diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-06-13 15:35:35 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-06-13 15:35:35 +0200 |
commit | d854960f9ee36760fa49bd6de97d9e01aa087900 (patch) | |
tree | e26b6b82a8328b050e738eda1a2bab1389294bed /sw/source/core/unocore/unodraw.cxx | |
parent | ebc5777548dea42ed966a16c66d879b1485bbfb4 (diff) | |
parent | f536dbf880c747403a9aed3a047487b8075d282f (diff) |
CWS swlayoutrefactoring: resync to m82
Diffstat (limited to 'sw/source/core/unocore/unodraw.cxx')
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 80ee39740c01..9cb7775e3bee 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -39,6 +39,7 @@ #include <unotextrange.hxx> #include <unoprnms.hxx> #include <editeng/unoprnms.hxx> +#include <svx/svditer.hxx> #include <swunohelper.hxx> #include <doc.hxx> #include <fmtcntnt.hxx> @@ -1052,25 +1053,34 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) : -----------------------------------------------------------------------*/ void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj ) { - SwXShape* pSwShape = NULL; - uno::Reference< lang::XUnoTunnel > xShapeTunnel( _rObj.getWeakUnoShape(), uno::UNO_QUERY ); - if ( xShapeTunnel.is() ) - pSwShape = reinterpret_cast< SwXShape * >( - sal::static_int_cast< sal_IntPtr >( xShapeTunnel->getSomething( SwXShape::getUnoTunnelId() ) ) ); - if ( pSwShape ) + SdrObjListIter aIter( _rObj, IM_DEEPNOGROUPS ); + while ( aIter.IsMore() ) { - if ( pSwShape->m_bDescriptor ) - { - SwFrmFmt* pFmt = ::FindFrmFmt( &const_cast< SdrObject& >( _rObj ) ); - if ( pFmt ) - pFmt->Add( pSwShape ); - pSwShape->m_bDescriptor = sal_False; - } + SdrObject* pCurrent = aIter.Next(); + OSL_ENSURE( pCurrent, "SwXShape::AddExistingShapeToFmt: invalid object list element!" ); + if ( !pCurrent ) + continue; - if ( !pSwShape->pImpl->bInitializedPropertyNotifier ) + SwXShape* pSwShape = NULL; + uno::Reference< lang::XUnoTunnel > xShapeTunnel( pCurrent->getWeakUnoShape(), uno::UNO_QUERY ); + if ( xShapeTunnel.is() ) + pSwShape = reinterpret_cast< SwXShape * >( + sal::static_int_cast< sal_IntPtr >( xShapeTunnel->getSomething( SwXShape::getUnoTunnelId() ) ) ); + if ( pSwShape ) { - lcl_addShapePropertyEventFactories( _rObj, *pSwShape ); - pSwShape->pImpl->bInitializedPropertyNotifier = true; + if ( pSwShape->m_bDescriptor ) + { + SwFrmFmt* pFmt = ::FindFrmFmt( const_cast< SdrObject* >( pCurrent ) ); + if ( pFmt ) + pFmt->Add( pSwShape ); + pSwShape->m_bDescriptor = sal_False; + } + + if ( !pSwShape->pImpl->bInitializedPropertyNotifier ) + { + lcl_addShapePropertyEventFactories( *pCurrent, *pSwShape ); + pSwShape->pImpl->bInitializedPropertyNotifier = true; + } } } } |