[Libreoffice-commits] core.git: sw/qa sw/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 28 19:01:52 UTC 2021


 sw/qa/extras/ww8export/data/tdf75748_inheritChapterNumberingC.doc |binary
 sw/qa/extras/ww8export/ww8export3.cxx                             |    6 ++++++
 sw/source/filter/ww8/ww8par.cxx                                   |    6 +++---
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit e5ac6caf9efa3d3a8cb82dbc59ef00b193facdc4
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Sat Jun 26 19:14:17 2021 +0200
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Mon Jun 28 21:01:18 2021 +0200

    tdf#104239 doc import: fix chose m_pChosenWW8OutlineStyle carefully
    
    I mis-placed the cancel test.
    In the previous place, that only worked if the FIRST instance
    of the style was bad. My intention was to prevent if ANY
    use of the numbering style could cause problems.
    
    tdf#75748 had the document I had been developing the fix for.
    
    Change-Id: I75286b943b7fca56ea43f79a49d68a351f6d0e24
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117966
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ww8export/data/tdf75748_inheritChapterNumberingC.doc b/sw/qa/extras/ww8export/data/tdf75748_inheritChapterNumberingC.doc
new file mode 100644
index 000000000000..7f393612cab7
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf75748_inheritChapterNumberingC.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index abbf414dc01d..9ccf3ea19a31 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -822,6 +822,12 @@ DECLARE_WW8EXPORT_TEST(testTdf106541_inheritChapterNumberingB, "tdf106541_inheri
     CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(xPara, "ListLabelString"));
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf75748_inheritChapterNumberingC, "tdf75748_inheritChapterNumberingC.doc")
+{
+    uno::Reference<beans::XPropertySet> xPara(getParagraph(5, "Inherited from Heading 3"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("II.B.1."), getProperty<OUString>(xPara, "ListLabelString"));
+}
+
 DECLARE_WW8EXPORT_TEST(testTdf104239_chapterNumberTortureTest, "tdf104239_chapterNumberTortureTest.doc")
 {
     // There is no point in identifying what the wrong values where in this test,
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 04b53252d49d..ede4943fdc10 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5981,9 +5981,6 @@ void SwWW8ImplReader::SetOutlineStyles()
             const SwNumRule* pWW8ListStyle = rSI.GetOutlineNumrule();
             if (pWW8ListStyle != nullptr)
             {
-                if (aPreventUseAsChapterNumbering[pWW8ListStyle])
-                    continue;
-
                 std::map<const SwNumRule*, int>::iterator aCountIter
                     = aWW8ListStyleCounts.find(pWW8ListStyle);
                 if (aCountIter == aWW8ListStyleCounts.end())
@@ -6000,6 +5997,9 @@ void SwWW8ImplReader::SetOutlineStyles()
         int nCurrentMaxCount = 0;
         for (const auto& rEntry : aWW8ListStyleCounts)
         {
+            if (aPreventUseAsChapterNumbering[rEntry.first])
+                continue;
+
             if (rEntry.second > nCurrentMaxCount)
             {
                 nCurrentMaxCount = rEntry.second;


More information about the Libreoffice-commits mailing list