diff options
author | Armin Le Grand <alg@apache.org> | 2012-10-23 12:46:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-12 14:31:10 +0100 |
commit | e717d1dcce7f8906311c5ccdbb2326b61a702630 (patch) | |
tree | 91290db5179fa4b4927af94c0f023f40dcda434c /svx/source/sdr | |
parent | 9e50e5f82927742c56e89258b80bc8cd93bb7e3b (diff) |
Resolves: #i121237# Rework/Cleanup of Region code...
due to missing complete support for B2DPolygon class
(cherry picked from commit cab10eeb7878edf224a004fd7640bd4adf8d3c51)
Conflicts:
cppcanvas/source/mtfrenderer/implrenderer.cxx
svx/source/sdr/overlay/overlaymanagerbuffered.cxx
svx/source/svdraw/svdpntv.cxx
vcl/aqua/source/gdi/salgdi.cxx
vcl/inc/region.h
vcl/inc/unx/gtk/gtkgdi.hxx
vcl/inc/vcl/regband.hxx
vcl/inc/vcl/region.hxx
vcl/os2/source/gdi/salgdi.cxx
vcl/source/gdi/bmpacc3.cxx
vcl/source/gdi/outdev2.cxx
vcl/source/gdi/outmap.cxx
vcl/source/gdi/regband.cxx
vcl/source/gdi/region.cxx
vcl/source/window/window.cxx
vcl/unx/generic/gdi/pspgraphics.cxx
vcl/unx/headless/svpgdi.cxx
vcl/unx/headless/svppspgraphics.cxx
vcl/win/source/gdi/salgdi.cxx
Change-Id: Iee9a66ff431c3cecb7603e445147b67715de0f7d
Remove unused variable to prevent compiler warning
(cherry picked from commit 0ac65ccf079e3e22ac23cbe7ae546504c863c31f)
Change-Id: Icbcaa9d576a7e560d96debc7360bdbe9090b3fd3
Wrong comparison with bool corrected
(cherry picked from commit 612cefdcf6176b6bb847ce899d89af40ef313a90)
Change-Id: I1cf5de6734b588f78d8e870ba7b7860634b461ce
Diffstat (limited to 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/overlay/overlaymanagerbuffered.cxx | 80 | ||||
-rw-r--r-- | svx/source/sdr/properties/itemsettools.cxx | 6 |
2 files changed, 62 insertions, 24 deletions
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index 81b53b27bb0e..47d76f835d00 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -109,33 +109,33 @@ namespace sdr void OverlayManagerBuffered::ImpRestoreBackground(const Region& rRegionPixel) const { - // local region - Region aRegionPixel(rRegionPixel); - RegionHandle aRegionHandle(aRegionPixel.BeginEnumRects()); - Rectangle aRegionRectanglePixel; - // MapModes off const bool bMapModeWasEnabledDest(getOutputDevice().IsMapModeEnabled()); const bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled()); getOutputDevice().EnableMapMode(false); ((OverlayManagerBuffered*)this)->maBufferDevice.EnableMapMode(false); - while(aRegionPixel.GetEnumRects(aRegionHandle, aRegionRectanglePixel)) + // local region + RectangleVector aRectangles; + rRegionPixel.GetRegionRectangles(aRectangles); + + for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) { #ifdef DBG_UTIL // #i72754# possible graphical region test only with non-pro static bool bDoPaintForVisualControl(false); + if(bDoPaintForVisualControl) { getOutputDevice().SetLineColor(COL_LIGHTGREEN); getOutputDevice().SetFillColor(); - getOutputDevice().DrawRect(aRegionRectanglePixel); + getOutputDevice().DrawRect(*aRectIter); } #endif // restore the area - const Point aTopLeft(aRegionRectanglePixel.TopLeft()); - const Size aSize(aRegionRectanglePixel.GetSize()); + const Point aTopLeft(aRectIter->TopLeft()); + const Size aSize(aRectIter->GetSize()); getOutputDevice().DrawOutDev( aTopLeft, aSize, // destination @@ -143,7 +143,33 @@ namespace sdr maBufferDevice); } - aRegionPixel.EndEnumRects(aRegionHandle); + //Region aRegionPixel(rRegionPixel); + //RegionHandle aRegionHandle(aRegionPixel.BeginEnumRects()); + //Rectangle aRegionRectanglePixel; + // + //while(aRegionPixel.GetEnumRects(aRegionHandle, aRegionRectanglePixel)) + //{ +#ifdef DBG_U//TIL + // // #i72754# possible graphical region test only with non-pro + // static bool bDoPaintForVisualControl(false); + // if(bDoPaintForVisualControl) + // { + // getOutputDevice().SetLineColor(COL_LIGHTGREEN); + // getOutputDevice().SetFillColor(); + // getOutputDevice().DrawRect(aRegionRectanglePixel); + // } +#endif // + // // restore the area + // const Point aTopLeft(aRegionRectanglePixel.TopLeft()); + // const Size aSize(aRegionRectanglePixel.GetSize()); + // + // getOutputDevice().DrawOutDev( + // aTopLeft, aSize, // destination + // aTopLeft, aSize, // source + // maBufferDevice); + //} + // + //aRegionPixel.EndEnumRects(aRegionHandle); // restore MapModes getOutputDevice().EnableMapMode(bMapModeWasEnabledDest); @@ -175,24 +201,24 @@ namespace sdr } // also limit to buffer size - const Rectangle aBufferDeviceRectanglePixel = Rectangle(Point(), maBufferDevice.GetOutputSizePixel()); + const Rectangle aBufferDeviceRectanglePixel(Point(), maBufferDevice.GetOutputSizePixel()); aRegion.Intersect(aBufferDeviceRectanglePixel); - // prepare to iterate over the rectangles from the region in pixels - RegionHandle aRegionHandle(aRegion.BeginEnumRects()); - Rectangle aRegionRectanglePixel; - // MapModes off const bool bMapModeWasEnabledDest(rSource.IsMapModeEnabled()); const bool bMapModeWasEnabledSource(maBufferDevice.IsMapModeEnabled()); rSource.EnableMapMode(false); maBufferDevice.EnableMapMode(false); - while(aRegion.GetEnumRects(aRegionHandle, aRegionRectanglePixel)) + // prepare to iterate over the rectangles from the region in pixels + RectangleVector aRectangles; + aRegion.GetRegionRectangles(aRectangles); + + for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) { // for each rectangle, save the area - Point aTopLeft(aRegionRectanglePixel.TopLeft()); - Size aSize(aRegionRectanglePixel.GetSize()); + const Point aTopLeft(aRectIter->TopLeft()); + const Size aSize(aRectIter->GetSize()); maBufferDevice.DrawOutDev( aTopLeft, aSize, // destination @@ -200,7 +226,23 @@ namespace sdr rSource); } - aRegion.EndEnumRects(aRegionHandle); + //RegionHandle aRegionHandle(aRegion.BeginEnumRects()); + //Rectangle aRegionRectanglePixel; + // + //while(aRegion.GetEnumRects(aRegionHandle, aRegionRectanglePixel)) + //{ + // // for each rectangle, save the area + // Point aTopLeft(aRegionRectanglePixel.TopLeft()); + // Size aSize(aRegionRectanglePixel.GetSize()); + // + // maBufferDevice.DrawOutDev( + // aTopLeft, aSize, // destination + // aTopLeft, aSize, // source + // rSource); + // + //} + // + //aRegion.EndEnumRects(aRegionHandle); // restore MapModes rSource.EnableMapMode(bMapModeWasEnabledDest); diff --git a/svx/source/sdr/properties/itemsettools.cxx b/svx/source/sdr/properties/itemsettools.cxx index b5f763ab6245..cea89d0e6248 100644 --- a/svx/source/sdr/properties/itemsettools.cxx +++ b/svx/source/sdr/properties/itemsettools.cxx @@ -21,10 +21,9 @@ #include <tools/debug.hxx> #include <svl/itemset.hxx> #include <svl/whiter.hxx> - -#include <vector> #include <svx/svdogrp.hxx> #include <svx/svditer.hxx> +#include <vcl/region.hxx> ////////////////////////////////////////////////////////////////////////////// // class to remember broadcast start positions @@ -33,9 +32,6 @@ namespace sdr { namespace properties { - // helper vector to remember rectangles - typedef ::std::vector< Rectangle > RectangleVector; - ItemChangeBroadcaster::ItemChangeBroadcaster(const SdrObject& rObj) { if(rObj.ISA(SdrObjGroup)) |