[Libreoffice-commits] .: Branch 'libreoffice-3-5-3' - 2 commits - sw/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Tue Apr 24 04:40:28 PDT 2012
sw/source/core/layout/paintfrm.cxx | 43 ++++++++++++++++++++++++++++---------
1 file changed, 33 insertions(+), 10 deletions(-)
New commits:
commit 32b854ee4a63da1be42294c5afe6c62e54ae72d3
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Apr 4 22:35:08 2012 +0200
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 at redhat.com>
Signed-off by: Miklos Vajna <vmiklos at suse.cz>
Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 435571a..1fd7013 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();
commit 1a34e28c9f80542bb8c0b120421f7a02832ad038
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Mar 23 14:08:31 2012 +0100
fdo#42750 fdo#45562 fdo#47717: border paint ordering:
Paint borders after subsidiary lines and hell layer, but before heaven
layer.
(cherry picked from commit 1024c172a5bfb3d85a86fcf7a046aa2b03950edd)
Signed-off-by: Caolán McNamara <caolanm at redhat.com>
Signed-off-by: Miklos Vajna <vmiklos at suse.cz>
Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 69e32ff..435571a 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -231,9 +231,12 @@ public:
{
m_Lines.push_back(xLine);
}
- drawinglayer::primitive2d::Primitive2DSequence GetBorderLines() const
+ drawinglayer::primitive2d::Primitive2DSequence GetBorderLines_Clear()
{
- return m_Lines.getAsConstList();
+ ::comphelper::SequenceAsVector<
+ ::drawinglayer::primitive2d::Primitive2DReference> lines;
+ ::std::swap(m_Lines, lines);
+ return lines.getAsConstList();
}
};
@@ -3002,6 +3005,16 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
}
pLines->PaintLines( pSh->GetOut() );
+ if ( pSh->GetWin() )
+ {
+ pSubsLines->PaintSubsidiary( pSh->GetOut(), pLines );
+ DELETEZ( pSubsLines );
+ DELETEZ( pSpecSubsLines );
+ }
+ // fdo#42750: delay painting these until after subsidiary lines
+ // fdo#45562: delay painting these until after hell layer
+ // fdo#47717: but do it before heaven layer
+ ProcessPrimitives(g_pBorderLines->GetBorderLines_Clear());
if ( pSh->Imp()->HasDrawView() )
{
@@ -3018,14 +3031,8 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
if ( bExtraData )
pPage->RefreshExtraData( aPaintRect );
- if ( pSh->GetWin() )
- {
- pSubsLines->PaintSubsidiary( pSh->GetOut(), pLines );
- DELETEZ( pSubsLines );
- DELETEZ( pSpecSubsLines );
- }
- // fdo#42750: delay painting these until after subsidiary lines
- ProcessPrimitives(g_pBorderLines->GetBorderLines());
+ // have to paint frame borders added in heaven layer here...
+ ProcessPrimitives(g_pBorderLines->GetBorderLines_Clear());
DELETEZ(g_pBorderLines);
pVout->Leave();
More information about the Libreoffice-commits
mailing list