diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-03-26 22:14:29 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-03-30 16:37:44 +0200 |
commit | 55b4c22d5ba86e8fc2082af4f04ba434c06eef1a (patch) | |
tree | bf7db4e39118dd25aaee2993195edecdd5ddc79e /sw/source/ui/index/cntex.cxx | |
parent | 4a387e155f9bf8f5796ee73231e304546ffe9730 (diff) |
sal_uInt16: to sal_Int32 and rework initialization
Change-Id: Ifd5d7a8fd792da9931995ae4982504b68afe8303
Diffstat (limited to 'sw/source/ui/index/cntex.cxx')
-rw-r--r-- | sw/source/ui/index/cntex.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 72ed20c9dcac..1b8d2f219cb9 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -224,10 +224,11 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( OUString sLevel; if(bOn) sLevel = rDesc.GetStyleNames(i); - sal_uInt16 nStyles = comphelper::string::getTokenCount(sLevel, TOX_STYLE_DELIMITER); + const sal_Int32 nStyles = + comphelper::string::getTokenCount(sLevel, TOX_STYLE_DELIMITER); uno::Sequence<OUString> aStyles(nStyles); OUString* pArr = aStyles.getArray(); - for(sal_uInt16 nStyle = 0; nStyle < nStyles; nStyle++) + for(sal_Int32 nStyle = 0; nStyle < nStyles; nStyle++) pArr[nStyle] = sLevel.getToken(nStyle, TOX_STYLE_DELIMITER); uno::Any aAny(&aStyles, ::getCppuType((uno::Sequence<OUString>*)0)); xAcc->replaceByIndex(i, aAny); @@ -282,16 +283,9 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( { lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_IS_COMMA_SEPARATED, pForm->IsCommaSeparated()); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_USE_ALPHABETICAL_SEPARATORS, 0 != (nIdxOptions&nsSwTOIOptions::TOI_ALPHA_DELIMITTER)); - sal_uInt16 nStartLevel = USHRT_MAX; - sal_uInt16 nEndLevel = USHRT_MAX; - if(nCurrentLevel < pForm->GetFormMax()) - nStartLevel = nEndLevel = nCurrentLevel; - else - { - nStartLevel = 0; - nEndLevel = pForm->GetFormMax() - 1; - } - + const bool bUseCurrent = nCurrentLevel < pForm->GetFormMax(); + const sal_uInt16 nStartLevel = bUseCurrent ? nCurrentLevel : 0; + const sal_uInt16 nEndLevel = bUseCurrent ? nCurrentLevel : pForm->GetFormMax() - 1; if(xInfo->hasPropertyByName(UNO_NAME_LEVEL_FORMAT)) { for(sal_uInt16 nCurrLevel = nStartLevel; nCurrLevel <= nEndLevel; nCurrLevel++) |