summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-08-05 10:46:11 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-05 11:19:08 -0400
commit808350a697a79ebcc1708f18de407294576a793e (patch)
tree3f72502667b7fd8680f0da15d77c12c2390e1470
parent700d1cab988524b28c7ce773cf473f42d7741001 (diff)
fdo#67099: Call Clear() before setting SetText() for the first time.
SetText itself internally clears the content, except that it doesn't clear text attributes for some reason. Since Clear() is quite expensive even when called with empty content, we need to call it only when necessary. Change-Id: I25ca36c1c2f690b160511180892595daf43681b3
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index de12fd225ba9..b03707f6e0c1 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -637,6 +637,8 @@ void ScXMLTableRowCellContext::PushParagraphEnd()
{
if (!maFirstParagraph.isEmpty())
{
+ // Flush the cached first paragraph first.
+ mpEditEngine->Clear();
mpEditEngine->SetText(maFirstParagraph);
maFirstParagraph = OUString();
}
@@ -644,6 +646,7 @@ void ScXMLTableRowCellContext::PushParagraphEnd()
}
else if (mbHasFormatRuns)
{
+ mpEditEngine->Clear();
mpEditEngine->SetText(maParagraph.makeStringAndClear());
mbEditEngineHasText = true;
}