summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
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 /svx/source/svdraw
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 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svddrgmt.cxx4
-rw-r--r--svx/source/svdraw/svdedxv.cxx2
-rw-r--r--svx/source/svdraw/svdibrow.cxx2
-rw-r--r--svx/source/svdraw/svdmodel.cxx28
-rw-r--r--svx/source/svdraw/svdmrkv.cxx8
-rw-r--r--svx/source/svdraw/svdoashp.cxx8
-rw-r--r--svx/source/svdraw/svdobj.cxx8
-rw-r--r--svx/source/svdraw/svdocapt.cxx4
-rw-r--r--svx/source/svdraw/svdograf.cxx8
-rw-r--r--svx/source/svdraw/svdomeas.cxx8
-rw-r--r--svx/source/svdraw/svdomedia.cxx2
-rw-r--r--svx/source/svdraw/svdoole2.cxx6
-rw-r--r--svx/source/svdraw/svdopath.cxx8
-rw-r--r--svx/source/svdraw/svdotext.cxx8
-rw-r--r--svx/source/svdraw/svdtrans.cxx84
15 files changed, 94 insertions, 94 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 6dde7207ca34..5c235813ced1 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -3779,10 +3779,10 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
return false;
const GraphicObject& rGraphicObject = pObj->GetGraphicObject();
- const MapMode aMapMode100thmm(MAP_100TH_MM);
+ const MapMode aMapMode100thmm(MapUnit::Map100thMM);
Size aGraphicSize(rGraphicObject.GetPrefSize());
- if( MAP_PIXEL == rGraphicObject.GetPrefMapMode().GetMapUnit() )
+ if( MapUnit::MapPixel == rGraphicObject.GetPrefMapMode().GetMapUnit() )
aGraphicSize = Application::GetDefaultDevice()->PixelToLogic( aGraphicSize, aMapMode100thmm );
else
aGraphicSize = OutputDevice::LogicToLogic( aGraphicSize, rGraphicObject.GetPrefMapMode(), aMapMode100thmm);
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 3876de9157f7..f8e7c727fe52 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1337,7 +1337,7 @@ bool SdrObjEditView::IsTextEditHit(const Point& rHit) const
long nHitTol = 2000;
OutputDevice* pRef = pTextEditOutliner->GetRefDevice();
if( pRef )
- nHitTol = OutputDevice::LogicToLogic( nHitTol, MAP_100TH_MM, pRef->GetMapMode().GetMapUnit() );
+ nHitTol = OutputDevice::LogicToLogic( nHitTol, MapUnit::Map100thMM, pRef->GetMapMode().GetMapUnit() );
bOk = pTextEditOutliner->IsTextPos( aPnt, (sal_uInt16)nHitTol );
}
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index c006538f6ab4..d3152c536893 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -1005,7 +1005,7 @@ void SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItemS
rItem.GetPresentation(SfxItemPresentation::Nameless,
pPool->GetMetric(nWhich),
- MAP_MM, aEntry.aValue);
+ MapUnit::MapMM, aEntry.aValue);
if (aEntry.bCanNum)
{
aEntry.aValue = OUString::number(aEntry.nVal) + ": " + aEntry.aValue;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 4bfb71beba97..dab3a8659519 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -937,20 +937,20 @@ void SdrModel::ImpSetUIUnit()
// normalize on meters resp. inch
switch (eObjUnit)
{
- case MAP_100TH_MM : nUIUnitKomma+=5; break;
- case MAP_10TH_MM : nUIUnitKomma+=4; break;
- case MAP_MM : nUIUnitKomma+=3; break;
- case MAP_CM : nUIUnitKomma+=2; break;
- case MAP_1000TH_INCH: nUIUnitKomma+=3; break;
- case MAP_100TH_INCH : nUIUnitKomma+=2; break;
- case MAP_10TH_INCH : nUIUnitKomma+=1; break;
- case MAP_INCH : nUIUnitKomma+=0; break;
- case MAP_POINT : nDiv=72; break; // 1Pt = 1/72"
- case MAP_TWIP : nDiv=144; nUIUnitKomma++; break; // 1Twip = 1/1440"
- case MAP_PIXEL : break;
- case MAP_SYSFONT : break;
- case MAP_APPFONT : break;
- case MAP_RELATIVE : break;
+ case MapUnit::Map100thMM : nUIUnitKomma+=5; break;
+ case MapUnit::Map10thMM : nUIUnitKomma+=4; break;
+ case MapUnit::MapMM : nUIUnitKomma+=3; break;
+ case MapUnit::MapCM : nUIUnitKomma+=2; break;
+ case MapUnit::Map1000thInch: nUIUnitKomma+=3; break;
+ case MapUnit::Map100thInch : nUIUnitKomma+=2; break;
+ case MapUnit::Map10thInch : nUIUnitKomma+=1; break;
+ case MapUnit::MapInch : nUIUnitKomma+=0; break;
+ case MapUnit::MapPoint : nDiv=72; break; // 1Pt = 1/72"
+ case MapUnit::MapTwip : nDiv=144; nUIUnitKomma++; break; // 1Twip = 1/1440"
+ case MapUnit::MapPixel : break;
+ case MapUnit::MapSysFont : break;
+ case MapUnit::MapAppFont : break;
+ case MapUnit::MapRelative : break;
default: break;
} // switch
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 383c51fc967d..8e618690cb0b 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -219,8 +219,8 @@ void SdrMarkView::ModelHasChanged()
{
if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
{
- if (pOutputDevice->GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP);
+ if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip);
}
}
@@ -753,8 +753,8 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
{
if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
{
- if (pOutputDevice->GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP);
+ if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip);
}
}
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index ea37cf640e4d..52545fbcd768 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2970,11 +2970,11 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix,
// force metric to pool metric
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
@@ -3122,11 +3122,11 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf
// force MapUnit to 100th mm
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 669689451666..f440b121d537 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2958,11 +2958,11 @@ bool SdrObject::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPo
// force MapUnit to 100th mm
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
@@ -3008,11 +3008,11 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba
// force metric to pool metric
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index bc917815586c..15e3dfe649fd 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -774,11 +774,11 @@ void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons
// force metric to pool metric
MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 602ec30b3d65..766083354c77 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -584,7 +584,7 @@ Size SdrGrafObj::getOriginalSize() const
aSize = Size ( aCroppedWidth, aCroppedHeight);
}
- if ( GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, GetModel()->GetScaleUnit() );
else
aSize = OutputDevice::LogicToLogic( aSize, GetGrafPrefMapMode(), GetModel()->GetScaleUnit() );
@@ -1243,12 +1243,12 @@ void SdrGrafObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly )
{
Size aSize;
Size aMaxSize( rMaxRect.GetSize() );
- if ( pGraphic->GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
- aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MAP_100TH_MM );
+ if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
+ aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MapUnit::Map100thMM );
else
aSize = OutputDevice::LogicToLogic( pGraphic->GetPrefSize(),
pGraphic->GetPrefMapMode(),
- MapMode( MAP_100TH_MM ) );
+ MapMode( MapUnit::Map100thMM ) );
if( aSize.Height() != 0 && aSize.Width() != 0 )
{
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index dcfda7e93744..286e6088fdf8 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -1391,11 +1391,11 @@ bool SdrMeasureObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B
// force MapUnit to 100th mm
MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
@@ -1428,11 +1428,11 @@ void SdrMeasureObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons
// force metric to pool metric
MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aPosA.setX(ImplMMToTwips(aPosA.getX()));
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index ada1c4aaa57f..7a55d02b49e4 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -184,7 +184,7 @@ const uno::Reference< graphic::XGraphic > SdrMediaObj::getSnapshot() const
void SdrMediaObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly /* = false */ )
{
- Size aSize( Application::GetDefaultDevice()->PixelToLogic( getPreferredSize(), MAP_100TH_MM ) );
+ Size aSize( Application::GetDefaultDevice()->PixelToLogic( getPreferredSize(), MapUnit::Map100thMM ) );
Size aMaxSize( rMaxRect.GetSize() );
if( aSize.Height() != 0 && aSize.Width() != 0 )
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 2c9bdca4c8d1..6e6609164b75 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -227,7 +227,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj
{
try
{
- MapUnit aContainerMapUnit( MAP_100TH_MM );
+ MapUnit aContainerMapUnit( MapUnit::Map100thMM );
uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY );
if ( xParentVis.is() )
aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) );
@@ -462,7 +462,7 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement()
throw uno::RuntimeException();
Rectangle aLogicRect = impl_getScaledRect_nothrow();
- MapUnit aContainerMapUnit( MAP_100TH_MM );
+ MapUnit aContainerMapUnit( MapUnit::Map100thMM );
uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY );
if ( xParentVis.is() )
aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) );
@@ -512,7 +512,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl
return;
// new scaled object area
- MapUnit aContainerMapUnit( MAP_100TH_MM );
+ MapUnit aContainerMapUnit( MapUnit::Map100thMM );
uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY );
if ( xParentVis.is() )
aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) );
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 0f6071dde53d..f91413b00426 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2946,11 +2946,11 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
// force MapUnit to 100th mm
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
@@ -3016,11 +3016,11 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
// force metric to pool metric
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 8bf65851dacf..2b7774006df9 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1631,11 +1631,11 @@ bool SdrTextObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
// force MapUnit to 100th mm
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
@@ -1696,11 +1696,11 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
// force metric to pool metric
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 554731b220be..5b18a2b3cd24 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -575,27 +575,27 @@ long BigMulDiv(long nVal, long nMul, long nDiv)
FrPair GetInchOrMM(MapUnit eU)
{
switch (eU) {
- case MAP_1000TH_INCH: return FrPair(1000,1);
- case MAP_100TH_INCH : return FrPair( 100,1);
- case MAP_10TH_INCH : return FrPair( 10,1);
- case MAP_INCH : return FrPair( 1,1);
- case MAP_POINT : return FrPair( 72,1);
- case MAP_TWIP : return FrPair(1440,1);
- case MAP_100TH_MM : return FrPair( 100,1);
- case MAP_10TH_MM : return FrPair( 10,1);
- case MAP_MM : return FrPair( 1,1);
- case MAP_CM : return FrPair( 1,10);
- case MAP_PIXEL : {
+ case MapUnit::Map1000thInch: return FrPair(1000,1);
+ case MapUnit::Map100thInch : return FrPair( 100,1);
+ case MapUnit::Map10thInch : return FrPair( 10,1);
+ case MapUnit::MapInch : return FrPair( 1,1);
+ case MapUnit::MapPoint : return FrPair( 72,1);
+ case MapUnit::MapTwip : return FrPair(1440,1);
+ case MapUnit::Map100thMM : return FrPair( 100,1);
+ case MapUnit::Map10thMM : return FrPair( 10,1);
+ case MapUnit::MapMM : return FrPair( 1,1);
+ case MapUnit::MapCM : return FrPair( 1,10);
+ case MapUnit::MapPixel : {
ScopedVclPtrInstance< VirtualDevice > pVD;
- pVD->SetMapMode(MapMode(MAP_100TH_MM));
+ pVD->SetMapMode(MapMode(MapUnit::Map100thMM));
Point aP(pVD->PixelToLogic(Point(64,64))); // 64 pixels for more accuracy
return FrPair(6400,aP.X(),6400,aP.Y());
}
- case MAP_APPFONT: case MAP_SYSFONT: {
+ case MapUnit::MapAppFont: case MapUnit::MapSysFont: {
ScopedVclPtrInstance< VirtualDevice > pVD;
pVD->SetMapMode(MapMode(eU));
Point aP(pVD->LogicToPixel(Point(32,32))); // 32 units for more accuracy
- pVD->SetMapMode(MapMode(MAP_100TH_MM));
+ pVD->SetMapMode(MapMode(MapUnit::Map100thMM));
aP=pVD->PixelToLogic(aP);
return FrPair(3200,aP.X(),3200,aP.Y());
}
@@ -667,22 +667,22 @@ void GetMeterOrInch(MapUnit eMU, short& rnKomma, long& rnMul, long& rnDiv, bool&
bool bMetr = false, bInch = false;
switch (eMU) {
// Metrisch
- case MAP_100TH_MM : bMetr = true; nKomma=5; break;
- case MAP_10TH_MM : bMetr = true; nKomma=4; break;
- case MAP_MM : bMetr = true; nKomma=3; break;
- case MAP_CM : bMetr = true; nKomma=2; break;
+ case MapUnit::Map100thMM : bMetr = true; nKomma=5; break;
+ case MapUnit::Map10thMM : bMetr = true; nKomma=4; break;
+ case MapUnit::MapMM : bMetr = true; nKomma=3; break;
+ case MapUnit::MapCM : bMetr = true; nKomma=2; break;
// Inch
- case MAP_1000TH_INCH: bInch = true; nKomma=3; break;
- case MAP_100TH_INCH : bInch = true; nKomma=2; break;
- case MAP_10TH_INCH : bInch = true; nKomma=1; break;
- case MAP_INCH : bInch = true; nKomma=0; break;
- case MAP_POINT : bInch = true; rnDiv=72; break; // 1Pt = 1/72"
- case MAP_TWIP : bInch = true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
+ case MapUnit::Map1000thInch: bInch = true; nKomma=3; break;
+ case MapUnit::Map100thInch : bInch = true; nKomma=2; break;
+ case MapUnit::Map10thInch : bInch = true; nKomma=1; break;
+ case MapUnit::MapInch : bInch = true; nKomma=0; break;
+ case MapUnit::MapPoint : bInch = true; rnDiv=72; break; // 1Pt = 1/72"
+ case MapUnit::MapTwip : bInch = true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
// Sonstiges
- case MAP_PIXEL : break;
- case MAP_SYSFONT : break;
- case MAP_APPFONT : break;
- case MAP_RELATIVE : break;
+ case MapUnit::MapPixel : break;
+ case MapUnit::MapSysFont : break;
+ case MapUnit::MapAppFont : break;
+ case MapUnit::MapRelative : break;
default: break;
} // switch
rnKomma=nKomma;
@@ -840,76 +840,76 @@ void SdrFormatter::TakeUnitStr(MapUnit eUnit, OUString& rStr)
switch(eUnit)
{
// metrically
- case MAP_100TH_MM :
+ case MapUnit::Map100thMM :
{
rStr = "/100mm";
break;
}
- case MAP_10TH_MM :
+ case MapUnit::Map10thMM :
{
rStr = "/10mm";
break;
}
- case MAP_MM :
+ case MapUnit::MapMM :
{
rStr = "mm";
break;
}
- case MAP_CM :
+ case MapUnit::MapCM :
{
rStr = "cm";
break;
}
// Inch
- case MAP_1000TH_INCH:
+ case MapUnit::Map1000thInch:
{
rStr = "/1000\"";
break;
}
- case MAP_100TH_INCH :
+ case MapUnit::Map100thInch :
{
rStr = "/100\"";
break;
}
- case MAP_10TH_INCH :
+ case MapUnit::Map10thInch :
{
rStr = "/10\"";
break;
}
- case MAP_INCH :
+ case MapUnit::MapInch :
{
rStr = "\"";
break;
}
- case MAP_POINT :
+ case MapUnit::MapPoint :
{
rStr = "pt";
break;
}
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
rStr = "twip";
break;
}
// others
- case MAP_PIXEL :
+ case MapUnit::MapPixel :
{
rStr = "pixel";
break;
}
- case MAP_SYSFONT :
+ case MapUnit::MapSysFont :
{
rStr = "sysfont";
break;
}
- case MAP_APPFONT :
+ case MapUnit::MapAppFont :
{
rStr = "appfont";
break;
}
- case MAP_RELATIVE :
+ case MapUnit::MapRelative :
{
rStr = "%";
break;