Download it now!
Bug 123621 - FILEOPEN | DOCX, Rectangle with text moves in LO
Summary: FILEOPEN | DOCX, Rectangle with text moves in LO
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Tibor Nagy (NISZ)
Whiteboard: target:7.1.0
Keywords: filter:docx
: 121526 (view as bug list)
Depends on:
Blocks: OOXML-Shapes WPSShapeTextImport-Change
  Show dependency treegraph
Reported: 2019-02-21 10:56 UTC by NISZ LibreOffice Team
Modified: 2020-09-10 10:48 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

The original file (28.12 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-02-21 10:56 UTC, NISZ LibreOffice Team
Screenshot of the original document side by side in Word and Writer. (322.03 KB, image/png)
2019-02-21 10:57 UTC, NISZ LibreOffice Team
The example file in Writer 5.2 and 5.3 (118.53 KB, image/png)
2020-07-08 08:22 UTC, NISZ LibreOffice Team
Simplified example file (19.35 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-07-08 08:43 UTC, NISZ LibreOffice Team

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2019-02-21 10:56:11 UTC
When the attached document gets opened in LO the rectangle moves downward.

Steps to Reproduce:
    1. Open the attached document in LO and MSO.
    2. Notice the diffenrences.

Actual Results:
The rectangle moved downward.

Expected Results:
The rectangle should stay in the same place.

Reproducible: Always

User Profile Reset: No

Additional Info:
Comment 1 NISZ LibreOffice Team 2019-02-21 10:56:40 UTC
Created attachment 149473 [details]
The original file
Comment 2 NISZ LibreOffice Team 2019-02-21 10:57:01 UTC
Created attachment 149474 [details]
Screenshot of the original document side by side in Word and Writer.
Comment 3 raal 2019-02-21 20:36:56 UTC
Confirm with Version:
Build ID: 465939feb0e9c382e5581b53b72008979ece4807
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
In older versions are another problems.
Comment 4 NISZ LibreOffice Team 2020-07-08 08:22:03 UTC
Created attachment 162781 [details]
The example file in Writer 5.2 and 5.3

This started in 5.3, before it was differently bad.
Comment 5 NISZ LibreOffice Team 2020-07-08 08:43:21 UTC
Created attachment 162782 [details]
Simplified example file

This file shows the problem in more detail: the left and right text boxes have a bottom and a top margin of 0.5 cm set in Word.
When opened in Writer these values are imported correctly (see Format - Text Box and Shape - Text Attributes dialog) but are applied incorrectly:
Left shape has 1cm bottom margin and the right shape has 0.5 cm top and bottom margins - so the top value is added to the bottom in all cases, even if it is modified in the Text Attributes dialog.

There was a change in commit:
author	Miklos Vajna <>	2016-10-25 09:05:47 +0200
committer	Miklos Vajna <>	2016-10-25 09:32:01 +0000

tdf#84678 DOCX import: fix handling of textbox margins

Before this the top margin value was not applied to the text box, although changing the top margin in the Text Attributes dialog still increased the bottom margin, which is probably the real problem here.
Comment 6 NISZ LibreOffice Team 2020-07-08 09:03:47 UTC
The behavior of attachment #162782 [details] changed in 4.4.0 - before in 4.3 they were imported as frames with correct internal padding values.
Comment 7 Commit Notification 2020-07-15 14:23:24 UTC
Tibor Nagy committed a patch related to this issue.
It has been pushed to "master":

tdf#123621 sw: fix textbox position according to DOCX

It will be available in 7.1.0.

The patch should be included in the daily builds available at in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 8 BogdanB 2020-07-20 19:38:06 UTC
It's ok now.

Verified in
Build ID: abea0d6647c7f1f7e76c73c26cb80e6a67dc5111
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 9 Tibor Nagy (NISZ) 2020-07-24 07:52:43 UTC
*** Bug 121526 has been marked as a duplicate of this bug. ***