mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 10:31:55 +00:00
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:
parent
5cea960784
commit
d1f464c5e3
4 changed files with 36 additions and 32 deletions
17
ChangeLog
17
ChangeLog
|
@ -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>
|
Sun Jul 25 11:40:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/GSTextStorage.m: Modified ([-setAttributes:range:]) and
|
* Source/GSTextStorage.m: Modified ([-setAttributes:range:]) and
|
||||||
|
|
|
@ -407,13 +407,13 @@ _attributesAtIndexEffectiveRange(
|
||||||
INSOBJECT(info, arrayIndex);
|
INSOBJECT(info, arrayIndex);
|
||||||
RELEASE(info);
|
RELEASE(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* post changes */
|
||||||
* Keep track of changes.
|
|
||||||
*/
|
|
||||||
[self edited: NSTextStorageEditedAttributes
|
[self edited: NSTextStorageEditedAttributes
|
||||||
range: range
|
range: range
|
||||||
changeinlength: 0];
|
changeInLength: 0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) replaceCharactersInRange: (NSRange)range
|
- (void) replaceCharactersInRange: (NSRange)range
|
||||||
|
@ -487,12 +487,12 @@ changeinlength: 0];
|
||||||
}
|
}
|
||||||
[textChars replaceCharactersInRange: range withString: aString];
|
[textChars replaceCharactersInRange: range withString: aString];
|
||||||
|
|
||||||
/*
|
/* notify of changes */
|
||||||
* Keep track of changes.
|
|
||||||
*/
|
|
||||||
[self edited: NSTextStorageEditedCharacters
|
[self edited: NSTextStorageEditedCharacters
|
||||||
range: range
|
range: range
|
||||||
changeinlength: aLength - range.length];
|
changeInLength: [aString length] - range.length];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
|
|
@ -242,6 +242,10 @@ storage occured.");
|
||||||
|
|
||||||
- (NSRange)glyphRangeForTextContainer: (NSTextContainer *)aTextContainer
|
- (NSRange)glyphRangeForTextContainer: (NSTextContainer *)aTextContainer
|
||||||
{
|
{
|
||||||
|
NSSize tcSize = [aTextContainer containerSize];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return NSMakeRange(0, 0);
|
return NSMakeRange(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,27 +91,6 @@ static Class concrete;
|
||||||
changeInLength: [attributedString length] - aRange.length];
|
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
|
* Managing NSLayoutManagers
|
||||||
*/
|
*/
|
||||||
|
@ -156,6 +135,9 @@ changeInLength: 0];
|
||||||
*/
|
*/
|
||||||
- (void) edited: (unsigned)mask range: (NSRange)old changeInLength: (int)delta
|
- (void) edited: (unsigned)mask range: (NSRange)old changeInLength: (int)delta
|
||||||
{
|
{
|
||||||
|
|
||||||
|
NSLog(@"edited:range:changeInLength: called");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add in any new flags for this edit.
|
* Add in any new flags for this edit.
|
||||||
*/
|
*/
|
||||||
|
@ -184,7 +166,8 @@ changeInLength: 0];
|
||||||
{
|
{
|
||||||
if (delta < 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;
|
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);
|
editedRange = NSMakeRange(0, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue