<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 - TOC adds an extra page in some cases"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=136187">136187</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>TOC adds an extra page in some cases
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows (All)
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </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>alex_polkovnik@mail.ru
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
Table of contents shows +1 page number sometimes.

Steps to Reproduce:
1. Open the attached file. The bug is reproduced there.
2. Seems to me that the bug appears if title text fills one line in TOC,
leaving no space before page number on the right.
3. The second condition - TOC should fill all page, only reduced text should be
able to fit below it.

Actual Results:
All page numbers are shifted by +1. I see "...3" where "...2" should be.

Expected Results:
Page numbers should show real page numbers.


Reproducible: Always


User Profile Reset: No



Additional Info:
I have found 2 workarounds to "fix" this behavior:
1. If you delete page break after TOC, you’ll see TOC fixed.
2. If you reduce title 4.2 text, TOC also will be OK.
3. And of course if TOC is one tile less or bigger no bug appears.
v 6.4.5.2 (x64)
ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
Threads: 8; OS: Windows 10.0 Build 18362; Render: GL; VCL: win; 
Locale: ru-RU (ru_RU); Language: ru-RU
Calc: CL</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>