summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-04-04 22:35:08 +0200
committerMichael Stahl <mstahl@redhat.com>2012-04-05 12:34:54 +0200
commit5913506b2193e93ca2767ab7365ab2e76ed7848f (patch)
tree26f3226bbca2b44106731ab14c25990f32b1c06a /sw
parent6e8cbfc63a30c3924d61e22d9cdf43ede78ee288 (diff)
fdo#45562: paint borders in SwFlyFrm::Paint:
Painting borders of Flys in the heaven layer cannot be done correctly in SwRootFrm::Paint, because delaying until then paints over other drawing objects that are on top of the frame, so do it in SwFlyFrm::Paint, like the old border painting code used to. (regression from 804d0a896731629397c5328c13c04a45bc55f459)
Diffstat (limited to 'sw')
-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();