summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-05-29 10:00:31 +0200
committerLuboš Luňák <l.lunak@collabora.com>2018-06-04 16:10:31 +0200
commite099cf1da1d83c1798b0c63fd267bb61973c55ef (patch)
treed981454335f1064a358bf8581216ebda3094c92f
parent4c42677aad1b91f0b51452560e23bdd706106d0f (diff)
avoid using EditEngine in ScEditUtils::GetString() if possible
According to 1ecdc7aaf66 it is really needed only for resolving fields, so if there's no field, simply concatenate the contents, as used to be the case before that commit. This should be faster and also safer in the case of Calc's threading enabled. Change-Id: I23a2e1873deb8538e2a1ae0dd80af7e5356c18a5 Reviewed-on: https://gerrit.libreoffice.org/54986 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/55275 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--sc/source/core/tool/editutil.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index d05cac306c86..b40764739a48 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -112,6 +112,9 @@ OUString ScEditUtil::GetMultilineString( const EditTextObject& rEdit )
OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocument* pDoc )
{
+ if( !rEditText.HasField())
+ return GetMultilineString( rEditText );
+
static osl::Mutex aMutex;
osl::MutexGuard aGuard( aMutex);
// ScFieldEditEngine is needed to resolve field contents.