NSText/NSAttributedString alignLeft: and rtf
NSText/NSAttributedString alignLeft: and rtf
- Subject: NSText/NSAttributedString alignLeft: and rtf
- From: Tony Rennier <email@hidden>
- Date: Tue, 30 May 2006 16:47:45 -0400
I have a problem that I can't seem to futz my way through. I have
been working with a code base that dates back to the NeXT days trying
to correct a problem that was introduced with the release a Tiger. It
seems that the following commands all produce NSData objects
(streams) with any and all AlignLeft tags removed.
NSData *rtfData = [[myNSTextView RTFFromRange:NSMakeRange(0,
[[myNSTextView string] length])] copy];
NSData *rtfData = [[[myNSTextView textStorage]
dataFromRange:NSMakeRange(0, [[myNSTextView textStorage] length])
documentAttributes:[NSDictionary dictionaryWithObject:
NSRTFTextDocumentType forKey:@"DocumentType"]
error:NULL] copy];
NSData *webArchiveData = [[[myNSTextView textStorage]
dataFromRange:NSMakeRange(0, [[myNSTextView textStorage] length])
documentAttributes:[NSDictionary
dictionaryWithObject:NSWebArchiveTextDocumentType
forKey:@"DocumentType"]
error:NULL] copy];
NSData *wordMLData = [[[myNSTextView textStorage]
dataFromRange:NSMakeRange(0, [[myNSTextView textStorage] length])
documentAttributes:[NSDictionary dictionaryWithObject:
NSWordMLTextDocumentType forKey:@"DocumentType"]
error:NULL] copy];
NSData *htmlData = [[[myNSTextView textStorage]
dataFromRange:NSMakeRange(0, [[myNSTextView textStorage] length])
documentAttributes:[NSDictionary dictionaryWithObject:
NSHTMLTextDocumentType forKey:@"DocumentType"]
error:NULL] copy];
Where myNSTextView is a simple NSTextView with rich text some of
which is left justified.
AlignCenter and AlignRight tags come through as expected.
The original code, which worked fine before the release of Tiger, is
the first entry above.
Any ideas on what changed and how I can get this working again are
greatly appreciated.
Thanks,
- Tony
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden