Bug 99822 - FILEOPEN: Floating table objects in tables horizontal position relative to margin is wrong in Writer
Summary: FILEOPEN: Floating table objects in tables horizontal position relative to ma...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: compatibilityMode14 target:24.2.0 tar...
Keywords: bibisected, bisected, filter:docx, regression
: 158213 (view as bug list)
Depends on:
Blocks: DOCX-Floatingtable
  Show dependency treegraph
 
Reported: 2016-05-13 07:45 UTC by RomaNick
Modified: 2023-11-20 19:26 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
page 4-7 (62.17 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-05-13 07:45 UTC, RomaNick
Details
WPS Office, analogously to MS (467.42 KB, image/jpeg)
2016-05-17 10:43 UTC, RomaNick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RomaNick 2016-05-13 07:45:15 UTC
Created attachment 125030 [details]
page 4-7

Hello.
It does not fix the correct location of objects. In MS Office & WPS office opens correctly. The LO 4.4.7.2 do not see pictures of the objects
Comment 1 Cor Nouws 2016-05-13 20:55:35 UTC
Hi RomaNIck,

Thanks for reporting.

Confirmed in Version: 5.2.0.0.alpha1+
Build ID: 52871b360c73efd59bfbc811b8b89a02b6375b29

that the objects on page 4-7 are positioned in the wrong table cell.
Can you maybe provide a screen shot of the correct situation?
Ciao - Cor
Comment 2 RomaNick 2016-05-17 10:43:19 UTC
Created attachment 125109 [details]
WPS Office, analogously to MS
Comment 3 Telesto 2016-12-11 14:11:29 UTC
Relating frame position: 

Repro with:
Version: 5.4.0.0.alpha0+
Build ID: 84f2ff67a7e404febf710b1dc7f66d06745c503f
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-12-09_23:20:01
Locale: nl-NL (nl_NL); Calc: CL

Position of frame with the table seems quite good in:
LibreOffice 3.5.7.2 
Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b

I also created a new bug report related to the inconsistent pie chart color (bug 104579)
Comment 4 Xisco Faulí 2017-03-10 14:25:41 UTC
tables position regression introduced by:

author	Cédric Bosdonnat <cedric.bosdonnat@free.fr>	2013-02-20 10:04:16 (GMT)
committer	Cédric Bosdonnat <cedric.bosdonnat@free.fr>	2013-02-20 10:17:00 (GMT)
commit d0cde9640b52ccfbb28ed1f65bba0927afd7b69b (patch)
tree 18c6342798d98ff8559a3cf26dac4994a2f82998
parent a633a96c3a50d803e5fa43b603edc0b8e2e34b6e (diff)
n#779642: Fixed floating tables import in writerfilter
Comment 5 Xisco Faulí 2017-07-19 20:56:01 UTC
Still reproducible in

Version: 6.0.0.0.alpha0+
Build ID: bde72cdae1e7e001d5089c5284672c976b8e43df
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 6 Xisco Faulí 2017-07-19 21:00:31 UTC Comment hidden (obsolete)
Comment 7 Tamás Zolnai 2017-07-20 10:36:30 UTC
(In reply to Xisco Faulí from comment #6)
> Hi Tamás,
> This issue was introduced by the same commit that introduced bug 109053,
> which was recently fixed by you in commit
> fc55711f01af172eb3a034454405fa941454c781. Would you mind taking a look at it
> when you have some spare time ?
> Regards

Hi Xisco,

There is an ugly hack in the code related to tables. Sometimes tables are imported as simple Writer tables, sometimes as a table inside a text frame (called floating table). The second one is used to workaround the missing features of Writer tables compared to Word tables. It's not something I can fix easily. For bug 109053 it was easy to avoid this floating table stuff and import the table as simple a Writer table, but otherwise it's hard to handle this kind of bugs. So I would not dig myself in this problem now.
Comment 8 QA Administrators 2018-07-21 02:40:03 UTC Comment hidden (obsolete)
Comment 9 Timur 2018-11-19 10:01:19 UTC
Repro 6.3+. Can be a duplicate of Bug 80869.
Comment 10 Xisco Faulí 2020-03-30 16:34:24 UTC
The issue is still reproducible in

Version: 7.0.0.0.alpha0+
Build ID: 11e6582b23b983fde4b04ece5b37c546bcd98a43
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

but it improved after https://cgit.freedesktop.org/libreoffice/core/commit/?id=4d5c0eaf3e0d3d3bcd9e691fffee19b75f3d6631

@László Németh, I thought you might be interested in this issue...
Comment 11 Justin L 2020-06-03 09:39:56 UTC
It looks to me like this is simply using the wrong anchoring. It should be relative to the cell margins, but it is being positioned relative to the page. NISZ guys have been going some work in this area, but this document isn't fixed yet in 7.1+.
Comment 12 NISZ LibreOffice Team 2020-06-03 10:40:35 UTC
(In reply to Justin L from comment #11)
> It looks to me like this is simply using the wrong anchoring. It should be
> relative to the cell margins, but it is being positioned relative to the
> page. NISZ guys have been going some work in this area, but this document
> isn't fixed yet in 7.1+.

Those are floating tables inside non-floating ones and the automatically added frame has wrong anchoring. We did not dare to touch such... yet.
Comment 13 QA Administrators 2023-01-12 03:21:21 UTC Comment hidden (obsolete, spam)
Comment 14 Roman Kuznetsov 2023-04-22 08:53:20 UTC
Miklos, the attached file with float table crashes LO in current master. 
I think it's one from crashes after your great float table work.
Comment 15 Miklos Vajna 2023-04-24 07:26:34 UTC
I hope to get to this in the near future.
Comment 16 Justin L 2023-05-19 15:38:36 UTC
The crash was fixed by 7.6 commit 1795d5183d5371a24e8dcb15f8671c78b2c94665
Author: Miklos Vajna on Fri Apr 28 08:28:22 2023 +0200
    sw floattable, crashtesting: fix PDF export of tdf114111-3.docx

The document looks pretty good now. There are what look like image size problems - where the image/wrapping is too large to fit in the expected cell, and so extra white space is seen.
Comment 17 Miklos Vajna 2023-05-31 09:01:32 UTC
Looking at the first chart on page 4, that also crosses the vertical cell border between A1 and B1 in Word. But their chart background is transparent, while in LO the chart area is filled with white.

As an additional data point, binary DOC does the same in Word, so old Word used to have white background, now it's transparent, but Writer even has it as white today.

Looks like a chart problem, not a DOCX / floating table problem by now, as the metabug would suggest.
Comment 18 Gabor Kelemen (allotropia) 2023-10-11 12:23:09 UTC
This changed recently: in current master opening the example file causes an endless loop, since:

https://git.libreoffice.org/core/+/5127b1961b762643d47a26704556fd9b8664c6fc

author	Miklos Vajna <vmiklos@collabora.com>	Wed Sep 13 08:14:19 2023 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	Wed Sep 13 11:35:07 2023 +0200

sw floattable, nesting: add DOCX import
Comment 19 Miklos Vajna 2023-10-25 12:26:01 UTC
There are two problems here. Comment 17 explains the original problem, as I understand it. Bisect points out that I fixed that already in commit 63007619da7e6c4a6d0c466a8fe54324252be14b (tdf#144798 DOCX import: handle ZOrder of chart objects, 2021-10-18) during the 7.3 development cycle.

Let's focus on the other problem here, that the recent floating table effort results in a layout loop here. I'll look at that.
Comment 20 Commit Notification 2023-10-27 07:48:45 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/435f1aadf7dd8087a8997924bedfccff0f496ba2

tdf#99822 sw floattable: allow nomimal overlap of objects from different cells

It will be available in 24.2.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 21 Commit Notification 2023-10-31 08:50:47 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#99822 sw floattable: allow nomimal overlap of objects from different cells

It will be available in 7.6.3.

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 22 Miklos Vajna 2023-11-06 10:23:15 UTC
Hm, forgot to add a test, will create one.
Comment 23 Commit Notification 2023-11-06 23:35:41 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0bf60e32c0ac2bf79fad6c29c39c6f6a3f9ce8e8

tdf#99822 sw floattable: testcase for objects from different cells

It will be available in 24.2.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 24 Gabor Kelemen (allotropia) 2023-11-14 22:30:13 UTC
*** Bug 158213 has been marked as a duplicate of this bug. ***
Comment 25 Commit Notification 2023-11-20 19:26:28 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#99822 sw floattable: testcase for objects from different cells

It will be available in 7.6.4.

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.