summaryrefslogtreecommitdiff
path: root/editeng/source/uno
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 /editeng/source/uno
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 'editeng/source/uno')
-rw-r--r--editeng/source/uno/unoipset.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 31f7e48ea8e1..60bac11af009 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -103,9 +103,9 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
if( nullptr == pItem && pPool )
pItem = &(pPool->GetDefaultItem( pMap->nWID ));
- const MapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : MAP_100TH_MM;
+ const MapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : MapUnit::Map100thMM;
sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
- if( eMapUnit == MAP_100TH_MM )
+ if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
if(pItem)
@@ -113,7 +113,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
pItem->QueryValue( aVal, nMemberId );
if( pMap->nMemberId & SFX_METRIC_ITEM )
{
- if( eMapUnit != MAP_100TH_MM )
+ if( eMapUnit != MapUnit::Map100thMM )
{
if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( aVal ) )
SvxUnoConvertToMM( eMapUnit, aVal );
@@ -164,10 +164,10 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa
{
uno::Any aValue( rVal );
- const MapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : MAP_100TH_MM;
+ const MapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : MapUnit::Map100thMM;
// check for needed metric translation
- if( (pMap->nMemberId & SFX_METRIC_ITEM) && eMapUnit != MAP_100TH_MM )
+ if( (pMap->nMemberId & SFX_METRIC_ITEM) && eMapUnit != MapUnit::Map100thMM )
{
if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( aValue ) )
SvxUnoConvertFromMM( eMapUnit, aValue );
@@ -176,7 +176,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa
SfxPoolItem *pNewItem = pItem->Clone();
sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
- if( eMapUnit == MAP_100TH_MM )
+ if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
if( pNewItem->PutValue( aValue, nMemberId ) )
@@ -200,7 +200,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
// No UsrAny detected yet, generate Default entry and return this
const MapUnit eMapUnit = mrItemPool.GetMetric((sal_uInt16)pMap->nWID);
sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
- if( eMapUnit == MAP_100TH_MM )
+ if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
uno::Any aVal;
SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID);
@@ -226,7 +226,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
if( pMap->nMemberId & SFX_METRIC_ITEM )
{
// check for needed metric translation
- if(pMap->nMemberId & SFX_METRIC_ITEM && eMapUnit != MAP_100TH_MM)
+ if(pMap->nMemberId & SFX_METRIC_ITEM && eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertToMM( eMapUnit, aVal );
}
@@ -282,7 +282,7 @@ void SvxUnoConvertToMM( const MapUnit eSourceMapUnit, uno::Any & rMetric ) throw
// map the metric of the itempool to 100th mm
switch(eSourceMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
switch( rMetric.getValueTypeClass() )
{
@@ -319,7 +319,7 @@ void SvxUnoConvertFromMM( const MapUnit eDestinationMapUnit, uno::Any & rMetric
{
switch(eDestinationMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
switch( rMetric.getValueTypeClass() )
{