Download it now!
Bug 31707 - Extraneous spaces inserted between `<text:span>` in flat ODT files
Summary: Extraneous spaces inserted between `<text:span>` in flat ODT files
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-18 03:01 UTC by Gioele Barabucci
Modified: 2013-11-23 13:15 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file confirming and expanding bug #31707 (29.67 KB, application/vnd.oasis.opendocument.text-flat-xml)
2011-05-20 05:18 UTC, josefk
Details

Note You need to log in before you can comment on or make changes to this bug.
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>