diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-05-06 11:33:41 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2019-05-08 12:42:53 +0200 |
commit | d0119ff7f2c68aa05286bd303128f3a69c6bbd6a (patch) | |
tree | 80fc2e52ceb8446997348eda9186cbdfcd247298 /sc/source | |
parent | 5218ca22b472a80969a715e38d7cb8d052be4b6a (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 'sc/source')
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 985267b8929d..5e515c80abd9 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -43,6 +43,7 @@ #include <editeng/scriptspaceitem.hxx> #include <sfx2/objsh.hxx> #include <svl/itempool.hxx> +#include <vcl/canvastools.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <tools/globname.hxx> @@ -761,7 +762,7 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData& aChange.translate(aCurrentCellRect.getX(), aCurrentCellRect.getY()); // create B2DRange and transform by prepared scale - basegfx::B2DRange aNewRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom()); + basegfx::B2DRange aNewRange = vcl::unotools::b2DRectangleFromRectangle(aRect); aNewRange.transform(aChange); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index a35b654f3d73..926a3e2b710e 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -40,6 +40,7 @@ #include <svl/stritem.hxx> #include <svl/urlbmk.hxx> #include <svl/sharedstringpool.hxx> +#include <vcl/canvastools.hxx> #include <vcl/cursor.hxx> #include <vcl/graph.hxx> #include <vcl/hatch.hxx> @@ -5845,7 +5846,7 @@ void ScGridWindow::UpdateCopySourceOverlay() Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor(); tools::Rectangle aLogic = PixelToLogic(aRect, aDrawMode); - ::basegfx::B2DRange aRange(aLogic.Left(), aLogic.Top(), aLogic.Right(), aLogic.Bottom()); + ::basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(aLogic); std::unique_ptr<ScOverlayDashedBorder> pDashedBorder(new ScOverlayDashedBorder(aRange, aHighlight)); xOverlayManager->add(*pDashedBorder); mpOOSelectionBorder->append(std::move(pDashedBorder)); @@ -6224,7 +6225,7 @@ void ScGridWindow::UpdateAutoFillOverlay() aHandleColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor; std::vector< basegfx::B2DRange > aRanges; const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation()); - basegfx::B2DRange aRB(aFillRect.Left(), aFillRect.Top(), aFillRect.Right(), aFillRect.Bottom()); + basegfx::B2DRange aRB = vcl::unotools::b2DRectangleFromRectangle(aFillRect); aRB.transform(aTransform); aRanges.push_back(aRB); |