From fb32f28a2b7f0c33533592b855ead127b858040c Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 29 May 2018 10:00:31 +0200 Subject: 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 Tested-by: Jenkins --- sc/source/core/tool/editutil.cxx | 3 +++ 1 file changed, 3 insertions(+) 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. -- cgit