mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
iFix in describing strings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7455 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
32fa5ad3e8
commit
122b12a894
3 changed files with 7 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
* Source/NSGString.m: Removed obsolete methods and added range checks.
|
||||
* Source/NSGCString.m: ditto.
|
||||
* Source/NSAttributedString.m: Fix fencepost error in -description.
|
||||
|
||||
2000-09-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -191,7 +191,8 @@ static Class NSMutableAttributedString_concrete_class;
|
|||
NSMutableString *desc;
|
||||
|
||||
desc = AUTORELEASE([[super description] mutableCopy]);
|
||||
while (index <= length &&
|
||||
[desc appendFormat: @" Length: %u", length];
|
||||
while (index < length &&
|
||||
(attrs = [self attributesAtIndex: index effectiveRange: &r]) != nil)
|
||||
{
|
||||
index = NSMaxRange(r);
|
||||
|
|
|
@ -42,6 +42,7 @@ NSString *NSBackgroundColorAttributeName = @"NSBackgroundColor";
|
|||
|
||||
void printAttrString(NSAttributedString *attrStr)
|
||||
{
|
||||
#if 0
|
||||
NSDictionary *tmpAttrDict;
|
||||
NSEnumerator *keyEnumerator;
|
||||
NSString *tmpStr;
|
||||
|
@ -63,6 +64,9 @@ void printAttrString(NSAttributedString *attrStr)
|
|||
(long)effectiveRange.location,
|
||||
(long)effectiveRange.length);
|
||||
}
|
||||
#else
|
||||
printf("%s\n", [[attrStr description] cString]);
|
||||
#endif
|
||||
}
|
||||
|
||||
void testAttributedString(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue