diff options
author | Gabor Kelemen <gabor.kelemen.extern@allotropia.de> | 2023-03-21 20:12:13 +0100 |
---|---|---|
committer | Gabor Kelemen <kelemeng@ubuntu.com> | 2023-03-22 20:05:09 +0000 |
commit | 667f5f87dee072f6737ee6b6491ed53b7cf154a7 (patch) | |
tree | 5cd7866f0d09e19ac360796f2b7228576806b84d | |
parent | 9b89ce887836742bb84bf57afa3b536b6c3bb1c1 (diff) |
tdf#153664 Export correct Table of Figures paragraph style
Change-Id: I892a0185a94aadd902e55ee9b719f855edbdfc89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149258
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/Table-of-Figures.odt | bin | 0 -> 9748 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 13 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/Table-of-Figures.odt b/sw/qa/extras/ooxmlexport/data/Table-of-Figures.odt Binary files differnew file mode 100644 index 000000000000..cd1502cf866f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/Table-of-Figures.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index b19c196016b2..20db0327ccef 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -632,6 +632,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148026) assertXPath(pXmlDoc, "//w:hyperlink", "tgtFrame", "_self"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf153664) +{ + loadAndReload("Table-of-Figures.odt"); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + CPPUNIT_ASSERT(pXmlStyles); + // Without the fix this was styleId='FigureIndex1' and name was "Figure Index 1" + // This led to syle settings being reset when ToF was updated in Word + // TOF's paragraph style should be exported as "Table of Figures" as that's the default Word style name + assertXPath(pXmlStyles, "/w:styles/w:style[12]", "styleId", "TableofFigures"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableofFigures']/w:name", "val", "Table of Figures"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 1d556fc312b8..8e0bcdde91a1 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -268,7 +268,7 @@ sal_uInt16 MSWordStyles::GetWWId( const SwFormat& rFormat ) case RES_POOLCOLL_FOOTER: nRet = ww::stiFooter; break; case RES_POOLCOLL_TOX_IDXH: nRet = ww::stiIndexHeading; break; case RES_POOLCOLL_LABEL: nRet = ww::stiCaption; break; - case RES_POOLCOLL_LABEL_DRAWING: nRet = ww::stiToCaption; break; + case RES_POOLCOLL_TOX_ILLUS1: nRet = ww::stiToCaption; break; case RES_POOLCOLL_ENVELOPE_ADDRESS: nRet = ww::stiEnvAddr; break; case RES_POOLCOLL_SEND_ADDRESS: nRet = ww::stiEnvRet; break; case RES_POOLCHR_FOOTNOTE_ANCHOR: nRet = ww::stiFootnoteRef; break; |