diff options
author | Shivam Kumar Singh <shivamhere247@gmail.com> | 2020-01-24 16:44:42 +0530 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-02-17 15:28:57 +0100 |
commit | 1d219e509750c73edbe610a9ed7f06e7de3bdbc1 (patch) | |
tree | f98873fa543aa976814690d9464160467a8a176c /sd | |
parent | 3a4fbfd94335778f5390676af896447bb8df5c4a (diff) |
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.stahl@cib.de>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/tdf123841.odg | bin | 0 -> 8590 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sd/qa/unit/data/tdf123841.odg b/sd/qa/unit/data/tdf123841.odg Binary files differnew file mode 100644 index 000000000000..a92477e83af9 --- /dev/null +++ b/sd/qa/unit/data/tdf123841.odg 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() { |