summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-09-02 13:38:53 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-09-02 13:38:53 +0200
commita3b8ba9084333aa7d6ca304dc9a51d089831b6eb (patch)
tree5e22f903267d9e3ded8d264459042f5f628e2ccb /sfx2
parent3ce3eaa6fa51944904686fe0fa955a19c52111d9 (diff)
dba34a: #i111379# don't throw exceptions in the header, move this to the CXX
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx7
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx13
2 files changed, 10 insertions, 10 deletions
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 578dd1fd33bb..00ee49a18004 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -1484,8 +1484,8 @@ public:
*/
SAL_DLLPRIVATE sal_Bool impl_isDisposed() const ;
- sal_Bool IsDisposed() const ;
sal_Bool IsInitialized() const;
+ void MethodEntryCheck( const bool i_mustBeInitialized ) const;
::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData() throw (::com::sun::star::uno::RuntimeException);
void SAL_CALL setViewData( const ::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess >& aData ) throw (::com::sun::star::uno::RuntimeException);
@@ -1573,10 +1573,7 @@ public:
SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE )
:m_aGuard( Application::GetSolarMutex() )
{
- if ( i_rModel.IsDisposed() )
- throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *&i_rModel );
- if ( ( i_eState != E_INITIALIZING ) && !i_rModel.IsInitialized() )
- throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *&i_rModel );
+ i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING );
}
~SfxModelGuard()
{
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 7ef9fe0d2f19..929fc02ca8d5 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2598,11 +2598,6 @@ SfxObjectShell* SfxBaseModel::impl_getObjectShell() const
// public impl.
//________________________________________________________________________________________________________
-sal_Bool SfxBaseModel::IsDisposed() const
-{
- return ( m_pData == NULL ) ;
-}
-
sal_Bool SfxBaseModel::IsInitialized() const
{
if ( !m_pData || !m_pData->m_pObjectShell )
@@ -2614,6 +2609,14 @@ sal_Bool SfxBaseModel::IsInitialized() const
return m_pData->m_pObjectShell->GetMedium() != NULL;
}
+void SfxBaseModel::MethodEntryCheck( const bool i_mustBeInitialized ) const
+{
+ if ( impl_isDisposed() )
+ throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *const_cast< SfxBaseModel* >( this ) );
+ if ( i_mustBeInitialized && !IsInitialized() )
+ throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *const_cast< SfxBaseModel* >( this ) );
+}
+
sal_Bool SfxBaseModel::impl_isDisposed() const
{
return ( m_pData == NULL ) ;