diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-07-24 00:23:49 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-07-24 14:18:24 +0200 |
commit | 45417d7e4a8d0b3dd1c6d21da1c487f9773c200a (patch) | |
tree | 3947ab4cf90239ec51b1572b6de3c4001549e714 | |
parent | 070213f800ac967e3da7c583d20fb7257b7d5896 (diff) |
remove superfluous scope
Change-Id: I0ded0e6dc4976cc13b1d60ce87ea02c01ed22490
-rw-r--r-- | sw/source/core/doc/docbm.cxx | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index f52f8f35209f..d1b8138a0e6e 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1688,45 +1688,44 @@ void CntntIdxStoreImpl::SaveFlys(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nCntnt, #endif if( pFrm ) // Do we have a layout? Then it's a bit cheaper ... { - if( pFrm->GetDrawObjs() ) + if( !pFrm->GetDrawObjs() ) + return; + const SwSortedObjs& rDObj = *pFrm->GetDrawObjs(); + for( sal_uInt32 n = rDObj.Count(); n; ) { - const SwSortedObjs& rDObj = *pFrm->GetDrawObjs(); - for( sal_uInt32 n = rDObj.Count(); n; ) + SwAnchoredObject* pObj = rDObj[ --n ]; + const SwFrmFmt& rFmt = pObj->GetFrmFmt(); + const SwFmtAnchor& rAnchor = rFmt.GetAnchor(); + SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + if ( pAPos && + ( ( nSaveFly && + FLY_AT_PARA == rAnchor.GetAnchorId() ) || + ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) ) ) { - SwAnchoredObject* pObj = rDObj[ --n ]; - const SwFrmFmt& rFmt = pObj->GetFrmFmt(); - const SwFmtAnchor& rAnchor = rFmt.GetAnchor(); - SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); - if ( pAPos && - ( ( nSaveFly && - FLY_AT_PARA == rAnchor.GetAnchorId() ) || - ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) ) ) - { - aSave.m_bOther = false; - aSave.m_nCntnt = pAPos->nContent.GetIndex(); + aSave.m_bOther = false; + aSave.m_nCntnt = pAPos->nContent.GetIndex(); - OSL_ENSURE( nNode == pAPos->nNode.GetIndex(), - "_SaveCntntIdx: Wrong Node-Index" ); - if ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) + OSL_ENSURE( nNode == pAPos->nNode.GetIndex(), + "_SaveCntntIdx: Wrong Node-Index" ); + if ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) + { + if( nCntnt <= aSave.m_nCntnt ) { - if( nCntnt <= aSave.m_nCntnt ) - { - if( SAVEFLY_SPLIT == nSaveFly ) - aSave.m_bOther = true; - else - continue; - } + if( SAVEFLY_SPLIT == nSaveFly ) + aSave.m_bOther = true; + else + continue; } - aSave.m_nIdx = pDoc->GetSpzFrmFmts()->size(); - while( aSave.m_nIdx && - &rFmt != (*pDoc->GetSpzFrmFmts())[ - --aSave.m_nIdx ] ) - ; // nothing - OSL_ENSURE( &rFmt == (*pDoc->GetSpzFrmFmts())[ - aSave.m_nIdx ], - "_SaveCntntIdx: Lost FrameFormat" ); - m_aFlyEntries.push_back(aSave); } + aSave.m_nIdx = pDoc->GetSpzFrmFmts()->size(); + while( aSave.m_nIdx && + &rFmt != (*pDoc->GetSpzFrmFmts())[ + --aSave.m_nIdx ] ) + ; // nothing + OSL_ENSURE( &rFmt == (*pDoc->GetSpzFrmFmts())[ + aSave.m_nIdx ], + "_SaveCntntIdx: Lost FrameFormat" ); + m_aFlyEntries.push_back(aSave); } } } |