Created attachment 201346 [details] sample DOCX Open sample DOCX that has ToC and tracked changes. See word Einleitung as Heading style. Save and reopen, see that Einleitung is Default style. Seems regression in 6.4: commit e76fcb8f169acac3d81bdaf9b126cc4c98e2eb8e [log] author Mike Kaganski <mike.kaganski@collabora.com> Fri Dec 13 09:36:39 2019 +0300 committer Andras Timar <andras.timar@collabora.com> Thu Jan 09 08:19:01 2020 +0100 tdf#129353, tdf#129402: fix node creation on index import
Actually, before referened commit file would not properly open, that one fixed opening. So that saving is spoiled seems a consequence, not a regression. I would rather call this missing feature of handling complex format.
Confirming, this is very similar to my bug 167196 (also from the same customer doc, but slightly more complicated example file - let's keep it open to be sure).
Gülşah Köse committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e3da51b84f58a1114fef0d9c5a2881eb05ad8f13 tdf#167082 Fix the missing style It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 201617 [details] A comparison of effects of the amount of deletion of the *previous* paragraph on the partially deleted next
Oh, we seem to have even larger problem here, and my document suffered from it: it already lost the formatting of para 2 when recording redlines in ODT.
Created attachment 201618 [details] A DOCX showing the different handling depending how much of *previous* paragraph is deleted
Created attachment 201622 [details] And here only deletion of the paragraph mark of the previous paragraph is shown Check in Word, how the resulting merged paragraph is shown in case of removed paragraph mark. We have some problems around redlines both in ODF export, and endline deletion handling (at least with Word compatibility). Maybe my doubt is caused not by the fix specifically, but by the general state of the feature.
Heh, both https://bz.apache.org/ooo/show_bug.cgi?id=75463 and my new bug 167360 seem related. The function lcl_getFormatCollection was introduced in the OOo bug, to handle the incorrect handling of the style in "Åbne filer" paragraph, which *expected* to have OOoHeading1 style. And it had that paragraph in the bugdoc, until we broke it somewhere in version 7.4. Which is yet another bug. Sorry to put it all together here; but it looks like we are keeping piling workarounds over hacks in the redlines area, and that needs some integral overview to proceed reasonably.
Created attachment 201627 [details] Attachment from i#75463 AOO Issuezilla seems to have spam influx, so they limited access to registered users; so here is the bugdoc from it, as well as the description: > export attached document to WW8 format, open in MS Word -> paragraph "Abne > filer" is no more a heading paragraph, got default style. When accepting all > tracked changes before exporting, Dok will look good in Word. ... > Investigations reveals the following: > The change tracking contains a merge of paragraphs. > OOo Writer and Microsoft Word have a different handling on merging paragraphs: > - In OOo Writer the paragraph style of the first paragraph is kept. > - In Microsoft Word the paragraph style of the second paragraph is kept. > Thus, in case the paragraph styles are different at the two merged paragraphs, > the result differs in OOo Writer and Microsoft Word. This different behavior > causes the described defect. The fixing commit was 39e43369ffb0339b2d33d54dc16725a9450ae055
Reading the OOo bug analysis, bug 167360 comment 1, and comment 8 mentioning a change in 7.4, I suspect that in 7.4, we made a breaking change to follow what Word does (incompletely). My suggestion would be to find that change in 7.4, see if that breaking change makes sense, and if so, then maybe simply remove lcl_getFormatCollection as a whole - because likely, we now don't need it anymore?
Gülşah Köse committed a patch related to this issue. It has been pushed to "libreoffice-25-8": https://git.libreoffice.org/core/commit/f2f9c31cf8aa7127a902a2a2533d3760bd6cc3df tdf#167082 Fix the missing style It will be available in 25.8.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Escuse me Mike, maybe it should be obvious but can you clarfiy change in 7.4, is it original bugdoc attachment 201346 [details], where is that style in "Åbne filer" paragraph, GUI or XML, not seeing that.
(In reply to Mike Kaganski from comment #10) It was commit 81273c65dd9cec5acd9464b9041f452a5481e10e (for bug 134759). And I believe, that that was a correct change. Deleting a paragraph in change tracking mode must result in the same formatting as in normal mode. Before that change, there was a difference how these two cases behaved; and what's even more interesting, it only appeared on save (i.e., user would see the result as expected when pressing Delete button). (In reply to Timur from comment #12) > Escuse me Mike, maybe it should be obvious but can you clarfiy change in > 7.4, is it original bugdoc attachment 201346 [details], No, that was the bugdoc from i#75463 (attachment 201627 [details]).
Verified in Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 36a55369a6ac72ae985cf31405b7f52686665d84 CPU threads: 14; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win Locale: de-DE (hu_HU); UI: en-US Calc: threaded After save and reload the Heading style of the Einleitung paragraph is retained.