summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/layout/paintfrm.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index bac034e7a69d..80ec5a1e310c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3025,8 +3025,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
if ( bExtraData )
pPage->RefreshExtraData( aPaintRect );
- // have to paint frame borders added in heaven layer here...
- ProcessPrimitives(g_pBorderLines->GetBorderLines_Clear());
DELETEZ(g_pBorderLines);
pVout->Leave();
@@ -3741,12 +3739,28 @@ void SwCellFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
void MA_FASTCALL lcl_PaintLowerBorders( const SwLayoutFrm *pLay,
const SwRect &rRect, const SwPageFrm *pPage );
+struct BorderLinesGuard
+{
+ explicit BorderLinesGuard() : m_pBorderLines(g_pBorderLines)
+ {
+ g_pBorderLines = new BorderLines;
+ }
+ ~BorderLinesGuard()
+ {
+ delete g_pBorderLines;
+ g_pBorderLines = m_pBorderLines;
+ }
+private:
+ BorderLines *const m_pBorderLines;
+};
+
void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
//because of the overlapping of frames and drawing objects the flys have to
//paint their borders (and those of the internal ones) directly.
//e.g. #33066#
pLines->LockLines(sal_True);
+ BorderLinesGuard blg; // this should not paint borders added from PaintBaBo
SwRect aRect( rRect );
aRect._Intersection( Frm() );
@@ -3957,6 +3971,8 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
// and then unlock other lines.
pLines->PaintLines( pOut );
pLines->LockLines( sal_False );
+ // have to paint frame borders added in heaven layer here...
+ ProcessPrimitives(g_pBorderLines->GetBorderLines_Clear());
pOut->Pop();