sd/qa/unit/data/tdf123841.odg |binary sd/qa/unit/import-tests.cxx | 15 +++++++++++++++ 2 files changed, 15 insertions(+)
New commits: commit 1d219e509750c73edbe610a9ed7f06e7de3bdbc1 Author: Shivam Kumar Singh <shivamhere...@gmail.com> AuthorDate: Fri Jan 24 16:44:42 2020 +0530 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Mon Feb 17 15:28:57 2020 +0100 sd: Unit test to check the fill style of odg object. Checks if the Fill Style is FillStyle_NONE . Change-Id: Ib2aff22fe9a4bcf9b483b7e3ac77df7bddf9415c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87440 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> diff --git a/sd/qa/unit/data/tdf123841.odg b/sd/qa/unit/data/tdf123841.odg new file mode 100644 index 000000000000..a92477e83af9 Binary files /dev/null and b/sd/qa/unit/data/tdf123841.odg differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 9eff839c2865..4d17e314fcf5 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -128,6 +128,7 @@ public: void testMasterPageStyleParent(); void testGradientAngle(); void testTdf97808(); + void testFillStyleNone(); void testFdo64512(); void testFdo71075(); void testN828390_2(); @@ -235,6 +236,7 @@ public: CPPUNIT_TEST(testMasterPageStyleParent); CPPUNIT_TEST(testGradientAngle); CPPUNIT_TEST(testTdf97808); + CPPUNIT_TEST(testFillStyleNone); CPPUNIT_TEST(testFdo64512); CPPUNIT_TEST(testFdo71075); CPPUNIT_TEST(testN828390_2); @@ -775,6 +777,19 @@ void SdImportTest::testTdf97808() xDocShRef->DoClose(); } +void SdImportTest::testFillStyleNone() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/tdf123841.odg"), ODG); + + const SdrPage* pPage = GetPage(1, xDocShRef); + const SdrObject* pObj = pPage->GetObj(0); + auto& rFillStyleItem + = dynamic_cast<const XFillStyleItem&>(pObj->GetMergedItem(XATTR_FILLSTYLE)); + // Without the accompanying fix in place, this test would have failed with 'Expected: 0; Actual: + // 1', i.e. the shape's fill was FillStyle_SOLID, making the text of the shape unreadable. + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, rFillStyleItem.GetValue()); + xDocShRef->DoClose(); +} void SdImportTest::testFdo64512() { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits