[Erp5-report] r19846 - /erp5/trunk/products/ERP5OOo/OOoTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 13 14:01:40 CET 2008


Author: jerome
Date: Thu Mar 13 14:01:38 2008
New Revision: 19846

URL: http://svn.erp5.org?rev=19846&view=rev
Log:
Generate different replacement text for openoffice 1 and openoffice 2.
This generates valid ODF for openoffice 2 documents. Behaviour unchanged for
openoffice 1 documents.

Modified:
    erp5/trunk/products/ERP5OOo/OOoTemplate.py

Modified: erp5/trunk/products/ERP5OOo/OOoTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/OOoTemplate.py?rev=19846&r1=19845&r2=19846&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/OOoTemplate.py (original)
+++ erp5/trunk/products/ERP5OOo/OOoTemplate.py Thu Mar 13 14:01:38 2008
@@ -415,15 +415,27 @@
       # XXX: Pictures directory not managed (seems facultative)
       #  <manifest:file-entry manifest:media-type="" manifest:full-path="ObjBFE4F50D/Pictures/"/>
       is_legacy = ('oasis.opendocument' not in self.content_type)
-      replacement = """<draw:image draw:style-name="%s" draw:name="ERP5Image%d"
-text:anchor-type="paragraph" svg:x="%s" svg:y="%s"
-svg:width="%.3fcm" svg:height="%.3fcm" xlink:href="%sPictures/%s"
-xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
-      """ % (options_dict['style'], actual_idx,
-             options_dict['x'], options_dict['y'],
-             w, h,
-             is_legacy and '#' or '',
-             pic_name.split('/')[-1] )
+      if is_legacy:
+        replacement = """<draw:image draw:style-name="%s" draw:name="ERP5Image%d"
+  text:anchor-type="paragraph" svg:x="%s" svg:y="%s"
+  svg:width="%.3fcm" svg:height="%.3fcm" xlink:href="#Pictures/%s"
+  xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
+        """ % (options_dict['style'], actual_idx,
+               options_dict['x'], options_dict['y'],
+               w, h,
+               pic_name.split('/')[-1] )
+      else:
+        replacement = """<draw:frame draw:style-name="%s" draw:name="ERP5Image%d"
+  text:anchor-type="paragraph" svg:x="%s" svg:y="%s"
+  svg:width="%.3fcm" svg:height="%.3fcm">
+     <draw:image xlink:href="Pictures/%s" xlink:type="simple"
+                 xlink:show="embed" xlink:actuate="onLoad"/>
+  </draw:frame>
+        """ % (options_dict['style'], actual_idx,
+               options_dict['x'], options_dict['y'],
+               w, h,
+               pic_name.split('/')[-1] )
+
       if not (self.content_type.endswith('draw') or
               self.content_type.endswith('presentation') or
               self.content_type.endswith('writer') or




More information about the Erp5-report mailing list