Description: This may be related to a lot of other bugs, but I'm not sure. There is a frame in the test file. Within the frame, there is a table with only one cell. Within this, there is a small image. (The table is put into a frame, so you can move it around in LO Writer) Steps to Reproduce: 1. open the test file in Writer Actual Results: The image is outside the frame Expected Results: The image should be in the frame (see attached PDF) Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Created attachment 139195 [details] test file
Created attachment 139196 [details] LO Writer (current master) render
Created attachment 139197 [details] MSO 2013 render
Confirmed in Version: 6.1.0.0.alpha0+ Build ID: 226804c8f7d2306562380283edfd919a88863807 CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded Version: 5.2.0.0.alpha0+ Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53 Threads 4; Ver: 4.10; Render: default; Version: 4.3.0.0.alpha1+ Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a) LibreOffice 3.3.0 OOO330m19 (Build:6) tag libreoffice-3.3.0.4
Confirmed Version: 5.4.4.2 (x64) Build ID: 2524958677847fb3bb44820e40380acbe820f960 CPU threads: 4; OS: Windows 6.19; UI render: default; Locale: bg-BG (bg_BG); Calc: group Version: 6.1.0.0.alpha0+ Build ID: d28e10b095b4ee0986fbe86170928bf077da04b9 CPU threads: 4; OS: Windows 10.0; UI render: default; TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2018-01-13_22:59:50 Locale: bg-BG (bg_BG); Calc: group threaded
I investigated the problem but I couldn't find it's cause... The anchor is set completely wrong. The absolute position "nTopOfAnch" in sw/layout is somewhere at 1700, but it has to be much more in the test file. The option "layoutInCell" of the docx is somehow recognized because manipulating this value leads to an even worse rendering of the document ... But then I get lost in the code and I think that some writer expert has to take a deeper look here.
Hi! A small update on this bug. After import, the doc model dump (nodes.xml) indicates that the image is not located within the table at all. It is attached independ of the table at a separate (empty) node (Thanks to Miklos for the hint!). This seems like a reasonable conclusion, since the image is put at the very beginning of the page and it's anchor is somewhere off the page. But this can be "fixed" by disabling the "SectionPropertyMap::FloatingTableConversion" in PropertyMap.cxx to avoid calling SwXText::convertToTextFrame. Then, the table layout gets lost (that's bad) but the image is put in context of the table in the nodes.xml. Additionally, the image is placed at the right position within the table! So, import of all components seems right, but the floating talbe conversion breaks the bonding of table and image.
Another info: Disabling/removing line 1689 in sw/core/unocore/unotext.cxx: -> aAnchor.SetAnchor(aMovePam.Start()); <- in function SwXText::convertToTextFrame actually leads to a correct result. Then, the old anchor (at node 9) is not overwritten by the new anchor (at node 22). I have no idea where the node 22 comes from. The content of nodes.xml and the resulting render looks good if the image is anchored at node 9. So maybe this info helps for future work on this bug!
Created attachment 141194 [details] Another test file The second test file contains 2 images. They should be located within the table but appear to be outside
Patrick Jaap committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/4d9dda3fd096b9bffba5a07243a86208affd893f%5E%21 tdf#115094 part I: do not move graphic nodes It will be available in 6.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.
Patrick Jaap committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/c3c80b6b63e998fd3117b5039e65a2ee9df90954%5E%21 tdf#115094 Part II: OOXML Feature: Add layoutInCell to Doc model It will be available in 6.3.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.
A polite ping to Patrick Jaap: Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing? Thanks
Still WIP. A final (3rd) patch is almost there :)
Patrick Jaap committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/02ba8155edd409ab249e04d317181a2ef8045191%5E%21 tdf#115094 part III: DOCX export: export floating tables directly It will be available in 6.3.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.
Bus is fixed in current master
Bug is fixed in current master
This bug is fiex in 6.3 Version: 6.3.0.0.alpha0+ Build ID: 9bc10964f0673b64e282ad567d08bf7ebba4df65 CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-01-27_18:08:30 Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US Calc: threaded
Patrick Jaap committed a patch related to this issue. It has been pushed to "libreoffice-6-2": https://git.libreoffice.org/core/+/a454fe6ca36924bfcb0db984aab54ad5242949f0%5E%21 tdf#115094 Part II: OOXML Feature: Add layoutInCell to Doc model It will be available in 6.2.1. 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.
Patrick Jaap committed a patch related to this issue. It has been pushed to "libreoffice-6-2": https://git.libreoffice.org/core/+/d8f427ae7b96fcdc74f45517843c28617a709f8b%5E%21 tdf#115094 part III: DOCX export: export floating tables directly It will be available in 6.2.1. 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.