[Libreoffice-commits] core.git: Branch 'feature/SwFrameBorder' - sw/source
Armin Le Grand
Armin.Le.Grand at cib.de
Wed Dec 6 17:57:48 UTC 2017
sw/source/core/layout/paintfrm.cxx | 140 -------------------------------------
1 file changed, 140 deletions(-)
New commits:
commit 5a8a2774cce9b7f8891b92ab207bc04aba9e50c3
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date: Wed Dec 6 18:56:06 2017 +0100
SwFrameBorder: Clang errors fixed
Change-Id: Ib0aa55cc5ad980a7e395b6a00ac30054cb268ebd
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index c35413757beb..09f2f4280758 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4492,146 +4492,6 @@ void SwFrame::PaintBorderLine( const SwRect& rRect,
gProp.pSLines->AddLineRect( aOut, pColor, nStyle, pTab, nSubCol, gProp );
}
-/**
- * @note Only all lines once or all lines twice!
- *
- * OD 29.04.2003 #107169# - method called for left and right border rectangles.
- * For a printer output device perform adjustment for non-overlapping top and
- * bottom border rectangles. Thus, add parameter <_bPrtOutputDev> to indicate
- * printer output device.
- * NOTE: For printer output device left/right border rectangle <_iorRect>
- * has to be already non-overlapping the outer top/bottom border rectangle.
- */
-static void lcl_SubTopBottom( SwRect& _iorRect,
- const SvxBoxItem& _rBox,
- const SwBorderAttrs& _rAttrs,
- const SwFrame& _rFrame,
- const SwRectFn& _rRectFn,
- const bool _bPrtOutputDev,
- SwPaintProperties const & properties )
-{
- const bool bCnt = _rFrame.IsContentFrame();
- if ( _rBox.GetTop() && _rBox.GetTop()->GetInWidth() &&
- ( !bCnt || _rAttrs.GetTopLine( _rFrame ) )
- )
- {
- // subtract distance between outer and inner line.
- SwTwips nDist = ::lcl_MinHeightDist( _rBox.GetTop()->GetDistance(), properties );
- // OD 19.05.2003 #109667# - non-overlapping border rectangles:
- // adjust x-/y-position, if inner top line is a hair line (width = 1)
- bool bIsInnerTopLineHairline = false;
- if ( !_bPrtOutputDev )
- {
- // additionally subtract width of top outer line
- // --> left/right inner/outer line doesn't overlap top outer line.
- nDist += ::lcl_AlignHeight( _rBox.GetTop()->GetOutWidth(), properties );
- }
- else
- {
- // OD 29.04.2003 #107169# - additionally subtract width of top inner line
- // --> left/right inner/outer line doesn't overlap top inner line.
- nDist += ::lcl_AlignHeight( _rBox.GetTop()->GetInWidth(), properties );
- bIsInnerTopLineHairline = _rBox.GetTop()->GetInWidth() == 1;
- }
- (_iorRect.*_rRectFn->fnSubTop)( -nDist );
- // OD 19.05.2003 #109667# - adjust calculated border top, if inner top line
- // is a hair line
- if ( bIsInnerTopLineHairline )
- {
- if ( _rFrame.IsVertical() )
- {
- // right of border rectangle has to be checked and adjusted
- Point aCompPt( _iorRect.Right(), 0 );
- Point aRefPt( aCompPt.X() + 1, aCompPt.Y() );
- lcl_CompPxPosAndAdjustPos( *(properties.pSGlobalShell->GetOut()),
- aRefPt, aCompPt,
- true, -1 );
- _iorRect.Right( aCompPt.X() );
- }
- else
- {
- // top of border rectangle has to be checked and adjusted
- Point aCompPt( 0, _iorRect.Top() );
- Point aRefPt( aCompPt.X(), aCompPt.Y() - 1 );
- lcl_CompPxPosAndAdjustPos( *(properties.pSGlobalShell->GetOut()),
- aRefPt, aCompPt,
- false, +1 );
- _iorRect.Top( aCompPt.Y() );
- }
- }
- }
-
- if ( _rBox.GetBottom() && _rBox.GetBottom()->GetInWidth() &&
- ( !bCnt || _rAttrs.GetBottomLine( _rFrame ) )
- )
- {
- // subtract distance between outer and inner line.
- SwTwips nDist = ::lcl_MinHeightDist( _rBox.GetBottom()->GetDistance(), properties );
- // OD 19.05.2003 #109667# - non-overlapping border rectangles:
- // adjust x-/y-position, if inner bottom line is a hair line (width = 1)
- bool bIsInnerBottomLineHairline = false;
- if ( !_bPrtOutputDev )
- {
- // additionally subtract width of bottom outer line
- // --> left/right inner/outer line doesn't overlap bottom outer line.
- nDist += ::lcl_AlignHeight( _rBox.GetBottom()->GetOutWidth(), properties );
- }
- else
- {
- // OD 29.04.2003 #107169# - additionally subtract width of bottom inner line
- // --> left/right inner/outer line doesn't overlap bottom inner line.
- nDist += ::lcl_AlignHeight( _rBox.GetBottom()->GetInWidth(), properties );
- bIsInnerBottomLineHairline = _rBox.GetBottom()->GetInWidth() == 1;
- }
- (_iorRect.*_rRectFn->fnAddBottom)( -nDist );
- // OD 19.05.2003 #109667# - adjust calculated border bottom, if inner
- // bottom line is a hair line.
- if ( bIsInnerBottomLineHairline )
- {
- if ( _rFrame.IsVertical() )
- {
- // left of border rectangle has to be checked and adjusted
- Point aCompPt( _iorRect.Left(), 0 );
- Point aRefPt( aCompPt.X() - 1, aCompPt.Y() );
- lcl_CompPxPosAndAdjustPos( *(properties.pSGlobalShell->GetOut()),
- aRefPt, aCompPt,
- true, +1 );
- _iorRect.Left( aCompPt.X() );
- }
- else
- {
- // bottom of border rectangle has to be checked and adjusted
- Point aCompPt( 0, _iorRect.Bottom() );
- Point aRefPt( aCompPt.X(), aCompPt.Y() + 1 );
- lcl_CompPxPosAndAdjustPos( *(properties.pSGlobalShell->GetOut()),
- aRefPt, aCompPt,
- false, -1 );
- _iorRect.Bottom( aCompPt.Y() );
- }
- }
- }
-}
-
-static sal_uInt16 lcl_GetLineWidth( const SvxBorderLine* pLine )
-{
- if ( pLine != nullptr )
- return pLine->GetScaledWidth();
-
- return 0;
-}
-
-static double lcl_GetExtent( const SvxBorderLine* pSideLine, const SvxBorderLine* pOppositeLine )
-{
- double nExtent = 0.0;
-
- if ( pSideLine && !pSideLine->isEmpty() )
- nExtent = -lcl_GetLineWidth( pSideLine ) / 2.0;
- else if ( pOppositeLine )
- nExtent = lcl_GetLineWidth( pOppositeLine ) / 2.0;
-
- return nExtent;
-}
-
namespace drawinglayer
{
namespace primitive2d
More information about the Libreoffice-commits
mailing list