[Erp5-report] r16148 - /erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Sep 7 10:19:57 CEST 2007
Author: yusei
Date: Fri Sep 7 10:19:57 2007
New Revision: 16148
URL: http://svn.erp5.org?rev=16148&view=rev
Log:
if document is empty, don't try to convert.
oood does not work for empty data, so it is waste of time.
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=16148&r1=16147&r2=16148&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/Document/OOoDocument.py (original)
+++ erp5/trunk/products/ERP5OOo/Document/OOoDocument.py Fri Sep 7 10:19:57 2007
@@ -312,6 +312,11 @@
If a conversion is already stored for this format, it is returned
directly, otherwise the conversion is stored for the next time.
"""
+ #XXX if document is empty, stop to try to convert.
+ #XXX but I don't know what is a appropriate mime-type.(Yusei)
+ if self.get_size()==0:
+ return 'text/plain', ''
+
# Make sure we can support html and pdf by default
is_html = 0
original_format = format
More information about the Erp5-report
mailing list