diff options
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 40 | ||||
-rw-r--r-- | chart2/qa/extras/data/docx/fdo78290_Combination_Chart_Marker_x.docx | bin | 0 -> 24245 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/docx/fdo78290_Line_Chart_Marker_x.docx | bin | 0 -> 24041 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/docx/fdo78290_Scatter_Chart_Marker_x.docx | bin | 0 -> 23747 bytes | |||
-rw-r--r-- | oox/source/export/chartexport.cxx | 5 |
5 files changed, 43 insertions, 2 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 30a252a4ae91..c75b5c288ada 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -57,6 +57,9 @@ public: void testGapWidthXLSX(); void testSmoothedLines(); void testLabelStringODS(); + void testfdo78290_Line_Chart_Marker_x(); + void testfdo78290_Scatter_Chart_Marker_x(); + void testfdo78290_Combination_Chart_Marker_x(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(test); @@ -86,6 +89,9 @@ public: CPPUNIT_TEST(testGapWidthXLSX); CPPUNIT_TEST(testSmoothedLines); CPPUNIT_TEST(testLabelStringODS); + CPPUNIT_TEST(testfdo78290_Line_Chart_Marker_x); + CPPUNIT_TEST(testfdo78290_Scatter_Chart_Marker_x); + CPPUNIT_TEST(testfdo78290_Combination_Chart_Marker_x); CPPUNIT_TEST_SUITE_END(); protected: @@ -629,6 +635,40 @@ void Chart2ExportTest::testFdo74115WallBitmapFill() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill"); } +//The below test case tests the built in marker 'x' for Office 2010 in Line charts + +void Chart2ExportTest::testfdo78290_Line_Chart_Marker_x() +{ + load("/chart2/qa/extras/data/docx/", "fdo78290_Line_Chart_Marker_x.docx"); + xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x"); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7"); +} + +// We can also use the built in marker 'x' in scatter chart, hence writing the test case for the same. + +void Chart2ExportTest::testfdo78290_Scatter_Chart_Marker_x() +{ + load("/chart2/qa/extras/data/docx/", "fdo78290_Scatter_Chart_Marker_x.docx"); + xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x"); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7"); +} + +// Also in a combination of charts like a column chart and line chart, we can use the built in marker 'x' +// for the line chart too. hence put a test case for the combination chart also. + +void Chart2ExportTest::testfdo78290_Combination_Chart_Marker_x() +{ + load("/chart2/qa/extras/data/docx/", "fdo78290_Combination_Chart_Marker_x.docx"); + xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x"); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7"); +} + void Chart2ExportTest::testBarChartRotation() { load ("/chart2/qa/extras/data/docx/", "barChartRotation.docx"); diff --git a/chart2/qa/extras/data/docx/fdo78290_Combination_Chart_Marker_x.docx b/chart2/qa/extras/data/docx/fdo78290_Combination_Chart_Marker_x.docx Binary files differnew file mode 100644 index 000000000000..ee2489d21a08 --- /dev/null +++ b/chart2/qa/extras/data/docx/fdo78290_Combination_Chart_Marker_x.docx diff --git a/chart2/qa/extras/data/docx/fdo78290_Line_Chart_Marker_x.docx b/chart2/qa/extras/data/docx/fdo78290_Line_Chart_Marker_x.docx Binary files differnew file mode 100644 index 000000000000..7e4b096b832b --- /dev/null +++ b/chart2/qa/extras/data/docx/fdo78290_Line_Chart_Marker_x.docx diff --git a/chart2/qa/extras/data/docx/fdo78290_Scatter_Chart_Marker_x.docx b/chart2/qa/extras/data/docx/fdo78290_Scatter_Chart_Marker_x.docx Binary files differnew file mode 100644 index 000000000000..2edc8f086225 --- /dev/null +++ b/chart2/qa/extras/data/docx/fdo78290_Scatter_Chart_Marker_x.docx diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 68bb9f0c2e7c..48c8fc5a5617 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -3000,7 +3000,7 @@ void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries) pSymbolType = "star"; break; case 10: - pSymbolType = "X"; + pSymbolType = "x"; // in MS office 2010 built in symbol marker 'X' is represented as 'x' break; case 11: pSymbolType = "plus"; @@ -3023,7 +3023,8 @@ void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries) awt::Size aSymbolSize = aSymbol.Size; sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height ); - nSize = nSize/250.0*7.0; // just guessed based on some test cases + nSize = nSize/250.0*7.0 + 1; // just guessed based on some test cases, + //the value is always 1 less than the actual value. nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) ); pFS->singleElement( FSNS( XML_c, XML_size), XML_val, I32S(nSize), |