summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Kelemen <gabor.kelemen.extern@allotropia.de>2023-03-21 09:21:18 +0100
committerGabor Kelemen <kelemeng@ubuntu.com>2023-03-22 20:04:57 +0000
commit9b89ce887836742bb84bf57afa3b536b6c3bb1c1 (patch)
tree8d4e52a2438a4cc9957895ad37dc7a5f5bc1c27a
parent6f59baf135f42f9c281148184b1b1f16e3902442 (diff)
tdf#153659 Import Table of Figures paragraph style correctly
Change-Id: I5a995349c168bfbb5c8933dafa72e06eddb74ac6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149257 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
-rw-r--r--sw/qa/extras/odfexport/odfexport2.cxx3
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx3
2 files changed, 5 insertions, 1 deletions
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx
index e4da067f5396..269525a8756b 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -606,6 +606,9 @@ DECLARE_ODFEXPORT_TEST(testTdf153090, "Custom-Style-TOC.docx")
uno::Reference<container::XIndexAccess> xIndexes(xIndexSupplier->getDocumentIndexes());
uno::Reference<text::XDocumentIndex> xTOC(xIndexes->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("_CustomImageCaption"), getProperty<OUString>(xTOC, "CreateFromParagraphStyle"));
+ // tdf#153659 this was imported as "table of figures" instead of "Figure Index 1"
+ // thus custom settings were not retained after ToF update
+ CPPUNIT_ASSERT_EQUAL(OUString("Figure Index 1"), getProperty<OUString>(getParagraph(1), "ParaStyleName"));
xTOC->update();
OUString const tocContent(xTOC->getAnchor()->getString());
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 1e10d4966dbf..a78ac4fda2db 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1594,7 +1594,8 @@ OUString StyleSheetTable::ConvertStyleName( const OUString& rWWName, bool bExten
{ "footer", "Footer" }, // RES_POOLCOLL_FOOTER
{ "Index Heading", "Index Heading" }, // RES_POOLCOLL_TOX_IDXH
{ "Caption", "Caption" }, // RES_POOLCOLL_LABEL
- { "Table of Figures", "Drawing" }, // RES_POOLCOLL_LABEL_DRAWING
+ { "table of figures", "Figure Index 1" }, // RES_POOLCOLL_TOX_ILLUS1
+ { "Table of Figures", "Figure Index 1" }, // RES_POOLCOLL_TOX_ILLUS1
{ "Envelope Address", "Addressee" }, // RES_POOLCOLL_ENVELOPE_ADDRESS
{ "Envelope Return", "Sender" }, // RES_POOLCOLL_SEND_ADDRESS
{ "footnote reference", "Footnote Symbol" }, // RES_POOLCHR_FOOTNOTE; tdf#82173