diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-04-20 16:25:35 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-04-27 14:00:40 +0200 |
commit | cecf256f369b6f149dd53637a20bceca1ed15906 (patch) | |
tree | c4e9477fbf20c870f552dc8014560c90f0c0ef1d /sw | |
parent | fa772f7fdb4c3ec40b63d5221ca9778be6abdcb6 (diff) |
sal_uInt16: constify and simplify
Change-Id: I120c19a4fd5bccc3d2d070cc0d52d5155fa5a037
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/chrdlg/numpara.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
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 |