summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/paintfrm.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-10-02 22:36:58 +0300
committerJustin Luth <justin_luth@sil.org>2018-10-03 06:55:29 +0200
commitb170dbbafc2a783aa8f54b5756b5c56b5153977f (patch)
tree68baee8bea2b79ae9dc229abdeed88d8a8d8ccd3 /sw/source/core/layout/paintfrm.cxx
parent8f30759a540c0b323b2fb6d873abd67f37da2ca2 (diff)
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_luth@sil.org>
Diffstat (limited to 'sw/source/core/layout/paintfrm.cxx')
-rw-r--r--sw/source/core/layout/paintfrm.cxx94
1 files changed, 46 insertions, 48 deletions
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));
}
}