sd/qa/unit/uiimpress.cxx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
New commits: commit 99032706a8f7b68e2e54d1da5cc58ae3ed67b73e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed May 28 14:14:12 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed May 28 17:07:11 2025 +0200 tdf#163805: sd_uiimpress: Add test Change-Id: If2d9539723ab70be8d2076c292b725da5c7b5313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185967 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index 9334e59e57fb..96cb6505efa3 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -1813,6 +1813,38 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme) } } +CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf163805) +{ + createSdImpressDoc(); + + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0)); + + drawing::FillStyle eFillStyle; + Color aColor; + CPPUNIT_ASSERT(xShape->getPropertyValue(u"FillStyle"_ustr) >>= eFillStyle); + CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_NONE), static_cast<int>(eFillStyle)); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"FillColor"_ustr) >>= aColor); + CPPUNIT_ASSERT_EQUAL(Color(0x729fcf), aColor); + + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<view::XSelectionSupplier> xController(xModel->getCurrentController(), + uno::UNO_QUERY); + xController->select(uno::Any(xShape)); + + uno::Sequence<beans::PropertyValue> aColorArgs + = { comphelper::makePropertyValue(u"FillColor.Color"_ustr, sal_Int32(0x800000)) }; + dispatchCommand(mxComponent, u".uno:FillColor"_ustr, aColorArgs); + + CPPUNIT_ASSERT(xShape->getPropertyValue(u"FillStyle"_ustr) >>= eFillStyle); + + // Without the fix in place, this test would have failed with + // - Expected: 1 + // - Actual : 0 + CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_SOLID), static_cast<int>(eFillStyle)); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"FillColor"_ustr) >>= aColor); + CPPUNIT_ASSERT_EQUAL(COL_RED, aColor); +} + CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorNoColor) { // Given an empty Impress document: