diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-05-05 16:58:23 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-05-12 16:50:45 +0200 |
commit | 898e4ae1364e76af8be22183ac64d73b6a6d8d90 (patch) | |
tree | ca73d6cd6a622f5a456dc823366f02a758cb4044 /chart2 | |
parent | fdf5bb5001422941e9d43e34ce88243e0e52109c (diff) |
tdf#128794 Chart: Fix OOXML import/export of Radial gradient
Style should be radial at least when the horizontal/vertical
center is not in the corner of a shape. Otherwise import
as a linear gradient, because it is the most similar to the
MSO radial style.
Change-Id: I9bab7b787897bde51a06a950487de9843eb717a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93497
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: Tünde Tóth <tundeth@gmail.com>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 13 | ||||
-rw-r--r-- | chart2/qa/extras/data/docx/tdf128794.docx | bin | 0 -> 31616 bytes |
2 files changed, 13 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 571a0da80132..5909bfd2c5db 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -96,6 +96,7 @@ public: void testColorGradientWithTransparancyDOCX(); void testColorGradientWithTransparancyODS(); void testColorGradientStopXLSX(); + void testRadialColorGradientDOCX(); void testBarChartDataPointPropDOCX(); void testFdo83058dlblPos(); void testAutoTitleDelXLSX(); @@ -225,6 +226,7 @@ public: CPPUNIT_TEST(testColorGradientWithTransparancyDOCX); CPPUNIT_TEST(testColorGradientWithTransparancyODS); CPPUNIT_TEST(testColorGradientStopXLSX); + CPPUNIT_TEST(testRadialColorGradientDOCX); CPPUNIT_TEST(testBarChartDataPointPropDOCX); CPPUNIT_TEST(testFdo83058dlblPos); CPPUNIT_TEST(testAutoTitleDelXLSX); @@ -1347,6 +1349,17 @@ void Chart2ExportTest::testColorGradientStopXLSX() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[2]", "pos", "100000"); } +void Chart2ExportTest::testRadialColorGradientDOCX() +{ + load("/chart2/qa/extras/data/docx/", "tdf128794.docx"); + xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + CPPUNIT_ASSERT(pXmlDoc); + // Test the gradeint style (if there is no 'a:path' attribute, it is a linear gradient) + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path", 0); + // Test the linear gradeint angle + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:lin", "ang", "13500000"); +} + void Chart2ExportTest::testBarChartDataPointPropDOCX() { load("/chart2/qa/extras/data/docx/", "testBarChartDataPointPropDOCX.docx"); diff --git a/chart2/qa/extras/data/docx/tdf128794.docx b/chart2/qa/extras/data/docx/tdf128794.docx Binary files differnew file mode 100644 index 000000000000..098c0a00e3cc --- /dev/null +++ b/chart2/qa/extras/data/docx/tdf128794.docx |