summaryrefslogtreecommitdiffstats
path: root/svx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-09-03 16:52:47 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-09-04 12:59:52 +0200
commit8af09bf33291df2fb2bfbbd6e42f9bf074fcc4fc (patch)
treeb3dc3e1739f7c006d7c9d21cf30acf76da95950c /svx
parentn#775270: clip pictures instead of scaling they don't fit (diff)
downloadcore-8af09bf33291df2fb2bfbbd6e42f9bf074fcc4fc.tar.gz
core-8af09bf33291df2fb2bfbbd6e42f9bf074fcc4fc.zip
n#777699: Clip the objects to the pagewe are painting
Change-Id: I78ac7de5346a2adea9a2c6cf3cbb0321e05d79dc
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/svdpagv.hxx3
-rw-r--r--svx/source/svdraw/svdpagv.cxx7
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);