[Erp5-report] r44921 nicolas - /erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Mar 31 17:13:27 CEST 2011
Author: nicolas
Date: Thu Mar 31 17:13:27 2011
New Revision: 44921
URL: http://svn.erp5.org?rev=44921&view=rev
Log:
Call getTargetFormatList() only once
Modified:
erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
Modified: erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/Document/OOoDocument.py?rev=44921&r1=44920&r2=44921&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/Document/OOoDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/Document/OOoDocument.py [utf8] Thu Mar 31 17:13:27 2011
@@ -300,25 +300,26 @@ class OOoDocument(OOoDocumentExtensibleT
is_html = 0
requires_pdf_first = 0
original_format = format
+ allowed_format_list = self.getTargetFormatList()
if format == 'base-data':
return self.getBaseContentType(), str(self.getBaseData())
if format == 'pdf':
- format_list = [x for x in self.getTargetFormatList()
+ format_list = [x for x in allowed_format_list
if x.endswith('pdf')]
format = format_list[0]
elif format in VALID_IMAGE_FORMAT_LIST:
- format_list = [x for x in self.getTargetFormatList()
+ format_list = [x for x in allowed_format_list
if x.endswith(format)]
if len(format_list):
format = format_list[0]
else:
# We must fist make a PDF which will be used to produce an image out of it
requires_pdf_first = 1
- format_list = [x for x in self.getTargetFormatList()
+ format_list = [x for x in allowed_format_list
if x.endswith('pdf')]
format = format_list[0]
elif format == 'html':
- format_list = [x for x in self.getTargetFormatList()
+ format_list = [x for x in allowed_format_list
if x.startswith('html') or x.endswith('html')]
format = format_list[0]
is_html = 1
More information about the Erp5-report
mailing list