Bug 136711

Summary: unable to copy/paste equation from kformula to other KDE application
Product: [Applications] calligraformula Reporter: Bertrand <bertrand.haut>
Component: generalAssignee: Alfredo Beaumont <alfredo.beaumont>
Status: RESOLVED FIXED    
Severity: normal CC: alfredo.beaumont
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Bertrand 2006-11-02 15:06:12 UTC
Version:           1.6.0 (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages

Launch kformula, type a equation, select it (C-a), copy (C-c), go to kword, paste it : an empty equation was pasted.

Same thing if I try to paste in kpresenter (empty image).

This was working with koffice 1.5 juste before the upgrade.
Comment 1 Alfredo Beaumont 2007-01-11 19:23:39 UTC
It works for me, I just copy from KFormula, paste in KWord. If there's no formula frame, it creates one, otherwise it pastes the copied formula.
Comment 2 Bertrand 2007-01-11 22:25:28 UTC
Using kword 1.6.1 (package from http://kubuntu.org/announcements/koffice-161.php), I still have the problem.

Launching kword from the konsole, here is an error message :

berti@neptune:~$ kword
kword: ERROR: Missing FORMULA tag in FRAMESET
kword: WARNING: Unknown frameset supplied!
kword: WARNING: KWFrameSet::findAnchor anchor not found (frameset='Formula 1' frameNum=0)
Comment 3 Alfredo Beaumont 2007-01-13 19:17:15 UTC
SVN commit 623001 by abeaumont:

KFormula uses MathML for copy and paste, reflect it in KWord.

BUG: 136711


 M  +3 -3      KWFormulaFrameSet.cpp  
 M  +1 -1      KWView.cpp  


--- branches/koffice/1.6/koffice/kword/KWFormulaFrameSet.cpp #623000:623001
@@ -298,13 +298,13 @@
             connect( formula, SIGNAL( errorMsg( const QString& ) ),
                      this, SLOT( slotErrorMessage( const QString& ) ) );
         }
-        m_doc->formulaDocument()->setCreationStrategy( "Ordinary" );
-        if ( !formula->load( formulaElem.firstChild().toElement() ) ) {
+        m_doc->formulaDocument()->setCreationStrategy( "Oasis" );
+        if ( !formula->loadMathML( formulaElem.firstChild().toElement() ) ) {
             kdError(32001) << "Error loading formula" << endl;
         }
     }
     else {
-        kdError(32001) << "Missing FORMULA tag in FRAMESET" << endl;
+        kdError(32001) << "Missing math tag in FRAMESET" << endl;
     }
 }
 
--- branches/koffice/1.6/koffice/kword/KWView.cpp #623000:623001
@@ -4113,7 +4113,7 @@
             QByteArray data = source->encodedData( KFormula::MimeSource::selectionMimeType() );
             QDomDocument formula;
             formula.setContent( data );
-            QDomElement formulaElem = formula.namedItem("KFORMULA").toElement();
+            QDomElement formulaElem = formula.namedItem("math").toElement();
             frameset->paste( formulaElem );
         }
         KWFrame *frame = new KWFrame(frameset, 0, 0, 10, 10 );