Kaydet (Commit) 804d0a89 authored tarafından Michael Stahl's avatar Michael Stahl

fdo#42750: delay painting borders until after subsidiary lines

With commit 0f0896c2, borders are drawn
immediately, but then the subsidiary lines are drawn over the borders,
hiding 1 twip wide borders completely.
üst bb35d3b2
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
#include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <svx/sdr/contact/objectcontacttools.hxx> #include <svx/sdr/contact/objectcontacttools.hxx>
#include <svx/unoapi.hxx> #include <svx/unoapi.hxx>
#include <comphelper/sequenceasvector.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
...@@ -219,6 +220,22 @@ public: ...@@ -219,6 +220,22 @@ public:
inline void Ins( const SwRect &rRect, const sal_uInt8 nSCol ); inline void Ins( const SwRect &rRect, const sal_uInt8 nSCol );
}; };
class BorderLines
{
::comphelper::SequenceAsVector<
::drawinglayer::primitive2d::Primitive2DReference> m_Lines;
public:
void AddBorderLine(
::drawinglayer::primitive2d::Primitive2DReference const& xLine)
{
m_Lines.push_back(xLine);
}
drawinglayer::primitive2d::Primitive2DSequence GetBorderLines() const
{
return m_Lines.getAsConstList();
}
};
//----------------- End of classes for border lines ---------------------- //----------------- End of classes for border lines ----------------------
static ViewShell *pGlobalShell = 0; static ViewShell *pGlobalShell = 0;
...@@ -252,6 +269,7 @@ static double aEdgeScale = 0.5; ...@@ -252,6 +269,7 @@ static double aEdgeScale = 0.5;
// be compared with pLines before the work in order to avoid help lines // be compared with pLines before the work in order to avoid help lines
// to hide borders. // to hide borders.
// bTablines is sal_True during the Paint of a table. // bTablines is sal_True during the Paint of a table.
static BorderLines *g_pBorderLines = 0;
static SwLineRects *pLines = 0; static SwLineRects *pLines = 0;
static SwSubsRects *pSubsLines = 0; static SwSubsRects *pSubsLines = 0;
// global variable for sub-lines of body, header, footer, section and footnote frames. // global variable for sub-lines of body, header, footer, section and footnote frames.
...@@ -334,6 +352,7 @@ class SwSavePaintStatics ...@@ -334,6 +352,7 @@ class SwSavePaintStatics
SwFlyFrm *pSRetoucheFly, SwFlyFrm *pSRetoucheFly,
*pSRetoucheFly2, *pSRetoucheFly2,
*pSFlyOnlyDraw; *pSFlyOnlyDraw;
BorderLines *pBLines;
SwLineRects *pSLines; SwLineRects *pSLines;
SwSubsRects *pSSubsLines; SwSubsRects *pSSubsLines;
SwSubsRects* pSSpecSubsLines; SwSubsRects* pSSpecSubsLines;
...@@ -359,6 +378,7 @@ SwSavePaintStatics::SwSavePaintStatics() : ...@@ -359,6 +378,7 @@ SwSavePaintStatics::SwSavePaintStatics() :
pSRetoucheFly ( pRetoucheFly ), pSRetoucheFly ( pRetoucheFly ),
pSRetoucheFly2 ( pRetoucheFly2 ), pSRetoucheFly2 ( pRetoucheFly2 ),
pSFlyOnlyDraw ( pFlyOnlyDraw ), pSFlyOnlyDraw ( pFlyOnlyDraw ),
pBLines ( g_pBorderLines ),
pSLines ( pLines ), pSLines ( pLines ),
pSSubsLines ( pSubsLines ), pSSubsLines ( pSubsLines ),
pSSpecSubsLines ( pSpecSubsLines ), pSSpecSubsLines ( pSpecSubsLines ),
...@@ -383,6 +403,7 @@ SwSavePaintStatics::SwSavePaintStatics() : ...@@ -383,6 +403,7 @@ SwSavePaintStatics::SwSavePaintStatics() :
aScaleX = aScaleY = 1.0; aScaleX = aScaleY = 1.0;
aMinDistScale = 0.73; aMinDistScale = 0.73;
aEdgeScale = 0.5; aEdgeScale = 0.5;
g_pBorderLines = 0;
pLines = 0; pLines = 0;
pSubsLines = 0; pSubsLines = 0;
pSpecSubsLines = 0L; pSpecSubsLines = 0L;
...@@ -397,6 +418,7 @@ SwSavePaintStatics::~SwSavePaintStatics() ...@@ -397,6 +418,7 @@ SwSavePaintStatics::~SwSavePaintStatics()
pRetoucheFly = pSRetoucheFly; pRetoucheFly = pSRetoucheFly;
pRetoucheFly2 = pSRetoucheFly2; pRetoucheFly2 = pSRetoucheFly2;
pFlyOnlyDraw = pSFlyOnlyDraw; pFlyOnlyDraw = pSFlyOnlyDraw;
g_pBorderLines = pBLines;
pLines = pSLines; pLines = pSLines;
pSubsLines = pSSubsLines; pSubsLines = pSSubsLines;
pSpecSubsLines = pSSpecSubsLines; pSpecSubsLines = pSSpecSubsLines;
...@@ -2889,6 +2911,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const ...@@ -2889,6 +2911,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
pSubsLines = new SwSubsRects; pSubsLines = new SwSubsRects;
pSpecSubsLines = new SwSubsRects; pSpecSubsLines = new SwSubsRects;
} }
g_pBorderLines = new BorderLines;
aPaintRect._Intersection( aRect ); aPaintRect._Intersection( aRect );
...@@ -3002,6 +3025,9 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const ...@@ -3002,6 +3025,9 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
DELETEZ( pSubsLines ); DELETEZ( pSubsLines );
DELETEZ( pSpecSubsLines ); DELETEZ( pSpecSubsLines );
} }
// fdo#42750: delay painting these until after subsidiary lines
ProcessPrimitives(g_pBorderLines->GetBorderLines());
DELETEZ(g_pBorderLines);
pVout->Leave(); pVout->Leave();
// #i68597# // #i68597#
...@@ -4507,11 +4533,8 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft, ...@@ -4507,11 +4533,8 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
::lcl_SubTopBottom( aRect, rBox, _rAttrs, _rFrm, _rRectFn, bPrtOutputDev ); ::lcl_SubTopBottom( aRect, rBox, _rAttrs, _rFrm, _rRectFn, bPrtOutputDev );
} }
// TODO Postpone the processing of the primitives
if ( lcl_GetLineWidth( pLeftRightBorder ) > 0 ) if ( lcl_GetLineWidth( pLeftRightBorder ) > 0 )
{ {
drawinglayer::primitive2d::Primitive2DSequence aSequence( 1 );
double nExtentIS = lcl_GetExtent( pTopBorder, NULL ); double nExtentIS = lcl_GetExtent( pTopBorder, NULL );
double nExtentIE = lcl_GetExtent( pBottomBorder, NULL ); double nExtentIE = lcl_GetExtent( pBottomBorder, NULL );
double nExtentOS = lcl_GetExtent( NULL, pTopBorder ); double nExtentOS = lcl_GetExtent( NULL, pTopBorder );
...@@ -4533,21 +4556,22 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft, ...@@ -4533,21 +4556,22 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
Color aLeftColor = _bLeft ? pLeftRightBorder->GetColorOut( _bLeft ) : pLeftRightBorder->GetColorIn( _bLeft ); Color aLeftColor = _bLeft ? pLeftRightBorder->GetColorOut( _bLeft ) : pLeftRightBorder->GetColorIn( _bLeft );
Color aRightColor = _bLeft ? pLeftRightBorder->GetColorIn( _bLeft ) : pLeftRightBorder->GetColorOut( _bLeft ); Color aRightColor = _bLeft ? pLeftRightBorder->GetColorIn( _bLeft ) : pLeftRightBorder->GetColorOut( _bLeft );
aSequence[0] = new drawinglayer::primitive2d::BorderLinePrimitive2D( drawinglayer::primitive2d::Primitive2DReference xLine =
new drawinglayer::primitive2d::BorderLinePrimitive2D(
aStart, aEnd, nLeftWidth, pLeftRightBorder->GetDistance(), nRightWidth, aStart, aEnd, nLeftWidth, pLeftRightBorder->GetDistance(), nRightWidth,
nExtentIS, nExtentIE, nExtentOS, nExtentOE, nExtentIS, nExtentIE, nExtentOS, nExtentOE,
aLeftColor.getBColor(), aRightColor.getBColor(), aLeftColor.getBColor(), aRightColor.getBColor(),
pLeftRightBorder->GetColorGap().getBColor(), pLeftRightBorder->GetColorGap().getBColor(),
pLeftRightBorder->HasGapColor(), pLeftRightBorder->GetStyle( ) ); pLeftRightBorder->HasGapColor(), pLeftRightBorder->GetStyle( ) );
_rFrm.ProcessPrimitives( aSequence ); g_pBorderLines->AddBorderLine(xLine);
} }
} }
// OD 19.05.2003 #109667# - merge <lcl_PaintTopLine> and <lcl_PaintBottomLine> // OD 19.05.2003 #109667# - merge <lcl_PaintTopLine> and <lcl_PaintBottomLine>
// into <lcl_PaintTopLine> // into <lcl_PaintTopLine>
void lcl_PaintTopBottomLine( const sal_Bool _bTop, void lcl_PaintTopBottomLine( const sal_Bool _bTop,
const SwFrm& _rFrm, const SwFrm& ,
const SwPageFrm& /*_rPage*/, const SwPageFrm& /*_rPage*/,
const SwRect& _rOutRect, const SwRect& _rOutRect,
const SwRect& /*_rRect*/, const SwRect& /*_rRect*/,
...@@ -4584,11 +4608,8 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop, ...@@ -4584,11 +4608,8 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
(aRect.*_rRectFn->fnGetHeight)() ); (aRect.*_rRectFn->fnGetHeight)() );
} }
// TODO Postpone the processing of the primitives
if ( lcl_GetLineWidth( pTopBottomBorder ) > 0 ) if ( lcl_GetLineWidth( pTopBottomBorder ) > 0 )
{ {
drawinglayer::primitive2d::Primitive2DSequence aSequence( 1 );
double nExtentIS = lcl_GetExtent( pRightBorder, NULL ); double nExtentIS = lcl_GetExtent( pRightBorder, NULL );
double nExtentIE = lcl_GetExtent( pLeftBorder, NULL ); double nExtentIE = lcl_GetExtent( pLeftBorder, NULL );
double nExtentOS = lcl_GetExtent( NULL, pRightBorder ); double nExtentOS = lcl_GetExtent( NULL, pRightBorder );
...@@ -4610,14 +4631,15 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop, ...@@ -4610,14 +4631,15 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
Color aLeftColor = _bTop ? pTopBottomBorder->GetColorOut( _bTop ) : pTopBottomBorder->GetColorIn( _bTop ); Color aLeftColor = _bTop ? pTopBottomBorder->GetColorOut( _bTop ) : pTopBottomBorder->GetColorIn( _bTop );
Color aRightColor = _bTop ? pTopBottomBorder->GetColorIn( _bTop ) : pTopBottomBorder->GetColorOut( _bTop ); Color aRightColor = _bTop ? pTopBottomBorder->GetColorIn( _bTop ) : pTopBottomBorder->GetColorOut( _bTop );
aSequence[0] = new drawinglayer::primitive2d::BorderLinePrimitive2D( drawinglayer::primitive2d::Primitive2DReference xLine =
new drawinglayer::primitive2d::BorderLinePrimitive2D(
aStart, aEnd, nLeftWidth, pTopBottomBorder->GetDistance(), nRightWidth, aStart, aEnd, nLeftWidth, pTopBottomBorder->GetDistance(), nRightWidth,
nExtentIS, nExtentIE, nExtentOS, nExtentOE, nExtentIS, nExtentIE, nExtentOS, nExtentOE,
aLeftColor.getBColor(), aRightColor.getBColor(), aLeftColor.getBColor(), aRightColor.getBColor(),
pTopBottomBorder->GetColorGap().getBColor(), pTopBottomBorder->GetColorGap().getBColor(),
pTopBottomBorder->HasGapColor(), pTopBottomBorder->GetStyle( ) ); pTopBottomBorder->HasGapColor(), pTopBottomBorder->GetStyle( ) );
_rFrm.ProcessPrimitives( aSequence ); g_pBorderLines->AddBorderLine(xLine);
} }
} }
......
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