officecfg/registry/schema/org/openoffice/Office/Common.xcs | 4 +-- sw/source/uibase/wrtsh/wrtsh1.cxx | 16 ++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-)
New commits: commit 02796c7467903d10e9cc38fc50acce4994537b7a Author: Aron Budea <[email protected]> AuthorDate: Tue Jan 20 03:25:07 2026 +1030 Commit: Aron Budea <[email protected]> CommitDate: Thu Jan 22 11:46:19 2026 +0100 Related: tdf#169441 Improve description and handling of mismatching config Use default bullet font if DefaultListBulletsFonts is shorter than DefaultListBullets. Change-Id: Ie83c111bfb1be88f3ac3dfd7c0323ac92c21cba4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197625 Tested-by: Jenkins Tested-by: Aron Budea <[email protected]> Reviewed-by: Aron Budea <[email protected]> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index f9857f2fc550..e2506f843218 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -3408,7 +3408,7 @@ </prop> <prop oor:name="DefaultListBullets" oor:type="oor:string-list" oor:nillable="false"> <info> - <desc>List of default bullets in unordered list</desc> + <desc>List of default bullet sequence when unordered list is toggled in Writer</desc> </info> <value> <it>•</it> @@ -3418,7 +3418,7 @@ </prop> <prop oor:name="DefaultListBulletsFonts" oor:type="oor:string-list" oor:nillable="false"> <info> - <desc>List of default bullet fonts in unordered list. Matching font for `DefaultListBullets`.</desc> + <desc>List of default bullet fonts in unordered list. Matching font for 'DefaultListBullets'.</desc> </info> <value> <it>OpenSymbol</it> diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index abb064a84c42..bbfb85dd7ae4 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1706,23 +1706,27 @@ void SwWrtShell::NumOrBulletOn(bool bNum) if (! bNum) { + static constexpr OUString sDefaultBulletSymbol = u"•"_ustr; + static constexpr OUString sDefaultBulletSymbolFont = u"OpenSymbol"_ustr; uno::Sequence<OUString> aBulletSymbols( officecfg::Office::Common::BulletsNumbering::DefaultListBullets::get()); uno::Sequence<OUString> aBulletSymbolsFonts( officecfg::Office::Common::BulletsNumbering::DefaultListBulletsFonts::get()); if (!aBulletSymbols.hasElements()) { + SAL_WARN("sw", "empty DefaultListBullets config, adding a default single bullet"); // Add a single element even if user cleared the list in the config aBulletSymbols.realloc(1); - aBulletSymbols.getArray()[0] = u"•"_ustr; - aBulletSymbolsFonts.realloc(1); - aBulletSymbolsFonts.getArray()[0] = "OpenSymbol"; + aBulletSymbols.getArray()[0] = sDefaultBulletSymbol; } - sal_Int32 nBulletSymbolIndex = nLvl % aBulletSymbols.getLength(); + const sal_Int32 nBulletSymbolIndex = nLvl % aBulletSymbols.getLength(); aFormat.SetBulletChar(aBulletSymbols[nBulletSymbolIndex].toChar()); vcl::Font aFont; - sal_Int32 nBulletSymbolsFontIndex = nLvl % aBulletSymbolsFonts.getLength(); - aFont.SetFamilyName(aBulletSymbolsFonts[nBulletSymbolsFontIndex]); + // Symbol and font correspond to each other, use same index + if (nBulletSymbolIndex < aBulletSymbolsFonts.getLength()) + aFont.SetFamilyName(aBulletSymbolsFonts[nBulletSymbolIndex]); + else + aFont.SetFamilyName(sDefaultBulletSymbolFont); aFormat.SetBulletFont(&aFont); aFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL); // #i93908# clear suffix for bullet lists
