summaryrefslogtreecommitdiff
path: root/basic/source/uno/namecont.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-14 16:11:21 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-15 14:19:32 +0000
commit878a8ff3f0b6b7f956e8ed40932ff47e0e56a0cd (patch)
treef9c102c825b04ddbdb3a5f0f4e589806a480a764 /basic/source/uno/namecont.cxx
parent22f96dad080e3fad30b164be8ee45caa11ae4407 (diff)
Some simplifications, using UNO_QUERY_THROW
Change-Id: Ie7b5bb82868f517d056907567dd8e53a34d8a0b0 Reviewed-on: https://gerrit.libreoffice.org/34273 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic/source/uno/namecont.cxx')
-rw-r--r--basic/source/uno/namecont.cxx18
1 files changed, 2 insertions, 16 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index ae83e5a939f1..221c2d30fcd4 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2076,14 +2076,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
try
{
xInfoStream = xTargetLibrariesStor->openStreamElement( aStreamName, embed::ElementModes::READWRITE );
- uno::Reference< beans::XPropertySet > xProps( xInfoStream, uno::UNO_QUERY );
- SAL_WARN_IF(
- !xProps.is(), "basic",
- "The stream must implement XPropertySet!");
- if ( !xProps.is() )
- {
- throw uno::RuntimeException("InfoStream doesn't implement XPropertySet");
- }
+ uno::Reference< beans::XPropertySet > xProps( xInfoStream, uno::UNO_QUERY_THROW );
OUString aMime( "text/xml" );
xProps->setPropertyValue("MediaType", uno::Any( aMime ) );
@@ -2134,14 +2127,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
xmlscript::exportLibraryContainer( xWriter, pLibArray.get() );
if ( bStorage )
{
- uno::Reference< embed::XTransactedObject > xTransact( xTargetLibrariesStor, uno::UNO_QUERY );
- SAL_WARN_IF(
- !xTransact.is(), "basic",
- "The storage must implement XTransactedObject!");
- if ( !xTransact.is() )
- {
- throw uno::RuntimeException("xTargetLibrariesStor doesn't implement XTransactedObject");
- }
+ uno::Reference< embed::XTransactedObject > xTransact( xTargetLibrariesStor, uno::UNO_QUERY_THROW );
xTransact->commit();
}
}