diff options
-rw-r--r-- | comphelper/source/container/embeddedobjectcontainer.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/mimeconfighelper.cxx | 5 | ||||
-rw-r--r-- | comphelper/source/misc/storagehelper.cxx | 40 |
3 files changed, 10 insertions, 39 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 4e0324a56efd..c05d143729de 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -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 ) ); diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index ef41ce364b50..a24e4abe764b 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -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 ); diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index 0157843e5ba7..d6229e9bda47 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -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; } |