Apply change from Fred Kiefer (r38871) in [NSTextView validateUserInterfaceItem:].

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38874 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fox 2015-08-12 17:21:42 +00:00
parent 00e7aa5a61
commit e53c91a2fb

View file

@ -3216,21 +3216,36 @@ Scroll so that the beginning of the range is visible.
if ([self isEditable])
{
NSArray *types = nil;
NSPasteboard *pb = nil;
NSString *available;
if (sel_isEqual(action, @selector(paste:)))
types = [self readablePasteboardTypes];
{
types = [self readablePasteboardTypes];
pb = [NSPasteboard generalPasteboard];
}
else if (sel_isEqual(action, @selector(pasteAsPlainText:)))
types = [NSArray arrayWithObject: NSStringPboardType];
{
types = [NSArray arrayWithObject: NSStringPboardType];
pb = [NSPasteboard generalPasteboard];
}
else if (sel_isEqual(action, @selector(pasteAsRichText:)))
types = [NSArray arrayWithObject: NSRTFPboardType];
{
types = [NSArray arrayWithObject: NSRTFPboardType];
pb = [NSPasteboard generalPasteboard];
}
else if (sel_isEqual(action, @selector(pasteFont:)))
types = [NSArray arrayWithObject: NSFontPboardType];
{
types = [NSArray arrayWithObject: NSFontPboardType];
pb = [NSPasteboard pasteboardWithName: NSFontPboard];
}
else if (sel_isEqual(action, @selector(pasteRuler:)))
types = [NSArray arrayWithObject: NSRulerPboard];
{
types = [NSArray arrayWithObject: NSRulerPboard];
pb = [NSPasteboard pasteboardWithName: NSRulerPboard];
}
available = [[NSPasteboard generalPasteboard]
availableTypeFromArray: types];
available = [pb availableTypeFromArray: types];
return available != nil;
}
else