From cecf256f369b6f149dd53637a20bceca1ed15906 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Sun, 20 Apr 2014 16:25:35 +0200 Subject: sal_uInt16: constify and simplify Change-Id: I120c19a4fd5bccc3d2d070cc0d52d5155fa5a037 --- sw/source/ui/chrdlg/numpara.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'sw') diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 87c7829d341b..c5ec3a94ff48 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -75,7 +75,7 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent, const SfxItemSet& ( 0 != ( pObjSh = SfxObjectShell::Current()) && 0 != (pItem = pObjSh->GetItem(SID_HTML_MODE)))) { - sal_uInt16 nHtmlMode = ((const SfxUInt16Item*)pItem)->GetValue(); + const sal_uInt16 nHtmlMode = ((const SfxUInt16Item*)pItem)->GetValue(); if (HTMLMODE_ON & nHtmlMode) m_pCountParaFram->Hide(); @@ -107,7 +107,7 @@ bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet ) { if( m_pOutlineLvLB->GetSelectEntryPos() != m_pOutlineLvLB->GetSavedValue()) { - sal_uInt16 aOutlineLv = m_pOutlineLvLB->GetSelectEntryPos(); + const sal_uInt16 aOutlineLv = m_pOutlineLvLB->GetSelectEntryPos(); const SfxUInt16Item* pOldOutlineLv = (const SfxUInt16Item*)GetOldItem( rSet, SID_ATTR_PARA_OUTLINE_LEVEL); SfxUInt16Item* pOutlineLv = (SfxUInt16Item*)pOldOutlineLv->Clone(); pOutlineLv->SetValue( aOutlineLv ); @@ -221,12 +221,10 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet ) eItemState = rSet.GetItemState( FN_NUMBER_NEWSTART_AT); if( eItemState > SFX_ITEM_AVAILABLE ) { - sal_uInt16 nNewStart = ((const SfxUInt16Item&)rSet.Get(FN_NUMBER_NEWSTART_AT)).GetValue(); - m_pNewStartNumberCB->Check(USHRT_MAX != nNewStart); - if(USHRT_MAX == nNewStart) - nNewStart = 1; - - m_pNewStartNF->SetValue(nNewStart); + const sal_uInt16 nNewStart = ((const SfxUInt16Item&)rSet.Get(FN_NUMBER_NEWSTART_AT)).GetValue(); + const bool bNotMax = USHRT_MAX != nNewStart; + m_pNewStartNumberCB->Check(bNotMax); + m_pNewStartNF->SetValue(bNotMax ? nNewStart : 1); m_pNewStartNumberCB->EnableTriState(false); } else -- cgit