Bug 75817 - Automatic styles are too persistent
Summary: Automatic styles are too persistent
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.0.0.alpha0+ Master
Hardware: Other All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Styles
  Show dependency treegraph
 
Reported: 2014-03-06 01:39 UTC by Urmas
Modified: 2024-10-16 04:42 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example (7.19 KB, application/x-zip)
2014-03-06 01:39 UTC, Urmas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Urmas 2014-03-06 01:39:07 UTC
Created attachment 95202 [details]
Example

Open and save the attached document.
It will have about 200 unused automatic styles.
Unused automatic styles must be cleaned automatically.
Comment 1 Joel Madero 2014-03-07 03:03:50 UTC
So you want the styles to just disappear for individual documents? The default styles that come with LibreOffice. If so I disagree with the request and will seek additional input from devs
Comment 2 Urmas 2014-06-10 03:30:40 UTC
Automatic styles are not default. Don't write nonsensical comments, please.
Comment 3 Joel Madero 2014-06-10 03:31:21 UTC
Urmas - don't be rude please. Again, warned.
Comment 4 Urmas 2014-07-12 02:14:06 UTC
That is not 'enhancement'. That is a bug.
Comment 5 João Paulo 2014-09-08 20:46:58 UTC
I can confirm this on LibreOffice 4.2.6.3 build id 3fd416d4c6db7d3204c17ce57a1d70f6e531ee21 running on Windows Vista 64 bits.

I suspected this long ago, LibreOffice just keeps adding automatic styles to the document, so if we create a new one from an older document, it will inherit the automatic styles and the document will be bigger and slower to parse.

It is a bug, not a enhancement, as there are people (myself included) which don't use official templates for creating documents - the template is the last document of the same type used. Lawyers do that when writing petitions of the same kind (the facts are changed, but the law it's based remains the same), judges also do that (the suit report and the judgement is changed, but the law it's based remains the same). It also happens because, in Brazil, the petitions don't have a defined form factor, one can use different fonts to make a better emphasis, many times just a word or two of the sentence (which already had emphasis) gets another emphasis by changing the body font (bold, italics, both - I do that), the size (from 12pt to 16pt - I see others doing that), another font entirely or even the color (from black to red, or orange - God forbid people from using blinking letters! On a petition! LOL).

It happens a lot when doing evictions, when the consumer doesn't receive what s/he bought etc. Also people who do write reports do that when changing a little bit of the style to make the document feel nicer etc, sometimes it's not the style.

Yes, I know we may change the default styles or even create new ones, but it's just not possible to always do that because it's a slow process and we need to be fast when writing, so we just use the formatting tools when is a little bit change that won't be used again on the document.

At my office, we use the Flat OpenDocument format (.fodt) (better for backing up, it is much more compressible than the zipped .odt type), but now I see documents with almost 300Kb that, opened using Notepad++, when the contents of the "<office:automatic-styles>" node is erased (not the node itself) and saved as another name, the size gets back to less than 90Kb and the document is still normally editable without errors.

So the only conclusion is LibreOffice isn't cleaning up its automatic styles, which is a kind of memory leak. Worse still, a persistent one.

PS: May I change this bug status as confirmed? I am doing that right after saving this comment.
Comment 6 João Paulo 2014-09-08 20:53:57 UTC
Just to clarify to Joel Madero:

* Default Styles are those which already comes with LibreOffice;
* Automatic Styles are those created by LibreOffice automatically every time the user changes the formatting without using styles. LO does that because the OpenDocument Format specs don't allow to use direct formatting, the software has to create the illusion of direct formatting creating automatically (and hidden) styles every time the user apply direct formatting on the document content.
Comment 8 Robinson Tryon (qubit) 2014-09-25 21:44:56 UTC
Bug is confirmed and status is NEW -> Removing needAdvice tag.
Comment 9 QA Administrators 2015-10-14 19:56:19 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2016-11-08 11:04:25 UTC Comment hidden (obsolete)
Comment 11 Roman Kuznetsov 2019-01-28 19:58:14 UTC
Regina, please look at this bug. Are we sure it's a bug?
Comment 12 Regina Henschel 2019-01-28 21:27:18 UTC
The "automatic" styles belong to direct formatting. It is not a file format error to keep them, it is allowed. But I dislike it too. Such styles should only be there, if there are objects which use them. If you save the example file in odt-format and then open and re-save it with Word 365, it shrinks from 13KB to 7KB, because Word does not save these useless styles.

I consider it a bug.
Comment 13 João Paulo 2022-08-18 18:44:02 UTC
I confirm this behavior / bug is still present on:

Version: 7.4.0.3 (x64) / LibreOffice Community
Build ID: f85e47c08ddd19c015c0114a68350214f7066f5a
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: pt-BR (pt_BR); UI: pt-BR
Calc: threaded
Comment 14 Rémi Hérilier 2024-05-02 15:45:35 UTC
I confirm this behavior / bug is still present on:

Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: 420(Build:3)
CPU threads: 16; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Debian package version: 4:24.2.0-1
Calc: threaded
Comment 15 Rémi Hérilier 2024-10-14 15:49:18 UTC
This bug seems to have been fixed. The OP's file has shrunk from 102945 bytes to 
43859.

Used version:

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 480(Build:1)
CPU threads: 16; OS: Linux 6.10; UI render: default; VCL: gtk3
Locale: en-US (C); UI: en-US
Debian package version: 4:24.8.2-1
Calc: threaded
Comment 16 João Paulo 2024-10-16 04:42:21 UTC
I viewed the contents of the OP's file to verify the <automatic-styles> node before and after saving with LibreOffice, and the document was cleaned.  So I can confirm Rémi Hérilier report and I am marking this bug as fixed.

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: pt-BR (pt_BR); UI: pt-BR
Calc: threaded