diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2021-06-14 14:27:56 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-06-29 19:02:20 +0200 |
commit | 9987b518fca1476bd0ce8c86bcf6ac7c81f7b580 (patch) | |
tree | 3aa1af29be70b24bc96951a310f3379a621a54b1 /sw | |
parent | d8dcd706c74b4a0fa420946c707137b097b3c7fe (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 'sw')
-rw-r--r-- | sw/qa/extras/odfexport/data/listformat.docx | bin | 0 -> 13082 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/data/listformat.odt | bin | 0 -> 9221 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport2.cxx | 66 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 8 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export2.cxx | 18 | ||||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 6 | ||||
-rw-r--r-- | sw/qa/python/check_cross_references.py | 21 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8num.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/outline.cxx | 4 |
13 files changed, 99 insertions, 48 deletions
diff --git a/sw/qa/extras/odfexport/data/listformat.docx b/sw/qa/extras/odfexport/data/listformat.docx Binary files differnew file mode 100644 index 000000000000..338678d82d3f --- /dev/null +++ b/sw/qa/extras/odfexport/data/listformat.docx diff --git a/sw/qa/extras/odfexport/data/listformat.odt b/sw/qa/extras/odfexport/data/listformat.odt Binary files differnew file mode 100644 index 000000000000..ec3992c8fde9 --- /dev/null +++ b/sw/qa/extras/odfexport/data/listformat.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 4f6e3b21c2e0..83a5b0cafbe3 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -2697,7 +2697,7 @@ DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt") const char* aFieldTexts[] = { "A 2", "Az Isten", "Az 50-esek", "A 2018-asok", "Az egyebek", "A fejezetek", reinterpret_cast<char const *>(u8"Az „Őseinket...”"), "a 2", - "Az v", "az 1", "Az e", "az 1", + "Az v.", "az 1", "Az e)", "az 1", "Az (5)", "az 1", "A 2", "az 1" }; uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); // update "A (4)" to "Az (5)" diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index b58e9e9a1d1a..bbe5d7f193e7 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -50,6 +50,72 @@ DECLARE_ODFEXPORT_TEST(testTdf137199, "tdf137199.docx") CPPUNIT_ASSERT_EQUAL(OUString("HELLO2WORLD!"), getProperty<OUString>(getParagraph(4), "ListLabelString")); } +DECLARE_ODFEXPORT_TEST(testListFormatDocx, "listformat.docx") +{ + // Ensure in resulting ODT we also have not just prefix/suffux, but custom delimiters + CPPUNIT_ASSERT_EQUAL(OUString(">1<"), getProperty<OUString>(getParagraph(1), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(">>1/1<<"), getProperty<OUString>(getParagraph(2), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(">>1/1/1<<"), getProperty<OUString>(getParagraph(3), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(">>1/1/2<<"), getProperty<OUString>(getParagraph(4), "ListLabelString")); + + // Check also that in numbering styles we have num-list-format defined + xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"); + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='1']", "num-list-format", ">%1%<"); + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='2']", "num-list-format", ">>%1%/%2%<<"); + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='3']", "num-list-format", ">>%1%/%2%/%3%<<"); + + // But for compatibility there are still prefix/suffix + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='1']", "num-prefix", ">"); + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='1']", "num-suffix", "<"); + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='2']", "num-prefix", ">>"); + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='2']", "num-suffix", "<<"); + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='3']", "num-prefix", ">>"); + assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/" + "text:list-level-style-number[@text:level='3']", "num-suffix", "<<"); +} + +DECLARE_ODFEXPORT_TEST(testListFormatOdt, "listformat.odt") +{ + // Ensure in resulting ODT we also have not just prefix/suffux, but custom delimiters + CPPUNIT_ASSERT_EQUAL(OUString(">1<"), getProperty<OUString>(getParagraph(1), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(">>1.1<<"), getProperty<OUString>(getParagraph(2), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(">>1.1.1<<"), getProperty<OUString>(getParagraph(3), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(">>1.1.2<<"), getProperty<OUString>(getParagraph(4), "ListLabelString")); + + if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) + { + // Check how conversion from prefix/suffix to list format did work + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='1']", "num-list-format", ">%1%<"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='2']", "num-list-format", ">>%1%.%2%<<"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='3']", "num-list-format", ">>%1%.%2%.%3%<<"); + + // But for compatibility there are still prefix/suffix as they were before + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='1']", "num-prefix", ">"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='1']", "num-suffix", "<"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='2']", "num-prefix", ">>"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='2']", "num-suffix", "<<"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='3']", "num-prefix", ">>"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/" + "text:list-level-style-number[@text:level='3']", "num-suffix", "<<"); + } +} + // This test started in LO 7.2. Use the odfexport.cxx if you intend to backport to 7.1. CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index d309e3577b80..e383984c1170 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -1070,12 +1070,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120394, "tdf120394.docx") { uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); - CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(xPara, "ListLabelString")); } { uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); - CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(xPara, "ListLabelString")); } { uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); @@ -1090,7 +1090,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133605, "tdf133605.docx") { uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); - CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(xPara, "ListLabelString")); } { uno::Reference<beans::XPropertySet> xPara(getParagraph(4), uno::UNO_QUERY); @@ -1116,7 +1116,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133605_2, "tdf133605_2.docx") { uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); - CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(xPara, "ListLabelString")); } { uno::Reference<beans::XPropertySet> xPara(getParagraph(4), uno::UNO_QUERY); diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 75c4382324e5..714aa8f468b1 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -672,7 +672,7 @@ DECLARE_RTFEXPORT_TEST(testFdo66682, "fdo66682.rtf") aListFormat = rProp.Value.get<OUString>(); } // Suffix was '\0' instead of ' '. - CPPUNIT_ASSERT_EQUAL(OUString(" %1 "), aListFormat); + CPPUNIT_ASSERT_EQUAL(OUString(" %1% "), aListFormat); } DECLARE_RTFEXPORT_TEST(testParaShadow, "para-shadow.rtf") diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index a1f8fe239d7a..3dc101b6f626 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -387,19 +387,11 @@ DECLARE_WW8EXPORT_TEST(testTdf119232_startEvenPage, "tdf119232_startEvenPage.doc DECLARE_WW8EXPORT_TEST(testTdf104805, "tdf104805.doc") { - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WW8Num1"), uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> aNumberingRule; - xLevels->getByIndex(1) >>= aNumberingRule; // 2nd level - for (const auto& rPair : std::as_const(aNumberingRule)) - { - if (rPair.Name == "Prefix") - // This was "." instead of empty, so the second paragraph was - // rendered as ".1" instead of "1.". - CPPUNIT_ASSERT_EQUAL(OUString(), rPair.Value.get<OUString>()); - else if (rPair.Name == "Suffix") - CPPUNIT_ASSERT_EQUAL(OUString("."), rPair.Value.get<OUString>()); - } + // Prefix was "." instead of empty, so the second paragraph was + // rendered as ".1" instead of "1.". + // Unittest modified due to Prefix/Suffix support obsolete + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString")); } DECLARE_WW8EXPORT_TEST(testTdf104334, "tdf104334.doc") diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index ffdf64cf5f1c..8c523682281b 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -794,12 +794,12 @@ DECLARE_WW8EXPORT_TEST(testTdf120394, "tdf120394.doc") { uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); - CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(xPara, "ListLabelString")); } { uno::Reference<beans::XPropertySet> xPara(getParagraph(8), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); - CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(xPara, "ListLabelString")); } { uno::Reference<beans::XPropertySet> xPara(getParagraph(9), uno::UNO_QUERY); @@ -809,7 +809,7 @@ DECLARE_WW8EXPORT_TEST(testTdf120394, "tdf120394.doc") { uno::Reference<beans::XPropertySet> xPara(getParagraph(10), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); - CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(xPara, "ListLabelString")); } } diff --git a/sw/qa/python/check_cross_references.py b/sw/qa/python/check_cross_references.py index de51d919c7c8..3c9319200ea7 100644 --- a/sw/qa/python/check_cross_references.py +++ b/sw/qa/python/check_cross_references.py @@ -89,15 +89,16 @@ class CheckCrossReferences(unittest.TestCase): FieldResult1 = "*i*" FieldResult2 = "+b+*i*" FieldResult3 = "-1-+b+*i*" - FieldResult4 = "1" - FieldResult5 = "1" - FieldResult6 = "A.1" - FieldResult7 = "2(a)" - FieldResult8 = "2(b)" - FieldResult9 = "2" - FieldResult10 = "1(a)" + FieldResult4 = "1." + FieldResult5 = "1." + FieldResult6 = "A.1." + FieldResult7 = " 2.(a)" + FieldResult8 = " 2.(b)" + FieldResult9 = " 2." + FieldResult10 = " 1.(a)" FieldResult11 = "(b)" FieldResult12 = "(a)" + FieldResult13 = " 1." # variables for current field xField = self.getNextField() @@ -155,9 +156,9 @@ class CheckCrossReferences(unittest.TestCase): xField = self.getNextField() xProps = self.getFieldProps(xField) - self.checkField(xField, xProps, NUMBER, FieldResult4) - self.checkField(xField, xProps, NUMBER_NO_CONTEXT, FieldResult4) - self.checkField(xField, xProps, NUMBER_FULL_CONTEXT, FieldResult4) + self.checkField(xField, xProps, NUMBER, FieldResult13) + self.checkField(xField, xProps, NUMBER_NO_CONTEXT, FieldResult13) + self.checkField(xField, xProps, NUMBER_FULL_CONTEXT, FieldResult13) xField = self.getNextField() xProps = self.getFieldProps(xField) diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 00eeed63ec70..c545448cf90c 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -388,8 +388,8 @@ SwNumRule::SwNumRule( const OUString& rNm, pFormat->SetStart( 1 ); pFormat->SetAbsLSpace( lNumberIndent + SwNumRule::GetNumIndent( n ) ); pFormat->SetFirstLineOffset( lNumberFirstLineOffset ); - pFormat->SetSuffix( "." ); - pFormat->SetBulletChar( numfunc::GetBulletChar(n)); + pFormat->SetListFormat("%" + OUString::number(n + 1) + "%."); + pFormat->SetBulletChar(numfunc::GetBulletChar(n)); SwNumRule::saBaseFormats[ NUM_RULE ][ n ] = pFormat; } // position-and-space mode LABEL_ALIGNMENT @@ -411,7 +411,7 @@ SwNumRule::SwNumRule( const OUString& rNm, pFormat->SetListtabPos( cIndentAt[ n ] ); pFormat->SetFirstLineIndent( cFirstLineIndent ); pFormat->SetIndentAt( cIndentAt[ n ] ); - pFormat->SetSuffix( "." ); + pFormat->SetListFormat( "%" + OUString::number(n + 1) + "%."); pFormat->SetBulletChar( numfunc::GetBulletChar(n)); SwNumRule::saLabelAlignmentBaseFormats[ NUM_RULE ][ n ] = pFormat; } @@ -682,18 +682,12 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto else sReplacement = "0"; // all 0 level are a 0 - OUString sFind("%" + OUString::number(i + 1)); + OUString sFind("%" + OUString::number(i + 1) + "%"); sal_Int32 nPosition = sLevelFormat.indexOf(sFind); if (nPosition >= 0) sLevelFormat = sLevelFormat.replaceAt(nPosition, sFind.getLength(), sReplacement); } - // As a fallback: caller code expects nonempty string as a result. - // But if we have empty string (and had no errors before) this is valid result. - // So use classical hack with zero-width-space as a string filling. - if (sLevelFormat.isEmpty()) - sLevelFormat = OUStringChar(CHAR_ZWSP); - aStr = sLevelFormat; } else diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 6cb95976c655..1f77b6d41d34 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -519,7 +519,7 @@ void MSWordExportBase::NumberingLevel( sal_Int32 nFnd = sNumStr.indexOf(sSrch); if (-1 != nFnd) { - *pLvlPos = static_cast<sal_uInt8>(nFnd + rFormat.GetPrefix().getLength() + 1); + *pLvlPos = static_cast<sal_uInt8>(nFnd + 1); ++pLvlPos; sNumStr = sNumStr.replaceAt(nFnd, 1, OUString(static_cast<char>(i))); } diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 02dd2f139d0b..815a6261fefd 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -884,7 +884,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet } else { - // Replace symbols at aOfsNumsXCH offsets to %1, %2 as supported by DOCX and LO + // Replace symbols at aOfsNumsXCH offsets to %1%, %2% as supported by LO OUString sListFormat = sNumString; if (sListFormat.getLength()) { @@ -902,7 +902,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet } sal_uInt8 nReplacement = sListFormat[nOffset] + 1; - OUString sReplacement("%" + OUString::number(nReplacement)); + OUString sReplacement("%" + OUString::number(nReplacement) + "%"); sListFormat = sListFormat.replaceAt(nOffset, 1, sReplacement); // We need also update an offset, since we are replacing one symbol by at least two diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index f01b6386901e..ebac78812a6c 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -648,9 +648,7 @@ IMPL_LINK_NOARG(SwOutlineSettingsTabPage, DelimModify, weld::Entry&, void) if(nActLevel & nMask) { SwNumFormat aNumFormat(pNumRule->Get(i)); - aNumFormat.SetPrefix( m_xPrefixED->get_text() ); - aNumFormat.SetSuffix( m_xSuffixED->get_text() ); - aNumFormat.SetListFormat(); // clear custom format + aNumFormat.SetListFormat( m_xPrefixED->get_text(), m_xSuffixED->get_text(), i ); pNumRule->Set(i, aNumFormat); } nMask <<= 1; |