summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorPallavi Jadhav <pallavi.jadhav@synerzip.com>2013-12-04 15:03:00 +0530
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-12-11 17:12:21 +0000
commite516f8be79ddc9d845d8141075f7d558c25c1636 (patch)
tree191046b38b4398fb2c9235ada13c968b2f5c4ad2 /chart2
parent784d3e2b49fb55bfc46723a99fd00d43f31e090a (diff)
fdo#72226: Fix for Stock chart Invalid RT
Issue : In chart1.xml, <c:chart> <c:plotArea> <c:stockChart> there are four types of series as Open,Low,High and Close. For Open series, <c:ser> <c:idx val="0" /> <c:order val="0" /> an attribute "val" should be 1 and not 0. i.e. index should start from 1 and not from 0. Implementation : - In ChartExport::exportCandleStickSeries(), Using idx variable, we are writing index value which should be greater than 0. So for idx=0, we are adding value 1 while writing index value. - Added Unit tese case for chart export Conflicts: chart2/qa/extras/chart2export.cxx Change-Id: I4d5ffefbc8fcf62b50c13ca1b3ed80290962fc4e Reviewed-on: https://gerrit.libreoffice.org/6925 Tested-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx22
-rw-r--r--chart2/qa/extras/data/docx/testStockChart.docxbin0 -> 19894 bytes
2 files changed, 22 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index fa4d6197ff3b..77a823a4b436 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -23,10 +23,13 @@ public:
void testErrorBarXLSX();
void testTrendline();
+ void testStockChart();
+
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
CPPUNIT_TEST(testErrorBarXLSX);
CPPUNIT_TEST(testTrendline);
+ CPPUNIT_TEST(testStockChart);
CPPUNIT_TEST_SUITE_END();
private:
@@ -255,6 +258,25 @@ void Chart2ExportTest::testTrendline()
}
+void Chart2ExportTest::testStockChart()
+{
+ /* For attached file Stock_Chart.docx, in chart1.xml,
+ * <c:stockChart>, there are four types of series as
+ * Open,Low,High and Close.
+ * For Open series, in <c:idx val="0" />
+ * an attribute val of index should start from 1 and not from 0.
+ * Which was problem area.
+ */
+ load("/chart2/qa/extras/data/docx/", "testStockChart.docx");
+ {
+ xmlDocPtr pXmlDoc = parseExport("word/charts/chart1.xml");
+ if (!pXmlDoc)
+ return;
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:order", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v", "Open");
+ }
+}
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/testStockChart.docx b/chart2/qa/extras/data/docx/testStockChart.docx
new file mode 100644
index 000000000000..a804e7df2dcf
--- /dev/null
+++ b/chart2/qa/extras/data/docx/testStockChart.docx
Binary files differ