summaryrefslogtreecommitdiff
path: root/linguistic/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-04-27 16:32:52 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-04-28 14:28:19 +0200
commit9ee7a841d41a5517fd567b17b936ea4c0141e157 (patch)
tree57d0578710a8f888901a7bc2999b42b375ac9e9b /linguistic/source
parent3d6214624128626c056b0a15ff6d654f57f149d9 (diff)
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>
Diffstat (limited to 'linguistic/source')
-rw-r--r--linguistic/source/lngsvcmgr.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 2cf8524f851f..16581700d890 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -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 &)
{