Kaydet (Commit) 93732de5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Some simplifications, using UNO_QUERY_THROW

Change-Id: Icefafed29c9702730181f61bb03296b5b474bfa6
Reviewed-on: https://gerrit.libreoffice.org/34269Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 5ce42c21
...@@ -155,15 +155,7 @@ void createInstance( ...@@ -155,15 +155,7 @@ void createInstance(
throw RuntimeException( "cannot get service instance \"" + rServiceName + "\"!" ); throw RuntimeException( "cannot get service instance \"" + rServiceName + "\"!" );
} }
rxOut.set( x, UNO_QUERY ); rxOut.set( x, UNO_QUERY_THROW );
if (! rxOut.is())
{
const Type & rType = cppu::UnoType<T>::get();
throw RuntimeException(
"service instance \"" + rServiceName +
"\" does not support demanded interface \"" +
rType.getTypeName() + "\"!" );
}
} }
/// @throws Exception /// @throws Exception
...@@ -490,9 +482,7 @@ SAL_IMPLEMENT_MAIN() ...@@ -490,9 +482,7 @@ SAL_IMPLEMENT_MAIN()
if (bSingleAccept) if (bSingleAccept)
{ {
Reference< XComponent > xComp( xBridge, UNO_QUERY ); Reference< XComponent > xComp( xBridge, UNO_QUERY_THROW );
if (! xComp.is())
throw RuntimeException( "bridge factory does not export interface \"com.sun.star.lang.XComponent\"!" );
ODisposingListener::waitFor( xComp ); ODisposingListener::waitFor( xComp );
xComp->dispose(); xComp->dispose();
// explicitly dispose the remote bridge so that it joins // explicitly dispose the remote bridge so that it joins
......
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