summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-04-04 22:35:08 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-04-24 13:38:53 +0200
commit32b854ee4a63da1be42294c5afe6c62e54ae72d3 (patch)
tree301fbe8b6017dd38b24c39b28e7ed0996b96dca1
parent1a34e28c9f80542bb8c0b120421f7a02832ad038 (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) (cherry picked from commit 5913506b2193e93ca2767ab7365ab2e76ed7848f) Signed-off-by: Caolán McNamara <caolanm@redhat.com> Signed-off by: Miklos Vajna <vmiklos@suse.cz> Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat@free.fr>
-rwxr-xr-xsw/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 435571a01db2..1fd70135b2e7 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3031,8 +3031,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();
@@ -3751,12 +3749,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
{
//wegen der Ueberlappung von Rahmen und Zeichenobjekten muessen die
//Flys ihre Umrandung (und die der Innenliegenden) direkt ausgeben.
//z.B. #33066#
pLines->LockLines(sal_True);
+ BorderLinesGuard blg; // this should not paint borders added from PaintBaBo
SwRect aRect( rRect );
aRect._Intersection( Frm() );
@@ -3966,6 +3980,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();