Commit ad001336 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Change the link format, depending on the content/mime type. This is required...

Change the link format, depending on the content/mime type. This is required for supporting image links in OOo2.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14643 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 18bf3606
......@@ -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
......
......@@ -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'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment