https://bugs.documentfoundation.org/show_bug.cgi?id=166710

            Bug ID: 166710
           Summary: FILEOPEN DOCX layoutincell: don't force top vertical
                    alignment in cell just because it contains a fly
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: filter:docx
          Severity: minor
          Priority: low
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
            Blocks: 162618

Created attachment 200939
  --> https://bugs.documentfoundation.org/attachment.cgi?id=200939&action=edit
tdf37153_squareWrap.docx: example document

In DOC format, a cell that contains a floating object (a layout-in-cell fly)
forces the cell contents to be top aligned. However, for DOCX format that
doesn't apply (unless it has layout option doNotVertAlignCellWithSp).

Bug 37153 deals with this concept in regards to the layout flag.

Layout-in-cell (aka FollowTextFlow using LO terminology) was already supported
in OOo, so this is an inherited problem. In OOo 3.3, our example document
appears to be treated this as a doNotVertAlignCellWithSp. This is basically 
what it looks today, although in between it has changed many times. 

The point is that it has never been correct.

There are two things that need to be corrected:
-   if ( bConsiderWrapOnObjPos ||     # sw/source/core/layout/tabfrm.cxx
+   if ( /* bConsiderWrapOnObjPos || */
and then properly place the image at the bottom of the cell.

The image is layout-in-cell. So it should usually be contained within the cell
boundaries. An exception is when the fly is css::text::WrapTextMode_THROUGH
('Behind text' or 'In front of text' to use MS terms). But even in that case,
the layout should ATTEMPT to keep everything inside the cell, and only escape
after the anchor paragraph has been pushed to the top of the cell.

I noticed that Microsoft's UI tries really hard to suggest offset values that
push the anchor paragraph to the top of the cell. I'm sure they did that to
emulate how older Word versions were going to display it. In other words, when
you make any changes to the wrapping, the Word application sets offset values
that would match the layout of doNotVertAlignCellWithSp. However, if you
override those values, you can see that there actually is no forcing of a top
alignment anymore.

Steps to reproduce:
-open tdf37153_squareWrap.docx

In MS Word, the image is at the bottom of the cell, with the anchor paragraph
just above it.
Currently, LO treats this non-wrap-through image as doNotVertAlignCellWithSp.
In the case of wrap-through flies (like ooxmlexport24's
tdf37153_considerWrapOnObjPos.docx), the fly has escaped the cell boundaries
and is underneath the cell.

Marking as low priority, because MOST documents will accidentally look OK.


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=162618
[Bug 162618] [META] MSO layoutInCell / LO IsFollowingTextFlow
-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to