summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-05-18 10:49:37 +0200
committerMichael Meeks <michael.meeks@collabora.com>2018-05-23 11:35:12 +0200
commit1464b94ab8ef58b2620e05d663403684deb19d0c (patch)
tree2f1ce36352d6e8ee25ae03c105d5b479fdd7d0b3 /sc
parent539d939cbd6a02ca043ef535424cda4a65abe5fd (diff)
extend mutex protection to the whole of ScEditUtil::GetString()
Otherwise with Calc's threading enabled and novell#306440-1.xlsx this function gets called multiple times at the same time and the SetText() calls operate on the same object. Change-Id: Ic044132ac98bed46440aadbdad6ad36f3a2e9beb Reviewed-on: https://gerrit.libreoffice.org/54520 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/editutil.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index e56a1b2ca437..d05cac306c86 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -112,6 +112,8 @@ OUString ScEditUtil::GetMultilineString( const EditTextObject& rEdit )
OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocument* pDoc )
{
+ static osl::Mutex aMutex;
+ osl::MutexGuard aGuard( aMutex);
// ScFieldEditEngine is needed to resolve field contents.
if (pDoc)
{
@@ -124,8 +126,6 @@ OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocumen
}
else
{
- static osl::Mutex aMutex;
- osl::MutexGuard aGuard( aMutex);
EditEngine& rEE = ScGlobal::GetStaticFieldEditEngine();
rEE.SetText( rEditText);
return GetMultilineString( rEE);