diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-02-20 18:09:14 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-20 20:35:22 +0100 |
commit | 8193e697d286595aa62859011761adeb002244e3 (patch) | |
tree | a920ed54e3efdd1274948c575ff8735ed2a4b9ad /sd/qa | |
parent | 3a85c2db176db708c0ff9401c40858eb60e80f1e (diff) |
oox smartart, cycle matrix: fix fill and line props of shape
The topmost shape may not have 0 depth, but something larger.
In that case at least it's safe to still use fill & line properties. The
B1 quadrant of the test file now has the proper orange background, and
B2's border is also properly orange.
Change-Id: Iccc5f6993693a0f1cf8f50d163003c24d3ad690e
Reviewed-on: https://gerrit.libreoffice.org/68104
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/pptx/smartart-cycle-matrix.pptx | bin | 56920 -> 56986 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-cycle-matrix.pptx b/sd/qa/unit/data/pptx/smartart-cycle-matrix.pptx Binary files differindex 76b771644cbb..fb1cb7ea2c2e 100644 --- a/sd/qa/unit/data/pptx/smartart-cycle-matrix.pptx +++ b/sd/qa/unit/data/pptx/smartart-cycle-matrix.pptx diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 2138b2ccf33b..2faf360b5b72 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -829,6 +829,19 @@ void SdImportTestSmartArt::testCycleMatrix() CPPUNIT_ASSERT(xA1.is()); CPPUNIT_ASSERT_EQUAL(OUString("A1"), xA1->getString()); + // Test fill color of B1, should be orange. + uno::Reference<text::XText> xB1(getChildShape(getChildShape(xGroup, 1), 1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xB1.is()); + CPPUNIT_ASSERT_EQUAL(OUString("B1"), xB1->getString()); + + uno::Reference<beans::XPropertySet> xB1Props(xB1, uno::UNO_QUERY); + CPPUNIT_ASSERT(xB1Props.is()); + sal_Int32 nFillColor = 0; + xB1Props->getPropertyValue("FillColor") >>= nFillColor; + // Without the accompanying fix in place, this test would have failed: the background color was + // 0x4f81bd, i.e. blue, not orange. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xf79646), nFillColor); + // Without the accompanying fix in place, this test would have failed: the // content of the "A2" shape was lost. uno::Reference<text::XText> xA2(getChildShape(getChildShape(getChildShape(xGroup, 0), 0), 1), @@ -850,6 +863,13 @@ void SdImportTestSmartArt::testCycleMatrix() uno::Reference<drawing::XShape> xB2Shape(xB2, uno::UNO_QUERY); CPPUNIT_ASSERT(xB2Shape.is()); + // Test line color of B2, should be orange. + uno::Reference<beans::XPropertySet> xB2Props(xB2, uno::UNO_QUERY); + CPPUNIT_ASSERT(xB2Props.is()); + sal_Int32 nLineColor = 0; + xB2Props->getPropertyValue("LineColor") >>= nLineColor; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xf79646), nLineColor); + uno::Reference<text::XText> xC2(getChildShape(getChildShape(getChildShape(xGroup, 0), 2), 1), uno::UNO_QUERY); CPPUNIT_ASSERT(xC2.is()); |