Commit caa6b0fd authored by Romain Courteaud's avatar Romain Courteaud

Bug fix: handle image in style.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11350 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 22e641d6
......@@ -42,7 +42,7 @@ from zLOG import LOG
import imghdr
import random
from OFS.Image import Pdata
class CorruptedOOoFile(Exception): pass
......@@ -70,7 +70,17 @@ class OOoBuilder:
def __init__(self, document):
if hasattr(document, 'data') :
self._document = StringIO()
if isinstance(document.data, Pdata):
# Handle image included in the style
dat = document.data
while dat is not None:
self._document.write(dat.data)
dat = dat.next
else:
# Default behaviour
self._document.write(document.data)
elif hasattr(document, 'read') :
self._document = document
else :
......
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