diff options
Diffstat (limited to 'svx/source/sdr/contact')
14 files changed, 31 insertions, 54 deletions
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index 92b0153f072d..3bda11b111f6 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -37,6 +37,7 @@ #include <drawinglayer/processor2d/processor2dtools.hxx> #include <svx/unoapi.hxx> #include <unotools/configmgr.hxx> +#include <vcl/canvastools.hxx> #include <comphelper/lok.hxx> #include <eventhandler.hxx> @@ -179,9 +180,7 @@ namespace sdr // export, so why not do it always const tools::Rectangle aLogicClipRectangle(rDisplayInfo.GetRedrawArea().GetBoundRect()); - aViewRange = basegfx::B2DRange( - aLogicClipRectangle.Left(), aLogicClipRectangle.Top(), - aLogicClipRectangle.Right(), aLogicClipRectangle.Bottom()); + aViewRange = vcl::unotools::b2DRectangleFromRectangle(aLogicClipRectangle); } } else @@ -193,9 +192,7 @@ namespace sdr { // get logic clip range and create discrete one const tools::Rectangle aLogicClipRectangle(rDisplayInfo.GetRedrawArea().GetBoundRect()); - basegfx::B2DRange aLogicClipRange( - aLogicClipRectangle.Left(), aLogicClipRectangle.Top(), - aLogicClipRectangle.Right(), aLogicClipRectangle.Bottom()); + basegfx::B2DRange aLogicClipRange = vcl::unotools::b2DRectangleFromRectangle(aLogicClipRectangle); basegfx::B2DRange aDiscreteClipRange(aLogicClipRange); aDiscreteClipRange.transform(rTargetOutDev.GetViewTransformation()); diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 2892b3e63eff..80b575585db9 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -29,6 +29,7 @@ #include <svx/sdr/contact/objectcontact.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <sdr/primitive2d/sdrgrafprimitive2d.hxx> +#include <vcl/canvastools.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> @@ -310,10 +311,7 @@ namespace sdr // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect() // which will use the primitive data we just create in the near future - const tools::Rectangle aRectangle(GetGrafObject().GetGeoRect()); - const ::basegfx::B2DRange aObjectRange( - aRectangle.Left(), aRectangle.Top(), - aRectangle.Right(), aRectangle.Bottom()); + const ::basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(GetGrafObject().GetGeoRect()); // look for mirroring const GeoStat& rGeoStat(GetGrafObject().GetGeoStat()); diff --git a/svx/source/sdr/contact/viewcontactofgroup.cxx b/svx/source/sdr/contact/viewcontactofgroup.cxx index 3aa1b9302b08..46561001adf7 100644 --- a/svx/source/sdr/contact/viewcontactofgroup.cxx +++ b/svx/source/sdr/contact/viewcontactofgroup.cxx @@ -28,6 +28,7 @@ #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx> #include <tools/debug.hxx> +#include <vcl/canvastools.hxx> namespace sdr @@ -72,10 +73,7 @@ namespace sdr else { // append an invisible outline for the cases where no visible content exists - const tools::Rectangle aCurrentBoundRect(GetSdrObjGroup().GetLastBoundRect()); - const basegfx::B2DRange aCurrentRange( - aCurrentBoundRect.Left(), aCurrentBoundRect.Top(), - aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom()); + const basegfx::B2DRange aCurrentRange = vcl::unotools::b2DRectangleFromRectangle(GetSdrObjGroup().GetLastBoundRect()); const drawinglayer::primitive2d::Primitive2DReference xReference( drawinglayer::primitive2d::createHiddenGeometryPrimitives2D( diff --git a/svx/source/sdr/contact/viewcontactofpageobj.cxx b/svx/source/sdr/contact/viewcontactofpageobj.cxx index a79c8e70c073..3032bfdb95a1 100644 --- a/svx/source/sdr/contact/viewcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewcontactofpageobj.cxx @@ -20,6 +20,7 @@ #include <svx/sdr/contact/viewcontactofpageobj.hxx> #include <svx/svdopage.hxx> #include <svx/sdr/contact/displayinfo.hxx> +#include <vcl/canvastools.hxx> #include <vcl/outdev.hxx> #include <svx/svdmodel.hxx> #include <svx/svdpage.hxx> @@ -70,7 +71,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfPageObj::createView // create a replacement graphic visualisation here. Use GetLastBoundRect to access the model data directly // which is aOutRect for SdrPageObj. const tools::Rectangle aModelRectangle(GetPageObj().GetLastBoundRect()); - const basegfx::B2DRange aModelRange(aModelRectangle.Left(), aModelRectangle.Top(), aModelRectangle.Right(), aModelRectangle.Bottom()); + const basegfx::B2DRange aModelRange = vcl::unotools::b2DRectangleFromRectangle(aModelRectangle); const basegfx::B2DPolygon aOutline(basegfx::utils::createPolygonFromRect(aModelRange)); const basegfx::BColor aYellow(1.0, 1.0, 0.0); const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow)); diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx index 8fe42c1fa6de..83aab2dfc687 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -35,6 +35,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <svx/sdr/primitive2d/sdrdecompositiontools.hxx> #include <basegfx/polygon/b2dpolygonclipper.hxx> +#include <vcl/canvastools.hxx> using namespace com::sun::star; @@ -64,9 +65,7 @@ namespace sdr // take unrotated snap rect (direct model data) for position and size const tools::Rectangle aRectangle(rCaptionObj.GetGeoRect()); - const ::basegfx::B2DRange aObjectRange( - aRectangle.Left(), aRectangle.Top(), - aRectangle.Right(), aRectangle.Bottom()); + const ::basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(aRectangle); const GeoStat& rGeoStat(rCaptionObj.GetGeoStat()); // fill object matrix diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx index 8d796643386d..6b1253d57ee0 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -25,6 +25,7 @@ #include <svl/itemset.hxx> #include <svx/sxciaitm.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <vcl/canvastools.hxx> namespace sdr @@ -50,10 +51,7 @@ namespace sdr false)); // take unrotated snap rect (direct model data) for position and size - const tools::Rectangle aRectangle(GetCircObj().GetGeoRect()); - const basegfx::B2DRange aObjectRange( - aRectangle.Left(), aRectangle.Top(), - aRectangle.Right(), aRectangle.Bottom() ); + const basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(GetCircObj().GetGeoRect()); const GeoStat& rGeoStat(GetCircObj().GetGeoStat()); // fill object matrix diff --git a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx index bda8a934109f..80373d8df122 100644 --- a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx @@ -23,6 +23,7 @@ #include <sdr/contact/viewobjectcontactofsdrmediaobj.hxx> #include <drawinglayer/primitive2d/mediaprimitive2d.hxx> #include <avmedia/mediawindow.hxx> +#include <vcl/canvastools.hxx> namespace sdr { namespace contact { @@ -101,9 +102,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrMediaObj::create // create range using the model data directly. This is in SdrTextObj::aRect which i will access using // GetGeoRect() to not trigger any calculations. It's the unrotated geometry which is okay for MediaObjects ATM. const tools::Rectangle aRectangle(GetSdrMediaObj().GetGeoRect()); - const basegfx::B2DRange aRange( - aRectangle.Left(), aRectangle.Top(), - aRectangle.Right(), aRectangle.Bottom()); + const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(aRectangle); // create object transform basegfx::B2DHomMatrix aTransform; diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 5c4bb784c515..c4af096a0d13 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -28,6 +28,7 @@ #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svx/obj3d.hxx> #include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx> +#include <vcl/canvastools.hxx> namespace sdr @@ -48,10 +49,8 @@ namespace sdr const tools::Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect()); tools::Rectangle aTextBound(aObjectBound); GetCustomShapeObj().GetTextBounds(aTextBound); - basegfx::B2DRange aTextRange(aTextBound.Left(), aTextBound.Top(), aTextBound.Right(), aTextBound.Bottom()); - const basegfx::B2DRange aObjectRange( - aObjectBound.Left(), aObjectBound.Top(), - aObjectBound.Right(), aObjectBound.Bottom()); + basegfx::B2DRange aTextRange = vcl::unotools::b2DRectangleFromRectangle(aTextBound); + const basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(aObjectBound); // no need to correct if no extra text range if(aTextRange != aObjectRange) @@ -151,9 +150,7 @@ namespace sdr // take unrotated snap rect as default, then get the // unrotated text box. Rotation needs to be done centered const tools::Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect()); - const basegfx::B2DRange aObjectRange( - aObjectBound.Left(), aObjectBound.Top(), - aObjectBound.Right(), aObjectBound.Bottom()); + const basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(aObjectBound); // #i101684# get the text range unrotated and absolute to the object range const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect()); diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index 6a13aaef8682..fdd64bee1243 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -28,6 +28,7 @@ #include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> #include <svtools/colorcfg.hxx> #include <svx/sdr/primitive2d/sdrattributecreator.hxx> +#include <vcl/canvastools.hxx> #include <vcl/svapp.hxx> #include <sdr/primitive2d/sdrolecontentprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> @@ -61,9 +62,7 @@ basegfx::B2DHomMatrix ViewContactOfSdrOle2Obj::createObjectTransform() const { // take unrotated snap rect (direct model data) for position and size const tools::Rectangle aRectangle(GetOle2Obj().GetGeoRect()); - const basegfx::B2DRange aObjectRange( - aRectangle.Left(), aRectangle.Top(), - aRectangle.Right(), aRectangle.Bottom()); + const basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(aRectangle); // create object matrix const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat()); diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index 28942f7b04de..082abb6a0e27 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -27,6 +27,7 @@ #include <sdr/primitive2d/sdrpathprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <vcl/canvastools.hxx> namespace sdr { @@ -177,9 +178,7 @@ namespace sdr aUnitDefinitionPolyPolygon.append( basegfx::utils::createPolygonFromRect( - basegfx::B2DRange( - rSnapRect.Left(), rSnapRect.Top(), - rSnapRect.Right(), rSnapRect.Bottom()))); + vcl::unotools::b2DRectangleFromRectangle(rSnapRect))); // use same coordinate system as the shape geometry -> this // makes it relative to shape's unit geometry and thus freely diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index 34734f96e1cd..3e51de1ed3c7 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -25,6 +25,7 @@ #include <sdr/primitive2d/sdrprimitivetools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svx/svdmodel.hxx> +#include <vcl/canvastools.hxx> namespace sdr { namespace contact { @@ -48,9 +49,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrRectObj::createV // take unrotated snap rect (direct model data) for position and size const tools::Rectangle aRectangle(GetRectObj().GetGeoRect()); - const ::basegfx::B2DRange aObjectRange( - aRectangle.Left(), aRectangle.Top(), - aRectangle.Right(), aRectangle.Bottom() ); + const ::basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(aRectangle); const GeoStat& rGeoStat(GetRectObj().GetGeoStat()); diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx index 78bdce4d6c2e..2c34c56a7c07 100644 --- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx @@ -30,6 +30,7 @@ #include <svx/sdrpaintwindow.hxx> #include <tools/diagnose_ex.h> +#include <vcl/canvastools.hxx> #include <vcl/pdfextoutdevdata.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <drawinglayer/primitive2d/controlprimitive2d.hxx> @@ -94,10 +95,7 @@ namespace sdr { namespace contact { // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj) // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything - const tools::Rectangle aRectangle(GetSdrUnoObj().GetGeoRect()); - const basegfx::B2DRange aRange( - aRectangle.Left(), aRectangle.Top(), - aRectangle.Right(), aRectangle.Bottom()); + const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(GetSdrUnoObj().GetGeoRect()); // create object transform basegfx::B2DHomMatrix aTransform; diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index 9acef8175f33..ef2247a746e0 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -32,6 +32,7 @@ #include <svx/unoapi.hxx> #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx> #include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx> +#include <vcl/canvastools.hxx> using namespace com::sun::star; @@ -192,9 +193,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfPageObj::crea basegfx::B2DHomMatrix aPageObjectTransform; { const tools::Rectangle aPageObjectModelData(rPageObject.GetLastBoundRect()); - const basegfx::B2DRange aPageObjectBound( - aPageObjectModelData.Left(), aPageObjectModelData.Top(), - aPageObjectModelData.Right(), aPageObjectModelData.Bottom()); + const basegfx::B2DRange aPageObjectBound = vcl::unotools::b2DRectangleFromRectangle(aPageObjectModelData); aPageObjectTransform.set(0, 0, aPageObjectBound.getWidth()); aPageObjectTransform.set(1, 1, aPageObjectBound.getHeight()); diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index d188ce4d2243..bd22d412cffc 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -45,6 +45,7 @@ #include <com/sun/star/container/XContainerListener.hpp> #include <com/sun/star/container/XContainer.hpp> +#include <vcl/canvastools.hxx> #include <vcl/svapp.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/scopeguard.hxx> @@ -1482,12 +1483,7 @@ namespace sdr { namespace contact { // use getBoundRect()/getSnapRect() here; these will use the sequence of // primitives themselves in the long run. const tools::Rectangle aSdrGeoData( _rVOC.GetSdrUnoObj().GetGeoRect() ); - const basegfx::B2DRange aRange( - aSdrGeoData.Left(), - aSdrGeoData.Top(), - aSdrGeoData.Right(), - aSdrGeoData.Bottom() - ); + const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(aSdrGeoData); _out_Transformation.identity(); _out_Transformation.set( 0, 0, aRange.getWidth() ); |