From afa675469cd9894f41a6b9eeb2e7acc8245d256c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 2 Mar 2017 14:24:47 +0200 Subject: use SvxExtNumType in SvxNumberType and follow the rabbit trail, fixing various other types in the process Change-Id: I8fc7df3b585df21578ffb28fdd7e5e427b3bfd9d Reviewed-on: https://gerrit.libreoffice.org/34814 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/inc/numpages.hxx | 5 +++-- cui/source/tabpages/numpages.cxx | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'cui') diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index afaaf1e61ba1..4894293ede51 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -65,14 +66,14 @@ class SvxNumberingPreview : public vcl::Window struct SvxNumSettings_Impl { - short nNumberType; + SvxExtNumType nNumberType; short nParentNumbering; OUString sPrefix; OUString sSuffix; OUString sBulletChar; OUString sBulletFont; SvxNumSettings_Impl() : - nNumberType(0), + nNumberType(SVX_NUM_CHARS_UPPER_LETTER), nParentNumbering(0) {} }; diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index df6aad67f5ae..679a5ff77f03 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -111,7 +111,11 @@ static SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const Sequence>= pNew->nNumberType; + { + sal_Int16 nTmp; + if (pValues[j].Value >>= nTmp) + pNew->nNumberType = (SvxExtNumType)nTmp; + } else if ( pValues[j].Name == "Prefix" ) pValues[j].Value >>= pNew->sPrefix; else if ( pValues[j].Name == "Suffix" ) @@ -326,7 +330,7 @@ IMPL_LINK_NOARG(SvxSingleNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void) if(aNumSettingsArr.size() <= nIdx) return; SvxNumSettings_Impl* _pSet = aNumSettingsArr[nIdx].get(); - sal_Int16 eNewType = _pSet->nNumberType; + SvxExtNumType eNewType = _pSet->nNumberType; const sal_Unicode cLocalPrefix = !_pSet->sPrefix.isEmpty() ? _pSet->sPrefix[0] : 0; const sal_Unicode cLocalSuffix = !_pSet->sSuffix.isEmpty() ? _pSet->sSuffix[0] : 0; @@ -945,7 +949,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, void) sal_uInt16 nIdx = m_pExamplesVS->GetSelectItemId() - 1; sal_uInt16 nMask = 1; - sal_uInt16 nSetNumberingType = SVX_NUM_BITMAP; + SvxExtNumType nSetNumberingType = SVX_NUM_BITMAP; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) { if(nActNumLvl & nMask) @@ -1780,8 +1784,8 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox&, rBox, void { SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); // PAGEDESC does not exist - sal_uInt16 nNumType = (sal_uInt16)reinterpret_cast(rBox.GetSelectEntryData()); - aNumFmt.SetNumberingType((sal_Int16)nNumType); + SvxExtNumType nNumType = (SvxExtNumType)reinterpret_cast(rBox.GetSelectEntryData()); + aNumFmt.SetNumberingType(nNumType); sal_uInt16 nNumberingType = aNumFmt.GetNumberingType(); if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN))) { -- cgit