sw/qa/extras/odfexport/data/tdf164712.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx      |   13 +++++++++++++
 2 files changed, 13 insertions(+)

New commits:
commit 089e8d0ae15da9632456bdf0c59a3531a6853dee
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Feb 10 23:20:56 2025 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 11 01:05:30 2025 +0100

    tdf#164712: sw_odfexport: Add unittest
    
    Change-Id: If81490314f47c88d54140712bee05b609990aa2e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181395
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/odfexport/data/tdf164712.odt 
b/sw/qa/extras/odfexport/data/tdf164712.odt
new file mode 100644
index 000000000000..9f2c63456e43
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf164712.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index d6e4c323ba58..537f15d64685 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2725,6 +2725,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129568ui)
     CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getProperty<Color>(xStyle, 
u"BackColor"_ustr));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf164712)
+{
+    loadAndReload("tdf164712.odt");
+    auto xText = getParagraph(1)->getText();
+    CPPUNIT_ASSERT(xText.is());
+    auto xCursor(xText->createTextCursorByRange(getParagraph(1)));
+    CPPUNIT_ASSERT(xCursor.is());
+    uno::Reference<beans::XPropertySet> xPropertySet(xCursor, uno::UNO_QUERY);
+    Color nColor;
+    // without the fix in place, this test would have failed here
+    
CPPUNIT_ASSERT(!css::uno::fromAny(xPropertySet->getPropertyValue(u"CharBackColor"_ustr),
 &nColor));
+}
+
 DECLARE_ODFEXPORT_TEST(testTdf132642_keepWithNextTable, 
"tdf132642_keepWithNextTable.odt")
 {
     // Since the row is very big, it should split over two pages.

Reply via email to