mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 07:10:59 +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
f5320a793f
commit
3a6b867d04
1 changed files with 13 additions and 8 deletions
|
@ -760,8 +760,16 @@ _Sane(NSLayoutManager *lm)
|
||||||
|
|
||||||
[_textContainers removeObjectAtIndex: index];
|
[_textContainers removeObjectAtIndex: index];
|
||||||
_textContainersCount--;
|
_textContainersCount--;
|
||||||
|
if (_textContainersCount > 0)
|
||||||
|
{
|
||||||
_firstTextView = [(NSTextContainer *)[_textContainers objectAtIndex: 0]
|
_firstTextView = [(NSTextContainer *)[_textContainers objectAtIndex: 0]
|
||||||
textView];
|
textView];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_firstTextView = nil;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < _textContainersCount; i++)
|
for (i = 0; i < _textContainersCount; i++)
|
||||||
{
|
{
|
||||||
NSTextView *tv = [[_textContainers objectAtIndex: i] textView];
|
NSTextView *tv = [[_textContainers objectAtIndex: i] textView];
|
||||||
|
@ -1968,7 +1976,7 @@ _Sane(self);
|
||||||
effectiveRange: (NSRange*)effectiveRange
|
effectiveRange: (NSRange*)effectiveRange
|
||||||
{
|
{
|
||||||
/* TODO */
|
/* TODO */
|
||||||
return [_textContainers objectAtIndex: 0];
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2448,10 +2456,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
||||||
|
|
||||||
- (NSTextView*) firstTextView
|
- (NSTextView*) firstTextView
|
||||||
{
|
{
|
||||||
return [[_textContainers objectAtIndex: 0] textView];
|
return _firstTextView;
|
||||||
/* WARNING: Uncommenting the following makes initialization
|
|
||||||
with the other text objects more difficult. */
|
|
||||||
// return _firstTextView;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method is special in that it won't cause layout if the
|
// 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.
|
// that this method could be done through other API.
|
||||||
- (NSTextView*) textViewForBeginningOfSelection
|
- (NSTextView*) textViewForBeginningOfSelection
|
||||||
{
|
{
|
||||||
return NULL;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue