[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/qa sw/source

Gabor Kelemen (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 21 08:30:55 UTC 2021


 sw/qa/extras/ooxmlexport/data/Simple-TOC.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx   |    9 +++++++++
 sw/source/filter/ww8/styles.cxx              |    2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 50044ecd89ea039cad4017ea4ccecd79893534de
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Thu Aug 5 22:56:19 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Tue Sep 21 10:30:22 2021 +0200

    tdf143726 DOCX: export default TOC Header style with correct name
    
    This seems to have been a typo since it was mapped to the default
    name of the Table of Authorities index's heading in Word
    which is not really supported anyways.
    
    Change-Id: I4cadce18c30c5497f27479fcc251fdf85d859145
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120091
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 5440492ff9f949ee9ed9052e8bab6f5136d78b2a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122278
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>

diff --git a/sw/qa/extras/ooxmlexport/data/Simple-TOC.odt b/sw/qa/extras/ooxmlexport/data/Simple-TOC.odt
new file mode 100644
index 000000000000..475f59e051a9
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/Simple-TOC.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index bd8338315381..f5f10b40e0e3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -551,6 +551,15 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_ShadowDirection, "tdf142361ShadowDirect
                 "rotWithShape", "0");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf143726, "Simple-TOC.odt")
+{
+    xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
+    CPPUNIT_ASSERT(pXmlStyles);
+    // Without the fix this was "TOA Heading" which belongs to the "Table of Authorities" index in Word
+    // TOC's heading style should be exported as "TOC Heading" as that's the default Word style name
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='ContentsHeading']/w:name", "val", "TOC Heading");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/styles.cxx b/sw/source/filter/ww8/styles.cxx
index 4c8c9bc49555..6f613b40fad6 100644
--- a/sw/source/filter/ww8/styles.cxx
+++ b/sw/source/filter/ww8/styles.cxx
@@ -73,7 +73,7 @@ namespace
             "Endnote Text",
             "Table of Authorities",
             "Macro Text",
-            "TOA Heading",
+            "TOC Heading",
             "List",
             "List 2",
             "List 3",


More information about the Libreoffice-commits mailing list