summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-14 16:11:11 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-15 14:19:13 +0000
commit20d648625b991318793bbc7eacfa7c0f2c23f5da (patch)
tree5e69af18141125758803f618d58cf74fd7fbaf1d /comphelper
parent367baee6ed2aa6e043333e04724831e095c5fead (diff)
Some simplifications, using UNO_QUERY_THROW
Change-Id: I143ec0287421675fb13a03e8cf3c7054a17be37f Reviewed-on: https://gerrit.libreoffice.org/34271 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/embeddedobjectcontainer.cxx4
-rw-r--r--comphelper/source/misc/mimeconfighelper.cxx5
-rw-r--r--comphelper/source/misc/storagehelper.cxx40
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;
}