tdf#169441 Decouple default list levels from bullet library items

First commit f944648e0f added
a new config to make bullet library items configurable, then
commit 626357f53c switched
from using the set of three default list bullets to bullet
library items.
The configs are DefaultBullets and DefaultBulletsFonts.

The problem is that the bullet library was never meant to
correspond to the default list, and a bulleted list looks
silly now. Let's introduce new configs for the list, with
the old defaults:
DefaultListBullets / DefaultListBulletsFonts

Once reaching the end with increasing levels, the list
wraps around.

Change-Id: I91f6a06e3c298edcfd0d11a3597c23129e0b085d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197014
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
Aron Budea
2026-01-12 13:24:47 +01:00
committed by Miklos Vajna
parent fa8e80f065
commit 3c12bd0f08
2 changed files with 34 additions and 6 deletions
@@ -3378,7 +3378,7 @@
</info>
<prop oor:name="DefaultBullets" oor:type="oor:string-list" oor:nillable="false">
<info>
<desc>List of default bullets</desc>
<desc>List of default bullets in bullet library</desc>
</info>
<value>
<it>●</it>
@@ -3393,7 +3393,7 @@
</prop>
<prop oor:name="DefaultBulletsFonts" oor:type="oor:string-list" oor:nillable="false">
<info>
<desc>List of default bullet fonts. Matching font for `DefaultBullets`.</desc>
<desc>List of default bullet fonts in bullet library. Matching font for `DefaultBullets`.</desc>
</info>
<value>
<it>OpenSymbol</it>
@@ -3406,6 +3406,26 @@
<it>OpenSymbol</it>
</value>
</prop>
<prop oor:name="DefaultListBullets" oor:type="oor:string-list" oor:nillable="false">
<info>
<desc>List of default bullets in unordered list</desc>
</info>
<value>
<it>•</it>
<it>◦</it>
<it>▪</it>
</value>
</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>
</info>
<value>
<it>OpenSymbol</it>
<it>OpenSymbol</it>
<it>OpenSymbol</it>
</value>
</prop>
</group>
<group oor:name="Help">
<info>
+12 -4
View File
@@ -1707,13 +1707,21 @@ void SwWrtShell::NumOrBulletOn(bool bNum)
if (! bNum)
{
uno::Sequence<OUString> aBulletSymbols(
officecfg::Office::Common::BulletsNumbering::DefaultBullets::get());
officecfg::Office::Common::BulletsNumbering::DefaultListBullets::get());
uno::Sequence<OUString> aBulletSymbolsFonts(
officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::get());
sal_Int32 nBulletSymbolIndex = nLvl < aBulletSymbols.getLength() ? nLvl : 0;
officecfg::Office::Common::BulletsNumbering::DefaultListBulletsFonts::get());
if (!aBulletSymbols.hasElements())
{
// 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";
}
sal_Int32 nBulletSymbolIndex = nLvl % aBulletSymbols.getLength();
aFormat.SetBulletChar(aBulletSymbols[nBulletSymbolIndex].toChar());
vcl::Font aFont;
sal_Int32 nBulletSymbolsFontIndex = nLvl < aBulletSymbolsFonts.getLength() ? nLvl : 0;
sal_Int32 nBulletSymbolsFontIndex = nLvl % aBulletSymbolsFonts.getLength();
aFont.SetFamilyName(aBulletSymbolsFonts[nBulletSymbolsFontIndex]);
aFormat.SetBulletFont(&aFont);
aFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);