Add remaining changes contributed by testplant.

This commit is contained in:
Gregory John Casamento 2021-10-27 15:18:23 -04:00
parent ac5b949f2a
commit 7023c7d06d
8 changed files with 43 additions and 16 deletions

View file

@ -123,7 +123,8 @@ static NSImage *_pbc_image[5];
[self _initMenu];
[self setPullsDown: flag];
_pbcFlags.usesItemFromMenu = YES;
[self setAltersStateOfSelectedItem: YES];
[self setUsesItemFromMenu: YES];
[self setPreferredEdge: NSMaxYEdge];
[self setArrowPosition: NSPopUpArrowAtCenter];

View file

@ -570,6 +570,10 @@
ASSIGN(_items, [aDecoder decodeObjectForKey: @"NSTabViewItems"]);
[_items makeObjectsPerformSelector: @selector(_setTabView:) withObject: self];
}
else
{
ASSIGN(_items, [NSMutableArray array]);
}
if ([aDecoder containsValueForKey: @"NSSelectedTabViewItem"])
{
// N.B.: As a side effect, this discards the subview frame

View file

@ -96,12 +96,12 @@ use bounds rectangle instead of frame? */
NSDebugLLog(@"NSText", @"NSTextContainer initWithContainerSize");
if (aSize.width < 0)
{
NSWarnMLog(@"given negative width");
NSWarnMLog(@"given negative width: %f current: %f", aSize.width, _containerRect.size.width);
aSize.width = 0;
}
if (aSize.height < 0)
{
NSWarnMLog(@"given negative height");
NSWarnMLog(@"given negative height: %f current: %f", aSize.height, _containerRect.size.height);
aSize.height = 0;
}
_layoutManager = nil;
@ -246,12 +246,12 @@ framework intact.
if (aSize.width < 0)
{
NSWarnMLog(@"given negative width");
NSWarnMLog(@"given negative width: %f current: %f", aSize.width, _containerRect.size.width);
aSize.width = 0;
}
if (aSize.height < 0)
{
NSWarnMLog(@"given negative height");
NSWarnMLog(@"given negative height: %f current: %f", aSize.height, _containerRect.size.height);
aSize.height = 0;
}

View file

@ -134,7 +134,7 @@ static Class textFieldCellClass;
*/
- (BOOL) isSelectable
{
return [_cell isSelectable];
return [_cell isSelectable] && [self isEnabled];
}
/** <p>Sets whether the NSTextField's cell and the NSText object is editable.

View file

@ -250,10 +250,10 @@
NSAttributedString *attrStr;
attrStr = [super _drawAttributedString];
if (attrStr == nil)
if ((attrStr == nil) || ([[attrStr string] length] == 0))
{
attrStr = [self placeholderAttributedString];
if (attrStr == nil)
if ((attrStr == nil) || ([[attrStr string] length] == 0))
{
NSString *string;
NSDictionary *attributes;
@ -286,6 +286,14 @@
}
}
- (void) _updateFieldEditor: (NSText*)textObject
{
[super _updateFieldEditor: textObject];
[textObject setDrawsBackground: _textfieldcell_draws_background];
[textObject setBackgroundColor: _background_color];
[textObject setTextColor: _text_color];
}
- (BOOL) isOpaque
{
if (_textfieldcell_draws_background == NO

View file

@ -6466,13 +6466,15 @@ or add guards
- (void) _scheduleTextCheckingTimer
{
[_textCheckingTimer invalidate];
_textCheckingTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5
target: self
selector: @selector(_textCheckingTimerFired:)
userInfo: [NSValue valueWithRect: [self visibleRect]]
repeats: NO];
if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSDisableSpellCheckerServer"] == NO)
{
[_textCheckingTimer invalidate];
_textCheckingTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5
target: self
selector: @selector(_textCheckingTimerFired:)
userInfo: [NSValue valueWithRect: [self visibleRect]]
repeats: NO];
}
}
- (void) _scheduleTextCheckingInVisibleRectIfNeeded

View file

@ -282,7 +282,8 @@
* Apple's implementation doesn't seem to deal with this case, and
* crashes if isReleaseWhenClosed is set.
*/
RETAIN(_window);
if ([_window isReleasedWhenClosed])
RETAIN(_window);
[self setWindow: nil];
[_document _removeWindowController: self];