diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2019-08-10 12:11:38 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2019-08-26 11:29:12 +0200 |
commit | 695f6bae59de85ae2a69afc9aca5d94758ff86ed (patch) | |
tree | 8e4fbd9ddb6e5f603abd688c842ff2c1bc39c06e /sd | |
parent | tdf#126792: DOCX legacy drop-downs are only supposed to hold 25 items, DOCX (diff) | |
download | core-695f6bae59de85ae2a69afc9aca5d94758ff86ed.tar.gz core-695f6bae59de85ae2a69afc9aca5d94758ff86ed.zip |
tdf#126746 Add support for import/export line caps for .pptx format
With this commit I have added importing and exporting line caps,
which could be (for pptx format:
rnd Round Line Cap
sq Square Line Cap
flat Flat Line Cap
Also exporting of these caps are added.
Change-Id: I799485048a2a7ac8df89f004e177d507f86ce99d
Reviewed-on: https://gerrit.libreoffice.org/77233
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
(cherry picked from commit 606a88d2abf85aa6edcc1fa26dc50cab6de3241f)
Reviewed-on: https://gerrit.libreoffice.org/77553
Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/odp/closed-shapes.odp | bin | 12596 -> 16370 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 31 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 3 |
3 files changed, 31 insertions, 3 deletions
diff --git a/sd/qa/unit/data/odp/closed-shapes.odp b/sd/qa/unit/data/odp/closed-shapes.odp Binary files differindex 23460c7dbae5..d422c74a02a9 100644 --- a/sd/qa/unit/data/odp/closed-shapes.odp +++ b/sd/qa/unit/data/odp/closed-shapes.odp diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index f69d63208e6a..d72ab73afb9c 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -147,7 +147,7 @@ public: void testTdf111863(); void testTdf111518(); void testTdf100387(); - void testClosingShapes(); + void testClosingShapesAndLineCaps(); void testRotateFlip(); void testTdf106867(); void testTdf112280(); @@ -238,7 +238,7 @@ public: CPPUNIT_TEST(testTdf111863); CPPUNIT_TEST(testTdf111518); CPPUNIT_TEST(testTdf100387); - CPPUNIT_TEST(testClosingShapes); + CPPUNIT_TEST(testClosingShapesAndLineCaps); CPPUNIT_TEST(testRotateFlip); CPPUNIT_TEST(testTdf106867); CPPUNIT_TEST(testTdf112280); @@ -1124,15 +1124,40 @@ void SdOOXMLExportTest2::testTdf100387() "/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt/p:txEl/p:pRg", "end", "2"); } -void SdOOXMLExportTest2::testClosingShapes() +// tdf#126746 Add support for Line Caps import and export +void SdOOXMLExportTest2::testClosingShapesAndLineCaps() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/closed-shapes.odp"), ODP); utl::TempFile tempFile; xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); xDocShRef->DoClose(); xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:moveTo/a:pt", 1); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", 1); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", 1); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 1); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:ln", "cap", "rnd"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:ln/a:miter", 1); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:ln", "cap", "rnd"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:spPr/a:ln/a:miter", 1); + + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:ln", "cap", "rnd"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:ln/a:miter", 1); + + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:ln", "cap", "sq"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:spPr/a:ln/a:round", 1); + + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0); + assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln", "cap"); // by default it is "flat" cap style + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln/a:bevel", 1); + + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0); + assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln", "cap"); // by default it is "flat" cap style + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:spPr/a:ln/a:round", 1); } void SdOOXMLExportTest2::testRotateFlip() diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index e6a1495ee4a5..c8d8c157fa81 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1587,18 +1587,21 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap </a:schemeClr>\ </a:solidFill>\ <a:prstDash val=\"solid\"/>\ + <a:miter/>\ </a:ln>\ <a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\ <a:solidFill>\ <a:schemeClr val=\"phClr\"/>\ </a:solidFill>\ <a:prstDash val=\"solid\"/>\ + <a:miter/>\ </a:ln>\ <a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\ <a:solidFill>\ <a:schemeClr val=\"phClr\"/>\ </a:solidFill>\ <a:prstDash val=\"solid\"/>\ + <a:miter/>\ </a:ln>\ </a:lnStyleLst>\ <a:effectStyleLst>\ |