sd::DocumentSettings: throwing UnknownPropertyException ...

... for properties that are in the PropertySetInfo just because there's
no document or shell is just plain wrong.

Change-Id: I84f4f930f492753b20ba04ec4d41c905d674b9ba
This commit is contained in:
Michael Stahl
2013-03-22 14:24:13 +01:00
parent cc85e44cfa
commit 3605407693
3 changed files with 32 additions and 14 deletions

View File

@@ -46,12 +46,12 @@ private:
PropertySetHelperImpl* mp; PropertySetHelperImpl* mp;
protected: protected:
virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0; virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ) = 0;
virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ) = 0; virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ) = 0;
virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::beans::PropertyState* pStates ) throw(::com::sun::star::beans::UnknownPropertyException ); virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::beans::PropertyState* pStates ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException ); virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
public: public:
PropertySetHelper( comphelper::PropertySetInfo* pInfo ) throw(); PropertySetHelper( comphelper::PropertySetInfo* pInfo ) throw();

View File

@@ -282,17 +282,22 @@ Any SAL_CALL PropertySetHelper::getPropertyDefault( const ::rtl::OUString& aProp
return _getPropertyDefault( pEntry ); return _getPropertyDefault( pEntry );
} }
void PropertySetHelper::_getPropertyStates( const comphelper::PropertyMapEntry**, PropertyState* ) throw(UnknownPropertyException ) void PropertySetHelper::_getPropertyStates(
const comphelper::PropertyMapEntry**, PropertyState*)
throw (UnknownPropertyException, RuntimeException)
{ {
OSL_FAIL( "you have to implement this yourself!"); OSL_FAIL( "you have to implement this yourself!");
} }
void PropertySetHelper::_setPropertyToDefault( const comphelper::PropertyMapEntry* ) throw(UnknownPropertyException ) void
PropertySetHelper::_setPropertyToDefault(const comphelper::PropertyMapEntry*)
throw (UnknownPropertyException, RuntimeException)
{ {
OSL_FAIL( "you have to implement this yourself!"); OSL_FAIL( "you have to implement this yourself!");
} }
Any PropertySetHelper::_getPropertyDefault( const comphelper::PropertyMapEntry* ) throw(UnknownPropertyException, WrappedTargetException ) Any PropertySetHelper::_getPropertyDefault(const comphelper::PropertyMapEntry*)
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{ {
OSL_FAIL( "you have to implement this yourself!"); OSL_FAIL( "you have to implement this yourself!");

View File

@@ -111,8 +111,8 @@ namespace sd
const uno::Sequence<beans::PropertyValue>& aConfigProps ); const uno::Sequence<beans::PropertyValue>& aConfigProps );
protected: protected:
virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, RuntimeException );
virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, RuntimeException );
private: private:
bool LoadList( XPropertyListType t, const rtl::OUString &rPath, bool LoadList( XPropertyListType t, const rtl::OUString &rPath,
@@ -388,14 +388,21 @@ uno::Sequence<beans::PropertyValue>
return aRet; return aRet;
} }
void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, const Any* pValues ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) void
DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
const Any* pValues)
throw (UnknownPropertyException, PropertyVetoException,
IllegalArgumentException, WrappedTargetException, RuntimeException)
{ {
::SolarMutexGuard aGuard; ::SolarMutexGuard aGuard;
SdDrawDocument* pDoc = mpModel->GetDoc(); SdDrawDocument* pDoc = mpModel->GetDoc();
::sd::DrawDocShell* pDocSh = mpModel->GetDocShell(); ::sd::DrawDocShell* pDocSh = mpModel->GetDocShell();
if( NULL == pDoc || NULL == pDocSh ) if( NULL == pDoc || NULL == pDocSh )
throw UnknownPropertyException(); {
throw RuntimeException("Document or Shell missing",
static_cast<OWeakObject *>(this));
}
sal_Bool bValue = sal_False; sal_Bool bValue = sal_False;
bool bOk, bChanged = false, bOptionsChanged = false; bool bOk, bChanged = false, bOptionsChanged = false;
@@ -949,14 +956,20 @@ void DocumentSettings::ExtractURL( XPropertyListType t, Any* pValue )
*pValue <<= aPath; *pValue <<= aPath;
} }
void DocumentSettings::_getPropertyValues( const PropertyMapEntry** ppEntries, Any* pValue ) throw(UnknownPropertyException, WrappedTargetException ) void
DocumentSettings::_getPropertyValues(
const PropertyMapEntry** ppEntries, Any* pValue)
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{ {
::SolarMutexGuard aGuard; ::SolarMutexGuard aGuard;
SdDrawDocument* pDoc = mpModel->GetDoc(); SdDrawDocument* pDoc = mpModel->GetDoc();
::sd::DrawDocShell* pDocSh = mpModel->GetDocShell(); ::sd::DrawDocShell* pDocSh = mpModel->GetDocShell();
if( NULL == pDoc || NULL == pDocSh ) if( NULL == pDoc || NULL == pDocSh )
throw UnknownPropertyException(); {
throw RuntimeException("Document or Shell missing",
static_cast<OWeakObject *>(this));
}
SdOptionsPrintItem aOptionsPrintItem( ATTR_OPTIONS_PRINT ); SdOptionsPrintItem aOptionsPrintItem( ATTR_OPTIONS_PRINT );