Bug 31707

Summary: Extraneous spaces inserted between `<text:span>` in flat ODT files
Product: LibreOffice Reporter: Gioele Barabucci <gioele>
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: chris, LibreOffice
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://launchpad.net/bugs/799596
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Example file confirming and expanding bug #31707

Description Gioele Barabucci 2010-11-18 03:01:12 UTC
Extra spaces (not typed by the user) are inserted by between `<text:span>` elements.

The following testcase illustrates the problem (`*` for bold, '/' for italic):

----
A*B/C/D*E
----

When saved in the ODT format, 'contents.xml' contains

----
<text:p text:style-name="Standard">A<text:span text:style-name="T1">B</text:span><text:span text:style-name="T2">C</text:span><text:span text:style-name="T1">D</text:span>E</text:p>
----

The same document saved in FODT (flat ODT) format end up containing

----
<text:p text:style-name="Standard">A<text:span text:style-name="T1">B</text:span>
  <text:span text:style-name="T2">C</text:span>
  <text:span text:style-name="T1">D</text:span>E</text:p>
----

That is, spaces are added around the second `<text:span>` element, the one containing the text 'C' with an italic style. When this file is read back, the content of the document is changed to

----
A*B /C/ D*E
----

Probably some XML processors used in the save path are indenting those elements because they think that text between `<text:span>` elements is ignored and, thus, these elements can be indented on a new line. If that is the case, adding `xml:space` declarations should avoid such issues.
Comment 1 Octavio Alvarez 2011-01-14 01:02:55 UTC
It happens with the following code too:

<text:p text:style-name="P1"><text:span text:style-name="T1">A</text:span><text:span text:style-name="T2">B</text:span><text:span text:style-name="T3">C</text:span><text:span text:style-name="T2">D</text:span><text:span text:style-name="T1">E</text:span></text:p>

No spaces, no newlines.
Comment 2 josefk 2011-05-20 05:18:17 UTC
Created attachment 46948 [details]
Example file confirming and expanding bug #31707

Example FODT-file showing that the import XSL (?) insert extra whitespace after text:area and text:note during the import.
Comment 3 josefk 2011-05-20 05:19:29 UTC
Not only text:area's are affected by this bug, text:note (footnotes, endnotes) are affected as well.
Comment 4 Björn Michaelsen 2011-12-23 11:34:58 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 5 Gioele Barabucci 2011-12-24 04:28:26 UTC
This bug seems fixed in LO 3.5-rc1.
Comment 6 Rainer Bielefeld Retired 2011-12-28 21:13:00 UTC
<https://bugs.freedesktop.org/page.cgi?id=fields.html#status>