<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 - FILESAVE DOCX Next Style property for page styles lost"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=118702">118702</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>FILESAVE DOCX Next Style property for page styles lost
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>6.2.0.0.alpha0+ Master
          </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>Keywords</th>
          <td>filter:docx
          </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>kelemeng@ubuntu.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=143473" name="attach_143473" title="The original document in ODF format.">attachment 143473</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=143473&action=edit" title="The original document in ODF format.">[details]</a></span>
The original document in ODF format.

LibreOffice Writer has page styles, Microsoft Word doesn't. This means that
every time a document with multiple page styles is saved as DOCX and reopened,
page styles have to be converted back and forth.

This works well when the page styles are separated with manual breaks with
directly set next page styles, but it doesn't if the next page style is applied
via the Next style property from the page style settings and pages are
separated with regular page breaks. I think that in this case regular page
breaks should be converted to page breaks with style changes to preserve the
original layout as much as possible.

Interestingly, if the page has a next style property, and there are no page
breaks set at all between pages (so when the text flows freely from one to the
next page) LibreOffice adds page breaks with style changes automatically.


Steps to reproduce:

1.      Create a new document in LibreOffice Writer.
2.      Open the “Style and Formatting” sidebar by pressing F11, and select the
“Page Styles” view.
3.      Create a new page style: Name it as you like, set the Next Style to
“Default style” and set the page orientation to Landscape.
4.      Apply the newly created page style and add some random text.
5.      Press Ctrl+Enter to insert a page break. The next page should be in
portrait, if everything was done right. Add some more random text to this page.
6.      Save the document as DOCX and reload it.

Actual results:
Both the first and second page are in landscape.

Expected results:
Only the first page should be in landscape, the second page should be in
portrait.

LibreOffice details:
Version: 6.2.0.0.alpha0+
Build ID: bb1d5780226bb1b9156580972eea9aa849178742
CPU threads: 1; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-07-03_05:56:48
Locale: hu-HU (hu_HU); Calc: group threaded</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>