fdo#38635: some assertions that the border start/end points match From: Michael Stahl This does not work in general, the assertions trigger when borders are merged, as can easily happen for table cells. --- sw/source/core/layout/paintfrm.cxx | 50 ++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 0600d2e..0e5d3aa 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -239,6 +239,10 @@ public: //----------------- End of classes for border lines ---------------------- +#ifdef DBG_UTIL +static BorderLinePrimitive2D * g_pDebugLines[4] = {0,0,0,0}; +#endif + static ViewShell *pGlobalShell = 0; //Only repaint the Fly content as well as the background of the Fly content if @@ -4621,6 +4625,49 @@ lcl_MakeBorderLine(SwRect const& rRect, rBorder.GetColorGap().getBColor(), rBorder.HasGapColor(), rBorder.GetStyle() ); g_pBorderLines->AddBorderLine(xLine); +#ifdef DBG_UTIL + size_t ix = isLeftOrTopBorderInModel ? isVerticalInModel ? 0 : 2 : isVerticalInModel ? 1 : 3; + g_pDebugLines[ix] = xLine.get(); + switch (ix) + { + case 1: + if (isVerticalInModel == isVertical) + { + assert(!g_pDebugLines[0] || g_pDebugLines[0]->getStart().getY() == g_pDebugLines[1]->getStart().getY()); + assert(!g_pDebugLines[0] || g_pDebugLines[0]->getEnd().getY() == g_pDebugLines[1]->getEnd().getY()); + } + else + { + assert(!g_pDebugLines[0] || g_pDebugLines[0]->getStart().getX() == g_pDebugLines[1]->getStart().getX()); + assert(!g_pDebugLines[0] || g_pDebugLines[0]->getEnd().getX() == g_pDebugLines[1]->getEnd().getX()); + } + break; + case 2: + if (isVerticalInModel == isVertical) + { + assert(!g_pDebugLines[0] || g_pDebugLines[0]->getStart() == g_pDebugLines[2]->getStart()); + assert(!g_pDebugLines[1] || g_pDebugLines[1]->getStart() == g_pDebugLines[2]->getEnd()); + } + else + { + assert(!g_pDebugLines[0] || g_pDebugLines[0]->getEnd() == g_pDebugLines[2]->getStart()); + assert(!g_pDebugLines[1] || g_pDebugLines[1]->getEnd() == g_pDebugLines[2]->getEnd()); + } + break; + case 3: + if (isVerticalInModel == isVertical) + { + assert(!g_pDebugLines[0] || g_pDebugLines[0]->getEnd() == g_pDebugLines[3]->getStart()); + assert(!g_pDebugLines[1] || g_pDebugLines[1]->getEnd() == g_pDebugLines[3]->getEnd()); + } + else + { + assert(!g_pDebugLines[0] || g_pDebugLines[0]->getStart() == g_pDebugLines[3]->getStart()); + assert(!g_pDebugLines[1] || g_pDebugLines[1]->getStart() == g_pDebugLines[3]->getEnd()); + } + break; + } +#endif } // OD 19.05.2003 #109667# - merge and @@ -5095,6 +5142,9 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage, ::lcl_PaintTopBottomLine(sal_False, *(this), *(pPage), aRect, rRect, rAttrs, fnRect); } } +#ifdef DBG_UTIL + g_pDebugLines[0] = g_pDebugLines[1] = g_pDebugLines[2] = g_pDebugLines[3] = 0; +#endif } rAttrs.SetGetCacheLine( sal_False ); }