summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2023-01-23 09:33:13 +0100
committerLászló Németh <nemeth@numbertext.org>2023-01-26 19:49:09 +0000
commite8335bac5690b6beccb5ca9b36281c89fb2f28f5 (patch)
tree568665ba85b151d5590d5898555474d52cbccfe3 /sd
parent7b0b6e5232585c3756c94ae15ae695eaa1f4fbe1 (diff)
tdf#153107 OOXML export: fix scale of tile of shape background
Relative scale values were exported as absolute values, resulting broken shape background. Change-Id: Ia38e125862e7f8ceff5d41754340723c3a9eb028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145996 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/odp/tdf153107.odpbin0 -> 19505 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx60
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx4
3 files changed, 62 insertions, 2 deletions
diff --git a/sd/qa/unit/data/odp/tdf153107.odp b/sd/qa/unit/data/odp/tdf153107.odp
new file mode 100644
index 000000000000..c77b65d87fa1
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf153107.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 7636af9f0079..a7469250f1fe 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -77,6 +77,7 @@ public:
}
void testRepeatBitmapMode();
+ void testTdf153107();
void testTdf142291();
void testTdf151492();
void testTdf149697();
@@ -149,6 +150,7 @@ public:
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
CPPUNIT_TEST(testRepeatBitmapMode);
+ CPPUNIT_TEST(testTdf153107);
CPPUNIT_TEST(testTdf142291);
CPPUNIT_TEST(testTdf151492);
CPPUNIT_TEST(testTdf149697);
@@ -247,6 +249,64 @@ void SdOOXMLExportTest2::testRepeatBitmapMode()
assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "algn", "ctr");
}
+void SdOOXMLExportTest2::testTdf153107()
+{
+ createSdImpressDoc("odp/tdf153107.odp");
+ save("Impress Office Open XML");
+
+ // placeholder
+ xmlDocUniquePtr pXmlDocContent1 = parseExport("ppt/slides/slide1.xml");
+ assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "tx",
+ "1879200");
+ assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "ty",
+ "83628");
+ assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "sx",
+ "264773");
+ assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "sy",
+ "91428");
+ assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:blipFill/a:tile", "algn",
+ "ctr");
+
+ // custom shape
+ xmlDocUniquePtr pXmlDocContent2 = parseExport("ppt/slides/slide1.xml");
+ assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "tx",
+ "198000");
+ assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "ty",
+ "324000");
+ assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "sx",
+ "69743");
+ assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "sy",
+ "78709");
+ assertXPath(pXmlDocContent2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:blipFill/a:tile", "algn",
+ "tl");
+
+ // polygon
+ xmlDocUniquePtr pXmlDocContent3 = parseExport("ppt/slides/slide1.xml");
+ assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "tx",
+ "2073600");
+ assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "ty",
+ "221760");
+ assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "sx",
+ "182602");
+ assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "sy",
+ "86580");
+ assertXPath(pXmlDocContent3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:blipFill/a:tile", "algn",
+ "ctr");
+
+ // textbox
+ xmlDocUniquePtr pXmlDocContent4 = parseExport("ppt/slides/slide1.xml");
+ assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "tx",
+ "662400");
+ assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "ty",
+ "760320");
+ assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "sx",
+ "202891");
+ assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "sy",
+ "129870");
+ assertXPath(pXmlDocContent4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:blipFill/a:tile", "algn",
+ "tl");
+}
+
void SdOOXMLExportTest2::testTdf142291()
{
createSdImpressDoc("pptx/tdt142291.pptx");
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 3827c90e045e..c053586e3d44 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -598,7 +598,7 @@ void PowerPointExport::ImplWriteBackground(const FSHelperPtr& pFS, const Referen
PowerPointShapeExport aDML(pFS, &maShapeMap, this);
aDML.SetBackgroundDark(mbIsBackgroundDark);
- aDML.WriteFill(rXPropSet);
+ aDML.WriteFill(rXPropSet, maPageSize);
pFS->endElementNS(XML_p, XML_bgPr);
pFS->endElementNS(XML_p, XML_bg);
@@ -1765,7 +1765,7 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap
{
WriteBlipFill(xProps, "Graphic");
// Do not forget to export the visible properties.
- WriteFill( xProps );
+ WriteFill( xProps, xShape->getSize());
WriteOutline( xProps );
WriteShapeEffects( xProps );