<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - FILEOPEN DOCX: Do not display line numbering if w:lnNumType is set but w:countBy="0""
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=131594">131594</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>FILEOPEN DOCX: Do not display line numbering if w:lnNumType is set but w:countBy="0"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.3.5.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Writer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>suokunlong@126.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=159036" name="attach_159036" title="test docx file">attachment 159036</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=159036&action=edit" title="test docx file">[details]</a></span>
test docx file

Steps to Reproduce:

1. Open the attached test docx document in Writer. Observe that the line
numbering is displayed every 5 lines.
2. Open this docx document in MSO. Observe that no line numbering is displayed.

-----

The issue is that, when unzip this docx, there is a the following code:

<w:sectPr>
  ...
  <w:lnNumType w:countBy="0" w:distance="360"/>
  ...
</w:sectPr>

The specification explained that w:lnNumType is used to define line numbering.
w:countBy="0" is used to specifies the line number increments to be displayed.
The problem is, as described in the follow link:

<a href="https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/7b579d67-5dd6-4e60-b176-31b8157addd0">https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/7b579d67-5dd6-4e60-b176-31b8157addd0</a>

Word only allow the countBy value from 1 to 100. The specification allows any
int value. As a result, the test document is still valid ooxml document, but in
Word no line number would be displayed (because I guess it treat this line as
invalid and it is just ignored), while in Writer it treated as valid but does
not know what is the exact increment value, thus falls to its default 5 lines.

-----

I assume this is not really a bug of LibreOffice itself, but for
interoperability we should treat w:countBy="0" as "line numbering off".

By the way, it seems that the test document was created using WPS Office.

This issue was originally reported on the LibreOffice Chinese discussion forum:
<a href="https://bbs.libreofficechina.org/forum.php?mod=viewthread&tid=2427">https://bbs.libreofficechina.org/forum.php?mod=viewthread&tid=2427</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>