From 0d9f2c6dbe9ed4c3a35952b189a954ec6c3e9139 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Tue, 11 Jun 2002 14:59:51 +0000 Subject: [PATCH] When parsing RTF (or other formats) require the generated attributed string to be of the appropriate class git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13841 72102866-910b-0410-8b05-ffd578937521 --- Source/NSAttributedString.m | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Source/NSAttributedString.m b/Source/NSAttributedString.m index 73fc6cb87..decfc060c 100644 --- a/Source/NSAttributedString.m +++ b/Source/NSAttributedString.m @@ -136,7 +136,7 @@ Class converter_bundles(NSString *format, BOOL producer) @selector(classForFormat:producer:)]) { converter_class = (Class)[bclass classForFormat: format - producer: producer]; + producer: producer]; } else { @@ -585,7 +585,8 @@ documentAttributes: (NSDictionary **)dict new = [converter_class(@"RTFD", NO) parseFile: wrapper - documentAttributes: dict]; + documentAttributes: dict + class: [self class]]; // We do not return self but the newly created object RELEASE (self); return RETAIN (new); @@ -604,7 +605,8 @@ documentAttributes: (NSDictionary **)dict new = [converter_class(@"RTFD", NO) parseData: data - documentAttributes: dict]; + documentAttributes: dict + class: [self class]]; // We do not return self but the newly created object RELEASE (self); return RETAIN (new); @@ -623,7 +625,8 @@ documentAttributes: (NSDictionary **)dict new = [converter_class(@"RTF", NO) parseData: data - documentAttributes: dict]; + documentAttributes: dict + class: [self class]]; // We do not return self but the newly created object RELEASE (self); return RETAIN (new); @@ -655,15 +658,17 @@ documentAttributes: (NSDictionary **)dict documentAttributes: (NSDictionary *)dict { return [converter_class(@"RTF", YES) - produceDataFrom: [self attributedSubstringFromRange: range] + produceDataFrom: + [self attributedSubstringFromRange: range] documentAttributes: dict]; } - (NSData *) RTFDFromRange: (NSRange)range - documentAttributes: (NSDictionary *)dict + documentAttributes: (NSDictionary *)dict { return [converter_class(@"RTFD", YES) - produceDataFrom: [self attributedSubstringFromRange: range] + produceDataFrom: + [self attributedSubstringFromRange: range] documentAttributes: dict]; } @@ -671,7 +676,8 @@ documentAttributes: (NSDictionary **)dict documentAttributes: (NSDictionary *)dict { return [converter_class(@"RTFD", YES) - produceFileFrom: [self attributedSubstringFromRange: range] + produceFileFrom: + [self attributedSubstringFromRange: range] documentAttributes: dict]; }