diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-06 14:37:23 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-08 12:15:51 +0100 |
commit | 9e0770ea7e0cf094add54ad64bc9ff825d24bbe1 (patch) | |
tree | e897291e44ecb11ca44ba5e5ebefe03ac536862f /sfx2 | |
parent | 841ee6fb052fb35467d74b70f575a86c8c0fe3b7 (diff) |
Convert FieldUnit to scoped enum
Change-Id: Id2df31daa596a18c79af5fc6ea162deb6e24d5af
Reviewed-on: https://gerrit.libreoffice.org/62958
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/module.cxx | 15 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 20 |
2 files changed, 20 insertions, 15 deletions
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 2a0aef44d6c8..9624a991a9a3 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -211,7 +211,7 @@ SfxModule* SfxModule::GetActiveModule( SfxViewFrame* pFrame ) FieldUnit SfxModule::GetModuleFieldUnit( css::uno::Reference< css::frame::XFrame > const & i_frame ) { - ENSURE_OR_RETURN( i_frame.is(), "SfxModule::GetModuleFieldUnit: invalid frame!", FUNIT_100TH_MM ); + ENSURE_OR_RETURN( i_frame.is(), "SfxModule::GetModuleFieldUnit: invalid frame!", FieldUnit::MM_100TH ); // find SfxViewFrame for the given XFrame SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst(); @@ -221,17 +221,22 @@ FieldUnit SfxModule::GetModuleFieldUnit( css::uno::Reference< css::frame::XFrame break; pViewFrame = SfxViewFrame::GetNext( *pViewFrame ); } - ENSURE_OR_RETURN( pViewFrame != nullptr, "SfxModule::GetModuleFieldUnit: unable to find an SfxViewFrame for the given XFrame", FUNIT_100TH_MM ); + ENSURE_OR_RETURN( + pViewFrame != nullptr, + "SfxModule::GetModuleFieldUnit: unable to find an SfxViewFrame for the given XFrame", + FieldUnit::MM_100TH); // find the module SfxModule const * pModule = GetActiveModule( pViewFrame ); - ENSURE_OR_RETURN( pModule != nullptr, "SfxModule::GetModuleFieldUnit: no SfxModule for the given frame!", FUNIT_100TH_MM ); + ENSURE_OR_RETURN(pModule != nullptr, + "SfxModule::GetModuleFieldUnit: no SfxModule for the given frame!", + FieldUnit::MM_100TH); return pModule->GetFieldUnit(); } FieldUnit SfxModule::GetCurrentFieldUnit() { - FieldUnit eUnit = FUNIT_INCH; + FieldUnit eUnit = FieldUnit::INCH; SfxModule* pModule = GetActiveModule(); if ( pModule ) { @@ -246,7 +251,7 @@ FieldUnit SfxModule::GetCurrentFieldUnit() FieldUnit SfxModule::GetFieldUnit() const { - FieldUnit eUnit = FUNIT_INCH; + FieldUnit eUnit = FieldUnit::INCH; const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC ); if ( pItem ) eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index ebebe1c78bd5..f04feef9dd86 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -295,7 +295,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl() { MapUnit eUnit = MapUnit::MapCM; - FieldUnit eFieldUnit( FUNIT_CM ); + FieldUnit eFieldUnit( FieldUnit::CM ); SfxModule* pModule = SfxModule::GetActiveModule(); if ( pModule ) { @@ -306,15 +306,15 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl() switch ( eFieldUnit ) { - case FUNIT_MM: eUnit = MapUnit::MapMM; break; - case FUNIT_CM: - case FUNIT_M: - case FUNIT_KM: eUnit = MapUnit::MapCM; break; - case FUNIT_POINT: - case FUNIT_PICA: eUnit = MapUnit::MapPoint; break; - case FUNIT_INCH: - case FUNIT_FOOT: - case FUNIT_MILE: eUnit = MapUnit::MapInch; break; + case FieldUnit::MM: eUnit = MapUnit::MapMM; break; + case FieldUnit::CM: + case FieldUnit::M: + case FieldUnit::KM: eUnit = MapUnit::MapCM; break; + case FieldUnit::POINT: + case FieldUnit::PICA: eUnit = MapUnit::MapPoint; break; + case FieldUnit::INCH: + case FieldUnit::FOOT: + case FieldUnit::MILE: eUnit = MapUnit::MapInch; break; default: OSL_FAIL( "non supported field unit" ); |