Description: Line numbering for specific paragraphs gets lost after saving to .docx (Word 2007-365) file format and reloading. Line numbering is stored in .odt and .doc (Word 97-2003) file format correctly. Line numbering for the whole document is stored in .docx file format correctly. Error happens in specified and older versions. Steps to Reproduce: 1. Create several paragraphs in a new text document. 2. Add line numbers to specific paragraphs (not the whole document) following this guide: https://help.libreoffice.org/3.3/Writer/Adding_Line_Numbers 3. Save document as .docx (Word 2007-365) and reload it Actual Results: No line numbering shown anymore. Expected Results: Line numbering shown as before saving. Reproducible: Always User Profile Reset: No Additional Info: [Information automatically included from LibreOffice] Locale: de Module: StartModule [Information guessed from browser] OS: Mac OS X (All) OS is 64bit: no
Repro for DOCX in 7.4+. Already in LO, same in MSO. Not for DOC.
Low priority: Things designed in Word seem to round-trip well. Things designed in LO using simple styles seem to work well also. MS Word has line numbering tied to a section. All paragraphs in a section participate, and require an explicit "suppress line numbers" paragraph property to avoid being numbered. LO does not tie numbering to page styles or sections AFAICS. It is just on or off for the whole document. But that sounds like it all should work. What is the problem then? I assume that the property <w:suppressLineNumbers/> is not written when it is false. Yup - here it is: if ( !rNumbering.IsCount( ) ) m_pSerializer->singleElementNS(XML_w, XML_suppressLineNumbers); Generally, that is a good thing, but not when it needs to override an inherited value (like in this case where the style says suppress, but the direct formatting says don't suppress). See ExportPoolItemsToCHP for some ideas on how to check that.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/91358f11ee7e87c8c8290b9507f64d8f90aac3ea tdf#148834 docxexport: also write suppressLineNumbers = false It will be available in 24.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.