diff --git a/product/ERP5OOo/OOoTemplate.py b/product/ERP5OOo/OOoTemplate.py index 1a1636cbfe6e1c593f9f3f1aee5c4cc7bccb589f..4ab91f557799fbc34701301682f3ca8b0df1c07c 100644 --- a/product/ERP5OOo/OOoTemplate.py +++ b/product/ERP5OOo/OOoTemplate.py @@ -366,13 +366,15 @@ xmlns:config="http://openoffice.org/2001/config" office:version="1.0"> ) # 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="#Pictures/%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 not (self.content_type.endswith('draw') or self.content_type.endswith('presentation') or diff --git a/product/ERP5OOo/OOoUtils.py b/product/ERP5OOo/OOoUtils.py index 7a6c1c3f6bf0083c6ef16024c28b9335507a3527..d90f0e5e562505191189c91086f9ffc7549dd3cf 100644 --- a/product/ERP5OOo/OOoUtils.py +++ b/product/ERP5OOo/OOoUtils.py @@ -198,7 +198,8 @@ class OOoBuilder: self._image_count += 1 name = "Picture/%s.%s" % (count, format) self.replace(name, image) - return "#%s" % name + is_legacy = ('oasis.opendocument' not in self.getMimeType()) + return "%s%s" % (is_legacy and '# ' or '', name,) security.declarePublic('render') def render(self, name='', extension='sxw'):