diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-12-03 10:20:34 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-12-03 10:20:34 +0100 |
commit | 455c3c0ca387adde8aeafe598cb49f730d655bd9 (patch) | |
tree | 938a6d7b4ea09f6fb622657b0587b199951b3fe7 /svx/source/form | |
parent | Automated merge with ssh://hg@hg.services.openoffice.org/cws/dba34c (diff) | |
download | core-455c3c0ca387adde8aeafe598cb49f730d655bd9.tar.gz core-455c3c0ca387adde8aeafe598cb49f730d655bd9.zip |
dba34c: #i115880# removed assertion - it does not really indicate a problem, and preventing it otherwise would be unreasonably expensive
Diffstat (limited to 'svx/source/form')
-rw-r--r-- | svx/source/form/fmpgeimp.cxx | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index ec612e2ea782..a582d97d8d15 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -169,16 +169,16 @@ namespace //------------------------------------------------------------------------------ void FmFormPageImpl::initFrom( FmFormPageImpl& i_foreignImpl ) { - DBG_CTOR(FmFormPageImpl,NULL); - // clone the Forms collection - Reference< XCloneable > xCloneable( const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ), UNO_QUERY ); + const Reference< XNameContainer > xForeignForms( const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ) ); + const Reference< XCloneable > xCloneable( xForeignForms, UNO_QUERY ); if ( !xCloneable.is() ) { // great, nothing to do - OSL_ENSURE( !const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ).is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" ); + OSL_ENSURE( !xForeignForms.is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" ); return; } + try { m_xForms.set( xCloneable->createClone(), UNO_QUERY_THROW ); @@ -205,31 +205,23 @@ void FmFormPageImpl::initFrom( FmFormPageImpl& i_foreignImpl ) bool bForeignIsForm = pForeignObj && ( pForeignObj->GetObjInventor() == FmFormInventor ); bool bOwnIsForm = pOwnObj && ( pOwnObj->GetObjInventor() == FmFormInventor ); - if ( bForeignIsForm != bOwnIsForm ) - { - OSL_ENSURE( false, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" ); - // don't attempt to do further assignments, something's completely messed up - break; - } + ENSURE_OR_BREAK( bForeignIsForm == bOwnIsForm, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" ); + // if this fires, don't attempt to do further assignments, something's completely messed up + if ( !bForeignIsForm ) // no form control -> next round continue; Reference< XControlModel > xForeignModel( pForeignObj->GetUnoControlModel() ); - OSL_ENSURE( xForeignModel.is(), "FmFormPageImpl::FmFormPageImpl: control shape without control!" ); - if ( !xForeignModel.is() ) - // the SdrObject does not have a UNO Control Model. This is pathological, but well ... So the cloned - // SdrObject will also not have a UNO Control Model. - continue; - - OSL_ENSURE( !pOwnObj->GetUnoControlModel().is(), "FmFormPageImpl::FmFormPageImpl: there already is a control model for the target object!" ); + ENSURE_OR_CONTINUE( xForeignModel.is(), "FmFormPageImpl::FmFormPageImpl: control shape without control!" ); + // if this fires, the SdrObject does not have a UNO Control Model. This is pathological, but well ... + // So the cloned SdrObject will also not have a UNO Control Model. MapControlModels::const_iterator assignment = aModelAssignment.find( xForeignModel ); - OSL_ENSURE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" ); - if ( assignment == aModelAssignment.end() ) - // the source SdrObject has a model, but it is not part of the model hierarchy in i_foreignImpl.getForms(). + ENSURE_OR_CONTINUE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" ); + // if this fires, the source SdrObject has a model, but it is not part of the model hierarchy in + // i_foreignImpl.getForms(). // Pathological, too ... - continue; pOwnObj->SetUnoControlModel( assignment->second ); } |