diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-09-03 16:52:47 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-09-04 12:59:52 +0200 |
commit | 8af09bf33291df2fb2bfbbd6e42f9bf074fcc4fc (patch) | |
tree | b3dc3e1739f7c006d7c9d21cf30acf76da95950c /svx | |
parent | e598ab04476a32a08f18e8f0662fafa5f78f1a4a (diff) |
n#777699: Clip the objects to the pagewe are painting
Change-Id: I78ac7de5346a2adea9a2c6cf3cbb0321e05d79dc
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/svdpagv.hxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/svdpagv.cxx | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/svx/inc/svx/svdpagv.hxx b/svx/inc/svx/svdpagv.hxx index 38881e559fb9..5ab5848cf059 100644 --- a/svx/inc/svx/svdpagv.hxx +++ b/svx/inc/svx/svdpagv.hxx @@ -181,7 +181,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); |