summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svddrgmt.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2019-05-06 11:33:41 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-05-08 12:42:53 +0200
commitd0119ff7f2c68aa05286bd303128f3a69c6bbd6a (patch)
tree80fc2e52ceb8446997348eda9186cbdfcd247298 /svx/source/svdraw/svddrgmt.cxx
parent5218ca22b472a80969a715e38d7cb8d052be4b6a (diff)
improve tools::Rectangle->basegfx::B2?Rectangle conversion
Improve the conversion method to do something reasonable with empty Rectangle. Use the conversion method in more places. Change-Id: I48c13f3d6dae71f39f03f7939101e545c8125503 Reviewed-on: https://gerrit.libreoffice.org/71853 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'svx/source/svdraw/svddrgmt.cxx')
-rw-r--r--svx/source/svdraw/svddrgmt.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index d96bed18602e..834547fc24ce 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -22,6 +22,7 @@
#include <tools/bigint.hxx>
#include <o3tl/numeric.hxx>
+#include <vcl/canvastools.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/ptrstyle.hxx>
@@ -468,7 +469,7 @@ void SdrDragMethod::createSdrDragEntries_PolygonDrag()
if(bNoPolygons)
{
const tools::Rectangle aR(getSdrDragView().GetSdrPageView()->MarkSnap());
- const basegfx::B2DRange aNewRectangle(aR.Left(), aR.Top(), aR.Right(), aR.Bottom());
+ const basegfx::B2DRange aNewRectangle = vcl::unotools::b2DRectangleFromRectangle(aR);
basegfx::B2DPolygon aNewPolygon(basegfx::utils::createPolygonFromRect(aNewRectangle));
aResult = basegfx::B2DPolyPolygon(basegfx::utils::expandToCurve(aNewPolygon));
@@ -3466,7 +3467,7 @@ void SdrDragDistort::MovAllPoints(basegfx::B2DPolyPolygon& rTarget)
if(pPV && pPV->HasMarkedObjPageView())
{
basegfx::B2DPolyPolygon aDragPolygon(rTarget);
- const basegfx::B2DRange aOriginalRange(aMarkRect.Left(), aMarkRect.Top(), aMarkRect.Right(), aMarkRect.Bottom());
+ const basegfx::B2DRange aOriginalRange = vcl::unotools::b2DRectangleFromRectangle(aMarkRect);
const basegfx::B2DPoint aTopLeft(aDistortedRect[0].X(), aDistortedRect[0].Y());
const basegfx::B2DPoint aTopRight(aDistortedRect[1].X(), aDistortedRect[1].Y());
const basegfx::B2DPoint aBottomLeft(aDistortedRect[3].X(), aDistortedRect[3].Y());