summaryrefslogtreecommitdiff
path: root/scripting/source/provider
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-05-23 12:03:21 +0200
committerNoel Grandin <noel@peralex.com>2014-05-23 15:06:00 +0200
commite7bc3cab019fbf040f9fb8b53ae2cf3f977d200b (patch)
treebc507bccee9fb71134e362b72d22991561e32aa0 /scripting/source/provider
parentc5d47c327a57df55fa3dac0fff6b65888d0345e4 (diff)
remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params, remove lots of boilerplate code. Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
Diffstat (limited to 'scripting/source/provider')
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx2
-rw-r--r--scripting/source/provider/MasterScriptProvider.cxx45
-rw-r--r--scripting/source/provider/ProviderCache.cxx4
-rw-r--r--scripting/source/provider/ScriptImpl.cxx6
-rw-r--r--scripting/source/provider/URIHelper.cxx12
5 files changed, 23 insertions, 46 deletions
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index 9941f6b6f1da..61581f55459a 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -680,7 +680,7 @@ BrowseNodeFactoryImpl::createView( sal_Int16 viewType )
case browse::BrowseNodeFactoryViewTypes::MACROORGANIZER:
return getOrganizerHierarchy();
default:
- throw RuntimeException( "Unknown view type", Reference< XInterface >() );
+ throw RuntimeException( "Unknown view type" );
}
}
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 0ae25ec6a3a0..3b02a10a8cf1 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -106,8 +106,7 @@ throw ( Exception, RuntimeException, std::exception )
if ( len > 1 )
{
throw RuntimeException(
- "MasterScriptProvider::initialize: invalid number of arguments",
- Reference< XInterface >() );
+ "MasterScriptProvider::initialize: invalid number of arguments" );
}
Sequence< Any > invokeArgs( len );
@@ -498,15 +497,13 @@ MasterScriptProvider::insertByName( const OUString& aName, const Any& aElement )
if ( !xCont.is() )
{
throw RuntimeException(
- "PackageMasterScriptProvider doesn't implement XNameContainer",
- Reference< XInterface >() );
+ "PackageMasterScriptProvider doesn't implement XNameContainer" );
}
xCont->insertByName( aName, aElement );
}
else
{
- throw RuntimeException( "PackageMasterScriptProvider is unitialised",
- Reference< XInterface >() );
+ throw RuntimeException( "PackageMasterScriptProvider is unitialised" );
}
}
@@ -530,8 +527,7 @@ MasterScriptProvider::insertByName( const OUString& aName, const Any& aElement )
{
throw RuntimeException(
"insertByName cannot instantiate "
- "child script providers.",
- Reference< XInterface >() );
+ "child script providers." );
}
Sequence < Reference< provider::XScriptProvider > > xSProviders =
providerCache()->getAllProviders();
@@ -578,15 +574,13 @@ MasterScriptProvider::removeByName( const OUString& Name ) throw ( container::No
if ( !xCont.is() )
{
throw RuntimeException(
- "PackageMasterScriptProvider doesn't implement XNameContainer",
- Reference< XInterface >() );
+ "PackageMasterScriptProvider doesn't implement XNameContainer" );
}
xCont->removeByName( Name );
}
else
{
- throw RuntimeException( "PackageMasterScriptProvider is unitialised",
- Reference< XInterface >() );
+ throw RuntimeException( "PackageMasterScriptProvider is unitialised" );
}
}
@@ -605,8 +599,7 @@ MasterScriptProvider::removeByName( const OUString& Name ) throw ( container::No
{
throw RuntimeException(
"removeByName() cannot instantiate "
- "child script providers.",
- Reference< XInterface >() );
+ "child script providers." );
}
Sequence < Reference< provider::XScriptProvider > > xSProviders =
providerCache()->getAllProviders();
@@ -650,8 +643,7 @@ MasterScriptProvider::replaceByName( const OUString& aName, const Any& aElement
// TODO needs implementing
if ( true )
{
- throw RuntimeException( "replaceByName not implemented!!!!" ,
- Reference< XInterface >() );
+ throw RuntimeException( "replaceByName not implemented!!!!" );
}
}
@@ -664,8 +656,7 @@ MasterScriptProvider::getByName( const OUString& aName ) throw ( container::NoSu
Any result;
if ( true )
{
- throw RuntimeException( "getByName not implemented!!!!" ,
- Reference< XInterface >() );
+ throw RuntimeException( "getByName not implemented!!!!" );
}
return result;
}
@@ -682,8 +673,7 @@ MasterScriptProvider::hasByName( const OUString& aName ) throw (RuntimeException
if ( !xCont.is() )
{
throw RuntimeException(
- "PackageMasterScriptProvider doesn't implement XNameContainer",
- Reference< XInterface >() );
+ "PackageMasterScriptProvider doesn't implement XNameContainer" );
}
result = xCont->hasByName( aName );
@@ -692,8 +682,7 @@ MasterScriptProvider::hasByName( const OUString& aName ) throw (RuntimeException
// have a PackageProvider
else if (!m_xModel.is())
{
- throw RuntimeException( "PackageMasterScriptProvider is unitialised",
- Reference< XInterface >() );
+ throw RuntimeException( "PackageMasterScriptProvider is unitialised" );
}
}
@@ -713,8 +702,7 @@ MasterScriptProvider::hasByName( const OUString& aName ) throw (RuntimeException
{
throw RuntimeException(
"removeByName() cannot instantiate "
- "child script providers.",
- Reference< XInterface >() );
+ "child script providers." );
}
Sequence < Reference< provider::XScriptProvider > > xSProviders =
providerCache()->getAllProviders();
@@ -750,8 +738,7 @@ MasterScriptProvider::getElementNames( ) throw ( RuntimeException, std::excepti
Sequence< OUString > names;
if ( true )
{
- throw RuntimeException( "getElementNames not implemented!!!!" ,
- Reference< XInterface >() );
+ throw RuntimeException( "getElementNames not implemented!!!!" );
}
return names;
}
@@ -769,8 +756,7 @@ sal_Bool SAL_CALL MasterScriptProvider::hasElements( ) throw ( RuntimeException
// TODO needs implementing
if ( true )
{
- throw RuntimeException( "hasElements not implemented!!!!" ,
- Reference< XInterface >() );
+ throw RuntimeException( "hasElements not implemented!!!!" );
}
return false;
}
@@ -787,8 +773,7 @@ MasterScriptProvider::getAllProviders() throw ( css::uno::RuntimeException )
{
OUString errorMsg(
"MasterScriptProvider::getAllProviders, cache not initialised");
- throw RuntimeException( errorMsg.concat( errorMsg ),
- Reference< XInterface >() );
+ throw RuntimeException( errorMsg.concat( errorMsg ) );
}
}
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index 71bba4c84e29..b094e2e224de 100644
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -176,7 +176,7 @@ ProviderCache::populateCache() throw ( RuntimeException )
OUString temp =
"ProviderCache::populateCache: couldn't obtain XSingleComponentFactory for "
+ serviceName;
- throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
+ throw RuntimeException( temp.concat( e.Message ) );
}
}
@@ -191,7 +191,7 @@ ProviderCache::createProvider( ProviderDetails& details ) throw ( RuntimeExcepti
catch ( const Exception& e )
{
OUString temp("ProviderCache::createProvider() Error creating provider from factory!!!\n");
- throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
+ throw RuntimeException( temp.concat( e.Message ) );
}
return details.provider;
diff --git a/scripting/source/provider/ScriptImpl.cxx b/scripting/source/provider/ScriptImpl.cxx
index f06075164287..f17bb9a2f006 100644
--- a/scripting/source/provider/ScriptImpl.cxx
+++ b/scripting/source/provider/ScriptImpl.cxx
@@ -92,15 +92,13 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException,
catch ( const RuntimeException & re )
{
OUString temp = "ScriptImpl::invoke RuntimeException : ";
- throw RuntimeException( temp.concat( re.Message ),
- Reference< XInterface > () );
+ throw RuntimeException( temp.concat( re.Message ) );
}
#ifdef _DEBUG
catch ( ... )
{
throw RuntimeException(
- "ScriptImpl::invoke Unknown Exception caught - RuntimeException rethrown",
- Reference< XInterface > () );
+ "ScriptImpl::invoke Unknown Exception caught - RuntimeException rethrown" );
}
#endif
return result;
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index a8498b33f9a7..1464e6ad3557 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -89,16 +89,12 @@ throw ( uno::Exception, uno::RuntimeException, std::exception )
args[0].getValueType() != ::cppu::UnoType<OUString>::get() ||
args[1].getValueType() != ::cppu::UnoType<OUString>::get() )
{
- throw uno::RuntimeException( OUString(
- "ScriptingFrameworkURIHelper got invalid argument list" ),
- uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( "ScriptingFrameworkURIHelper got invalid argument list" );
}
if ( !(args[0] >>= m_sLanguage) || !(args[1] >>= m_sLocation) )
{
- throw uno::RuntimeException( OUString(
- "ScriptingFrameworkURIHelper error parsing args" ),
- uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( "ScriptingFrameworkURIHelper error parsing args" );
}
SCRIPTS_PART = "/Scripts/";
@@ -106,9 +102,7 @@ throw ( uno::Exception, uno::RuntimeException, std::exception )
if ( !initBaseURI() )
{
- throw uno::RuntimeException( OUString(
- "ScriptingFrameworkURIHelper cannot find script directory"),
- uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( "ScriptingFrameworkURIHelper cannot find script directory" );
}
}