]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1298 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 12 Dec 2007 16:45:44 +0000 (16:45 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 12 Dec 2007 16:45:44 +0000 (16:45 +0000)
ChangeLog
UI/MailPartViewers/UIxMailPartHTMLViewer.m
UI/MailPartViewers/UIxMailRenderingContext.h
UI/MailPartViewers/UIxMailRenderingContext.m

index b1885e35573b66a1313a946d7f8e3ddea86ba8cb..ab8ee20da4dc3733ac72d7569797be157ae32a46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-12-12  Ludovic Marcotte <ludovic@inverse.ca>
+
+       * 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  <wsourdeau@inverse.ca>
 
        * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject
index 50f79391d77dd51b4e2013aa1e1b164e3fe674ab..6644e30ff3d9f4773b84d61523bd8b6471eea74f 100644 (file)
 - (void) characters: (unichar *) _chars
              length: (int) _len
 {
-  NSString *tmpString;
-
   showWhoWeAre();
   if (!inScript)
     {
         [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 <html> 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]];
         }
     }
 }
index 5817816ae7f470d525aabd8f2724af29afeb3284..1ac62538f2e9a0ab86bd5086f4fef676ca251a6a 100644 (file)
   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
index 0ed6f0bb3133cde43e753750eaedf4159bd62116..5e275adfda56987a0756ab04833e65ac6f6d5fa7 100644 (file)
@@ -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 */