Additional merges with GUI main branch revision 39320: Source/NSLayoutManager.m Source/NSTextView.m

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@39330 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2016-02-02 23:26:13 +00:00
parent 1232765f08
commit a856194aba
2 changed files with 10 additions and 18 deletions

View file

@ -2639,7 +2639,7 @@ this file describes this.
if (!layout_char)
new_last_glyph = 0;
else if (layout_char == [_textStorage length])
else if (layout_char >= [_textStorage length])
new_last_glyph = [self numberOfGlyphs];
else
new_last_glyph = [self glyphRangeForCharacterRange: NSMakeRange(layout_char, 1)

View file

@ -5178,27 +5178,23 @@ overridden version does not.
ret = [pboard setString: [[self string] substringWithRange: _layoutManager->_selected_range]
forType: NSStringPboardType];
}
if ([type isEqualToString: NSRTFPboardType])
else if ([type isEqualToString: NSRTFPboardType])
{
ret = [pboard setData: [self RTFFromRange: _layoutManager->_selected_range]
forType: NSRTFPboardType];
}
if ([type isEqualToString: NSRTFDPboardType])
else if ([type isEqualToString: NSRTFDPboardType])
{
ret = [pboard setData: [self RTFDFromRange: _layoutManager->_selected_range]
forType: NSRTFDPboardType];
}
if ([type isEqualToString: NSSmartPastePboardType] &&
else if ([type isEqualToString: NSSmartPastePboardType] &&
[self selectionGranularity] == NSSelectByWord)
{
ret = [pboard setData: [NSData data]
forType: NSSmartPastePboardType];
}
if ([type isEqualToString: NSColorPboardType])
else if ([type isEqualToString: NSColorPboardType])
{
NSColor *color;
@ -5211,30 +5207,26 @@ overridden version does not.
ret = YES;
}
}
if ([type isEqualToString: NSFontPboardType])
else if ([type isEqualToString: NSFontPboardType])
{
NSDictionary *dict;
dict = [_textStorage fontAttributesInRange: _layoutManager->_selected_range];
if (dict != nil)
{
[pboard setData: [NSArchiver archivedDataWithRootObject: dict]
ret = [pboard setData: [NSArchiver archivedDataWithRootObject: dict]
forType: NSFontPboardType];
ret = YES;
}
}
if ([type isEqualToString: NSRulerPboardType])
else if ([type isEqualToString: NSRulerPboardType])
{
NSDictionary *dict;
dict = [_textStorage rulerAttributesInRange: _layoutManager->_selected_range];
if (dict != nil)
{
[pboard setData: [NSArchiver archivedDataWithRootObject: dict]
ret = [pboard setData: [NSArchiver archivedDataWithRootObject: dict]
forType: NSRulerPboardType];
ret = YES;
}
}
@ -5951,7 +5943,7 @@ static const NSInteger GSSpellingSuggestionMenuItemTag = 1;
NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker];
NSString *word = [[self string] substringWithRange: [self selectedRange]];
if ([sp checkSpellingOfString: word startingAt: 0].location != NSNotFound)
if (sp != nil && [sp checkSpellingOfString: word startingAt: 0].location != NSNotFound)
{
/*NSArray *guesses = [sp guessesForWordRange: wordRange
inString: [self string]