Bug 81420 - Excessive use of text:style-name elements in content.xml in .ODT
Summary: Excessive use of text:style-name elements in content.xml in .ODT
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.4.2 release
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks: ODF-export-invalid
  Show dependency treegraph
 
Reported: 2014-07-16 09:42 UTC by Zhivko
Modified: 2020-09-13 20:54 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhivko 2014-07-16 09:42:36 UTC
I am getting something like:
<text:span text:style-name="T14">text1</text:span>
              <text:span text:style-name="T15">text2</text:span>
              <text:span text:style-name="T11">text3</text:span>
              <text:span text:style-name="T14">text4</text:span>
              <text:span text:style-name="T15">text5</text:span>
in content.xml in .ODT file for my document.


If I look at document it has 1 paragraph with text from text 1 to text4 in plain, and text5 in bold.

I tried copy paste same text (paste unformated text) and formating text5 as bold - but I still get such a lot of style-name elements in ODT.

What could cause such excessive use of style-name inside LibreOffice?
Comment 1 Jorendc 2014-07-16 19:35:20 UTC Comment hidden (obsolete)
Comment 2 Jorendc 2014-07-16 19:38:38 UTC
Ah wait, I can reproduce this. Ignore my brain fart.

I did forget to mark the last paragraph as bold.

Tested using Mac OSX 10.9 with LibreOffice Version: 4.4.0.0.alpha0+
Build ID: 7dd5f9308895644ae6ece56253c892046cc6ed5e
TinderBox: MacOSX-x86@49-TDF, Branch:master, Time: 2014-07-16_07:40:22
Comment 3 Jorendc 2014-07-16 19:39:09 UTC
Any chance we can transform this to an EasyHack?
Comment 4 Michael Stahl (allotropia) 2014-12-03 14:03:19 UTC
i can't reproduce this, i get just 1 span for the bold word.

the most likely explanation for lots of different automatic styles in Writer is the RSID feature.
Comment 5 Jim Avera 2014-12-04 21:22:31 UTC
Regarding those spans for RSIDs, see also bug 86988
Comment 6 Robinson Tryon (qubit) 2015-12-13 11:21:22 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2017-01-03 19:47:38 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2019-12-03 14:17:34 UTC Comment hidden (obsolete)
Comment 9 Thomas Lendo QA 2020-06-07 18:47:46 UTC
Maybe it's because LibreOffice doesn't delete not anymore used style spans?
Comment 10 Regina Henschel 2020-09-12 17:08:16 UTC
Steps to reproduce are not clear. And the description needs a remark whether the option "Random number to improve accuracy of document comparison" is set, and it needs to specify the file format.

I cannot reproduce it with Version: 7.1.0.0.alpha0+ (x64)
Build ID: 1e0cfd5662d95cea84e80e4fe10d52c3b1101ae6
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: Skia/Vulkan; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL
Comment 11 Zhivko 2020-09-13 14:22:27 UTC
@Regina Henschel and others:

Steps to reproduce:

1) step 1
You write in writer following lines that end with paragraph mark (enter pressed at the end):

text1 text2 text3 text4 text5

2) step 2
you format last word "text5" with bold

3) step 3
you save file

4) step 4
you add .zip to file extension file.odt so it come to be: file.odt.zip

5) step 5
you open content.xml within zip file

6) you check file - it should contains following:

Expected outcome (as I just tested on: Version: 6.2.4.2 (x64)
Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: sl-SI (en_SI); UI-Language: en-GB
Calc: threaded):

<text:p text:style-name="Standard">Text1 text2 text3 text4 <text:span text:style-name="T1">text5</text:span></text:p>

actual result with libreoffice at 2014-07-16 (not sure about version):

<text:span text:style-name="T12">text1</text:span>
              <text:span text:style-name="T13">text2</text:span>
              <text:span text:style-name="T14">text3</text:span>
              <text:span text:style-name="T15">text4</text:span>
              <text:span text:style-name="T16">text5</text:span>

Please note in defective libreoffice writer at 2014-07-16 vrsion last case - every word has its own style from t12 to t15 and last one is T16.




I can confirm that on version:
Version: 6.2.4.2 (x64)
Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: sl-SI (en_SI); UI-Language: en-GB
Calc: threaded

This does not happen anymore - seems it is fixed.