Author: fredkiefer
Date: Sat Oct 25 19:59:36 2014
New Revision: 38134
URL: http://svn.gna.org/viewcvs/gnustep?rev=38134&view=rev
Log:
* Source/NSParagraphStyle.m,
* Source/NSTextList.m: Add keyed en-/decoding.
Modified:
libs/gui/trunk/ChangeLog
libs/gui/trunk/Source/NSParagraphStyle.m
libs/gui/trunk/Source/NSTextList.m
Modified: libs/gui/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38134&r1=38133&r2=38134&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog (original)
+++ libs/gui/trunk/ChangeLog Sat Oct 25 19:59:36 2014
@@ -1,3 +1,8 @@
+2014-10-25 Fred Kiefer <[email protected]>
+
+ * Source/NSParagraphStyle.m,
+ * Source/NSTextList.m: Add keyed en-/decoding.
+
2014-10-05 Fred Kiefer <[email protected]>
* TextConverters/RTF/rtfScanner.m: Add RTFfamilyBiDi.
Modified: libs/gui/trunk/Source/NSParagraphStyle.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSParagraphStyle.m?rev=38134&r1=38133&r2=38134&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSParagraphStyle.m (original)
+++ libs/gui/trunk/Source/NSParagraphStyle.m Sat Oct 25 19:59:36 2014
@@ -464,7 +464,12 @@
{
if ([aCoder allowsKeyedCoding])
{
- // TODO_NIB: Determine keys for NSParagraphStyle, if there are any.
+ _firstLineHeadIndent = [aCoder decodeFloatForKey:
@"NSFirstLineHeadIndent"];
+ _headIndent = [aCoder decodeFloatForKey: @"NSHeadIndent"];
+ _paragraphSpacing = [aCoder decodeFloatForKey:
@"NSParagraphSpacingBefore"];
+ ASSIGN(_tabStops, [aCoder decodeObjectForKey: @"NSTabStops"]);
+ ASSIGN(_textLists, [aCoder decodeObjectForKey: @"NSTextLists"]);
+ _baseDirection = [aCoder decodeIntForKey: @"NSWritingDirection"];
}
else
{
@@ -530,7 +535,12 @@
{
if ([aCoder allowsKeyedCoding])
{
- // TODO_NIB: Determine keys for NSParagraphStyle, if there are any.
+ [aCoder encodeFloat: _firstLineHeadIndent forKey:
@"NSFirstLineHeadIndent"];
+ [aCoder encodeFloat: _headIndent forKey: @"NSHeadIndent"];
+ [aCoder encodeFloat: _paragraphSpacing forKey:
@"NSParagraphSpacingBefore"];
+ [aCoder encodeObject: _tabStops forKey: @"NSTabStops"];
+ [aCoder encodeObject: _textLists forKey: @"NSTextLists"];
+ [aCoder encodeInt: _baseDirection forKey: @"NSWritingDirection"];
}
else
{
Modified: libs/gui/trunk/Source/NSTextList.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSTextList.m?rev=38134&r1=38133&r2=38134&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSTextList.m (original)
+++ libs/gui/trunk/Source/NSTextList.m Sat Oct 25 19:59:36 2014
@@ -47,7 +47,7 @@
- (void) dealloc;
{
RELEASE(_markerFormat);
- [super dealloc];
+ [super dealloc];
}
- (BOOL) isEqual: (id)anObject
@@ -77,7 +77,7 @@
- (NSString *) markerForItemNumber: (int)item
{
- NSMutableString *s = [_markerFormat mutableCopy];
+ NSMutableString *s = [_markerFormat mutableCopy];
unichar box = 0x25A1;
unichar check = 0x2713;
unichar circle = 0x25E6;
@@ -87,67 +87,67 @@
unichar square = 0x25A0;
// FIXME: Needs optimisation and roman numbers
- [s replaceOccurrencesOfString: @"{box}"
+ [s replaceOccurrencesOfString: @"{box}"
withString: [NSString stringWithCharacters: &box length: 1]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{check}"
+ [s replaceOccurrencesOfString: @"{check}"
withString: [NSString stringWithCharacters: &check length: 1]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{circle}"
+ [s replaceOccurrencesOfString: @"{circle}"
withString: [NSString stringWithCharacters: &circle length: 1]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{diamond}"
+ [s replaceOccurrencesOfString: @"{diamond}"
withString: [NSString stringWithCharacters: &diamond length: 1]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{disc}"
+ [s replaceOccurrencesOfString: @"{disc}"
withString: [NSString stringWithCharacters: &disc length: 1]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{hyphen}"
+ [s replaceOccurrencesOfString: @"{hyphen}"
withString: [NSString stringWithCharacters: &hyphen length: 1]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{square}"
+ [s replaceOccurrencesOfString: @"{square}"
withString: [NSString stringWithCharacters: &square length: 1]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{decimal}"
+ [s replaceOccurrencesOfString: @"{decimal}"
withString: [NSString stringWithFormat: @"%d", item]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{octal}"
+ [s replaceOccurrencesOfString: @"{octal}"
withString: [NSString stringWithFormat: @"%o", item]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{lower-hexadecimal}"
+ [s replaceOccurrencesOfString: @"{lower-hexadecimal}"
withString: [NSString stringWithFormat: @"%x", item]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{upper-hexadecimal}"
+ [s replaceOccurrencesOfString: @"{upper-hexadecimal}"
withString: [NSString stringWithFormat: @"%X", item]
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{lower-alpha}"
+ [s replaceOccurrencesOfString: @"{lower-alpha}"
withString: [NSString stringWithFormat: @"%c", item + 'a']
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{lower-latin}"
+ [s replaceOccurrencesOfString: @"{lower-latin}"
withString: [NSString stringWithFormat: @"%c", item + 'a']
options: 0
range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{upper-alpha}"
+ [s replaceOccurrencesOfString: @"{upper-alpha}"
withString: [NSString stringWithFormat: @"%c", item + 'A']
options: 0 range: NSMakeRange(0, [s length])];
- [s replaceOccurrencesOfString: @"{upper-latin}"
+ [s replaceOccurrencesOfString: @"{upper-latin}"
withString: [NSString stringWithFormat: @"%c", item + 'A']
options: 0
range: NSMakeRange(0, [s length])];
- return AUTORELEASE(s);
+ return AUTORELEASE(s);
}
- (id) copyWithZone: (NSZone*)zone
@@ -161,9 +161,12 @@
- (void) encodeWithCoder: (NSCoder*)aCoder
{
- // FIXME
if ([aCoder allowsKeyedCoding])
{
+ [aCoder encodeObject: _markerFormat
+ forKey: @"NSMarkerFormat"];
+ [aCoder encodeInt: _listOptions
+ forKey: @"NSOptions"];
}
else
{
@@ -172,9 +175,10 @@
- (id) initWithCoder: (NSCoder*)aDecoder
{
- // FIXME
if ([aDecoder allowsKeyedCoding])
{
+ ASSIGN(_markerFormat, [aDecoder decodeObjectForKey: @"NSMarkerFormat"]);
+ _listOptions = [aDecoder decodeIntForKey: @"NSOptions"];
}
else
{
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs