diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-04-23 09:09:21 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-04-23 15:42:02 +0200 |
commit | 1d0729a5b7a96c6fb962b60a51eddf773773e379 (patch) | |
tree | df1691a550d2a023f11c1f60732db81cc2683672 /sd | |
parent | 790bdd69926cf53359b35a105c3e9e1f61314aa7 (diff) |
tdf#123684 PPTX import: fix wrong background color for <p:sp useBgFill="1">
Regression from commit 59339dec1ce56213dc74a06af2f0d35ac1c534d7
(tdf#105150 PPTX import: try harder to handle <p:sp useBgFill="1">,
2017-01-06), the problem was that we gave a white solid fill to a shape
which is meant to be transparent.
Fix the problem by limiting the scope of the mentioned commit to solid
colors only, and also extend to code to look for background fill from
the masterpage as well. This allows not hardcoding the white solid fill
and leaves the fill style of shapes as transparent where the slide
background is a bitmap or other more complex fill type.
(cherry picked from commit 943a534ac7cb3df513583e226c986dafd8ba246b)
Change-Id: I0063e88d510250652d2b14856df3bd431681422d
Reviewed-on: https://gerrit.libreoffice.org/71115
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf123684.pptx | bin | 0 -> 142961 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf123684.pptx b/sd/qa/unit/data/pptx/tdf123684.pptx Binary files differnew file mode 100644 index 000000000000..87243422753b --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf123684.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 2c5295abcd36..879e13d8f90f 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -166,6 +166,7 @@ public: void testTdf104445(); void testTdf105150(); void testTdf105150PPT(); + void testTdf123684(); void testTdf100926(); void testTdf89064(); void testTdf108925(); @@ -252,6 +253,7 @@ public: CPPUNIT_TEST(testTdf104445); CPPUNIT_TEST(testTdf105150); CPPUNIT_TEST(testTdf105150PPT); + CPPUNIT_TEST(testTdf123684); CPPUNIT_TEST(testTdf100926); CPPUNIT_TEST(testPatternImport); CPPUNIT_TEST(testTdf89064); @@ -1768,6 +1770,20 @@ void SdImportTest::testTdf105150() xDocShRef->DoClose(); } +void SdImportTest::testTdf123684() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf123684.pptx"), PPTX); + 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::testTdf105150PPT() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/ppt/tdf105150.ppt"), PPT); |