mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-28 23:53:11 +00:00
Renamed methods to fit the GSTextConsumer protocol. Adopted to
changes in header. Perliminary implementation for RTFDConsumer. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10724 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
48d393c79e
commit
401c1a5f2b
1 changed files with 26 additions and 2 deletions
|
@ -225,7 +225,7 @@ readNSString (StringContext *ctxt)
|
|||
|
||||
@implementation RTFConsumer
|
||||
|
||||
+ (NSAttributedString*) parseRTFD: (NSFileWrapper *)wrapper
|
||||
+ (NSAttributedString*) parseFile: (NSFileWrapper *)wrapper
|
||||
documentAttributes: (NSDictionary **)dict
|
||||
{
|
||||
RTFConsumer *consumer = [RTFConsumer new];
|
||||
|
@ -255,7 +255,7 @@ readNSString (StringContext *ctxt)
|
|||
return text;
|
||||
}
|
||||
|
||||
+ (NSAttributedString*) parseRTF: (NSData *)rtfData
|
||||
+ (NSAttributedString*) parseData: (NSData *)rtfData
|
||||
documentAttributes: (NSDictionary **)dict
|
||||
{
|
||||
RTFConsumer *consumer = [RTFConsumer new];
|
||||
|
@ -292,6 +292,30 @@ readNSString (StringContext *ctxt)
|
|||
|
||||
@end
|
||||
|
||||
@implementation RTFDConsumer
|
||||
|
||||
+ (NSAttributedString*) parseFile: (NSFileWrapper *)wrapper
|
||||
documentAttributes: (NSDictionary **)dict
|
||||
{
|
||||
return [super parseFile: wrapper
|
||||
documentAttributes: dict];
|
||||
}
|
||||
|
||||
+ (NSAttributedString*) parseData: (NSData *)rtfData
|
||||
documentAttributes: (NSDictionary **)dict
|
||||
{
|
||||
NSAttributedString *str;
|
||||
NSFileWrapper *wrapper = [[NSFileWrapper alloc]
|
||||
initWithSerializedRepresentation: rtfData];
|
||||
|
||||
str = [self parseFile: wrapper documentAttributes: dict];
|
||||
RELEASE (wrapper);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation RTFConsumer (Private)
|
||||
|
||||
- (NSDictionary*) documentAttributes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue