Bug 93052 - When save, generate unused list-styles in context.xml
Summary: When save, generate unused list-styles in context.xml
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Jan-Marek Glogowski
URL:
Whiteboard: target:5.1.0 target:5.0.3
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-31 13:30 UTC by Juergen Funk (CIB)
Modified: 2016-10-25 19:20 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
File for reproduce the bug (7.19 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-07-31 13:30 UTC, Juergen Funk (CIB)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Funk (CIB) 2015-07-31 13:30:27 UTC
Created attachment 117562 [details]
File for reproduce the bug

The file "TestCalc.ods" have generated with OpenOffice 3.2.1.
But when i load with the LO 5.0 [a5a871bf03b212ce760997b16d764e266207dc55] and save, then generate the follow
        <text:list-style style:name="L1">
            <text:list-level-style-number text:level="1" style:num-format="A">
                <style:list-level-properties/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="2" style:num-format="A">
                <style:list-level-properties text:space-before="8mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="3" style:num-format="A">
                <style:list-level-properties text:space-before="16mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="4" style:num-format="A">
                <style:list-level-properties text:space-before="24mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="5" style:num-format="A">
                <style:list-level-properties text:space-before="32mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="6" style:num-format="A">
                <style:list-level-properties text:space-before="40mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="7" style:num-format="A">
                <style:list-level-properties text:space-before="48mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="8" style:num-format="A">
                <style:list-level-properties text:space-before="56mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="9" style:num-format="A">
                <style:list-level-properties text:space-before="64mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
            <text:list-level-style-number text:level="10" style:num-format="A">
                <style:list-level-properties text:space-before="72mm"/>
                <style:text-properties fo:color="#000000" fo:font-size="100%"/>
            </text:list-level-style-number>
        </text:list-style>
        <text:list-style style:name="L2">
         .
         .
        </text:list-style>

This "text:list-style" has no referenz to other object and is not necessary.
I have a document with 1341 comments and then generate 2616 "text:list-styles" entries for nothing (the context.xml grow to 5 MB).
Comment 1 Juergen Funk (CIB) 2015-07-31 14:05:11 UTC
Now i have found why make two text:list-style entries for the one comment object.
The reason is, the comment has a newline and that make the 2 text:list-style entries, when more newlines then more entries for one comment object.
Comment 2 Jan-Marek Glogowski 2015-08-05 13:16:25 UTC
I did a bibisect and then an additional bisect, as I couldn't identify any matching change for my problem. The bisect finally pointed to:

commit 5785db93c5739846fb0a84b138be485044d4bda5
Author: Cao Cuong Ngo <cao.cuong.ngo@gmail.com>
Date:   Wed Apr 10 20:41:54 2013 +0200

    fdo#47018 Impress crashes when modifying bullet
    
    Default numbering rules shouldn't be left zero nor hard-coded.
    
    Change-Id: I8a34331006abf3de8c170f8dca43ccf9cec92f04
    Reviewed-on: https://gerrit.libreoffice.org/3312
    Reviewed-by: Eike Rathke <erack@redhat.com>
    Tested-by: Eike Rathke <erack@redhat.com>

Except for spreading some SVX_MAX_NUM to fix the Impress crash, it also changed the default NumRule flags from SvxNumRuleFlags::NONE to SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::BULLET_COLOR | SvxNumRuleFlags::CHAR_TEXT_DISTANCE

I reverted this line, which stopped the additional NumRule styles for Calc, and still couldn't reproduce the Impress crash,

Will push a patch to Gerrit later.
Comment 3 Jan-Marek Glogowski 2015-08-05 17:50:31 UTC
https://gerrit.libreoffice.org/#/c/17527/
Comment 4 Commit Notification 2015-08-15 21:13:48 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2238bb47f5fce8449760e71525153967b4ce873c

tdf#93052 Fix abundance of calc annotation styles

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2015-09-01 10:07:08 UTC
Juergen Funk committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d9305ae68bf3707242a96fb1b697c36d6eaf91c4

tdf#93052 - When save, generate unused list-styles in context.xml

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2015-09-07 11:38:22 UTC
Juergen Funk committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ead98b51ee35d9f070ab426bf840bf234fd524c3&h=libreoffice-5-0

tdf#93052 - When save, generate unused list-styles in context.xml

It will be available in 5.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.