summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-06-19 14:32:38 -0300
committerNoel Power <noel.power@suse.com>2013-06-20 13:54:37 +0000
commit41de10f5fd181dc45b487d2ac29cd2b4fbb34710 (patch)
treeebb862335e7b426dbd3b9528b3c562dccc63c6c3 /starmath
parent07cd857a0e35c9f80f35e8c042ff0ae16aceaef7 (diff)
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 <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathmlimport.cxx4
-rw-r--r--starmath/source/view.cxx2
2 files changed, 1 insertions, 5 deletions
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);