Kaydet (Commit) 41de10f5 authored tarafından Marcos Paulo de Souza's avatar Marcos Paulo de Souza Kaydeden (comit) Noel Power

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/4369Reviewed-by: 's avatarNoel Power <noel.power@suse.com>
Tested-by: 's avatarNoel Power <noel.power@suse.com>
üst 07cd857a
......@@ -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();
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment