summaryrefslogtreecommitdiff
path: root/cui
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 /cui
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 'cui')
-rw-r--r--cui/source/tabpages/transfrm.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 76d10ee63c5c..9adcea111d85 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -45,6 +45,7 @@
#include <svl/aeitem.hxx>
#include <swpossizetabpage.hxx>
#include <comphelper/lok.hxx>
+#include <vcl/canvastools.hxx>
// static ----------------------------------------------------------------
@@ -236,7 +237,7 @@ void SvxAngleTabPage::Construct()
{ // #i75273#
::tools::Rectangle aTempRect(pView->GetAllMarkedRect());
pView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ maRange = vcl::unotools::b2DRectangleFromRectangle(aTempRect);
}
// Take anchor into account (Writer)
@@ -857,13 +858,13 @@ void SvxPositionSizeTabPage::Construct()
{ // #i75273#
::tools::Rectangle aTempRect(mpView->GetAllMarkedRect());
mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ maRange = vcl::unotools::b2DRectangleFromRectangle(aTempRect);
}
{ // #i75273#
::tools::Rectangle aTempRect(mpView->GetWorkArea());
mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maWorkRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ maWorkRange = vcl::unotools::b2DRectangleFromRectangle(aTempRect);
}
// take anchor into account (Writer)
@@ -958,7 +959,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
{ // #i75273#
::tools::Rectangle aTempRect(mpView->GetAllMarkedRect());
mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ maRange = vcl::unotools::b2DRectangleFromRectangle(aTempRect);
}
// #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions
@@ -1180,7 +1181,7 @@ void SvxPositionSizeTabPage::ActivatePage( const SfxItemSet& rSet )
{
{ // #i75273#
const ::tools::Rectangle aTempRect(pRectItem->GetValue());
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ maRange = vcl::unotools::b2DRectangleFromRectangle(aTempRect);
}
SetMinMaxPosition();