Make sure the text network stays synchronized when one part changes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15760 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-01-29 20:19:01 +00:00
parent 5580ccd32c
commit 6d9a9c890c
3 changed files with 30 additions and 1 deletions

View file

@ -1,3 +1,14 @@
2003-01-29 21:14 Alexander Malmberg <alexander@malmberg.org>
* Source/GSLayoutManager.m (-setTextStorage:): Tell our text
containers about the change.
* Source/NSTextContainer.m (-setLayoutManager:): Tell our text view
about the change.
* Source/NSTextView.m: Guard in a few places where _layoutManager
might be nil.
2003-01-29 16:01 Alexander Malmberg <alexander@malmberg.org>
* Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Place

View file

@ -1991,8 +1991,14 @@ forStartOfGlyphRange: (NSRange)glyphRange
* more for internal use by the text system.
* Invalidates the entire layout (should it??)
*/
/*
See [NSTextView -setTextContainer:] for more information about these calls.
*/
- (void) setTextStorage: (NSTextStorage *)aTextStorage
{
int i;
textcontainer_t *tc;
[self _invalidateEverything];
/*
@ -2001,7 +2007,14 @@ forStartOfGlyphRange: (NSRange)glyphRange
*/
_textStorage = aTextStorage;
/* TODO: tell all the text containers about that change! */
/*
We send this message to all text containers so they can respond to the
change (most importantly to let them tell their text views).
*/
for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++)
{
[tc->textContainer setLayoutManager: self];
}
}
/**

View file

@ -118,11 +118,16 @@ use bounds rectangle instead of frame? */
[super dealloc];
}
/*
See [NSTextView -setTextContainer:] for more information about these calls.
*/
- (void) setLayoutManager: (GSLayoutManager*)aLayoutManager
{
/* The layout manager owns us - so he retains us and we don't retain
him. */
_layoutManager = aLayoutManager;
/* Tell our text view about the change. */
[_textView setTextContainer: self];
}
- (GSLayoutManager*) layoutManager