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 /sw/source/uibase/sidebar | |
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 'sw/source/uibase/sidebar')
-rw-r--r-- | sw/source/uibase/sidebar/PageFormatPanel.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageMarginControl.cxx | 20 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageSizeControl.cxx | 8 |
3 files changed, 21 insertions, 21 deletions
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx b/sw/source/uibase/sidebar/PageFormatPanel.cxx index a256e0be0e1d..b8b81c56d48a 100644 --- a/sw/source/uibase/sidebar/PageFormatPanel.cxx +++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx @@ -129,10 +129,10 @@ void PageFormatPanel::Initialize() aCustomEntry = mpCustomEntry->GetText(); const SvtOptionsDrawinglayer aDrawinglayerOpt; - mpPaperWidth->SetMax(mpPaperWidth->Normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FUNIT_CM); - mpPaperWidth->SetLast(mpPaperWidth->Normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FUNIT_CM); - mpPaperHeight->SetMax(mpPaperHeight->Normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FUNIT_CM); - mpPaperHeight->SetLast(mpPaperHeight->Normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FUNIT_CM); + mpPaperWidth->SetMax(mpPaperWidth->Normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FieldUnit::CM); + mpPaperWidth->SetLast(mpPaperWidth->Normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FieldUnit::CM); + mpPaperHeight->SetMax(mpPaperHeight->Normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FieldUnit::CM); + mpPaperHeight->SetLast(mpPaperHeight->Normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FieldUnit::CM); mpPaperSizeBox->SetSelectHdl( LINK(this, PageFormatPanel, PaperFormatModifyHdl )); mpPaperOrientation->SetSelectHdl( LINK(this, PageFormatPanel, PaperFormatModifyHdl )); @@ -166,8 +166,8 @@ void PageFormatPanel::NotifyItemUpdate( { Size aPaperSize = pSizeItem->GetSize(); - mpPaperWidth->SetValue( mpPaperWidth->Normalize( aPaperSize.Width() ), FUNIT_TWIP ); - mpPaperHeight->SetValue( mpPaperHeight->Normalize( aPaperSize.Height() ), FUNIT_TWIP ); + mpPaperWidth->SetValue( mpPaperWidth->Normalize( aPaperSize.Width() ), FieldUnit::TWIP ); + mpPaperHeight->SetValue( mpPaperHeight->Normalize( aPaperSize.Height() ), FieldUnit::TWIP ); if(mpPaperOrientation->GetSelectedEntryPos() == 1) Swap(aPaperSize); @@ -302,7 +302,7 @@ IMPL_LINK_NOARG(PageFormatPanel, PaperModifyMarginHdl, ListBox&, void) FieldUnit PageFormatPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState ) { - FieldUnit eUnit = FUNIT_NONE; + FieldUnit eUnit = FieldUnit::NONE; if ( pState && eState >= SfxItemState::DEFAULT ) eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pState)->GetValue()); diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index ad6d3c5860e7..984c7d8cde2b 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -49,7 +49,7 @@ namespace { FieldUnit lcl_GetFieldUnit() { - FieldUnit eUnit = FUNIT_INCH; + FieldUnit eUnit = FieldUnit::INCH; const SfxPoolItem* pItem = nullptr; SfxItemState eState = SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_METRIC, pItem ); if ( pItem && eState >= SfxItemState::DEFAULT ) @@ -169,7 +169,7 @@ PageMarginControl::PageMarginControl( sal_uInt16 nId, vcl::Window* pParent ) get( m_pContainer, "container" ); m_pWidthHeightField = VclPtr<MetricField>::Create( m_pContainer.get(), WinBits(0) ); m_pWidthHeightField->Hide(); - m_pWidthHeightField->SetUnit( FUNIT_CM ); + m_pWidthHeightField->SetUnit( FieldUnit::CM ); m_pWidthHeightField->SetMax( 9999 ); m_pWidthHeightField->SetDecimalDigits( 2 ); m_pWidthHeightField->SetSpinSize( 10 ); @@ -254,29 +254,29 @@ void PageMarginControl::dispose() void PageMarginControl::SetMetricFieldMaxValues( const Size& rPageSize ) { - const long nML = m_pLeftMarginEdit->Denormalize( m_pLeftMarginEdit->GetValue( FUNIT_TWIP ) ); - const long nMR = m_pRightMarginEdit->Denormalize( m_pRightMarginEdit->GetValue( FUNIT_TWIP ) ); - const long nMT = m_pTopMarginEdit->Denormalize( m_pTopMarginEdit->GetValue( FUNIT_TWIP ) ); - const long nMB = m_pBottomMarginEdit->Denormalize( m_pBottomMarginEdit->GetValue( FUNIT_TWIP ) ); + const long nML = m_pLeftMarginEdit->Denormalize( m_pLeftMarginEdit->GetValue( FieldUnit::TWIP ) ); + const long nMR = m_pRightMarginEdit->Denormalize( m_pRightMarginEdit->GetValue( FieldUnit::TWIP ) ); + const long nMT = m_pTopMarginEdit->Denormalize( m_pTopMarginEdit->GetValue( FieldUnit::TWIP ) ); + const long nMB = m_pBottomMarginEdit->Denormalize( m_pBottomMarginEdit->GetValue( FieldUnit::TWIP ) ); const long nPH = LogicToLogic( rPageSize.Height(), m_eUnit, MapUnit::MapTwip ); const long nPW = LogicToLogic( rPageSize.Width(), m_eUnit, MapUnit::MapTwip ); // Left long nMax = nPW - nMR - MINBODY; - m_pLeftMarginEdit->SetMax( m_pLeftMarginEdit->Normalize( nMax ), FUNIT_TWIP ); + m_pLeftMarginEdit->SetMax( m_pLeftMarginEdit->Normalize( nMax ), FieldUnit::TWIP ); // Right nMax = nPW - nML - MINBODY; - m_pRightMarginEdit->SetMax( m_pRightMarginEdit->Normalize( nMax ), FUNIT_TWIP ); + m_pRightMarginEdit->SetMax( m_pRightMarginEdit->Normalize( nMax ), FieldUnit::TWIP ); //Top nMax = nPH - nMB - MINBODY; - m_pTopMarginEdit->SetMax( m_pTopMarginEdit->Normalize( nMax ), FUNIT_TWIP ); + m_pTopMarginEdit->SetMax( m_pTopMarginEdit->Normalize( nMax ), FieldUnit::TWIP ); //Bottom nMax = nPH - nMT - MINBODY; - m_pBottomMarginEdit->SetMax( m_pTopMarginEdit->Normalize( nMax ), FUNIT_TWIP ); + m_pBottomMarginEdit->SetMax( m_pTopMarginEdit->Normalize( nMax ), FieldUnit::TWIP ); } void PageMarginControl::FillHelpText( const bool bUserCustomValuesAvailable ) diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx index eb189fa7935a..f95dd0769462 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -40,7 +40,7 @@ namespace { FieldUnit lcl_GetFieldUnit() { - FieldUnit eUnit = FUNIT_INCH; + FieldUnit eUnit = FieldUnit::INCH; const SfxPoolItem* pItem = nullptr; SfxItemState eState = SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_METRIC, pItem ); if ( pItem && eState >= SfxItemState::DEFAULT ) @@ -74,7 +74,7 @@ PageSizeControl::PageSizeControl( sal_uInt16 nId, vcl::Window* pParent ) mpSizeValueSet = VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( maContainer.get(), WB_BORDER ); maWidthHeightField = VclPtr<MetricField>::Create( maContainer.get(), 0 ); maWidthHeightField->Hide(); - maWidthHeightField->SetUnit(FUNIT_CM); + maWidthHeightField->SetUnit(FieldUnit::CM); maWidthHeightField->SetMax(9999); maWidthHeightField->SetDecimalDigits(2); maWidthHeightField->SetSpinSize(10); @@ -140,14 +140,14 @@ PageSizeControl::PageSizeControl( sal_uInt16 nId, vcl::Window* pParent ) Swap( aPaperSize ); } - maWidthHeightField->SetValue( maWidthHeightField->Normalize( aPaperSize.Width() ), FUNIT_TWIP ); + maWidthHeightField->SetValue( maWidthHeightField->Normalize( aPaperSize.Width() ), FieldUnit::TWIP ); aWidthStr = localeDataWrapper.getNum( maWidthHeightField->GetValue(), maWidthHeightField->GetDecimalDigits(), maWidthHeightField->IsUseThousandSep(), maWidthHeightField->IsShowTrailingZeros() ); - maWidthHeightField->SetValue( maWidthHeightField->Normalize( aPaperSize.Height() ), FUNIT_TWIP); + maWidthHeightField->SetValue( maWidthHeightField->Normalize( aPaperSize.Height() ), FieldUnit::TWIP); aHeightStr = localeDataWrapper.getNum( maWidthHeightField->GetValue(), maWidthHeightField->GetDecimalDigits(), |