Commit 7a3f3dc9 authored by Jérome Perrin's avatar Jérome Perrin

fix typo (h in None)

omit # in xlink:href for generated draw:image block.
Opendocument presentation endwith 'presentation', not 'draw'



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9523 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 41ae0f91
......@@ -335,15 +335,13 @@ xmlns:config="http://openoffice.org/2001/config" office:version="1.0">
aspect_ratio = float(picture.width) / float(picture.height)
except TypeError:
aspect_ratio = float(picture.width()) / float(picture.height())
# fix a default value and correct the aspect
if h in None:
if h is None:
if w is None:
w = 10.0
h = w / aspect_ratio
elif w is None:
w = h * aspect_ratio
# picture is too large
if maxwidth and maxwidth < w:
w = maxwidth
......@@ -366,13 +364,14 @@ xmlns:config="http://openoffice.org/2001/config" office:version="1.0">
# <manifest:file-entry manifest:media-type="" manifest:full-path="ObjBFE4F50D/Pictures/"/>
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="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] )
if not self.content_type.endswith('draw'):
if not ( self.content_type.endswith('draw') or
self.content_type.endswith('presentation') ):
replacement = '<text:p text:style-name="Standard">'+replacement+'</text:p>'
return replacement
......
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