This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rai
Recipients rai
Date 2014-06-07.13:02:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402146125.06.0.0023086764998.issue21685@psf.upfronthosting.co.za>
In-reply-to
Content
Steps to reproduce
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
-1- Create a document.odt containing an input (text) field and a conditional text field; the latter will show a different text based upon the content of the input text field. [use attached example.odt]
-2- Edit the file by means of following code

from zipfile import ZipFile, ZIP_DEFLATED
document = '/tmp/example.odt'                     # SET ME PLEASE
S2b, R2b = 'SUBST'.encode(), 'REPLACEMENT'.encode()
with ZipFile(document,'a', ZIP_DEFLATED) as z:
	xmlString = z.read('content.xml')
	xmlString = xmlString.replace(S2b, R2b)
	z.writestr('content.xml', xmlString)

-3- Open example.odt with *office

As `REPLACEMENT' is the requested string, one expect to see the relevant conditional text
What happens: the LO function doesn't recognize the string, unless one do not retype it manually

Omitting ZIP_DEFLATED parameter prevents this behaviour from happen (so letting zipfile use the default no-compression method) 


tested on
Python 2.7.3 and Python 3.2.3
Ubuntu 12.04 amd64
LibreOffice Version 4.0.4.2
History
Date User Action Args
2014-06-07 13:02:05raisetrecipients: + rai
2014-06-07 13:02:05raisetmessageid: <1402146125.06.0.0023086764998.issue21685@psf.upfronthosting.co.za>
2014-06-07 13:02:05railinkissue21685 messages
2014-06-07 13:02:04raicreate