From a023fd1367931a15e650d3c9ecba9623636ed666 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 3 Sep 2012 16:52:47 +0200 Subject: n#777699: Clip the objects to the pagewe are painting Change-Id: I78ac7de5346a2adea9a2c6cf3cbb0321e05d79dc --- svx/inc/svx/svdpagv.hxx | 3 ++- svx/source/svdraw/svdpagv.cxx | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'svx') diff --git a/svx/inc/svx/svdpagv.hxx b/svx/inc/svx/svdpagv.hxx index 90bd6951e875..039bd6c6c4f1 100644 --- a/svx/inc/svx/svdpagv.hxx +++ b/svx/inc/svx/svdpagv.hxx @@ -182,7 +182,8 @@ public: // write access to mpPreparedPageWindow void setPreparedPageWindow(SdrPageWindow* pKnownTarget); - void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget = 0, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const; + void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget = 0, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L, + const Rectangle& rRect = Rectangle()) const; void DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, Color aColor = Color( COL_BLACK ) ); Rectangle GetPageRect() const; diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index 5efebdfc304c..9a3aaf16f7f5 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -346,7 +346,7 @@ void SdrPageView::setPreparedPageWindow(SdrPageWindow* pKnownTarget) mpPreparedPageWindow = pKnownTarget; } -void SdrPageView::DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::contact::ViewObjectContactRedirector* pRedirector) const +void SdrPageView::DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::contact::ViewObjectContactRedirector* pRedirector, const Rectangle& rRect) const { if(GetPage()) { @@ -374,7 +374,10 @@ void SdrPageView::DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::con // Copy existing paint region to use the same as prepared in BeginDrawLayer SdrPaintWindow& rExistingPaintWindow = pPreparedTarget->GetPaintWindow(); const Region& rExistingRegion = rExistingPaintWindow.GetRedrawRegion(); - aTemporaryPaintWindow.SetRedrawRegion(rExistingRegion); + if ( rRect.IsEmpty() ) + aTemporaryPaintWindow.SetRedrawRegion(rExistingRegion); + else + aTemporaryPaintWindow.SetRedrawRegion(Region(rRect)); // patch the ExistingPageWindow pPreparedTarget->patchPaintWindow(aTemporaryPaintWindow); -- cgit