summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-09-20 16:41:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-05 06:51:20 +0000
commit954f752cf10fc6a8777af2a6a93e496688464687 (patch)
tree0fc776cdcb6ad9b1d2b9673ac044bb5b4f496972 /oox
parentc1e18e05a53c1d55afe36a887ca25f74f3f1d32d (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 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx2
-rw-r--r--oox/source/export/drawingml.cxx4
-rw-r--r--oox/source/export/shapes.cxx4
-rw-r--r--oox/source/helper/graphichelper.cxx2
4 files changed, 6 insertions, 6 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 3fbe3515bd1b..83a02d4d439b 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1231,7 +1231,7 @@ Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase& rFilterBase )
// Size of the rendering
awt::Size aActualSize = mxShape->getSize();
- Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) );
+ Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MapUnit::MapCM ) );
double fPixelsPer100thmm = static_cast < double > ( aResolution.Width() ) / 100000.0;
awt::Size aSize = awt::Size( static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Width ) + 0.5 ),
static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Height ) + 0.5 ) );
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3670664d7aac..a70b8d6f1dcf 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1090,8 +1090,8 @@ void DrawingML::WriteSrcRect( const Reference< XPropertySet >& rXPropSet, const
const MapMode& rMapMode = aGraphicObject.GetPrefMapMode();
// GraphicCrop is in mm100, so in case the original size is in pixels, convert it over.
- if (rMapMode.GetMapUnit() == MAP_PIXEL)
- aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, MapMode(MAP_100TH_MM));
+ if (rMapMode.GetMapUnit() == MapUnit::MapPixel)
+ aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, MapMode(MapUnit::Map100thMM));
if ( GetProperty( rXPropSet, "GraphicCrop" ) )
{
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index d61635991cd6..62b8b34aa2c7 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -364,8 +364,8 @@ ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ShapeHashMap
, mnPictureIdMax( 1 )
, mnXmlNamespace( nXmlNamespace )
, maFraction( 1, 576 )
- , maMapModeSrc( MAP_100TH_MM )
- , maMapModeDest( MAP_INCH, Point(), maFraction, maFraction )
+ , maMapModeSrc( MapUnit::Map100thMM )
+ , maMapModeDest( MapUnit::MapInch, Point(), maFraction, maFraction )
, mpShapeMap( pShapeMap ? pShapeMap : &maShapeMap )
{
mpURLTransformer.reset(new URLTransformer);
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
index 5e9d43293b8a..f4ac89353b57 100644
--- a/oox/source/helper/graphichelper.cxx
+++ b/oox/source/helper/graphichelper.cxx
@@ -116,7 +116,7 @@ GraphicHelper::GraphicHelper( const Reference< XComponentContext >& rxContext, c
// get the metric of the output device
OSL_ENSURE( xFrame.is(), "GraphicHelper::GraphicHelper - cannot get target frame" );
// some default just in case, 100 000 is 1 meter in MM100
- Size aDefault = Application::GetDefaultDevice()->LogicToPixel(Size(100000, 100000), MapMode(MAP_100TH_MM));
+ Size aDefault = Application::GetDefaultDevice()->LogicToPixel(Size(100000, 100000), MapMode(MapUnit::Map100thMM));
maDeviceInfo.PixelPerMeterX = aDefault.Width();
maDeviceInfo.PixelPerMeterY = aDefault.Height();
if( xFrame.is() ) try