sw/source/core/layout/paintfrm.cxx | 94 ++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 48 deletions(-)
New commits: commit b170dbbafc2a783aa8f54b5756b5c56b5153977f Author: Justin Luth <justin_l...@sil.org> AuthorDate: Tue Oct 2 22:36:58 2018 +0300 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Wed Oct 3 06:55:29 2018 +0200 paintfrm white-spacing adjust: remove obsolete brackets doing this in a separate patch to avoid obscuring the changes inside of the other cleanup patch. This simply removes one layer of indenting. Change-Id: I295b2ef59fb8c62db14d18d2e529da6c4c578665 Reviewed-on: https://gerrit.libreoffice.org/61273 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 098cc26ef718..af4ed98bfbec 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1246,63 +1246,61 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrame *pFrame, rRect = pFrame->getFramePrintArea(); rRect.Pos() += pFrame->getFrameArea().Pos(); + SwRectFn fnRect = pFrame->IsVertical() ? ( pFrame->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; + + const SvxBoxItem &rBox = rAttrs.GetBox(); + const bool bTop = 0 != (pFrame->*fnRect->fnGetTopMargin)(); + if ( bTop ) { - SwRectFn fnRect = pFrame->IsVertical() ? ( pFrame->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; + SwTwips nDiff = rBox.GetTop() ? + rBox.CalcLineSpace( SvxBoxItemLine::TOP ) : + rBox.GetDistance( SvxBoxItemLine::TOP ); + if( nDiff ) + (rRect.*fnRect->fnSubTop)( nDiff ); + } - const SvxBoxItem &rBox = rAttrs.GetBox(); - const bool bTop = 0 != (pFrame->*fnRect->fnGetTopMargin)(); - if ( bTop ) + const bool bBottom = 0 != (pFrame->*fnRect->fnGetBottomMargin)(); + if ( bBottom ) + { + SwTwips nDiff = 0; + // #i29550# + if ( pFrame->IsTabFrame() && + static_cast<const SwTabFrame*>(pFrame)->IsCollapsingBorders() ) { - SwTwips nDiff = rBox.GetTop() ? - rBox.CalcLineSpace( SvxBoxItemLine::TOP ) : - rBox.GetDistance( SvxBoxItemLine::TOP ); - if( nDiff ) - (rRect.*fnRect->fnSubTop)( nDiff ); + // For collapsing borders, we have to add the height of + // the height of the last line + nDiff = static_cast<const SwTabFrame*>(pFrame)->GetBottomLineSize(); } - - const bool bBottom = 0 != (pFrame->*fnRect->fnGetBottomMargin)(); - if ( bBottom ) + else { - SwTwips nDiff = 0; - // #i29550# - if ( pFrame->IsTabFrame() && - static_cast<const SwTabFrame*>(pFrame)->IsCollapsingBorders() ) - { - // For collapsing borders, we have to add the height of - // the height of the last line - nDiff = static_cast<const SwTabFrame*>(pFrame)->GetBottomLineSize(); - } - else - { - nDiff = rBox.GetBottom() ? - rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM ) : - rBox.GetDistance( SvxBoxItemLine::BOTTOM ); - } - if( nDiff ) - (rRect.*fnRect->fnAddBottom)( nDiff ); + nDiff = rBox.GetBottom() ? + rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM ) : + rBox.GetDistance( SvxBoxItemLine::BOTTOM ); } + if( nDiff ) + (rRect.*fnRect->fnAddBottom)( nDiff ); + } - if ( rBox.GetLeft() ) - (rRect.*fnRect->fnSubLeft)( rBox.CalcLineSpace( SvxBoxItemLine::LEFT ) ); - else - (rRect.*fnRect->fnSubLeft)( rBox.GetDistance( SvxBoxItemLine::LEFT ) ); + if ( rBox.GetLeft() ) + (rRect.*fnRect->fnSubLeft)( rBox.CalcLineSpace( SvxBoxItemLine::LEFT ) ); + else + (rRect.*fnRect->fnSubLeft)( rBox.GetDistance( SvxBoxItemLine::LEFT ) ); - if ( rBox.GetRight() ) - (rRect.*fnRect->fnAddRight)( rBox.CalcLineSpace( SvxBoxItemLine::RIGHT ) ); - else - (rRect.*fnRect->fnAddRight)( rBox.GetDistance( SvxBoxItemLine::RIGHT ) ); + if ( rBox.GetRight() ) + (rRect.*fnRect->fnAddRight)( rBox.CalcLineSpace( SvxBoxItemLine::RIGHT ) ); + else + (rRect.*fnRect->fnAddRight)( rBox.GetDistance( SvxBoxItemLine::RIGHT ) ); - if ( bShadow && rAttrs.GetShadow().GetLocation() != SvxShadowLocation::NONE ) - { - const SvxShadowItem &rShadow = rAttrs.GetShadow(); - if ( bTop ) - (rRect.*fnRect->fnSubTop)(rShadow.CalcShadowSpace(SvxShadowItemSide::TOP)); - (rRect.*fnRect->fnSubLeft)(rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT)); - if ( bBottom ) - (rRect.*fnRect->fnAddBottom) - (rShadow.CalcShadowSpace( SvxShadowItemSide::BOTTOM )); - (rRect.*fnRect->fnAddRight)(rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT)); - } + if ( bShadow && rAttrs.GetShadow().GetLocation() != SvxShadowLocation::NONE ) + { + const SvxShadowItem &rShadow = rAttrs.GetShadow(); + if ( bTop ) + (rRect.*fnRect->fnSubTop)(rShadow.CalcShadowSpace(SvxShadowItemSide::TOP)); + (rRect.*fnRect->fnSubLeft)(rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT)); + if ( bBottom ) + (rRect.*fnRect->fnAddBottom) + (rShadow.CalcShadowSpace( SvxShadowItemSide::BOTTOM )); + (rRect.*fnRect->fnAddRight)(rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT)); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits