summaryrefslogtreecommitdiff
path: root/sc
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-05-29 11:47:49 +0200
commitfb32f28a2b7f0c33533592b855ead127b858040c (patch)
treeae9af333dc6985c2314108eec50543065f6077e3 /sc
parentc4041a3b6c703254ee3977eef1a989992506772b (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>
Diffstat (limited to 'sc')
-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.