diff options
Diffstat (limited to 'sw/source/core/text/txtdrop.cxx')
-rw-r--r-- | sw/source/core/text/txtdrop.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 19d888153542..623019163396 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -43,13 +43,12 @@ #include <txtpaint.hxx> // SwSaveClip #include <blink.hxx> // pBlink #include <breakit.hxx> -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include <com/sun/star/i18n/ScriptType.hdl> -#endif #include <com/sun/star/i18n/WordType.hpp> #include <editeng/langitem.hxx> #include <charatr.hxx> #include <editeng/fhgtitem.hxx> +#include <switerator.hxx> using namespace ::com::sun::star::i18n; using namespace ::com::sun::star; @@ -228,21 +227,19 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen } // get text frame - SwClientIter aClientIter( (SwTxtNode&)*this ); - SwClient* pLastFrm = aClientIter.GoStart(); - - while( pLastFrm ) + SwIterator<SwTxtFrm,SwTxtNode> aIter( *this ); + for( SwTxtFrm* pLastFrm = aIter.First(); pLastFrm; pLastFrm = aIter.Next() ) { // Only (master-) text frames can have a drop cap. - if ( pLastFrm->ISA( SwTxtFrm ) && !((SwTxtFrm*)pLastFrm)->IsFollow() ) + if ( !pLastFrm->IsFollow() ) { - if( !((SwTxtFrm*)pLastFrm)->HasPara() ) - ((SwTxtFrm*)pLastFrm)->GetFormatted(); + if( !pLastFrm->HasPara() ) + pLastFrm->GetFormatted(); - if ( !((SwTxtFrm*)pLastFrm)->IsEmpty() ) + if ( !pLastFrm->IsEmpty() ) { - const SwParaPortion* pPara = ((SwTxtFrm*)pLastFrm)->GetPara(); + const SwParaPortion* pPara = pLastFrm->GetPara(); ASSERT( pPara, "GetDropSize could not find the ParaPortion, I'll guess the drop cap size" ) if ( pPara ) @@ -265,7 +262,6 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen } break; } - pLastFrm = ++aClientIter; } if (rFontHeight==0 && rDropHeight==0 && rDropDescent==0) |