diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-02-17 21:57:17 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-02-22 12:25:00 +0100 |
commit | f268099aad4c55cb29bed25179434f4798f57105 (patch) | |
tree | ef44c18e362df0ee1428504be0c0884f401fa3b6 /sw | |
parent | a88f507bc66cbceb6b82f5ca4ff04dec79eaa276 (diff) |
Avoid else after return and make code more readable
Change-Id: I3bffc7aa916c2408dfb981837c58e90d7d4b16e7
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/porrst.cxx | 84 |
1 files changed, 40 insertions, 44 deletions
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 8c1bc56f2bcb..263d0fb7e08d 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -313,55 +313,51 @@ bool SwTxtFrm::FormatEmpty() SVX_LINE_SPACE_FIX == rSpacing.GetLineSpaceRule() || aSet.GetLRSpace().IsAutoFirst() ) ) return false; - else - { - SwTxtFly aTxtFly( this ); - SwRect aRect; - bool bFirstFlyCheck = 0 != Prt().Height(); - if ( !bCollapse && bFirstFlyCheck && - aTxtFly.IsOn() && aTxtFly.IsAnyObj( aRect ) ) - return false; - else - { - SwTwips nHeight = EmptyHeight(); - if ( GetTxtNode()->GetSwAttrSet().GetParaGrid().GetValue() && - IsInDocBody() ) - { - GETGRID( FindPageFrm() ) - if ( pGrid ) - nHeight = pGrid->GetBaseHeight() + pGrid->GetRubyHeight(); - } + SwTxtFly aTxtFly( this ); + SwRect aRect; + bool bFirstFlyCheck = 0 != Prt().Height(); + if ( !bCollapse && bFirstFlyCheck && + aTxtFly.IsOn() && aTxtFly.IsAnyObj( aRect ) ) + return false; - SWRECTFN( this ) - const SwTwips nChg = nHeight - (Prt().*fnRect->fnGetHeight)(); + SwTwips nHeight = EmptyHeight(); - if( !nChg ) - SetUndersized( false ); - AdjustFrm( nChg ); + if ( GetTxtNode()->GetSwAttrSet().GetParaGrid().GetValue() && + IsInDocBody() ) + { + GETGRID( FindPageFrm() ) + if ( pGrid ) + nHeight = pGrid->GetBaseHeight() + pGrid->GetRubyHeight(); + } - if( HasBlinkPor() ) - { - ClearPara(); - ResetBlinkPor(); - } - SetCacheIdx( MSHRT_MAX ); - if( !IsEmpty() ) - { - SetEmpty( true ); - SetCompletePaint(); - } - if( !bCollapse && !bFirstFlyCheck && - aTxtFly.IsOn() && aTxtFly.IsAnyObj( aRect ) ) - return false; - - // #i35635# - call method <HideAndShowObjects()> - // to assure that objects anchored at the empty paragraph are - // correctly visible resp. invisible. - HideAndShowObjects(); - return true; - } + SWRECTFN( this ) + const SwTwips nChg = nHeight - (Prt().*fnRect->fnGetHeight)(); + + if( !nChg ) + SetUndersized( false ); + AdjustFrm( nChg ); + + if( HasBlinkPor() ) + { + ClearPara(); + ResetBlinkPor(); } + SetCacheIdx( MSHRT_MAX ); + if( !IsEmpty() ) + { + SetEmpty( true ); + SetCompletePaint(); + } + if( !bCollapse && !bFirstFlyCheck && + aTxtFly.IsOn() && aTxtFly.IsAnyObj( aRect ) ) + return false; + + // #i35635# - call method <HideAndShowObjects()> + // to assure that objects anchored at the empty paragraph are + // correctly visible resp. invisible. + HideAndShowObjects(); + return true; } bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff ) |