Kaydet (Commit) 20d64862 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Some simplifications, using UNO_QUERY_THROW

Change-Id: I143ec0287421675fb13a03e8cf3c7054a17be37f
Reviewed-on: https://gerrit.libreoffice.org/34271Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 367baee6
......@@ -1156,9 +1156,7 @@ bool EmbeddedObjectContainer::InsertGraphicStream( const css::uno::Reference < c
::comphelper::OStorageHelper::CopyInputToOutput( rStream, xOutStream );
xOutStream->flush();
uno::Reference< beans::XPropertySet > xPropSet( xGraphicStream, uno::UNO_QUERY );
if ( !xPropSet.is() )
throw uno::RuntimeException();
uno::Reference< beans::XPropertySet > xPropSet( xGraphicStream, uno::UNO_QUERY_THROW );
xPropSet->setPropertyValue("UseCommonStoragePasswordEncryption",
uno::Any( true ) );
......
......@@ -579,10 +579,7 @@ OUString MimeConfigurationHelper::UpdateMediaDescriptorWithFilterName(
uno::Reference< document::XTypeDetection > xTypeDetection(
m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", m_xContext),
uno::UNO_QUERY );
if ( !xTypeDetection.is() )
throw uno::RuntimeException(); // TODO
uno::UNO_QUERY_THROW );
// typedetection can change the mode, add a stream and so on, thus a copy should be used
uno::Sequence< beans::PropertyValue > aTempMD( aMediaDescr );
......
......@@ -74,10 +74,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetTemporaryStorage(
const uno::Reference< uno::XComponentContext >& rxContext )
{
uno::Reference< embed::XStorage > xTempStorage( GetStorageFactory( rxContext )->createInstance(),
uno::UNO_QUERY );
if ( !xTempStorage.is() )
throw uno::RuntimeException();
uno::UNO_QUERY_THROW );
return xTempStorage;
}
......@@ -92,10 +89,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageFromURL(
aArgs[1] <<= nStorageMode;
uno::Reference< embed::XStorage > xTempStorage( GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
uno::UNO_QUERY );
if ( !xTempStorage.is() )
throw uno::RuntimeException();
uno::UNO_QUERY_THROW );
return xTempStorage;
}
......@@ -124,10 +118,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageFromURL2(
if (!xFact.is()) throw uno::RuntimeException();
uno::Reference< embed::XStorage > xTempStorage(
xFact->createInstanceWithArguments( aArgs ), uno::UNO_QUERY );
if ( !xTempStorage.is() )
throw uno::RuntimeException();
xFact->createInstanceWithArguments( aArgs ), uno::UNO_QUERY_THROW );
return xTempStorage;
}
......@@ -141,10 +132,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageFromInputStream(
aArgs[1] <<= embed::ElementModes::READ;
uno::Reference< embed::XStorage > xTempStorage( GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
uno::UNO_QUERY );
if ( !xTempStorage.is() )
throw uno::RuntimeException();
uno::UNO_QUERY_THROW );
return xTempStorage;
}
......@@ -159,10 +147,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageFromStream(
aArgs[1] <<= nStorageMode;
uno::Reference< embed::XStorage > xTempStorage( GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
uno::UNO_QUERY );
if ( !xTempStorage.is() )
throw uno::RuntimeException();
uno::UNO_QUERY_THROW );
return xTempStorage;
}
......@@ -294,10 +279,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromURL(
aArgs[2] <<= aProps;
uno::Reference< embed::XStorage > xTempStorage( GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
uno::UNO_QUERY );
if ( !xTempStorage.is() )
throw uno::RuntimeException();
uno::UNO_QUERY_THROW );
return xTempStorage;
}
......@@ -335,10 +317,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromInputStr
aArgs[2] <<= aProps;
uno::Reference< embed::XStorage > xTempStorage( GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
uno::UNO_QUERY );
if ( !xTempStorage.is() )
throw uno::RuntimeException();
uno::UNO_QUERY_THROW );
return xTempStorage;
}
......@@ -377,10 +356,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream(
aArgs[2] <<= aProps;
uno::Reference< embed::XStorage > xTempStorage( GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
uno::UNO_QUERY );
if ( !xTempStorage.is() )
throw uno::RuntimeException();
uno::UNO_QUERY_THROW );
return xTempStorage;
}
......
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