summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2021-06-14 14:27:56 +0300
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-06-29 19:02:20 +0200
commit9987b518fca1476bd0ce8c86bcf6ac7c81f7b580 (patch)
tree3aa1af29be70b24bc96951a310f3379a621a54b1 /sd
parentd8dcd706c74b4a0fa420946c707137b097b3c7fe (diff)
new ODF numbered list parameter loext:num-list-format
Instead of style:num-prefix and style:num-suffix new list format is much more flexible for storing list multilevel numberings. Now it is possible to have not just prefix/suffix but any random separators between levels, arbitrary levels order, etc. Internal LO format for list format is changed: instead of placeholders like %1, %2, etc we right now use %1%, %2%... Reason: for ODT documents, having more than 9 levels there is ambiguity in "%10": it is "%1" followed by "0" suffix, or "%10"? Aux changes: * removed zero width space hack: since format string is always defined this hack is interfering with standard list numbers printing (see changes in ooxmlexport14.cxx, ww8export3.cxx tests) * changed cross-references values to lists: they are now including full list label string: previously this was bit self-contradictory (see changes in odfexport.cxx and check_cross_references.py tests) Conflicts: sw/qa/extras/odfexport/odfexport.cxx Change-Id: I9696cc4846375c5f6222539aeaadbca5ae58ce27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117156 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118040 Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/BulletAndPositionDlg.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
index fb798956e4ef..fe6ecf9ee52a 100644
--- a/sd/source/ui/dlg/BulletAndPositionDlg.cxx
+++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
@@ -716,8 +716,7 @@ IMPL_LINK(SvxBulletAndPositionDlg, NumberTypeSelectHdl_Impl, weld::ComboBox&, rB
{
bBmp |= nullptr != aNumFmt.GetBrush();
aNumFmt.SetIncludeUpperLevels(0);
- aNumFmt.SetSuffix("");
- aNumFmt.SetPrefix("");
+ aNumFmt.SetListFormat("", "", i);
if (!bBmp)
aNumFmt.SetGraphic("");
pActNum->SetLevel(i, aNumFmt);
@@ -726,8 +725,7 @@ IMPL_LINK(SvxBulletAndPositionDlg, NumberTypeSelectHdl_Impl, weld::ComboBox&, rB
else if (SVX_NUM_CHAR_SPECIAL == nNumberingType)
{
aNumFmt.SetIncludeUpperLevels(0);
- aNumFmt.SetSuffix("");
- aNumFmt.SetPrefix("");
+ aNumFmt.SetListFormat("", "", i);
if (!aNumFmt.GetBulletFont())
aNumFmt.SetBulletFont(&aActBulletFont);
if (!aNumFmt.GetBulletChar())
@@ -738,8 +736,7 @@ IMPL_LINK(SvxBulletAndPositionDlg, NumberTypeSelectHdl_Impl, weld::ComboBox&, rB
}
else
{
- aNumFmt.SetPrefix(m_xPrefixED->get_text());
- aNumFmt.SetSuffix(m_xSuffixED->get_text());
+ aNumFmt.SetListFormat(m_xPrefixED->get_text(), m_xSuffixED->get_text(), i);
SwitchNumberType(SHOW_NUMBERING);
pActNum->SetLevel(i, aNumFmt);
CheckForStartValue_Impl(nNumberingType);
@@ -1233,8 +1230,7 @@ IMPL_LINK(SvxBulletAndPositionDlg, RelativeHdl_Impl, weld::Toggleable&, rBox, vo
void SvxBulletAndPositionDlg::EditModifyHdl_Impl(const weld::Entry* pEdit)
{
- bool bPrefix = pEdit == m_xPrefixED.get();
- bool bSuffix = pEdit == m_xSuffixED.get();
+ bool bPrefixOrSuffix = (pEdit == m_xPrefixED.get()) || (pEdit == m_xSuffixED.get());
bool bStart = pEdit == m_xStartED.get();
sal_uInt16 nMask = 1;
for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
@@ -1242,10 +1238,8 @@ void SvxBulletAndPositionDlg::EditModifyHdl_Impl(const weld::Entry* pEdit)
if (nActNumLvl & nMask)
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- if (bPrefix)
- aNumFmt.SetPrefix(m_xPrefixED->get_text());
- else if (bSuffix)
- aNumFmt.SetSuffix(m_xSuffixED->get_text());
+ if (bPrefixOrSuffix)
+ aNumFmt.SetListFormat(m_xPrefixED->get_text(), m_xSuffixED->get_text(), i);
else if (bStart)
aNumFmt.SetStart(m_xStartED->get_value());
pActNum->SetLevel(i, aNumFmt);