[Libreoffice-commits] core.git: 2 commits - stoc/source svx/source
Stephan Bergmann
sbergman at redhat.com
Wed Feb 15 14:17:38 UTC 2017
stoc/source/javaloader/javaloader.cxx | 5 +----
stoc/source/javavm/javavm.cxx | 16 +++-------------
svx/source/accessibility/AccessibleTextHelper.cxx | 5 +----
svx/source/svdraw/svdoole2.cxx | 4 +---
4 files changed, 6 insertions(+), 24 deletions(-)
New commits:
commit 9a7d112603393ad45b71d36860ac7d0d8175c06d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Feb 14 16:10:00 2017 +0100
Some simplifications, using UNO_QUERY_THROW
Change-Id: Icc72bd482d37e1857137470a8357659ab4d0a969
Reviewed-on: https://gerrit.libreoffice.org/34257
Tested-by: Stephan Bergmann <sbergman at redhat.com>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 5b421b0..7ff8f61 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -257,10 +257,7 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL
}
// set the service manager at the javaloader
- css::uno::Reference<XInitialization> javaLoader_XInitialization(m_javaLoader, UNO_QUERY);
- if(!javaLoader_XInitialization.is())
- throw RuntimeException(
- "javaloader error - initialization of java javaloader failed, no XInitialization");
+ css::uno::Reference<XInitialization> javaLoader_XInitialization(m_javaLoader, UNO_QUERY_THROW);
Any any;
any <<= css::uno::Reference<XMultiComponentFactory>(
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index ee5069d..ef8e8ae 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -273,9 +273,7 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
xCtx );
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);
- if(!xConfRegistry_simple.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_THROW);
xConfRegistry_simple->open("org.openoffice.Inet", true, false);
css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey();
@@ -358,11 +356,7 @@ void getDefaultLocaleFromConfig(
"javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple(
- xConfRegistry, css::uno::UNO_QUERY);
- if(!xConfRegistry_simple.is())
- throw css::uno::RuntimeException(
- "javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
-
+ xConfRegistry, css::uno::UNO_QUERY_THROW);
xConfRegistry_simple->open("org.openoffice.Setup", true, false);
css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey();
@@ -464,11 +458,7 @@ void getJavaPropsFromSafetySettings(
"javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple(
- xConfRegistry, css::uno::UNO_QUERY);
- if(!xConfRegistry_simple.is())
- throw css::uno::RuntimeException(
- "javavm.cxx: couldn't get ConfigurationRegistry", nullptr);
-
+ xConfRegistry, css::uno::UNO_QUERY_THROW);
xConfRegistry_simple->open(
"org.openoffice.Office.Java",
true, false);
commit 90e6afc6e236ebe7abcc406fa9cb9d5455f0ae81
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Feb 14 16:09:57 2017 +0100
Some simplifications, using UNO_QUERY_THROW
Change-Id: I6244b12a85a6cbd8c5945a0b4965c070eed15ed4
Reviewed-on: https://gerrit.libreoffice.org/34256
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index c4c05e8..c30ec41 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -1566,10 +1566,7 @@ namespace accessibility
if( !xFrontEndContext.is() )
throw uno::RuntimeException("AccessibleTextHelper_Impl::getAccessibleAt: frontend invalid", mxFrontEnd );
- uno::Reference< XAccessibleComponent > xFrontEndComponent( xFrontEndContext, uno::UNO_QUERY );
-
- if( !xFrontEndComponent.is() )
- throw uno::RuntimeException("AccessibleTextHelper_Impl::getAccessibleAt: frontend is no XAccessibleComponent", mxFrontEnd );
+ uno::Reference< XAccessibleComponent > xFrontEndComponent( xFrontEndContext, uno::UNO_QUERY_THROW );
// #103862# No longer need to make given position relative
Point aPoint( _aPoint.X, _aPoint.Y );
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index a299327..34b6ec0 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -471,9 +471,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl
if ( !mpObj )
throw uno::RuntimeException();
- uno::Reference< embed::XInplaceObject > xInplace( mpObj->GetObjRef(), uno::UNO_QUERY );
- if ( !xInplace.is() )
- throw uno::RuntimeException();
+ uno::Reference< embed::XInplaceObject > xInplace( mpObj->GetObjRef(), uno::UNO_QUERY_THROW );
// check if the change is at least one pixel in size
awt::Rectangle aOldRect = getPlacement();
More information about the Libreoffice-commits
mailing list