Bug 134044 - KOffice 1.6: formulas lost in saved document
Summary: KOffice 1.6: formulas lost in saved document
Status: RESOLVED FIXED
Alias: None
Product: calligraformula
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Alfredo Beaumont
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-14 03:59 UTC by Yuriy Kozlov
Modified: 2011-03-11 11:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
the test file (4.39 KB, application/octet-stream)
2006-09-14 04:00 UTC, Yuriy Kozlov
Details
a screenshot where commas are inserted (1.26 KB, image/png)
2006-09-14 04:03 UTC, Yuriy Kozlov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuriy Kozlov 2006-09-14 03:59:10 UTC
Version:           1.5.91 (using KDE KDE 3.5.4)
Installed from:    Ubuntu Packages
OS:                Linux

I had two documents in KWord, on two different machines both running Kubuntu Edgy with KOffice 1.6 Beta 1.

Each document had several in-line formulas and were saved in ODT (ODF) format.  When I open them with KWord, most (not all) of the contents of the formulas are gone.  The frames are still there.  OpenOffice.org 2.0 crashes when trying to open either of the documents.

In a couple formulas that remain intact, there are commas inserted between parentheses and the content between those parentheses.

I made a test file with just one formula.  I saved it in both KWord and ODF formats.  Either of those opened in KWord yields a blank frame.  When the ODT is opened in OpenOffice.org 2.0, the formula is there.
Comment 1 Yuriy Kozlov 2006-09-14 04:00:44 UTC
Created attachment 17761 [details]
the test file

This contains one formula, created in KWord, that appears in OpenOffice but not
in KWord.
Comment 2 Yuriy Kozlov 2006-09-14 04:03:22 UTC
Created attachment 17762 [details]
a screenshot where commas are inserted
Comment 3 Alfredo Beaumont 2006-09-14 10:31:48 UTC
Thanks for your report, I can confirm it. Hope to fix later today.
Comment 4 Alfredo Beaumont 2006-09-14 20:05:55 UTC
SVN commit 584398 by abeaumont:

OpenDocument: Fix saving <semantics>, it does not infer mrows, so mrow is
manually added.

BUG: 134044


 M  +9 -4      formulaelement.cc  


--- branches/koffice/1.6/koffice/lib/kformula/formulaelement.cc #584397:584398
@@ -316,16 +316,21 @@
 void FormulaElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const
 {
     QDomElement de;
-    if ( !oasisFormat )
+    if ( !oasisFormat ) {
         de = doc.createElementNS( "http://www.w3.org/1998/Math/MathML",
                                               "math" );
-    else
-        de =doc.createElement( "math:semantics" );
+        parent.appendChild( de );
+    }
+    else {
+        QDomElement element = doc.createElement( "math:semantics" );
+        de = doc.createElement( "math:mrow" );
+        parent.appendChild( element );
+        element.appendChild( de );
+    }
     for ( uint i = 0; i < countChildren(); ++i ) {
         const BasicElement* e = getChild( i );
         e->writeMathML( doc, de, oasisFormat );
     }
-    parent.appendChild( de );
 }
 
 KFORMULA_NAMESPACE_END