diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2024-05-06 09:20:58 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2024-05-16 09:17:09 +0200 |
commit | c8a5dc46d11f2ef1e3a66d633730d9a700ced24a (patch) | |
tree | df9b1b9ad3572d536e9b981c4d3df4cfa61d6009 /svx/source/sidebar | |
parent | 28c64afa68f52fb847e9915cde108b856fa39987 (diff) |
tdf#161056 Show bullets used in document in bullets dropdown
Change-Id: I40cfc39501006146f7c6c04a1f3c7cf877c6f1c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167186
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'svx/source/sidebar')
-rw-r--r-- | svx/source/sidebar/nbdtmg.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index ed88addb88b2..14a27feaedbb 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -341,6 +341,30 @@ void BulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 } } +void BulletsTypeMgr::ApplyCustomRule(SvxNumRule& aNum, std::u16string_view sBullet, + std::u16string_view sFont, sal_uInt16 mLevel, bool isResetSize) +{ + sal_uInt16 nMask = 1; + OUString sBulletCharFormatName = GetBulletCharFmtName(); + const vcl::Font aFont(OUString(sFont), Size(1, 1)); + for (sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++) + { + if (mLevel & nMask) + { + SvxNumberFormat aFmt(aNum.GetLevel(i)); + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); + aFmt.SetBulletFont(&aFont); + aFmt.SetBulletChar(sBullet[0]); + aFmt.SetCharFormatName(sBulletCharFormatName); + aFmt.SetListFormat(""); + if (isResetSize) + aFmt.SetBulletRelSize(45); + aNum.SetLevel(i, aFmt); + } + nMask <<= 1; + } +} + OUString BulletsTypeMgr::GetDescription(sal_uInt16 /*nIndex*/, bool /*isDefault*/) { return OUString(); |