summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-01-02 16:31:45 -0500
committerJustin Luth <jluth@mail.com>2023-01-05 22:51:35 +0000
commitdd8ed1fdbc63499ac958d28536c3c5540455358b (patch)
treef562ef20b6f32e497f8cd578c3e06b085b84c25c /cui
parent3ab8349a37215d8e355e79b93d66f631144e7c57 (diff)
tdf#56258 en_US: increase outline levels definitions to 6
There are 10 levels in numbering, so it only makes sense to allow outline definitions for all 10 levels. Note that DOC/X formats only allow 9 levels, There are two code paths that read these definitions. The SVX toolbar code to allow 10 levels (SVX_MAX_NUM) was already completed in the previous patch. This commit allows 10 levels for the Bullets and Numbering menu dialog. Since all choices MUST define the same number of levels, I only added one more. I hope that there isn't some secret kind of requirement that ALL LOCALE's must also use the same number of definitions - it doesn't seem to. [Although not a direct comparison, bg_BG defines 10 single number levels, compared to en_US's 8, and some Chinese locales also do more than 8.] Change-Id: Ibe00d54cfa4577db83eba368b92be11055b076ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144976 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/numpages.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 0c66f69ee637..6e27c26fdf99 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -509,11 +509,14 @@ SvxNumPickTabPage::SvxNumPickTabPage(weld::Container* pPage, weld::DialogControl
SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[ nItem ];
Reference<XIndexAccess> xLevel = aOutlineAccess.getConstArray()[nItem];
- for(sal_Int32 nLevel = 0; nLevel < xLevel->getCount() && nLevel < 5; nLevel++)
+ for(sal_Int32 nLevel = 0; nLevel < SVX_MAX_NUM; nLevel++)
{
- Any aValueAny = xLevel->getByIndex(nLevel);
+ // use the last locale-defined level for all remaining levels.
+ sal_Int32 nLocaleLevel = std::min(nLevel, xLevel->getCount() - 1);
Sequence<PropertyValue> aLevelProps;
- aValueAny >>= aLevelProps;
+ if (nLocaleLevel >= 0)
+ xLevel->getByIndex(nLocaleLevel) >>= aLevelProps;
+
SvxNumSettings_Impl* pNew = lcl_CreateNumSettingsPtr(aLevelProps);
rItemArr.push_back( std::unique_ptr<SvxNumSettings_Impl>(pNew) );
}