Closed davyrouillard closed 7 years ago
I just stumbled upon this myself. It's caused by the xml parser eating whitespace in <text:span> </text:span>
. I've created a quick fix here.
@joostvanzwieten Could you create a pull request from your change or do you consider it to be too hackish?
@joostvanzwieten Thanks you very much ! After two hours, I haven't succeed to solve the problem myself. You have saved my application based on odfpy. Thanks you !!
@icemac Sure! I have too little knowledge about ODF to judge if this is the proper solution. However, preserving whitespace seems harmless to me and LibreOffice appears to produce files without unnecessary whitespace anyhow.
@joostvanzwieten No problem, making it a PR allows to discuss it or even improve it.
Pull request accepted and version 1.3.5 published.
Hi all,
I have a problem when loading/saving a document that contains user fields separated by a space (see variables_with_space.odt in zip archive) It seems that the call to odf.opendocument.load() deletes the space between the variables.
The odt file has been created with Libreoffice 5.3.1.2
Please see as evidence material, the small program "test_load_save.py" that only load a document and immediately save it. you can found the result in the file "saved_variables_with_space.odt".
I obtain the same result with various version of odfpy (1.3.4, 1.3.2, 1.2.0) and python (2.7.6, 3.4.4).
It's a very annoying problem as I use the excellent library odfpy to automatically produced reports and this problem makes it useless. Please, could you help me on that point ?
Best regard, Davy
bug_report.zip