summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2019-08-20 10:43:46 +0200
committerRegina Henschel <rb.henschel@t-online.de>2019-08-23 23:38:33 +0200
commit72b50be0197159c5afc5da4daf01ba303519b14a (patch)
treedb2d45de370f19bafc2b50aa568f5527e7967d75 /sd
parent7b4b70afba2d6bde66dd59da5950d45efb4a645b (diff)
tdf#99497 CircleKind ARC, CUT, SECTION to OOXML arc, chord, pie
Before this patch, a classical ellipse or circle was exported as OOXML preset type 'ellipse', regardless of the value of property CircleKind. Now the property is evaluated and the corresponding preset type is used. Change-Id: I49ff43cf7e2ce02654979e82f7d83d60ace39e23 Reviewed-on: https://gerrit.libreoffice.org/77785 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/odp/tdf99497_CircleKind.odpbin0 -> 12196 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx42
2 files changed, 42 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf99497_CircleKind.odp b/sd/qa/unit/data/odp/tdf99497_CircleKind.odp
new file mode 100644
index 000000000000..f3749dfdffb0
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf99497_CircleKind.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index dc1c4246ff35..0916ac95f3ff 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -193,6 +193,7 @@ public:
void testTdf111789();
void testTdf100348_convert_Fontwork2TextWarp();
void testTdf1225573_FontWorkScaleX();
+ void testTdf99497_keepAppearanceOfCircleKind();
/// SmartArt animated elements
void testTdf104792();
void testTdf90627();
@@ -288,6 +289,7 @@ public:
CPPUNIT_TEST(testTdf111789);
CPPUNIT_TEST(testTdf100348_convert_Fontwork2TextWarp);
CPPUNIT_TEST(testTdf1225573_FontWorkScaleX);
+ CPPUNIT_TEST(testTdf99497_keepAppearanceOfCircleKind);
CPPUNIT_TEST(testTdf104792);
CPPUNIT_TEST(testTdf90627);
CPPUNIT_TEST(testTdf104786);
@@ -2538,6 +2540,46 @@ void SdOOXMLExportTest2::testTdf126741()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf99497_keepAppearanceOfCircleKind()
+{
+ // Error was, that all CircleKind were exported to 'ellipse'.
+ // Resulting pptx has to contain the customshapes of the corresponding kind
+ // slide 1 ARC -> arc, slide 2 CUT -> chord, slide 3 SECTION -> pie
+ // Adjustment values need to exist and their values need to correspond to the
+ // orignal angles. Shape 'arc' needs to be unfilled.
+ const OUString sPath("/sd/qa/unit/data/odp/tdf99497_CircleKind.odp");
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(sPath), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ // slide 1 45° -> adj1 = 20493903, 270° -> adj2 = 5400000, <a:noFill/> exists
+ xmlDocPtr pXmlDocContent1 = parseExport(tempFile, "ppt/slides/slide1.xml");
+ const OString sPathStart1("/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom");
+ assertXPath(pXmlDocContent1, sPathStart1 + "[@prst='arc']");
+ const OString sPathAdj1(sPathStart1 + "/a:avLst/a:gd");
+ assertXPath(pXmlDocContent1, sPathAdj1 + "[@name='adj1' and @fmla='val 20493903']");
+ assertXPath(pXmlDocContent1, sPathAdj1 + "[@name='adj2' and @fmla='val 5400000']");
+ assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:noFill");
+
+ // slide 2 270° -> adj1 = 5400000, 180° -> adj2 = 10800000
+ xmlDocPtr pXmlDocContent2 = parseExport(tempFile, "ppt/slides/slide2.xml");
+ const OString sPathStart2("/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom");
+ assertXPath(pXmlDocContent2, sPathStart2 + "[@prst='chord']");
+ const OString sPathAdj2(sPathStart2 + "/a:avLst/a:gd");
+ assertXPath(pXmlDocContent2, sPathAdj2 + "[@name='adj1' and @fmla='val 5400000']");
+ assertXPath(pXmlDocContent2, sPathAdj2 + "[@name='adj2' and @fmla='val 10800000']");
+
+ // slide 3 120° -> adj1 = 12600000, 30° -> adj2 = 20946396
+ xmlDocPtr pXmlDocContent3 = parseExport(tempFile, "ppt/slides/slide3.xml");
+ const OString sPathStart3("/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom");
+ assertXPath(pXmlDocContent3, sPathStart3 + "[@prst='pie']");
+ const OString sPathAdj3(sPathStart3 + "/a:avLst/a:gd");
+ assertXPath(pXmlDocContent3, sPathAdj3 + "[@name='adj1' and @fmla='val 12600000']");
+ assertXPath(pXmlDocContent3, sPathAdj3 + "[@name='adj2' and @fmla='val 20946396']");
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();