Bug 138892 - FILEOPEN DOCX Empty paragraph after two consecutive breaks gets numbering
Summary: FILEOPEN DOCX Empty paragraph after two consecutive breaks gets numbering
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.2.0 target:7.1.0.0.beta2 tar...
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: DOCX-Section
  Show dependency treegraph
 
Reported: 2020-12-14 11:44 UTC by NISZ LibreOffice Team
Modified: 2021-01-25 14:28 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word (19.75 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-12-14 11:44 UTC, NISZ LibreOffice Team
Details
Screenshot of the original document side by side in Word and Writer (179.37 KB, image/png)
2020-12-14 11:45 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-12-14 11:44:40 UTC
Created attachment 168145 [details]
Example file from Word

Attached file was reduced from the attachment #130189 [details] of bug #105134 
Here a numbering is closed with two (one is not enough to trigger this problem) consecutive continuous section breaks, followed by an empty paragraph.
When opened in Writer the empty paragraph gets numbering.

Steps to reproduce:
    1. Open attached file

Actual results:
Empty paragraph at the bottom of the first page gets numbering.

Expected results:
No numbering for the empty paragraph.

LibreOffice details:
Version: 7.2.0.0.alpha0+ (x64)
Build ID: 61d07657caab5e0fb8ec4446f67a7044e14dae4b
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

Also in:
Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: en-US (hu_HU); Calc: CL

Not yet in:
Version: 6.0.0.3
Build ID: 64a0f66915f38c6217de274f0aa8e15618924765
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: en-US (hu_HU); Calc: CL

Additional Information: 

Bibisected using bibisect-win32-6.1 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=e24e2d2fb02239753c1520a0458b44683ea4cc2e 
author	Justin Luth <justin_luth@sil.org>	2018-01-23 21:56:00 +0300
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2018-01-26 12:41:18 +0100

tdf#95377 ooxmlimport: treat default style like named styles

Adding CC to: Justin Luth
Comment 1 NISZ LibreOffice Team 2020-12-14 11:45:00 UTC
Created attachment 168146 [details]
Screenshot of the original document side by side in Word and Writer
Comment 2 Xisco Faulí 2020-12-14 15:15:27 UTC
Reproduced in

Version: 7.1.0.0.alpha1+
Build ID: 738bcf5e9a8c443d60c29c3a8068e8c16c72638a
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 3 Justin L 2020-12-15 08:04:27 UTC
OK - this is what I think was happening.
BEFORE: It gets to pStyle assignment of List Paragraph. Assigns PROP_NUMBERING_RULES. Then gets to the end of the paragraph and bRemove/bNoNumbering. NoNumbering removes the applied PROP_NUMBERING_RULE, and then finishParagraph was called - which did nothing about numbering at that time.

NOW: pStyle waits until finishParagraph to apply numbering. bNoNumbering removes directly applied PROP_NUMBERING_RULE, and then finishParagraph is called, and it applies the list numbering.

Surprisingly, there are no unit tests that hit this behaviour.

This situation just got harder with "Since LO7.0/tdf#131321 fixed the loss of numbering in styles, this OUGHT to be obsolete,". So this requires ADDING a cancelling numbering rule in case the style assigns one. 

Proposed fix at http://gerrit.libreoffice.org/c/core/+/107738
Comment 4 Commit Notification 2020-12-16 05:04:47 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bfcd952dc7820c4cf8761c4222d29ede039391dc

tdf#138892 writerfilter: cancel style list if bNoNumbering

It will be available in 7.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.
Comment 5 Commit Notification 2020-12-16 05:44:14 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/e901ffcb93d217f2cc09021a3b2fecb36f9884f6

tdf#138892 writerfilter: cancel style list if bNoNumbering

It will be available in 7.1.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.
Comment 6 Commit Notification 2020-12-16 14:58:37 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/88aa8f5343705008b86ef41512993a00d331a668

tdf#138892 writerfilter: cancel style list if bNoNumbering

It will be available in 7.0.5.

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.
Comment 7 NISZ LibreOffice Team 2021-01-25 14:28:09 UTC
Verified in:

Version: 7.2.0.0.alpha0+ (x64)
Build ID: 96bafa464ebdbce3ef04bec9beae5e745bb37794
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-GB
Calc: threaded

Thanks for fixing!