diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-20 16:41:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-05 06:51:20 +0000 |
commit | 954f752cf10fc6a8777af2a6a93e496688464687 (patch) | |
tree | 0fc776cdcb6ad9b1d2b9673ac044bb5b4f496972 /svx/source/sdr | |
parent | c1e18e05a53c1d55afe36a887ca25f74f3f1d32d (diff) |
convert MapUnit to scoped enum
I left a prefix on the names "Map" so that I would not have to re-arrange
each name too much, since I can't start identifiers with digits like "100thMM"
And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore.
Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224
Reviewed-on: https://gerrit.libreoffice.org/29096
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr')
4 files changed, 14 insertions, 14 deletions
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 8cb09022e000..c4c336bff959 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -106,13 +106,13 @@ namespace sdr // safe to assume 100th mm as target. Size aPrefSize(GetGrafObject().GetGrafPrefSize()); - if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit()) + if(MapUnit::MapPixel == GetGrafObject().GetGrafPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapUnit::Map100thMM); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MapUnit::Map100thMM); } // decompose object matrix to get single values @@ -198,13 +198,13 @@ namespace sdr { Size aPrefSize(aDraftBitmap.GetPrefSize()); - if(MAP_PIXEL == aDraftBitmap.GetPrefMapMode().GetMapUnit()) + if(MapUnit::MapPixel == aDraftBitmap.GetPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MAP_100TH_MM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MapUnit::Map100thMM); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MAP_100TH_MM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MapUnit::Map100thMM); } const double fBitmapScaling(2.0); diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index c744f2923793..6438bc762115 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -79,8 +79,8 @@ namespace sdr if (comphelper::LibreOfficeKit::isActive()) { aSizeLogic = Size(DEFAULT_VALUE_FOR_HITTEST_TWIP, DEFAULT_VALUE_FOR_HITTEST_TWIP); - if (pManager->getOutputDevice().GetMapMode().GetMapUnit() == MAP_100TH_MM) - aSizeLogic = OutputDevice::LogicToLogic(aSizeLogic, MAP_TWIP, MAP_100TH_MM); + if (pManager->getOutputDevice().GetMapMode().GetMapUnit() == MapUnit::Map100thMM) + aSizeLogic = OutputDevice::LogicToLogic(aSizeLogic, MapUnit::MapTwip, MapUnit::Map100thMM); } fLogicTolerance = aSizeLogic.Width(); diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index bbfbbd87d8fa..e150b19469f5 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -642,7 +642,7 @@ namespace drawinglayer if(GraphicType::Bitmap == aGraphic.GetType()) { aGraphic.SetPrefSize(aGraphic.GetBitmapEx().GetSizePixel()); - aGraphic.SetPrefMapMode(MAP_PIXEL); + aGraphic.SetPrefMapMode(MapUnit::MapPixel); } } @@ -659,11 +659,11 @@ namespace drawinglayer if(aGraphic.GetPrefMapMode() != aDestinationMapUnit) { - // #i100360# for MAP_PIXEL, LogicToLogic will not work properly, + // #i100360# for MapUnit::MapPixel, LogicToLogic will not work properly, // so fallback to Application::GetDefaultDevice() Size aNewSize(0, 0); - if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit()) + if(MapUnit::MapPixel == aGraphic.GetPrefMapMode().GetMapUnit()) { aNewSize = Application::GetDefaultDevice()->PixelToLogic( aGraphic.GetPrefSize(), diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx index 276f68d98452..a4fa9e4f3419 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -73,13 +73,13 @@ namespace drawinglayer // get PrefSize from the graphic in 100th mm Size aPrefSize(aGraphic.GetPrefSize()); - if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit()) + if(MapUnit::MapPixel == aGraphic.GetPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapUnit::Map100thMM); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MAP_100TH_MM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MapUnit::Map100thMM); } const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0); |