From 9cb57a50d7eeaa1dda19d18bcb3cde7e4a7984e5 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 7 Mar 2017 11:19:35 +0200 Subject: convert SvxAdjust to scoped enum Change-Id: I0df7a5313d6d62d0c657e62ef6014a3ddbab4639 Reviewed-on: https://gerrit.libreoffice.org/34941 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/tabpages/numpages.cxx | 20 ++++++++--------- cui/source/tabpages/paragrph.cxx | 48 ++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 34 deletions(-) (limited to 'cui/source/tabpages') diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 7ebc6d171d29..edd9a15056b4 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -1583,9 +1583,9 @@ void SvxNumOptionsTabPage::InitControls() if(bSameAdjust) { sal_Int32 nPos = 1; // centered - if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT) + if(aNumFmtArr[nLvl]->GetNumAdjust() == SvxAdjust::Left) nPos = 0; - else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT) + else if(aNumFmtArr[nLvl]->GetNumAdjust() == SvxAdjust::Right) nPos = 2; m_pAlignLB->SelectEntryPos(nPos); } @@ -2265,11 +2265,11 @@ void SvxNumOptionsTabPage::EditModifyHdl_Impl( Edit* pEdit ) else //align { sal_Int32 nPos = m_pAlignLB->GetSelectEntryPos(); - SvxAdjust eAdjust = SVX_ADJUST_CENTER; + SvxAdjust eAdjust = SvxAdjust::Center; if(nPos == 0) - eAdjust = SVX_ADJUST_LEFT; + eAdjust = SvxAdjust::Left; else if(nPos == 2) - eAdjust = SVX_ADJUST_RIGHT; + eAdjust = SvxAdjust::Right; aNumFmt.SetNumAdjust( eAdjust ); } pActNum->SetLevel(i, aNumFmt); @@ -2898,9 +2898,9 @@ void SvxNumPositionTabPage::InitControls() if(bSameAdjust) { sal_Int32 nPos = 1; // centered - if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT) + if(aNumFmtArr[nLvl]->GetNumAdjust() == SvxAdjust::Left) nPos = 0; - else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT) + else if(aNumFmtArr[nLvl]->GetNumAdjust() == SvxAdjust::Right) nPos = 2; m_pAlignLB->SelectEntryPos(nPos); m_pAlign2LB->SelectEntryPos( nPos ); @@ -3207,11 +3207,11 @@ IMPL_LINK_NOARG(SvxNumPositionTabPage, EditModifyHdl_Impl, ListBox&, void) const sal_Int32 nPos = m_pAlignLB->IsVisible() ? m_pAlignLB->GetSelectEntryPos() : m_pAlign2LB->GetSelectEntryPos(); - SvxAdjust eAdjust = SVX_ADJUST_CENTER; + SvxAdjust eAdjust = SvxAdjust::Center; if(nPos == 0) - eAdjust = SVX_ADJUST_LEFT; + eAdjust = SvxAdjust::Left; else if(nPos == 2) - eAdjust = SVX_ADJUST_RIGHT; + eAdjust = SvxAdjust::Right; aNumFmt.SetNumAdjust( eAdjust ); pActNum->SetLevel(i, aNumFmt); } diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 5a3e94cf758f..63876219713c 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -1093,29 +1093,29 @@ bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet ) bool bModified = false; bool bAdj = false, bChecked = false; - SvxAdjust eAdjust = SVX_ADJUST_LEFT; + SvxAdjust eAdjust = SvxAdjust::Left; if ( m_pLeft->IsChecked() ) { - eAdjust = SVX_ADJUST_LEFT; + eAdjust = SvxAdjust::Left; bAdj = !m_pLeft->GetSavedValue(); bChecked = true; } else if ( m_pRight->IsChecked() ) { - eAdjust = SVX_ADJUST_RIGHT; + eAdjust = SvxAdjust::Right; bAdj = !m_pRight->GetSavedValue(); bChecked = true; } else if ( m_pCenter->IsChecked() ) { - eAdjust = SVX_ADJUST_CENTER; + eAdjust = SvxAdjust::Center; bAdj = !m_pCenter->GetSavedValue(); bChecked = true; } else if ( m_pJustify->IsChecked() ) { - eAdjust = SVX_ADJUST_BLOCK; + eAdjust = SvxAdjust::Block; bAdj = !m_pJustify->GetSavedValue() || m_pExpandCB->IsValueChangedFromSaved() || m_pLastLineLB->IsValueChangedFromSaved(); @@ -1127,15 +1127,15 @@ bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet ) { const SvxAdjustItem* pOld = static_cast(GetOldItem( *rOutSet, SID_ATTR_PARA_ADJUST )); - SvxAdjust eOneWord = m_pExpandCB->IsChecked() ? SVX_ADJUST_BLOCK : SVX_ADJUST_LEFT; + SvxAdjust eOneWord = m_pExpandCB->IsChecked() ? SvxAdjust::Block : SvxAdjust::Left; sal_Int32 nLBPos = m_pLastLineLB->GetSelectEntryPos(); - SvxAdjust eLastBlock = SVX_ADJUST_LEFT; + SvxAdjust eLastBlock = SvxAdjust::Left; if ( 1 == nLBPos ) - eLastBlock = SVX_ADJUST_CENTER; + eLastBlock = SvxAdjust::Center; else if ( 2 == nLBPos ) - eLastBlock = SVX_ADJUST_BLOCK; + eLastBlock = SvxAdjust::Block; bool bNothingWasChecked = !m_pLeft->GetSavedValue() && !m_pRight->GetSavedValue() && @@ -1190,13 +1190,13 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet ) switch ( rAdj.GetAdjust() /*!!! ask VB rAdj.GetLastBlock()*/ ) { - case SVX_ADJUST_LEFT: m_pLeft->Check(); break; + case SvxAdjust::Left: m_pLeft->Check(); break; - case SVX_ADJUST_RIGHT: m_pRight->Check(); break; + case SvxAdjust::Right: m_pRight->Check(); break; - case SVX_ADJUST_CENTER: m_pCenter->Check(); break; + case SvxAdjust::Center: m_pCenter->Check(); break; - case SVX_ADJUST_BLOCK: m_pJustify->Check(); break; + case SvxAdjust::Block: m_pJustify->Check(); break; default: ; //prevent warning } bool bEnable = m_pJustify->IsChecked(); @@ -1205,15 +1205,15 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet ) switch(rAdj.GetLastBlock()) { - case SVX_ADJUST_LEFT: nLBSelect = 0; break; + case SvxAdjust::Left: nLBSelect = 0; break; - case SVX_ADJUST_CENTER: nLBSelect = 1; break; + case SvxAdjust::Center: nLBSelect = 1; break; - case SVX_ADJUST_BLOCK: nLBSelect = 2; break; + case SvxAdjust::Block: nLBSelect = 2; break; default: ; //prevent warning } m_pExpandCB->Enable(bEnable && nLBSelect == 2); - m_pExpandCB->Check(SVX_ADJUST_BLOCK == rAdj.GetOneWord()); + m_pExpandCB->Check(SvxAdjust::Block == rAdj.GetOneWord()); } else { @@ -1324,20 +1324,20 @@ IMPL_LINK_NOARG(SvxParaAlignTabPage, TextDirectionHdl_Impl, ListBox&, void) void SvxParaAlignTabPage::UpdateExample_Impl() { if ( m_pLeft->IsChecked() ) - m_pExampleWin->SetAdjust( SVX_ADJUST_LEFT ); + m_pExampleWin->SetAdjust( SvxAdjust::Left ); else if ( m_pRight->IsChecked() ) - m_pExampleWin->SetAdjust( SVX_ADJUST_RIGHT ); + m_pExampleWin->SetAdjust( SvxAdjust::Right ); else if ( m_pCenter->IsChecked() ) - m_pExampleWin->SetAdjust( SVX_ADJUST_CENTER ); + m_pExampleWin->SetAdjust( SvxAdjust::Center ); else if ( m_pJustify->IsChecked() ) { - m_pExampleWin->SetAdjust( SVX_ADJUST_BLOCK ); - SvxAdjust eLastBlock = SVX_ADJUST_LEFT; + m_pExampleWin->SetAdjust( SvxAdjust::Block ); + SvxAdjust eLastBlock = SvxAdjust::Left; sal_Int32 nLBPos = m_pLastLineLB->GetSelectEntryPos(); if(nLBPos == 1) - eLastBlock = SVX_ADJUST_CENTER; + eLastBlock = SvxAdjust::Center; else if(nLBPos == 2) - eLastBlock = SVX_ADJUST_BLOCK; + eLastBlock = SvxAdjust::Block; m_pExampleWin->SetLastLine( eLastBlock ); } -- cgit