linguistic: make LngSvcMgr::GetAvailableGrammarSvcs_Impl() more readable

It's not exactly clear why, but as a side effect, this makes a crash in
uno::Reference::release() go away in the --enable-macosx-sandbox case.
But it helps readability as well, so why not.

The root cause is probabably either a compiler bug or the old code
depends on a longer lifetime of the temporaries involved in the function
call, but that's not clear to me.

Change-Id: I5f987129d3301d30ebf732757a4f1ba4bdbb8d52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93040
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
Miklos Vajna 2020-04-27 16:32:52 +02:00
parent 3d62146241
commit 9ee7a841d4

View file

@ -1011,7 +1011,14 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
{
try
{
xSvc.set( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
if (xCompFactory.is())
{
xSvc.set(xCompFactory->createInstanceWithContext(xContext), uno::UNO_QUERY);
}
else
{
xSvc.set(xFactory->createInstance(), uno::UNO_QUERY);
}
}
catch (const uno::Exception &)
{