summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/transfrm.cxx
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 /cui/source/tabpages/transfrm.cxx
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 'cui/source/tabpages/transfrm.cxx')
-rw-r--r--cui/source/tabpages/transfrm.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index d673aa64725a..98d1f9b765f4 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -900,8 +900,8 @@ void SvxPositionSizeTabPage::Construct()
// take UI units into account
const sal_uInt16 nDigits(m_pMtrPosX->GetDecimalDigits());
- TransfrmHelper::ConvertRect( maWorkRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
- TransfrmHelper::ConvertRect( maRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
+ TransfrmHelper::ConvertRect( maWorkRange, nDigits, mePoolUnit, meDlgUnit );
+ TransfrmHelper::ConvertRect( maRange, nDigits, mePoolUnit, meDlgUnit );
SetMinMaxPosition();
}
@@ -969,14 +969,14 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
double nWidth = static_cast<double>(m_pMtrWidth->GetValue( meDlgUnit ));
nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
long lWidth = long(nWidth * (double)aUIScale);
- lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit );
+ lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit );
lWidth = static_cast<long>(m_pMtrWidth->Denormalize( lWidth ));
// get Height
double nHeight = static_cast<double>(m_pMtrHeight->GetValue( meDlgUnit ));
nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
long lHeight = long(nHeight * (double)aUIScale);
- lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit );
+ lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
lHeight = static_cast<long>(m_pMtrHeight->Denormalize( lHeight ));
// put Width & Height to itemset
@@ -1073,7 +1073,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{ // #i75273# set width
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH );
mfOldWidth = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
- double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale);
+ double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
if(m_pMtrWidth->GetDecimalDigits())
fTmpWidth *= pow(10.0, m_pMtrWidth->GetDecimalDigits());
@@ -1085,7 +1085,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{ // #i75273# set height
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT );
mfOldHeight = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
- double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale);
+ double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
if(m_pMtrHeight->GetDecimalDigits())
fTmpHeight *= pow(10.0, m_pMtrHeight->GetDecimalDigits());
@@ -1310,7 +1310,7 @@ void SvxPositionSizeTabPage::SetMinMaxPosition()
}
}
- const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MAP_100TH_MM, meDlgUnit ) - 1L));
+ const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1L));
fLeft = basegfx::clamp(fLeft, -fMaxLong, fMaxLong);
fRight = basegfx::clamp(fRight, -fMaxLong, fMaxLong);
fTop = basegfx::clamp(fTop, - fMaxLong, fMaxLong);