mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 18:30:38 +00:00
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
This commit is contained in:
parent
db1b1d040c
commit
0d9f2c6dbe
1 changed files with 14 additions and 8 deletions
|
@ -136,7 +136,7 @@ Class converter_bundles(NSString *format, BOOL producer)
|
||||||
@selector(classForFormat:producer:)])
|
@selector(classForFormat:producer:)])
|
||||||
{
|
{
|
||||||
converter_class = (Class)[bclass classForFormat: format
|
converter_class = (Class)[bclass classForFormat: format
|
||||||
producer: producer];
|
producer: producer];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -585,7 +585,8 @@ documentAttributes: (NSDictionary **)dict
|
||||||
|
|
||||||
new = [converter_class(@"RTFD", NO)
|
new = [converter_class(@"RTFD", NO)
|
||||||
parseFile: wrapper
|
parseFile: wrapper
|
||||||
documentAttributes: dict];
|
documentAttributes: dict
|
||||||
|
class: [self class]];
|
||||||
// We do not return self but the newly created object
|
// We do not return self but the newly created object
|
||||||
RELEASE (self);
|
RELEASE (self);
|
||||||
return RETAIN (new);
|
return RETAIN (new);
|
||||||
|
@ -604,7 +605,8 @@ documentAttributes: (NSDictionary **)dict
|
||||||
|
|
||||||
new = [converter_class(@"RTFD", NO)
|
new = [converter_class(@"RTFD", NO)
|
||||||
parseData: data
|
parseData: data
|
||||||
documentAttributes: dict];
|
documentAttributes: dict
|
||||||
|
class: [self class]];
|
||||||
// We do not return self but the newly created object
|
// We do not return self but the newly created object
|
||||||
RELEASE (self);
|
RELEASE (self);
|
||||||
return RETAIN (new);
|
return RETAIN (new);
|
||||||
|
@ -623,7 +625,8 @@ documentAttributes: (NSDictionary **)dict
|
||||||
|
|
||||||
new = [converter_class(@"RTF", NO)
|
new = [converter_class(@"RTF", NO)
|
||||||
parseData: data
|
parseData: data
|
||||||
documentAttributes: dict];
|
documentAttributes: dict
|
||||||
|
class: [self class]];
|
||||||
// We do not return self but the newly created object
|
// We do not return self but the newly created object
|
||||||
RELEASE (self);
|
RELEASE (self);
|
||||||
return RETAIN (new);
|
return RETAIN (new);
|
||||||
|
@ -655,15 +658,17 @@ documentAttributes: (NSDictionary **)dict
|
||||||
documentAttributes: (NSDictionary *)dict
|
documentAttributes: (NSDictionary *)dict
|
||||||
{
|
{
|
||||||
return [converter_class(@"RTF", YES)
|
return [converter_class(@"RTF", YES)
|
||||||
produceDataFrom: [self attributedSubstringFromRange: range]
|
produceDataFrom:
|
||||||
|
[self attributedSubstringFromRange: range]
|
||||||
documentAttributes: dict];
|
documentAttributes: dict];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSData *) RTFDFromRange: (NSRange)range
|
- (NSData *) RTFDFromRange: (NSRange)range
|
||||||
documentAttributes: (NSDictionary *)dict
|
documentAttributes: (NSDictionary *)dict
|
||||||
{
|
{
|
||||||
return [converter_class(@"RTFD", YES)
|
return [converter_class(@"RTFD", YES)
|
||||||
produceDataFrom: [self attributedSubstringFromRange: range]
|
produceDataFrom:
|
||||||
|
[self attributedSubstringFromRange: range]
|
||||||
documentAttributes: dict];
|
documentAttributes: dict];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -671,7 +676,8 @@ documentAttributes: (NSDictionary **)dict
|
||||||
documentAttributes: (NSDictionary *)dict
|
documentAttributes: (NSDictionary *)dict
|
||||||
{
|
{
|
||||||
return [converter_class(@"RTFD", YES)
|
return [converter_class(@"RTFD", YES)
|
||||||
produceFileFrom: [self attributedSubstringFromRange: range]
|
produceFileFrom:
|
||||||
|
[self attributedSubstringFromRange: range]
|
||||||
documentAttributes: dict];
|
documentAttributes: dict];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue