summaryrefslogtreecommitdiff
path: root/drawinglayer
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 /drawinglayer
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 'drawinglayer')
-rw-r--r--drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx2
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx20
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx10
-rw-r--r--drawinglayer/source/tools/converters.cxx2
6 files changed, 21 insertions, 21 deletions
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 1092de8d796d..ef23f2194ede 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -176,7 +176,7 @@ namespace drawinglayer
{
const uno::Reference< rendering::XGraphicDevice > xGraphicDevice;
- aBitmapEx.SetPrefMapMode(MapMode(MAP_100TH_MM));
+ aBitmapEx.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
aBitmapEx.SetPrefSize(Size(basegfx::fround(fWidth), basegfx::fround(fHeight)));
XBitmap = vcl::unotools::xBitmapFromBitmapEx(xGraphicDevice, aBitmapEx);
}
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 1367692b8f3c..6a62af0ad014 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -135,8 +135,8 @@ namespace drawinglayer
{ // #i93162# For painting the control setting a Zoom (using setZoom() at the xControlView)
// is needed to define the font size. Normally this is done in
// ViewObjectContactOfUnoControl::createPrimitive2DSequence by using positionControlForPaint().
- // For some reason the difference between MAP_TWIPS and MAP_100TH_MM still plays
- // a role there so that for Draw/Impress/Calc (the MAP_100TH_MM users) i need to set a zoom
+ // For some reason the difference between MapUnit::MapTwipS and MapUnit::Map100thMM still plays
+ // a role there so that for Draw/Impress/Calc (the MapUnit::Map100thMM users) i need to set a zoom
// here, too. The factor includes the needed scale, but is calculated by pure comparisons. It
// is somehow related to the twips/100thmm relationship.
bool bUserIs100thmm(false);
@@ -160,7 +160,7 @@ namespace drawinglayer
if(pWindow)
{
- if(MAP_100TH_MM == pWindow->GetMapMode().GetMapUnit())
+ if(MapUnit::Map100thMM == pWindow->GetMapMode().GetMapUnit())
{
bUserIs100thmm = true;
}
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index f83939a65cd4..de1c22bba9b0 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -104,7 +104,7 @@ namespace
public:
PropertyHolder()
: maTransformation(),
- maMapUnit(MAP_100TH_MM),
+ maMapUnit(MapUnit::Map100thMM),
maLineColor(),
maFillColor(),
maTextColor(COL_BLACK),
@@ -2661,14 +2661,14 @@ namespace
case MetaActionType::MAPMODE :
{
/** CHECKED, WORKS WELL */
- // the most necessary MapMode to be interpreted is MAP_RELATIVE,
+ // the most necessary MapMode to be interpreted is MapUnit::MapRelative,
// but also the others may occur. Even not yet supported ones
// may need to be added here later
const MetaMapModeAction* pA = static_cast<const MetaMapModeAction*>(pAction);
const MapMode& rMapMode = pA->GetMapMode();
basegfx::B2DHomMatrix aMapping;
- if(MAP_RELATIVE == rMapMode.GetMapUnit())
+ if(MapUnit::MapRelative == rMapMode.GetMapUnit())
{
aMapping = getTransformFromMapMode(rMapMode);
}
@@ -2676,21 +2676,21 @@ namespace
{
switch(rMapMode.GetMapUnit())
{
- case MAP_100TH_MM :
+ case MapUnit::Map100thMM :
{
- if(MAP_TWIP == rPropertyHolders.Current().getMapUnit())
+ if(MapUnit::MapTwip == rPropertyHolders.Current().getMapUnit())
{
- // MAP_TWIP -> MAP_100TH_MM
+ // MapUnit::MapTwip -> MapUnit::Map100thMM
const double fTwipTo100thMm(127.0 / 72.0);
aMapping.scale(fTwipTo100thMm, fTwipTo100thMm);
}
break;
}
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
- if(MAP_100TH_MM == rPropertyHolders.Current().getMapUnit())
+ if(MapUnit::Map100thMM == rPropertyHolders.Current().getMapUnit())
{
- // MAP_100TH_MM -> MAP_TWIP
+ // MapUnit::Map100thMM -> MapUnit::MapTwip
const double f100thMmToTwip(72.0 / 127.0);
aMapping.scale(f100thMmToTwip, f100thMmToTwip);
}
@@ -2733,7 +2733,7 @@ namespace
// convert to target MapUnit if not pixels
aFontSize = OutputDevice::LogicToLogic(
- aFontSize, MAP_PIXEL, rPropertyHolders.Current().getMapUnit());
+ aFontSize, MapUnit::MapPixel, rPropertyHolders.Current().getMapUnit());
aCorrectedFont.SetFontSize(aFontSize);
rPropertyHolders.Current().setFont(aCorrectedFont);
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index b87df2739280..d863d21eb7a5 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -124,7 +124,7 @@ namespace
aRetval = BitmapEx(aContent, aAlpha);
// #i101811# set PrefMapMode and PrefSize at newly created Bitmap
- aRetval.SetPrefMapMode(MAP_PIXEL);
+ aRetval.SetPrefMapMode(MapUnit::MapPixel);
aRetval.SetPrefSize(Size(nWidth, nHeight));
}
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index ce0c192c44d1..19ad8bdb9fb8 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -818,7 +818,7 @@ namespace drawinglayer
double fFactorY(1.0);
{
- const MapMode aMapMode100thmm(MAP_100TH_MM);
+ const MapMode aMapMode100thmm(MapUnit::Map100thMM);
const Size aBitmapSize(OutputDevice::LogicToLogic(
rGraphicPrimitive.getGraphicObject().GetPrefSize(),
rGraphicPrimitive.getGraphicObject().GetPrefMapMode(), aMapMode100thmm));
@@ -909,7 +909,7 @@ namespace drawinglayer
pPDFControl->Location = aRectLogic;
Size aFontSize(pPDFControl->TextFont.GetFontSize());
- aFontSize = OutputDevice::LogicToLogic(aFontSize, MapMode(MAP_POINT), mpOutputDevice->GetMapMode());
+ aFontSize = OutputDevice::LogicToLogic(aFontSize, MapMode(MapUnit::MapPoint), mpOutputDevice->GetMapMode());
pPDFControl->TextFont.SetFontSize(aFontSize);
mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::Form);
@@ -2033,10 +2033,10 @@ namespace drawinglayer
// prepare view transformation for target renderers
// ATTENTION! Need to apply another scaling because of the potential DPI differences
// between Printer and VDev (mpOutputDevice and aBufferDevice here).
- // To get the DPI, LogicToPixel from (1,1) from MAP_INCH needs to be used.
+ // To get the DPI, LogicToPixel from (1,1) from MapUnit::MapInch needs to be used.
basegfx::B2DHomMatrix aViewTransform(aBufferDevice->GetViewTransformation());
- const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MAP_INCH));
- const Size aDPINew(aBufferDevice->LogicToPixel(Size(1, 1), MAP_INCH));
+ const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MapUnit::MapInch));
+ const Size aDPINew(aBufferDevice->LogicToPixel(Size(1, 1), MapUnit::MapInch));
const double fDPIXChange((double)aDPIOld.getWidth() / (double)aDPINew.getWidth());
const double fDPIYChange((double)aDPIOld.getHeight() / (double)aDPINew.getHeight());
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index ac41e60fbc77..93cc3329b2e6 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -50,7 +50,7 @@ namespace drawinglayer
if(!rSeq.empty() && nDiscreteWidth && nDiscreteHeight)
{
// get destination size in pixels
- const MapMode aMapModePixel(MAP_PIXEL);
+ const MapMode aMapModePixel(MapUnit::MapPixel);
const sal_uInt32 nViewVisibleArea(nDiscreteWidth * nDiscreteHeight);
drawinglayer::primitive2d::Primitive2DContainer aSequence(rSeq);