diff options
author | PriyankaGaikwad <priyanka.gaikwad@synerzip.com> | 2014-08-27 19:28:44 +0530 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2015-01-03 00:53:47 +0000 |
commit | a7052b906dfd1d749f7da9ea64a3479d7c1cc2c9 (patch) | |
tree | 2aa4b932432043a1aaab81de694af1bc35bb3468 /chart2 | |
parent | 31e82d9f6f07335a2526bd44956eebfcaf0a289d (diff) |
fdo#83058 File corrupt due to data label position is invalid in chart.xml
- File getting corrupted after RT due to data label position is invalid in chart.xml
- LO must not export invalid label position property if chart type doesn't support that positioning in MS Office.
- For clusterd bar chart XML Difference
chart1.xml
Original file
<c:barChart>
<c:grouping val="clustered" />
<c:ser>
<c:dLbls>
...
<c:dLbl>
<c:dLblPos val="outEnd" />
</c:dLbl>
...
</c:dLbls>
</c:ser>
</c:barChart>
Roundtrip file
<c:barChart>
<c:grouping val="clustered" />
<c:ser>
<c:dLbls>
...
<c:dLbl>
<c:dLblPos val="r" />
</c:dLbl>
...
</c:dLbls>
</c:ser>
</c:barChart>
Change-Id: I9cae11b8d198aaa70fb05cb3bf329cd898519170
Reviewed-on: https://gerrit.libreoffice.org/11141
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 15 | ||||
-rw-r--r-- | chart2/qa/extras/data/docx/fdo83058_dlblPos.docx | bin | 0 -> 35931 bytes |
2 files changed, 14 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index fc2930537494..66f5b90a9bfc 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -79,6 +79,7 @@ public: void testDataLabelDoughnutChartDOCX(); void testDataLabelAreaChartDOCX(); void testDataLabelDefaultLineChartDOCX(); + void testFdo83058dlblPos(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(test); @@ -123,6 +124,7 @@ public: CPPUNIT_TEST(testDataLabelDoughnutChartDOCX); CPPUNIT_TEST(testDataLabelAreaChartDOCX); CPPUNIT_TEST(testDataLabelDefaultLineChartDOCX); + CPPUNIT_TEST(testFdo83058dlblPos); CPPUNIT_TEST_SUITE_END(); protected: @@ -867,7 +869,7 @@ void Chart2ExportTest::testDataLabelClusteredBarChartDOCX() CPPUNIT_ASSERT(pXmlDoc); // This was "t", should be one of the allowed values. - assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLbl[2]/c:dLblPos", "val", "ctr"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLbl[2]/c:dLblPos", "val", "outEnd"); } void Chart2ExportTest::testDataLabelRadarChartDOCX() @@ -1186,6 +1188,17 @@ void Chart2ExportTest::testLabelStringODS() CPPUNIT_ASSERT_EQUAL(OUString("\"LabelName\""), aLabelString); } +void Chart2ExportTest::testFdo83058dlblPos() +{ + load ("/chart2/qa/extras/data/docx/", "fdo83058_dlblPos.docx"); + xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[2]/c:dLblPos", "val", "outEnd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[3]/c:dLblPos", "val", "outEnd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[4]/c:dLblPos", "val", "outEnd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[5]/c:dLblPos", "val", "outEnd"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/docx/fdo83058_dlblPos.docx b/chart2/qa/extras/data/docx/fdo83058_dlblPos.docx Binary files differnew file mode 100644 index 000000000000..721a717897b3 --- /dev/null +++ b/chart2/qa/extras/data/docx/fdo83058_dlblPos.docx |