Bug 135720 - FILEOPEN DOCX Vertically aligned shapes appear on top of each other if anchored to header/footer
Summary: FILEOPEN DOCX Vertically aligned shapes appear on top of each other if anchor...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Tibor Nagy
URL:
Whiteboard: target:7.1.0
Keywords: filter:docx
Depends on:
Blocks: OOXML-Shapes
  Show dependency treegraph
 
Reported: 2020-08-13 14:42 UTC by NISZ LibreOffice Team
Modified: 2020-09-11 18:44 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word with shapes aligned relative to bottom margin, anchored to header (22.60 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-08-13 14:42 UTC, NISZ LibreOffice Team
Details
Example file from Word with shapes aligned relative to bottom margin, anchored to footer (20.04 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-08-13 14:43 UTC, NISZ LibreOffice Team
Details
Example file from Word with shapes aligned relative to bottom margin, anchored to document body (19.39 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-08-13 14:43 UTC, NISZ LibreOffice Team
Details
Documents with shapes anchored to document body or header side by side in Word (113.49 KB, image/png)
2020-08-13 14:44 UTC, NISZ LibreOffice Team
Details
Documents with shapes anchored to document body or header side by side in Writer (116.77 KB, image/png)
2020-08-13 14:45 UTC, NISZ LibreOffice Team
Details
Documents with shapes anchored to document body or footer side by side in Word (98.63 KB, image/png)
2020-08-13 14:45 UTC, NISZ LibreOffice Team
Details
Documents with shapes anchored to document body or footer side by side in Writer (113.18 KB, image/png)
2020-08-13 14:46 UTC, NISZ LibreOffice Team
Details
Example with image in top, center, bottom, inside, outside (26.47 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-08-24 20:09 UTC, Regina Henschel
Details
the triangle looks fine now (227.74 KB, image/png)
2020-09-11 18:44 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-08-13 14:42:06 UTC
Created attachment 164266 [details]
Example file from Word with shapes aligned relative to bottom margin, anchored to header

This is followup to bug #133071
If shapes are in Word vertically aligned relative to the bottom margin now they appear correctly positioned in Writer: vertically at the top/center/bottom of the footer.
However of they are anchored not inside the document body but in its header/footer, they appear on top of each other at the bottom of the footer.
Word does not seem to make any difference based on the anchoring point, the shapes show up vertically at the top/center/bottom of the footer in all three cases.

Steps to reproduce:
    1. Open attached documents

Actual results:
The three triangles appear at the bottom of the footer, on top of each other.

Expected results:
The triangles appear vertically at the top/center/bottom of the footer.

LibreOffice details:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: <buildversion>
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
(nightly from 08-13)
Comment 1 NISZ LibreOffice Team 2020-08-13 14:43:14 UTC
Created attachment 164268 [details]
Example file from Word with shapes aligned relative to bottom margin, anchored to footer
Comment 2 NISZ LibreOffice Team 2020-08-13 14:43:28 UTC
Created attachment 164269 [details]
Example file from Word with shapes aligned relative to bottom margin, anchored to document body
Comment 3 NISZ LibreOffice Team 2020-08-13 14:44:27 UTC
Created attachment 164270 [details]
Documents with shapes anchored to document body or header side by side in Word
Comment 4 NISZ LibreOffice Team 2020-08-13 14:45:30 UTC
Created attachment 164271 [details]
Documents with shapes anchored to document body or header side by side in Writer
Comment 5 NISZ LibreOffice Team 2020-08-13 14:45:47 UTC
Created attachment 164272 [details]
Documents with shapes anchored to document body or footer side by side in Word
Comment 6 NISZ LibreOffice Team 2020-08-13 14:46:28 UTC
Created attachment 164273 [details]
Documents with shapes anchored to document body or footer side by side in Writer
Comment 7 Regina Henschel 2020-08-14 13:18:43 UTC
I'm confused. I have got the request for a positioning "from" relative to "bottom margin". That is now resolved in https://issues.oasis-open.org/browse/OFFICE-4073.
That corresponds in MS Word to "Absolute position" below "Bottom Margin". That is a positioning relative to a "line" as reference.

Now you are doing something different. You do a positioning relative to an "area". I'm not against it, but you should not introduce this without taking care how this can be added to ODF.

Also the UI has to be reconsidered. "Page text area bottom" is the bottom edge of the page text area. That is the line between the areas "Page text area" and "Bottom page margin". And "Top", "Center" and "Bottom" would be relative to this line; which means "Center" to "Page text area bottom" has to put the shape so, that the bottom edge of the page text area goes through the center of the shape.

So please before going on, describe how do you want that this is defined in ODF and how the UI for it should be.
Comment 8 Commit Notification 2020-08-24 15:32:21 UTC
Tibor Nagy committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6788133b3bdf02097d66a99047aa7bcba3a99a66

tdf#135720 sw: fix PAGE_PRINT_AREA_BOTTOM alignment with footer

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 László Németh 2020-08-24 15:51:51 UTC
(In reply to Regina Henschel from comment #7)
 
> So please before going on, describe how do you want that this is defined in
> ODF and how the UI for it should be.

This is only a clean-up for commit d54264e34c1ccc0eaf4178ab165a843028500223
(tdf#133071 DOCX import: fix vertical alignment to bottom page margin),
which has the same problem related to standardization. Miklós' implementation
uses only "from top" alignment of bottom margin, but Word supports "top" and
"center" alignments of the area below page text are bottom.

All possible settings of Positions and size are area, not an edge. For example, "margin" means the area of the paragraph text area extended with the top margin of the paragraph (interestingly without the bottom margin of the paragraph).
Now "page text area bottom" means the area between page text area bottom and page bottom. Likely if we want full DOCX interoperability, we will need page text area top, too. You are right, we can find better names for these area, for example, "top page margin" or "bottom page margin". Thank you for your review and standardization work! If the recent ODF standard doesn't cover the recent solution, we would like to ask your help again!
Comment 10 Regina Henschel 2020-08-24 20:09:55 UTC
Created attachment 164653 [details]
Example with image in top, center, bottom, inside, outside

There is something wrong:
A) The images are not rendered. They are visible in pdf and thumbnail, but neither in edit mode nor print preview.
B) The position "outside" touches the bottom page edge in Word, but is "top" in LO.

Tested with Version: 7.1.0.0.alpha0+ (x64)
Build ID: 5e8875780d665b7ae0fee1a053b5ce78ec513f69
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL

The images are anchored to header.

It would be nice to get a better proposal next time.

The wording is a problem, because ODF uses the CSS box-model and there you have from outer to inner:
page margin: from page edge to outer border edge
border: from outer border edge to inner border edge
padding: from inner border edge to content edge
If you have a nice idea, which does not use "margin", please let me know.
Comment 11 Regina Henschel 2020-08-28 16:16:10 UTC
Position of "outside" is wrong, see my previous comment.
Comment 12 Regina Henschel 2020-08-31 23:24:18 UTC
The missing images I mentioned in comment#10, is a separate problem, see bug 136324.
Comment 13 BogdanB 2020-09-11 18:44:07 UTC
It's ok now
Version: 7.1.0.0.alpha0+
Build ID: 3a22f5a589e822e7ca8bbb00e38a3aff93ed7ba5
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 14 BogdanB 2020-09-11 18:44:42 UTC
Created attachment 165403 [details]
the triangle looks fine now