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 /extensions | |
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 'extensions')
-rw-r--r-- | extensions/source/propctrlr/propertyhandler.cxx | 10 | ||||
-rw-r--r-- | extensions/source/propctrlr/standardcontrol.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/usercontrol.cxx | 2 | ||||
-rw-r--r-- | extensions/source/scanner/sanedlg.cxx | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/extensions/source/propctrlr/propertyhandler.cxx b/extensions/source/propctrlr/propertyhandler.cxx index 6ea9864adcdd..d261ae48ecbe 100644 --- a/extensions/source/propctrlr/propertyhandler.cxx +++ b/extensions/source/propctrlr/propertyhandler.cxx @@ -350,7 +350,7 @@ namespace pcr sal_Int16 PropertyHandler::impl_getDocumentMeasurementUnit_throw() const { - FieldUnit eUnit = FUNIT_NONE; + FieldUnit eUnit = FieldUnit::NONE; Reference< XServiceInfo > xDocumentSI( impl_getContextDocument_nothrow(), UNO_QUERY ); OSL_ENSURE( xDocumentSI.is(), "PropertyHandlerHelper::impl_getDocumentMeasurementUnit_throw: No context document - where do I live?" ); @@ -390,19 +390,19 @@ namespace pcr { ::utl::OConfigurationTreeRoot aConfigTree( ::utl::OConfigurationTreeRoot::createWithComponentContext( m_xContext, sConfigurationLocation, -1, ::utl::OConfigurationTreeRoot::CM_READONLY ) ); - sal_Int32 nUnitAsInt = sal_Int32(FUNIT_NONE); + sal_Int32 nUnitAsInt = sal_Int32(FieldUnit::NONE); aConfigTree.getNodeValue( sConfigurationProperty ) >>= nUnitAsInt; // if this denotes a valid (and accepted) unit, then use it - if ( ( nUnitAsInt > FUNIT_NONE ) && ( nUnitAsInt <= FUNIT_100TH_MM ) ) + if ( ( nUnitAsInt > sal_Int32(FieldUnit::NONE) ) && ( nUnitAsInt <= sal_Int32(FieldUnit::MM_100TH) ) ) eUnit = static_cast< FieldUnit >( nUnitAsInt ); } } - if ( FUNIT_NONE == eUnit ) + if ( FieldUnit::NONE == eUnit ) { MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); - eUnit = MeasurementSystem::Metric == eSystem ? FUNIT_CM : FUNIT_INCH; + eUnit = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH; } return VCLUnoHelper::ConvertToMeasurementUnit( eUnit, 1 ); diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 40e283108339..9f88def3cbf6 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -477,10 +477,10 @@ namespace pcr ONumericControl::ONumericControl( vcl::Window* _pParent, WinBits _nWinStyle ) :ONumericControl_Base( PropertyControlType::NumericField, _pParent, _nWinStyle ) - ,m_eValueUnit( FUNIT_NONE ) + ,m_eValueUnit( FieldUnit::NONE ) ,m_nFieldToUNOValueFactor( 1 ) { - MetricField::SetDefaultUnit( FUNIT_NONE ); + MetricField::SetDefaultUnit( FieldUnit::NONE ); getTypedControlWindow()->EnableEmptyFieldValue( true ); getTypedControlWindow()->SetStrictFormat( true ); diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index a74726df964b..9163d21f141e 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -290,7 +290,7 @@ namespace pcr OTimeDurationControl::OTimeDurationControl( vcl::Window* pParent ) :ONumericControl( pParent, WB_BORDER | WB_TABSTOP ) { - getTypedControlWindow()->SetUnit( FUNIT_CUSTOM ); + getTypedControlWindow()->SetUnit( FieldUnit::CUSTOM ); getTypedControlWindow()->SetCustomUnitText(" ms"); getTypedControlWindow()->SetCustomConvertHdl( LINK( this, OTimeDurationControl, OnCustomConvert ) ); } diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index d23384b868a3..1a88a2ee5194 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -469,12 +469,12 @@ void SaneDlg::InitFields() { if( mrSane.GetOptionUnit( nOption ) == SANE_UNIT_MM ) { - pField->SetUnit( FUNIT_MM ); - pField->SetValue( static_cast<int>(fValue), FUNIT_MM ); + pField->SetUnit( FieldUnit::MM ); + pField->SetValue( static_cast<int>(fValue), FieldUnit::MM ); } else // SANE_UNIT_PIXEL { - pField->SetValue( static_cast<int>(fValue), FUNIT_CUSTOM ); + pField->SetValue( static_cast<int>(fValue), FieldUnit::CUSTOM ); pField->SetCustomUnitText("Pixel"); } switch( i ) { |