Created attachment 144783 [details] Sample DOCX The tables in the attached DOCX went between Word and Writer back and forth, that's why they are both in frames. In Writer the first table isn't shown. The likely cause appears to be the following piece of XML in word\document.xml: <w:pPr> <w:rPr> <w:vanish/> </w:rPr> </w:pPr> If the supposedly invisble content is removed from the document via Inspect Document in Word, both tables appear in Writer (positioning is slightly off, though). Observed using LO 6.2 daily build (2018-09-07_23:40:38, 9a9b81c7212fa6a6762246593acf3f1950677a22) & 4.0.0.3 / Windows 7. In 3.5.0.3 that one showing table appears worse.
Created attachment 144784 [details] Sample DOCX with "hidden text" removed There's no actual hidden text in the original, just the mentioned element.
Created attachment 144785 [details] Screenshot in Word
Created attachment 144786 [details] PDF exported in Word Interestingly, frame placement shows the same difference in the exported PDF as the good DOCX displays in Writer.
(In reply to Aron Budea from comment #0) > If the supposedly invisble content is removed from the document via Inspect > Document in Word, both tables appear in Writer (positioning is slightly off, > though). (In reply to Aron Budea from comment #3) > Interestingly, frame placement shows the same difference in the exported PDF > as the good DOCX displays in Writer. Most likely if the supposedly empty paragraph is removed, that adjusts position of the second frame/table (in Word as well).
Confirmed. Arch Linux 64-bit Version: 6.2.0.0.alpha0+ Build ID: 36befb3aca96907a14e71e82497dbb8f03ead5ab CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; Locale: fi-FI (fi_FI.UTF-8); Calc: threaded Built on 3 October 2018
And the table is actually still there, just hidden: enabling dispaly of Hidden text under Options→Writer→Formatting Aids shows that.
The problem here seems to be that <w:rPr> under <w:pPr> is the properties of *paragraph mark* only (ECMA-376 Part 1 sect. 17.3.1.29), not properties of all runs of the paragraph.
Created attachment 147060 [details] A minimal "vanish" document In the attachment, there are 3 paragraphs ("Para1", "Para2", and "Para3"), of which Para2 has the w:vanish under w:pPr/w:rPr. The document shows that LibreOffice does not always hide everything in the paragraph with this setup. Word just joins the two paragraphs (Para2 and Para3) together, as if the paragraph mark didn't exist (visible when Word's "Show/Hide ¶" is not shown, and on print preview). LibreOffice does not ignore the paragraph mark (absent functionality?), and does not hide the plain paragraph's text - but seems to be hiding the anchored objects.
Code pointer: look for LN_EG_RPrBase_vanish in writerfilter/source/dmapper/DomainMapper.cxx
Still reproducible in Version: 6.4.0.0.alpha1+ Build ID: de4839e66d3d195315729b95cc144cdab96b6e74 CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US Calc: threaded
(In reply to Mike Kaganski from comment #9) > Code pointer: look for LN_EG_RPrBase_vanish in > writerfilter/source/dmapper/DomainMapper.cxx Let's turn it into an easyhack then...
This probably is closer to "impossible" than easy. The first thing is to ignore DOCX and make non-hidden anchored objects possible in LO itself (without breaking existing documents).
tdf#119800 DOCX import: fix vanished objects Not hidden objects, for example shapes and tables were converted to hidden text, when they were anchored to empty hidden paragraphs (see w:vanish character property in OOXML). Note: now DOCX round-trip doesn't change the document layout (previously DOCX export hid the vanished object), but Writer shows also an extra empty paragraph with the fixed object, so the layout is still not the same here. Follow-up of commit 2be656908e9f30d0b0f795cc67096f0d673a3a21 (tdf#128646 DOCX import: don't hide shape of hidden paragraph), extending the fix also for not table paragraphs.
László Németh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ab25bf4b2c51e5634bdfeaa1f84af4bb652f7a47 tdf#119800 DOCX import: fix vanished objects It will be available in 7.0.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.
*** Bug 97677 has been marked as a duplicate of this bug. ***