Bug 106262 - FILESAVE bad handling of text which is added to an OLE object
Summary: FILESAVE bad handling of text which is added to an OLE object
Status: CLOSED DUPLICATE of bug 112547
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OLE-Object-Interoperability ODF-export-invalid
  Show dependency treegraph
 
Reported: 2017-03-01 18:10 UTC by Regina Henschel
Modified: 2017-10-24 09:51 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2017-03-01 18:10:48 UTC
The error happens with an OLE object of kind MATH, chart or other of the ODF document kinds. It happens in Impress as well.
This is about the errors in file format. For problems with the UI see bug 106249.

Start with a Draw document and insert a MATH object. Select the object, so that it has green handles. Then press key F2. Now you are in text edit mode. Write some text. Save the document using "ODF 1.2 extended". Close and reopen the document. The text is gone.
Do the same, but save using "ODF 1.2", which should produce strict ODF.
Do the same with a chart.


In case "ODF 1.2 extended" LibreOffice writes the structure
<draw:frame>
  <loext:p text:style-name="P1">Your text</loext:p>
  <draw:object>
    ⁞

The element <loext:p> is not invalid for "extended", but useless, as it is not evaluated on import and bad in sense of interoperability and not needed, see below.


In case "ODF 1.2" LibreOffice writes the structure
<draw:frame>
  <p text:style-name="P1">Your text</p>
  <draw:object>
    ⁞

The element <p> is invalid, because the element <draw:frame> has no child of kind paragraph and because the element itself needs a namespace prefix "text:".



In case you do the same test with a Calc-OLE (copy some cells from a spreadsheet and insert is as "Calc 8" to get a Calc-OLE), there no text is in the document at all.


expected behavior
=================
The <draw:frame> element has a child element <draw:text-box>. Such element <draw:text-box> has a child element <text:p>. So the correct structure would be

<draw:frame>
  <draw:text-box>
     <text:p text:style-name="P1">Your text</text:p>
  </draw:text-box>
  <draw:object>
      ⁞
  </draw:object>
      ⁞

AOO is wrong too, but it fails different from LibreOffice.

I have tested it in Version: 5.4.0.0.alpha0+
Build ID: eb7b03b052ffe8c2c577b2349987653db6c53f76
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2017-02-26_22:34:18
Locale: de-DE (de_DE); Calc: group
I guess, it had never been correct.
Comment 1 Regina Henschel 2017-10-24 09:51:39 UTC

*** This bug has been marked as a duplicate of bug 112547 ***