From 3bec617bda8cf543172a4da338e341b34ba8b057 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Wed, 12 Dec 2007 16:45:44 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1298 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 10 +++ UI/MailPartViewers/UIxMailPartHTMLViewer.m | 12 +++- UI/MailPartViewers/UIxMailRenderingContext.h | 7 -- UI/MailPartViewers/UIxMailRenderingContext.m | 67 ++------------------ 4 files changed, 25 insertions(+), 71 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1885e35..ab8ee20d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-12-12 Ludovic Marcotte + + * UI/MailPartViewers/UIxMailRenderingContext.{h,m} + Removed template caching which added very little + and created re-entrant issues. + + * UI/MailPartViewers/UIxMailPartHTMLViewer.m + Added a hack (and stated so in the source file) + to avoid what seems to be a bug in libxml. + 2007-12-12 Wolfgang Sourdeau * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject diff --git a/UI/MailPartViewers/UIxMailPartHTMLViewer.m b/UI/MailPartViewers/UIxMailPartHTMLViewer.m index 50f79391..6644e30f 100644 --- a/UI/MailPartViewers/UIxMailPartHTMLViewer.m +++ b/UI/MailPartViewers/UIxMailPartHTMLViewer.m @@ -298,8 +298,6 @@ - (void) characters: (unichar *) _chars length: (int) _len { - NSString *tmpString; - showWhoWeAre(); if (!inScript) { @@ -307,8 +305,16 @@ [self _appendStyle: _chars length: _len]; else if (inBody) { + NSString *tmpString; + tmpString = [NSString stringWithCharacters: _chars length: _len]; - [result appendString: [tmpString stringByEscapingHTMLString]]; + + // HACK: This is to avoid appending the useless junk in the tag + // that Outlook adds. It seems to confuse the XML parser for + // forwarded messages as we get this in the _body_ of the email + // while we really aren't in it! + if (![tmpString hasPrefix: @" xmlns:v=\"urn:schemas-microsoft-com:vml\""]) + [result appendString: [tmpString stringByEscapingHTMLString]]; } } } diff --git a/UI/MailPartViewers/UIxMailRenderingContext.h b/UI/MailPartViewers/UIxMailRenderingContext.h index 5817816a..1ac62538 100644 --- a/UI/MailPartViewers/UIxMailRenderingContext.h +++ b/UI/MailPartViewers/UIxMailRenderingContext.h @@ -43,13 +43,6 @@ WOComponent *viewer; /* non-retained! */ WOContext *context; /* non-retained! */ NSDictionary *flatContents; /* IMAP4 name to NSData */ - - WOComponent *textViewer; - WOComponent *imageViewer; - WOComponent *linkViewer; - WOComponent *messageViewer; - WOComponent *iCalViewer; - WOComponent *htmlViewer; } - (id) initWithViewer: (WOComponent *) _viewer diff --git a/UI/MailPartViewers/UIxMailRenderingContext.m b/UI/MailPartViewers/UIxMailRenderingContext.m index 0ed6f0bb..5e275adf 100644 --- a/UI/MailPartViewers/UIxMailRenderingContext.m +++ b/UI/MailPartViewers/UIxMailRenderingContext.m @@ -72,32 +72,13 @@ static BOOL showNamedTextAttachmentsInline = NO; - (void) dealloc { [flatContents release]; - [iCalViewer release]; - [htmlViewer release]; - [textViewer release]; - [imageViewer release]; - [linkViewer release]; - [messageViewer release]; [super dealloc]; } - (void) reset { [flatContents release]; - [iCalViewer release]; - [htmlViewer release]; - [textViewer release]; - [imageViewer release]; - [linkViewer release]; - [messageViewer release]; - flatContents = nil; - iCalViewer = nil; - textViewer = nil; - imageViewer = nil; - htmlViewer = nil; - linkViewer = nil; - messageViewer = nil; } /* fetching */ @@ -151,68 +132,32 @@ static BOOL showNamedTextAttachmentsInline = NO; - (WOComponent *) textViewer { - if (!textViewer) - { - textViewer = [viewer pageWithName: @"UIxMailPartTextViewer"]; - [textViewer retain]; - } - - return textViewer; + return [viewer pageWithName: @"UIxMailPartTextViewer"]; } - (WOComponent *) imageViewer { - if (!imageViewer) - { - imageViewer = [viewer pageWithName: @"UIxMailPartImageViewer"]; - [imageViewer retain]; - } - - return imageViewer; + return [viewer pageWithName: @"UIxMailPartImageViewer"]; } - (WOComponent *) linkViewer { - if (!linkViewer) - { - linkViewer = [viewer pageWithName: @"UIxMailPartLinkViewer"]; - [linkViewer retain]; - } - - return linkViewer; + return [viewer pageWithName: @"UIxMailPartLinkViewer"]; } - (WOComponent *) htmlViewer { - if (!htmlViewer) - { - htmlViewer = [viewer pageWithName: @"UIxMailPartHTMLViewer"]; - [htmlViewer retain]; - } - - return htmlViewer; + return [viewer pageWithName: @"UIxMailPartHTMLViewer"]; } - (WOComponent *) messageViewer { - if (!messageViewer) - { - messageViewer = [viewer pageWithName: @"UIxMailPartMessageViewer"]; - [messageViewer retain]; - } - - return messageViewer; + return [viewer pageWithName: @"UIxMailPartMessageViewer"]; } - (WOComponent *) iCalViewer { - if (!iCalViewer) - { - iCalViewer = [viewer pageWithName: @"UIxMailPartICalViewer"]; - [iCalViewer retain]; - } - - return iCalViewer; + return [viewer pageWithName: @"UIxMailPartICalViewer"]; } /* Kolab viewers */ -- 2.39.5