Created attachment 50866 [details] Load this document, save it again and the number of <draw> tags double I'm editing a file with a few drawings. After a few sessions, it appears that the file is corrupted and the Libre Office crashes (so does Open Office too). To see what was happening, I looked content.xml inside the odt file. And what's interesting: one of the images embedded using <draw> tag was cloned 2048 times. The number 2048 (2 ^ 11) is not accidental. I checked that each save the file doubles the number of tags <draw> referring to the same object.
This seems very familiar, I'm sure we've encountered this bug before.
It's the (incredibly annoying) change tracking. A breakpoint on SwGrfNode::SwGrfNode and toggleing redlines off and on should add graphic nodes per toggle
Created attachment 51183 [details] smaller reproducer Here's an easier reproducer, i.e. load this, F5 and expand graphics, there is 1 listed, save as, and even without re-loading a new graphic will appear in the graphics list. Seems the temp copy of the redline stuff during export creates a copy of the graphic which isn't deleted when the redline section is removed again. Something of that nature anyway
Some thinking out loud via unit tests for graphic deletion http://cgit.freedesktop.org/libreoffice/core/commit/?id=8578e3c80d99da0b47cd450a9be61cef28f411b0
Created attachment 51228 [details] this is what I'd like to do This would fix it, but potentially with side-effects.
[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
Michael Stahl committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=23e52c207760c596cc2f841ef59f3100c110d591 fdo#40599 i#112763: fix frame duplication:
used to work in OOo 3.1.1, broke in OOo 3.2 => regression this was introduced with the following change in CWS os131: SwDoc::CopyFlyInFlyImpl: - pAPos->nNode < rRg.aEnd ) + pAPos->nNode <= rRg.aEnd ) the problem happens on Show/Hide redlines. there is also OOo issue 112763 which is essentially a duplicate. @Caolán: i don't like the attached patch because i have no idea what problems it could cause; since the redlining already sets a special flag that is used for comparing the start position i found it expedient to use it for comparing the end position too. fixed on master.
great you found a fix. re attached patch, yeah, I never committed it because its more an aside along the lines of "this is the way I want the world to work" than a fix
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-3-5": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ab55f25ecad89e05a440770cfc8c87320ae010ef&g=libreoffice-3-5 fdo#40599 i#112763: fix frame duplication: It will be available in LibreOffice 3.5.2.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-3-5-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=eda71e73a401458acdb58a26841791de1d23c2c5&g=libreoffice-3-5-1 fdo#40599 i#112763: fix frame duplication: It will be available already in LibreOffice 3.5.1.