diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
commit | a0d0dd7ae3feaf4de3d70957c20bb1fcf22525bf (patch) | |
tree | 0d4f1aa05689431fd938fd505466261d16b2b645 /sw/source/core/unocore/unodraw.cxx | |
parent | c84af0cedc1c407d5e1a92fe172e134c08b130f6 (diff) | |
parent | fd6a3e64d1c8bb4f42e33d78fe8f7e5d738fb0a2 (diff) |
dba33f: merge with m76-branch
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 8ae8f948900f..ab5d68910769 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; + } } } } |