mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Fixed problems with no text container being set ... typically happening
early during initialization git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12481 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ae95ed3ec9
commit
435e2fe226
1 changed files with 13 additions and 8 deletions
|
@ -760,8 +760,16 @@ _Sane(NSLayoutManager *lm)
|
|||
|
||||
[_textContainers removeObjectAtIndex: index];
|
||||
_textContainersCount--;
|
||||
_firstTextView = [(NSTextContainer *)[_textContainers objectAtIndex: 0]
|
||||
textView];
|
||||
if (_textContainersCount > 0)
|
||||
{
|
||||
_firstTextView = [(NSTextContainer *)[_textContainers objectAtIndex: 0]
|
||||
textView];
|
||||
}
|
||||
else
|
||||
{
|
||||
_firstTextView = nil;
|
||||
}
|
||||
|
||||
for (i = 0; i < _textContainersCount; i++)
|
||||
{
|
||||
NSTextView *tv = [[_textContainers objectAtIndex: i] textView];
|
||||
|
@ -1968,7 +1976,7 @@ _Sane(self);
|
|||
effectiveRange: (NSRange*)effectiveRange
|
||||
{
|
||||
/* TODO */
|
||||
return [_textContainers objectAtIndex: 0];
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -2448,10 +2456,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
|
||||
- (NSTextView*) firstTextView
|
||||
{
|
||||
return [[_textContainers objectAtIndex: 0] textView];
|
||||
/* WARNING: Uncommenting the following makes initialization
|
||||
with the other text objects more difficult. */
|
||||
// return _firstTextView;
|
||||
return _firstTextView;
|
||||
}
|
||||
|
||||
// This method is special in that it won't cause layout if the
|
||||
|
@ -2459,7 +2464,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
// that this method could be done through other API.
|
||||
- (NSTextView*) textViewForBeginningOfSelection
|
||||
{
|
||||
return NULL;
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue