summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-14 16:10:10 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-15 14:17:41 +0000
commitc27586115d1df8b80cece6b03e333803c1a15b19 (patch)
treec3f833fec2dfe12480831384ef2e9cff458d1ca2 /scripting
parent8b3a9d3055d261a3ba16932bf7f361e0ca5c77c2 (diff)
Some simplifications, using UNO_QUERY_THROW
Change-Id: I705e4e7e8446a503e3ef0e2828a22554f94585c6 Reviewed-on: https://gerrit.libreoffice.org/34259 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/provider/MasterScriptProvider.cxx22
1 files changed, 3 insertions, 19 deletions
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index c469ba325378..e1599be206bc 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -473,12 +473,7 @@ MasterScriptProvider::insertByName( const OUString& aName, const Any& aElement )
{
if ( m_xMSPPkg.is() )
{
- Reference< container::XNameContainer > xCont( m_xMSPPkg, UNO_QUERY );
- if ( !xCont.is() )
- {
- throw RuntimeException(
- "PackageMasterScriptProvider doesn't implement XNameContainer" );
- }
+ Reference< container::XNameContainer > xCont( m_xMSPPkg, UNO_QUERY_THROW );
xCont->insertByName( aName, aElement );
}
else
@@ -552,12 +547,7 @@ MasterScriptProvider::removeByName( const OUString& Name )
{
if ( m_xMSPPkg.is() )
{
- Reference< container::XNameContainer > xCont( m_xMSPPkg, UNO_QUERY );
- if ( !xCont.is() )
- {
- throw RuntimeException(
- "PackageMasterScriptProvider doesn't implement XNameContainer" );
- }
+ Reference< container::XNameContainer > xCont( m_xMSPPkg, UNO_QUERY_THROW );
xCont->removeByName( Name );
}
else
@@ -651,13 +641,7 @@ MasterScriptProvider::hasByName( const OUString& aName )
{
if ( m_xMSPPkg.is() )
{
- Reference< container::XNameContainer > xCont( m_xMSPPkg, UNO_QUERY );
- if ( !xCont.is() )
- {
- throw RuntimeException(
- "PackageMasterScriptProvider doesn't implement XNameContainer" );
- }
-
+ Reference< container::XNameContainer > xCont( m_xMSPPkg, UNO_QUERY_THROW );
result = xCont->hasByName( aName );
}
// If this is a document provider then we shouldn't