Kaydet (Commit) b170dbba authored tarafından Justin Luth's avatar Justin Luth

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: 's avatarJustin Luth <justin_luth@sil.org>
üst 8f30759a
......@@ -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));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment