summaryrefslogtreecommitdiff
path: root/sd/workben
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-19 11:16:52 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-19 11:16:52 +0100
commit0dec5536c50fb545cf26701c6ecf158d3f9ab38a (patch)
treefe3c5321c8397cda3eea7d5ab0926c7fe01fbe0d /sd/workben
parent1644d80f7aa55a6b2e4a926215b105842c3ab242 (diff)
slidecopy: XResourceFactory::createResource now allows to raise IllegalArgument/WrappedTargetException
Diffstat (limited to 'sd/workben')
-rw-r--r--sd/workben/custompanel/ctp_factory.cxx8
-rw-r--r--sd/workben/custompanel/ctp_factory.hxx2
2 files changed, 5 insertions, 5 deletions
diff --git a/sd/workben/custompanel/ctp_factory.cxx b/sd/workben/custompanel/ctp_factory.cxx
index 573c68ebfecb..caa19170ca59 100644
--- a/sd/workben/custompanel/ctp_factory.cxx
+++ b/sd/workben/custompanel/ctp_factory.cxx
@@ -58,6 +58,7 @@ namespace sd { namespace colortoolpanel
using ::com::sun::star::lang::NotInitializedException;
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::drawing::framework::XResourceFactoryManager;
+ using ::com::sun::star::lang::WrappedTargetException;
/** === end UNO using === **/
//==================================================================================================================
@@ -87,16 +88,15 @@ namespace sd { namespace colortoolpanel
}
//------------------------------------------------------------------------------------------------------------------
- Reference< XResource > SAL_CALL ResourceFactory::createResource( const Reference< XResourceId >& i_rResourceId ) throw (RuntimeException)
+ Reference< XResource > SAL_CALL ResourceFactory::createResource( const Reference< XResourceId >& i_rResourceId ) throw (RuntimeException, IllegalArgumentException, WrappedTargetException)
{
FactoryGuard aGuard( *this );
if ( !i_rResourceId.is() )
- // TODO: the API should allow me to throw an IllegalArgumentException here
- throw NULL;
+ throw IllegalArgumentException( ::rtl::OUString::createFromAscii( "illegal resource ID" ), *this, 1 );
const ::rtl::OUString sResourceURL( i_rResourceId->getResourceURL() );
if ( sResourceURL != lcl_getSingleColorViewURL() )
- return NULL;
+ throw IllegalArgumentException( ::rtl::OUString::createFromAscii( "unsupported resource URL" ), *this, 1 );
return new SingleColorPanel( m_xContext, m_xControllerManager->getConfigurationController(), i_rResourceId );
}
diff --git a/sd/workben/custompanel/ctp_factory.hxx b/sd/workben/custompanel/ctp_factory.hxx
index 8f9ff523f5ec..ab6cb3f6a9db 100644
--- a/sd/workben/custompanel/ctp_factory.hxx
+++ b/sd/workben/custompanel/ctp_factory.hxx
@@ -62,7 +62,7 @@ namespace sd { namespace colortoolpanel
~ResourceFactory();
// XResourceFactory
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResource > SAL_CALL createResource( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& xResourceId ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResource > SAL_CALL createResource( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& xResourceId ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException);
virtual void SAL_CALL releaseResource( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResource >& xResource ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo