use SolarMutexReleaser in UUIInteractionHelper

instead of hand-coding it

Change-Id: I16cc72854a0d02422eaacf5794b97cfcd7689d83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90744
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2020-03-19 14:07:29 +02:00
parent bc898e2c27
commit 3705a2904d

View file

@ -164,11 +164,8 @@ UUIInteractionHelper::handleRequest(
HandleData aHD(rRequest);
Link<void*,void> aLink(&aHD,handlerequest);
Application::PostUserEvent(aLink,this);
comphelper::SolarMutex& rSolarMutex = Application::GetSolarMutex();
sal_uInt32 nLockCount = (rSolarMutex.IsCurrentThread()) ? rSolarMutex.release(true) : 0;
SolarMutexReleaser aReleaser;
aHD.wait();
if (nLockCount)
rSolarMutex.acquire(nLockCount);
return aHD.bHandled;
}
else
@ -215,11 +212,8 @@ UUIInteractionHelper::getStringFromRequest(
HandleData aHD(rRequest);
Link<void*,void> aLink(&aHD,getstringfromrequest);
Application::PostUserEvent(aLink,this);
comphelper::SolarMutex& rSolarMutex = Application::GetSolarMutex();
sal_uInt32 nLockCount = (rSolarMutex.IsCurrentThread()) ? rSolarMutex.release(true) : 0;
SolarMutexReleaser aReleaser;
aHD.wait();
if (nLockCount)
rSolarMutex.acquire(nLockCount);
return aHD.m_aResult;
}
else