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 /drawinglayer/source/tools | |
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 'drawinglayer/source/tools')
-rw-r--r-- | drawinglayer/source/tools/wmfemfhelper.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index 40ce19383f50..5669202d40cd 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -46,6 +46,7 @@ #include <sal/log.hxx> #include <tools/fract.hxx> #include <tools/stream.hxx> +#include <vcl/canvastools.hxx> #include <vcl/gradient.hxx> #include <vcl/hatch.hxx> #include <vcl/outdev.hxx> @@ -1016,9 +1017,7 @@ namespace wmfemfhelper // use wallpaper rect if set if(rWallpaper.IsRect() && !rWallpaper.GetRect().IsEmpty()) { - aWallpaperRange = basegfx::B2DRange( - rWallpaper.GetRect().Left(), rWallpaper.GetRect().Top(), - rWallpaper.GetRect().Right(), rWallpaper.GetRect().Bottom()); + aWallpaperRange = vcl::unotools::b2DRectangleFromRectangle(rWallpaper.GetRect()); } drawinglayer::primitive2d::BasePrimitive2D* pBitmapWallpaperFill = @@ -1611,7 +1610,7 @@ namespace wmfemfhelper if(!rRectangle.IsEmpty()) { - const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(rRectangle); if(!aRange.isEmpty()) { @@ -1638,7 +1637,7 @@ namespace wmfemfhelper if(!rRectangle.IsEmpty()) { - const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(rRectangle); if(!aRange.isEmpty()) { @@ -1677,7 +1676,7 @@ namespace wmfemfhelper if(!rRectangle.IsEmpty()) { - const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(rRectangle); if(!aRange.isEmpty()) { @@ -2118,7 +2117,7 @@ namespace wmfemfhelper if(!rRectangle.IsEmpty()) { - basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom()); + basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(rRectangle); if(!aRange.isEmpty()) { @@ -2210,9 +2209,7 @@ namespace wmfemfhelper { const Wallpaper& rWallpaper = pA->GetWallpaper(); const WallpaperStyle eWallpaperStyle(rWallpaper.GetStyle()); - basegfx::B2DRange aWallpaperRange( - aWallpaperRectangle.Left(), aWallpaperRectangle.Top(), - aWallpaperRectangle.Right(), aWallpaperRectangle.Bottom()); + basegfx::B2DRange aWallpaperRange = vcl::unotools::b2DRectangleFromRectangle(aWallpaperRectangle); if(WallpaperStyle::NONE != eWallpaperStyle) { @@ -2290,9 +2287,7 @@ namespace wmfemfhelper else { // create transformed ClipRange - basegfx::B2DRange aClipRange( - rRectangle.Left(), rRectangle.Top(), - rRectangle.Right(), rRectangle.Bottom()); + basegfx::B2DRange aClipRange = vcl::unotools::b2DRectangleFromRectangle(rRectangle); aClipRange.transform(rPropertyHolders.Current().getTransformation()); |