Small fixes to text network.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4648 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Michael Silva 1999-07-25 20:49:08 +00:00
parent c36401836d
commit f1001c574f
4 changed files with 36 additions and 32 deletions

View file

@ -1,3 +1,20 @@
1999-07-25 Michael Hanni <mhanni@sprintmail.com>
* Source/NSTextStorage.m: removed excess calls to
edited:range:changeInLength. Also changed on line 191 from > to
>=. Not sure the complete implications, but alas it now works
correctly.
Try gstextnetwork.app, you'll see a lot of debug information.
After that has cleared click twice in the textView and press a
key. You will see the textStorage buffer. You should see the word
'eek' close to the top, that would be from a replaceCharacters in
range edit, and you should also notice that some 500 characters
are missing from the middle, that would be from the
deleteCharactersInRange edit. It seems that the text network is
working slightly on the flip side, now all we need is some
drawing code to help make sense of all this. ;-)
Sun Jul 25 11:40:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/GSTextStorage.m: Modified ([-setAttributes:range:]) and

View file

@ -407,13 +407,13 @@ _attributesAtIndexEffectiveRange(
INSOBJECT(info, arrayIndex);
RELEASE(info);
}
/*
* Keep track of changes.
*/
/* post changes */
[self edited: NSTextStorageEditedAttributes
range: range
changeinlength: 0];
changeInLength: 0];
}
- (void) replaceCharactersInRange: (NSRange)range
@ -487,12 +487,12 @@ changeinlength: 0];
}
[textChars replaceCharactersInRange: range withString: aString];
/*
* Keep track of changes.
*/
/* notify of changes */
[self edited: NSTextStorageEditedCharacters
range: range
changeinlength: aLength - range.length];
changeInLength: [aString length] - range.length];
}
- (void) dealloc

View file

@ -242,6 +242,10 @@ storage occured.");
- (NSRange)glyphRangeForTextContainer: (NSTextContainer *)aTextContainer
{
NSSize tcSize = [aTextContainer containerSize];
return NSMakeRange(0, 0);
}

View file

@ -91,27 +91,6 @@ static Class concrete;
changeInLength: [attributedString length] - aRange.length];
}
- (void) replaceCharactersInRange: (NSRange)aRange
withString: (NSString*)aString
{
[super replaceCharactersInRange: aRange
withString: aString];
[self edited: NSTextStorageEditedCharacters
range: aRange
changeInLength: [aString length] - aRange.length];
}
- (void) setAttributes: (NSDictionary*)attributes
range: (NSRange)aRange
{
[super setAttributes: attributes
range: aRange];
[self edited: NSTextStorageEditedAttributes
range: aRange
changeInLength: 0];
}
/*
* Managing NSLayoutManagers
*/
@ -156,6 +135,9 @@ changeInLength: 0];
*/
- (void) edited: (unsigned)mask range: (NSRange)old changeInLength: (int)delta
{
NSLog(@"edited:range:changeInLength: called");
/*
* Add in any new flags for this edit.
*/
@ -184,7 +166,8 @@ changeInLength: 0];
{
if (delta < 0)
{
NSAssert(old.length > -delta, NSInvalidArgumentException);
// FIXME: this was > not >=, is that going to be a problem?
NSAssert(old.length >= -delta, NSInvalidArgumentException);
}
editedDelta += delta;
}
@ -236,7 +219,7 @@ changeInLength: 0];
}
/*
* Why are we resetting the values?
* edited values reset to be used again in the next pass.
*/
editedRange = NSMakeRange(0, 0);