[Libreoffice-commits] core.git: sc/source
Luboš Luňák
l.lunak at collabora.com
Wed May 23 09:35:36 UTC 2018
sc/source/core/tool/editutil.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 1464b94ab8ef58b2620e05d663403684deb19d0c
Author: Luboš Luňák <l.lunak at collabora.com>
Date: Fri May 18 10:49:37 2018 +0200
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 at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
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);
More information about the Libreoffice-commits
mailing list