Kaydet (Commit) 9a7d1126 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Some simplifications, using UNO_QUERY_THROW

Change-Id: Icc72bd482d37e1857137470a8357659ab4d0a969
Reviewed-on: https://gerrit.libreoffice.org/34257Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 90e6afc6
...@@ -257,10 +257,7 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL ...@@ -257,10 +257,7 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL
} }
// set the service manager at the javaloader // set the service manager at the javaloader
css::uno::Reference<XInitialization> javaLoader_XInitialization(m_javaLoader, UNO_QUERY); css::uno::Reference<XInitialization> javaLoader_XInitialization(m_javaLoader, UNO_QUERY_THROW);
if(!javaLoader_XInitialization.is())
throw RuntimeException(
"javaloader error - initialization of java javaloader failed, no XInitialization");
Any any; Any any;
any <<= css::uno::Reference<XMultiComponentFactory>( any <<= css::uno::Reference<XMultiComponentFactory>(
......
...@@ -273,9 +273,7 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm, ...@@ -273,9 +273,7 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
xCtx ); xCtx );
if(!xConfRegistry.is()) throw css::uno::RuntimeException("javavm.cxx: couldn't get ConfigurationRegistry", nullptr); if(!xConfRegistry.is()) throw css::uno::RuntimeException("javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple(xConfRegistry, css::uno::UNO_QUERY); css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple(xConfRegistry, css::uno::UNO_QUERY_THROW);
if(!xConfRegistry_simple.is()) throw css::uno::RuntimeException("javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
xConfRegistry_simple->open("org.openoffice.Inet", true, false); xConfRegistry_simple->open("org.openoffice.Inet", true, false);
css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey();
...@@ -358,11 +356,7 @@ void getDefaultLocaleFromConfig( ...@@ -358,11 +356,7 @@ void getDefaultLocaleFromConfig(
"javavm.cxx: couldn't get ConfigurationRegistry", nullptr); "javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple( css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple(
xConfRegistry, css::uno::UNO_QUERY); xConfRegistry, css::uno::UNO_QUERY_THROW);
if(!xConfRegistry_simple.is())
throw css::uno::RuntimeException(
"javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
xConfRegistry_simple->open("org.openoffice.Setup", true, false); xConfRegistry_simple->open("org.openoffice.Setup", true, false);
css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey();
...@@ -464,11 +458,7 @@ void getJavaPropsFromSafetySettings( ...@@ -464,11 +458,7 @@ void getJavaPropsFromSafetySettings(
"javavm.cxx: couldn't get ConfigurationRegistry", nullptr); "javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple( css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple(
xConfRegistry, css::uno::UNO_QUERY); xConfRegistry, css::uno::UNO_QUERY_THROW);
if(!xConfRegistry_simple.is())
throw css::uno::RuntimeException(
"javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
xConfRegistry_simple->open( xConfRegistry_simple->open(
"org.openoffice.Office.Java", "org.openoffice.Office.Java",
true, false); true, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment