summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2020-07-04 15:11:03 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-07-10 00:57:22 +0200
commit005f5db47b8e1bbd7ebddee92009be072e835fd5 (patch)
treedd91d9f59e17b1ae916c34db7373cd3d4f5a3ab6 /sd
parentb8ff69726959ee4d148c12866d64601d86635bcc (diff)
tdf#100348 add fill to fontwork in export to pptx
This patch adds fill to the characters in a Fontwork shape in export to pptx. It does not contain export to docx and not import. Change-Id: Ie7c8a35380a845f513516636c4f60ee307eacd50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98187 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/odp/tdf100348_FontworkBitmapFill.odpbin0 -> 17886 bytes
-rw-r--r--sd/qa/unit/data/odp/tdf100348_FontworkGradientGlow.odpbin0 -> 20381 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml1.cxx37
3 files changed, 37 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf100348_FontworkBitmapFill.odp b/sd/qa/unit/data/odp/tdf100348_FontworkBitmapFill.odp
new file mode 100644
index 000000000000..be3d17c21c12
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf100348_FontworkBitmapFill.odp
Binary files differ
diff --git a/sd/qa/unit/data/odp/tdf100348_FontworkGradientGlow.odp b/sd/qa/unit/data/odp/tdf100348_FontworkGradientGlow.odp
new file mode 100644
index 000000000000..e2c5f1e887f9
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf100348_FontworkGradientGlow.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index f7cec3010dc7..57112261a4af 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -91,6 +91,8 @@ public:
void testRoundtripPrstDash();
void testDashOnHairline();
void testCustomshapeBitmapfillSrcrect();
+ void testTdf100348FontworkBitmapFill();
+ void testTdf100348FontworkGradientGlow();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
@@ -131,6 +133,8 @@ public:
CPPUNIT_TEST(testRoundtripPrstDash);
CPPUNIT_TEST(testDashOnHairline);
CPPUNIT_TEST(testCustomshapeBitmapfillSrcrect);
+ CPPUNIT_TEST(testTdf100348FontworkBitmapFill);
+ CPPUNIT_TEST(testTdf100348FontworkGradientGlow);
CPPUNIT_TEST_SUITE_END();
@@ -1095,6 +1099,39 @@ void SdOOXMLExportTest1::testCustomshapeBitmapfillSrcrect()
CPPUNIT_ASSERT_EQUAL(4.0, fRightPercent);
}
+void SdOOXMLExportTest1::testTdf100348FontworkBitmapFill()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf100348_FontworkBitmapFill.odp"), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ xDocShRef->DoClose();
+
+ // Make sure the fontwork shape has a blip bitmap fill and a colored outline.
+ // Without the patch, fill and outline were black.
+ xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
+ const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr");
+ assertXPath(pXmlDoc, sPathStart + "/a:blipFill/a:blip", 1);
+ assertXPath(pXmlDoc, sPathStart + "/a:ln/a:solidFill/a:srgbClr", "val", "ffbf00");
+}
+
+void SdOOXMLExportTest1::testTdf100348FontworkGradientGlow()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf100348_FontworkGradientGlow.odp"), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ xDocShRef->DoClose();
+
+ // Make sure the fontwork shape has a gradient fill and a colored glow.
+ // Without the patch, fill was black and no glow applied.
+ xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
+ const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr");
+ assertXPath(pXmlDoc, sPathStart + "/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "8d281e");
+ assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow", "rad", "63360");
+ assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow/a:srgbClr", "val", "ff4500");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);
CPPUNIT_PLUGIN_IMPLEMENT();