Bug 69648 - FILEOPEN: DOCX Import renders text-boxes with text alignement (text anchoring property of frame) wrong
Summary: FILEOPEN: DOCX Import renders text-boxes with text alignement (text anchoring...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.1.1 rc
Hardware: Other All
: medium normal
Assignee: Attila Bakos (NISZ)
URL:
Whiteboard: BSA target:7.4.0
Keywords:
Depends on:
Blocks: DOCX-Grouped-Shapes
  Show dependency treegraph
 
Reported: 2013-09-21 16:04 UTC by Adam CloudOn
Modified: 2022-03-10 10:04 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX containing two shapes side-by-side with text inside each of them (25.81 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-09-21 16:04 UTC, Adam CloudOn
Details
Screenshot comparison between MS Word and LibreOffice (116.39 KB, image/png)
2013-09-21 16:07 UTC, Adam CloudOn
Details
The example document in current master (226.42 KB, image/png)
2022-01-11 14:39 UTC, Gabor Kelemen (allotropia)
Details
desired state in LO 7.4 (78.31 KB, image/jpeg)
2022-02-10 18:08 UTC, Attila Bakos (NISZ)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam CloudOn 2013-09-21 16:04:41 UTC
Created attachment 86263 [details]
DOCX containing two shapes side-by-side with text inside each of them

Problem description: 
When LO opens a DOCX that has 2 text-boxes side-by-side with text in them - the text inside the text-boxes is aligned to the center, instead of to the sides.

Steps to reproduce:
1. Load the attached DOCX in LO
2. The text is aligned in the text-boxes to the center

Current behavior:
LO renders the text in both text-boxes in the center

Expected behavior:
LO should render the text in both text-boxes to the left & right
              
Operating System: All
Version: 4.2.0.0.alpha0+ Master
Comment 1 Adam CloudOn 2013-09-21 16:07:54 UTC
Created attachment 86264 [details]
Screenshot comparison between MS Word and LibreOffice
Comment 2 Cor Nouws 2013-09-25 19:39:39 UTC
I reproduce the problem in 4.1.2.2
(Did not yet check in older versions).

To look in details of the issue:
- select shape in Writer
- click Shft-F10 (context menu)
- choose Group > Ungroup
- now for the left shape > context menu
-   > Text .. Text anchor top left, OK
  > text in correct position
(Same for the frame right,  wih text anchor top right)

 - Should be checked in previous versions
 - Should be searched for duplicates
Comment 3 Cor Nouws 2013-09-25 19:42:48 UTC
3.3.4 and 4.0.5.2 show no drawing frames at all.
So it's an not yet implemented detail of a recent implemented improved import
Comment 4 Cor Nouws 2013-09-25 19:48:44 UTC
In 4.1.0.x there is no visible import at all
In 4.1.1.2 the frames are visible. so prolly 4.1.1.1 is the first version
Comment 5 Xisco Faulí 2014-02-24 17:07:20 UTC
it's still present in:
   - Libreoffice 4.1.4.2 Build  ID: 0a0440ccc0227ad9829de5f46be37cfb6edcf72
   - Libreoffice 4.2.1.1 Build  ID: d7dbbd7842e6a58b0f521599204e827654e1fb8b

In Libreoffice 4.3.0.0.alpha0 ID: f839b5dd16c05c0eda21345ec36ec0cb024eb732 left text is imported correctly but not the right one
Comment 6 Joel Madero 2015-05-02 15:44:23 UTC Comment hidden (obsolete)
Comment 7 Buovjaga 2015-06-21 13:51:48 UTC
Now text is left-aligned in both boxes.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 3ecef8cedb215e49237a11607197edc91639bfcd
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-19_23:16:58
Locale: fi-FI (fi_FI)
Comment 8 QA Administrators 2016-09-20 10:11:40 UTC Comment hidden (obsolete)
Comment 9 Xisco Faulí 2016-10-09 22:34:56 UTC
text being left-aligned still reproducible in

Version: 5.3.0.0.alpha0+
Build ID: ae3ec79354f7b4967e736c6a4cd7c08fc52e2b7d
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 10 Xisco Faulí 2017-10-03 14:17:28 UTC
Still reproducible in

Version: 6.0.0.0.alpha0+
Build ID: 34e8fd7e99489e9f50a512b07c6f3923b358b4d3
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 11 QA Administrators 2018-10-04 02:56:03 UTC Comment hidden (obsolete)
Comment 12 sdc.blanco 2019-10-30 00:43:03 UTC
Text is still left-aligned in both boxes, as first reported in comment 7

Version: 6.3.3.1 (x64)
Build ID: f41f4c7f9507aeca13cb9df51f34d80e8ba30a99
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win;
Comment 13 Regina Henschel 2019-10-30 11:58:18 UTC
Problem seems to be handling of <w:bidi> element in a group.
Ungrouping the frames and resaving in Word365 solves it.

Remark: The "alignment" in the right frame is not a paragraph alignment, but is the result of right-to-left text direction by an <w:bidi> element.
Comment 14 NISZ LibreOffice Team 2020-09-08 14:35:10 UTC
(In reply to Regina Henschel from comment #13)
> Problem seems to be handling of <w:bidi> element in a group.
> Ungrouping the frames and resaving in Word365 solves it.
> 

Grouped shape meta then.
Comment 15 Xisco Faulí 2021-03-18 09:07:10 UTC
in

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: d7ed130f537a81b900c55d222004cc9e88c0b355
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

text is aligned to the left
Comment 16 Gabor Kelemen (allotropia) 2022-01-11 14:39:46 UTC
Created attachment 177459 [details]
The example document in current master

This started to look a bit more bad in:

https://git.libreoffice.org/core/+/2951cbdf3a6e2b62461665546b47e1d253fcb834

author	Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>	Wed Nov 10 14:10:11 2021 +0100
committer	László Németh <nemeth@numbertext.org>	Mon Jan 03 14:28:15 2022 +0100

tdf#143574 OOXML export/import of textboxes in group shapes

The textframes are positioned to be outside of the group to the top and the left by a few cm, this can be seen when the group is moved to the bottom and right a bit.

A bit of good news is that in bibisect-7.4 master after the fix to bug 66039 the blue (right side) text boxes text is right aligned, as in Word:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: bf883027ee62ece0844730572305094f53daa521
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded
Comment 17 Attila Bakos (NISZ) 2022-02-10 18:08:22 UTC
Created attachment 178197 [details]
desired state in LO 7.4

fix is on gerrit here: https://gerrit.libreoffice.org/c/core/+/129796
Comment 18 Commit Notification 2022-03-02 08:12:29 UTC
Attila Bakos (NISZ) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9c0779cfe6a091e222a35b068e9354dce32cc2dc

tdf#69648 tdf#119234 sw: fix at-char group textbox position

It will be available in 7.4.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 19 NISZ LibreOffice Team 2022-03-10 10:04:47 UTC
Verified in:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 6adabd915d931b845fcf2fef15fbf3fca14ec9b3
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded