From 41de10f5fd181dc45b487d2ac29cd2b4fbb34710 Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Wed, 19 Jun 2013 14:32:38 -0300 Subject: Fix fdo#59641 - Duplication in formula when import mathml Remove wrong concatenation of text from EditView in SmXMLImport::endDocument, and use just the text extracted from formula. After the SmXMLImport::endDocument method, we compare the text from doc(extracted from formula) and from editview(text inserted before call the importer) and as they're different, the text from formula will be inserted in the current edit cursor position. Also, remove bogus pDocShell->SetText( String() ), as we will set the text some lines below. Change-Id: Ia317a23d27964a9d1264dcaf9ec0d38b8c586655 Reviewed-on: https://gerrit.libreoffice.org/4369 Reviewed-by: Noel Power Tested-by: Noel Power --- starmath/source/mathmlimport.cxx | 4 +--- starmath/source/view.cxx | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'starmath') diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index 4d1f95ec91b3..a7133dfe5584 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -557,12 +557,10 @@ void SmXMLImport::endDocument(void) pDocShell->SetFormulaTree(pTree); if (0 == aText.Len()) //If we picked up no annotation text { - //Make up some editable text - aText = pDocShell->GetText(); + // Get text from imported formula pTree->CreateTextFromNode(aText); aText = comphelper::string::stripEnd(aText, ' '); } - pDocShell->SetText( String() ); // Convert symbol names SmParser &rParser = pDocShell->GetParser(); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index d3ffcfea2aac..e0fd8d43a35a 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1519,9 +1519,7 @@ bool SmViewShell::InsertFrom(SfxMedium &rMedium) if (pEditWin) pEditWin->InsertText( aText ); else - { SAL_WARN( "starmath", "EditWindow missing" ); - } pDoc->Parse(); pDoc->SetModified(true); -- cgit