Bug 79541 - Corrupt: Inline Drawing within floating table
Summary: Corrupt: Inline Drawing within floating table
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.0.alpha0+ Master
Hardware: Other All
: high major
Assignee: Rajashri
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-02 11:15 UTC by Rajashri
Modified: 2015-08-24 14:36 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
The file contains a shape which is applied "In-line with Text". And this shape is enclosed in nested table. (31.16 KB, application/vnd.ms-word.document.12)
2014-06-02 11:15 UTC, Rajashri
Details
Roundtripped file using LibreOffice 4.4 (10.85 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-06-05 08:18 UTC, Jorendc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rajashri 2014-06-02 11:15:13 UTC
Created attachment 100289 [details]
The file contains a shape which is applied "In-line with Text". And this shape is enclosed in nested table.

After doing the initial phase of analysis, we can say that the corruption might get introduced due a shape enclosed in nested table. This shape is applied "In-Line with shape" wrapping text property.

Steps to reproduce:
1. Open file in LibreOffice
2. Click File -> Save As (Microsoft word 2007/2010(.docx))
3. It saves as .docx
4. Open the same file again which got roundtripped.

Expected Result:
The file should open properly after roundtrip.

Actual Result:
It gives a message "You cannot put drawing objects in a textbox, callout, comment, footnote or endnote".
Operating System: All
Version: 4.4.0.0.alpha0+ Master
Comment 1 Rajashri 2014-06-02 13:03:40 UTC
- Have optimised the file and was able to highlight the main area of the issue.

- The optimised file is attached.

- The Optimised file contains a table within a table. Inside the inner table there are two shapes which are having wrapping property as "In-Line with Text".

- Thus in original file, the xml is like, within table, there is another table and inside the inner table the shapes are preserved.

- During RT, LO, is first starting the alternate content and then within the textBox, the table is started.

- This leads to corruption.

- Tried to create the similar file with shaped enclosed within nested table, but the RT was succesfull.

- Need to try again for reproducing the issue

- Need to check the code for the corruption.
Comment 2 Jorendc 2014-06-03 20:34:43 UTC
I can reproduce a corruption with the attached document.

Version: 4.4.0.0.alpha0+
Build ID: b447687292334687a371b66d7ad56ba9662b898e
TinderBox: Win-x86@39, Branch:master, Time: 2014-06-03_06:24:04
Comment 3 Rajashri 2014-06-05 05:06:13 UTC
- Checked the export code. docxattributeoutput.cxx and docxsdrexport.cxx

- There is a different behaviour during code and the actual document.xml

- During the code debugging, within the alternate content there are two separate startTable and endTable. and the inline drawing is getting enclosed within these tables.

- As against this in the document.xml, within the alternateContent there is a text frame, in this text frame there is a table and in this table there is yet another textBox[For the inline drawing.]

- Had suspected on the fastserializer, that may be due to the mark() and mergeTopMarks(), the order of the elements is getting modified in the final output stream,

- Have tried adding dump statements in fastserializer.cxx to check if at any point of time there is a call to PREPEND. No such behaviour observed.
Comment 4 Rajashri 2014-06-05 08:07:17 UTC
Hi Jorendc,

I was not able tor eproduce the issue document.
Please could you give me the steps to reproduce.

Thanks.
Comment 5 Jorendc 2014-06-05 08:17:26 UTC
Hi Rajashri,

(In reply to comment #4)
> I was not able tor eproduce the issue document.
> Please could you give me the steps to reproduce.

Sure :-)

Tested using Windows 8.1 with LibreOffice Version: 4.4.0.0.alpha0+
Build ID: b447687292334687a371b66d7ad56ba9662b898e
TinderBox: Win-x86@39, Branch:master, Time: 2014-06-03_06:24:04

* Open LibreOffice
* Open your attached file
* A dialog pops up saying it is 'already in use' (which is quite strange, but I just click on 'open Copy')
* Document opens fine
* File > Save As
* Save document as .docx (Microsoft Word 2007/2010/2013 XML (.docx))

* Open document using Microsoft Word (I use version 2013)

Message: You cannot put drawing objects into a text box, callout, comment, footnote, or endnote.

I'll attach my roundtripped document which result in that error.

Kind regards,
Joren
Comment 6 Jorendc 2014-06-05 08:18:05 UTC
Created attachment 100449 [details]
Roundtripped file using LibreOffice 4.4
Comment 7 Xisco Faulí 2015-08-24 14:36:44 UTC
I can no longer reproduce this issue with

Version: 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: es-ES (es_ES)

on Windows 7 (64-bit)

Thus, I close this as RESOLVED WORKSFORME

Regarding the formatting problem when opening/saving the document, I've created bug 93621, bug 93624, bug 93625