Set the icon of the file wrapper to the image.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29223 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2010-01-06 21:37:47 +00:00
parent 212696a5f8
commit 8d53fe7507
2 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2010-01-06 Fred Kiefer <FredKiefer@gmx.de>
* TextConverters/RTF/RTFConsumer.m (RTFDConsumer-appendImage:):
Set the icon of the file wrapper to the image.
2010-01-05 Fred Kiefer <FredKiefer@gmx.de>
* TextConverters/RTF/RTFConsumer.m (-parseRTF:...class:): Try to

View file

@ -451,13 +451,16 @@ static BOOL classInheritsFromNSMutableAttributedString (Class c)
if (wrapper != nil)
{
NSImage* image = [[NSImage alloc] initWithData: [wrapper regularFileContents]];
NSTextAttachmentCell* attachedCell = [[NSTextAttachmentCell alloc] initImageCell: image];
NSTextAttachment* attachment = [[NSTextAttachment alloc] initWithFileWrapper: wrapper];
NSTextAttachment* attachment;
RTFAttribute* attr = [self attr];
NSMutableDictionary* attributes = nil;
NSMutableAttributedString* str = nil;
[attachment setAttachmentCell: attachedCell];
if (image != nil)
{
[wrapper setIcon: image];
}
attachment = [[NSTextAttachment alloc] initWithFileWrapper: wrapper];
attributes = [[NSMutableDictionary alloc]
initWithObjectsAndKeys:
@ -474,7 +477,6 @@ static BOOL classInheritsFromNSMutableAttributedString (Class c)
RELEASE(attributes);
RELEASE(attachment);
RELEASE(attachedCell);
RELEASE(image);
}
}