summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/atrflyin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/txtnode/atrflyin.cxx')
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index d3076e642ef5..dbcc5d06b8d1 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -42,9 +42,8 @@
#include "swfont.hxx"
#include "txtfrm.hxx"
#include "flyfrms.hxx"
-// --> OD 2004-11-09 #i26945#
#include <objectformatter.hxx>
-// <--
+#include <switerator.hxx>
SwFmtFlyCnt::SwFmtFlyCnt( SwFrmFmt *pFrmFmt )
: SfxPoolItem( RES_TXTATR_FLYCNT ),
@@ -232,17 +231,15 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
return NULL;
}
- SwClientIter aIter( *GetFlyCnt().pFmt );
+ SwIterator<SwFlyFrm,SwFmt> aIter( *GetFlyCnt().pFmt );
ASSERT( pCurrFrm->IsTxtFrm(), "SwTxtFlyCnt::_GetFlyFrm for TxtFrms only." );
-
- if( aIter.GoStart() )
+ SwFrm* pFrm = aIter.First();
+ if ( pFrm )
{
SwTxtFrm *pFirst = (SwTxtFrm*)pCurrFrm;
while ( pFirst->IsFollow() )
pFirst = pFirst->FindMaster();
do
- { SwFrm * pFrm = PTR_CAST( SwFrm, aIter() );
- if ( pFrm )
{
SwTxtFrm *pTmp = pFirst;
do
@@ -257,8 +254,10 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
}
pTmp = pTmp->GetFollow();
} while ( pTmp );
- }
- } while( aIter++ );
+
+ pFrm = aIter.Next();
+
+ } while( pFrm );
}
// Wir haben keinen passenden FlyFrm gefunden, deswegen wird ein
@@ -266,8 +265,9 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
// Dabei wird eine sofortige Neuformatierung von pCurrFrm angestossen.
// Die Rekursion wird durch den Lockmechanismus in SwTxtFrm::Format()
// abgewuergt.
- SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, (SwFrm*)pCurrFrm );
- ((SwFrm*)pCurrFrm)->AppendFly( pFly );
+ SwFrm* pCurrFrame = const_cast< SwFrm* >(pCurrFrm);
+ SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, pCurrFrame, pCurrFrame );
+ pCurrFrame->AppendFly( pFly );
pFly->RegistFlys();
// 7922: Wir muessen dafuer sorgen, dass der Inhalt des FlyInCnt