Bug 103611 - FILEOPEN: DOCX: Objects using "bottom margin" for vertical position alignment not imported correctly
Summary: FILEOPEN: DOCX: Objects using "bottom margin" for vertical position alignment...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Tibor Nagy
URL:
Whiteboard: target:7.1.0
Keywords: filter:docx
Depends on:
Blocks: DOCX-Objects
  Show dependency treegraph
 
Reported: 2016-10-31 21:37 UTC by Luke
Modified: 2020-10-21 07:09 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
sample docx file with vertical alignment (11.79 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-10-31 21:39 UTC, Luke
Details
Compare to .doc file that is correctly imported (27.50 KB, application/msword)
2016-10-31 21:40 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2016-10-31 21:37:41 UTC
Description:
Bug 103573 fixed the horizontal import of docx shapes with alignment relative to 'Left Margin' or 'Right Margin'. The import of shapes with vertical alignment relative to 'Top Margin' and "Bottom Margin' are still unhanded.

Steps to Reproduce:
1. In Word insert image, texbox, or shape. 
2. Set vertical alignment relative to 'Top Margin' or 'Bottom Margin'
3. Save and Open in Writer

Actual Results:  
'Bottom Margin' objects are placed on the top.

Expected Results:
Same results as Word


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
Comment 1 Luke 2016-10-31 21:39:51 UTC
Created attachment 128390 [details]
sample docx file with vertical alignment
Comment 2 Luke 2016-10-31 21:40:46 UTC
Created attachment 128391 [details]
Compare to .doc file that is correctly imported
Comment 3 Xisco Faulí 2016-11-01 15:51:56 UTC
Confirmed in

Version: 5.3.0.0.alpha1+
Build ID: 64d3bd38c9242c1cc114f6e68bf13475ef679b73
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; VCL: gtk2; Layout Engine: old; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 4 Luke 2016-11-18 22:29:37 UTC
Zolnai,
The MS-DOC importer maps Word's "Top Margin" to "Entire Page". Would that work here?
Comment 5 Tamás Zolnai 2016-11-19 13:01:18 UTC
(In reply to Luke from comment #4)
> Zolnai,
> The MS-DOC importer maps Word's "Top Margin" to "Entire Page". Would that
> work here?

Hi Luke,
I don't know how DOC import exactly works, but that's true we don't have similar options as MS Word's "Top Margin" and "Bottom Margin" alignment, so a workaround can be an option. It seems DOC import handle this on the way setting alignment to "Entire Page" and somehow convert position values. If this works good enough,then it can be a good idea to implement it in DOCX import too.
Comment 6 QA Administrators 2017-12-10 16:43:47 UTC Comment hidden (obsolete)
Comment 7 Luke 2017-12-12 17:33:12 UTC
Still Version: 6.1.0.0.alpha0+ (x64)
Build ID: 61eafd7d39665dd6dc90e1d2b8ddaf7562fc58ed

Objects set with vertical alignment relative to 'Top Margin' or 'Bottom Margin' are misplaced on the page in the docx. MS-DOC file works as expected.

Miklos, any thoughts here?
Comment 8 NISZ LibreOffice Team 2020-06-17 10:03:19 UTC
The bug #133045 is similar, however this example doc contains VML, while that one contains DML shape - this might make a bit of difference, so not closing yet.
Comment 9 Commit Notification 2020-09-15 10:12:21 UTC
Tibor Nagy committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cf0c04d5fc85acbe6cbeb090de6a739a0d5a8d30

tdf#103611 sw: fix vertical alignment to page bottom margin

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 10 László Németh 2020-09-15 10:27:47 UTC
@Tibor: I've modified this bug only for the  "bottom margin" case, so you can close it. We must file a new bug for the "top margin", where we will be able to do more investigation, according to the missing top page border RelOrientation. Likely we will need a PAGE_PRINT_AREA_TOP_AREA RelOrientation (or PAGE_TOP, similar to the existing PAGE_LEFT and PAGE_RIGHT).