<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 - ODF export: text:anchor-type="page" + style:horizontal-rel="paragraph" etc. invalid combinations"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=135464">135464</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ODF export: text:anchor-type="page" + style:horizontal-rel="paragraph" etc. invalid combinations
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>Inherited From OOo
          </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>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>michael.stahl@cib.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>rb.henschel@t-online.de, vmiklos@collabora.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Writer can produce documents with combinations of anchor-type and
horizontal-rel that are invalid according to ODF 1.3, 20.298
style:horizontal-pos.

for "page" anchor, "paragraph", "paragraph-content", "paragraph-end-margin",
"paragraph-start-margin", "char" are invalid.

to create such a document:
1. insert a shape (or image/frame/ole, 2 different implementations of it)
2. use context menu "Anchor->To Page"

now the Properties dialog will show Page (because the actual value "Paragraph
area" isn't valid) but when you save the file it actually writes "paragraph".

it looks like if the anchor is FLY_AT_PAGE, the anchor frame is always going to
be SwPageFrame, and there is only one difference in the layout code that i can
find where things are different between the horizontal-rel values:

flylay.cxx: CalcClipRect() has this:

            if( rH.GetHoriOrient() != text::HoriOrientation::NONE &&
                rH.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
            {
                aRectFnSet.SetLeft( rRect, aRectFnSet.GetPrtLeft(*pClip) );
                aRectFnSet.SetRight(rRect, aRectFnSet.GetPrtRight(*pClip));
            }

but no corresponding case for PAGE_PRINT_AREA.

so i hope we might be able to easily fix this on ODF import for 3 of the 4
invalid cases.</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>