diff options
Diffstat (limited to 'svx/source/form/fmmodel.cxx')
-rw-r--r-- | svx/source/form/fmmodel.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx index d816dc06b813..09008ae220b9 100644 --- a/svx/source/form/fmmodel.cxx +++ b/svx/source/form/fmmodel.cxx @@ -223,18 +223,21 @@ void FmFormModel::MovePage( USHORT nPgNum, USHORT nNewPos ) \************************************************************************/ SdrPage* FmFormModel::RemovePage(sal_uInt16 nPgNum) { - FmFormPage* pPage = (FmFormPage*)SdrModel::RemovePage(nPgNum); + FmFormPage* pToBeRemovedPage = dynamic_cast< FmFormPage* >( GetPage( nPgNum ) ); + OSL_ENSURE( pToBeRemovedPage, "FmFormModel::RemovePage: *which page*?" ); #ifndef SVX_LIGHT - if (pPage) + if ( pToBeRemovedPage ) { - Reference< XNameContainer > xForms( pPage->GetForms( false ) ); + Reference< XNameContainer > xForms( pToBeRemovedPage->GetForms( false ) ); if ( xForms.is() ) m_pImpl->pUndoEnv->RemoveForms( xForms ); } #endif - return pPage; + FmFormPage* pRemovedPage = (FmFormPage*)SdrModel::RemovePage(nPgNum); + OSL_ENSURE( pRemovedPage == pToBeRemovedPage, "FmFormModel::RemovePage: inconsistency!" ); + return pRemovedPage; } /************************************************************************* |