From 7a3f3dc90f85cf5eacfa8c93192008b411726ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Mon, 28 Aug 2006 17:35:02 +0000 Subject: [PATCH] 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 --- product/ERP5OOo/OOoTemplate.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/product/ERP5OOo/OOoTemplate.py b/product/ERP5OOo/OOoTemplate.py index 525f2c83e9..1caf26dfe8 100644 --- a/product/ERP5OOo/OOoTemplate.py +++ b/product/ERP5OOo/OOoTemplate.py @@ -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 -- 2.30.9