chart2/qa/extras/chart2export.cxx | 14 ++++++++++++++ chart2/qa/extras/data/xlsx/tdf128619.xlsx |binary oox/source/export/drawingml.cxx | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-)
New commits: commit d7149889a9e1cae7f255691c2a35090ac3245bfa Author: Balazs Varga <balazs.varga...@gmail.com> AuthorDate: Mon Nov 11 15:03:05 2019 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Wed Nov 13 08:28:11 2019 +0100 tdf#128619 Chart OOXML export: fix gradient position Export the gradient border value as gradient stop position of the first color at LINEAR GradientStyle. Change-Id: I1a2b986a004fecbf68050c6bf95be549684fea70 Reviewed-on: https://gerrit.libreoffice.org/82446 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> Tested-by: László Németh <nem...@numbertext.org> diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 4d14a1e96638..694e814250bd 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -91,6 +91,7 @@ public: void testChartTitlePropertiesBitmapFillDOCX(); void testColorGradientWithTransparancyDOCX(); void testColorGradientWithTransparancyODS(); + void testColorGradientStopXLSX(); void testBarChartDataPointPropDOCX(); void testFdo83058dlblPos(); void testAutoTitleDelXLSX(); @@ -201,6 +202,7 @@ public: CPPUNIT_TEST(testChartTitlePropertiesBitmapFillDOCX); CPPUNIT_TEST(testColorGradientWithTransparancyDOCX); CPPUNIT_TEST(testColorGradientWithTransparancyODS); + CPPUNIT_TEST(testColorGradientStopXLSX); CPPUNIT_TEST(testBarChartDataPointPropDOCX); CPPUNIT_TEST(testFdo83058dlblPos); CPPUNIT_TEST(testAutoTitleDelXLSX); @@ -1251,6 +1253,18 @@ void Chart2ExportTest::testColorGradientWithTransparancyODS() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "60000"); } +void Chart2ExportTest::testColorGradientStopXLSX() +{ + // Test color gradient (two color) stop of the first color + load("/chart2/qa/extras/data/xlsx/", "tdf128619.xlsx"); + xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + // Test the position of the first color + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[1]", "pos", "45000"); + // Test the position of the second color + 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::testBarChartDataPointPropDOCX() { load("/chart2/qa/extras/data/docx/", "testBarChartDataPointPropDOCX.docx"); diff --git a/chart2/qa/extras/data/xlsx/tdf128619.xlsx b/chart2/qa/extras/data/xlsx/tdf128619.xlsx new file mode 100644 index 000000000000..e6eb142593fe Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf128619.xlsx differ diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index a5c152dcf6d1..2cc160d05b57 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -605,7 +605,7 @@ void DrawingML::WriteGradientFill(awt::Gradient rGradient, awt::Gradient rTransp nStartAlpha = GetAlphaFromTransparenceGradient(rTransparenceGradient, true); nEndAlpha = GetAlphaFromTransparenceGradient(rTransparenceGradient, false); } - WriteGradientStop(0, ColorWithIntensity(rGradient.StartColor, rGradient.StartIntensity), + WriteGradientStop(rGradient.Border, ColorWithIntensity(rGradient.StartColor, rGradient.StartIntensity), nStartAlpha); WriteGradientStop(100, ColorWithIntensity(rGradient.EndColor, rGradient.EndIntensity), nEndAlpha); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits