mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 05:10:47 +00:00
Renamed methods to fit the GSTextProducer protocol. Adopted to
changes in header. Implementation for RTFProducer. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10722 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1829333edf
commit
c692062b18
1 changed files with 35 additions and 16 deletions
|
@ -40,7 +40,7 @@
|
||||||
|
|
||||||
#define points2twips(a) ((a)*20.0)
|
#define points2twips(a) ((a)*20.0)
|
||||||
|
|
||||||
@interface RTFProducer (Private)
|
@interface RTFDProducer (Private)
|
||||||
|
|
||||||
- (NSString*) headerString;
|
- (NSString*) headerString;
|
||||||
- (NSString*) trailerString;
|
- (NSString*) trailerString;
|
||||||
|
@ -49,12 +49,12 @@
|
||||||
documentAttributes: (NSDictionary*)dict;
|
documentAttributes: (NSDictionary*)dict;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation RTFProducer
|
@implementation RTFDProducer
|
||||||
|
|
||||||
+ (NSFileWrapper*) produceRTFD: (NSAttributedString*) aText
|
+ (NSFileWrapper*) produceFileFrom: (NSAttributedString*) aText
|
||||||
documentAttributes: (NSDictionary*)dict
|
documentAttributes: (NSDictionary*)dict
|
||||||
{
|
{
|
||||||
RTFProducer *new = [self new];
|
RTFDProducer *new = [self new];
|
||||||
NSData *data;
|
NSData *data;
|
||||||
NSFileWrapper *wrapper;
|
NSFileWrapper *wrapper;
|
||||||
|
|
||||||
|
@ -82,17 +82,11 @@
|
||||||
return AUTORELEASE(wrapper);
|
return AUTORELEASE(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSData*) produceRTF: (NSAttributedString*) aText
|
+ (NSData*) produceDataFrom: (NSAttributedString*) aText
|
||||||
documentAttributes: (NSDictionary*)dict
|
documentAttributes: (NSDictionary*)dict
|
||||||
{
|
{
|
||||||
RTFProducer *new = [self new];
|
return [[self produceFileFrom: aText
|
||||||
NSData *data;
|
documentAttributes: dict] serializedRepresentation];
|
||||||
|
|
||||||
data = [[new RTFDStringFromAttributedString: aText
|
|
||||||
documentAttributes: dict]
|
|
||||||
dataUsingEncoding: NSISOLatin1StringEncoding];
|
|
||||||
RELEASE(new);
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)init
|
- (id)init
|
||||||
|
@ -129,7 +123,32 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation RTFProducer (Private)
|
@implementation RTFProducer
|
||||||
|
|
||||||
|
+ (NSData*) produceDataFrom: (NSAttributedString*) aText
|
||||||
|
documentAttributes: (NSDictionary*)dict
|
||||||
|
{
|
||||||
|
RTFProducer *new = [self new];
|
||||||
|
NSData *data;
|
||||||
|
|
||||||
|
data = [[new RTFDStringFromAttributedString: aText
|
||||||
|
documentAttributes: dict]
|
||||||
|
dataUsingEncoding: NSISOLatin1StringEncoding];
|
||||||
|
RELEASE(new);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSFileWrapper*) produceFileFrom: (NSAttributedString*) aText
|
||||||
|
documentAttributes: (NSDictionary*)dict
|
||||||
|
{
|
||||||
|
return [[NSFileWrapper alloc] initRegularFileWithContents:
|
||||||
|
[self produceDataFrom: aText
|
||||||
|
documentAttributes: dict]];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation RTFDProducer (Private)
|
||||||
|
|
||||||
- (NSString*) fontTable
|
- (NSString*) fontTable
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue