From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- chart2/qa/TestCaseOldAPI.java | 957 +++++++++ chart2/qa/data.chd | 14 + chart2/qa/extras/PivotChartTest.cxx | 967 +++++++++ chart2/qa/extras/chart2_trendcalculators.cxx | 217 ++ chart2/qa/extras/chart2dump/chart2dump.cxx | 1122 ++++++++++ .../chart2dump/data/axis_special_positioning.odp | Bin 0 -> 25153 bytes .../data/chartwall_auto_adjust_with_titles.ods | Bin 0 -> 24943 bytes .../data/chartwall_auto_adjust_without_titles.ods | Bin 0 -> 25090 bytes .../data/chartwall_custom_positioning.ods | Bin 0 -> 29351 bytes .../chart2dump/data/column_chart_small_spacing.ods | Bin 0 -> 29333 bytes .../chart2dump/data/custom_legend_position.odp | Bin 0 -> 16422 bytes .../qa/extras/chart2dump/data/date-categories.pptx | Bin 0 -> 41931 bytes .../chart2dump/data/default_formated_axis.odp | Bin 0 -> 26218 bytes chart2/qa/extras/chart2dump/data/donut_chart.ods | Bin 0 -> 24630 bytes .../extras/chart2dump/data/exploded_pie_chart.ods | Bin 0 -> 26180 bytes .../chart2dump/data/formated_axis_labels.odp | Bin 0 -> 15328 bytes .../extras/chart2dump/data/formated_axis_lines.odp | Bin 0 -> 24305 bytes .../extras/chart2dump/data/formated_grid_line.ods | Bin 0 -> 30275 bytes .../qa/extras/chart2dump/data/horizontal_grid.ods | Bin 0 -> 30942 bytes .../qa/extras/chart2dump/data/legend_on_bottom.odp | Bin 0 -> 16526 bytes .../extras/chart2dump/data/legend_on_left_side.odp | Bin 0 -> 16235 bytes .../chart2dump/data/legend_on_right_side.odp | Bin 0 -> 14176 bytes chart2/qa/extras/chart2dump/data/legend_on_top.odp | Bin 0 -> 16410 bytes .../extras/chart2dump/data/many_legend_entries.odp | Bin 0 -> 20961 bytes .../extras/chart2dump/data/minimal_legend_test.odp | Bin 0 -> 18253 bytes chart2/qa/extras/chart2dump/data/minor_grid.ods | Bin 0 -> 30004 bytes .../extras/chart2dump/data/multiple_categories.odp | Bin 0 -> 21476 bytes .../extras/chart2dump/data/multiple_categories.ods | Bin 0 -> 35766 bytes .../extras/chart2dump/data/normal_area_chart.ods | Bin 0 -> 29023 bytes .../qa/extras/chart2dump/data/normal_bar_chart.ods | Bin 0 -> 31385 bytes .../extras/chart2dump/data/normal_column_chart.ods | Bin 0 -> 29326 bytes .../data/normal_line_chart_lines_and_points.ods | Bin 0 -> 29690 bytes .../data/normal_line_chart_lines_only.ods | Bin 0 -> 29596 bytes .../data/normal_line_chart_points_only.ods | Bin 0 -> 29686 bytes .../qa/extras/chart2dump/data/normal_pie_chart.ods | Bin 0 -> 26374 bytes .../chart2dump/data/percent_stacked_area_chart.ods | Bin 0 -> 31559 bytes .../chart2dump/data/percent_stacked_bar_chart.ods | Bin 0 -> 29672 bytes .../data/percent_stacked_column_chart.odp | Bin 0 -> 23155 bytes .../data/percent_stacked_column_chart.ods | Bin 0 -> 31177 bytes ...percent_stacked_line_chart_lines_and_points.ods | Bin 0 -> 23971 bytes .../data/percent_stacked_line_chart_lines_only.ods | Bin 0 -> 23869 bytes .../percent_stacked_line_chart_points_only.ods | Bin 0 -> 23751 bytes .../chart2dump/data/pie_chart_many_slices.ods | Bin 0 -> 16351 bytes .../chart2dump/data/pivotchart_data_button.ods | Bin 0 -> 18366 bytes .../extras/chart2dump/data/rotated_axis_labels.odp | Bin 0 -> 24098 bytes .../extras/chart2dump/data/rotated_pie_chart.ods | Bin 0 -> 26286 bytes .../data/scatter_chart_lines_and_points.ods | Bin 0 -> 23728 bytes .../chart2dump/data/scatter_chart_lines_only.ods | Bin 0 -> 23540 bytes .../chart2dump/data/scatter_chart_points_only.ods | Bin 0 -> 23520 bytes chart2/qa/extras/chart2dump/data/simple_chart.ods | Bin 0 -> 29601 bytes .../extras/chart2dump/data/stacked_area_chart.ods | Bin 0 -> 30199 bytes .../extras/chart2dump/data/stacked_bar_chart.ods | Bin 0 -> 29285 bytes .../chart2dump/data/stacked_column_chart.ods | Bin 0 -> 29893 bytes .../data/stacked_line_chart_lines_and_points.ods | Bin 0 -> 23638 bytes .../data/stacked_line_chart_lines_only.ods | Bin 0 -> 23312 bytes .../data/stacked_line_chart_points_only.ods | Bin 0 -> 23484 bytes chart2/qa/extras/chart2dump/data/tdf118150.xlsx | Bin 0 -> 14212 bytes chart2/qa/extras/chart2dump/data/vertical_grid.ods | Bin 0 -> 31470 bytes .../reference/areacharttest/normal_area_chart.txt | 62 + .../areacharttest/percent_stacked_area_chart.txt | 62 + .../reference/areacharttest/stacked_area_chart.txt | 62 + .../axisgeometrytest/axis_special_positioning.txt | 38 + .../axisgeometrytest/default_formated_axis.txt | 38 + .../axisgeometrytest/formated_axis_lines.txt | 38 + .../axisgeometrytest/rotated_axis_labels.txt | 38 + .../reference/axislabeltest/date-categories.txt | 180 ++ .../axislabeltest/default_formated_axis.txt | 96 + .../axislabeltest/formated_axis_labels.txt | 96 + .../axislabeltest/percent_stacked_column_chart.txt | 96 + .../axislabeltest/rotated_axis_labels.txt | 60 + .../reference/axislabeltest/tdf118150.txt | 216 ++ .../chartdatatest/multiple_categories.txt | 70 + .../reference/chartdatatest/simple_chart.txt | 50 + .../chartwall_auto_adjust_with_titles.txt | 10 + .../chartwall_auto_adjust_without_titles.txt | 10 + .../chartwalltest/chartwall_custom_positioning.txt | 10 + .../reference/chartwalltest/formated_chartwall.txt | 10 + .../column_chart_small_spacing.txt | 162 ++ .../columnbarcharttest/normal_bar_chart.txt | 162 ++ .../columnbarcharttest/normal_column_chart.txt | 162 ++ .../percent_stacked_bar_chart.txt | 162 ++ .../percent_stacked_column_chart.txt | 162 ++ .../columnbarcharttest/stacked_bar_chart.txt | 162 ++ .../columnbarcharttest/stacked_column_chart.txt | 162 ++ .../reference/gridtest/formated_grid_line.txt | 17 + .../reference/gridtest/horizontal_grid.txt | 17 + .../chart2dump/reference/gridtest/minor_grid.txt | 68 + .../reference/gridtest/vertical_grid.txt | 17 + .../legendtest/custom_legend_position.txt | 50 + .../reference/legendtest/legend_on_bottom.txt | 50 + .../reference/legendtest/legend_on_left_side.txt | 50 + .../reference/legendtest/legend_on_right_side.txt | 18 + .../reference/legendtest/legend_on_top.txt | 50 + .../reference/legendtest/many_legend_entries.txt | 182 ++ .../reference/legendtest/minimal_legend_test.txt | 14 + .../reference/legendtest/multiple_categories.txt | 66 + .../reference/piecharttest/donut_chart.txt | 194 ++ .../reference/piecharttest/exploded_pie_chart.txt | 50 + .../reference/piecharttest/normal_pie_chart.txt | 50 + .../piecharttest/pie_chart_many_slices.txt | 275 +++ .../reference/piecharttest/rotated_pie_chart.txt | 50 + .../pivotchart_data_button.txt | 2 + .../normal_line_chart_lines_and_points.txt | 250 +++ .../normal_line_chart_lines_only.txt | 58 + .../normal_line_chart_points_only.txt | 198 ++ ...percent_stacked_line_chart_lines_and_points.txt | 310 +++ .../percent_stacked_line_chart_lines_only.txt | 58 + .../percent_stacked_line_chart_points_only.txt | 258 +++ .../scatter_chart_lines_and_points.txt | 310 +++ .../scatter_chart_lines_only.txt | 58 + .../scatter_chart_points_only.txt | 258 +++ .../stacked_line_chart_lines_and_points.txt | 310 +++ .../stacked_line_chart_lines_only.txt | 58 + .../stacked_line_chart_points_only.txt | 258 +++ chart2/qa/extras/chart2export.cxx | 1258 +++++++++++ chart2/qa/extras/chart2export2.cxx | 1685 +++++++++++++++ chart2/qa/extras/chart2export3.cxx | 767 +++++++ chart2/qa/extras/chart2geometry.cxx | 493 +++++ chart2/qa/extras/chart2import.cxx | 2242 ++++++++++++++++++++ chart2/qa/extras/chart2import2.cxx | 892 ++++++++ chart2/qa/extras/charttest.hxx | 605 ++++++ chart2/qa/extras/data/doc/chart.doc | Bin 0 -> 15872 bytes chart2/qa/extras/data/docx/3d-bar-label.docx | Bin 0 -> 24163 bytes .../qa/extras/data/docx/Bar_horizontal_cone.docx | Bin 0 -> 18237 bytes chart2/qa/extras/data/docx/DisplayUnits.docx | Bin 0 -> 18137 bytes chart2/qa/extras/data/docx/FDO74430.docx | Bin 0 -> 19199 bytes chart2/qa/extras/data/docx/FDO75975.docx | Bin 0 -> 18257 bytes .../extras/data/docx/MSO_Custom_Leader_Line.docx | Bin 0 -> 25883 bytes chart2/qa/extras/data/docx/MSO_axis_position.docx | Bin 0 -> 41444 bytes chart2/qa/extras/data/docx/PieChartDataLabels.docx | Bin 0 -> 120403 bytes chart2/qa/extras/data/docx/TableOnPage3.docx | Bin 0 -> 35511 bytes chart2/qa/extras/data/docx/UpDownBars.docx | Bin 0 -> 24198 bytes chart2/qa/extras/data/docx/area-chart-labels.docx | Bin 0 -> 24123 bytes chart2/qa/extras/data/docx/bar-chart-labels.docx | Bin 0 -> 24357 bytes chart2/qa/extras/data/docx/barChartRotation.docx | Bin 0 -> 24220 bytes chart2/qa/extras/data/docx/bubblechart.docx | Bin 0 -> 17740 bytes chart2/qa/extras/data/docx/chart.docx | Bin 0 -> 17749 bytes .../data/docx/clustered-bar-chart-labels.docx | Bin 0 -> 22977 bytes chart2/qa/extras/data/docx/data-label-borders.docx | Bin 0 -> 34843 bytes .../data/docx/data_point_inherited_color.docx | Bin 0 -> 5426 bytes .../qa/extras/data/docx/doughnut-chart-labels.docx | Bin 0 -> 23902 bytes chart2/qa/extras/data/docx/doughnutChart.docx | Bin 0 -> 17486 bytes .../extras/data/docx/fdo74115_WallBitmapFill.docx | Bin 0 -> 34418 bytes .../data/docx/fdo74115_WallGradientFill.docx | Bin 0 -> 17942 bytes .../docx/fdo78290_Combination_Chart_Marker_x.docx | Bin 0 -> 24245 bytes .../data/docx/fdo78290_Line_Chart_Marker_x.docx | Bin 0 -> 24041 bytes .../data/docx/fdo78290_Scatter_Chart_Marker_x.docx | Bin 0 -> 23747 bytes chart2/qa/extras/data/docx/fdo83058_dlblPos.docx | Bin 0 -> 35931 bytes .../docx/line-chart-label-default-placement.docx | Bin 0 -> 17824 bytes chart2/qa/extras/data/docx/pieChartRotation.docx | Bin 0 -> 23528 bytes .../data/docx/piechart_deleted_legend_entry.docx | Bin 0 -> 27165 bytes chart2/qa/extras/data/docx/radar-chart-labels.docx | Bin 0 -> 24223 bytes .../data/docx/scatter-chart-text-x-values.docx | Bin 0 -> 23974 bytes chart2/qa/extras/data/docx/tdf121744.docx | Bin 0 -> 25221 bytes chart2/qa/extras/data/docx/tdf123206.docx | Bin 0 -> 24223 bytes chart2/qa/extras/data/docx/tdf124083.docx | Bin 0 -> 25793 bytes chart2/qa/extras/data/docx/tdf124243.docx | Bin 0 -> 25872 bytes chart2/qa/extras/data/docx/tdf125337.docx | Bin 0 -> 25063 bytes chart2/qa/extras/data/docx/tdf128794.docx | Bin 0 -> 31616 bytes chart2/qa/extras/data/docx/tdf132174.docx | Bin 0 -> 13865 bytes chart2/qa/extras/data/docx/tdf133632.docx | Bin 0 -> 26280 bytes chart2/qa/extras/data/docx/tdf134111.docx | Bin 0 -> 22831 bytes chart2/qa/extras/data/docx/tdf134255.docx | Bin 0 -> 33169 bytes chart2/qa/extras/data/docx/tdf136650.docx | Bin 0 -> 25543 bytes chart2/qa/extras/data/docx/tdf139658.docx | Bin 0 -> 27488 bytes chart2/qa/extras/data/docx/tdf143130.docx | Bin 0 -> 26675 bytes chart2/qa/extras/data/docx/tdf91250.docx | Bin 0 -> 25895 bytes chart2/qa/extras/data/docx/testAreaChartLoad.docx | Bin 0 -> 23962 bytes .../qa/extras/data/docx/testAxisTitlePosition.docx | Bin 0 -> 26274 bytes chart2/qa/extras/data/docx/testBarChart.docx | Bin 0 -> 23955 bytes .../data/docx/testBarChartDataPointPropDOCX.docx | Bin 0 -> 25590 bytes chart2/qa/extras/data/docx/testChartDataTable.docx | Bin 0 -> 18084 bytes .../docx/testChartTitlePropertiesBitmapFill.docx | Bin 0 -> 47851 bytes .../docx/testChartTitlePropertiesColorFill.docx | Bin 0 -> 5549 bytes .../docx/testChartTitlePropertiesGradientFill.docx | Bin 0 -> 5595 bytes .../docx/testColorGradientWithTransparency.docx | Bin 0 -> 25872 bytes .../qa/extras/data/docx/testCustomlabeltext.docx | Bin 0 -> 26031 bytes chart2/qa/extras/data/docx/testLabelSeparator.docx | Bin 0 -> 25333 bytes .../data/docx/testMultilevelCategoryAxis.docx | Bin 0 -> 5890 bytes chart2/qa/extras/data/docx/testMultipleChart.docx | Bin 0 -> 47534 bytes .../data/docx/testMultiplechartembeddings.docx | Bin 0 -> 47534 bytes chart2/qa/extras/data/docx/testSeriesIdxOrder.docx | Bin 0 -> 25941 bytes .../extras/data/docx/testSimpleCategoryAxis.docx | Bin 0 -> 31629 bytes chart2/qa/extras/data/docx/testStockChart.docx | Bin 0 -> 19894 bytes chart2/qa/extras/data/docx/testTdf108110.docx | Bin 0 -> 25892 bytes chart2/qa/extras/data/docx/testTdf114179.docx | Bin 0 -> 5839 bytes chart2/qa/extras/data/docx/testTdf122226.docx | Bin 0 -> 19648 bytes .../data/docx/testchartoleobjectembeddings.docx | Bin 0 -> 2041727 bytes chart2/qa/extras/data/docx/testcustomshapepos.docx | Bin 0 -> 26359 bytes .../qa/extras/data/fods/stacked-column-chart.fods | 861 ++++++++ .../qa/extras/data/odp/BarChartVeryLongLabel.odp | Bin 0 -> 16390 bytes chart2/qa/extras/data/odp/chart.odp | Bin 0 -> 14747 bytes .../qa/extras/data/odp/ellipticalGradientFill.odp | Bin 0 -> 17071 bytes chart2/qa/extras/data/odp/tdf119029.odp | Bin 0 -> 13643 bytes chart2/qa/extras/data/odp/tdf121189.odp | Bin 0 -> 16945 bytes chart2/qa/extras/data/odp/tdf123206.odp | Bin 0 -> 19589 bytes .../extras/data/odp/tdf128345_ChartArea_CG_TS.odp | Bin 0 -> 19486 bytes .../extras/data/odp/tdf128345_ChartWall_CS_TG.odp | Bin 0 -> 16551 bytes .../data/odp/tdf128345_Legend_CS_TG_axial.odp | Bin 0 -> 15174 bytes chart2/qa/extras/data/ods/ErrorBarRange.ods | Bin 0 -> 17937 bytes chart2/qa/extras/data/ods/PivotChartRoundTrip.ods | Bin 0 -> 21988 bytes chart2/qa/extras/data/ods/PivotTableExample.ods | Bin 0 -> 17183 bytes .../qa/extras/data/ods/axis-numformats-linked.ods | Bin 0 -> 26944 bytes chart2/qa/extras/data/ods/axis_number_format.ods | Bin 0 -> 12662 bytes chart2/qa/extras/data/ods/chart.ods | Bin 0 -> 12599 bytes .../qa/extras/data/ods/chartWithDotInSheetName.ods | Bin 0 -> 15057 bytes .../data/ods/combined_chart_secondary_axis.ods | Bin 0 -> 16334 bytes chart2/qa/extras/data/ods/error_bar.ods | Bin 0 -> 13724 bytes chart2/qa/extras/data/ods/error_bar_properties.ods | Bin 0 -> 17387 bytes chart2/qa/extras/data/ods/error_bar_range.ods | Bin 0 -> 13490 bytes chart2/qa/extras/data/ods/fdo60083.ods | Bin 0 -> 14538 bytes chart2/qa/extras/data/ods/labelString.ods | Bin 0 -> 17401 bytes chart2/qa/extras/data/ods/legend_overlay.ods | Bin 0 -> 12314 bytes chart2/qa/extras/data/ods/moving-type.ods | Bin 0 -> 29749 bytes chart2/qa/extras/data/ods/multilevelcat.ods | Bin 0 -> 13559 bytes chart2/qa/extras/data/ods/multiple_axis.ods | Bin 0 -> 12864 bytes chart2/qa/extras/data/ods/pie_chart_100_and_0.ods | Bin 0 -> 11354 bytes chart2/qa/extras/data/ods/secondary_axis.ods | Bin 0 -> 16783 bytes chart2/qa/extras/data/ods/ser_labels.ods | Bin 0 -> 29539 bytes chart2/qa/extras/data/ods/smoothedLines.ods | Bin 0 -> 16115 bytes chart2/qa/extras/data/ods/stepped_lines.ods | Bin 0 -> 76168 bytes chart2/qa/extras/data/ods/tdf101894.ods | Bin 0 -> 18221 bytes chart2/qa/extras/data/ods/tdf107097.ods | Bin 0 -> 17945 bytes chart2/qa/extras/data/ods/tdf108021.ods | Bin 0 -> 16728 bytes chart2/qa/extras/data/ods/tdf120348.ods | Bin 0 -> 43612 bytes chart2/qa/extras/data/ods/tdf123774.ods | Bin 0 -> 16140 bytes chart2/qa/extras/data/ods/tdf128432.ods | Bin 0 -> 13755 bytes chart2/qa/extras/data/ods/tdf131115.ods | Bin 0 -> 13814 bytes chart2/qa/extras/data/ods/tdf131979.ods | Bin 0 -> 11510 bytes chart2/qa/extras/data/ods/tdf132076.ods | Bin 0 -> 16138 bytes .../data/ods/tdf135366_data_label_series.ods | Bin 0 -> 7661 bytes chart2/qa/extras/data/ods/tdf136011.ods | Bin 0 -> 23559 bytes chart2/qa/extras/data/ods/tdf136024.ods | Bin 0 -> 15430 bytes chart2/qa/extras/data/ods/tdf146066.ods | Bin 0 -> 15079 bytes chart2/qa/extras/data/ods/tdf146463.ods | Bin 0 -> 21780 bytes chart2/qa/extras/data/ods/tdf148142.ods | Bin 0 -> 15349 bytes chart2/qa/extras/data/ods/tdf151091.ods | Bin 0 -> 14140 bytes chart2/qa/extras/data/ods/tdf158223.ods | Bin 0 -> 27391 bytes chart2/qa/extras/data/ods/tdf59857.ods | Bin 0 -> 33209 bytes chart2/qa/extras/data/ods/tdf62057.ods | Bin 0 -> 16852 bytes chart2/qa/extras/data/ods/tdf64224.ods | Bin 0 -> 33209 bytes chart2/qa/extras/data/ods/tdf72776.ods | Bin 0 -> 14798 bytes chart2/qa/extras/data/ods/tdf86624.ods | Bin 0 -> 14461 bytes chart2/qa/extras/data/ods/tdf96161.ods | Bin 0 -> 17545 bytes .../extras/data/ods/testChartMainWithSubTitle.ods | Bin 0 -> 12317 bytes chart2/qa/extras/data/ods/testChartSubTitle.ods | Bin 0 -> 12598 bytes .../data/ods/testColorGradientWithTransparency.ods | Bin 0 -> 17224 bytes chart2/qa/extras/data/ods/test_CrossBetween.ods | Bin 0 -> 12365 bytes chart2/qa/extras/data/ods/trend_calculators.ods | Bin 0 -> 45107 bytes chart2/qa/extras/data/ods/trendline.ods | Bin 0 -> 17563 bytes chart2/qa/extras/data/odt/axis-position.odt | Bin 0 -> 21224 bytes chart2/qa/extras/data/odt/chart.odt | Bin 0 -> 13470 bytes chart2/qa/extras/data/odt/multilevelcat.odt | Bin 0 -> 13942 bytes chart2/qa/extras/data/odt/scatter-plot-labels.odt | Bin 0 -> 13454 bytes chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt | Bin 0 -> 16810 bytes chart2/qa/extras/data/odt/tdf108022.odt | Bin 0 -> 23191 bytes chart2/qa/extras/data/odt/tdf114657.odt | Bin 0 -> 12890 bytes chart2/qa/extras/data/odt/tdf128733.odt | Bin 0 -> 13708 bytes chart2/qa/extras/data/odt/tdf131143.odt | Bin 0 -> 13970 bytes .../data/odt/tdf135366_data_label_export.odt | Bin 0 -> 16069 bytes .../extras/data/odt/tdf135366_data_label_point.odt | Bin 0 -> 8344 bytes .../extras/data/odt/testPieChartWallLineStyle.odt | Bin 0 -> 16427 bytes chart2/qa/extras/data/ppt/chart.ppt | Bin 0 -> 76800 bytes ...ieChartWithAutomaticLayout_SizeAndPosition.pptx | Bin 0 -> 165804 bytes chart2/qa/extras/data/pptx/bnc864396.pptx | Bin 0 -> 41580 bytes chart2/qa/extras/data/pptx/bnc882383.pptx | Bin 0 -> 43962 bytes chart2/qa/extras/data/pptx/bnc889755.pptx | Bin 0 -> 34771 bytes chart2/qa/extras/data/pptx/chart.pptx | Bin 0 -> 33393 bytes .../data/pptx/percentage-number-formats.pptx | Bin 0 -> 58872 bytes chart2/qa/extras/data/pptx/sparse-chart.pptx | Bin 0 -> 57398 bytes .../data/pptx/stacked-bar-chart-hidden-series.pptx | Bin 0 -> 54370 bytes .../data/pptx/stacked-non-stacked-mix-y-axis.pptx | Bin 0 -> 86216 bytes chart2/qa/extras/data/pptx/tdf105517.pptx | Bin 0 -> 37194 bytes chart2/qa/extras/data/pptx/tdf106217.pptx | Bin 0 -> 47976 bytes chart2/qa/extras/data/pptx/tdf115107-2.pptx | Bin 0 -> 50519 bytes chart2/qa/extras/data/pptx/tdf115107.pptx | Bin 0 -> 50726 bytes chart2/qa/extras/data/pptx/tdf115859.pptx | Bin 0 -> 49120 bytes chart2/qa/extras/data/pptx/tdf116163.pptx | Bin 0 -> 47591 bytes chart2/qa/extras/data/pptx/tdf121205.pptx | Bin 0 -> 42922 bytes chart2/qa/extras/data/pptx/tdf122765.pptx | Bin 0 -> 47625 bytes chart2/qa/extras/data/pptx/tdf125444.pptx | Bin 0 -> 34078 bytes chart2/qa/extras/data/pptx/tdf127393.pptx | Bin 0 -> 64536 bytes chart2/qa/extras/data/pptx/tdf127720.pptx | Bin 0 -> 38935 bytes chart2/qa/extras/data/pptx/tdf127811.pptx | Bin 0 -> 59647 bytes .../data/pptx/tdf128345_ChartArea_CG_TS.pptx | Bin 0 -> 21913 bytes .../data/pptx/tdf128345_ChartWall_CS_TG.pptx | Bin 0 -> 21921 bytes .../data/pptx/tdf128345_Legend_CS_TG_axial.pptx | Bin 0 -> 21932 bytes .../data/pptx/tdf135366_CustomLabelText.pptx | Bin 0 -> 36946 bytes .../qa/extras/data/pptx/tdf137691_dataTable.pptx | Bin 0 -> 49901 bytes chart2/qa/extras/data/pptx/tdf150176.pptx | Bin 0 -> 52342 bytes chart2/qa/extras/data/pptx/tdf48041.pptx | Bin 0 -> 23937 bytes chart2/qa/extras/data/pptx/tdf60316.pptx | Bin 0 -> 46023 bytes .../pptx/testChartTitlePropertiesBitmapFill.pptx | Bin 0 -> 50865 bytes .../pptx/testChartTitlePropertiesColorFill.pptx | Bin 0 -> 47424 bytes .../pptx/testChartTitlePropertiesGradientFill.pptx | Bin 0 -> 47473 bytes .../qa/extras/data/xls/axis_sourceformatting.xls | Bin 0 -> 7168 bytes chart2/qa/extras/data/xls/chart.xls | Bin 0 -> 7168 bytes chart2/qa/extras/data/xls/piechart_outside.xls | Bin 0 -> 60928 bytes .../extras/data/xls/source_number_format_axis.xls | Bin 0 -> 7168 bytes chart2/qa/extras/data/xlsx/ChartDataTable.xlsx | Bin 0 -> 8142 bytes ...able-MultipleLegendEntriesForOneDataSeries.xlsx | Bin 0 -> 15745 bytes .../data/xlsx/add_series_secondary_axis.xlsx | Bin 0 -> 20217 bytes .../qa/extras/data/xlsx/auto_marker_excel10.xlsx | Bin 0 -> 16250 bytes chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx | Bin 0 -> 10455 bytes chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx | Bin 0 -> 13222 bytes .../qa/extras/data/xlsx/axis-label-rotation.xlsx | Bin 0 -> 13698 bytes .../data/xlsx/axis_character_properties.xlsx | Bin 0 -> 10381 bytes .../data/xlsx/axis_title_default_rotation.xlsx | Bin 0 -> 11868 bytes chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx | Bin 0 -> 11579 bytes .../qa/extras/data/xlsx/axis_title_rotation.xlsx | Bin 0 -> 13057 bytes chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx | Bin 0 -> 12966 bytes chart2/qa/extras/data/xlsx/barchart_outend.xlsx | Bin 0 -> 15277 bytes chart2/qa/extras/data/xlsx/barchart_totalsrow.xlsx | Bin 0 -> 20117 bytes .../qa/extras/data/xlsx/bubble_chart_simple.xlsx | Bin 0 -> 13010 bytes .../data/xlsx/chart-area-style-background.xlsx | Bin 0 -> 13796 bytes .../extras/data/xlsx/chart-area-style-border.xlsx | Bin 0 -> 12006 bytes .../qa/extras/data/xlsx/chart-auto-background.xlsx | Bin 0 -> 11310 bytes chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx | Bin 0 -> 11579 bytes .../extras/data/xlsx/chart-text-can-overlap.xlsx | Bin 0 -> 13368 bytes chart2/qa/extras/data/xlsx/chart.xlsx | Bin 0 -> 7055 bytes .../extras/data/xlsx/chart_label_text_break.xlsx | Bin 0 -> 13940 bytes chart2/qa/extras/data/xlsx/chart_pie2007.xlsx | Bin 0 -> 9091 bytes chart2/qa/extras/data/xlsx/chart_title.xlsx | Bin 0 -> 13085 bytes .../qa/extras/data/xlsx/chart_with_name_range.xlsx | Bin 0 -> 14575 bytes .../data/xlsx/combined_chart_secondary_axis.xlsx | Bin 0 -> 15304 bytes chart2/qa/extras/data/xlsx/custom_data_label.xlsx | Bin 0 -> 13944 bytes chart2/qa/extras/data/xlsx/data_label.xlsx | Bin 0 -> 13057 bytes .../extras/data/xlsx/data_labels_fill_color.xlsx | Bin 0 -> 11256 bytes .../qa/extras/data/xlsx/deleted_data_labels.xlsx | Bin 0 -> 7536 bytes .../qa/extras/data/xlsx/deleted_legend_entry.xlsx | Bin 0 -> 14346 bytes .../qa/extras/data/xlsx/deleted_legend_entry2.xlsx | Bin 0 -> 20060 bytes chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx | Bin 0 -> 10520 bytes chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx | Bin 0 -> 13430 bytes chart2/qa/extras/data/xlsx/empty_chart.xlsx | Bin 0 -> 13370 bytes chart2/qa/extras/data/xlsx/external_str_ref.xlsx | Bin 0 -> 23847 bytes chart2/qa/extras/data/xlsx/fdo54361-1.xlsx | Bin 0 -> 11106 bytes chart2/qa/extras/data/xlsx/fdo54361.xlsx | Bin 0 -> 10273 bytes chart2/qa/extras/data/xlsx/fdo70609.xlsx | Bin 0 -> 13654 bytes chart2/qa/extras/data/xlsx/fdo78080.xlsx | Bin 0 -> 7020 bytes chart2/qa/extras/data/xlsx/gapWidth.xlsx | Bin 0 -> 18668 bytes chart2/qa/extras/data/xlsx/hidden_cells.xlsx | Bin 0 -> 11215 bytes .../extras/data/xlsx/incorrect_label_position.xlsx | Bin 0 -> 14112 bytes .../qa/extras/data/xlsx/legend_manual_layout.xlsx | Bin 0 -> 13145 bytes chart2/qa/extras/data/xlsx/majorTickMark.xlsx | Bin 0 -> 11223 bytes chart2/qa/extras/data/xlsx/markerColor.xlsx | Bin 0 -> 12999 bytes chart2/qa/extras/data/xlsx/minorTickMark.xlsx | Bin 0 -> 11256 bytes chart2/qa/extras/data/xlsx/no_marker.xlsx | Bin 0 -> 13006 bytes chart2/qa/extras/data/xlsx/number-formats.xlsx | Bin 0 -> 12638 bytes .../data/xlsx/pie_chart_datapoint_explosion.xlsx | Bin 0 -> 19237 bytes .../data/xlsx/piechart_deleted_legendentry.xlsx | Bin 0 -> 13447 bytes chart2/qa/extras/data/xlsx/piechart_legend.xlsx | Bin 0 -> 13426 bytes chart2/qa/extras/data/xlsx/piechart_outside.xlsx | Bin 0 -> 15473 bytes chart2/qa/extras/data/xlsx/plotVisOnly.xlsx | Bin 0 -> 11206 bytes .../extras/data/xlsx/plot_area_manual_layout.xlsx | Bin 0 -> 13142 bytes chart2/qa/extras/data/xlsx/rAngAx.xlsx | Bin 0 -> 11364 bytes .../secondary_axis_title_default_rotation.xlsx | Bin 0 -> 11529 bytes chart2/qa/extras/data/xlsx/ser_labels.xlsx | Bin 0 -> 18412 bytes chart2/qa/extras/data/xlsx/smoothed_series.xlsx | Bin 0 -> 12836 bytes .../qa/extras/data/xlsx/smoothed_series2007.xlsx | Bin 0 -> 12351 bytes chart2/qa/extras/data/xlsx/strict_chart.xlsx | Bin 0 -> 12779 bytes chart2/qa/extras/data/xlsx/tdf100084.xlsx | Bin 0 -> 10070 bytes chart2/qa/extras/data/xlsx/tdf108107.xlsx | Bin 0 -> 14277 bytes chart2/qa/extras/data/xlsx/tdf111173.xlsx | Bin 0 -> 16013 bytes chart2/qa/extras/data/xlsx/tdf111824.xlsx | Bin 0 -> 15235 bytes chart2/qa/extras/data/xlsx/tdf114139.xlsx | Bin 0 -> 18794 bytes chart2/qa/extras/data/xlsx/tdf115012.xlsx | Bin 0 -> 13729 bytes .../xlsx/tdf119138-missing-autotitledeleted.xlsx | Bin 0 -> 8424 bytes chart2/qa/extras/data/xlsx/tdf122031.xlsx | Bin 0 -> 13229 bytes chart2/qa/extras/data/xlsx/tdf122915.xlsx | Bin 0 -> 14310 bytes chart2/qa/extras/data/xlsx/tdf124817.xlsx | Bin 0 -> 20868 bytes chart2/qa/extras/data/xlsx/tdf126033.xlsx | Bin 0 -> 20012 bytes chart2/qa/extras/data/xlsx/tdf126115.xlsx | Bin 0 -> 20173 bytes chart2/qa/extras/data/xlsx/tdf127777.xlsx | Bin 0 -> 14421 bytes chart2/qa/extras/data/xlsx/tdf128619.xlsx | Bin 0 -> 13658 bytes chart2/qa/extras/data/xlsx/tdf128621.xlsx | Bin 0 -> 15011 bytes chart2/qa/extras/data/xlsx/tdf128627.xlsx | Bin 0 -> 14307 bytes chart2/qa/extras/data/xlsx/tdf128633.xlsx | Bin 0 -> 15018 bytes chart2/qa/extras/data/xlsx/tdf128634.xlsx | Bin 0 -> 14185 bytes chart2/qa/extras/data/xlsx/tdf128732.xlsx | Bin 0 -> 7511 bytes chart2/qa/extras/data/xlsx/tdf130657.xlsx | Bin 0 -> 7468 bytes chart2/qa/extras/data/xlsx/tdf130986.xlsx | Bin 0 -> 15393 bytes chart2/qa/extras/data/xlsx/tdf132076.xlsx | Bin 0 -> 14632 bytes .../qa/extras/data/xlsx/tdf133190_tdf133191.xlsx | Bin 0 -> 12142 bytes chart2/qa/extras/data/xlsx/tdf133376.xlsx | Bin 0 -> 12736 bytes chart2/qa/extras/data/xlsx/tdf134118.xlsx | Bin 0 -> 16014 bytes chart2/qa/extras/data/xlsx/tdf134225.xlsx | Bin 0 -> 13956 bytes chart2/qa/extras/data/xlsx/tdf134978.xlsx | Bin 0 -> 13746 bytes .../qa/extras/data/xlsx/tdf135184RoundLineCap.xlsx | Bin 0 -> 25538 bytes .../extras/data/xlsx/tdf135184RoundLineCap2.xlsx | Bin 0 -> 21937 bytes chart2/qa/extras/data/xlsx/tdf136105.xlsx | Bin 0 -> 16753 bytes chart2/qa/extras/data/xlsx/tdf136267.xlsx | Bin 0 -> 31986 bytes chart2/qa/extras/data/xlsx/tdf136752.xlsx | Bin 0 -> 11909 bytes chart2/qa/extras/data/xlsx/tdf137505.xlsx | Bin 0 -> 14908 bytes chart2/qa/extras/data/xlsx/tdf137734.xlsx | Bin 0 -> 6504 bytes chart2/qa/extras/data/xlsx/tdf137917.xlsx | Bin 0 -> 13940 bytes chart2/qa/extras/data/xlsx/tdf138204.xlsx | Bin 0 -> 15138 bytes chart2/qa/extras/data/xlsx/tdf140489.xlsx | Bin 0 -> 32626 bytes chart2/qa/extras/data/xlsx/tdf142351.xlsx | Bin 0 -> 15077 bytes chart2/qa/extras/data/xlsx/tdf143127.xlsx | Bin 0 -> 18486 bytes chart2/qa/extras/data/xlsx/tdf143942.xlsx | Bin 0 -> 13697 bytes chart2/qa/extras/data/xlsx/tdf150434.xlsx | Bin 0 -> 14918 bytes chart2/qa/extras/data/xlsx/tdf81396.xlsx | Bin 0 -> 8224 bytes chart2/qa/extras/data/xlsx/tdf90876.xlsx | Bin 0 -> 12736 bytes chart2/qa/extras/data/xlsx/tdf98690.xlsx | Bin 0 -> 17975 bytes chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx | Bin 0 -> 13917 bytes .../qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx | Bin 0 -> 15501 bytes .../qa/extras/data/xlsx/testAutoTitleDeleted.xlsx | Bin 0 -> 15097 bytes .../data/xlsx/testBarChartDataPointPropXLSX.xlsx | Bin 0 -> 14007 bytes .../xlsx/testChartTitlePropertiesBitmapFill.xlsx | Bin 0 -> 49790 bytes .../xlsx/testChartTitlePropertiesColorFill.xlsx | Bin 0 -> 11515 bytes .../xlsx/testChartTitlePropertiesGradientFill.xlsx | Bin 0 -> 7542 bytes .../qa/extras/data/xlsx/testCombinedChartAxis.xlsx | Bin 0 -> 20857 bytes .../extras/data/xlsx/testCustomPosDataLabels.xlsx | Bin 0 -> 14332 bytes .../data/xlsx/testDataPointLabelCustomPos.xlsx | Bin 0 -> 15069 bytes .../xlsx/testDataseriesOverlapStackedChart.xlsx | Bin 0 -> 11007 bytes chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx | Bin 0 -> 14559 bytes chart2/qa/extras/data/xlsx/testSecondaryAxis.xlsx | Bin 0 -> 14757 bytes chart2/qa/extras/data/xlsx/testTdf130032.xlsx | Bin 0 -> 14208 bytes chart2/qa/extras/data/xlsx/testTdf90749.xlsx | Bin 0 -> 14505 bytes .../data/xlsx/title_character_properties.xlsx | Bin 0 -> 10355 bytes .../qa/extras/data/xlsx/title_manual_layout.xlsx | Bin 0 -> 13160 bytes chart2/qa/extras/data/xlsx/trendline.xlsx | Bin 0 -> 13397 bytes chart2/qa/extras/data/xlsx/trendline2007.xlsx | Bin 0 -> 12514 bytes chart2/qa/extras/data/xlsx/vary_color.xlsx | Bin 0 -> 13935 bytes chart2/qa/extras/data/xlsx/vary_color2007.xlsx | Bin 0 -> 13142 bytes .../qa/extras/data/xlsx/xAxisLabelsRotation.xlsx | Bin 0 -> 13601 bytes chart2/qa/extras/uichart.cxx | 441 ++++ chart2/qa/extras/xshape/chart2xshape.cxx | 322 +++ chart2/qa/extras/xshape/data/ods/fdo75075.ods | Bin 0 -> 15763 bytes .../xshape/data/ods/property-mapping-bar.ods | Bin 0 -> 15481 bytes chart2/qa/extras/xshape/data/ods/tdf151424.ods | Bin 0 -> 17727 bytes .../xshape/data/ods/tdf76649_TrendLineBug.ods | Bin 0 -> 12060 bytes chart2/qa/extras/xshape/data/ods/tdf90839-4.ods | Bin 0 -> 19765 bytes chart2/qa/extras/xshape/data/ods/testChart.ods | Bin 0 -> 11156 bytes chart2/qa/extras/xshape/data/pptx/tdf149204.pptx | Bin 0 -> 33324 bytes .../data/pptx/tdf88154_LabelRotatedLayout.pptx | Bin 0 -> 34771 bytes .../qa/extras/xshape/data/reference/fdo75075.xml | 1692 +++++++++++++++ .../xshape/data/reference/property-mapping-bar.xml | 1164 ++++++++++ .../qa/extras/xshape/data/reference/tdf149204.xml | 397 ++++ .../qa/extras/xshape/data/reference/tdf150832.xml | 974 +++++++++ .../qa/extras/xshape/data/reference/tdf151424.xml | 1160 ++++++++++ .../qa/extras/xshape/data/reference/tdf90839-1.xml | 336 +++ .../qa/extras/xshape/data/reference/tdf90839-2.xml | 336 +++ .../qa/extras/xshape/data/reference/tdf90839-3.xml | 336 +++ .../qa/extras/xshape/data/reference/tdf90839-4.xml | 336 +++ .../qa/extras/xshape/data/reference/testChart.xml | 1218 +++++++++++ .../qa/extras/xshape/data/reference/tolerance.xml | 15 + chart2/qa/extras/xshape/data/xls/tdf150832.xls | Bin 0 -> 7168 bytes chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx | Bin 0 -> 13080 bytes chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx | Bin 0 -> 12498 bytes chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx | Bin 0 -> 13200 bytes chart2/qa/unit/chart2-dialogs-test.cxx | 61 + chart2/qa/unit/common_functor_test.cxx | 83 + chart2/qa/unit/data/chart2-dialogs-test.txt | 69 + chart2/qa/unit/data/tolerance.xml | 7 + chart2/qa/unoapi/knownissues.xcl | 58 + chart2/qa/unoapi/sch.sce | 42 + .../qa/unoapi/testdocuments/TransparencyChart.sxs | Bin 0 -> 10810 bytes chart2/qa/unoapi/testdocuments/emptyChart.sds | Bin 0 -> 44544 bytes chart2/qa/unoapi/testdocuments/space-metal.jpg | Bin 0 -> 4313 bytes 460 files changed, 27107 insertions(+) create mode 100644 chart2/qa/TestCaseOldAPI.java create mode 100644 chart2/qa/data.chd create mode 100644 chart2/qa/extras/PivotChartTest.cxx create mode 100644 chart2/qa/extras/chart2_trendcalculators.cxx create mode 100644 chart2/qa/extras/chart2dump/chart2dump.cxx create mode 100644 chart2/qa/extras/chart2dump/data/axis_special_positioning.odp create mode 100644 chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods create mode 100644 chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods create mode 100644 chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods create mode 100644 chart2/qa/extras/chart2dump/data/column_chart_small_spacing.ods create mode 100644 chart2/qa/extras/chart2dump/data/custom_legend_position.odp create mode 100644 chart2/qa/extras/chart2dump/data/date-categories.pptx create mode 100644 chart2/qa/extras/chart2dump/data/default_formated_axis.odp create mode 100644 chart2/qa/extras/chart2dump/data/donut_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/exploded_pie_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/formated_axis_labels.odp create mode 100644 chart2/qa/extras/chart2dump/data/formated_axis_lines.odp create mode 100644 chart2/qa/extras/chart2dump/data/formated_grid_line.ods create mode 100644 chart2/qa/extras/chart2dump/data/horizontal_grid.ods create mode 100644 chart2/qa/extras/chart2dump/data/legend_on_bottom.odp create mode 100644 chart2/qa/extras/chart2dump/data/legend_on_left_side.odp create mode 100644 chart2/qa/extras/chart2dump/data/legend_on_right_side.odp create mode 100644 chart2/qa/extras/chart2dump/data/legend_on_top.odp create mode 100644 chart2/qa/extras/chart2dump/data/many_legend_entries.odp create mode 100644 chart2/qa/extras/chart2dump/data/minimal_legend_test.odp create mode 100644 chart2/qa/extras/chart2dump/data/minor_grid.ods create mode 100644 chart2/qa/extras/chart2dump/data/multiple_categories.odp create mode 100644 chart2/qa/extras/chart2dump/data/multiple_categories.ods create mode 100644 chart2/qa/extras/chart2dump/data/normal_area_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/normal_bar_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/normal_column_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/normal_line_chart_lines_and_points.ods create mode 100644 chart2/qa/extras/chart2dump/data/normal_line_chart_lines_only.ods create mode 100644 chart2/qa/extras/chart2dump/data/normal_line_chart_points_only.ods create mode 100644 chart2/qa/extras/chart2dump/data/normal_pie_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/percent_stacked_area_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/percent_stacked_bar_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/percent_stacked_column_chart.odp create mode 100644 chart2/qa/extras/chart2dump/data/percent_stacked_column_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_lines_and_points.ods create mode 100644 chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_lines_only.ods create mode 100644 chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_points_only.ods create mode 100644 chart2/qa/extras/chart2dump/data/pie_chart_many_slices.ods create mode 100644 chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods create mode 100644 chart2/qa/extras/chart2dump/data/rotated_axis_labels.odp create mode 100644 chart2/qa/extras/chart2dump/data/rotated_pie_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/scatter_chart_lines_and_points.ods create mode 100644 chart2/qa/extras/chart2dump/data/scatter_chart_lines_only.ods create mode 100644 chart2/qa/extras/chart2dump/data/scatter_chart_points_only.ods create mode 100644 chart2/qa/extras/chart2dump/data/simple_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/stacked_area_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/stacked_bar_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/stacked_column_chart.ods create mode 100644 chart2/qa/extras/chart2dump/data/stacked_line_chart_lines_and_points.ods create mode 100644 chart2/qa/extras/chart2dump/data/stacked_line_chart_lines_only.ods create mode 100644 chart2/qa/extras/chart2dump/data/stacked_line_chart_points_only.ods create mode 100644 chart2/qa/extras/chart2dump/data/tdf118150.xlsx create mode 100644 chart2/qa/extras/chart2dump/data/vertical_grid.ods create mode 100644 chart2/qa/extras/chart2dump/reference/areacharttest/normal_area_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/areacharttest/percent_stacked_area_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/areacharttest/stacked_area_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axisgeometrytest/axis_special_positioning.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axisgeometrytest/default_formated_axis.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axisgeometrytest/formated_axis_lines.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axisgeometrytest/rotated_axis_labels.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axislabeltest/date-categories.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axislabeltest/default_formated_axis.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axislabeltest/formated_axis_labels.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axislabeltest/percent_stacked_column_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axislabeltest/rotated_axis_labels.txt create mode 100644 chart2/qa/extras/chart2dump/reference/axislabeltest/tdf118150.txt create mode 100644 chart2/qa/extras/chart2dump/reference/chartdatatest/multiple_categories.txt create mode 100644 chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_with_titles.txt create mode 100644 chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_without_titles.txt create mode 100644 chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_custom_positioning.txt create mode 100644 chart2/qa/extras/chart2dump/reference/chartwalltest/formated_chartwall.txt create mode 100644 chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt create mode 100644 chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_bar_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_column_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_bar_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_column_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_bar_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_column_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/gridtest/formated_grid_line.txt create mode 100644 chart2/qa/extras/chart2dump/reference/gridtest/horizontal_grid.txt create mode 100644 chart2/qa/extras/chart2dump/reference/gridtest/minor_grid.txt create mode 100644 chart2/qa/extras/chart2dump/reference/gridtest/vertical_grid.txt create mode 100644 chart2/qa/extras/chart2dump/reference/legendtest/custom_legend_position.txt create mode 100644 chart2/qa/extras/chart2dump/reference/legendtest/legend_on_bottom.txt create mode 100644 chart2/qa/extras/chart2dump/reference/legendtest/legend_on_left_side.txt create mode 100644 chart2/qa/extras/chart2dump/reference/legendtest/legend_on_right_side.txt create mode 100644 chart2/qa/extras/chart2dump/reference/legendtest/legend_on_top.txt create mode 100644 chart2/qa/extras/chart2dump/reference/legendtest/many_legend_entries.txt create mode 100644 chart2/qa/extras/chart2dump/reference/legendtest/minimal_legend_test.txt create mode 100644 chart2/qa/extras/chart2dump/reference/legendtest/multiple_categories.txt create mode 100644 chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/piecharttest/exploded_pie_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/piecharttest/normal_pie_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/piecharttest/pie_chart_many_slices.txt create mode 100644 chart2/qa/extras/chart2dump/reference/piecharttest/rotated_pie_chart.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_lines_and_points.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_lines_only.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_points_only.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_lines_and_points.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_lines_only.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_points_only.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_lines_and_points.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_lines_only.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_points_only.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_lines_and_points.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_lines_only.txt create mode 100644 chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_points_only.txt create mode 100644 chart2/qa/extras/chart2export.cxx create mode 100644 chart2/qa/extras/chart2export2.cxx create mode 100644 chart2/qa/extras/chart2export3.cxx create mode 100644 chart2/qa/extras/chart2geometry.cxx create mode 100644 chart2/qa/extras/chart2import.cxx create mode 100644 chart2/qa/extras/chart2import2.cxx create mode 100644 chart2/qa/extras/charttest.hxx create mode 100644 chart2/qa/extras/data/doc/chart.doc create mode 100644 chart2/qa/extras/data/docx/3d-bar-label.docx create mode 100644 chart2/qa/extras/data/docx/Bar_horizontal_cone.docx create mode 100644 chart2/qa/extras/data/docx/DisplayUnits.docx create mode 100644 chart2/qa/extras/data/docx/FDO74430.docx create mode 100644 chart2/qa/extras/data/docx/FDO75975.docx create mode 100644 chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx create mode 100644 chart2/qa/extras/data/docx/MSO_axis_position.docx create mode 100644 chart2/qa/extras/data/docx/PieChartDataLabels.docx create mode 100644 chart2/qa/extras/data/docx/TableOnPage3.docx create mode 100644 chart2/qa/extras/data/docx/UpDownBars.docx create mode 100644 chart2/qa/extras/data/docx/area-chart-labels.docx create mode 100644 chart2/qa/extras/data/docx/bar-chart-labels.docx create mode 100644 chart2/qa/extras/data/docx/barChartRotation.docx create mode 100644 chart2/qa/extras/data/docx/bubblechart.docx create mode 100644 chart2/qa/extras/data/docx/chart.docx create mode 100644 chart2/qa/extras/data/docx/clustered-bar-chart-labels.docx create mode 100644 chart2/qa/extras/data/docx/data-label-borders.docx create mode 100644 chart2/qa/extras/data/docx/data_point_inherited_color.docx create mode 100644 chart2/qa/extras/data/docx/doughnut-chart-labels.docx create mode 100644 chart2/qa/extras/data/docx/doughnutChart.docx create mode 100644 chart2/qa/extras/data/docx/fdo74115_WallBitmapFill.docx create mode 100644 chart2/qa/extras/data/docx/fdo74115_WallGradientFill.docx create mode 100644 chart2/qa/extras/data/docx/fdo78290_Combination_Chart_Marker_x.docx create mode 100644 chart2/qa/extras/data/docx/fdo78290_Line_Chart_Marker_x.docx create mode 100644 chart2/qa/extras/data/docx/fdo78290_Scatter_Chart_Marker_x.docx create mode 100644 chart2/qa/extras/data/docx/fdo83058_dlblPos.docx create mode 100644 chart2/qa/extras/data/docx/line-chart-label-default-placement.docx create mode 100644 chart2/qa/extras/data/docx/pieChartRotation.docx create mode 100644 chart2/qa/extras/data/docx/piechart_deleted_legend_entry.docx create mode 100644 chart2/qa/extras/data/docx/radar-chart-labels.docx create mode 100644 chart2/qa/extras/data/docx/scatter-chart-text-x-values.docx create mode 100644 chart2/qa/extras/data/docx/tdf121744.docx create mode 100644 chart2/qa/extras/data/docx/tdf123206.docx create mode 100644 chart2/qa/extras/data/docx/tdf124083.docx create mode 100644 chart2/qa/extras/data/docx/tdf124243.docx create mode 100644 chart2/qa/extras/data/docx/tdf125337.docx create mode 100644 chart2/qa/extras/data/docx/tdf128794.docx create mode 100644 chart2/qa/extras/data/docx/tdf132174.docx create mode 100644 chart2/qa/extras/data/docx/tdf133632.docx create mode 100644 chart2/qa/extras/data/docx/tdf134111.docx create mode 100644 chart2/qa/extras/data/docx/tdf134255.docx create mode 100644 chart2/qa/extras/data/docx/tdf136650.docx create mode 100644 chart2/qa/extras/data/docx/tdf139658.docx create mode 100644 chart2/qa/extras/data/docx/tdf143130.docx create mode 100644 chart2/qa/extras/data/docx/tdf91250.docx create mode 100644 chart2/qa/extras/data/docx/testAreaChartLoad.docx create mode 100644 chart2/qa/extras/data/docx/testAxisTitlePosition.docx create mode 100644 chart2/qa/extras/data/docx/testBarChart.docx create mode 100644 chart2/qa/extras/data/docx/testBarChartDataPointPropDOCX.docx create mode 100644 chart2/qa/extras/data/docx/testChartDataTable.docx create mode 100644 chart2/qa/extras/data/docx/testChartTitlePropertiesBitmapFill.docx create mode 100644 chart2/qa/extras/data/docx/testChartTitlePropertiesColorFill.docx create mode 100644 chart2/qa/extras/data/docx/testChartTitlePropertiesGradientFill.docx create mode 100644 chart2/qa/extras/data/docx/testColorGradientWithTransparency.docx create mode 100644 chart2/qa/extras/data/docx/testCustomlabeltext.docx create mode 100644 chart2/qa/extras/data/docx/testLabelSeparator.docx create mode 100644 chart2/qa/extras/data/docx/testMultilevelCategoryAxis.docx create mode 100644 chart2/qa/extras/data/docx/testMultipleChart.docx create mode 100644 chart2/qa/extras/data/docx/testMultiplechartembeddings.docx create mode 100644 chart2/qa/extras/data/docx/testSeriesIdxOrder.docx create mode 100644 chart2/qa/extras/data/docx/testSimpleCategoryAxis.docx create mode 100644 chart2/qa/extras/data/docx/testStockChart.docx create mode 100644 chart2/qa/extras/data/docx/testTdf108110.docx create mode 100644 chart2/qa/extras/data/docx/testTdf114179.docx create mode 100644 chart2/qa/extras/data/docx/testTdf122226.docx create mode 100644 chart2/qa/extras/data/docx/testchartoleobjectembeddings.docx create mode 100644 chart2/qa/extras/data/docx/testcustomshapepos.docx create mode 100644 chart2/qa/extras/data/fods/stacked-column-chart.fods create mode 100644 chart2/qa/extras/data/odp/BarChartVeryLongLabel.odp create mode 100644 chart2/qa/extras/data/odp/chart.odp create mode 100644 chart2/qa/extras/data/odp/ellipticalGradientFill.odp create mode 100644 chart2/qa/extras/data/odp/tdf119029.odp create mode 100644 chart2/qa/extras/data/odp/tdf121189.odp create mode 100644 chart2/qa/extras/data/odp/tdf123206.odp create mode 100644 chart2/qa/extras/data/odp/tdf128345_ChartArea_CG_TS.odp create mode 100644 chart2/qa/extras/data/odp/tdf128345_ChartWall_CS_TG.odp create mode 100644 chart2/qa/extras/data/odp/tdf128345_Legend_CS_TG_axial.odp create mode 100644 chart2/qa/extras/data/ods/ErrorBarRange.ods create mode 100644 chart2/qa/extras/data/ods/PivotChartRoundTrip.ods create mode 100644 chart2/qa/extras/data/ods/PivotTableExample.ods create mode 100644 chart2/qa/extras/data/ods/axis-numformats-linked.ods create mode 100644 chart2/qa/extras/data/ods/axis_number_format.ods create mode 100644 chart2/qa/extras/data/ods/chart.ods create mode 100644 chart2/qa/extras/data/ods/chartWithDotInSheetName.ods create mode 100644 chart2/qa/extras/data/ods/combined_chart_secondary_axis.ods create mode 100644 chart2/qa/extras/data/ods/error_bar.ods create mode 100644 chart2/qa/extras/data/ods/error_bar_properties.ods create mode 100644 chart2/qa/extras/data/ods/error_bar_range.ods create mode 100644 chart2/qa/extras/data/ods/fdo60083.ods create mode 100644 chart2/qa/extras/data/ods/labelString.ods create mode 100644 chart2/qa/extras/data/ods/legend_overlay.ods create mode 100644 chart2/qa/extras/data/ods/moving-type.ods create mode 100644 chart2/qa/extras/data/ods/multilevelcat.ods create mode 100644 chart2/qa/extras/data/ods/multiple_axis.ods create mode 100644 chart2/qa/extras/data/ods/pie_chart_100_and_0.ods create mode 100644 chart2/qa/extras/data/ods/secondary_axis.ods create mode 100644 chart2/qa/extras/data/ods/ser_labels.ods create mode 100644 chart2/qa/extras/data/ods/smoothedLines.ods create mode 100644 chart2/qa/extras/data/ods/stepped_lines.ods create mode 100644 chart2/qa/extras/data/ods/tdf101894.ods create mode 100644 chart2/qa/extras/data/ods/tdf107097.ods create mode 100644 chart2/qa/extras/data/ods/tdf108021.ods create mode 100644 chart2/qa/extras/data/ods/tdf120348.ods create mode 100644 chart2/qa/extras/data/ods/tdf123774.ods create mode 100644 chart2/qa/extras/data/ods/tdf128432.ods create mode 100644 chart2/qa/extras/data/ods/tdf131115.ods create mode 100644 chart2/qa/extras/data/ods/tdf131979.ods create mode 100644 chart2/qa/extras/data/ods/tdf132076.ods create mode 100644 chart2/qa/extras/data/ods/tdf135366_data_label_series.ods create mode 100644 chart2/qa/extras/data/ods/tdf136011.ods create mode 100644 chart2/qa/extras/data/ods/tdf136024.ods create mode 100644 chart2/qa/extras/data/ods/tdf146066.ods create mode 100644 chart2/qa/extras/data/ods/tdf146463.ods create mode 100644 chart2/qa/extras/data/ods/tdf148142.ods create mode 100644 chart2/qa/extras/data/ods/tdf151091.ods create mode 100644 chart2/qa/extras/data/ods/tdf158223.ods create mode 100644 chart2/qa/extras/data/ods/tdf59857.ods create mode 100644 chart2/qa/extras/data/ods/tdf62057.ods create mode 100644 chart2/qa/extras/data/ods/tdf64224.ods create mode 100644 chart2/qa/extras/data/ods/tdf72776.ods create mode 100644 chart2/qa/extras/data/ods/tdf86624.ods create mode 100644 chart2/qa/extras/data/ods/tdf96161.ods create mode 100644 chart2/qa/extras/data/ods/testChartMainWithSubTitle.ods create mode 100644 chart2/qa/extras/data/ods/testChartSubTitle.ods create mode 100644 chart2/qa/extras/data/ods/testColorGradientWithTransparency.ods create mode 100644 chart2/qa/extras/data/ods/test_CrossBetween.ods create mode 100644 chart2/qa/extras/data/ods/trend_calculators.ods create mode 100644 chart2/qa/extras/data/ods/trendline.ods create mode 100644 chart2/qa/extras/data/odt/axis-position.odt create mode 100644 chart2/qa/extras/data/odt/chart.odt create mode 100644 chart2/qa/extras/data/odt/multilevelcat.odt create mode 100644 chart2/qa/extras/data/odt/scatter-plot-labels.odt create mode 100644 chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt create mode 100644 chart2/qa/extras/data/odt/tdf108022.odt create mode 100644 chart2/qa/extras/data/odt/tdf114657.odt create mode 100644 chart2/qa/extras/data/odt/tdf128733.odt create mode 100644 chart2/qa/extras/data/odt/tdf131143.odt create mode 100644 chart2/qa/extras/data/odt/tdf135366_data_label_export.odt create mode 100644 chart2/qa/extras/data/odt/tdf135366_data_label_point.odt create mode 100644 chart2/qa/extras/data/odt/testPieChartWallLineStyle.odt create mode 100644 chart2/qa/extras/data/ppt/chart.ppt create mode 100644 chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx create mode 100644 chart2/qa/extras/data/pptx/bnc864396.pptx create mode 100644 chart2/qa/extras/data/pptx/bnc882383.pptx create mode 100644 chart2/qa/extras/data/pptx/bnc889755.pptx create mode 100644 chart2/qa/extras/data/pptx/chart.pptx create mode 100644 chart2/qa/extras/data/pptx/percentage-number-formats.pptx create mode 100644 chart2/qa/extras/data/pptx/sparse-chart.pptx create mode 100644 chart2/qa/extras/data/pptx/stacked-bar-chart-hidden-series.pptx create mode 100644 chart2/qa/extras/data/pptx/stacked-non-stacked-mix-y-axis.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf105517.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf106217.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf115107-2.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf115107.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf115859.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf116163.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf121205.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf122765.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf125444.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf127393.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf127720.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf127811.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf128345_ChartArea_CG_TS.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf128345_ChartWall_CS_TG.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf128345_Legend_CS_TG_axial.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf135366_CustomLabelText.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf150176.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf48041.pptx create mode 100644 chart2/qa/extras/data/pptx/tdf60316.pptx create mode 100644 chart2/qa/extras/data/pptx/testChartTitlePropertiesBitmapFill.pptx create mode 100644 chart2/qa/extras/data/pptx/testChartTitlePropertiesColorFill.pptx create mode 100644 chart2/qa/extras/data/pptx/testChartTitlePropertiesGradientFill.pptx create mode 100644 chart2/qa/extras/data/xls/axis_sourceformatting.xls create mode 100644 chart2/qa/extras/data/xls/chart.xls create mode 100644 chart2/qa/extras/data/xls/piechart_outside.xls create mode 100644 chart2/qa/extras/data/xls/source_number_format_axis.xls create mode 100644 chart2/qa/extras/data/xlsx/ChartDataTable.xlsx create mode 100644 chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx create mode 100644 chart2/qa/extras/data/xlsx/add_series_secondary_axis.xlsx create mode 100644 chart2/qa/extras/data/xlsx/auto_marker_excel10.xlsx create mode 100644 chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx create mode 100644 chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx create mode 100644 chart2/qa/extras/data/xlsx/axis-label-rotation.xlsx create mode 100644 chart2/qa/extras/data/xlsx/axis_character_properties.xlsx create mode 100644 chart2/qa/extras/data/xlsx/axis_title_default_rotation.xlsx create mode 100644 chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx create mode 100644 chart2/qa/extras/data/xlsx/axis_title_rotation.xlsx create mode 100644 chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx create mode 100644 chart2/qa/extras/data/xlsx/barchart_outend.xlsx create mode 100644 chart2/qa/extras/data/xlsx/barchart_totalsrow.xlsx create mode 100644 chart2/qa/extras/data/xlsx/bubble_chart_simple.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart-area-style-border.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart-auto-background.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart-text-can-overlap.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart_label_text_break.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart_pie2007.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart_title.xlsx create mode 100644 chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx create mode 100644 chart2/qa/extras/data/xlsx/combined_chart_secondary_axis.xlsx create mode 100644 chart2/qa/extras/data/xlsx/custom_data_label.xlsx create mode 100644 chart2/qa/extras/data/xlsx/data_label.xlsx create mode 100644 chart2/qa/extras/data/xlsx/data_labels_fill_color.xlsx create mode 100644 chart2/qa/extras/data/xlsx/deleted_data_labels.xlsx create mode 100644 chart2/qa/extras/data/xlsx/deleted_legend_entry.xlsx create mode 100644 chart2/qa/extras/data/xlsx/deleted_legend_entry2.xlsx create mode 100644 chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx create mode 100644 chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx create mode 100644 chart2/qa/extras/data/xlsx/empty_chart.xlsx create mode 100644 chart2/qa/extras/data/xlsx/external_str_ref.xlsx create mode 100644 chart2/qa/extras/data/xlsx/fdo54361-1.xlsx create mode 100644 chart2/qa/extras/data/xlsx/fdo54361.xlsx create mode 100644 chart2/qa/extras/data/xlsx/fdo70609.xlsx create mode 100644 chart2/qa/extras/data/xlsx/fdo78080.xlsx create mode 100644 chart2/qa/extras/data/xlsx/gapWidth.xlsx create mode 100644 chart2/qa/extras/data/xlsx/hidden_cells.xlsx create mode 100644 chart2/qa/extras/data/xlsx/incorrect_label_position.xlsx create mode 100644 chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx create mode 100644 chart2/qa/extras/data/xlsx/majorTickMark.xlsx create mode 100644 chart2/qa/extras/data/xlsx/markerColor.xlsx create mode 100644 chart2/qa/extras/data/xlsx/minorTickMark.xlsx create mode 100644 chart2/qa/extras/data/xlsx/no_marker.xlsx create mode 100644 chart2/qa/extras/data/xlsx/number-formats.xlsx create mode 100644 chart2/qa/extras/data/xlsx/pie_chart_datapoint_explosion.xlsx create mode 100644 chart2/qa/extras/data/xlsx/piechart_deleted_legendentry.xlsx create mode 100644 chart2/qa/extras/data/xlsx/piechart_legend.xlsx create mode 100644 chart2/qa/extras/data/xlsx/piechart_outside.xlsx create mode 100644 chart2/qa/extras/data/xlsx/plotVisOnly.xlsx create mode 100644 chart2/qa/extras/data/xlsx/plot_area_manual_layout.xlsx create mode 100644 chart2/qa/extras/data/xlsx/rAngAx.xlsx create mode 100644 chart2/qa/extras/data/xlsx/secondary_axis_title_default_rotation.xlsx create mode 100644 chart2/qa/extras/data/xlsx/ser_labels.xlsx create mode 100644 chart2/qa/extras/data/xlsx/smoothed_series.xlsx create mode 100644 chart2/qa/extras/data/xlsx/smoothed_series2007.xlsx create mode 100644 chart2/qa/extras/data/xlsx/strict_chart.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf100084.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf108107.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf111173.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf111824.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf114139.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf115012.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf122031.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf122915.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf124817.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf126033.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf126115.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf127777.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf128619.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf128621.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf128627.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf128633.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf128634.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf128732.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf130657.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf130986.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf132076.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf133190_tdf133191.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf133376.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf134118.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf134225.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf134978.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf135184RoundLineCap.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf135184RoundLineCap2.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf136105.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf136267.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf136752.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf137505.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf137734.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf137917.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf138204.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf140489.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf142351.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf143127.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf143942.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf150434.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf81396.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf90876.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdf98690.xlsx create mode 100644 chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx create mode 100644 chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testBarChartDataPointPropXLSX.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testChartTitlePropertiesBitmapFill.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testChartTitlePropertiesColorFill.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testChartTitlePropertiesGradientFill.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testCombinedChartAxis.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testCustomPosDataLabels.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testDataPointLabelCustomPos.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testDataseriesOverlapStackedChart.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testSecondaryAxis.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testTdf130032.xlsx create mode 100644 chart2/qa/extras/data/xlsx/testTdf90749.xlsx create mode 100644 chart2/qa/extras/data/xlsx/title_character_properties.xlsx create mode 100644 chart2/qa/extras/data/xlsx/title_manual_layout.xlsx create mode 100644 chart2/qa/extras/data/xlsx/trendline.xlsx create mode 100644 chart2/qa/extras/data/xlsx/trendline2007.xlsx create mode 100644 chart2/qa/extras/data/xlsx/vary_color.xlsx create mode 100644 chart2/qa/extras/data/xlsx/vary_color2007.xlsx create mode 100644 chart2/qa/extras/data/xlsx/xAxisLabelsRotation.xlsx create mode 100644 chart2/qa/extras/uichart.cxx create mode 100644 chart2/qa/extras/xshape/chart2xshape.cxx create mode 100644 chart2/qa/extras/xshape/data/ods/fdo75075.ods create mode 100644 chart2/qa/extras/xshape/data/ods/property-mapping-bar.ods create mode 100644 chart2/qa/extras/xshape/data/ods/tdf151424.ods create mode 100644 chart2/qa/extras/xshape/data/ods/tdf76649_TrendLineBug.ods create mode 100644 chart2/qa/extras/xshape/data/ods/tdf90839-4.ods create mode 100644 chart2/qa/extras/xshape/data/ods/testChart.ods create mode 100644 chart2/qa/extras/xshape/data/pptx/tdf149204.pptx create mode 100644 chart2/qa/extras/xshape/data/pptx/tdf88154_LabelRotatedLayout.pptx create mode 100644 chart2/qa/extras/xshape/data/reference/fdo75075.xml create mode 100644 chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml create mode 100644 chart2/qa/extras/xshape/data/reference/tdf149204.xml create mode 100644 chart2/qa/extras/xshape/data/reference/tdf150832.xml create mode 100644 chart2/qa/extras/xshape/data/reference/tdf151424.xml create mode 100644 chart2/qa/extras/xshape/data/reference/tdf90839-1.xml create mode 100644 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml create mode 100644 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml create mode 100644 chart2/qa/extras/xshape/data/reference/tdf90839-4.xml create mode 100644 chart2/qa/extras/xshape/data/reference/testChart.xml create mode 100644 chart2/qa/extras/xshape/data/reference/tolerance.xml create mode 100644 chart2/qa/extras/xshape/data/xls/tdf150832.xls create mode 100644 chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx create mode 100644 chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx create mode 100644 chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx create mode 100644 chart2/qa/unit/chart2-dialogs-test.cxx create mode 100644 chart2/qa/unit/common_functor_test.cxx create mode 100644 chart2/qa/unit/data/chart2-dialogs-test.txt create mode 100644 chart2/qa/unit/data/tolerance.xml create mode 100644 chart2/qa/unoapi/knownissues.xcl create mode 100644 chart2/qa/unoapi/sch.sce create mode 100644 chart2/qa/unoapi/testdocuments/TransparencyChart.sxs create mode 100644 chart2/qa/unoapi/testdocuments/emptyChart.sds create mode 100644 chart2/qa/unoapi/testdocuments/space-metal.jpg (limited to 'chart2/qa') diff --git a/chart2/qa/TestCaseOldAPI.java b/chart2/qa/TestCaseOldAPI.java new file mode 100644 index 0000000000..f5bc4f571c --- /dev/null +++ b/chart2/qa/TestCaseOldAPI.java @@ -0,0 +1,957 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +// package name: as default, start with complex +package qa; + +import complexlib.ComplexTestCase; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.Type; +import java.io.PrintWriter; +import com.sun.star.lang.*; +import com.sun.star.beans.*; +import com.sun.star.frame.*; +import com.sun.star.chart.*; +import com.sun.star.drawing.*; +import com.sun.star.awt.*; +import com.sun.star.container.*; +import com.sun.star.util.XCloseable; +import com.sun.star.util.CloseVetoException; +import com.sun.star.uno.AnyConverter; +import util.utils; + +/** + * The following Complex Test will test the + * com.sun.star.document.IndexedPropertyValues + * service + */ + +public class TestCaseOldAPI extends ComplexTestCase { + + // The name of the tested service + private static final String testedServiceName = + "com.sun.star.chart.ChartDocument"; + + // The first of the mandatory functions: + /** + * Return the name of the test. + * In this case it is the actual name of the service. + * @return The tested service. + */ + @Override + public String getTestObjectName() { + return testedServiceName; + } + + // The second of the mandatory functions: return all test methods as an + // array. There is only one test function in this example. + /** + * Return all test methods. + * @return The test methods. + */ + @Override + public String[] getTestMethodNames() { + // For some tests a view needs to be created. Accessing the model via + // this program and the view may lead to problems + boolean bAvoidViewCreation = false; + + if( bAvoidViewCreation ) + return new String[] { + "testData", + "testChartType", + "testArea", + "testAggregation", + "testFactory", + "testDataSeriesAndPoints", + "testStatistics", + "testStockProperties" + }; + + return new String[] { + "testData", + "testChartType", + "testTitle", + "testSubTitle", + "testDiagram", + "testAxis", + "testLegend", + "testArea", + "testAggregation", + "testFactory", + "testDataSeriesAndPoints", + "testStatistics", + "testStockProperties" + }; + } + + + + public void before() + { + // set to "true" to get a view + mbCreateView = true; + + if( mbCreateView ) + mxChartModel = createDocument( "schart" ); + else + mxChartModel = createChartModel(); + + mxOldDoc = UnoRuntime.queryInterface( + XChartDocument.class, mxChartModel ); + } + + + + public void after() + { + XCloseable xCloseable = UnoRuntime.queryInterface( + XCloseable.class, mxChartModel ); + assure( "document is no XCloseable", xCloseable != null ); + + // do not close document if there exists a view + if( ! mbCreateView ) + { + try + { + xCloseable.close( true ); + } + catch( CloseVetoException ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + } + + + + public void testTitle() + { + try + { + XPropertySet xDocProp = UnoRuntime.queryInterface( + XPropertySet.class, mxOldDoc ); + assure( "Chart Document is no XPropertySet", xDocProp != null ); + xDocProp.setPropertyValue( "HasMainTitle", Boolean.TRUE); + assure( "Property HasMainTitle", AnyConverter.toBoolean( + xDocProp.getPropertyValue( "HasMainTitle" ))); + + XShape xTitleShape = mxOldDoc.getTitle(); + XPropertySet xTitleProp = UnoRuntime.queryInterface( + XPropertySet.class, xTitleShape ); + + // set property via old API + if( xTitleProp != null ) + { + String aTitle = " Overwritten by Old API "; + float fHeight = (float)17.0; + + xTitleProp.setPropertyValue( "String", aTitle ); + xTitleProp.setPropertyValue( "CharHeight", Float.valueOf( fHeight ) ); + + float fNewHeight = AnyConverter.toFloat( xTitleProp.getPropertyValue( "CharHeight" ) ); + assure( "Changing CharHeight via old API failed", fNewHeight == fHeight ); + + String aNewTitle = AnyConverter.toString( xTitleProp.getPropertyValue( "String" ) ); + assure( "Property \"String\" failed", aNewTitle.equals( aTitle )); + } + + // move title + Point aSetPos = new Point(); + aSetPos.X = 1000; + aSetPos.Y = 200; + xTitleShape.setPosition( aSetPos ); + + Point aNewPos = xTitleShape.getPosition(); + assure( "Title Position X", approxEqual( aNewPos.X, aSetPos.X, 1 )); + assure( "Title Position Y", approxEqual( aNewPos.Y, aSetPos.Y, 1 )); + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testSubTitle() + { + try + { + XPropertySet xDocProp = UnoRuntime.queryInterface( + XPropertySet.class, mxOldDoc ); + assure( "Chart Document is no XPropertySet", xDocProp != null ); + xDocProp.setPropertyValue( "HasSubTitle", Boolean.TRUE); + assure( "Property HasSubTitle", AnyConverter.toBoolean( + xDocProp.getPropertyValue( "HasSubTitle" ))); + + XShape xTitleShape = mxOldDoc.getSubTitle(); + XPropertySet xTitleProp = UnoRuntime.queryInterface( + XPropertySet.class, xTitleShape ); + + // set Property via old API + if( xTitleProp != null ) + { + int nColor = 0x009acd; // DeepSkyBlue3 + float fWeight = FontWeight.BOLD; + float fHeight = (float)14.0; + + xTitleProp.setPropertyValue( "CharColor", Integer.valueOf( nColor ) ); + xTitleProp.setPropertyValue( "CharWeight", Float.valueOf( fWeight )); + xTitleProp.setPropertyValue( "CharHeight", Float.valueOf( fHeight ) ); + + int nNewColor = AnyConverter.toInt( xTitleProp.getPropertyValue( "CharColor" ) ); + assure( "Changing CharColor via old API failed", nNewColor == nColor ); + + float fNewWeight = AnyConverter.toFloat( xTitleProp.getPropertyValue( "CharWeight" ) ); + assure( "Changing CharWeight via old API failed", fNewWeight == fWeight ); + + float fNewHeight = AnyConverter.toFloat( xTitleProp.getPropertyValue( "CharHeight" ) ); + assure( "Changing CharHeight via old API failed", fNewHeight == fHeight ); + } + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testDiagram() + { + try + { + // testing wall + XDiagram xDia = mxOldDoc.getDiagram(); + if( xDia != null ) + { + X3DDisplay xDisp = UnoRuntime.queryInterface( + X3DDisplay.class, xDia ); + assure( "X3DDisplay not supported", xDisp != null ); + + // Wall + XPropertySet xProp = xDisp.getWall(); + if( xProp != null ) + { + int nColor = 0xffe1ff; // thistle1 + xProp.setPropertyValue( "FillColor", Integer.valueOf( nColor ) ); + int nNewColor = AnyConverter.toInt( xProp.getPropertyValue( "FillColor" ) ); + assure( "Changing FillColor via old API failed", nNewColor == nColor ); + } + + assure( "Wrong Diagram Type", xDia.getDiagramType().equals( + "com.sun.star.chart.BarDiagram" )); + + // Diagram properties + xProp = UnoRuntime.queryInterface( XPropertySet.class, xDia ); + assure( "Diagram is no property set", xProp != null ); + + // y-axis + boolean bFirstYAxisText = false; + xProp.setPropertyValue( "HasYAxisDescription", Boolean.valueOf( bFirstYAxisText )); + boolean bNewFirstYAxisText = AnyConverter.toBoolean( + xProp.getPropertyValue( "HasYAxisDescription" )); + assure( "Removing description of first y-axis", bNewFirstYAxisText == bFirstYAxisText ); + + // second y-axis + boolean bSecondaryYAxis = true; + xProp.setPropertyValue( "HasSecondaryYAxis", Boolean.valueOf( bSecondaryYAxis )); + boolean bNewSecYAxisValue = AnyConverter.toBoolean( + xProp.getPropertyValue( "HasSecondaryYAxis" )); + assure( "Adding a second y-axis does not work", bNewSecYAxisValue == bSecondaryYAxis ); + + XTwoAxisYSupplier xSecYAxisSuppl = UnoRuntime.queryInterface( + XTwoAxisYSupplier.class, xDia ); + assure( "XTwoAxisYSupplier not implemented", xSecYAxisSuppl != null ); + assure( "No second y-axis found", xSecYAxisSuppl.getSecondaryYAxis() != null ); + } + + // move diagram + { + XShape xDiagramShape = UnoRuntime.queryInterface( + XShape.class, xDia ); + + Point aOldPos = xDiagramShape.getPosition(); + int xDiff = 20; + int yDiff = 20; + Point aSetPos = new Point(); + aSetPos.X = aOldPos.X + xDiff; + aSetPos.Y = aOldPos.Y + yDiff; + xDiagramShape.setPosition( aSetPos ); + + Point aNewPos = xDiagramShape.getPosition(); + assure( "Diagram Position X", approxEqual( aNewPos.X, aSetPos.X, 1 )); + assure( "Diagram Position Y", approxEqual( aNewPos.Y, aSetPos.Y, 1 )); + } + + // size diagram + { + XShape xDiagramShape = UnoRuntime.queryInterface( + XShape.class, xDia ); + + Size aOldSize = xDiagramShape.getSize(); + int xDiff = aOldSize.Width/2+2; + int yDiff = aOldSize.Height/2+2; + Size aSetSize = new Size(); + aSetSize.Width = aOldSize.Width - xDiff; + aSetSize.Height = aOldSize.Height - yDiff; + xDiagramShape.setSize( aSetSize ); + + Size aNewSize = xDiagramShape.getSize(); + assure( "Diagram Width", approxEqual( aNewSize.Width, aSetSize.Width, 2 )); + assure( "Diagram Height", approxEqual( aNewSize.Height, aSetSize.Height, 2 )); + } + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testAxis() + { + try + { + XAxisYSupplier xYAxisSuppl = UnoRuntime.queryInterface( + XAxisYSupplier.class, mxOldDoc.getDiagram() ); + assure( "Diagram is no y-axis supplier", xYAxisSuppl != null ); + + XPropertySet xProp = xYAxisSuppl.getYAxis(); + assure( "No y-axis found", xProp != null ); + + double fMax1, fMax2; + Object oMax = xProp.getPropertyValue( "Max" ); + assure( "No Maximum set", AnyConverter.isDouble( oMax )); + fMax1 = AnyConverter.toDouble( oMax ); + log.println( "Maximum retrieved: " + fMax1 ); + //todo: the view has to be built before there is an explicit value + xProp.setPropertyValue( "AutoMax", Boolean.FALSE); + oMax = xProp.getPropertyValue( "Max" ); + assure( "No Maximum set", AnyConverter.isDouble( oMax )); + fMax2 = AnyConverter.toDouble( oMax ); + log.println( "Maximum with AutoMax off: " + fMax2 ); + assure( "maxima differ", fMax1 == fMax2 ); + + double nNewMax = 12.3; + double nNewOrigin = 2.7; + + xProp.setPropertyValue( "Max", Double.valueOf( nNewMax )); + assure( "AutoMax is on", ! AnyConverter.toBoolean( xProp.getPropertyValue( "AutoMax" )) ); + + assure( "Maximum value invalid", + utils.approxEqual( + AnyConverter.toDouble( xProp.getPropertyValue( "Max" )), + nNewMax )); + + xProp.setPropertyValue( "AutoMin", Boolean.TRUE); + assure( "AutoMin is off", AnyConverter.toBoolean( xProp.getPropertyValue( "AutoMin" )) ); + + xProp.setPropertyValue( "Origin", Double.valueOf( nNewOrigin )); + assure( "Origin invalid", + utils.approxEqual( + AnyConverter.toDouble( xProp.getPropertyValue( "Origin" )), + nNewOrigin )); + xProp.setPropertyValue( "AutoOrigin", Boolean.TRUE); + assure( "AutoOrigin is off", AnyConverter.toBoolean( xProp.getPropertyValue( "AutoOrigin" )) ); + Object oOrigin = xProp.getPropertyValue( "Origin" ); + assure( "No Origin set", AnyConverter.isDouble( oOrigin )); + log.println( "Origin retrieved: " + AnyConverter.toDouble( oOrigin )); + + xProp.setPropertyValue( "Logarithmic", Boolean.TRUE); + assure( "Scaling is not logarithmic", + AnyConverter.toBoolean( xProp.getPropertyValue( "Logarithmic" )) ); + xProp.setPropertyValue( "Logarithmic", Boolean.FALSE); + assure( "Scaling is not logarithmic", + ! AnyConverter.toBoolean( xProp.getPropertyValue( "Logarithmic" )) ); + + int nNewColor = 0xcd853f; // peru + xProp.setPropertyValue( "LineColor", Integer.valueOf( nNewColor )); + assure( "Property LineColor", + AnyConverter.toInt( xProp.getPropertyValue( "LineColor" )) == nNewColor ); + float fNewCharHeight = (float)(16.0); + xProp.setPropertyValue( "CharHeight", Float.valueOf( fNewCharHeight )); + assure( "Property CharHeight", + AnyConverter.toFloat( xProp.getPropertyValue( "CharHeight" )) == fNewCharHeight ); + + int nNewTextRotation = 700; // in 1/100 degrees + xProp.setPropertyValue( "TextRotation", Integer.valueOf( nNewTextRotation )); + assure( "Property TextRotation", + AnyConverter.toInt( xProp.getPropertyValue( "TextRotation" )) == nNewTextRotation ); + + double fStepMain = 10.0; + xProp.setPropertyValue( "StepMain", Double.valueOf( fStepMain )); + assure( "Property StepMain", + AnyConverter.toDouble( xProp.getPropertyValue( "StepMain" )) == fStepMain ); + + // note: fStepHelp must be a divider of fStepMain, because + // internally, the help-step is stored as an integer number of + // substeps + double fStepHelp = 5.0; + xProp.setPropertyValue( "StepHelp", Double.valueOf( fStepHelp )); + assure( "Property StepHelp", + AnyConverter.toDouble( xProp.getPropertyValue( "StepHelp" )) == fStepHelp ); + + xProp.setPropertyValue( "DisplayLabels", Boolean.FALSE); + assure( "Property DisplayLabels", ! AnyConverter.toBoolean( + xProp.getPropertyValue( "DisplayLabels" ))); + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testLegend() + { + XShape xLegend = mxOldDoc.getLegend(); + assure( "No Legend returned", xLegend != null ); + + XPropertySet xLegendProp = UnoRuntime.queryInterface( + XPropertySet.class, xLegend ); + assure( "Legend is no property set", xLegendProp != null ); + + try + { + ChartLegendPosition eNewPos = ChartLegendPosition.BOTTOM; + xLegendProp.setPropertyValue( "Alignment", eNewPos ); + assure( "Property Alignment", + AnyConverter.toObject( + new Type( ChartLegendPosition.class ), + xLegendProp.getPropertyValue( "Alignment" )) == eNewPos ); + + float fNewCharHeight = (float)(11.0); + xLegendProp.setPropertyValue( "CharHeight", Float.valueOf( fNewCharHeight )); + assure( "Property CharHeight", + AnyConverter.toFloat( xLegendProp.getPropertyValue( "CharHeight" )) == fNewCharHeight ); + + // move legend + { + Point aOldPos = xLegend.getPosition(); + int xDiff = 20; + int yDiff = 20; + Point aSetPos = new Point(); + aSetPos.X = aOldPos.X + xDiff; + aSetPos.Y = aOldPos.Y + yDiff; + xLegend.setPosition( aSetPos ); + + Point aNewPos = xLegend.getPosition(); + assure( "Legend Position X", approxEqual( aNewPos.X, aSetPos.X, 1 )); + assure( "Legend Position Y", approxEqual( aNewPos.Y, aSetPos.Y, 1 )); + } + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testArea() + { + XPropertySet xArea = mxOldDoc.getArea(); + assure( "No Area", xArea != null ); + + try + { + int nColor = 0xf5fffa; // mint cream + xArea.setPropertyValue( "FillColor", Integer.valueOf( nColor ) ); + xArea.setPropertyValue( "FillStyle", FillStyle.SOLID ); + + int nNewColor = AnyConverter.toInt( xArea.getPropertyValue( "FillColor" ) ); + assure( "Changing FillColor of Area failed", nNewColor == nColor ); + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testChartType() + { + XMultiServiceFactory xFact = UnoRuntime.queryInterface( + XMultiServiceFactory.class, mxOldDoc ); + assure( "document is no factory", xFact != null ); + + try + { + String aMyServiceName = "com.sun.star.chart.BarDiagram"; + String aServices[] = xFact.getAvailableServiceNames(); + boolean bServiceFound = false; + for( int i = 0; i < aServices.length; ++i ) + { + if( aServices[ i ].equals( aMyServiceName )) + { + bServiceFound = true; + break; + } + } + assure( "getAvailableServiceNames did not return " + aMyServiceName, bServiceFound ); + + if( bServiceFound ) + { + XDiagram xDia = UnoRuntime.queryInterface( + XDiagram.class, xFact.createInstance( aMyServiceName )); + assure( aMyServiceName + " could not be created", xDia != null ); + + mxOldDoc.setDiagram( xDia ); + + XPropertySet xDiaProp = UnoRuntime.queryInterface( + XPropertySet.class, xDia ); + assure( "Diagram is no XPropertySet", xDiaProp != null ); + + xDiaProp.setPropertyValue( "Stacked", Boolean.TRUE); + assure( "StackMode could not be set correctly", + AnyConverter.toBoolean( + xDiaProp.getPropertyValue( "Stacked" ))); + + xDiaProp.setPropertyValue( "Dim3D", Boolean.FALSE); + assure( "Dim3D could not be set correctly", + ! AnyConverter.toBoolean( + xDiaProp.getPropertyValue( "Dim3D" ))); + + xDiaProp.setPropertyValue( "Vertical", Boolean.TRUE); + assure( "Vertical could not be set correctly", + AnyConverter.toBoolean( + xDiaProp.getPropertyValue( "Vertical" ))); + } + + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testAggregation() + { + // query to new type + XChartDocument xDiaProv = UnoRuntime.queryInterface( + XChartDocument.class, mxOldDoc ); + assure( "query to new interface failed", xDiaProv != null ); + + com.sun.star.chart.XChartDocument xDoc = UnoRuntime.queryInterface( + com.sun.star.chart.XChartDocument.class, xDiaProv ); + assure( "querying back to old interface failed", xDoc != null ); + } + + + + public void testDataSeriesAndPoints() + { + try + { + XDiagram xDia = mxOldDoc.getDiagram(); + assure( "Invalid Diagram", xDia != null ); + XMultiServiceFactory xFact = UnoRuntime.queryInterface( + XMultiServiceFactory.class, mxOldDoc ); + assure( "document is no factory", xFact != null ); + + // FillColor + XPropertySet xProp = xDia.getDataRowProperties( 0 ); + int nColor = 0xffd700; // gold + xProp.setPropertyValue( "FillColor", Integer.valueOf( nColor )); + int nNewColor = AnyConverter.toInt( xProp.getPropertyValue( "FillColor" ) ); + assure( "Changing FillColor of Data Series failed", nNewColor == nColor ); + + // Gradient + + // note: the FillGradient property is optional, however it was + // supported in the old chart's API + XNameContainer xGradientTable = UnoRuntime.queryInterface( + XNameContainer.class, + xFact.createInstance( "com.sun.star.drawing.GradientTable" )); + assure( "no gradient table", xGradientTable != null ); + String aGradientName = "NewAPITestGradient"; + Gradient aGradient = new Gradient(); + aGradient.Style = GradientStyle.LINEAR; + aGradient.StartColor = 0xe0ffff; // light cyan + aGradient.EndColor = 0xff8c00; // dark orange + aGradient.Angle = 300; // 30 degrees + aGradient.Border = 15; + aGradient.XOffset = 0; + aGradient.YOffset = 0; + aGradient.StartIntensity = 100; + aGradient.EndIntensity = 80; + aGradient.StepCount = 23; + + xGradientTable.insertByName( aGradientName, aGradient ); + xProp.setPropertyValue( "FillStyle", FillStyle.GRADIENT ); + xProp.setPropertyValue( "FillGradientName", aGradientName ); + String aNewGradientName = AnyConverter.toString( xProp.getPropertyValue( "FillGradientName" )); + assure( "GradientName", aNewGradientName.equals( aGradientName )); + Gradient aNewGradient = (Gradient) AnyConverter.toObject( + new Type( Gradient.class ), + xGradientTable.getByName( aNewGradientName )); + assure( "Gradient Style", aNewGradient.Style == aGradient.Style ); + assure( "Gradient StartColor", aNewGradient.StartColor == aGradient.StartColor ); + assure( "Gradient EndColor", aNewGradient.EndColor == aGradient.EndColor ); + assure( "Gradient Angle", aNewGradient.Angle == aGradient.Angle ); + assure( "Gradient Border", aNewGradient.Border == aGradient.Border ); + assure( "Gradient XOffset", aNewGradient.XOffset == aGradient.XOffset ); + assure( "Gradient YOffset", aNewGradient.YOffset == aGradient.YOffset ); + assure( "Gradient StartIntensity", aNewGradient.StartIntensity == aGradient.StartIntensity ); + assure( "Gradient EndIntensity", aNewGradient.EndIntensity == aGradient.EndIntensity ); + assure( "Gradient StepCount", aNewGradient.StepCount == aGradient.StepCount ); + + // Hatch + xProp = xDia.getDataPointProperties( 1, 0 ); + assure( "No DataPointProperties for (1,0)", xProp != null ); + + // note: the FillHatch property is optional, however it was + // supported in the old chart's API + XNameContainer xHatchTable = UnoRuntime.queryInterface( + XNameContainer.class, + xFact.createInstance( "com.sun.star.drawing.HatchTable" )); + assure( "no hatch table", xHatchTable != null ); + String aHatchName = "NewAPITestHatch"; + Hatch aHatch = new Hatch(); + aHatch.Style = HatchStyle.DOUBLE; + aHatch.Color = 0xd2691e; // chocolate + aHatch.Distance = 200; // 2 mm (?) + aHatch.Angle = 230; // 23 degrees + + xHatchTable.insertByName( aHatchName, aHatch ); + xProp.setPropertyValue( "FillHatchName", aHatchName ); + xProp.setPropertyValue( "FillStyle", FillStyle.HATCH ); + xProp.setPropertyValue( "FillBackground", Boolean.TRUE); + String aNewHatchName = AnyConverter.toString( xProp.getPropertyValue( "FillHatchName" )); + assure( "HatchName", aNewHatchName.equals( aHatchName )); + Hatch aNewHatch = (Hatch) AnyConverter.toObject( + new Type( Hatch.class ), + xHatchTable.getByName( aNewHatchName )); + assure( "Hatch Style", aNewHatch.Style == aHatch.Style ); + assure( "Hatch Color", aNewHatch.Color == aHatch.Color ); + assure( "Hatch Distance", aNewHatch.Distance == aHatch.Distance ); + assure( "Hatch Angle", aNewHatch.Angle == aHatch.Angle ); + assure( "FillBackground", AnyConverter.toBoolean( xProp.getPropertyValue( "FillBackground" )) ); + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testStatistics() + { + try + { + XDiagram xDia = mxOldDoc.getDiagram(); + assure( "Invalid Diagram", xDia != null ); + + XPropertySet xProp = xDia.getDataRowProperties( 0 ); + assure( "No DataRowProperties for first series", xProp != null ); + + xProp.setPropertyValue( "MeanValue", Boolean.TRUE); + assure( "No MeanValue", AnyConverter.toBoolean( xProp.getPropertyValue( "MeanValue" )) ); + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void setStockData_Type4() + { + try + { + XPropertySet xDiaProp = UnoRuntime.queryInterface( + XPropertySet.class, mxOldDoc.getDiagram() ); + + ChartDataRowSource eNewSource = ChartDataRowSource.ROWS; + xDiaProp.setPropertyValue( "DataRowSource", eNewSource ); + assure( "Couldn't set \"DataRowSource\" property at Diagram", + AnyConverter.toObject( + new Type( ChartDataRowSource.class ), + xDiaProp.getPropertyValue( "DataRowSource" )) == eNewSource ); + + double aData[][] = + { + { 100.0, 200.0, 300.0, 250.0, 300.0 }, + { 6.5, 4.5, 6.0, 5.5, 3.5 }, + { 1.0, 1.5, 2.0, 2.5, 3.0 }, + { 6.0, 6.5, 7.0, 6.5, 5.0 }, + { 6.0, 5.5, 4.0, 4.5, 4.0 } + }; + + String[] aRowDescriptions = + { + "Volume", "Open", "Min", "Max", "Close" + }; + + String[] aColumnDescriptions = + { + "First Row", "Second Row", "Third Row", "Fourth Row", "Fifth Row" + }; + + + XChartData xData = mxOldDoc.getData(); + XChartDataArray xDataArray = UnoRuntime.queryInterface( + XChartDataArray.class, xData ); + assure( "document has no XChartDataArray", xDataArray != null ); + + xDataArray.setData( aData ); + xDataArray.setRowDescriptions( aRowDescriptions ); + xDataArray.setColumnDescriptions( aColumnDescriptions ); + + mxOldDoc.attachData( xData ); + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testStockProperties() + { + try + { + setStockData_Type4(); + + XMultiServiceFactory xFact = UnoRuntime.queryInterface( + XMultiServiceFactory.class, mxOldDoc ); + assure( "document is no factory", xFact != null ); + + String aMyServiceName = "com.sun.star.chart.StockDiagram"; + XDiagram xDia = UnoRuntime.queryInterface( + XDiagram.class, xFact.createInstance( aMyServiceName )); + assure( aMyServiceName + " could not be created", xDia != null ); + + mxOldDoc.setDiagram( xDia ); + + XPropertySet xDiaProp = UnoRuntime.queryInterface( + XPropertySet.class, xDia ); + assure( "Diagram is no XPropertySet", xDiaProp != null ); + + xDiaProp.setPropertyValue( "Volume", Boolean.TRUE); + assure( "Has Volume", AnyConverter.toBoolean( xDiaProp.getPropertyValue( "Volume" ))); + + xDiaProp.setPropertyValue( "UpDown", Boolean.TRUE); + assure( "Has UpDown", AnyConverter.toBoolean( xDiaProp.getPropertyValue( "UpDown" ))); + + // MinMaxLine + XStatisticDisplay xMinMaxProvider = UnoRuntime.queryInterface( + XStatisticDisplay.class, xDia ); + assure( "Diagram is no XStatisticDisplay", xMinMaxProvider != null ); + XPropertySet xMinMaxProp = xMinMaxProvider.getMinMaxLine(); + assure( "No MinMaxLine", xMinMaxProp != null ); + + int nLineColor = 0x458b00; // chartreuse4 + xMinMaxProp.setPropertyValue( "LineColor", Integer.valueOf( nLineColor )); + int nNewColor = AnyConverter.toInt( xMinMaxProp.getPropertyValue( "LineColor" ) ); + assure( "Changing LineColor of MinMax Line", nNewColor == nLineColor ); + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testFactory() + { + try + { + XMultiServiceFactory xFact = UnoRuntime.queryInterface( + XMultiServiceFactory.class, mxOldDoc ); + assure( "document is no factory", xFact != null ); + + Object aTestTable = xFact.createInstance( "com.sun.star.drawing.GradientTable" ); + assure( "Couldn't create gradient table via factory", aTestTable != null ); + } + catch( Exception ex ) + { + failed( ex.getMessage() ); + ex.printStackTrace( (PrintWriter)log ); + } + } + + + + public void testData() + { + try + { + // set data + double aData[][] = { + { 1.0, 1.5, 2.0, 2.5, 3.0 }, + { 2.0, 2.5, 3.0, 3.5, 4.0 }, + { 3.0, 3.5, 4.0, 4.5, 5.0 } + }; + + String[] aColumnDescriptions = { + "First Column", "Second Column", "Third Column", + "Fourth Column", "Fifth Column" + }; + + String[] aRowDescriptions = { + "First Row", "Second Row", "Third Row" + }; + + XPropertySet xDiaProp = UnoRuntime.queryInterface( + XPropertySet.class, mxOldDoc.getDiagram() ); + ChartDataRowSource eNewSource = ChartDataRowSource.ROWS; + xDiaProp.setPropertyValue( "DataRowSource", eNewSource ); + assure( "Couldn't set \"DataRowSource\" property at Diagram", + AnyConverter.toObject( + new Type( ChartDataRowSource.class ), + xDiaProp.getPropertyValue( "DataRowSource" )) == eNewSource ); + + XChartData xData = mxOldDoc.getData(); + XChartDataArray xDataArray = UnoRuntime.queryInterface( + XChartDataArray.class, xData ); + assure( "document has no XChartDataArray", xDataArray != null ); + + xDataArray.setData( aData ); + xDataArray.setRowDescriptions( aRowDescriptions ); + xDataArray.setColumnDescriptions( aColumnDescriptions ); + + mxOldDoc.attachData( xData ); + + // get data + double aReadData[][]; + String[] aReadColumnDescriptions; + String[] aReadRowDescriptions; + + // refetch data + xData = mxOldDoc.getData(); + xDataArray = UnoRuntime.queryInterface( + XChartDataArray.class, xData ); + assure( "document has no XChartDataArray", xDataArray != null ); + + aReadData = xDataArray.getData(); + aReadRowDescriptions = xDataArray.getRowDescriptions(); + aReadColumnDescriptions = xDataArray.getColumnDescriptions(); + + // compare to values set before + assure( "Data size differs", aData.length == aReadData.length ); + for( int i=0; i= b )); + } +} diff --git a/chart2/qa/data.chd b/chart2/qa/data.chd new file mode 100644 index 0000000000..01888e4c19 --- /dev/null +++ b/chart2/qa/data.chd @@ -0,0 +1,14 @@ +# Series Labels +Column_1 Column_2 Column_3 + +# Categories +Row_1 Row_2 Row_3 Row_4 + +# Column 1 +9.1 2.4 3.1 4.3 + +# Column 2 +3.2 8.8 1.5 9.02 + +# Column 3 +4.54 9.65 3.7 6.2 diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx new file mode 100644 index 0000000000..d6a87ec057 --- /dev/null +++ b/chart2/qa/extras/PivotChartTest.cxx @@ -0,0 +1,967 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace com::sun::star::table { class XCellRange; } +namespace com::sun::star::util { class XNumberFormats; } + +class PivotChartTest : public ChartTest +{ +public: + PivotChartTest() + : ChartTest("/chart2/qa/extras/data/") + {} + + void testRoundtrip(); + void testChangePivotTable(); + void testPivotChartWithOneColumnField(); + void testPivotChartWithOneRowField(); + void testPivotTableDataProvider_PivotTableFields(); + void testPivotChartRowFieldInOutlineMode(); + void testPivotChartWithDateRowField(); + + CPPUNIT_TEST_SUITE(PivotChartTest); + CPPUNIT_TEST(testRoundtrip); + CPPUNIT_TEST(testChangePivotTable); + CPPUNIT_TEST(testPivotChartWithOneColumnField); + CPPUNIT_TEST(testPivotChartWithOneRowField); + CPPUNIT_TEST(testPivotTableDataProvider_PivotTableFields); + CPPUNIT_TEST(testPivotChartRowFieldInOutlineMode); + CPPUNIT_TEST(testPivotChartWithDateRowField); + CPPUNIT_TEST_SUITE_END(); +}; + +namespace +{ + +void lclModifyOrientation(uno::Reference const & xDescriptor, + std::u16string_view sFieldName, + sheet::DataPilotFieldOrientation eOrientation) +{ + uno::Reference xIndexAccess(xDescriptor->getDataPilotFields(), UNO_SET_THROW); + sal_Int32 nCount = xIndexAccess->getCount(); + for (sal_Int32 i = 0; i < nCount; ++i) + { + uno::Reference xNamed(xIndexAccess->getByIndex(i), UNO_QUERY_THROW); + OUString aName = xNamed->getName(); + uno::Reference xPropSet(xNamed, UNO_QUERY_THROW); + if (aName == sFieldName) + xPropSet->setPropertyValue("Orientation", uno::Any(eOrientation)); + } +} + +void lclModifyFunction(uno::Reference const & xDescriptor, + std::u16string_view sFieldName, + sheet::GeneralFunction eFunction) +{ + uno::Reference xPilotIndexAccess(xDescriptor->getDataPilotFields(), UNO_SET_THROW); + sal_Int32 nCount = xPilotIndexAccess->getCount(); + for (sal_Int32 i = 0; i < nCount; ++i) + { + uno::Reference xNamed(xPilotIndexAccess->getByIndex(i), UNO_QUERY_THROW); + OUString aName = xNamed->getName(); + uno::Reference xPropSet(xNamed, UNO_QUERY_THROW); + if (aName == sFieldName) + xPropSet->setPropertyValue("Function", uno::Any(eFunction)); + } +} + +void lclModifyLayoutInfo(uno::Reference const & xDescriptor, + std::u16string_view sFieldName, + sheet::DataPilotFieldLayoutInfo aLayoutInfo) +{ + uno::Reference xIndexAccess(xDescriptor->getDataPilotFields(), UNO_SET_THROW); + sal_Int32 nCount = xIndexAccess->getCount(); + for (sal_Int32 i = 0; i < nCount; ++i) + { + uno::Reference xNamed(xIndexAccess->getByIndex(i), UNO_QUERY_THROW); + OUString aName = xNamed->getName(); + uno::Reference xPropSet(xNamed, UNO_QUERY_THROW); + if (aName == sFieldName) + { + uno::Any aValue; + aValue <<= aLayoutInfo; + xPropSet->setPropertyValue("LayoutInfo", aValue); + } + } +} + +void lclModifySubtotals(uno::Reference const & xDescriptor, + std::u16string_view sFieldName, + uno::Sequence const & rSubtotalFunctions) +{ + uno::Reference xIndexAccess(xDescriptor->getDataPilotFields(), UNO_SET_THROW); + sal_Int32 nCount = xIndexAccess->getCount(); + for (sal_Int32 i = 0; i < nCount; ++i) + { + uno::Reference xNamed(xIndexAccess->getByIndex(i), UNO_QUERY_THROW); + OUString aName = xNamed->getName(); + uno::Reference xPropSet(xNamed, UNO_QUERY_THROW); + if (aName == sFieldName) + { + uno::Any aValue; + aValue <<= rSubtotalFunctions; + xPropSet->setPropertyValue("Subtotals", aValue); + } + } +} + +void lclModifyColumnGrandTotal(uno::Reference const & xDataPilotDescriptor, bool bTotal) +{ + uno::Reference xProperties(xDataPilotDescriptor, uno::UNO_QUERY_THROW); + xProperties->setPropertyValue("ColumnGrand", uno::Any(bTotal)); +} + +void lclModifyRowGrandTotal(uno::Reference const & xDataPilotDescriptor, bool bTotal) +{ + uno::Reference xProperties(xDataPilotDescriptor, uno::UNO_QUERY_THROW); + xProperties->setPropertyValue("RowGrand", uno::Any(bTotal)); +} + +void lclCheckSequence(std::vector const & reference, + uno::Sequence const & values, + double delta) +{ + CPPUNIT_ASSERT_EQUAL(reference.size(), size_t(values.getLength())); + for (size_t i = 0; i < reference.size(); ++i) + { + CPPUNIT_ASSERT_DOUBLES_EQUAL( + reference[i], values[i].get(), delta); + } +} + +void lclCheckCategories(std::vector const & reference, + uno::Reference const & xSequence) +{ + uno::Reference xTextualDataSequence(xSequence, uno::UNO_QUERY_THROW); + uno::Sequence aText = xTextualDataSequence->getTextualData(); + + CPPUNIT_ASSERT_EQUAL(reference.size(), size_t(aText.getLength())); + for (size_t i = 0; i < reference.size(); ++i) + { + CPPUNIT_ASSERT_EQUAL(reference[i], aText[i]); + } +} + +OUString lclGetLabel(Reference const & xChartDoc, sal_Int32 nSeriesIndex) +{ + Reference xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, nSeriesIndex); + return xLabelDataSequence->getData()[0].get(); +} + +uno::Reference lclGetPivotTableByName(sal_Int32 nIndex, OUString const & sPivotTableName, + uno::Reference const & xComponent) +{ + uno::Reference xDoc(xComponent, UNO_QUERY_THROW); + uno::Reference xSheetIndexAccess(xDoc->getSheets(), UNO_QUERY_THROW); + uno::Any aAny = xSheetIndexAccess->getByIndex(nIndex); + uno::Reference xSheet; + CPPUNIT_ASSERT(aAny >>= xSheet); + uno::Reference xDataPilotTablesSupplier(xSheet, uno::UNO_QUERY_THROW); + uno::Reference xDataPilotTables = xDataPilotTablesSupplier->getDataPilotTables(); + return uno::Reference(xDataPilotTables->getByName(sPivotTableName), UNO_QUERY_THROW); +} + +uno::Sequence> + lclGetCategories(Reference const & xChartDoc) +{ + uno::Sequence aArguments( comphelper::InitPropertySequence( + {{"CellRangeRepresentation", uno::Any(OUString("PT@categories"))}} )); + + uno::Reference xDataProvider(xChartDoc->getDataProvider(), uno::UNO_SET_THROW); + return xDataProvider->createDataSource(aArguments)->getDataSequences(); +} + +struct Value +{ + OUString maString; + double mfValue; + bool mbIsValue; + + Value(OUString const & rString) + : maString(rString) + , mfValue(0.0) + , mbIsValue(false) + {} + + Value(double fValue) + : mfValue(fValue) + , mbIsValue(true) + {} +}; + +uno::Reference< sheet::XDataPilotTables> +lclGetDataPilotTables(sal_Int32 nIndex, uno::Reference const & xSheetDoc) +{ + uno::Reference xSpreadsheets = xSheetDoc->getSheets(); + uno::Reference oIndexAccess(xSpreadsheets, uno::UNO_QUERY_THROW); + uno::Reference xSheet; + CPPUNIT_ASSERT(oIndexAccess->getByIndex(nIndex) >>= xSheet); + + // create the test objects + uno::Reference< sheet::XDataPilotTablesSupplier> xDataPilotTablesSupplier(xSheet, uno::UNO_QUERY_THROW); + return xDataPilotTablesSupplier->getDataPilotTables(); +} + +table::CellRangeAddress lclCreateTestData(uno::Reference const & xSheetDoc) +{ + CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is()); + + std::vector aHeaders { + "Country", "City", "Type", "Sales T1", "Sales T2", "Sales T3", "Sales T4", "Date" + }; + + std::vector> aData { + { {"FR"}, {"Paris"}, {"A"}, {123.0}, {223.0}, {323.0}, {423.0}, {"12/14/15"} }, + { {"EN"}, {"London"}, {"A"}, {456.0}, {556.0}, {656.0}, {756.0}, {"12/11/15"} }, + { {"DE"}, {"Berlin"}, {"A"}, {468.0}, {568.0}, {668.0}, {768.0}, {"12/11/15"} }, + { {"FR"}, {"Nantes"}, {"A"}, {694.0}, {794.0}, {894.0}, {994.0}, {"12/11/15"} }, + { {"EN"}, {"Glasgow"}, {"A"}, {298.0}, {398.0}, {498.0}, {598.0}, {"12/11/15"} }, + { {"DE"}, {"Munich"}, {"A"}, {369.0}, {469.0}, {569.0}, {669.0}, {"12/11/15"} }, + { {"FR"}, {"Paris"}, {"B"}, {645.0}, {745.0}, {845.0}, {945.0}, {"12/11/15"} }, + { {"EN"}, {"London"}, {"B"}, {687.0}, {787.0}, {887.0}, {987.0}, {"03/21/17"} }, + { {"DE"}, {"Munich"}, {"B"}, {253.0}, {353.0}, {453.0}, {553.0}, {"12/17/15"} }, + { {"FR"}, {"Nantes"}, {"B"}, {474.0}, {574.0}, {674.0}, {774.0}, {"01/20/16"} }, + { {"EN"}, {"Liverpool"}, {"B"}, {562.0}, {662.0}, {762.0}, {862.0}, {"01/20/16"} }, + { {"DE"}, {"Berlin"}, {"B"}, {648.0}, {748.0}, {848.0}, {948.0}, {"01/20/16"} } + }; + + // Getting spreadsheet + uno::Reference xSpreadsheets = xSheetDoc->getSheets(); + uno::Reference oIndexAccess(xSpreadsheets, uno::UNO_QUERY_THROW); + uno::Reference xSheet; + CPPUNIT_ASSERT(oIndexAccess->getByIndex(0) >>= xSheet); + + uno::Reference oPivotTableSheet; + xSpreadsheets->insertNewByName("Pivot Table", 1); + CPPUNIT_ASSERT(oIndexAccess->getByIndex(1) >>= oPivotTableSheet); + + sal_Int32 currentRow = 0; + for (size_t column = 0; column < aHeaders.size(); ++column) + { + xSheet->getCellByPosition(column, currentRow)->setFormula(aHeaders[column]); + } + currentRow++; + + for (std::vector const & rRowOfData : aData) + { + for (size_t column = 0; column < rRowOfData.size(); ++column) + { + Value const & rValue = rRowOfData[column]; + uno::Reference xCell(xSheet->getCellByPosition(column, currentRow)); + if (rValue.mbIsValue) + xCell->setValue(rValue.mfValue); + else + xCell->setFormula(rValue.maString); + } + currentRow++; + } + + sal_Int32 nEndCol = sal_Int32(aHeaders.size() - 1); + sal_Int32 nEndRow = sal_Int32(1/*HEADER*/ + aData.size() - 1); + + // Apply date format to the last column + uno::Reference xNumberFormatsSupplier(xSheetDoc, UNO_QUERY_THROW); + uno::Reference xNumberFormats = xNumberFormatsSupplier->getNumberFormats(); + uno::Reference xNumberFormatTypes(xNumberFormats, UNO_QUERY_THROW); + lang::Locale aLocale; + sal_Int32 nDateKey = xNumberFormatTypes->getStandardFormat(util::NumberFormat::DATE, aLocale); + uno::Reference xCellRange = xSheet->getCellRangeByPosition(nEndCol, 1, nEndCol, nEndRow); + uno::Reference xCellProp(xCellRange, UNO_QUERY_THROW); + xCellProp->setPropertyValue("NumberFormat", uno::Any(nDateKey)); + + table::CellRangeAddress sCellRangeAddress; + sCellRangeAddress.Sheet = 0; + sCellRangeAddress.StartColumn = 0; + sCellRangeAddress.StartRow = 0; + sCellRangeAddress.EndColumn = nEndCol; + sCellRangeAddress.EndRow = nEndRow; + + return sCellRangeAddress; +} + +} // end anonymous namespace + +void PivotChartTest::testRoundtrip() +{ + uno::Sequence xSequence; + Reference xChartDoc; + + std::vector aReference1 { 10162.033139, 16614.523063, 27944.146101 }; + + std::vector aReference2 { 101879.458079, 178636.929704, 314626.484864 }; + + loadFromFile(u"ods/PivotChartRoundTrip.ods"); + + xChartDoc = getPivotChartDocFromSheet(1, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getNumberOfDataSeries(xChartDoc)); + + // Check the data series + { + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference1, xSequence, 1E-4); + CPPUNIT_ASSERT_EQUAL(OUString("Exp."), lclGetLabel(xChartDoc, 0)); + } + { + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData(); + lclCheckSequence(aReference2, xSequence, 1E-4); + CPPUNIT_ASSERT_EQUAL(OUString("Rev."), lclGetLabel(xChartDoc, 1)); + } + + // Modify the pivot table + { + uno::Reference xDataPilotTable = lclGetPivotTableByName(1, "DataPilot1", mxComponent); + uno::Reference xDataPilotDescriptor(xDataPilotTable, UNO_QUERY_THROW); + lclModifyOrientation(xDataPilotDescriptor, u"Exp.", sheet::DataPilotFieldOrientation_HIDDEN); + } + + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc)); + + // Check again the data series + { + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference2, xSequence, 1E-4); + CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0)); + } + + saveAndReload("calc8"); + + xChartDoc = getPivotChartDocFromSheet(1, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc)); + + // Check again the data series + { + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference2, xSequence, 1E-4); + CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0)); + } +} + +void PivotChartTest::testChangePivotTable() +{ + uno::Sequence xSequence; + Reference xChartDoc; + + loadFromFile(u"ods/PivotTableExample.ods"); + + // Check we have the Pivot Table + OUString sPivotTableName("DataPilot1"); + uno::Reference xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent); + CPPUNIT_ASSERT(xDataPilotTable.is()); + + // Check that we don't have any pivot chart in the document + uno::Reference xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent); + uno::Reference xIndexAccess(xTablePivotCharts, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount()); + + // Create a new pivot chart + xTablePivotCharts->addNewByName("Chart", awt::Rectangle{0, 0, 9000, 9000}, sPivotTableName); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + + // Get the pivot chart document so we can access its data + xChartDoc.set(getPivotChartDocFromSheet(xTablePivotCharts, 0)); + + CPPUNIT_ASSERT(xChartDoc.is()); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getNumberOfDataSeries(xChartDoc)); + + // Check first data series + { + std::vector aReference { 10162.033139, 16614.523063, 27944.146101 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("Exp."), lclGetLabel(xChartDoc, 0)); + } + + // Check second data series + { + std::vector aReference { 101879.458079, 178636.929704, 314626.484864 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("Rev."), lclGetLabel(xChartDoc, 1)); + } + + // Modify the pivot table, move "Group Segment" to Column fields, + // add "Service Month" to Row fields, remove "Rev." Data field + { + uno::Reference xDataPilotDescriptor(xDataPilotTable, UNO_QUERY_THROW); + + lclModifyOrientation(xDataPilotDescriptor, u"Service Month", sheet::DataPilotFieldOrientation_ROW); + lclModifyOrientation(xDataPilotDescriptor, u"Group Segment", sheet::DataPilotFieldOrientation_COLUMN); + lclModifyOrientation(xDataPilotDescriptor, u"Rev.", sheet::DataPilotFieldOrientation_HIDDEN); + } + + // Check the pivot chart again as we expect it has been updated when we updated the pivot table + + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getNumberOfDataSeries(xChartDoc)); + + // Check the first data series + { + std::vector aReference { 2855.559, 1780.326, 2208.713, 2130.064, 1187.371 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + + CPPUNIT_ASSERT_EQUAL(OUString("Big"), lclGetLabel(xChartDoc, 0)); + } + + // Check the second data series + { + std::vector aReference { 4098.908, 2527.286, 4299.716, 2362.225, 3326.389 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + + CPPUNIT_ASSERT_EQUAL(OUString("Medium"), lclGetLabel(xChartDoc, 1)); + } + + // Check the third data series + { + std::vector aReference { 4926.303, 5684.060, 4201.398, 7290.795, 5841.591 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 2)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + + CPPUNIT_ASSERT_EQUAL(OUString("Small"), lclGetLabel(xChartDoc, 2)); + } + + // Remove "Service Month" so row fields are empty - check we handle empty rows + { + uno::Reference xDataPilotDescriptor(xDataPilotTable, uno::UNO_QUERY_THROW); + lclModifyOrientation(xDataPilotDescriptor, u"Service Month", sheet::DataPilotFieldOrientation_HIDDEN); + } + + // Check the pivot chart again as we expect it has been updated when we updated the pivot table + + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getNumberOfDataSeries(xChartDoc)); + + // Check the first data series + { + std::vector aReference { 10162.033139 }; + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + CPPUNIT_ASSERT_EQUAL(OUString("Big"), lclGetLabel(xChartDoc, 0)); + } + // Check the second data series + { + std::vector aReference { 16614.523063 }; + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + CPPUNIT_ASSERT_EQUAL(OUString("Medium"), lclGetLabel(xChartDoc, 1)); + } + // Check the third data series + { + std::vector aReference { 27944.146101 }; + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 2)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + CPPUNIT_ASSERT_EQUAL(OUString("Small"), lclGetLabel(xChartDoc, 2)); + } + + // Enable column totals and check the data is still unchanged + { + uno::Reference xProperties(xDataPilotTable, uno::UNO_QUERY_THROW); + xProperties->setPropertyValue("ColumnGrand", uno::Any(true)); + } + + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getNumberOfDataSeries(xChartDoc)); + + // Check the first data series + { + std::vector aReference { 10162.033139 }; + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + CPPUNIT_ASSERT_EQUAL(OUString("Big"), lclGetLabel(xChartDoc, 0)); + } + // Check the second data series + { + std::vector aReference { 16614.523063 }; + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + CPPUNIT_ASSERT_EQUAL(OUString("Medium"), lclGetLabel(xChartDoc, 1)); + } + // Check the third data series + { + std::vector aReference { 27944.146101 }; + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 2)->getData(); + lclCheckSequence(aReference, xSequence, 1E-3); + CPPUNIT_ASSERT_EQUAL(OUString("Small"), lclGetLabel(xChartDoc, 2)); + } +} + +void PivotChartTest::testPivotChartWithOneColumnField() +{ + // We put one field as COLUMN field only and one DATA field. We expect we will get as many data series + // in the pivot table as many distinct column values we have (with this example data 3: DE, EN, FR). + + // SETUP DATA and PIVOT TABLE + + mxComponent = loadFromDesktop("private:factory/scalc"); + + uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); + + OUString sPivotTableName("DataPilotTable"); + + table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc); + + uno::Reference xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc); + + uno::Reference xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor(); + xDataPilotDescriptor->setSourceRange(sCellRangeAddress); + + lclModifyOrientation(xDataPilotDescriptor, u"Country", sheet::DataPilotFieldOrientation_COLUMN); + lclModifyOrientation(xDataPilotDescriptor, u"Sales T1", sheet::DataPilotFieldOrientation_DATA); + lclModifyFunction(xDataPilotDescriptor, u"Sales T1", sheet::GeneralFunction_SUM); + + xDataPilotTables->insertNewByName(sPivotTableName, table::CellAddress{1, 0, 0}, xDataPilotDescriptor); + + // TEST + + uno::Sequence xSequence; + Reference xChartDoc; + + // Check we have the Pivot Table + + uno::Reference xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent); + CPPUNIT_ASSERT(xDataPilotTable.is()); + + // Check that we don't have any pivot chart in the document + uno::Reference xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent); + uno::Reference xIndexAccess(xTablePivotCharts, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount()); + + // Create a new pivot chart + xTablePivotCharts->addNewByName("PivotChart", awt::Rectangle{ 9000, 9000, 21000, 18000 }, sPivotTableName); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + + // Get the pivot chart document so we can access its data + xChartDoc.set(getPivotChartDocFromSheet(xTablePivotCharts, 0)); + + CPPUNIT_ASSERT(xChartDoc.is()); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getNumberOfDataSeries(xChartDoc)); + // Check data series 1 + { + std::vector aReference { 1738.0 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("DE"), lclGetLabel(xChartDoc, 0)); + } + + // Check data series 2 + { + std::vector aReference { 2003.0 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("EN"), lclGetLabel(xChartDoc, 1)); + } + // Check data series 3 + { + std::vector aReference { 1936.0 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 2)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("FR"), lclGetLabel(xChartDoc, 2)); + } +} + +void PivotChartTest::testPivotChartWithOneRowField() +{ + // We put one field as ROW field only and one DATA field. We expect we will get one data series + // in the pivot table. + + // SETUP DATA and PIVOT TABLE + + mxComponent = loadFromDesktop("private:factory/scalc"); + + uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); + + OUString sPivotTableName("DataPilotTable"); + + table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc); + + uno::Reference xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc); + + uno::Reference xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor(); + xDataPilotDescriptor->setSourceRange(sCellRangeAddress); + + lclModifyOrientation(xDataPilotDescriptor, u"Country", sheet::DataPilotFieldOrientation_ROW); + lclModifyOrientation(xDataPilotDescriptor, u"Sales T1", sheet::DataPilotFieldOrientation_DATA); + lclModifyFunction(xDataPilotDescriptor, u"Sales T1", sheet::GeneralFunction_SUM); + + xDataPilotTables->insertNewByName(sPivotTableName, table::CellAddress{1, 0, 0}, xDataPilotDescriptor); + + // TEST + + uno::Sequence xSequence; + Reference xChartDoc; + + // Check we have the Pivot Table + + uno::Reference xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent); + CPPUNIT_ASSERT(xDataPilotTable.is()); + + // Check that we don't have any pivot chart in the document + uno::Reference xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent); + uno::Reference xIndexAccess(xTablePivotCharts, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount()); + + // Create a new pivot chart + xTablePivotCharts->addNewByName("PivotChart", awt::Rectangle{ 9000, 9000, 21000, 18000 }, sPivotTableName); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + + // Get the pivot chart document so we can access its data + xChartDoc.set(getPivotChartDocFromSheet(xTablePivotCharts, 0)); + + CPPUNIT_ASSERT(xChartDoc.is()); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc)); + // Check data series 1 + { + std::vector aReference { 1738.0, 2003.0, 1936.0 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0)); + } +} + +void PivotChartTest::testPivotTableDataProvider_PivotTableFields() +{ + // SETUP DATA and PIVOT TABLE + + mxComponent = loadFromDesktop("private:factory/scalc"); + + uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); + + OUString sPivotTableName("DataPilotTable"); + + table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc); + + uno::Reference xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc); + + uno::Reference xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor(); + xDataPilotDescriptor->setSourceRange(sCellRangeAddress); + + lclModifyOrientation(xDataPilotDescriptor, u"City", sheet::DataPilotFieldOrientation_ROW); + lclModifyOrientation(xDataPilotDescriptor, u"Country", sheet::DataPilotFieldOrientation_COLUMN); + lclModifyOrientation(xDataPilotDescriptor, u"Type", sheet::DataPilotFieldOrientation_COLUMN); + lclModifyOrientation(xDataPilotDescriptor, u"Sales T1", sheet::DataPilotFieldOrientation_DATA); + lclModifyFunction(xDataPilotDescriptor, u"Sales T1", sheet::GeneralFunction_SUM); + lclModifyOrientation(xDataPilotDescriptor, u"Sales T2", sheet::DataPilotFieldOrientation_DATA); + lclModifyFunction(xDataPilotDescriptor, u"Sales T2", sheet::GeneralFunction_SUM); + + lclModifyColumnGrandTotal(xDataPilotDescriptor, true); + lclModifyRowGrandTotal(xDataPilotDescriptor, true); + + xDataPilotTables->insertNewByName(sPivotTableName, table::CellAddress{1, 0, 0}, xDataPilotDescriptor); + + // TEST + Reference xChartDoc; + + // Check we have the Pivot Table + uno::Reference xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent); + CPPUNIT_ASSERT(xDataPilotTable.is()); + + // refetch the XDataPilotDescriptor + xDataPilotDescriptor.set(xDataPilotTable, uno::UNO_QUERY_THROW); + + // Check that we don't have any pivot chart in the document + uno::Reference xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent); + uno::Reference xIndexAccess(xTablePivotCharts, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount()); + + // Create a new pivot chart + xTablePivotCharts->addNewByName("PivotChart", awt::Rectangle{ 9000, 9000, 21000, 18000 }, sPivotTableName); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + + // Get the pivot chart document so we can access its data + xChartDoc.set(getPivotChartDocFromSheet(xTablePivotCharts, 0)); + + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xPivotTableDataProvider(xChartDoc->getDataProvider(), UNO_QUERY_THROW); + uno::Sequence aFieldEntries; + + aFieldEntries = xPivotTableDataProvider->getColumnFields(); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aFieldEntries.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("Country"), aFieldEntries[0].Name); + CPPUNIT_ASSERT_EQUAL(OUString("Type"), aFieldEntries[1].Name); + + aFieldEntries = xPivotTableDataProvider->getRowFields(); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aFieldEntries.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("City"), aFieldEntries[0].Name); + CPPUNIT_ASSERT_EQUAL(OUString("Data"), aFieldEntries[1].Name); + + aFieldEntries = xPivotTableDataProvider->getDataFields(); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aFieldEntries.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("Sum - Sales T1"), aFieldEntries[0].Name); + CPPUNIT_ASSERT_EQUAL(OUString("Sum - Sales T2"), aFieldEntries[1].Name); + + // Data to column fields + lclModifyOrientation(xDataPilotDescriptor, u"Data", sheet::DataPilotFieldOrientation_COLUMN); + + // Change the order of column fields: expected data, type, country + lclModifyOrientation(xDataPilotDescriptor, u"Country", sheet::DataPilotFieldOrientation_HIDDEN); + lclModifyOrientation(xDataPilotDescriptor, u"Type", sheet::DataPilotFieldOrientation_HIDDEN); + + lclModifyOrientation(xDataPilotDescriptor, u"Type", sheet::DataPilotFieldOrientation_COLUMN); + lclModifyOrientation(xDataPilotDescriptor, u"Country", sheet::DataPilotFieldOrientation_COLUMN); + + // set the XPivotTableDataProvider again as the old one was exchanged + xPivotTableDataProvider.set(xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW); + + aFieldEntries = xPivotTableDataProvider->getColumnFields(); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aFieldEntries.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("Data"), aFieldEntries[0].Name); + CPPUNIT_ASSERT_EQUAL(OUString("Type"), aFieldEntries[1].Name); + CPPUNIT_ASSERT_EQUAL(OUString("Country"), aFieldEntries[2].Name); + + aFieldEntries = xPivotTableDataProvider->getRowFields(); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aFieldEntries.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("City"), aFieldEntries[0].Name); + + aFieldEntries = xPivotTableDataProvider->getDataFields(); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aFieldEntries.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("Sum - Sales T1"), aFieldEntries[0].Name); + CPPUNIT_ASSERT_EQUAL(OUString("Sum - Sales T2"), aFieldEntries[1].Name); +} + +void PivotChartTest::testPivotChartRowFieldInOutlineMode() +{ + // SETUP DATA and PIVOT TABLE + + mxComponent = loadFromDesktop("private:factory/scalc"); + + uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); + + OUString sPivotTableName("DataPilotTable"); + + table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc); + + uno::Reference xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc); + + uno::Reference xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor(); + xDataPilotDescriptor->setSourceRange(sCellRangeAddress); + + lclModifyOrientation(xDataPilotDescriptor, u"Country", sheet::DataPilotFieldOrientation_ROW); + lclModifyOrientation(xDataPilotDescriptor, u"City", sheet::DataPilotFieldOrientation_ROW); + lclModifyOrientation(xDataPilotDescriptor, u"Sales T1", sheet::DataPilotFieldOrientation_DATA); + lclModifyFunction(xDataPilotDescriptor, u"Sales T1", sheet::GeneralFunction_SUM); + xDataPilotTables->insertNewByName(sPivotTableName, table::CellAddress{1, 0, 0}, xDataPilotDescriptor); + + // TEST + uno::Sequence xSequence; + Reference xChartDoc; + + // Check we have the Pivot Table + uno::Reference xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent); + CPPUNIT_ASSERT(xDataPilotTable.is()); + + // refetch the XDataPilotDescriptor + xDataPilotDescriptor.set(xDataPilotTable, uno::UNO_QUERY_THROW); + + // Check that we don't have any pivot chart in the document + uno::Reference xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent); + uno::Reference xIndexAccess(xTablePivotCharts, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount()); + + // Create a new pivot chart + xTablePivotCharts->addNewByName("PivotChart", awt::Rectangle{ 9000, 9000, 21000, 18000 }, sPivotTableName); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + + // Get the pivot chart document so we can access its data + xChartDoc.set(getPivotChartDocFromSheet(xTablePivotCharts, 0)); + + CPPUNIT_ASSERT(xChartDoc.is()); + + // Test case with defaults + + // Check when using defaults the data is as expected + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc)); + { + std::vector aReference { 1116.0, 622.0, 298.0, 562.0, 1143.0, 1168.0, 768.0 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0)); + } + // Check the categories + { + lclCheckCategories({ "DE", "", "EN", "", "", "FR", ""}, + lclGetCategories(xChartDoc)[0]->getValues()); + lclCheckCategories({ "Berlin", "Munich", "Glasgow", "Liverpool", "London", "Nantes", "Paris"}, + lclGetCategories(xChartDoc)[1]->getValues()); + } + + sheet::DataPilotFieldLayoutInfo aLayoutInfoValue; + + // Test case where we enable subtotals (auto) and set the outline subtotals at the bottom + // We don't expect any change in data as every extra subtotal row should be ignored + + // Enable subtotals - set to auto + uno::Sequence aGeneralFunctionSequence{ sheet::GeneralFunction_AUTO }; + lclModifySubtotals(xDataPilotDescriptor, u"Country", aGeneralFunctionSequence); + // Set Subtotals layout to bottom + add empty lines + aLayoutInfoValue.AddEmptyLines = true; + aLayoutInfoValue.LayoutMode = sheet::DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_BOTTOM; + lclModifyLayoutInfo(xDataPilotDescriptor, u"Country", aLayoutInfoValue); + + // Check data is unchanged + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc)); + { + std::vector aReference { 1116.0, 622.0, 298.0, 562.0, 1143.0, 1168.0, 768.0 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0)); + } + // Check categories + { + lclCheckCategories({ "DE", "", "EN", "", "", "FR", ""}, + lclGetCategories(xChartDoc)[0]->getValues()); + lclCheckCategories({ "Berlin", "Munich", "Glasgow", "Liverpool", "London", "Nantes", "Paris"}, + lclGetCategories(xChartDoc)[1]->getValues()); + } + + // Test case where we enable subtotals (auto) and set the outline subtotals at the top + // We don't expect any change in data as every extra subtotal row should be ignored + + // Enable subtotals - set to auto + aGeneralFunctionSequence.getArray()[0] = sheet::GeneralFunction_AUTO; + lclModifySubtotals(xDataPilotDescriptor, u"Country", aGeneralFunctionSequence); + // Set Subtotals layout to top + add empty lines + aLayoutInfoValue.AddEmptyLines = true; + aLayoutInfoValue.LayoutMode = sheet::DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_TOP; + lclModifyLayoutInfo(xDataPilotDescriptor, u"Country", aLayoutInfoValue); + + // Check data is unchanged + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc)); + { + std::vector aReference { 1116.0, 622.0, 298.0, 562.0, 1143.0, 1168.0, 768.0 }; + + xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData(); + lclCheckSequence(aReference, xSequence, 1E-4); + + CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0)); + } + // Check categories + { + lclCheckCategories({ "DE", "", "EN", "", "", "FR", ""}, + lclGetCategories(xChartDoc)[0]->getValues()); + lclCheckCategories({ "Berlin", "Munich", "Glasgow", "Liverpool", "London", "Nantes", "Paris"}, + lclGetCategories(xChartDoc)[1]->getValues()); + } +} + +void PivotChartTest::testPivotChartWithDateRowField() +{ + // SETUP DATA and PIVOT TABLE + + mxComponent = loadFromDesktop("private:factory/scalc"); + + uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); + + OUString sPivotTableName("DataPilotTable"); + + table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc); + + uno::Reference xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc); + + uno::Reference xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor(); + xDataPilotDescriptor->setSourceRange(sCellRangeAddress); + + lclModifyOrientation(xDataPilotDescriptor, u"Date", sheet::DataPilotFieldOrientation_ROW); + lclModifyOrientation(xDataPilotDescriptor, u"City", sheet::DataPilotFieldOrientation_ROW); + lclModifyOrientation(xDataPilotDescriptor, u"Country", sheet::DataPilotFieldOrientation_ROW); + lclModifyOrientation(xDataPilotDescriptor, u"Type", sheet::DataPilotFieldOrientation_COLUMN); + lclModifyOrientation(xDataPilotDescriptor, u"Sales T1", sheet::DataPilotFieldOrientation_DATA); + lclModifyFunction(xDataPilotDescriptor, u"Sales T1", sheet::GeneralFunction_SUM); + + lclModifyColumnGrandTotal(xDataPilotDescriptor, true); + lclModifyRowGrandTotal(xDataPilotDescriptor, true); + + xDataPilotTables->insertNewByName(sPivotTableName, table::CellAddress{1, 0, 0}, xDataPilotDescriptor); + + // TEST + Reference xChartDoc; + + // Check we have the Pivot Table + uno::Reference xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent); + CPPUNIT_ASSERT(xDataPilotTable.is()); + + // refetch the XDataPilotDescriptor + xDataPilotDescriptor.set(xDataPilotTable, uno::UNO_QUERY_THROW); + + // Check that we don't have any pivot chart in the document + uno::Reference xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent); + uno::Reference xIndexAccess(xTablePivotCharts, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount()); + + // Create a new pivot chart + xTablePivotCharts->addNewByName("PivotChart", awt::Rectangle{ 9000, 9000, 21000, 18000 }, sPivotTableName); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + + // Get the pivot chart document so we can access its data + xChartDoc.set(getPivotChartDocFromSheet(xTablePivotCharts, 0)); + + CPPUNIT_ASSERT(xChartDoc.is()); + + // Check if Date category is date formatted. + lclCheckCategories( { "12/11/15", "", "", "", "", "", "12/14/15", "12/17/15", "01/20/16", "", "", "03/21/17" }, + lclGetCategories( xChartDoc )[0]->getValues() ); +} + + +CPPUNIT_TEST_SUITE_REGISTRATION(PivotChartTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx b/chart2/qa/extras/chart2_trendcalculators.cxx new file mode 100644 index 0000000000..8639015d62 --- /dev/null +++ b/chart2/qa/extras/chart2_trendcalculators.cxx @@ -0,0 +1,217 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" +#include +#include +#include + + +// Define the index of sheets in the test document +constexpr sal_Int32 SHEET_POTENTIAL1 = 0; +constexpr sal_Int32 SHEET_POTENTIAL2 = 1; +constexpr sal_Int32 SHEET_LINEAR1 = 2; +constexpr sal_Int32 SHEET_POLYNOMIAL1 = 3; +constexpr sal_Int32 SHEET_EXPONENTIAL1 = 4; +constexpr sal_Int32 SHEET_EXPONENTIAL2 = 5; + +class Chart2TrendCalculators : public ChartTest +{ +public: + Chart2TrendCalculators() + : ChartTest("/chart2/qa/extras/data/") + {} + + void setUp() override; + void tearDown() override; + + void testPotentialRegression1(); + void testPotentialRegression2(); + void testLinearRegression1(); + void testPolynomialRegression1(); + void testExponentialRegression1(); + void testExponentialRegression2(); + + CPPUNIT_TEST_SUITE(Chart2TrendCalculators); + CPPUNIT_TEST(testPotentialRegression1); + CPPUNIT_TEST(testPotentialRegression2); + CPPUNIT_TEST(testLinearRegression1); + CPPUNIT_TEST(testPolynomialRegression1); + CPPUNIT_TEST(testExponentialRegression1); + CPPUNIT_TEST(testExponentialRegression2); + CPPUNIT_TEST_SUITE_END(); + +private: + Reference m_xCurve; + Reference< chart2::XRegressionCurveCalculator > m_xRegressionCurveCalculator; + + void loadCalculatorFromSheet(sal_Int32 nSheet); + void checkCalculator( + const Sequence< double >& xValues, const Sequence< double >& yValues, + const OUString& sExpectedFormula ); +}; + +void Chart2TrendCalculators::setUp() +{ + ChartTest::setUp(); + loadFromFile(u"ods/trend_calculators.ods"); +} + +void Chart2TrendCalculators::tearDown() +{ + m_xRegressionCurveCalculator.clear(); + m_xCurve.clear(); + ChartTest::tearDown(); +} + +void Chart2TrendCalculators::loadCalculatorFromSheet(sal_Int32 nSheet) +{ + Reference xChartDoc = getChartDocFromSheet(nSheet, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + + Reference xRegressionCurveContainer(xDataSeries, UNO_QUERY_THROW); + + Sequence< Reference< chart2::XRegressionCurve > > xRegressionCurveSequence = xRegressionCurveContainer->getRegressionCurves(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xRegressionCurveSequence.getLength()); + + m_xCurve = xRegressionCurveSequence[0]; + CPPUNIT_ASSERT(m_xCurve.is()); + + m_xRegressionCurveCalculator = m_xCurve->getCalculator(); + CPPUNIT_ASSERT(m_xRegressionCurveCalculator.is()); +} + +void Chart2TrendCalculators::checkCalculator( + const Sequence< double >& xValues, const Sequence< double >& yValues, + const OUString& sExpectedFormula ) +{ + m_xRegressionCurveCalculator->recalculateRegression( xValues, yValues ); + OUString aRepresentation = m_xRegressionCurveCalculator->getRepresentation (); + CPPUNIT_ASSERT_EQUAL( sExpectedFormula, aRepresentation ); + double r2 = m_xRegressionCurveCalculator->getCorrelationCoefficient(); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, r2, 1e-8 ); +} + +// test y = A x ^ B +void Chart2TrendCalculators::testPotentialRegression1() +{ + loadCalculatorFromSheet( SHEET_POTENTIAL1 ); + m_xRegressionCurveCalculator->setRegressionProperties( 0, false, 0, 0, 0 ); + Sequence< double > xValues( 7 ); + auto pxValues = xValues.getArray(); + Sequence< double > yValues( 7 ); + auto pyValues = yValues.getArray(); + for (int i=0; i<7; i++) + { + const double d = static_cast(i); + pxValues[i] = d; + pyValues[i] = 2.0 * pow ( d, 3 ); + } + checkCalculator( xValues, yValues, "f(x) = 2 x^3"); +} + +// test y = A x ^ B +void Chart2TrendCalculators::testPotentialRegression2() +{ + loadCalculatorFromSheet( SHEET_POTENTIAL2 ); + m_xRegressionCurveCalculator->setRegressionProperties( 0, false, 0, 0, 0 ); + Sequence< double > xValues( 7 ); + auto pxValues = xValues.getArray(); + Sequence< double > yValues( 7 ); + auto pyValues = yValues.getArray(); + for (int i=0; i<7; i++) + { + const double d = static_cast(i); + pxValues[i] = d; + pyValues[i] = -2.0 * pow ( d, 3 ); + } + checkCalculator( xValues, yValues, "f(x) = "+ OUStringChar(aMinusSign) +" 2 x^3"); +} + +// test y = - 2 X - 5 +void Chart2TrendCalculators::testLinearRegression1() +{ + loadCalculatorFromSheet( SHEET_LINEAR1 ); + m_xRegressionCurveCalculator->setRegressionProperties( 1, false, 0, 0, 0 ); + Sequence< double > xValues( 7 ); + auto pxValues = xValues.getArray(); + Sequence< double > yValues( 7 ); + auto pyValues = yValues.getArray(); + for (int i=0; i<7; i++) + { + const double d = static_cast(i); + pxValues[i] = d; + pyValues[i] = - 2.0 * d - 5.0 ; + } + checkCalculator( xValues, yValues, "f(x) = "+ OUStringChar(aMinusSign) +" 2 x "+ OUStringChar(aMinusSign) +" 5"); +} + +// test y = A x ^ B +void Chart2TrendCalculators::testPolynomialRegression1() +{ + loadCalculatorFromSheet( SHEET_POLYNOMIAL1 ); + m_xRegressionCurveCalculator->setRegressionProperties( 2, false, 0, 0, 0 ); + Sequence< double > xValues( 7 ); + auto pxValues = xValues.getArray(); + Sequence< double > yValues( 7 ); + auto pyValues = yValues.getArray(); + for (int i=0; i<7; i++) + { + const double d = static_cast(i); + pxValues[i] = d; + pyValues[i] = - 2.0 * d * d + 4 * d - 5; + } + OUString sExpectedFormula( "f(x) = "+ OUStringChar(aMinusSign) +" 2 x" + OUStringChar( aSuperscriptFigures[2] ) + " + 4 x "+ OUStringChar(aMinusSign) +" 5" ); + checkCalculator( xValues, yValues, sExpectedFormula ); +} + +void Chart2TrendCalculators::testExponentialRegression1() +{ + loadCalculatorFromSheet( SHEET_EXPONENTIAL1 ); + m_xRegressionCurveCalculator->setRegressionProperties( 0, false, 0, 0, 0 ); + Sequence< double > xValues( 7 ); + auto pxValues = xValues.getArray(); + Sequence< double > yValues( 7 ); + auto pyValues = yValues.getArray(); + for (int i=0; i<7; i++) + { + const double d = static_cast(i); + pxValues[i] = d; + pyValues[i] = 2.0 * exp ( 0.3 * d ); + } + checkCalculator( xValues, yValues, "f(x) = 2 exp( 0.3 x )"); +} + +void Chart2TrendCalculators::testExponentialRegression2() +{ + loadCalculatorFromSheet( SHEET_EXPONENTIAL2 ); + m_xRegressionCurveCalculator->setRegressionProperties( 0, false, 0, 0, 0 ); + Sequence< double > xValues( 7 ); + auto pxValues = xValues.getArray(); + Sequence< double > yValues( 7 ); + auto pyValues = yValues.getArray(); + for (int i=0; i<7; i++) + { + const double d = static_cast(i); + pxValues[i] = d; + pyValues[i] = -2.0 * exp ( 0.3 * d ); + } + checkCalculator( xValues, yValues, "f(x) = "+ OUStringChar(aMinusSign) + " 2 exp( 0.3 x )"); +} + + +CPPUNIT_TEST_SUITE_REGISTRATION(Chart2TrendCalculators); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx b/chart2/qa/extras/chart2dump/chart2dump.cxx new file mode 100644 index 0000000000..d13d768c03 --- /dev/null +++ b/chart2/qa/extras/chart2dump/chart2dump.cxx @@ -0,0 +1,1122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#if defined(X86) +#define INT_EPS 2.1 +#else +#define INT_EPS 0.1 +#endif + +#define DECLARE_DUMP_TEST(TestName, BaseClass, DumpMode) \ + class TestName : public BaseClass { \ + protected:\ + virtual OUString getTestName() override { return #TestName; } \ + public:\ + TestName() : BaseClass(DumpMode) {}; \ + CPPUNIT_TEST_SUITE(TestName); \ + CPPUNIT_TEST(verify); \ + CPPUNIT_TEST_SUITE_END(); \ + virtual void verify() override;\ + };\ + CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \ + void TestName::verify() + + +#define CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aActual) \ + if(isInDumpMode()) \ + writeActual(OUString::number(aActual), #aActual); \ + else \ + { \ + OString sTestFileName = OUStringToOString(getTestFileName(), RTL_TEXTENCODING_UTF8); \ + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("Failing test file is: " + sTestFileName).getStr(), readExpected(u ## #aActual), OUString(OUString::number(aActual))); \ + } + +#define CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aActual, EPS_) \ + if(isInDumpMode()) \ + writeActual(OUString::number(aActual), #aActual); \ + else \ + { \ + OString sTestFileName = OUStringToOString(getTestFileName(), RTL_TEXTENCODING_UTF8); \ + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(OString("Failing test file is: " + sTestFileName).getStr(), readExpectedDouble(u ## #aActual), aActual, EPS_); \ + } + +#define CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(aActual) \ + if(isInDumpMode()) \ + writeActual(aActual, #aActual); \ + else \ + { \ + OString sTestFileName = OUStringToOString(getTestFileName(), RTL_TEXTENCODING_UTF8); \ + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("Failing test file is: " + sTestFileName).getStr(), readExpected(u ## #aActual), aActual.trim()); \ + } + +#define CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aActual, EPS_) \ + if(isInDumpMode()) \ + writeActualTransformation(aActual, #aActual); \ + else \ + { \ + OUString expectedTransform; \ + if (!readAndCheckTransformation (aActual, u ## #aActual, EPS_, expectedTransform)) \ + { \ + OString sTestFileName = OUStringToOString(getTestFileName(), RTL_TEXTENCODING_UTF8); \ + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("Failing test file is: " + sTestFileName).getStr(), expectedTransform, transformationToOneLineString(aActual)); \ + } \ + } + +class Chart2DumpTest : public ChartTest +{ +protected: + Chart2DumpTest(bool bDumpMode) + : ChartTest("/chart2/qa/extras/chart2dump/data/") + { + m_bDumpMode = bDumpMode; + } + + virtual ~Chart2DumpTest() override + { + } + + void CPPUNIT_DUMP_ASSERT_NOTE(OUString const & Note) { + if(isInDumpMode()) + writeNote(Note); + else + readNote(Note); + } + + bool isInDumpMode () const {return m_bDumpMode;} + + virtual OUString getTestName() { return OUString(); } + OUString const & getTestFileName() const { return m_sTestFileName; } + OUString getReferenceDirName() + { + return "/chart2/qa/extras/chart2dump/reference/" + getTestName().toAsciiLowerCase() + "/"; + } + + void setTestFileName (const OUString& sName) + { + m_sTestFileName = sName; + + OUString sFileName = m_sTestFileName; + assert(sFileName.lastIndexOf('.') < sFileName.getLength()); + sFileName = OUString::Concat(sFileName.subView(0, sFileName.lastIndexOf('.'))) + ".txt"; + if (!m_bDumpMode) + { + if (m_aReferenceFile.is_open()) + m_aReferenceFile.close(); + OString sReferenceFile = OUStringToOString(Concat2View(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8); + m_aReferenceFile.open(sReferenceFile.getStr(), std::ios_base::in); + CPPUNIT_ASSERT_MESSAGE(OString("Can't open reference file: " + sReferenceFile).getStr(), m_aReferenceFile.is_open()); + } + else + { + if (m_aDumpFile.is_open()) + m_aDumpFile.close(); + OString sDumpFile = OUStringToOString(Concat2View(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8); + m_aDumpFile.open(sDumpFile.getStr(), std::ios_base::out | std::ofstream::binary | std::ofstream::trunc); + CPPUNIT_ASSERT_MESSAGE(OString("Can't open dump file: " + sDumpFile).getStr(), m_aDumpFile.is_open()); + } + } + + virtual void verify() + { + CPPUNIT_FAIL("verify method must be overridden"); + } + + OUString readExpected(std::u16string_view sCheck) + { + assert(!m_bDumpMode); + assert(m_aReferenceFile.is_open()); + std::string sTemp; + getline(m_aReferenceFile, sTemp); + OString sAssertMessage = + "The reference file does not contain the right content. Maybe it needs an update:" + + OUStringToOString(m_sTestFileName, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sAssertMessage.getStr(), OUString(OUString::Concat("// ") + sCheck), OUString(sTemp.data(), sTemp.length(), RTL_TEXTENCODING_UTF8)); + getline(m_aReferenceFile, sTemp); + return OUString(sTemp.data(), sTemp.length(), RTL_TEXTENCODING_UTF8); + } + + void writeActual(std::u16string_view sActualValue, const OUString& sCheck) + { + assert(m_bDumpMode); + assert(m_aDumpFile.is_open()); + m_aDumpFile << "// " << sCheck << "\n"; // Add check string to make dump file readable + m_aDumpFile << OUString(sActualValue) << "\n"; // Write out the checked value, will be used as reference later + } + + void readNote(std::u16string_view sNote) + { + assert(!m_bDumpMode); + assert(m_aReferenceFile.is_open()); + std::string sTemp; + getline(m_aReferenceFile, sTemp); + OString sAssertMessage = + "The reference file does not contain the right content. Maybe it needs an update:" + + OUStringToOString(m_sTestFileName, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sAssertMessage.getStr(), OUString(OUString::Concat("/// ") + sNote), OUString(sTemp.data(), sTemp.length(), RTL_TEXTENCODING_UTF8)); + } + + void writeNote(const OUString& sNote) + { + assert(m_bDumpMode); + assert(m_aDumpFile.is_open()); + m_aDumpFile << "/// " << sNote << "\n"; + } + + double readExpectedDouble(std::u16string_view sCheck) + { + OUString sExpected = readExpected(sCheck); + return sExpected.toDouble(); + } + + void writeActualTransformation(const drawing::HomogenMatrix3& rTransform, const OUString& sCheck) + { + writeActual(transformationToOneLineString(rTransform), sCheck); + } + + bool readAndCheckTransformation(const drawing::HomogenMatrix3& rTransform, std::u16string_view sCheck, const double fEPS, OUString& rExpectedTransform) + { + rExpectedTransform = readExpected(sCheck); // Reference transformation string + + // Convert string back to a transformation; + drawing::HomogenMatrix3 aExpectedTransform; + sal_Int32 nIdx {0}; + aExpectedTransform.Line1.Column1 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + aExpectedTransform.Line1.Column2 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + aExpectedTransform.Line1.Column3 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + aExpectedTransform.Line2.Column1 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + aExpectedTransform.Line2.Column2 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + aExpectedTransform.Line2.Column3 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + aExpectedTransform.Line3.Column1 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + aExpectedTransform.Line3.Column2 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + aExpectedTransform.Line3.Column3 = o3tl::toDouble(o3tl::getToken(rExpectedTransform, 0, ';', nIdx)); + + // Check the equality of the two transformation + return (std::abs(aExpectedTransform.Line1.Column1 - rTransform.Line1.Column1) < fEPS && + std::abs(aExpectedTransform.Line1.Column2 - rTransform.Line1.Column2) < fEPS && + std::abs(aExpectedTransform.Line1.Column3 - rTransform.Line1.Column3) < fEPS && + std::abs(aExpectedTransform.Line2.Column1 - rTransform.Line2.Column1) < fEPS && + std::abs(aExpectedTransform.Line2.Column2 - rTransform.Line2.Column2) < fEPS && + std::abs(aExpectedTransform.Line2.Column3 - rTransform.Line2.Column3) < fEPS && + std::abs(aExpectedTransform.Line3.Column1 - rTransform.Line3.Column1) < fEPS && + std::abs(aExpectedTransform.Line3.Column2 - rTransform.Line3.Column2) < fEPS && + std::abs(aExpectedTransform.Line3.Column3 - rTransform.Line3.Column3) < fEPS); + } + + OUString sequenceToOneLineString(const uno::Sequence& rSeq) + { + OUStringBuffer aBuffer; + for (const OUString& seqItem : rSeq) + { + aBuffer.append(seqItem + ";"); + } + return aBuffer.makeStringAndClear(); + } + + OUString doubleVectorToOneLineString(const std::vector& rVector) + { + OUStringBuffer aBuffer; + for (const double& vectorItem : rVector) + { + aBuffer.append(OUString::number(vectorItem) + ";"); + } + return aBuffer.makeStringAndClear(); + } + + OUString transformationToOneLineString(const drawing::HomogenMatrix3& rTransform) + { + return OUString::number(rTransform.Line1.Column1) + ";" + OUString::number(rTransform.Line1.Column2) + ";" + OUString::number(rTransform.Line1.Column3) + ";" + + OUString::number(rTransform.Line2.Column1) + ";" + OUString::number(rTransform.Line2.Column2) + ";" + OUString::number(rTransform.Line2.Column3) + ";" + + OUString::number(rTransform.Line3.Column1) + ";" + OUString::number(rTransform.Line3.Column2) + ";" + OUString::number(rTransform.Line3.Column3); + } + +private: + OUString m_sTestFileName; + bool m_bDumpMode; + std::ifstream m_aReferenceFile; + std::ofstream m_aDumpFile; +}; + +DECLARE_DUMP_TEST(ChartDataTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "simple_chart.ods", + "multiple_categories.ods" + }; + + for (const OUString& aTestFile : aTestFiles) + { + setTestFileName(aTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc (getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW); + + // Check title + uno::Reference< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference xTitled(xChartDoc, uno::UNO_QUERY_THROW); + uno::Reference xTitle = xTitled->getTitleObject(); + if(xTitle.is()) + { + OUString sChartTitle = getTitleString(xTitled); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sChartTitle); + } + + // Check chart type + Reference xChartType = getChartTypeFromDoc(xChartDoc2, 0); + CPPUNIT_ASSERT(xChartType.is()); + OUString sChartType = xChartType->getChartType(); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sChartType); + + // Check axis titles and number format + // x Axis + Reference xAxis = getAxisFromDoc(xChartDoc2, 0, 0, 0); + Reference xAxisTitled(xAxis, UNO_QUERY_THROW); + uno::Reference xAxisTitle = xAxisTitled->getTitleObject(); + if (xAxisTitle.is()) + { + OUString sXAxisTitle = getTitleString(xAxisTitled); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sXAxisTitle); + } + sal_Int32 nXAxisNumberFormat = getNumberFormatFromAxis(xAxis); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nXAxisNumberFormat); + sal_Int16 nXAxisNumberType = getNumberFormatType(xChartDoc2, nXAxisNumberFormat); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nXAxisNumberType); + + // y Axis + xAxis.set(getAxisFromDoc(xChartDoc2, 0, 1, 0)); + xAxisTitled.set(xAxis, UNO_QUERY_THROW); + xAxisTitle.set(xAxisTitled->getTitleObject()); + if (xAxisTitle.is()) + { + OUString sYAxisTitle = getTitleString(xAxisTitled); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sYAxisTitle); + } + sal_Int32 nYAxisNumberFormat = getNumberFormatFromAxis(xAxis); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nYAxisNumberFormat); + sal_Int16 nYAxisNumberType = getNumberFormatType(xChartDoc2, nYAxisNumberFormat); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nYAxisNumberType); + + // Check column labels + uno::Reference< chart::XChartDataArray > xChartData(xChartDoc->getData(), UNO_QUERY_THROW); + uno::Sequence < OUString > aColumnLabels = xChartData->getColumnDescriptions(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aColumnLabels.getLength()); + OUString sColumnLabels = sequenceToOneLineString(aColumnLabels); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sColumnLabels); + + // Check row labels + uno::Sequence< OUString > aRowLabels = xChartData->getRowDescriptions(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aRowLabels.getLength()); + OUString sRowLabels = sequenceToOneLineString(aRowLabels); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sRowLabels); + + // Check Y values + std::vector > aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aDataSeriesYValues.size()); + for (const std::vector& aYValuesOfSeries : aDataSeriesYValues) + { + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aYValuesOfSeries.size()); + OUString sYValuesOfSeries = doubleVectorToOneLineString(aYValuesOfSeries); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sYValuesOfSeries); + } + + // Check source ranges + for (size_t nIndex = 0; nIndex < aDataSeriesYValues.size(); ++nIndex) + { + Reference< chart2::data::XDataSequence > xDataSeq = getDataSequenceFromDocByRole(xChartDoc2, u"values-x", nIndex); + if (xDataSeq.is()) + { + OUString aXValuesSourceRange = xDataSeq->getSourceRangeRepresentation(); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(aXValuesSourceRange); + } + xDataSeq.set(getDataSequenceFromDocByRole(xChartDoc2, u"values-y", nIndex)); + if (xDataSeq.is()) + { + OUString aYValuesSourceRange = xDataSeq->getSourceRangeRepresentation(); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(aYValuesSourceRange); + } + xDataSeq.set(getDataSequenceFromDocByRole(xChartDoc2, u"categories", nIndex)); + if (xDataSeq.is()) + { + OUString aCategoriesSourceRange = xDataSeq->getSourceRangeRepresentation(); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(aCategoriesSourceRange); + } + } + } +} + +DECLARE_DUMP_TEST(LegendTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "legend_on_right_side.odp", + "legend_on_bottom.odp", + "legend_on_left_side.odp", + "legend_on_top.odp", + "many_legend_entries.odp", + "custom_legend_position.odp", + "multiple_categories.odp", + "minimal_legend_test.odp" + }; + + for (const OUString& aTestFile : aTestFiles) + { + setTestFileName(aTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_SET_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + // Get legend shape + uno::Reference xLegend = getShapeByName(xShapes, "CID/D=0:Legend="); + CPPUNIT_ASSERT(xLegend.is()); + + /* Check legend position and size + awt::Point aLegendPosition = xLegend->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLegendPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLegendPosition.Y, INT_EPS); + awt::Size aLegendSize = xLegend->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLegendSize.Width, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLegendSize.Height, INT_EPS);*/ + + // Check legend entries + uno::Reference< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference xChartType = getChartTypeFromDoc(xChartDoc2, 0); + CPPUNIT_ASSERT(xChartType.is()); + std::vector > aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + size_t nLegendEntryCount = aDataSeriesYValues.size(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nLegendEntryCount); + // Check legend entries geometry + for (size_t nSeriesIndex = 0; nSeriesIndex < nLegendEntryCount; ++nSeriesIndex) + { + uno::Reference xLegendEntry = getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=" + OUString::number(nSeriesIndex) + ":LegendEntry=0"); + CPPUNIT_ASSERT(xLegendEntry.is()); + + /* Check position and size + awt::Point aLegendEntryPosition = xLegendEntry->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLegendEntryPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLegendEntryPosition.Y, INT_EPS); + awt::Size aLegendEntrySize = xLegendEntry->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLegendEntrySize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLegendEntrySize.Width, INT_EPS); + + // Check transformation + Reference< beans::XPropertySet > xLegendEntryPropSet(xLegendEntry, UNO_QUERY_THROW); + drawing::HomogenMatrix3 aLegendEntryTransformation; + xLegendEntryPropSet->getPropertyValue("Transformation") >>= aLegendEntryTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aLegendEntryTransformation, INT_EPS);*/ + + uno::Reference xLegendEntryContainer(xLegendEntry, UNO_QUERY_THROW); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(xLegendEntryContainer->getCount()); + for (sal_Int32 nEntryGeometryElement = 1; nEntryGeometryElement < xLegendEntryContainer->getCount(); ++nEntryGeometryElement) + { + uno::Reference xLegendEntryGeom(xLegendEntryContainer->getByIndex(nEntryGeometryElement), UNO_QUERY_THROW); + + // Check geometry + uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xLegendEntryGeom, uno::UNO_QUERY_THROW); + OUString sEntryGeomShapeType = xShapeDescriptor->getShapeType(); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sEntryGeomShapeType); + + // Check display color + Reference< beans::XPropertySet > xPropSet(xLegendEntryGeom, UNO_QUERY_THROW); + util::Color aEntryGeomColor = 0; + xPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aEntryGeomColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aEntryGeomColor)); + } + } + // Check legend entries' text + uno::Reference xLegendContainer(xLegend, UNO_QUERY_THROW); + for (sal_Int32 i = 0; i < xLegendContainer->getCount(); ++i) + { + uno::Reference xShape(xLegendContainer->getByIndex(i), uno::UNO_QUERY); + uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xShape, uno::UNO_QUERY_THROW); + OUString sShapeType = xShapeDescriptor->getShapeType(); + + if (sShapeType == "com.sun.star.drawing.TextShape") + { + uno::Reference xLegendEntryText = uno::Reference(xShape, uno::UNO_QUERY_THROW)->getText(); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(xLegendEntryText->getString()); + } + } + } +} + +DECLARE_DUMP_TEST(GridTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "vertical_grid.ods", + "horizontal_grid.ods", + "minor_grid.ods", + "formated_grid_line.ods" + }; + + for (const OUString& sTestFile : aTestFiles) + { + setTestFileName(sTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + const std::vector aGridShapeNames = + { + "CID/D=0:CS=0:Axis=1,0:Grid=0", // Major vertical grid + "CID/D=0:CS=0:Axis=0,0:Grid=0", // Major horizontal grid + "CID/D=0:CS=0:Axis=1,0:Grid=0:SubGrid=0", // Minor vertical grid + "CID/D=0:CS=0:Axis=0,0:Grid=0:SubGrid=0" // Minor horizontal grid + }; + + for (const OUString& sGridShapeName : aGridShapeNames) + { + uno::Reference xGrid = getShapeByName(xShapes, sGridShapeName); + if (xGrid.is()) + { + CPPUNIT_DUMP_ASSERT_NOTE(sGridShapeName); + // Check position and size + awt::Point aGridPosition = xGrid->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aGridPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aGridPosition.Y, INT_EPS); + awt::Size aGridSize = xGrid->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aGridSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aGridSize.Width, INT_EPS); + + // Check transformation + Reference< beans::XPropertySet > xPropSet(xGrid, UNO_QUERY_THROW); + drawing::HomogenMatrix3 aGridTransformation; + xPropSet->getPropertyValue("Transformation") >>= aGridTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aGridTransformation, INT_EPS); + + // Check line properties + uno::Reference xIndexAccess(xGrid, UNO_QUERY_THROW); + uno::Reference xGridLine(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); + Reference< beans::XPropertySet > xGridLinePropSet(xGridLine, UNO_QUERY_THROW); + // Line type + drawing::LineDash aLineDash; + xGridLinePropSet->getPropertyValue("LineDash") >>= aLineDash; + OUString sGridLineDash = + OUString::number(static_cast(aLineDash.Style)) + ";" + OUString::number(aLineDash.Dots) + ";" + OUString::number(aLineDash.DotLen) + + OUString::number(aLineDash.Dashes) + ";" + OUString::number(aLineDash.DashLen) + ";" + OUString::number(aLineDash.Distance); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sGridLineDash); + // Line color + util::Color aLineColor = 0; + xGridLinePropSet->getPropertyValue("LineColor") >>= aLineColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aLineColor)); + // Line width + sal_Int32 nLineWidth = 0; + xGridLinePropSet->getPropertyValue("LineWidth") >>= nLineWidth; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nLineWidth); + } + } + } +} + +DECLARE_DUMP_TEST(AxisGeometryTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "default_formated_axis.odp", + "axis_special_positioning.odp", + "formated_axis_lines.odp", + "rotated_axis_labels.odp" + }; + + for (const OUString& sTestFile : aTestFiles) + { + setTestFileName(sTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_SET_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + const std::vector aAxisShapeNames = + { + "CID/D=0:CS=0:Axis=0,0", // X Axis + "CID/D=0:CS=0:Axis=1,0", // Y Axis + }; + + for (const OUString& sAxisShapeName : aAxisShapeNames) + { + uno::Reference xXAxis = getShapeByName(xShapes, sAxisShapeName); + CPPUNIT_ASSERT(xXAxis.is()); + + CPPUNIT_DUMP_ASSERT_NOTE(sAxisShapeName); + // Check position and size + awt::Point aAxisPosition = xXAxis->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAxisPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAxisPosition.Y, INT_EPS); + awt::Size aAxisSize = xXAxis->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAxisSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAxisSize.Width, INT_EPS); + + // Check transformation + Reference< beans::XPropertySet > xPropSet(xXAxis, UNO_QUERY_THROW); + drawing::HomogenMatrix3 aAxisTransformation; + xPropSet->getPropertyValue("Transformation") >>= aAxisTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aAxisTransformation, INT_EPS); + + // Check line properties + uno::Reference xIndexAccess(xXAxis, UNO_QUERY_THROW); + sal_Int32 nAxisGeometriesCount = xIndexAccess->getCount(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nAxisGeometriesCount); + uno::Reference xAxisLine(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); + Reference< beans::XPropertySet > xAxisLinePropSet(xAxisLine, UNO_QUERY_THROW); + // Line type + drawing::LineDash aLineDash; + xAxisLinePropSet->getPropertyValue("LineDash") >>= aLineDash; + OUString sAxisLineDash = + OUString::number(static_cast(aLineDash.Style)) + ";" + OUString::number(aLineDash.Dots) + ";" + OUString::number(aLineDash.DotLen) + + OUString::number(aLineDash.Dashes) + ";" + OUString::number(aLineDash.DashLen) + ";" + OUString::number(aLineDash.Distance); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sAxisLineDash); + // Line color + util::Color aAxisLineColor = 0; + xAxisLinePropSet->getPropertyValue("LineColor") >>= aAxisLineColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aAxisLineColor)); + // Line width + sal_Int32 nAxisLineWidth = 0; + xAxisLinePropSet->getPropertyValue("LineWidth") >>= nAxisLineWidth; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nAxisLineWidth); + } + } +} + +DECLARE_DUMP_TEST(AxisLabelTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "default_formated_axis.odp", + "rotated_axis_labels.odp", + "formated_axis_labels.odp", + "percent_stacked_column_chart.odp", + "tdf118150.xlsx", + "date-categories.pptx", + }; + + for (const OUString& sTestFile : aTestFiles) + { + setTestFileName(sTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_SET_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + const std::vector aAxisShapeNames = + { + "CID/D=0:CS=0:Axis=0,0", // X Axis + "CID/D=0:CS=0:Axis=1,0", // Y Axis + }; + + for (const OUString& sAxisShapeName : aAxisShapeNames) + { + uno::Reference xXAxis = getShapeByName(xShapes, sAxisShapeName, + // Axis occurs twice in chart xshape representation so need to get the one related to labels + [](const uno::Reference& rXShape) -> bool + { + uno::Reference xAxisShapes(rXShape, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisShapes.is()); + uno::Reference xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY); + uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xChildShape, uno::UNO_QUERY_THROW); + return (xShapeDescriptor->getShapeType() == "com.sun.star.drawing.TextShape"); + }); + CPPUNIT_ASSERT(xXAxis.is()); + CPPUNIT_DUMP_ASSERT_NOTE(sAxisShapeName); + + // Check label count + uno::Reference xIndexAccess(xXAxis, UNO_QUERY_THROW); + sal_Int32 nAxisLabelsCount = xIndexAccess->getCount(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nAxisLabelsCount); + + // Check labels's text, positioning and font properties + for (sal_Int32 nLabelIndex = 0; nLabelIndex < nAxisLabelsCount; ++nLabelIndex) + { + // Check text + uno::Reference xLabel(xIndexAccess->getByIndex(nLabelIndex), uno::UNO_QUERY); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(xLabel->getString()); + + // Check size and position + uno::Reference xLabelShape(xLabel, uno::UNO_QUERY); + /*awt::Point aLabelPosition = xLabelShape->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLabelPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLabelPosition.Y, INT_EPS); + awt::Size aLabelSize = xLabelShape->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLabelSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLabelSize.Width, INT_EPS);*/ + + // Check transformation + Reference< beans::XPropertySet > xPropSet(xLabelShape, UNO_QUERY_THROW); + /*drawing::HomogenMatrix3 aLabelTransformation; + xPropSet->getPropertyValue("Transformation") >>= aLabelTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aLabelTransformation, INT_EPS);*/ + + // Check font color and height + util::Color aLabelFontColor = 0; + xPropSet->getPropertyValue("CharColor") >>= aLabelFontColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aLabelFontColor)); + float fLabelFontHeight = 0.0f; + xPropSet->getPropertyValue("CharHeight") >>= fLabelFontHeight; + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(fLabelFontHeight, 1E-12); + } + } + } +} + +DECLARE_DUMP_TEST(ColumnBarChartTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "normal_column_chart.ods", + "stacked_column_chart.ods", + "percent_stacked_column_chart.ods", + "column_chart_small_spacing.ods", + "normal_bar_chart.ods", + "stacked_bar_chart.ods", + "percent_stacked_bar_chart.ods", + }; + + for (const OUString& sTestFile : aTestFiles) + { + setTestFileName(sTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference xChartType = getChartTypeFromDoc(xChartDoc2, 0); + CPPUNIT_ASSERT(xChartType.is()); + std::vector > aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + size_t nSeriesCount = aDataSeriesYValues.size(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nSeriesCount); + + for (size_t nSeries = 0; nSeries < nSeriesCount; ++nSeries) + { + uno::Reference xSeriesColumnsOrBars = getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=" + OUString::number(nSeries)); + CPPUNIT_ASSERT(xSeriesColumnsOrBars.is()); + CPPUNIT_DUMP_ASSERT_NOTE("Series " + OUString::number(nSeries) + " ColumnsOrBars"); + + // Check column/bar count in the series + uno::Reference xIndexAccess(xSeriesColumnsOrBars, UNO_QUERY_THROW); + sal_Int32 nColumnOrBarCountInSeries = xIndexAccess->getCount(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nColumnOrBarCountInSeries); + + // Check column/bar fill style and color + Reference< beans::XPropertySet > xColumnOrBarPropSet(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); + drawing::FillStyle aSeriesColumnOrBarFillStyle; + xColumnOrBarPropSet->getPropertyValue(UNO_NAME_FILLSTYLE) >>= aSeriesColumnOrBarFillStyle; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aSeriesColumnOrBarFillStyle)); + util::Color aSeriesColumnOrBarFillColor = 0; + xColumnOrBarPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aSeriesColumnOrBarFillColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aSeriesColumnOrBarFillColor)); + + for (sal_Int32 nColumnOrBar = 0; nColumnOrBar < nColumnOrBarCountInSeries; ++nColumnOrBar) + { + uno::Reference xColumnOrBar(xIndexAccess->getByIndex(nColumnOrBar), UNO_QUERY_THROW); + uno::Reference xNamedShape(xIndexAccess->getByIndex(nColumnOrBar), uno::UNO_QUERY); + CPPUNIT_DUMP_ASSERT_NOTE(xNamedShape->getName()); + + // Check size and position + awt::Point aColumnOrBarPosition = xColumnOrBar->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aColumnOrBarPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aColumnOrBarPosition.Y, INT_EPS); + awt::Size aColumnOrBarSize = xColumnOrBar->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aColumnOrBarSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aColumnOrBarSize.Width, INT_EPS); + + // Check transformation + Reference< beans::XPropertySet > xPropSet(xColumnOrBar, UNO_QUERY_THROW); + drawing::HomogenMatrix3 aColumnOrBarTransformation; + xPropSet->getPropertyValue("Transformation") >>= aColumnOrBarTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aColumnOrBarTransformation, INT_EPS); + } + } + } +} + +DECLARE_DUMP_TEST(ChartWallTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "chartwall_auto_adjust_with_titles.ods", + "chartwall_auto_adjust_without_titles.ods", + "chartwall_custom_positioning.ods" + }; + + for (const OUString& sTestFile : aTestFiles) + { + setTestFileName(sTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_SET_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xChartWall = getShapeByName(xShapes, "CID/DiagramWall="); + CPPUNIT_ASSERT(xChartWall.is()); + + // Check position and size + /*awt::Point aChartWallPosition = xChartWall->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aChartWallPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aChartWallPosition.Y, INT_EPS); + awt::Size aChartWallSize = xChartWall->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aChartWallSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aChartWallSize.Width, INT_EPS);*/ + + // Check transformation + Reference< beans::XPropertySet > xPropSet(xChartWall, UNO_QUERY_THROW); + /*drawing::HomogenMatrix3 aChartWallTransformation; + xPropSet->getPropertyValue("Transformation") >>= aChartWallTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aChartWallTransformation, INT_EPS);*/ + + // Check fill properties + drawing::FillStyle aChartWallFillStyle; + xPropSet->getPropertyValue(UNO_NAME_FILLSTYLE) >>= aChartWallFillStyle; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aChartWallFillStyle)); + util::Color aChartWallFillColor = 0; + xPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aChartWallFillColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aChartWallFillColor)); + + // Check line properties + // Line type + drawing::LineDash aLineDash; + xPropSet->getPropertyValue("LineDash") >>= aLineDash; + OUString sChartWallLineDash = + OUString::number(static_cast(aLineDash.Style)) + ";" + OUString::number(aLineDash.Dots) + ";" + OUString::number(aLineDash.DotLen) + + OUString::number(aLineDash.Dashes) + ";" + OUString::number(aLineDash.DashLen) + ";" + OUString::number(aLineDash.Distance); + CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sChartWallLineDash); + // Line color + util::Color aChartWallLineColor = 0; + xPropSet->getPropertyValue("LineColor") >>= aChartWallLineColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aChartWallLineColor)); + // Line width + sal_Int32 nChartWallLineWidth = 0; + xPropSet->getPropertyValue("LineWidth") >>= nChartWallLineWidth; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nChartWallLineWidth); + } +} + +DECLARE_DUMP_TEST(PieChartTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "normal_pie_chart.ods", + "rotated_pie_chart.ods", + "exploded_pie_chart.ods", + "donut_chart.ods", + "pie_chart_many_slices.ods", + }; + + for (const OUString& sTestFile : aTestFiles) + { + setTestFileName(sTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference xChartType = getChartTypeFromDoc(xChartDoc2, 0); + CPPUNIT_ASSERT(xChartType.is()); + + std::vector > aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + size_t nSeriesCount = aDataSeriesYValues.size(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nSeriesCount); + + for (size_t nSeries = 0; nSeries < nSeriesCount; ++nSeries) + { + uno::Reference xSeriesSlices = getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=" + OUString::number(nSeries)); + if (!xSeriesSlices.is()) + break; // Normal pie chart displays only one series + CPPUNIT_DUMP_ASSERT_NOTE("Series " + OUString::number(nSeries) + " slices"); + + // Check slice count in the series + uno::Reference xIndexAccess(xSeriesSlices, UNO_QUERY_THROW); + sal_Int32 nSlicesCountInSeries = xIndexAccess->getCount(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nSlicesCountInSeries); + + // Check slices properties + for (sal_Int32 nSlice = 0; nSlice < nSlicesCountInSeries; ++nSlice) + { + uno::Reference xSlice(xIndexAccess->getByIndex(nSlice), UNO_QUERY_THROW); + uno::Reference xNamedShape(xIndexAccess->getByIndex(nSlice), uno::UNO_QUERY); + OUString sName = xNamedShape->getName(); + CPPUNIT_DUMP_ASSERT_NOTE(sName.copy(sName.lastIndexOf("/D=0"))); + + // Check size and position + awt::Point aSlicePosition = xSlice->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aSlicePosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aSlicePosition.Y, INT_EPS); + awt::Size aSliceSize = xSlice->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aSliceSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aSliceSize.Width, INT_EPS); + + // Check transformation + Reference< beans::XPropertySet > xPropSet(xSlice, UNO_QUERY_THROW); + drawing::HomogenMatrix3 aSliceTransformation; + xPropSet->getPropertyValue("Transformation") >>= aSliceTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aSliceTransformation, INT_EPS); + + // Check slice fill style and color + drawing::FillStyle aSliceFillStyle; + xPropSet->getPropertyValue(UNO_NAME_FILLSTYLE) >>= aSliceFillStyle; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aSliceFillStyle)); + util::Color aSliceFillColor = 0; + xPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aSliceFillColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aSliceFillColor)); + } + } + } +} + +DECLARE_DUMP_TEST(AreaChartTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "normal_area_chart.ods", + "stacked_area_chart.ods", + "percent_stacked_area_chart.ods" + }; + + for (const OUString& sTestFile : aTestFiles) + { + setTestFileName(sTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference xChartType = getChartTypeFromDoc(xChartDoc2, 0); + CPPUNIT_ASSERT(xChartType.is()); + + std::vector > aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + size_t nSeriesCount = aDataSeriesYValues.size(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nSeriesCount); + + for (size_t nSeries = 0; nSeries < nSeriesCount; ++nSeries) + { + uno::Reference xSeries = getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=" + OUString::number(nSeries)); + CPPUNIT_ASSERT(xSeries.is()); + CPPUNIT_DUMP_ASSERT_NOTE("Series " + OUString::number(nSeries)); + + // One area for one series + uno::Reference xIndexAccess(xSeries, UNO_QUERY_THROW); + uno::Reference xIndexAccess2(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); // Why this second group shape is here? + uno::Reference xArea(xIndexAccess2->getByIndex(0), UNO_QUERY_THROW); + + // Check size and position + awt::Point aAreaPosition = xArea->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAreaPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAreaPosition.Y, INT_EPS); + awt::Size aAreaSize = xArea->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAreaSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAreaSize.Width, INT_EPS); + + // Check transformation + Reference< beans::XPropertySet > xPropSet(xArea, UNO_QUERY_THROW); + drawing::HomogenMatrix3 aAreaTransformation; + xPropSet->getPropertyValue("Transformation") >>= aAreaTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aAreaTransformation, INT_EPS); + + // Check area fill style and color + drawing::FillStyle aAreaFillStyle; + xPropSet->getPropertyValue(UNO_NAME_FILLSTYLE) >>= aAreaFillStyle; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aAreaFillStyle)); + util::Color aAreaFillColor = 0; + xPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aAreaFillColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aAreaFillColor)); + } + } +} + + +DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false) +{ + const std::vector aTestFiles = + { + "normal_line_chart_lines_only.ods", + "normal_line_chart_points_only.ods", + "normal_line_chart_lines_and_points.ods", + "stacked_line_chart_lines_only.ods", + "stacked_line_chart_points_only.ods", + "stacked_line_chart_lines_and_points.ods", + "percent_stacked_line_chart_lines_only.ods", + "percent_stacked_line_chart_points_only.ods", + "percent_stacked_line_chart_lines_and_points.ods", + "scatter_chart_points_only.ods", + "scatter_chart_lines_only.ods", + "scatter_chart_lines_and_points.ods", + }; + + for (const OUString& sTestFile : aTestFiles) + { + setTestFileName(sTestFile); + loadFromFile(getTestFileName()); + uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference xChartType = getChartTypeFromDoc(xChartDoc2, 0); + CPPUNIT_ASSERT(xChartType.is()); + + std::vector > aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + size_t nSeriesCount = aDataSeriesYValues.size(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nSeriesCount); + + for (size_t nSeries = 0; nSeries < nSeriesCount; ++nSeries) + { + uno::Reference xSeries = getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=" + OUString::number(nSeries)); + CPPUNIT_ASSERT(xSeries.is()); + CPPUNIT_DUMP_ASSERT_NOTE("Series " + OUString::number(nSeries)); + + uno::Reference xIndexAccess(xSeries, UNO_QUERY_THROW); + uno::Reference xIndexAccess2(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); + uno::Reference xLine(xIndexAccess2->getByIndex(0), UNO_QUERY_THROW); + Reference< beans::XPropertySet > xPropSet(xLine, UNO_QUERY_THROW); + + // Check whether we have line + drawing::LineStyle aSeriesLineStyle; + xPropSet->getPropertyValue(UNO_NAME_LINESTYLE) >>= aSeriesLineStyle; + if (aSeriesLineStyle != drawing::LineStyle_NONE) + { + CPPUNIT_DUMP_ASSERT_NOTE("Lines are displayed"); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aSeriesLineStyle)); + + // Check line shape geometry + awt::Point aLinePosition = xLine->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLinePosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLinePosition.Y, INT_EPS); + awt::Size aLineSize = xLine->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLineSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLineSize.Width, INT_EPS); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::HomogenMatrix3 aLineTransformation; + xPropSet->getPropertyValue("Transformation") >>= aLineTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aLineTransformation, INT_EPS); + } + + // Check points of series + if (xIndexAccess->getCount() >= 2) + { + CPPUNIT_DUMP_ASSERT_NOTE("Points are displayed"); + uno::Reference xPointsOfSeries(xIndexAccess->getByIndex(1), UNO_QUERY_THROW); + sal_Int32 nPointCountInSeries = xPointsOfSeries->getCount(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nPointCountInSeries); + for (sal_Int32 nPoint = 0; nPoint < nPointCountInSeries; ++nPoint) + { + uno::Reference XPointContainer ( + getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=" + OUString::number(nSeries) + ":Point=" + OUString::number(nPoint)), UNO_QUERY_THROW); + uno::Reference XPoint(XPointContainer->getByIndex(0), UNO_QUERY_THROW); + uno::Reference xNamedShape(XPointContainer, uno::UNO_QUERY); + CPPUNIT_DUMP_ASSERT_NOTE(xNamedShape->getName()); + + // Check size and position + awt::Point aPointPosition = XPoint->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aPointPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aPointPosition.Y, INT_EPS); + awt::Size aPointSize = XPoint->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aPointSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aPointSize.Width, INT_EPS); + + // Check transformation + Reference< beans::XPropertySet > xPointPropSet(XPoint, UNO_QUERY_THROW); + drawing::HomogenMatrix3 aPointTransformation; + xPointPropSet->getPropertyValue("Transformation") >>= aPointTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aPointTransformation, INT_EPS); + + // Check fill style and color + drawing::FillStyle aPointFillStyle; + xPointPropSet->getPropertyValue(UNO_NAME_FILLSTYLE) >>= aPointFillStyle; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aPointFillStyle)); + util::Color aPointFillColor = 0; + xPointPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aPointFillColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast(aPointFillColor)); + } + } + } + } +} + +DECLARE_DUMP_TEST( PivotChartDataButtonTest, Chart2DumpTest, false ) +{ + setTestFileName( "pivotchart_data_button.ods" ); + loadFromFile(getTestFileName()); + + // Check that we have pivot chart in the document + uno::Reference xTablePivotCharts = getTablePivotChartsFromSheet( 1, mxComponent ); + uno::Reference xIndexAccess( xTablePivotCharts, UNO_QUERY_THROW ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xIndexAccess->getCount() ); + + // Get the pivot chart document so we ca access its data + uno::Reference xChartDoc; + xChartDoc.set( getPivotChartDocFromSheet( xTablePivotCharts, 0 ) ); + CPPUNIT_ASSERT( xChartDoc.is() ); + + uno::Reference xDrawPageSupplier( xChartDoc, uno::UNO_QUERY ); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes( xDrawPage->getByIndex(0), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xShapes.is() ); + + // Get the shape that represents the "Data" button. + uno::Reference xButton = getShapeByName( xShapes, "FieldButton.Row.8", + []( const uno::Reference& xShapeNode ) + { + return xShapeNode->getShapeType() == "com.sun.star.drawing.TextShape"; + } ); + CPPUNIT_ASSERT_MESSAGE( "Cannot find Data button shape", xButton.is() ); + + // Make sure that there is no arrow shape with the Data button + uno::Reference xArrow = getShapeByName( xShapes, "FieldButton.Row.8", + []( const uno::Reference& xShapeNode ) + { + return xShapeNode->getShapeType() == "com.sun.star.drawing.PolyPolygonShape"; + } ); + CPPUNIT_ASSERT_MESSAGE( "Arrow shape should not be present for the Data button", !xArrow.is() ); + + // Assert the background color of the Data button + util::Color aButtonFillColor = 0; + uno::Reference xPropSet( xButton, UNO_QUERY_THROW ); + xPropSet->getPropertyValue( UNO_NAME_FILLCOLOR ) >>= aButtonFillColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL( static_cast( aButtonFillColor ) ); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2dump/data/axis_special_positioning.odp b/chart2/qa/extras/chart2dump/data/axis_special_positioning.odp new file mode 100644 index 0000000000..a09ddb893d Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/axis_special_positioning.odp differ diff --git a/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods new file mode 100644 index 0000000000..1b41db316e Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods differ diff --git a/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods new file mode 100644 index 0000000000..be5b118048 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods differ diff --git a/chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods b/chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods new file mode 100644 index 0000000000..b6ba872212 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods differ diff --git a/chart2/qa/extras/chart2dump/data/column_chart_small_spacing.ods b/chart2/qa/extras/chart2dump/data/column_chart_small_spacing.ods new file mode 100644 index 0000000000..1206a4e198 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/column_chart_small_spacing.ods differ diff --git a/chart2/qa/extras/chart2dump/data/custom_legend_position.odp b/chart2/qa/extras/chart2dump/data/custom_legend_position.odp new file mode 100644 index 0000000000..d36677ab49 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/custom_legend_position.odp differ diff --git a/chart2/qa/extras/chart2dump/data/date-categories.pptx b/chart2/qa/extras/chart2dump/data/date-categories.pptx new file mode 100644 index 0000000000..b9e0c69f32 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/date-categories.pptx differ diff --git a/chart2/qa/extras/chart2dump/data/default_formated_axis.odp b/chart2/qa/extras/chart2dump/data/default_formated_axis.odp new file mode 100644 index 0000000000..a5cdd0522b Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/default_formated_axis.odp differ diff --git a/chart2/qa/extras/chart2dump/data/donut_chart.ods b/chart2/qa/extras/chart2dump/data/donut_chart.ods new file mode 100644 index 0000000000..4490f76954 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/donut_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/exploded_pie_chart.ods b/chart2/qa/extras/chart2dump/data/exploded_pie_chart.ods new file mode 100644 index 0000000000..68a9c98429 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/exploded_pie_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/formated_axis_labels.odp b/chart2/qa/extras/chart2dump/data/formated_axis_labels.odp new file mode 100644 index 0000000000..a94c8c4d05 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/formated_axis_labels.odp differ diff --git a/chart2/qa/extras/chart2dump/data/formated_axis_lines.odp b/chart2/qa/extras/chart2dump/data/formated_axis_lines.odp new file mode 100644 index 0000000000..7a421497b4 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/formated_axis_lines.odp differ diff --git a/chart2/qa/extras/chart2dump/data/formated_grid_line.ods b/chart2/qa/extras/chart2dump/data/formated_grid_line.ods new file mode 100644 index 0000000000..1d0ef5389f Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/formated_grid_line.ods differ diff --git a/chart2/qa/extras/chart2dump/data/horizontal_grid.ods b/chart2/qa/extras/chart2dump/data/horizontal_grid.ods new file mode 100644 index 0000000000..c9f913067b Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/horizontal_grid.ods differ diff --git a/chart2/qa/extras/chart2dump/data/legend_on_bottom.odp b/chart2/qa/extras/chart2dump/data/legend_on_bottom.odp new file mode 100644 index 0000000000..b080d33116 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/legend_on_bottom.odp differ diff --git a/chart2/qa/extras/chart2dump/data/legend_on_left_side.odp b/chart2/qa/extras/chart2dump/data/legend_on_left_side.odp new file mode 100644 index 0000000000..71e2947c6a Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/legend_on_left_side.odp differ diff --git a/chart2/qa/extras/chart2dump/data/legend_on_right_side.odp b/chart2/qa/extras/chart2dump/data/legend_on_right_side.odp new file mode 100644 index 0000000000..7aac4d3f33 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/legend_on_right_side.odp differ diff --git a/chart2/qa/extras/chart2dump/data/legend_on_top.odp b/chart2/qa/extras/chart2dump/data/legend_on_top.odp new file mode 100644 index 0000000000..318901f2e4 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/legend_on_top.odp differ diff --git a/chart2/qa/extras/chart2dump/data/many_legend_entries.odp b/chart2/qa/extras/chart2dump/data/many_legend_entries.odp new file mode 100644 index 0000000000..8f02a99f66 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/many_legend_entries.odp differ diff --git a/chart2/qa/extras/chart2dump/data/minimal_legend_test.odp b/chart2/qa/extras/chart2dump/data/minimal_legend_test.odp new file mode 100644 index 0000000000..63911f119c Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/minimal_legend_test.odp differ diff --git a/chart2/qa/extras/chart2dump/data/minor_grid.ods b/chart2/qa/extras/chart2dump/data/minor_grid.ods new file mode 100644 index 0000000000..f8f30198b0 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/minor_grid.ods differ diff --git a/chart2/qa/extras/chart2dump/data/multiple_categories.odp b/chart2/qa/extras/chart2dump/data/multiple_categories.odp new file mode 100644 index 0000000000..95e51f3f69 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/multiple_categories.odp differ diff --git a/chart2/qa/extras/chart2dump/data/multiple_categories.ods b/chart2/qa/extras/chart2dump/data/multiple_categories.ods new file mode 100644 index 0000000000..67e00525b9 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/multiple_categories.ods differ diff --git a/chart2/qa/extras/chart2dump/data/normal_area_chart.ods b/chart2/qa/extras/chart2dump/data/normal_area_chart.ods new file mode 100644 index 0000000000..84b9ec2247 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/normal_area_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/normal_bar_chart.ods b/chart2/qa/extras/chart2dump/data/normal_bar_chart.ods new file mode 100644 index 0000000000..531f406f93 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/normal_bar_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/normal_column_chart.ods b/chart2/qa/extras/chart2dump/data/normal_column_chart.ods new file mode 100644 index 0000000000..a8c6404001 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/normal_column_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_and_points.ods b/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_and_points.ods new file mode 100644 index 0000000000..4dd613b6f4 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_and_points.ods differ diff --git a/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_only.ods b/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_only.ods new file mode 100644 index 0000000000..c4f57a6f3c Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_only.ods differ diff --git a/chart2/qa/extras/chart2dump/data/normal_line_chart_points_only.ods b/chart2/qa/extras/chart2dump/data/normal_line_chart_points_only.ods new file mode 100644 index 0000000000..e55b41115e Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/normal_line_chart_points_only.ods differ diff --git a/chart2/qa/extras/chart2dump/data/normal_pie_chart.ods b/chart2/qa/extras/chart2dump/data/normal_pie_chart.ods new file mode 100644 index 0000000000..3c3a6a327f Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/normal_pie_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/percent_stacked_area_chart.ods b/chart2/qa/extras/chart2dump/data/percent_stacked_area_chart.ods new file mode 100644 index 0000000000..0cc5d1728a Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/percent_stacked_area_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/percent_stacked_bar_chart.ods b/chart2/qa/extras/chart2dump/data/percent_stacked_bar_chart.ods new file mode 100644 index 0000000000..2d337a5b3d Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/percent_stacked_bar_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/percent_stacked_column_chart.odp b/chart2/qa/extras/chart2dump/data/percent_stacked_column_chart.odp new file mode 100644 index 0000000000..e8180cfc73 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/percent_stacked_column_chart.odp differ diff --git a/chart2/qa/extras/chart2dump/data/percent_stacked_column_chart.ods b/chart2/qa/extras/chart2dump/data/percent_stacked_column_chart.ods new file mode 100644 index 0000000000..ce7440aa77 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/percent_stacked_column_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_lines_and_points.ods b/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_lines_and_points.ods new file mode 100644 index 0000000000..ade9ea8f13 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_lines_and_points.ods differ diff --git a/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_lines_only.ods b/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_lines_only.ods new file mode 100644 index 0000000000..3228f51a3f Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_lines_only.ods differ diff --git a/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_points_only.ods b/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_points_only.ods new file mode 100644 index 0000000000..b2483b6da5 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/percent_stacked_line_chart_points_only.ods differ diff --git a/chart2/qa/extras/chart2dump/data/pie_chart_many_slices.ods b/chart2/qa/extras/chart2dump/data/pie_chart_many_slices.ods new file mode 100644 index 0000000000..2cc2e8b7bb Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/pie_chart_many_slices.ods differ diff --git a/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods b/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods new file mode 100644 index 0000000000..d57edf66d2 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods differ diff --git a/chart2/qa/extras/chart2dump/data/rotated_axis_labels.odp b/chart2/qa/extras/chart2dump/data/rotated_axis_labels.odp new file mode 100644 index 0000000000..24e9cf05b2 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/rotated_axis_labels.odp differ diff --git a/chart2/qa/extras/chart2dump/data/rotated_pie_chart.ods b/chart2/qa/extras/chart2dump/data/rotated_pie_chart.ods new file mode 100644 index 0000000000..ee8b3a7d96 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/rotated_pie_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/scatter_chart_lines_and_points.ods b/chart2/qa/extras/chart2dump/data/scatter_chart_lines_and_points.ods new file mode 100644 index 0000000000..de7b1c67c5 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/scatter_chart_lines_and_points.ods differ diff --git a/chart2/qa/extras/chart2dump/data/scatter_chart_lines_only.ods b/chart2/qa/extras/chart2dump/data/scatter_chart_lines_only.ods new file mode 100644 index 0000000000..fed5789927 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/scatter_chart_lines_only.ods differ diff --git a/chart2/qa/extras/chart2dump/data/scatter_chart_points_only.ods b/chart2/qa/extras/chart2dump/data/scatter_chart_points_only.ods new file mode 100644 index 0000000000..dd1626d7a2 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/scatter_chart_points_only.ods differ diff --git a/chart2/qa/extras/chart2dump/data/simple_chart.ods b/chart2/qa/extras/chart2dump/data/simple_chart.ods new file mode 100644 index 0000000000..f65584d12a Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/simple_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/stacked_area_chart.ods b/chart2/qa/extras/chart2dump/data/stacked_area_chart.ods new file mode 100644 index 0000000000..56bc4e4992 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/stacked_area_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/stacked_bar_chart.ods b/chart2/qa/extras/chart2dump/data/stacked_bar_chart.ods new file mode 100644 index 0000000000..2e8ca327e4 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/stacked_bar_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/stacked_column_chart.ods b/chart2/qa/extras/chart2dump/data/stacked_column_chart.ods new file mode 100644 index 0000000000..159df229a4 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/stacked_column_chart.ods differ diff --git a/chart2/qa/extras/chart2dump/data/stacked_line_chart_lines_and_points.ods b/chart2/qa/extras/chart2dump/data/stacked_line_chart_lines_and_points.ods new file mode 100644 index 0000000000..d11ecb7058 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/stacked_line_chart_lines_and_points.ods differ diff --git a/chart2/qa/extras/chart2dump/data/stacked_line_chart_lines_only.ods b/chart2/qa/extras/chart2dump/data/stacked_line_chart_lines_only.ods new file mode 100644 index 0000000000..1652c3a589 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/stacked_line_chart_lines_only.ods differ diff --git a/chart2/qa/extras/chart2dump/data/stacked_line_chart_points_only.ods b/chart2/qa/extras/chart2dump/data/stacked_line_chart_points_only.ods new file mode 100644 index 0000000000..a85a2abe86 Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/stacked_line_chart_points_only.ods differ diff --git a/chart2/qa/extras/chart2dump/data/tdf118150.xlsx b/chart2/qa/extras/chart2dump/data/tdf118150.xlsx new file mode 100644 index 0000000000..f29b9a1c2e Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/tdf118150.xlsx differ diff --git a/chart2/qa/extras/chart2dump/data/vertical_grid.ods b/chart2/qa/extras/chart2dump/data/vertical_grid.ods new file mode 100644 index 0000000000..9f2ed7838a Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/vertical_grid.ods differ diff --git a/chart2/qa/extras/chart2dump/reference/areacharttest/normal_area_chart.txt b/chart2/qa/extras/chart2dump/reference/areacharttest/normal_area_chart.txt new file mode 100644 index 0000000000..4f4a5181fd --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/areacharttest/normal_area_chart.txt @@ -0,0 +1,62 @@ +// nSeriesCount +4 +/// Series 0 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3295 +// aAreaSize.Height +4052 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;4052;3295;0;0;1 +// static_cast(aAreaFillStyle) +1 +// static_cast(aAreaFillColor) +16711680 +/// Series 1 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3385 +// aAreaSize.Height +3962 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;3962;3385;0;0;1 +// static_cast(aAreaFillStyle) +2 +// static_cast(aAreaFillColor) +10079487 +/// Series 2 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3345 +// aAreaSize.Height +4002 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;4002;3345;0;0;1 +// static_cast(aAreaFillStyle) +4 +// static_cast(aAreaFillColor) +10079487 +/// Series 3 +// aAreaPosition.X +5507 +// aAreaPosition.Y +2334 +// aAreaSize.Height +5013 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;5013;2334;0;0;1 +// static_cast(aAreaFillStyle) +3 +// static_cast(aAreaFillColor) +16777215 diff --git a/chart2/qa/extras/chart2dump/reference/areacharttest/percent_stacked_area_chart.txt b/chart2/qa/extras/chart2dump/reference/areacharttest/percent_stacked_area_chart.txt new file mode 100644 index 0000000000..b8769b7ad3 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/areacharttest/percent_stacked_area_chart.txt @@ -0,0 +1,62 @@ +// nSeriesCount +4 +/// Series 0 +// aAreaPosition.X +5507 +// aAreaPosition.Y +5080 +// aAreaSize.Height +2267 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2267;5080;0;0;1 +// static_cast(aAreaFillStyle) +1 +// static_cast(aAreaFillColor) +16711680 +/// Series 1 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3458 +// aAreaSize.Height +2693 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2693;3458;0;0;1 +// static_cast(aAreaFillStyle) +2 +// static_cast(aAreaFillColor) +10079487 +/// Series 2 +// aAreaPosition.X +5507 +// aAreaPosition.Y +2634 +// aAreaSize.Height +2049 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2049;2634;0;0;1 +// static_cast(aAreaFillStyle) +4 +// static_cast(aAreaFillColor) +10079487 +/// Series 3 +// aAreaPosition.X +5507 +// aAreaPosition.Y +1344 +// aAreaSize.Height +2157 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2157;1344;0;0;1 +// static_cast(aAreaFillStyle) +3 +// static_cast(aAreaFillColor) +16777215 diff --git a/chart2/qa/extras/chart2dump/reference/areacharttest/stacked_area_chart.txt b/chart2/qa/extras/chart2dump/reference/areacharttest/stacked_area_chart.txt new file mode 100644 index 0000000000..00934b44bf --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/areacharttest/stacked_area_chart.txt @@ -0,0 +1,62 @@ +// nSeriesCount +4 +/// Series 0 +// aAreaPosition.X +5507 +// aAreaPosition.Y +5958 +// aAreaSize.Height +1389 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;1389;5958;0;0;1 +// static_cast(aAreaFillStyle) +1 +// static_cast(aAreaFillColor) +16711680 +/// Series 1 +// aAreaPosition.X +5507 +// aAreaPosition.Y +4882 +// aAreaSize.Height +1710 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;1710;4882;0;0;1 +// static_cast(aAreaFillStyle) +2 +// static_cast(aAreaFillColor) +10079487 +/// Series 2 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3510 +// aAreaSize.Height +2542 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2542;3510;0;0;1 +// static_cast(aAreaFillStyle) +4 +// static_cast(aAreaFillColor) +10079487 +/// Series 3 +// aAreaPosition.X +5507 +// aAreaPosition.Y +1792 +// aAreaSize.Height +3985 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;3985;1792;0;0;1 +// static_cast(aAreaFillStyle) +3 +// static_cast(aAreaFillColor) +16777215 diff --git a/chart2/qa/extras/chart2dump/reference/axisgeometrytest/axis_special_positioning.txt b/chart2/qa/extras/chart2dump/reference/axisgeometrytest/axis_special_positioning.txt new file mode 100644 index 0000000000..e34ef3c104 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axisgeometrytest/axis_special_positioning.txt @@ -0,0 +1,38 @@ +/// CID/D=0:CS=0:Axis=0,0 +// aAxisPosition.X +5112 +// aAxisPosition.Y +1990 +// aAxisSize.Height +300 +// aAxisSize.Width +17133 +// aAxisTransformation +17134;0;5112;0;301;1990;0;0;1 +// nAxisGeometriesCount +2 +// sAxisLineDash +0;1;201;20;20 +// static_cast(aAxisLineColor) +0 +// nAxisLineWidth +0 +/// CID/D=0:CS=0:Axis=1,0 +// aAxisPosition.X +22245 +// aAxisPosition.Y +2140 +// aAxisSize.Height +8005 +// aAxisSize.Width +150 +// aAxisTransformation +151;0;22245;0;8006;2140;0;0;1 +// nAxisGeometriesCount +3 +// sAxisLineDash +0;1;201;20;20 +// static_cast(aAxisLineColor) +0 +// nAxisLineWidth +0 diff --git a/chart2/qa/extras/chart2dump/reference/axisgeometrytest/default_formated_axis.txt b/chart2/qa/extras/chart2dump/reference/axisgeometrytest/default_formated_axis.txt new file mode 100644 index 0000000000..46eec6d766 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axisgeometrytest/default_formated_axis.txt @@ -0,0 +1,38 @@ +/// CID/D=0:CS=0:Axis=0,0 +// aAxisPosition.X +5393 +// aAxisPosition.Y +11883 +// aAxisSize.Height +150 +// aAxisSize.Width +17455 +// aAxisTransformation +17456;0;5393;0;151;11883;0;0;1 +// nAxisGeometriesCount +2 +// sAxisLineDash +0;1;201;20;20 +// static_cast(aAxisLineColor) +0 +// nAxisLineWidth +0 +/// CID/D=0:CS=0:Axis=1,0 +// aAxisPosition.X +5243 +// aAxisPosition.Y +2507 +// aAxisSize.Height +9376 +// aAxisSize.Width +150 +// aAxisTransformation +151;0;5243;0;9377;2507;0;0;1 +// nAxisGeometriesCount +2 +// sAxisLineDash +0;1;201;20;20 +// static_cast(aAxisLineColor) +0 +// nAxisLineWidth +0 diff --git a/chart2/qa/extras/chart2dump/reference/axisgeometrytest/formated_axis_lines.txt b/chart2/qa/extras/chart2dump/reference/axisgeometrytest/formated_axis_lines.txt new file mode 100644 index 0000000000..980e2592da --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axisgeometrytest/formated_axis_lines.txt @@ -0,0 +1,38 @@ +/// CID/D=0:CS=0:Axis=0,0 +// aAxisPosition.X +3852 +// aAxisPosition.Y +9713 +// aAxisSize.Height +150 +// aAxisSize.Width +15854 +// aAxisTransformation +15855;0;3852;0;151;9713;0;0;1 +// nAxisGeometriesCount +2 +// sAxisLineDash +0;1;00;0;457 +// static_cast(aAxisLineColor) +16711680 +// nAxisLineWidth +100 +/// CID/D=0:CS=0:Axis=1,0 +// aAxisPosition.X +3702 +// aAxisPosition.Y +2051 +// aAxisSize.Height +7662 +// aAxisSize.Width +150 +// aAxisTransformation +151;0;3702;0;7663;2051;0;0;1 +// nAxisGeometriesCount +2 +// sAxisLineDash +0;1;511;51;51 +// static_cast(aAxisLineColor) +65280 +// nAxisLineWidth +100 diff --git a/chart2/qa/extras/chart2dump/reference/axisgeometrytest/rotated_axis_labels.txt b/chart2/qa/extras/chart2dump/reference/axisgeometrytest/rotated_axis_labels.txt new file mode 100644 index 0000000000..151ab21acb --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axisgeometrytest/rotated_axis_labels.txt @@ -0,0 +1,38 @@ +/// CID/D=0:CS=0:Axis=0,0 +// aAxisPosition.X +3798 +// aAxisPosition.Y +9860 +// aAxisSize.Height +150 +// aAxisSize.Width +16412 +// aAxisTransformation +16413;0;3798;0;151;9860;0;0;1 +// nAxisGeometriesCount +2 +// sAxisLineDash +0;1;201;20;20 +// static_cast(aAxisLineColor) +0 +// nAxisLineWidth +0 +/// CID/D=0:CS=0:Axis=1,0 +// aAxisPosition.X +3648 +// aAxisPosition.Y +2082 +// aAxisSize.Height +7778 +// aAxisSize.Width +150 +// aAxisTransformation +151;0;3648;0;7779;2082;0;0;1 +// nAxisGeometriesCount +2 +// sAxisLineDash +0;1;201;20;20 +// static_cast(aAxisLineColor) +0 +// nAxisLineWidth +0 diff --git a/chart2/qa/extras/chart2dump/reference/axislabeltest/date-categories.txt b/chart2/qa/extras/chart2dump/reference/axislabeltest/date-categories.txt new file mode 100644 index 0000000000..a9274fd783 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axislabeltest/date-categories.txt @@ -0,0 +1,180 @@ +/// CID/D=0:CS=0:Axis=0,0 +// nAxisLabelsCount +22 +// xLabel->getString() +15/Jun/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +17/Jun/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +19/Jun/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +21/Jun/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +23/Jun/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +25/Jun/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +27/Jun/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +29/Jun/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +1/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +3/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +5/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +7/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +9/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +11/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +13/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +15/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +17/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +19/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +21/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +23/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +25/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +27/Jul/21 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +/// CID/D=0:CS=0:Axis=1,0 +// nAxisLabelsCount +7 +// xLabel->getString() +0 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +20 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +40 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +60 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +80 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +100 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 +// xLabel->getString() +120 +// static_cast(aLabelFontColor) +5855577 +// fLabelFontHeight +9 diff --git a/chart2/qa/extras/chart2dump/reference/axislabeltest/default_formated_axis.txt b/chart2/qa/extras/chart2dump/reference/axislabeltest/default_formated_axis.txt new file mode 100644 index 0000000000..51c1e37d63 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axislabeltest/default_formated_axis.txt @@ -0,0 +1,96 @@ +/// CID/D=0:CS=0:Axis=0,0 +// nAxisLabelsCount +4 +// xLabel->getString() +1. quarter +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +2. quarter +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +3. quarter +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +4. quarter +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +/// CID/D=0:CS=0:Axis=1,0 +// nAxisLabelsCount +11 +// xLabel->getString() +- Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +2000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +4000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +6000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +8000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +10000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +12000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +14000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +16000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +18000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +20000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 diff --git a/chart2/qa/extras/chart2dump/reference/axislabeltest/formated_axis_labels.txt b/chart2/qa/extras/chart2dump/reference/axislabeltest/formated_axis_labels.txt new file mode 100644 index 0000000000..ffc0877e49 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axislabeltest/formated_axis_labels.txt @@ -0,0 +1,96 @@ +/// CID/D=0:CS=0:Axis=0,0 +// nAxisLabelsCount +4 +// xLabel->getString() +1. quarter +// static_cast(aLabelFontColor) +8388352 +// fLabelFontHeight +12 +// xLabel->getString() +2. quarter +// static_cast(aLabelFontColor) +8388352 +// fLabelFontHeight +12 +// xLabel->getString() +2. quarter +// static_cast(aLabelFontColor) +8388352 +// fLabelFontHeight +12 +// xLabel->getString() +2. quarter +// static_cast(aLabelFontColor) +8388352 +// fLabelFontHeight +12 +/// CID/D=0:CS=0:Axis=1,0 +// nAxisLabelsCount +11 +// xLabel->getString() +- Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +2000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +4000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +6000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +8000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +10000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +12000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +14000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +16000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +18000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 +// xLabel->getString() +20000000 Ft +// static_cast(aLabelFontColor) +16711935 +// fLabelFontHeight +14 diff --git a/chart2/qa/extras/chart2dump/reference/axislabeltest/percent_stacked_column_chart.txt b/chart2/qa/extras/chart2dump/reference/axislabeltest/percent_stacked_column_chart.txt new file mode 100644 index 0000000000..304f9abf03 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axislabeltest/percent_stacked_column_chart.txt @@ -0,0 +1,96 @@ +/// CID/D=0:CS=0:Axis=0,0 +// nAxisLabelsCount +4 +// xLabel->getString() +Inkjet +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Leser +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Multifunction +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Picture +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +/// CID/D=0:CS=0:Axis=1,0 +// nAxisLabelsCount +11 +// xLabel->getString() +0,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +10,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +20,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +30,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +40,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +50,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +60,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +70,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +80,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +90,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +100,00% +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 diff --git a/chart2/qa/extras/chart2dump/reference/axislabeltest/rotated_axis_labels.txt b/chart2/qa/extras/chart2dump/reference/axislabeltest/rotated_axis_labels.txt new file mode 100644 index 0000000000..52aceba87b --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axislabeltest/rotated_axis_labels.txt @@ -0,0 +1,60 @@ +/// CID/D=0:CS=0:Axis=0,0 +// nAxisLabelsCount +4 +// xLabel->getString() +1. quarter +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +2. quarter +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +3. quarter +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +4. quarter +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +/// CID/D=0:CS=0:Axis=1,0 +// nAxisLabelsCount +5 +// xLabel->getString() +- Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +5000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +10000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +15000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +20000000 Ft +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 diff --git a/chart2/qa/extras/chart2dump/reference/axislabeltest/tdf118150.txt b/chart2/qa/extras/chart2dump/reference/axislabeltest/tdf118150.txt new file mode 100644 index 0000000000..fabf4acac6 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/axislabeltest/tdf118150.txt @@ -0,0 +1,216 @@ +/// CID/D=0:CS=0:Axis=0,0 +// nAxisLabelsCount +28 +// xLabel->getString() +Sep 2013 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Oct 2013 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Nov 2013 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Dec 2013 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Jan 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Feb 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Mar 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Apr 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +May 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Jun 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Jul 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Aug 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Sep 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Oct 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Nov 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Dec 2014 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Jan 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Feb 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Mar 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Apr 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +May 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Jun 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Jul 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Aug 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Sep 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Oct 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Nov 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +Dec 2015 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +/// CID/D=0:CS=0:Axis=1,0 +// nAxisLabelsCount +7 +// xLabel->getString() +0.00 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +2.00 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +4.00 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +6.00 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +8.00 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +10.00 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 +// xLabel->getString() +12.00 +// static_cast(aLabelFontColor) +0 +// fLabelFontHeight +10 diff --git a/chart2/qa/extras/chart2dump/reference/chartdatatest/multiple_categories.txt b/chart2/qa/extras/chart2dump/reference/chartdatatest/multiple_categories.txt new file mode 100644 index 0000000000..1d0e3ea39d --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/chartdatatest/multiple_categories.txt @@ -0,0 +1,70 @@ +// sChartTitle +Chart Title +// sChartType +com.sun.star.chart2.LineChartType +// nXAxisNumberFormat +0 +// nXAxisNumberType +16 +// nYAxisNumberFormat +0 +// nYAxisNumberType +16 +// aColumnLabels.getLength() +8 +// sColumnLabels +A In0;A In100;A In200;A In400;B In0;B In100;B In200;B In400; +// aRowLabels.getLength() +49 +// sRowLabels +M 14;M 15;M 99;M 22;M 17;M 25;M 28;M 25;M 26;M 24;M 25;M 22;M 33;M 22;M 25;M 32;M 19;M 14;M 18;F 22;F 16;F 26;F 18;F 48;F 19;F 24;F 22;F 25;F 28;F 23;F 25;F 29;F 24;F 27;F 24;F 27;F 27;F 31;F 17;F 50;F 17;F 16;F 17;F 15;F 17;F 17;F 17;F 17;F 18; +// aDataSeriesYValues.size() +8 +// aYValuesOfSeries.size() +49 +// sYValuesOfSeries +0.533;0.413;0.55;0.273;0.45;0.423;0.54;0.433;0.417;0.513;0.563;0.503;0.54;0.737;0.563;0.36;0.443;1.007;1.21;0.51;0.443;0.41;0.637;1.15;0.777;0.58;0.587;0.713;0.477;0.533;0.55;0.443;0.197;0.48;0.497;0.513;0.607;0.573;0.54;0.283;0.257;0.43;0.223;0.377;0.38;0.573;1.843;0.427;0.523; +// aYValuesOfSeries.size() +49 +// sYValuesOfSeries +0.8;0.287;0.457;0.143;0.61;0.373;0.47;0.397;0.413;0.337;0.347;0.447;0.467;0.587;0.533;0.34;0.647;0.647;0.823;0.77;0.743;0.607;0.523;0.7;1.053;0.407;0.577;0.533;0.54;0.347;0.633;0.56;0.397;0.423;0.393;0.707;0.703;0.65;0.487;0.437;0.937;0.547;0.357;0.61;0.597;0.517;0.503;0.333;0.84; +// aYValuesOfSeries.size() +49 +// sYValuesOfSeries +0.38;0.547;0.35;0.46;0.607;0.44;0.68;0.47;0.43;0.363;0.46;0.533;0.44;0.2;0.627;0.307;0.27;0.5;0.66;0.403;0.413;0.61;0.58;0.973;0.903;0.57;0.563;0.617;0.463;0.537;0.497;0.42;0.253;0.49;0.43;0.577;1.07;0.583;0.427;0.297;0.397;0.503;0.717;0.507;0.513;0.743;0.693;0.44;0.737; +// aYValuesOfSeries.size() +49 +// sYValuesOfSeries +0.467;0.467;0.463;0.367;0.457;0.443;0.63;0.48;0.38;0.577;0.477;0.443;0.47;0.557;0.45;0.46;0.283;0.523;0.527;0.537;0.34;0.32;0.51;1.12;0.897;0.437;0.673;0.637;0.463;0.613;0.72;0.443;0.25;0.497;0.393;0.503;0.617;0.87;0.383;0.383;0.39;0.467;0.373;0.523;0.553;0.353;0.37;0.493;0.52; +// aYValuesOfSeries.size() +49 +// sYValuesOfSeries +1.533;1.413;1.55;1.273;1.45;1.423;1.54;1.433;1.417;1.513;1.563;1.503;1.54;1.737;1.563;1.36;1.443;2.007;2.21;1.51;1.443;1.41;1.637;2.15;1.777;1.58;1.587;1.713;1.477;1.533;1.55;1.443;1.197;1.48;1.497;1.513;1.607;1.573;1.54;1.283;1.257;1.43;1.223;1.377;1.38;1.573;2.843;1.427;1.523; +// aYValuesOfSeries.size() +49 +// sYValuesOfSeries +0.7;0.187;0.357;0.043;0.51;0.273;0.37;0.297;0.313;0.237;0.247;0.347;0.367;0.487;0.433;0.24;0.547;0.547;0.723;0.67;0.643;0.507;0.423;0.6;0.953;0.307;0.477;0.433;0.44;0.247;0.533;0.46;0.297;0.323;0.293;0.607;0.603;0.55;0.387;0.337;0.837;0.447;0.257;0.51;0.497;0.417;0.403;0.233;0.74; +// aYValuesOfSeries.size() +49 +// sYValuesOfSeries +0.19;0.2735;0.175;0.23;0.3035;0.22;0.34;0.235;0.215;0.1815;0.23;0.2665;0.22;0.1;0.3135;0.1535;0.135;0.25;0.33;0.2015;0.2065;0.305;0.29;0.4865;0.4515;0.285;0.2815;0.3085;0.2315;0.2685;0.2485;0.21;0.1265;0.245;0.215;0.2885;0.535;0.2915;0.2135;0.1485;0.1985;0.2515;0.3585;0.2535;0.2565;0.3715;0.3465;0.22;0.3685; +// aYValuesOfSeries.size() +49 +// sYValuesOfSeries +0.0667142857142857;0.0667142857142857;0.0661428571428571;0.0524285714285714;0.0652857142857143;0.0632857142857143;0.09;0.0685714285714286;0.0542857142857143;0.0824285714285714;0.0681428571428571;0.0632857142857143;0.0671428571428571;0.0795714285714286;0.0642857142857143;0.0657142857142857;0.0404285714285714;0.0747142857142857;0.0752857142857143;0.0767142857142857;0.0485714285714286;0.0457142857142857;0.0728571428571429;0.16;0.128142857142857;0.0624285714285714;0.0961428571428572;0.091;0.0661428571428571;0.0875714285714286;0.102857142857143;0.0632857142857143;0.0357142857142857;0.071;0.0561428571428572;0.0718571428571429;0.0881428571428572;0.124285714285714;0.0547142857142857;0.0547142857142857;0.0557142857142857;0.0667142857142857;0.0532857142857143;0.0747142857142857;0.079;0.0504285714285714;0.0528571428571429;0.0704285714285714;0.0742857142857143; +// aYValuesSourceRange +$Table.$E$3:$E$51 +// aYValuesSourceRange +$Table.$F$3:$F$51 +// aYValuesSourceRange +$Table.$G$3:$G$51 +// aYValuesSourceRange +$Table.$H$3:$H$51 +// aYValuesSourceRange +$Table.$I$3:$I$51 +// aYValuesSourceRange +$Table.$J$3:$J$51 +// aYValuesSourceRange +$Table.$K$3:$K$51 +// aYValuesSourceRange +$Table.$L$3:$L$51 diff --git a/chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt b/chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt new file mode 100644 index 0000000000..ec3bfa72e3 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt @@ -0,0 +1,50 @@ +// sChartTitle +Annual Revenue +// sChartType +com.sun.star.chart2.ColumnChartType +// sXAxisTitle +Quarter +// nXAxisNumberFormat +0 +// nXAxisNumberType +16 +// sYAxisTitle +Income (Ft) +// nYAxisNumberFormat +159 +// nYAxisNumberType +17 +// aColumnLabels.getLength() +4 +// sColumnLabels +1. quarter;2. quarter;3. quarter;4. quarter; +// aRowLabels.getLength() +4 +// sRowLabels +Inkjet;Leser;Multifunction;Picture; +// aDataSeriesYValues.size() +4 +// aYValuesOfSeries.size() +4 +// sYValuesOfSeries +4399120;8098380;4799040;6448710; +// aYValuesOfSeries.size() +4 +// sYValuesOfSeries +3149650;4499500;5399400;7919120; +// aYValuesOfSeries.size() +4 +// sYValuesOfSeries +1599800;4399450;3199600;7999000; +// aYValuesOfSeries.size() +4 +// sYValuesOfSeries +2504850;5009700;7514550;10019400; +// aYValuesSourceRange +$Mo_példa_06_a.$E$11:$H$11 +// aYValuesSourceRange +$Mo_példa_06_a.$E$12:$H$12 +// aYValuesSourceRange +$Mo_példa_06_a.$E$13:$H$13 +// aYValuesSourceRange +$Mo_példa_06_a.$E$14:$H$14 diff --git a/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_with_titles.txt b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_with_titles.txt new file mode 100644 index 0000000000..83e9596f26 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_with_titles.txt @@ -0,0 +1,10 @@ +// static_cast(aChartWallFillStyle) +2 +// static_cast(aChartWallFillColor) +15132390 +// sChartWallLineDash +0;1;200710;0;152 +// static_cast(aChartWallLineColor) +11010131 +// nChartWallLineWidth +100 diff --git a/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_without_titles.txt b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_without_titles.txt new file mode 100644 index 0000000000..83e9596f26 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_without_titles.txt @@ -0,0 +1,10 @@ +// static_cast(aChartWallFillStyle) +2 +// static_cast(aChartWallFillColor) +15132390 +// sChartWallLineDash +0;1;200710;0;152 +// static_cast(aChartWallLineColor) +11010131 +// nChartWallLineWidth +100 diff --git a/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_custom_positioning.txt b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_custom_positioning.txt new file mode 100644 index 0000000000..f689425eca --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_custom_positioning.txt @@ -0,0 +1,10 @@ +// static_cast(aChartWallFillStyle) +1 +// static_cast(aChartWallFillColor) +13773611 +// sChartWallLineDash +0;2;01;203;203 +// static_cast(aChartWallLineColor) +8388352 +// nChartWallLineWidth +110 diff --git a/chart2/qa/extras/chart2dump/reference/chartwalltest/formated_chartwall.txt b/chart2/qa/extras/chart2dump/reference/chartwalltest/formated_chartwall.txt new file mode 100644 index 0000000000..83e9596f26 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/chartwalltest/formated_chartwall.txt @@ -0,0 +1,10 @@ +// static_cast(aChartWallFillStyle) +2 +// static_cast(aChartWallFillColor) +15132390 +// sChartWallLineDash +0;1;200710;0;152 +// static_cast(aChartWallLineColor) +11010131 +// nChartWallLineWidth +100 diff --git a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt new file mode 100644 index 0000000000..f9ec3b65a2 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt @@ -0,0 +1,162 @@ +// nSeriesCount +4 +/// Series 0 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aColumnOrBarPosition.X +3698 +// aColumnOrBarPosition.Y +4414 +// aColumnOrBarSize.Height +2935 +// aColumnOrBarSize.Width +1170 +// aColumnOrBarTransformation +1170;0;3698;0;2935;4414;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aColumnOrBarPosition.X +8610 +// aColumnOrBarPosition.Y +1946 +// aColumnOrBarSize.Height +5403 +// aColumnOrBarSize.Width +1170 +// aColumnOrBarTransformation +1170;0;8610;0;5403;1946;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aColumnOrBarPosition.X +13522 +// aColumnOrBarPosition.Y +4147 +// aColumnOrBarSize.Height +3202 +// aColumnOrBarSize.Width +1169 +// aColumnOrBarTransformation +1169;0;13522;0;3202;4147;0;0;1 +/// Series 1 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aColumnOrBarPosition.X +4868 +// aColumnOrBarPosition.Y +5247 +// aColumnOrBarSize.Height +2102 +// aColumnOrBarSize.Width +1169 +// aColumnOrBarTransformation +1169;0;4868;0;2102;5247;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aColumnOrBarPosition.X +9780 +// aColumnOrBarPosition.Y +4347 +// aColumnOrBarSize.Height +3002 +// aColumnOrBarSize.Width +1169 +// aColumnOrBarTransformation +1169;0;9780;0;3002;4347;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aColumnOrBarPosition.X +14691 +// aColumnOrBarPosition.Y +3747 +// aColumnOrBarSize.Height +3602 +// aColumnOrBarSize.Width +1170 +// aColumnOrBarTransformation +1170;0;14691;0;3602;3747;0;0;1 +/// Series 2 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +3 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aColumnOrBarPosition.X +6037 +// aColumnOrBarPosition.Y +6281 +// aColumnOrBarSize.Height +1068 +// aColumnOrBarSize.Width +1170 +// aColumnOrBarTransformation +1170;0;6037;0;1068;6281;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aColumnOrBarPosition.X +10949 +// aColumnOrBarPosition.Y +4414 +// aColumnOrBarSize.Height +2935 +// aColumnOrBarSize.Width +1169 +// aColumnOrBarTransformation +1169;0;10949;0;2935;4414;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aColumnOrBarPosition.X +15861 +// aColumnOrBarPosition.Y +5214 +// aColumnOrBarSize.Height +2135 +// aColumnOrBarSize.Width +1169 +// aColumnOrBarTransformation +1169;0;15861;0;2135;5214;0;0;1 +/// Series 3 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +2 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aColumnOrBarPosition.X +7207 +// aColumnOrBarPosition.Y +5677 +// aColumnOrBarSize.Height +1672 +// aColumnOrBarSize.Width +1169 +// aColumnOrBarTransformation +1169;0;7207;0;1672;5677;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aColumnOrBarPosition.X +12118 +// aColumnOrBarPosition.Y +4006 +// aColumnOrBarSize.Height +3343 +// aColumnOrBarSize.Width +1170 +// aColumnOrBarTransformation +1170;0;12118;0;3343;4006;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aColumnOrBarPosition.X +17030 +// aColumnOrBarPosition.Y +2335 +// aColumnOrBarSize.Height +5014 +// aColumnOrBarSize.Width +1170 +// aColumnOrBarTransformation +1170;0;17030;0;5014;2335;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_bar_chart.txt b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_bar_chart.txt new file mode 100644 index 0000000000..47a0a9b0ac --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_bar_chart.txt @@ -0,0 +1,162 @@ +// nSeriesCount +4 +/// Series 0 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +6712 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +6482 +// aColumnOrBarTransformation +6482;0;3582;0;364;6712;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +4710 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +11932 +// aColumnOrBarTransformation +11932;0;3582;0;364;4710;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +2709 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +7071 +// aColumnOrBarTransformation +7071;0;3582;0;364;2709;0;0;1 +/// Series 1 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +6348 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +4641 +// aColumnOrBarTransformation +4641;0;3582;0;364;6348;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +4347 +// aColumnOrBarSize.Height +363 +// aColumnOrBarSize.Width +6630 +// aColumnOrBarTransformation +6630;0;3582;0;363;4347;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +2345 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +7956 +// aColumnOrBarTransformation +7956;0;3582;0;364;2345;0;0;1 +/// Series 2 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +5984 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +2357 +// aColumnOrBarTransformation +2357;0;3582;0;364;5984;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +3983 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +6482 +// aColumnOrBarTransformation +6482;0;3582;0;364;3983;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +1981 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +4714 +// aColumnOrBarTransformation +4714;0;3582;0;364;1981;0;0;1 +/// Series 3 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +5620 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +3690 +// aColumnOrBarTransformation +3690;0;3582;0;364;5620;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +3619 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +7381 +// aColumnOrBarTransformation +7381;0;3582;0;364;3619;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +1617 +// aColumnOrBarSize.Height +364 +// aColumnOrBarSize.Width +11072 +// aColumnOrBarTransformation +11072;0;3582;0;364;1617;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_column_chart.txt b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_column_chart.txt new file mode 100644 index 0000000000..d3a9646798 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_column_chart.txt @@ -0,0 +1,162 @@ +// nSeriesCount +4 +/// Series 0 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aColumnOrBarPosition.X +4359 +// aColumnOrBarPosition.Y +4414 +// aColumnOrBarSize.Height +2935 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;4359;0;2935;4414;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aColumnOrBarPosition.X +9396 +// aColumnOrBarPosition.Y +1946 +// aColumnOrBarSize.Height +5403 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;9396;0;5403;1946;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aColumnOrBarPosition.X +14433 +// aColumnOrBarPosition.Y +4147 +// aColumnOrBarSize.Height +3202 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;14433;0;3202;4147;0;0;1 +/// Series 1 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aColumnOrBarPosition.X +5275 +// aColumnOrBarPosition.Y +5247 +// aColumnOrBarSize.Height +2102 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;5275;0;2102;5247;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aColumnOrBarPosition.X +10312 +// aColumnOrBarPosition.Y +4347 +// aColumnOrBarSize.Height +3002 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;10312;0;3002;4347;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aColumnOrBarPosition.X +15349 +// aColumnOrBarPosition.Y +3747 +// aColumnOrBarSize.Height +3602 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;15349;0;3602;3747;0;0;1 +/// Series 2 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aColumnOrBarPosition.X +6191 +// aColumnOrBarPosition.Y +6281 +// aColumnOrBarSize.Height +1068 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;6191;0;1068;6281;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aColumnOrBarPosition.X +11228 +// aColumnOrBarPosition.Y +4414 +// aColumnOrBarSize.Height +2935 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;11228;0;2935;4414;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aColumnOrBarPosition.X +16265 +// aColumnOrBarPosition.Y +5214 +// aColumnOrBarSize.Height +2135 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;16265;0;2135;5214;0;0;1 +/// Series 3 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aColumnOrBarPosition.X +7107 +// aColumnOrBarPosition.Y +5677 +// aColumnOrBarSize.Height +1672 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;7107;0;1672;5677;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aColumnOrBarPosition.X +12144 +// aColumnOrBarPosition.Y +4006 +// aColumnOrBarSize.Height +3343 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;12144;0;3343;4006;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aColumnOrBarPosition.X +17181 +// aColumnOrBarPosition.Y +2335 +// aColumnOrBarSize.Height +5014 +// aColumnOrBarSize.Width +916 +// aColumnOrBarTransformation +916;0;17181;0;5014;2335;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_bar_chart.txt b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_bar_chart.txt new file mode 100644 index 0000000000..1d53a339e4 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_bar_chart.txt @@ -0,0 +1,162 @@ +// nSeriesCount +4 +/// Series 0 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +5681 +// aColumnOrBarSize.Height +1334 +// aColumnOrBarSize.Width +5562 +// aColumnOrBarTransformation +5562;0;3582;0;1334;5681;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +3679 +// aColumnOrBarSize.Height +1335 +// aColumnOrBarSize.Width +5422 +// aColumnOrBarTransformation +5422;0;3582;0;1335;3679;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +1678 +// aColumnOrBarSize.Height +1334 +// aColumnOrBarSize.Width +3381 +// aColumnOrBarTransformation +3381;0;3582;0;1334;1678;0;0;1 +/// Series 1 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aColumnOrBarPosition.X +9144 +// aColumnOrBarPosition.Y +5681 +// aColumnOrBarSize.Height +1334 +// aColumnOrBarSize.Width +3982 +// aColumnOrBarTransformation +3982;0;9144;0;1334;5681;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aColumnOrBarPosition.X +9004 +// aColumnOrBarPosition.Y +3679 +// aColumnOrBarSize.Height +1335 +// aColumnOrBarSize.Width +3013 +// aColumnOrBarTransformation +3013;0;9004;0;1335;3679;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aColumnOrBarPosition.X +6963 +// aColumnOrBarPosition.Y +1678 +// aColumnOrBarSize.Height +1334 +// aColumnOrBarSize.Width +3804 +// aColumnOrBarTransformation +3804;0;6963;0;1334;1678;0;0;1 +/// Series 2 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +255 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aColumnOrBarPosition.X +13126 +// aColumnOrBarPosition.Y +5681 +// aColumnOrBarSize.Height +1334 +// aColumnOrBarSize.Width +2023 +// aColumnOrBarTransformation +2023;0;13126;0;1334;5681;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aColumnOrBarPosition.X +12017 +// aColumnOrBarPosition.Y +3679 +// aColumnOrBarSize.Height +1335 +// aColumnOrBarSize.Width +2945 +// aColumnOrBarTransformation +2945;0;12017;0;1335;3679;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aColumnOrBarPosition.X +10767 +// aColumnOrBarPosition.Y +1678 +// aColumnOrBarSize.Height +1334 +// aColumnOrBarSize.Width +2255 +// aColumnOrBarTransformation +2255;0;10767;0;1334;1678;0;0;1 +/// Series 3 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aColumnOrBarPosition.X +15149 +// aColumnOrBarPosition.Y +5681 +// aColumnOrBarSize.Height +1334 +// aColumnOrBarSize.Width +3168 +// aColumnOrBarTransformation +3168;0;15149;0;1334;5681;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aColumnOrBarPosition.X +14962 +// aColumnOrBarPosition.Y +3679 +// aColumnOrBarSize.Height +1335 +// aColumnOrBarSize.Width +3355 +// aColumnOrBarTransformation +3355;0;14962;0;1335;3679;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aColumnOrBarPosition.X +13022 +// aColumnOrBarPosition.Y +1678 +// aColumnOrBarSize.Height +1334 +// aColumnOrBarSize.Width +5295 +// aColumnOrBarTransformation +5295;0;13022;0;1334;1678;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_column_chart.txt b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_column_chart.txt new file mode 100644 index 0000000000..75ee404178 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_column_chart.txt @@ -0,0 +1,162 @@ +// nSeriesCount +4 +/// Series 0 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aColumnOrBarPosition.X +5055 +// aColumnOrBarPosition.Y +5082 +// aColumnOrBarSize.Height +2267 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;5055;0;2267;5082;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aColumnOrBarPosition.X +9967 +// aColumnOrBarPosition.Y +5139 +// aColumnOrBarSize.Height +2210 +// aColumnOrBarSize.Width +1964 +// aColumnOrBarTransformation +1964;0;9967;0;2210;5139;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aColumnOrBarPosition.X +14878 +// aColumnOrBarPosition.Y +5971 +// aColumnOrBarSize.Height +1378 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;14878;0;1378;5971;0;0;1 +/// Series 1 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aColumnOrBarPosition.X +5055 +// aColumnOrBarPosition.Y +3459 +// aColumnOrBarSize.Height +1623 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;5055;0;1623;3459;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aColumnOrBarPosition.X +9967 +// aColumnOrBarPosition.Y +3912 +// aColumnOrBarSize.Height +1227 +// aColumnOrBarSize.Width +1964 +// aColumnOrBarTransformation +1964;0;9967;0;1227;3912;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aColumnOrBarPosition.X +14878 +// aColumnOrBarPosition.Y +4421 +// aColumnOrBarSize.Height +1550 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;14878;0;1550;4421;0;0;1 +/// Series 2 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +3 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aColumnOrBarPosition.X +5055 +// aColumnOrBarPosition.Y +2635 +// aColumnOrBarSize.Height +824 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;5055;0;824;2635;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aColumnOrBarPosition.X +9967 +// aColumnOrBarPosition.Y +2711 +// aColumnOrBarSize.Height +1201 +// aColumnOrBarSize.Width +1964 +// aColumnOrBarTransformation +1964;0;9967;0;1201;2711;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aColumnOrBarPosition.X +14878 +// aColumnOrBarPosition.Y +3502 +// aColumnOrBarSize.Height +919 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;14878;0;919;3502;0;0;1 +/// Series 3 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +2 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aColumnOrBarPosition.X +5055 +// aColumnOrBarPosition.Y +1345 +// aColumnOrBarSize.Height +1290 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;5055;0;1290;1345;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aColumnOrBarPosition.X +9967 +// aColumnOrBarPosition.Y +1345 +// aColumnOrBarSize.Height +1366 +// aColumnOrBarSize.Width +1964 +// aColumnOrBarTransformation +1964;0;9967;0;1366;1345;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aColumnOrBarPosition.X +14878 +// aColumnOrBarPosition.Y +1345 +// aColumnOrBarSize.Height +2157 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;14878;0;2157;1345;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_bar_chart.txt b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_bar_chart.txt new file mode 100644 index 0000000000..f9bf6a20b1 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_bar_chart.txt @@ -0,0 +1,162 @@ +// nSeriesCount +4 +/// Series 0 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +5948 +// aColumnOrBarSize.Height +800 +// aColumnOrBarSize.Width +2592 +// aColumnOrBarTransformation +2592;0;3582;0;800;5948;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +3946 +// aColumnOrBarSize.Height +801 +// aColumnOrBarSize.Width +4773 +// aColumnOrBarTransformation +4773;0;3582;0;801;3946;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aColumnOrBarPosition.X +3582 +// aColumnOrBarPosition.Y +1945 +// aColumnOrBarSize.Height +800 +// aColumnOrBarSize.Width +2828 +// aColumnOrBarTransformation +2828;0;3582;0;800;1945;0;0;1 +/// Series 1 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aColumnOrBarPosition.X +6174 +// aColumnOrBarPosition.Y +5948 +// aColumnOrBarSize.Height +800 +// aColumnOrBarSize.Width +1857 +// aColumnOrBarTransformation +1857;0;6174;0;800;5948;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aColumnOrBarPosition.X +8355 +// aColumnOrBarPosition.Y +3946 +// aColumnOrBarSize.Height +801 +// aColumnOrBarSize.Width +2652 +// aColumnOrBarTransformation +2652;0;8355;0;801;3946;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aColumnOrBarPosition.X +6410 +// aColumnOrBarPosition.Y +1945 +// aColumnOrBarSize.Height +800 +// aColumnOrBarSize.Width +3182 +// aColumnOrBarTransformation +3182;0;6410;0;800;1945;0;0;1 +/// Series 2 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +255 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aColumnOrBarPosition.X +8031 +// aColumnOrBarPosition.Y +5948 +// aColumnOrBarSize.Height +800 +// aColumnOrBarSize.Width +943 +// aColumnOrBarTransformation +943;0;8031;0;800;5948;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aColumnOrBarPosition.X +11007 +// aColumnOrBarPosition.Y +3946 +// aColumnOrBarSize.Height +801 +// aColumnOrBarSize.Width +2593 +// aColumnOrBarTransformation +2593;0;11007;0;801;3946;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aColumnOrBarPosition.X +9592 +// aColumnOrBarPosition.Y +1945 +// aColumnOrBarSize.Height +800 +// aColumnOrBarSize.Width +1886 +// aColumnOrBarTransformation +1886;0;9592;0;800;1945;0;0;1 +/// Series 3 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aColumnOrBarPosition.X +8974 +// aColumnOrBarPosition.Y +5948 +// aColumnOrBarSize.Height +800 +// aColumnOrBarSize.Width +1476 +// aColumnOrBarTransformation +1476;0;8974;0;800;5948;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aColumnOrBarPosition.X +13600 +// aColumnOrBarPosition.Y +3946 +// aColumnOrBarSize.Height +801 +// aColumnOrBarSize.Width +2952 +// aColumnOrBarTransformation +2952;0;13600;0;801;3946;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aColumnOrBarPosition.X +11478 +// aColumnOrBarPosition.Y +1945 +// aColumnOrBarSize.Height +800 +// aColumnOrBarSize.Width +4429 +// aColumnOrBarTransformation +4429;0;11478;0;800;1945;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_column_chart.txt b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_column_chart.txt new file mode 100644 index 0000000000..dd34a49584 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_column_chart.txt @@ -0,0 +1,162 @@ +// nSeriesCount +4 +/// Series 0 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +1 +// static_cast(aSeriesColumnOrBarFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aColumnOrBarPosition.X +5055 +// aColumnOrBarPosition.Y +6292 +// aColumnOrBarSize.Height +1057 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;5055;0;1057;6292;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aColumnOrBarPosition.X +9967 +// aColumnOrBarPosition.Y +5404 +// aColumnOrBarSize.Height +1945 +// aColumnOrBarSize.Width +1964 +// aColumnOrBarTransformation +1964;0;9967;0;1945;5404;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aColumnOrBarPosition.X +14878 +// aColumnOrBarPosition.Y +6196 +// aColumnOrBarSize.Height +1153 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;14878;0;1153;6196;0;0;1 +/// Series 1 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aColumnOrBarPosition.X +5055 +// aColumnOrBarPosition.Y +5536 +// aColumnOrBarSize.Height +756 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;5055;0;756;5536;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aColumnOrBarPosition.X +9967 +// aColumnOrBarPosition.Y +4323 +// aColumnOrBarSize.Height +1081 +// aColumnOrBarSize.Width +1964 +// aColumnOrBarTransformation +1964;0;9967;0;1081;4323;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aColumnOrBarPosition.X +14878 +// aColumnOrBarPosition.Y +4899 +// aColumnOrBarSize.Height +1297 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;14878;0;1297;4899;0;0;1 +/// Series 2 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +4 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aColumnOrBarPosition.X +5055 +// aColumnOrBarPosition.Y +5151 +// aColumnOrBarSize.Height +385 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;5055;0;385;5151;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aColumnOrBarPosition.X +9967 +// aColumnOrBarPosition.Y +3266 +// aColumnOrBarSize.Height +1057 +// aColumnOrBarSize.Width +1964 +// aColumnOrBarTransformation +1964;0;9967;0;1057;3266;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aColumnOrBarPosition.X +14878 +// aColumnOrBarPosition.Y +4131 +// aColumnOrBarSize.Height +768 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;14878;0;768;4131;0;0;1 +/// Series 3 ColumnsOrBars +// nColumnOrBarCountInSeries +3 +// static_cast(aSeriesColumnOrBarFillStyle) +2 +// static_cast(aSeriesColumnOrBarFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aColumnOrBarPosition.X +5055 +// aColumnOrBarPosition.Y +4550 +// aColumnOrBarSize.Height +601 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;5055;0;601;4550;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aColumnOrBarPosition.X +9967 +// aColumnOrBarPosition.Y +2063 +// aColumnOrBarSize.Height +1203 +// aColumnOrBarSize.Width +1964 +// aColumnOrBarTransformation +1964;0;9967;0;1203;2063;0;0;1 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aColumnOrBarPosition.X +14878 +// aColumnOrBarPosition.Y +2326 +// aColumnOrBarSize.Height +1805 +// aColumnOrBarSize.Width +1965 +// aColumnOrBarTransformation +1965;0;14878;0;1805;2326;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/gridtest/formated_grid_line.txt b/chart2/qa/extras/chart2dump/reference/gridtest/formated_grid_line.txt new file mode 100644 index 0000000000..b3d3c09875 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/gridtest/formated_grid_line.txt @@ -0,0 +1,17 @@ +/// CID/D=0:CS=0:Axis=0,0:Grid=0 +// aGridPosition.X +3763 +// aGridPosition.Y +1344 +// aGridSize.Height +6005 +// aGridSize.Width +15480 +// aGridTransformation +15481;0;3763;0;6006;1344;0;0;1 +// sGridLineDash +2;1;1970;0;127 +// static_cast(aLineColor) +65280 +// nLineWidth +100 diff --git a/chart2/qa/extras/chart2dump/reference/gridtest/horizontal_grid.txt b/chart2/qa/extras/chart2dump/reference/gridtest/horizontal_grid.txt new file mode 100644 index 0000000000..428a206de5 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/gridtest/horizontal_grid.txt @@ -0,0 +1,17 @@ +/// CID/D=0:CS=0:Axis=1,0:Grid=0 +// aGridPosition.X +3644 +// aGridPosition.Y +1344 +// aGridSize.Height +6005 +// aGridSize.Width +14988 +// aGridTransformation +14989;0;3644;0;6006;1344;0;0;1 +// sGridLineDash +0;1;201;20;20 +// static_cast(aLineColor) +0 +// nLineWidth +0 diff --git a/chart2/qa/extras/chart2dump/reference/gridtest/minor_grid.txt b/chart2/qa/extras/chart2dump/reference/gridtest/minor_grid.txt new file mode 100644 index 0000000000..35f3d560e4 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/gridtest/minor_grid.txt @@ -0,0 +1,68 @@ +/// CID/D=0:CS=0:Axis=1,0:Grid=0 +// aGridPosition.X +3529 +// aGridPosition.Y +1344 +// aGridSize.Height +6005 +// aGridSize.Width +14515 +// aGridTransformation +14516;0;3529;0;6006;1344;0;0;1 +// sGridLineDash +0;1;201;20;20 +// static_cast(aLineColor) +0 +// nLineWidth +0 +/// CID/D=0:CS=0:Axis=0,0:Grid=0 +// aGridPosition.X +3529 +// aGridPosition.Y +1344 +// aGridSize.Height +6005 +// aGridSize.Width +14515 +// aGridTransformation +14516;0;3529;0;6006;1344;0;0;1 +// sGridLineDash +0;1;201;20;20 +// static_cast(aLineColor) +11776947 +// nLineWidth +0 +/// CID/D=0:CS=0:Axis=1,0:Grid=0:SubGrid=0 +// aGridPosition.X +3529 +// aGridPosition.Y +1773 +// aGridSize.Height +5147 +// aGridSize.Width +14515 +// aGridTransformation +14516;0;3529;0;5148;1773;0;0;1 +// sGridLineDash +0;1;201;20;20 +// static_cast(aLineColor) +14540253 +// nLineWidth +0 +/// CID/D=0:CS=0:Axis=0,0:Grid=0:SubGrid=0 +// aGridPosition.X +5343 +// aGridPosition.Y +1344 +// aGridSize.Height +6005 +// aGridSize.Width +10886 +// aGridTransformation +10887;0;5343;0;6006;1344;0;0;1 +// sGridLineDash +0;1;201;20;20 +// static_cast(aLineColor) +14540253 +// nLineWidth +0 diff --git a/chart2/qa/extras/chart2dump/reference/gridtest/vertical_grid.txt b/chart2/qa/extras/chart2dump/reference/gridtest/vertical_grid.txt new file mode 100644 index 0000000000..a0c341dc63 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/gridtest/vertical_grid.txt @@ -0,0 +1,17 @@ +/// CID/D=0:CS=0:Axis=0,0:Grid=0 +// aGridPosition.X +3620 +// aGridPosition.Y +1343 +// aGridSize.Height +6120 +// aGridSize.Width +15109 +// aGridTransformation +15110;0;3620;0;6121;1343;0;0;1 +// sGridLineDash +0;1;201;20;20 +// static_cast(aLineColor) +11776947 +// nLineWidth +0 diff --git a/chart2/qa/extras/chart2dump/reference/legendtest/custom_legend_position.txt b/chart2/qa/extras/chart2dump/reference/legendtest/custom_legend_position.txt new file mode 100644 index 0000000000..ad31f8c863 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/legendtest/custom_legend_position.txt @@ -0,0 +1,50 @@ +// nLegendEntryCount +4 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +43091 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +8388352 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16765728 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16711807 +// xLegendEntryText->getString() +A +// xLegendEntryText->getString() +B +// xLegendEntryText->getString() +C +// xLegendEntryText->getString() +DD diff --git a/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_bottom.txt b/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_bottom.txt new file mode 100644 index 0000000000..5d2a2c0111 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_bottom.txt @@ -0,0 +1,50 @@ +// nLegendEntryCount +4 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +43091 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +8388352 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16765728 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16711807 +// xLegendEntryText->getString() +AA +// xLegendEntryText->getString() +BB +// xLegendEntryText->getString() +CC +// xLegendEntryText->getString() +DD diff --git a/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_left_side.txt b/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_left_side.txt new file mode 100644 index 0000000000..7f55f89183 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_left_side.txt @@ -0,0 +1,50 @@ +// nLegendEntryCount +4 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +17798 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +8388352 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16765728 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +32767 +// xLegendEntryText->getString() +AA +// xLegendEntryText->getString() +BB +// xLegendEntryText->getString() +CC +// xLegendEntryText->getString() +DD diff --git a/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_right_side.txt b/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_right_side.txt new file mode 100644 index 0000000000..78c83ef625 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_right_side.txt @@ -0,0 +1,18 @@ +// nLegendEntryCount +2 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.RectangleShape +// static_cast(aEntryGeomColor) +17798 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.RectangleShape +// static_cast(aEntryGeomColor) +16728590 +// xLegendEntryText->getString() +A +// xLegendEntryText->getString() +C-B diff --git a/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_top.txt b/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_top.txt new file mode 100644 index 0000000000..5d2a2c0111 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/legendtest/legend_on_top.txt @@ -0,0 +1,50 @@ +// nLegendEntryCount +4 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +43091 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +8388352 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16765728 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16711807 +// xLegendEntryText->getString() +AA +// xLegendEntryText->getString() +BB +// xLegendEntryText->getString() +CC +// xLegendEntryText->getString() +DD diff --git a/chart2/qa/extras/chart2dump/reference/legendtest/many_legend_entries.txt b/chart2/qa/extras/chart2dump/reference/legendtest/many_legend_entries.txt new file mode 100644 index 0000000000..a3ef82203b --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/legendtest/many_legend_entries.txt @@ -0,0 +1,182 @@ +// nLegendEntryCount +15 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +43091 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +8388352 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16765728 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16711807 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +8257569 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +8637183 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +3227652 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +11456256 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +4923247 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16749838 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +12910603 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +34001 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +17798 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16728590 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +16765728 +// xLegendEntryText->getString() +AA +// xLegendEntryText->getString() +BB +// xLegendEntryText->getString() +CC +// xLegendEntryText->getString() +DD +// xLegendEntryText->getString() +EE +// xLegendEntryText->getString() +FF +// xLegendEntryText->getString() +GG +// xLegendEntryText->getString() +HH +// xLegendEntryText->getString() +II +// xLegendEntryText->getString() +JJ +// xLegendEntryText->getString() +KK +// xLegendEntryText->getString() +LL +// xLegendEntryText->getString() +MM +// xLegendEntryText->getString() +NN +// xLegendEntryText->getString() +OO diff --git a/chart2/qa/extras/chart2dump/reference/legendtest/minimal_legend_test.txt b/chart2/qa/extras/chart2dump/reference/legendtest/minimal_legend_test.txt new file mode 100644 index 0000000000..63a2980cfa --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/legendtest/minimal_legend_test.txt @@ -0,0 +1,14 @@ +// nLegendEntryCount +1 +// xLegendEntryContainer->getCount() +3 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// sEntryGeomShapeType +com.sun.star.drawing.PolyPolygonShape +// static_cast(aEntryGeomColor) +17798 +// xLegendEntryText->getString() +Inkjet diff --git a/chart2/qa/extras/chart2dump/reference/legendtest/multiple_categories.txt b/chart2/qa/extras/chart2dump/reference/legendtest/multiple_categories.txt new file mode 100644 index 0000000000..9c207c9817 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/legendtest/multiple_categories.txt @@ -0,0 +1,66 @@ +// nLegendEntryCount +8 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// xLegendEntryContainer->getCount() +2 +// sEntryGeomShapeType +com.sun.star.drawing.LineShape +// static_cast(aEntryGeomColor) +7512015 +// xLegendEntryText->getString() +A In0 +// xLegendEntryText->getString() +A In100 +// xLegendEntryText->getString() +A In200 +// xLegendEntryText->getString() +A In400 +// xLegendEntryText->getString() +B In0 +// xLegendEntryText->getString() +B In100 +// xLegendEntryText->getString() +B In200 +// xLegendEntryText->getString() +B In400 diff --git a/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt b/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt new file mode 100644 index 0000000000..c1af41103d --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt @@ -0,0 +1,194 @@ +// nSeriesCount +4 +/// Series 0 slices +// nSlicesCountInSeries +3 +/// /D=0:CS=0:CT=0:Series=0:Point=0 +// aSlicePosition.X +6089 +// aSlicePosition.Y +2527 +// aSliceSize.Height +2118 +// aSliceSize.Width +4554 +// aSliceTransformation +4554;0;6089;0;2118;2527;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=0:Point=1 +// aSlicePosition.X +4353 +// aSlicePosition.Y +2931 +// aSliceSize.Height +6249 +// aSliceSize.Width +4305 +// aSliceTransformation +4305;0;4353;0;6249;2931;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=0:Point=2 +// aSlicePosition.X +9033 +// aSlicePosition.Y +4635 +// aSliceSize.Height +4659 +// aSliceSize.Width +2458 +// aSliceTransformation +2458;0;9033;0;4659;4635;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 +/// Series 1 slices +// nSlicesCountInSeries +3 +/// /D=0:CS=0:CT=0:Series=1:Point=0 +// aSlicePosition.X +6601 +// aSlicePosition.Y +3192 +// aSliceSize.Height +1755 +// aSliceSize.Width +3449 +// aSliceTransformation +3449;0;6601;0;1755;3192;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=1:Point=1 +// aSlicePosition.X +5018 +// aSlicePosition.Y +3420 +// aSliceSize.Height +4691 +// aSliceSize.Width +1852 +// aSliceTransformation +1852;0;5018;0;4691;3420;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=1:Point=2 +// aSlicePosition.X +6270 +// aSlicePosition.Y +4645 +// aSliceSize.Height +3869 +// aSliceSize.Width +4070 +// aSliceTransformation +4070;0;6270;0;3869;4645;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 +/// Series 2 slices +// nSlicesCountInSeries +3 +/// /D=0:CS=0:CT=0:Series=2:Point=0 +// aSlicePosition.X +7688 +// aSlicePosition.Y +3857 +// aSliceSize.Height +1392 +// aSliceSize.Width +1769 +// aSliceTransformation +1769;0;7688;0;1392;3857;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=2:Point=1 +// aSlicePosition.X +5683 +// aSlicePosition.Y +3857 +// aSliceSize.Height +3971 +// aSliceSize.Width +2010 +// aSliceTransformation +2010;0;5683;0;3971;3857;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=2:Point=2 +// aSlicePosition.X +7394 +// aSlicePosition.Y +4947 +// aSliceSize.Height +2902 +// aSliceSize.Width +2281 +// aSliceTransformation +2281;0;7394;0;2902;4947;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 +/// Series 3 slices +// nSlicesCountInSeries +3 +/// /D=0:CS=0:CT=0:Series=3:Point=0 +// aSlicePosition.X +7714 +// aSlicePosition.Y +4524 +// aSliceSize.Height +1027 +// aSliceSize.Width +1151 +// aSliceTransformation +1151;0;7714;0;1027;4524;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=3:Point=1 +// aSlicePosition.X +6348 +// aSlicePosition.Y +4522 +// aSliceSize.Height +1935 +// aSliceSize.Width +1401 +// aSliceTransformation +1401;0;6348;0;1935;4522;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=3:Point=2 +// aSlicePosition.X +6493 +// aSlicePosition.Y +5249 +// aSliceSize.Height +1935 +// aSliceSize.Width +2517 +// aSliceTransformation +2517;0;6493;0;1935;5249;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 diff --git a/chart2/qa/extras/chart2dump/reference/piecharttest/exploded_pie_chart.txt b/chart2/qa/extras/chart2dump/reference/piecharttest/exploded_pie_chart.txt new file mode 100644 index 0000000000..9cbc93de42 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/piecharttest/exploded_pie_chart.txt @@ -0,0 +1,50 @@ +// nSeriesCount +4 +/// Series 0 slices +// nSlicesCountInSeries +3 +/// /D=0:CS=0:CT=0:Series=0:Point=0 +// aSlicePosition.X +6018 +// aSlicePosition.Y +2178 +// aSliceSize.Height +2218 +// aSliceSize.Width +3177 +// aSliceTransformation +3177;0;6018;0;2218;2178;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=0:Point=1 +// aSlicePosition.X +5246 +// aSlicePosition.Y +3867 +// aSliceSize.Height +3714 +// aSliceSize.Width +3525 +// aSliceTransformation +3525;0;5246;0;3714;3867;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=0:Point=2 +// aSlicePosition.X +7679 +// aSlicePosition.Y +3576 +// aSliceSize.Height +3387 +// aSliceSize.Width +2217 +// aSliceTransformation +2217;0;7679;0;3387;3576;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 diff --git a/chart2/qa/extras/chart2dump/reference/piecharttest/normal_pie_chart.txt b/chart2/qa/extras/chart2dump/reference/piecharttest/normal_pie_chart.txt new file mode 100644 index 0000000000..1b97446cc2 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/piecharttest/normal_pie_chart.txt @@ -0,0 +1,50 @@ +// nSeriesCount +4 +/// Series 0 slices +// nSlicesCountInSeries +3 +/// /D=0:CS=0:CT=0:Series=0:Point=0 +// aSlicePosition.X +4353 +// aSlicePosition.Y +1846 +// aSliceSize.Height +3416 +// aSliceSize.Width +3326 +// aSliceTransformation +3326;0;4353;0;3416;1846;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=0:Point=1 +// aSlicePosition.X +4354 +// aSlicePosition.Y +5172 +// aSliceSize.Height +3326 +// aSliceSize.Width +6601 +// aSliceTransformation +6601;0;4354;0;3326;5172;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=0:Point=2 +// aSlicePosition.X +7679 +// aSlicePosition.Y +1846 +// aSliceSize.Height +3896 +// aSliceSize.Width +3326 +// aSliceTransformation +3326;0;7679;0;3896;1846;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 diff --git a/chart2/qa/extras/chart2dump/reference/piecharttest/pie_chart_many_slices.txt b/chart2/qa/extras/chart2dump/reference/piecharttest/pie_chart_many_slices.txt new file mode 100644 index 0000000000..820a344443 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/piecharttest/pie_chart_many_slices.txt @@ -0,0 +1,275 @@ +// nSeriesCount +1 +/// Series 0 slices +// nSlicesCountInSeries +18 +/// /D=0:CS=0:CT=0:Series=0:Point=0 +// aSlicePosition.X +10469 +// aSlicePosition.Y +3869 +// aSliceSize.Height +4104 +// aSliceSize.Width +49 +// aSliceTransformation +49;0;10469;0;4104;3869;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=0:Point=1 +// aSlicePosition.X +10275 +// aSlicePosition.Y +505 +// aSliceSize.Height +4103 +// aSliceSize.Width +158 +// aSliceTransformation +158;0;10275;0;4103;505;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=0:Point=2 +// aSlicePosition.X +10224 +// aSlicePosition.Y +3872 +// aSliceSize.Height +4101 +// aSliceSize.Width +294 +// aSliceTransformation +294;0;10224;0;4101;3872;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 +/// /D=0:CS=0:CT=0:Series=0:Point=3 +// aSlicePosition.X +10050 +// aSlicePosition.Y +3879 +// aSliceSize.Height +4094 +// aSliceSize.Width +468 +// aSliceTransformation +468;0;10050;0;4094;3879;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +5741852 +/// /D=0:CS=0:CT=0:Series=0:Point=4 +// aSlicePosition.X +9734 +// aSlicePosition.Y +3895 +// aSliceSize.Height +4078 +// aSliceSize.Width +784 +// aSliceTransformation +784;0;9734;0;4078;3895;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +8257569 +/// /D=0:CS=0:CT=0:Series=0:Point=5 +// aSlicePosition.X +9478 +// aSlicePosition.Y +3944 +// aSliceSize.Height +4029 +// aSliceSize.Width +1040 +// aSliceTransformation +1040;0;9478;0;4029;3944;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +8637183 +/// /D=0:CS=0:CT=0:Series=0:Point=6 +// aSlicePosition.X +9184 +// aSlicePosition.Y +4002 +// aSliceSize.Height +3971 +// aSliceSize.Width +1334 +// aSliceTransformation +1334;0;9184;0;3971;4002;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +3227652 +/// /D=0:CS=0:CT=0:Series=0:Point=7 +// aSlicePosition.X +8858 +// aSlicePosition.Y +4091 +// aSliceSize.Height +3882 +// aSliceSize.Width +1660 +// aSliceTransformation +1660;0;8858;0;3882;4091;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +11456256 +/// /D=0:CS=0:CT=0:Series=0:Point=8 +// aSlicePosition.X +8506 +// aSlicePosition.Y +4219 +// aSliceSize.Height +3754 +// aSliceSize.Width +2012 +// aSliceTransformation +2012;0;8506;0;3754;4219;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +4923247 +/// /D=0:CS=0:CT=0:Series=0:Point=9 +// aSlicePosition.X +8030 +// aSlicePosition.Y +4395 +// aSliceSize.Height +3578 +// aSliceSize.Width +2488 +// aSliceTransformation +2488;0;8030;0;3578;4395;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16749838 +/// /D=0:CS=0:CT=0:Series=0:Point=10 +// aSlicePosition.X +7311 +// aSlicePosition.Y +4708 +// aSliceSize.Height +3265 +// aSliceSize.Width +3207 +// aSliceTransformation +3207;0;7311;0;3265;4708;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +12910603 +/// /D=0:CS=0:CT=0:Series=0:Point=11 +// aSlicePosition.X +6490 +// aSlicePosition.Y +5411 +// aSliceSize.Height +2562 +// aSliceSize.Width +4028 +// aSliceTransformation +4028;0;6490;0;2562;5411;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +34001 +/// /D=0:CS=0:CT=0:Series=0:Point=12 +// aSlicePosition.X +6414 +// aSlicePosition.Y +7182 +// aSliceSize.Height +2834 +// aSliceSize.Width +4104 +// aSliceTransformation +4104;0;6414;0;2834;7182;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=0:Point=13 +// aSlicePosition.X +6959 +// aSlicePosition.Y +7973 +// aSliceSize.Height +3991 +// aSliceSize.Width +3559 +// aSliceTransformation +3559;0;6959;0;3991;7973;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=0:Point=14 +// aSlicePosition.X +9562 +// aSlicePosition.Y +7973 +// aSliceSize.Height +4104 +// aSliceSize.Width +3990 +// aSliceTransformation +3990;0;9562;0;4104;7973;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 +/// /D=0:CS=0:CT=0:Series=0:Point=15 +// aSlicePosition.X +10518 +// aSlicePosition.Y +6606 +// aSliceSize.Height +4129 +// aSliceSize.Width +4104 +// aSliceTransformation +4104;0;10518;0;4129;6606;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +5741852 +/// /D=0:CS=0:CT=0:Series=0:Point=16 +// aSlicePosition.X +10518 +// aSlicePosition.Y +3909 +// aSliceSize.Height +4064 +// aSliceSize.Width +3869 +// aSliceTransformation +3869;0;10518;0;4064;3909;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +8257569 +/// /D=0:CS=0:CT=0:Series=0:Point=17 +// aSlicePosition.X +10658 +// aSlicePosition.Y +1862 +// aSliceSize.Height +4104 +// aSliceSize.Width +573 +// aSliceTransformation +573;0;10658;0;4104;1862;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +8637183 diff --git a/chart2/qa/extras/chart2dump/reference/piecharttest/rotated_pie_chart.txt b/chart2/qa/extras/chart2dump/reference/piecharttest/rotated_pie_chart.txt new file mode 100644 index 0000000000..e1a3708593 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/piecharttest/rotated_pie_chart.txt @@ -0,0 +1,50 @@ +// nSeriesCount +4 +/// Series 0 slices +// nSlicesCountInSeries +3 +/// /D=0:CS=0:CT=0:Series=0:Point=0 +// aSlicePosition.X +7679 +// aSlicePosition.Y +2779 +// aSliceSize.Height +4767 +// aSliceSize.Width +3326 +// aSliceTransformation +3326;0;7679;0;4767;2779;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +17798 +/// /D=0:CS=0:CT=0:Series=0:Point=1 +// aSlicePosition.X +4353 +// aSlicePosition.Y +3306 +// aSliceSize.Height +5192 +// aSliceSize.Width +5654 +// aSliceTransformation +5654;0;4353;0;5192;3306;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16728590 +/// /D=0:CS=0:CT=0:Series=0:Point=2 +// aSlicePosition.X +4925 +// aSlicePosition.Y +1846 +// aSliceSize.Height +3326 +// aSliceSize.Width +5064 +// aSliceTransformation +5064;0;4925;0;3326;1846;0;0;1 +// static_cast(aSliceFillStyle) +1 +// static_cast(aSliceFillColor) +16765728 diff --git a/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt b/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt new file mode 100644 index 0000000000..3d7d8a55c6 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt @@ -0,0 +1,2 @@ +// static_cast( aButtonFillColor ) +16185078 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_lines_and_points.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_lines_and_points.txt new file mode 100644 index 0000000000..007a25ed48 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_lines_and_points.txt @@ -0,0 +1,250 @@ +// nSeriesCount +4 +/// Series 0 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +10215 +// aLinePosition.Y +3360 +// aLineSize.Height +4263 +// aLineSize.Width +15800 +// aLineTransformation +15800;0;10215;0;4263;3360;0;0;1 +/// Points are displayed +// nPointCountInSeries +3 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aPointPosition.X +10090 +// aPointPosition.Y +7498 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;10090;0;250;7498;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aPointPosition.X +17990 +// aPointPosition.Y +3235 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;17990;0;250;3235;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aPointPosition.X +25890 +// aPointPosition.Y +7037 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;25890;0;250;7037;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16711807 +/// Series 1 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +10215 +// aLinePosition.Y +6470 +// aLineSize.Height +2592 +// aLineSize.Width +15800 +// aLineTransformation +15800;0;10215;0;2592;6470;0;0;1 +/// Points are displayed +// nPointCountInSeries +3 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aPointPosition.X +10090 +// aPointPosition.Y +8937 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;10090;0;250;8937;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aPointPosition.X +17990 +// aPointPosition.Y +7382 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;17990;0;250;7382;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aPointPosition.X +25890 +// aPointPosition.Y +6345 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;25890;0;250;6345;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// Series 2 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +10215 +// aLinePosition.Y +7622 +// aLineSize.Height +3226 +// aLineSize.Width +15800 +// aLineTransformation +15800;0;10215;0;3226;7622;0;0;1 +/// Points are displayed +// nPointCountInSeries +3 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aPointPosition.X +10090 +// aPointPosition.Y +10723 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;10090;0;250;10723;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aPointPosition.X +17990 +// aPointPosition.Y +7497 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;17990;0;250;7497;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aPointPosition.X +25890 +// aPointPosition.Y +8880 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;25890;0;250;8880;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// Series 3 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +10215 +// aLinePosition.Y +4033 +// aLineSize.Height +5772 +// aLineSize.Width +15800 +// aLineTransformation +15800;0;10215;0;5772;4033;0;0;1 +/// Points are displayed +// nPointCountInSeries +3 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aPointPosition.X +10090 +// aPointPosition.Y +9680 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;10090;0;250;9680;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16776960 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aPointPosition.X +17990 +// aPointPosition.Y +6794 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;17990;0;250;6794;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16776960 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aPointPosition.X +25890 +// aPointPosition.Y +3908 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;25890;0;250;3908;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16776960 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_lines_only.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_lines_only.txt new file mode 100644 index 0000000000..c92fbb1bfa --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_lines_only.txt @@ -0,0 +1,58 @@ +// nSeriesCount +4 +/// Series 0 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +10215 +// aLinePosition.Y +3360 +// aLineSize.Height +4263 +// aLineSize.Width +15800 +// aLineTransformation +15800;0;10215;0;4263;3360;0;0;1 +/// Series 1 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +10215 +// aLinePosition.Y +6470 +// aLineSize.Height +2592 +// aLineSize.Width +15800 +// aLineTransformation +15800;0;10215;0;2592;6470;0;0;1 +/// Series 2 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +10215 +// aLinePosition.Y +7622 +// aLineSize.Height +3226 +// aLineSize.Width +15800 +// aLineTransformation +15800;0;10215;0;3226;7622;0;0;1 +/// Series 3 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +2 +// aLinePosition.X +10215 +// aLinePosition.Y +4033 +// aLineSize.Height +5772 +// aLineSize.Width +15800 +// aLineTransformation +15800;0;10215;0;5772;4033;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_points_only.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_points_only.txt new file mode 100644 index 0000000000..61c521ff3a --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/normal_line_chart_points_only.txt @@ -0,0 +1,198 @@ +// nSeriesCount +4 +/// Series 0 +/// Points are displayed +// nPointCountInSeries +3 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aPointPosition.X +10090 +// aPointPosition.Y +7498 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;10090;0;250;7498;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aPointPosition.X +17990 +// aPointPosition.Y +3235 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;17990;0;250;3235;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16711807 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aPointPosition.X +25890 +// aPointPosition.Y +7037 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;25890;0;250;7037;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16711807 +/// Series 1 +/// Points are displayed +// nPointCountInSeries +3 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aPointPosition.X +10090 +// aPointPosition.Y +8937 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;10090;0;250;8937;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aPointPosition.X +17990 +// aPointPosition.Y +7382 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;17990;0;250;7382;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aPointPosition.X +25890 +// aPointPosition.Y +6345 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;25890;0;250;6345;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// Series 2 +/// Points are displayed +// nPointCountInSeries +3 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aPointPosition.X +10090 +// aPointPosition.Y +10723 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;10090;0;250;10723;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aPointPosition.X +17990 +// aPointPosition.Y +7497 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;17990;0;250;7497;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aPointPosition.X +25890 +// aPointPosition.Y +8880 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;25890;0;250;8880;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +10079487 +/// Series 3 +/// Points are displayed +// nPointCountInSeries +3 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aPointPosition.X +10090 +// aPointPosition.Y +9680 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;10090;0;250;9680;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16776960 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aPointPosition.X +17990 +// aPointPosition.Y +6794 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;17990;0;250;6794;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16776960 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aPointPosition.X +25890 +// aPointPosition.Y +3908 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;25890;0;250;3908;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16776960 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_lines_and_points.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_lines_and_points.txt new file mode 100644 index 0000000000..01c6448c29 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_lines_and_points.txt @@ -0,0 +1,310 @@ +// nSeriesCount +4 +/// Series 0 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +8218 +// aLineSize.Height +2227 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;2227;8218;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +8093 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;8093;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +8212 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;8212;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +9941 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;9941;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +10320 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;10320;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// Series 1 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +4844 +// aLineSize.Height +2549 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;2549;4844;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +4719 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;4719;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +5660 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;5660;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +6718 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;6718;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +7268 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;7268;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// Series 2 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +3131 +// aLineSize.Height +1802 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;1802;3131;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +3006 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;3006;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +3164 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;3164;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +4808 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;4808;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +4184 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;4184;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// Series 3 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +448 +// aLineSize.Height +0 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;0;448;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +323 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;323;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +323 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;323;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +323 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;323;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +323 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;323;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_lines_only.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_lines_only.txt new file mode 100644 index 0000000000..42eaae0b23 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_lines_only.txt @@ -0,0 +1,58 @@ +// nSeriesCount +4 +/// Series 0 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +8218 +// aLineSize.Height +2227 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;2227;8218;0;0;1 +/// Series 1 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +4844 +// aLineSize.Height +2549 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;2549;4844;0;0;1 +/// Series 2 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +3131 +// aLineSize.Height +1802 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;1802;3131;0;0;1 +/// Series 3 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +448 +// aLineSize.Height +0 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;0;448;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_points_only.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_points_only.txt new file mode 100644 index 0000000000..c8d1819f90 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/percent_stacked_line_chart_points_only.txt @@ -0,0 +1,258 @@ +// nSeriesCount +4 +/// Series 0 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aPointPosition.X +2980 +// aPointPosition.Y +8115 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2980;0;250;8115;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aPointPosition.X +9124 +// aPointPosition.Y +8234 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9124;0;250;8234;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aPointPosition.X +15268 +// aPointPosition.Y +9967 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15268;0;250;9967;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3 +// aPointPosition.X +21412 +// aPointPosition.Y +10347 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21412;0;250;10347;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// Series 1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aPointPosition.X +2980 +// aPointPosition.Y +4732 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2980;0;250;4732;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aPointPosition.X +9124 +// aPointPosition.Y +5675 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9124;0;250;5675;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aPointPosition.X +15268 +// aPointPosition.Y +6736 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15268;0;250;6736;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3 +// aPointPosition.X +21412 +// aPointPosition.Y +7287 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21412;0;250;7287;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// Series 2 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aPointPosition.X +2980 +// aPointPosition.Y +3014 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2980;0;250;3014;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aPointPosition.X +9124 +// aPointPosition.Y +3173 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9124;0;250;3173;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aPointPosition.X +15268 +// aPointPosition.Y +4821 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15268;0;250;4821;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=3 +// aPointPosition.X +21412 +// aPointPosition.Y +4196 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21412;0;250;4196;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// Series 3 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aPointPosition.X +2980 +// aPointPosition.Y +324 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2980;0;250;324;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aPointPosition.X +9124 +// aPointPosition.Y +324 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9124;0;250;324;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aPointPosition.X +15268 +// aPointPosition.Y +324 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15268;0;250;324;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=3 +// aPointPosition.X +21412 +// aPointPosition.Y +324 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21412;0;250;324;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_lines_and_points.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_lines_and_points.txt new file mode 100644 index 0000000000..c6ef9431cd --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_lines_and_points.txt @@ -0,0 +1,310 @@ +// nSeriesCount +4 +/// Series 0 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +4801 +// aLinePosition.Y +3760 +// aLineSize.Height +3138 +// aLineSize.Width +7912 +// aLineTransformation +7912;0;4801;0;3138;3760;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aPointPosition.X +4676 +// aPointPosition.Y +6773 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;4676;0;250;6773;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aPointPosition.X +7313 +// aPointPosition.Y +3635 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;7313;0;250;3635;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aPointPosition.X +9951 +// aPointPosition.Y +6434 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9951;0;250;6434;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3 +// aPointPosition.X +12588 +// aPointPosition.Y +5034 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;12588;0;250;5034;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// Series 1 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +4801 +// aLinePosition.Y +3912 +// aLineSize.Height +4045 +// aLineSize.Width +7912 +// aLineTransformation +7912;0;4801;0;4045;3912;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aPointPosition.X +4676 +// aPointPosition.Y +7832 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;4676;0;250;7832;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aPointPosition.X +7313 +// aPointPosition.Y +6688 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;7313;0;250;6688;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aPointPosition.X +9951 +// aPointPosition.Y +5924 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9951;0;250;5924;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3 +// aPointPosition.X +12588 +// aPointPosition.Y +3787 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;12588;0;250;3787;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// Series 2 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +4801 +// aLinePosition.Y +3845 +// aLineSize.Height +5427 +// aLineSize.Width +7912 +// aLineTransformation +7912;0;4801;0;5427;3845;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aPointPosition.X +4676 +// aPointPosition.Y +9147 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;4676;0;250;9147;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aPointPosition.X +7313 +// aPointPosition.Y +6772 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;7313;0;250;6772;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aPointPosition.X +9951 +// aPointPosition.Y +7790 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9951;0;250;7790;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=3 +// aPointPosition.X +12588 +// aPointPosition.Y +3720 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;12588;0;250;3720;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// Series 3 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +4801 +// aLinePosition.Y +2131 +// aLineSize.Height +6373 +// aLineSize.Width +7912 +// aLineTransformation +7912;0;4801;0;6373;2131;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aPointPosition.X +4676 +// aPointPosition.Y +8379 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;4676;0;250;8379;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aPointPosition.X +7313 +// aPointPosition.Y +6255 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;7313;0;250;6255;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aPointPosition.X +9951 +// aPointPosition.Y +4131 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9951;0;250;4131;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=3 +// aPointPosition.X +12588 +// aPointPosition.Y +2006 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;12588;0;250;2006;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_lines_only.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_lines_only.txt new file mode 100644 index 0000000000..55a84b00fd --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_lines_only.txt @@ -0,0 +1,58 @@ +// nSeriesCount +4 +/// Series 0 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +5069 +// aLinePosition.Y +3954 +// aLineSize.Height +3299 +// aLineSize.Width +8352 +// aLineTransformation +8352;0;5069;0;3299;3954;0;0;1 +/// Series 1 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +5069 +// aLinePosition.Y +4114 +// aLineSize.Height +4253 +// aLineSize.Width +8352 +// aLineTransformation +8352;0;5069;0;4253;4114;0;0;1 +/// Series 2 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +5069 +// aLinePosition.Y +4043 +// aLineSize.Height +5706 +// aLineSize.Width +8352 +// aLineTransformation +8352;0;5069;0;5706;4043;0;0;1 +/// Series 3 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +5069 +// aLinePosition.Y +2242 +// aLineSize.Height +6700 +// aLineSize.Width +8352 +// aLineTransformation +8352;0;5069;0;6700;2242;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_points_only.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_points_only.txt new file mode 100644 index 0000000000..1107f97cd0 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/scatter_chart_points_only.txt @@ -0,0 +1,258 @@ +// nSeriesCount +4 +/// Series 0 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aPointPosition.X +4695 +// aPointPosition.Y +7540 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;4695;0;250;7540;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aPointPosition.X +8618 +// aPointPosition.Y +4016 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;8618;0;250;4016;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aPointPosition.X +12540 +// aPointPosition.Y +7159 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;12540;0;250;7159;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3 +// aPointPosition.X +16463 +// aPointPosition.Y +5588 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;16463;0;250;5588;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// Series 1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aPointPosition.X +4695 +// aPointPosition.Y +8730 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;4695;0;250;8730;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aPointPosition.X +8618 +// aPointPosition.Y +7444 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;8618;0;250;7444;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aPointPosition.X +12540 +// aPointPosition.Y +6587 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;12540;0;250;6587;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3 +// aPointPosition.X +16463 +// aPointPosition.Y +4187 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;16463;0;250;4187;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// Series 2 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aPointPosition.X +4695 +// aPointPosition.Y +10207 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;4695;0;250;10207;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aPointPosition.X +8618 +// aPointPosition.Y +7540 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;8618;0;250;7540;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aPointPosition.X +12540 +// aPointPosition.Y +8683 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;12540;0;250;8683;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=3 +// aPointPosition.X +16463 +// aPointPosition.Y +4111 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;16463;0;250;4111;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// Series 3 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aPointPosition.X +4695 +// aPointPosition.Y +9344 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;4695;0;250;9344;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aPointPosition.X +8618 +// aPointPosition.Y +6958 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;8618;0;250;6958;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aPointPosition.X +12540 +// aPointPosition.Y +4572 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;12540;0;250;4572;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=3 +// aPointPosition.X +16463 +// aPointPosition.Y +2186 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;16463;0;250;2186;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_lines_and_points.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_lines_and_points.txt new file mode 100644 index 0000000000..d58d57d1e8 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_lines_and_points.txt @@ -0,0 +1,310 @@ +// nSeriesCount +4 +/// Series 0 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +10042 +// aLineSize.Height +1320 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;1320;10042;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +11237 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;11237;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +9917 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;9917;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +11094 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;11094;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +10506 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;10506;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// Series 1 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +7806 +// aLineSize.Height +2432 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;2432;7806;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +10113 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;10113;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +8312 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;8312;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +9168 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;9168;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +7681 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;7681;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// Series 2 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +4953 +// aLineSize.Height +4715 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;4715;4953;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +9543 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;9543;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +6743 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;6743;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +8027 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;8027;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +4828 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;4828;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// Series 3 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3101 +// aLinePosition.Y +1380 +// aLineSize.Height +7394 +// aLineSize.Width +18406 +// aLineTransformation +18406;0;3101;0;7394;1380;0;0;1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +8649 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;8649;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +4957 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;4957;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +5347 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;5347;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +1255 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;1255;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16744192 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_lines_only.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_lines_only.txt new file mode 100644 index 0000000000..b8d7c7a241 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_lines_only.txt @@ -0,0 +1,58 @@ +// nSeriesCount +4 +/// Series 0 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3100 +// aLinePosition.Y +10256 +// aLineSize.Height +1221 +// aLineSize.Width +18405 +// aLineTransformation +18405;0;3100;0;1221;10256;0;0;1 +/// Series 1 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3100 +// aLinePosition.Y +8187 +// aLineSize.Height +2250 +// aLineSize.Width +18405 +// aLineTransformation +18405;0;3100;0;2250;8187;0;0;1 +/// Series 2 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3100 +// aLinePosition.Y +5547 +// aLineSize.Height +4362 +// aLineSize.Width +18405 +// aLineTransformation +18405;0;3100;0;4362;5547;0;0;1 +/// Series 3 +/// Lines are displayed +// static_cast(aSeriesLineStyle) +1 +// aLinePosition.X +3100 +// aLinePosition.Y +2240 +// aLineSize.Height +6843 +// aLineSize.Width +18405 +// aLineTransformation +18405;0;3100;0;6843;2240;0;0;1 diff --git a/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_points_only.txt b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_points_only.txt new file mode 100644 index 0000000000..8803c6e02d --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/pointlinecharttest/stacked_line_chart_points_only.txt @@ -0,0 +1,258 @@ +// nSeriesCount +4 +/// Series 0 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +11237 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;11237;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +9917 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;9917;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +11094 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;11094;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +10506 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;10506;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +17798 +/// Series 1 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +10113 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;10113;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +8312 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;8312;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +9168 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;9168;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +7681 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;7681;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16728590 +/// Series 2 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +9543 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;9543;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +6743 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;6743;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +8027 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;8027;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +4828 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;4828;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +16765728 +/// Series 3 +/// Points are displayed +// nPointCountInSeries +4 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=0 +// aPointPosition.X +2976 +// aPointPosition.Y +8649 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;2976;0;250;8649;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=1 +// aPointPosition.X +9111 +// aPointPosition.Y +4957 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;9111;0;250;4957;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=2 +// aPointPosition.X +15246 +// aPointPosition.Y +5347 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;15246;0;250;5347;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 +/// CID/MultiClick/D=0:CS=0:CT=0:Series=3:Point=3 +// aPointPosition.X +21382 +// aPointPosition.Y +1255 +// aPointSize.Height +250 +// aPointSize.Width +250 +// aPointTransformation +250;0;21382;0;250;1255;0;0;1 +// static_cast(aPointFillStyle) +1 +// static_cast(aPointFillColor) +5741852 diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx new file mode 100644 index 0000000000..6958876b1d --- /dev/null +++ b/chart2/qa/extras/chart2export.cxx @@ -0,0 +1,1258 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using uno::Reference; +using beans::XPropertySet; + +class Chart2ExportTest : public ChartTest +{ +public: + Chart2ExportTest() : ChartTest("/chart2/qa/extras/data/") {} +}; + +namespace { + +void testErrorBar( Reference< XPropertySet > const & xErrorBar ) +{ + sal_Int32 nErrorBarStyle; + CPPUNIT_ASSERT( + xErrorBar->getPropertyValue("ErrorBarStyle") >>= nErrorBarStyle); + CPPUNIT_ASSERT_EQUAL(chart::ErrorBarStyle::RELATIVE, nErrorBarStyle); + bool bShowPositive = bool(), bShowNegative = bool(); + CPPUNIT_ASSERT( + xErrorBar->getPropertyValue("ShowPositiveError") >>= bShowPositive); + CPPUNIT_ASSERT(bShowPositive); + CPPUNIT_ASSERT( + xErrorBar->getPropertyValue("ShowNegativeError") >>= bShowNegative); + CPPUNIT_ASSERT(bShowNegative); + double nVal = 0.0; + CPPUNIT_ASSERT(xErrorBar->getPropertyValue("PositiveError") >>= nVal); + CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, nVal, 1e-10); +} + +void checkCommonTrendline( + Reference const & xCurve, + double aExpectedExtrapolateForward, double aExpectedExtrapolateBackward, + bool aExpectedForceIntercept, double aExpectedInterceptValue, + bool aExpectedShowEquation, bool aExpectedR2, bool aExpectedMayHaveR2) +{ + Reference xProperties( xCurve , uno::UNO_QUERY ); + CPPUNIT_ASSERT(xProperties.is()); + + double aExtrapolateForward = 0.0; + CPPUNIT_ASSERT(xProperties->getPropertyValue("ExtrapolateForward") >>= aExtrapolateForward); + CPPUNIT_ASSERT_EQUAL(aExpectedExtrapolateForward, aExtrapolateForward); + + double aExtrapolateBackward = 0.0; + CPPUNIT_ASSERT(xProperties->getPropertyValue("ExtrapolateBackward") >>= aExtrapolateBackward); + CPPUNIT_ASSERT_EQUAL(aExpectedExtrapolateBackward, aExtrapolateBackward); + + bool bForceIntercept = false; + CPPUNIT_ASSERT(xProperties->getPropertyValue("ForceIntercept") >>= bForceIntercept); + CPPUNIT_ASSERT_EQUAL(aExpectedForceIntercept, bForceIntercept); + + if (bForceIntercept) + { + double aInterceptValue = 0.0; + CPPUNIT_ASSERT(xProperties->getPropertyValue("InterceptValue") >>= aInterceptValue); + CPPUNIT_ASSERT_EQUAL(aExpectedInterceptValue, aInterceptValue); + } + + Reference< XPropertySet > xEquationProperties( xCurve->getEquationProperties() ); + CPPUNIT_ASSERT(xEquationProperties.is()); + + bool bShowEquation = false; + CPPUNIT_ASSERT(xEquationProperties->getPropertyValue("ShowEquation") >>= bShowEquation); + CPPUNIT_ASSERT_EQUAL(aExpectedShowEquation, bShowEquation); + + bool bShowCorrelationCoefficient = false; + CPPUNIT_ASSERT(xEquationProperties->getPropertyValue("ShowCorrelationCoefficient") >>= bShowCorrelationCoefficient); + CPPUNIT_ASSERT_EQUAL(aExpectedR2, bShowCorrelationCoefficient); + + bool bMayHaveR2 = false; + CPPUNIT_ASSERT(xEquationProperties->getPropertyValue("MayHaveCorrelationCoefficient") >>= bMayHaveR2); + CPPUNIT_ASSERT_EQUAL(aExpectedMayHaveR2, bMayHaveR2); +} + +void checkNameAndType(Reference const & xProperties, const OUString& aExpectedName, const OUString& aExpectedServiceName) +{ + Reference< lang::XServiceName > xServiceName( xProperties, UNO_QUERY ); + CPPUNIT_ASSERT(xServiceName.is()); + + OUString aServiceName = xServiceName->getServiceName(); + CPPUNIT_ASSERT_EQUAL(aExpectedServiceName, aServiceName); + + OUString aCurveName; + CPPUNIT_ASSERT(xProperties->getPropertyValue("CurveName") >>= aCurveName); + CPPUNIT_ASSERT_EQUAL(aExpectedName, aCurveName); +} + +void checkLinearTrendline( + Reference const & xCurve, const OUString& aExpectedName, + double aExpectedExtrapolateForward, double aExpectedExtrapolateBackward, + double aExpectedInterceptValue) +{ + Reference xProperties( xCurve , uno::UNO_QUERY ); + CPPUNIT_ASSERT(xProperties.is()); + + checkNameAndType(xProperties, aExpectedName, "com.sun.star.chart2.LinearRegressionCurve"); + + checkCommonTrendline( + xCurve, + aExpectedExtrapolateForward, aExpectedExtrapolateBackward, + /*aExpectedForceIntercept*/false, aExpectedInterceptValue, + /*aExpectedShowEquation*/true, /*aExpectedR2*/false, /*aExpectedMayHaveR2*/true); +} + +void checkPolynomialTrendline( + Reference const & xCurve, const OUString& aExpectedName, + sal_Int32 aExpectedDegree, + double aExpectedExtrapolateForward, double aExpectedExtrapolateBackward, + double aExpectedInterceptValue) +{ + Reference xProperties( xCurve , uno::UNO_QUERY ); + CPPUNIT_ASSERT(xProperties.is()); + + checkNameAndType(xProperties, aExpectedName, "com.sun.star.chart2.PolynomialRegressionCurve"); + + sal_Int32 aDegree = 2; + CPPUNIT_ASSERT(xProperties->getPropertyValue("PolynomialDegree") >>= aDegree); + CPPUNIT_ASSERT_EQUAL(aExpectedDegree, aDegree); + + checkCommonTrendline( + xCurve, + aExpectedExtrapolateForward, aExpectedExtrapolateBackward, + /*aExpectedForceIntercept*/true, aExpectedInterceptValue, + /*aExpectedShowEquation*/true, /*aExpectedR2*/true, /*aExpectedMayHaveR2*/true); +} + +void checkMovingAverageTrendline( + Reference const & xCurve, const OUString& aExpectedName, sal_Int32 aExpectedPeriod) +{ + Reference xProperties( xCurve , uno::UNO_QUERY ); + CPPUNIT_ASSERT(xProperties.is()); + + checkNameAndType(xProperties, aExpectedName, "com.sun.star.chart2.MovingAverageRegressionCurve"); + + sal_Int32 aPeriod = 2; + CPPUNIT_ASSERT(xProperties->getPropertyValue("MovingAveragePeriod") >>= aPeriod); + CPPUNIT_ASSERT_EQUAL(aExpectedPeriod, aPeriod); + + checkCommonTrendline( + xCurve, + /*aExpectedExtrapolateForward*/0.0, /*aExpectedExtrapolateBackward*/0.0, + /*aExpectedForceIntercept*/false, /*aExpectedInterceptValue*/0.0, + /*aExpectedShowEquation*/false, /*aExpectedR2*/false, /*aExpectedMayHaveR2*/false); +} + +void checkTrendlinesInChart(uno::Reference< chart2::XChartDocument > const & xChartDoc) +{ + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< chart2::XRegressionCurveContainer > xRegressionCurveContainer( xDataSeries, UNO_QUERY ); + CPPUNIT_ASSERT( xRegressionCurveContainer.is() ); + + Sequence< Reference< chart2::XRegressionCurve > > xRegressionCurveSequence = xRegressionCurveContainer->getRegressionCurves(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xRegressionCurveSequence.getLength()); + + Reference xCurve; + + xCurve = xRegressionCurveSequence[0]; + CPPUNIT_ASSERT(xCurve.is()); + checkPolynomialTrendline(xCurve, "col2_poly", 3, 0.1, -0.1, -1.0); + + xCurve = xRegressionCurveSequence[1]; + CPPUNIT_ASSERT(xCurve.is()); + checkLinearTrendline(xCurve, "col2_linear", -0.5, -0.5, 0.0); + + xCurve = xRegressionCurveSequence[2]; + CPPUNIT_ASSERT(xCurve.is()); + checkMovingAverageTrendline(xCurve, "col2_moving_avg", 3); +} + +} + +// improve the test +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarXLSX) +{ + loadFromFile(u"ods/error_bar.ods"); + { + // make sure the ODS import was successful + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW ); + + // test that y error bars are there + Reference< beans::XPropertySet > xErrorBarYProps; + xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps; + testErrorBar(xErrorBarYProps); + } + + saveAndReload("Calc Office Open XML"); + { + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW ); + + // test that y error bars are there + Reference< beans::XPropertySet > xErrorBarYProps; + xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps; + testErrorBar(xErrorBarYProps); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarPropXLSX) +{ + loadFromFile(u"xlsx/testErrorBarProp.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // test y error bars property + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:errDir"_ostr, "val"_ostr, "y"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:spPr/a:ln"_ostr, "w"_ostr, "12600"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:spPr/a:ln/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "ff0000"); + + // test x error bars property + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:errDir"_ostr, "val"_ostr, "x"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:spPr/a:ln"_ostr, "w"_ostr, "9360"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:spPr/a:ln/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "595959"); +} + +// This method tests the preservation of properties for trendlines / regression curves +// in an export -> import cycle using different file formats - ODS, XLS and XLSX. +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendline) +{ + // Validation fails with + // Error: tag name "chart:symbol-image" is not allowed. Possible tag names are: + skipValidation(); + loadFromFile(u"ods/trendline.ods"); + checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent)); + saveAndReload("calc8"); + checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent)); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendlineOOXML) +{ + loadFromFile(u"ods/trendline.ods"); + checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent)); + saveAndReload("Calc Office Open XML"); + checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent)); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendlineXLS) +{ + loadFromFile(u"ods/trendline.ods"); + checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent)); + saveAndReload("MS Excel 97"); + checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent)); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testMovingAverage) +{ + loadFromFile(u"ods/moving-type.ods"); + saveAndReload("calc8"); + + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< chart2::XRegressionCurveContainer > xRegressionCurveContainer( xDataSeries, UNO_QUERY ); + CPPUNIT_ASSERT( xRegressionCurveContainer.is() ); + + Sequence< Reference< chart2::XRegressionCurve > > xRegressionCurveSequence = xRegressionCurveContainer->getRegressionCurves(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xRegressionCurveSequence.getLength()); + + Reference xCurve = xRegressionCurveSequence[0]; + CPPUNIT_ASSERT(xCurve.is()); + + Reference xProperties( xCurve , uno::UNO_QUERY ); + CPPUNIT_ASSERT(xProperties.is()); + + sal_Int32 nMovingAverageType = 0; + xProperties->getPropertyValue("MovingAverageType") >>= nMovingAverageType; + CPPUNIT_ASSERT_EQUAL(chart2::MovingAverageType::Central, nMovingAverageType); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testStockChart) +{ + /* For attached file Stock_Chart.docx, in chart1.xml, + * , there are four types of series as + * Open,Low,High and Close. + * For Open series, in + * an attribute val of index should start from 1 and not from 0. + * Which was problem area. + */ + loadFromFile(u"docx/testStockChart.docx"); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:order"_ostr, "val"_ostr, "1"); + assertXPathContent( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v"_ostr, + "Open"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChart) +{ + loadFromFile(u"docx/testBarChart.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:barDir"_ostr, "val"_ostr, "col"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testCrosses) +{ + // test crosses val="autoZero" with DOCX + { + loadFromFile(u"docx/Bar_horizontal_cone.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses"_ostr, "val"_ostr, "autoZero"); + } + // tdf#142351: test crossesAt val="-50" with XLSX + { + loadFromFile(u"xlsx/tdf142351.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crossesAt"_ostr, "val"_ostr, "-50"); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterChartTextXValues) +{ + loadFromFile(u"docx/scatter-chart-text-x-values.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + // Make sure we have exactly 3 data series. + std::vector > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 1"), aLabels[0][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 2"), aLabels[1][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), aLabels[2][0].get()); + + std::vector > aYValues = getDataSeriesYValuesFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aYValues.size()); + + // Check the Y values of "Series 1". + CPPUNIT_ASSERT_EQUAL(size_t(4), aYValues[0].size()); + CPPUNIT_ASSERT_EQUAL(4.3, aYValues[0][0]); + CPPUNIT_ASSERT_EQUAL(2.5, aYValues[0][1]); + CPPUNIT_ASSERT_EQUAL(3.5, aYValues[0][2]); + CPPUNIT_ASSERT_EQUAL(4.5, aYValues[0][3]); + + // And "Series 2". + CPPUNIT_ASSERT_EQUAL(size_t(4), aYValues[1].size()); + CPPUNIT_ASSERT_EQUAL(2.4, aYValues[1][0]); + CPPUNIT_ASSERT_EQUAL(4.4, aYValues[1][1]); + CPPUNIT_ASSERT_EQUAL(1.8, aYValues[1][2]); + CPPUNIT_ASSERT_EQUAL(2.8, aYValues[1][3]); + + // And "Series 3". + CPPUNIT_ASSERT_EQUAL(size_t(4), aYValues[2].size()); + CPPUNIT_ASSERT_EQUAL(2.0, aYValues[2][0]); + CPPUNIT_ASSERT_EQUAL(2.0, aYValues[2][1]); + CPPUNIT_ASSERT_EQUAL(3.0, aYValues[2][2]); + CPPUNIT_ASSERT_EQUAL(5.0, aYValues[2][3]); + + // Test the export. + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal[1]/c:numRef[1]/c:numCache[1]/c:pt[1]/c:v[1]"_ostr, "1"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisValues) +{ + loadFromFile(u"odt/tdf114657.odt"); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:ptCount"_ostr, "val"_ostr, "5"); + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[1]/c:v"_ostr, "15"); + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[2]/c:v"_ostr, "11"); + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[3]/c:v"_ostr, "20"); + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[4]/c:v"_ostr, "16"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisCategories) +{ + loadFromFile(u"odt/tdf131143.odt"); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:ptCount"_ostr, "val"_ostr, "4"); + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[1]/c:v"_ostr, "Row 1"); + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[2]/c:v"_ostr, "Row 2"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartDataTable) +{ + loadFromFile(u"docx/testChartDataTable.docx"); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showHorzBorder"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showVertBorder"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showOutline"_ostr, "val"_ostr, "1"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartExternalData) +{ + loadFromFile(u"docx/testMultipleChart.docx"); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:externalData"_ostr); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testEmbeddingsGrabBag) +{ + // The problem was that .xlsx files were missing from docx file from embeddings folder + // after saving file. + // This test case tests whether embeddings files grabbagged properly in correct object. + + loadFromFile(u"docx/testMultiplechartembeddings.docx" ); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY); + uno::Sequence aGrabBag(0); + xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty + bool bEmbeddings = false; + const char* const testEmbeddedFileNames[] {"word/embeddings/Microsoft_Excel_Worksheet3.xlsx", + "word/embeddings/Microsoft_Excel_Worksheet2.xlsx", + "word/embeddings/Microsoft_Excel_Worksheet1.xlsx"}; + for(beans::PropertyValue const & prop : std::as_const(aGrabBag)) + { + if (prop.Name == "OOXEmbeddings") + { + bEmbeddings = true; + uno::Sequence aEmbeddingsList(0); + uno::Reference aEmbeddingXlsxStream; + OUString aEmbeddedfileName; + CPPUNIT_ASSERT(prop.Value >>= aEmbeddingsList); // PropertyValue of proper type + sal_Int32 length = aEmbeddingsList.getLength(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), length); + for(int j = 0; j < length; ++j) + { + aEmbeddingsList[j].Value >>= aEmbeddingXlsxStream; + aEmbeddedfileName = aEmbeddingsList[j].Name; + CPPUNIT_ASSERT(aEmbeddingXlsxStream); // Reference not empty + CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(testEmbeddedFileNames[j]),aEmbeddedfileName); + } + } + } + CPPUNIT_ASSERT(bEmbeddings); // Grab Bag has all the expected elements +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAreaChartLoad) +{ + loadFromFile(u"docx/testAreaChartLoad.docx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:showVal"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:dLbl"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testUpDownBars) +{ + loadFromFile(u"docx/UpDownBars.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:upDownBars"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDoughnutChart) +{ + loadFromFile(u"docx/doughnutChart.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart"_ostr); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits) +{ + loadFromFile(u"docx/DisplayUnits.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:dispUnits/c:builtInUnit"_ostr, "val"_ostr, "billions"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallGradientFill) +{ + loadFromFile(u"docx/fdo74115_WallGradientFill.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill"_ostr); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallBitmapFill) +{ + loadFromFile(u"docx/fdo74115_WallBitmapFill.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill"_ostr); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartWallLineStyle) +{ + loadFromFile(u"odt/testPieChartWallLineStyle.odt"); + + // FIXME: validation error in OOXML export: Errors: 9 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:noFill"_ostr); +} + +//The below test case tests the built in marker 'x' for Office 2010 in Line charts + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290LineChartMarkerX) +{ + loadFromFile(u"docx/fdo78290_Line_Chart_Marker_x.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + 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]"_ostr,"val"_ostr,"x"); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]"_ostr,"val"_ostr,"7"); +} + +// We can also use the built in marker 'x' in scatter chart, hence writing the test case for the same. + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290ScatterChartMarkerX) +{ + loadFromFile(u"docx/fdo78290_Scatter_Chart_Marker_x.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + 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]"_ostr,"val"_ostr,"x"); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:size[1]"_ostr,"val"_ostr,"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. + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290CombinationChartMarkerX) +{ + loadFromFile(u"docx/fdo78290_Combination_Chart_Marker_x.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + 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]"_ostr,"val"_ostr,"x"); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]"_ostr,"val"_ostr,"7"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTdf126115IndividualMarker) +{ + // Check individual marker properties. + loadFromFile(u"xlsx/tdf126115.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // 1. series + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:symbol"_ostr, "val"_ostr, "square"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:size"_ostr, "val"_ostr, "8"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "ff0000"); + // 2. series + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:symbol"_ostr, "val"_ostr, "x"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:size"_ostr, "val"_ostr, "15"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "7030a0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAxisNumberFormatODS) +{ + struct + { + void check( const Reference& xChartDoc ) + { + Reference xAxisX = getAxisFromDoc(xChartDoc, 0, 0, 0); + Reference xTitle(xAxisX, UNO_QUERY_THROW); + OUString aTitleText = getTitleString(xTitle); + CPPUNIT_ASSERT_EQUAL(OUString("Linked To Source"), aTitleText); + + sal_Int32 nNumFmt = getNumberFormatFromAxis(xAxisX); + sal_Int16 nType = getNumberFormatType(xChartDoc, nNumFmt); + CPPUNIT_ASSERT_MESSAGE("X axis should be percentage format.", (nType & util::NumberFormat::PERCENT)); + + bool bNumFmtLinked = false; + Reference xPS(xAxisX, uno::UNO_QUERY_THROW); + xPS->getPropertyValue("LinkNumberFormatToSource") >>= bNumFmtLinked; + CPPUNIT_ASSERT_MESSAGE("X axis should have its number format linked to source.", bNumFmtLinked); + + Reference xAxisY = getAxisFromDoc(xChartDoc, 0, 1, 0); + xTitle.set(xAxisY, UNO_QUERY_THROW); + aTitleText = getTitleString(xTitle); + CPPUNIT_ASSERT_EQUAL(OUString("Not Linked"), aTitleText); + + nNumFmt = getNumberFormatFromAxis(xAxisY); + nType = getNumberFormatType(xChartDoc, nNumFmt); + CPPUNIT_ASSERT_MESSAGE("Y axis should be a normal number format.", (nType & util::NumberFormat::NUMBER)); + + bNumFmtLinked = true; + xPS.set(xAxisY, uno::UNO_QUERY_THROW); + xPS->getPropertyValue("LinkNumberFormatToSource") >>= bNumFmtLinked; + CPPUNIT_ASSERT_MESSAGE("Y axis should not have its number format linked to source.", !bNumFmtLinked); + } + + } aTest; + + loadFromFile(u"ods/axis-numformats-linked.ods"); + + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + aTest.check(xChartDoc); + + // Reload the document and make sure everything remains intact. + saveAndReload("calc8"); + xChartDoc = getChartDocFromSheet(0, mxComponent); + aTest.check(xChartDoc); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAxisNumberFormatXLS) +{ + struct + { + void check( const Reference& xChartDoc, bool bNumFmtLinkedActual, sal_Int16 nNumFmtTypeFlag ) const + { + Reference xAxisY = getAxisFromDoc( xChartDoc, 0, 1, 0 ); + bool bNumFmtLinked = false; + Reference xPS( xAxisY, uno::UNO_QUERY_THROW ); + xPS->getPropertyValue( "LinkNumberFormatToSource" ) >>= bNumFmtLinked; + + if ( bNumFmtLinkedActual ) + CPPUNIT_ASSERT_MESSAGE( "Y axis should have its number format linked to source.", bNumFmtLinked ); + else + { + CPPUNIT_ASSERT_MESSAGE( "Y axis should not have its number format linked to source.", !bNumFmtLinked ); + + sal_Int32 nNumFmt = getNumberFormatFromAxis( xAxisY ); + sal_Int16 nType = getNumberFormatType( xChartDoc, nNumFmt ); + if ( nNumFmtTypeFlag == util::NumberFormat::PERCENT ) + CPPUNIT_ASSERT_MESSAGE( "Y axis should be percentage format.", ( nType & util::NumberFormat::PERCENT ) ); + else + CPPUNIT_ASSERT_MESSAGE( "Y axis should be number format.", ( nType & util::NumberFormat::NUMBER ) ); + } + } + + void change( const Reference& xChartDoc, sal_Int16 nNumFmtTypeFlag ) + { + Reference xAxisY = getAxisFromDoc( xChartDoc, 0, 1, 0 ); + Reference xPS( xAxisY, uno::UNO_QUERY_THROW ); + Any aAny( false ); + xPS->setPropertyValue( "LinkNumberFormatToSource", aAny ); + + Reference xNFS( xChartDoc, uno::UNO_QUERY_THROW ); + Reference xNumberFormats = xNFS->getNumberFormats(); + CPPUNIT_ASSERT( xNumberFormats.is() ); + lang::Locale aLocale{ "en", "US", "" }; + Sequence aNumFmts = xNumberFormats->queryKeys( nNumFmtTypeFlag, aLocale, false ); + CPPUNIT_ASSERT( aNumFmts.hasElements() ); + aAny <<= aNumFmts[0]; + xPS->setPropertyValue( CHART_UNONAME_NUMFMT, aAny ); + } + + } aTest; + + loadFromFile(u"xls/axis_sourceformatting.xls" ); + + Reference xChartDoc = getChartDocFromSheet( 0, mxComponent ); + aTest.check( xChartDoc, true, util::NumberFormat::PERCENT ); + + aTest.change( xChartDoc, util::NumberFormat::NUMBER ); + // Write the document(xls) with changes made close it, load it and check if changes are intact + saveAndReload( "MS Excel 97" ); + xChartDoc = getChartDocFromSheet( 0, mxComponent ); + aTest.check( xChartDoc, false, util::NumberFormat::NUMBER ); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelBordersDOCX) +{ + struct Check + { + sal_Int32 mnIndex; + css::drawing::LineStyle meStyle; + Color mnColor; + }; + + struct + { + /** + * Chart 1 has 4 bars of which 1st and 3rd have labels with borders + * around them. + */ + void checkObject1( const Reference& xChartDoc ) + { + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + + // Check to make sure that data points 0 and 2 have local properties. + Reference xPropSet(xDataSeries, uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropSet.is()); + + Sequence aIndices; + xPropSet->getPropertyValue("AttributedDataPoints") >>= aIndices; + /* + CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be 2 data points with local properties.", sal_Int32(2), aIndices.getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aIndices[0]); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aIndices[1]); + */ + + static const Check aDataPoints[] = + { + { 0, css::drawing::LineStyle_SOLID, 0x00FFFF00 }, // solid yellow + { 2, css::drawing::LineStyle_SOLID, 0x00FF0000 } // solid red + }; + + for (size_t i = 0; i < std::size(aDataPoints); ++i) + { + xPropSet = xDataSeries->getDataPointByIndex(aDataPoints[i].mnIndex); + CPPUNIT_ASSERT(xPropSet.is()); + + css::drawing::LineStyle eLineStyle = css::drawing::LineStyle_NONE; + xPropSet->getPropertyValue(CHART_UNONAME_LABEL_BORDER_STYLE) >>= eLineStyle; + CPPUNIT_ASSERT_EQUAL(aDataPoints[i].meStyle, eLineStyle); + + sal_Int32 nWidth = -1; + xPropSet->getPropertyValue(CHART_UNONAME_LABEL_BORDER_WIDTH) >>= nWidth; + CPPUNIT_ASSERT(nWidth > 0); + + Color nColor; + xPropSet->getPropertyValue(CHART_UNONAME_LABEL_BORDER_COLOR) >>= nColor; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Border color is wrong.", aDataPoints[i].mnColor, nColor); + } + } + + /** + * Chart 2 has all its data labels with identical borders. + */ + void checkObject2( const Reference& xChartDoc ) + { + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + + Reference xPropSet(xDataSeries, uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropSet.is()); + + css::drawing::LineStyle eLineStyle = css::drawing::LineStyle_NONE; + xPropSet->getPropertyValue(CHART_UNONAME_LABEL_BORDER_STYLE) >>= eLineStyle; + CPPUNIT_ASSERT_EQUAL(css::drawing::LineStyle_SOLID, eLineStyle); + + sal_Int32 nWidth = -1; + xPropSet->getPropertyValue(CHART_UNONAME_LABEL_BORDER_WIDTH) >>= nWidth; + CPPUNIT_ASSERT(nWidth > 0); + + Color nColor; + xPropSet->getPropertyValue(CHART_UNONAME_LABEL_BORDER_COLOR) >>= nColor; + CPPUNIT_ASSERT_EQUAL_MESSAGE("Border color should be green.", COL_LIGHTGREEN, nColor); + } + + } aTest; + + loadFromFile(u"docx/data-label-borders.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + + // "Automatic" chart background fill in docx should be loaded as solid white. + Reference xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); + sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in docx should be loaded as solid fill.", + drawing::FillStyle_SOLID, eStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in docx should be loaded as solid white.", + sal_Int32(0x00FFFFFF), sal_Int32(nColor & 0x00FFFFFF)); // highest 2 bytes are transparency which we ignore here. + + aTest.checkObject1(xChartDoc); + xChartDoc.set(getChartDocFromWriter(1), uno::UNO_QUERY); + aTest.checkObject2(xChartDoc); + + // FIXME: validation error in OOXML export: Errors: 3 + skipValidation(); + + saveAndReload("Office Open XML Text"); + + xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY); + aTest.checkObject1(xChartDoc); + xChartDoc.set(getChartDocFromWriter(1), uno::UNO_QUERY); + aTest.checkObject2(xChartDoc); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabel3DChartDOCX) +{ + loadFromFile(u"docx/3d-bar-label.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // We must not export label position attributes for 3D bar charts. The + // same rule also applies to several other 3D charts, apparently. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:dLblPos"_ostr, 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:dLbl/c:dLblPos"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelBarChartDOCX) +{ + loadFromFile(u"docx/bar-chart-labels.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLblPos"_ostr, "val"_ostr, "ctr"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:dLblPos"_ostr, "val"_ostr, "inEnd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:dLblPos"_ostr, "val"_ostr, "inBase"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelClusteredBarChartDOCX) +{ + loadFromFile(u"docx/clustered-bar-chart-labels.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // FIXME: validation error in OOXML export: Errors: 9 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + 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"_ostr, "val"_ostr, "outEnd"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelRadarChartDOCX) +{ + loadFromFile(u"docx/radar-chart-labels.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // We must not export label position attributes for radar charts. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:radarChart/c:ser/c:dLbls/c:dLblPos"_ostr, 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:radarChart/c:ser/c:dLbls/c:dLbl/c:dLblPos"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelDoughnutChartDOCX) +{ + loadFromFile(u"docx/doughnut-chart-labels.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // We must not export label position attributes for doughnut charts. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:dLblPos"_ostr, 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:dLbl/c:dLblPos"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelAreaChartDOCX) +{ + loadFromFile(u"docx/area-chart-labels.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // We must not export label position attributes for area charts. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:dLblPos"_ostr, 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:dLbl/c:dLblPos"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelDefaultLineChartDOCX) +{ + // This file was created by Word 2007, which doesn't provide default data + // label position (2010 does). Make sure its default data label position + // is RIGHT when exporting. + + loadFromFile(u"docx/line-chart-label-default-placement.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + saveAndReload("Office Open XML Text"); + + xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + Reference xPropSet(xDataSeries, uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropSet.is()); + sal_Int32 nLabelPlacement = -1; + if (xPropSet->getPropertyValue("LabelPlacement") >>= nLabelPlacement) + // This option may not be set. Check its value only when it's set. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Line chart's default label placement should be 'right'.", chart::DataLabelPlacement::RIGHT, nLabelPlacement ); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testIndividualDataLabelProps) +{ + loadFromFile(u"xlsx/tdf122915.xlsx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, "1600"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "ff0000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr/a:latin"_ostr, "typeface"_ostr, "Times New Roman"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChartRotation) +{ + loadFromFile(u"docx/barChartRotation.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX"_ostr, "val"_ostr, "30"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotY"_ostr, "val"_ostr, "50"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testShapeFollowedByChart) +{ + /* If there is a scenario where a chart is followed by a shape + which is being exported as an alternate content then, the + docPr Id is being repeated, ECMA 20.4.2.5 says that the + docPr Id should be unique, ensuring the same here. + */ + loadFromFile(u"docx/FDO74430.docx"); + + // FIXME: validation error in OOXML export: Errors: 5 + skipValidation(); + + save("Office Open XML Text" ); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + OUString aValueOfFirstDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:drawing[1]/wp:inline[1]/wp:docPr[1]"_ostr, "id"_ostr); + OUString aValueOfSecondDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:docPr[1]"_ostr, "id"_ostr); + + CPPUNIT_ASSERT( aValueOfFirstDocPR != aValueOfSecondDocPR ); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartDataLabels) +{ + loadFromFile(u"docx/PieChartDataLabels.docx"); + + // FIXME: validation error in OOXML export: Errors: 19 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser[1]/c:dLbls/c:dLbl[1]/c:dLblPos"_ostr, "val"_ostr, "outEnd"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSeriesIdxOrder) +{ + loadFromFile(u"docx/testSeriesIdxOrder.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:idx[1]"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:order[1]"_ostr, "val"_ostr, "1"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterPlotLabels) +{ + loadFromFile(u"odt/scatter-plot-labels.odt"); + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + // Make sure the original chart has 'a', 'b', 'c' as its data labels. + std::vector > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("a"), aLabels[0][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("b"), aLabels[1][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("c"), aLabels[2][0].get()); + + // Reload the doc and check again. The labels should not change. + saveAndReload("writer8"); + + xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("a"), aLabels[0][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("b"), aLabels[1][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("c"), aLabels[2][0].get()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarDataRangeODS) +{ + loadFromFile(u"ods/ErrorBarRange.ods"); + saveAndReload("calc8"); + + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW ); + + // test that y error bars are there + Reference< beans::XPropertySet > xErrorBarYProps; + xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps; + uno::Any aAny = xErrorBarYProps->getPropertyValue("ErrorBarRangePositive"); + CPPUNIT_ASSERT(aAny.hasValue()); + OUString aPosRange; + aAny >>= aPosRange; + CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$B$1:$B$3"), aPosRange); + + aAny = xErrorBarYProps->getPropertyValue("ErrorBarRangeNegative"); + CPPUNIT_ASSERT(aAny.hasValue()); + OUString aNegRange; + aAny >>= aNegRange; + CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$C$1:$C$3"), aNegRange); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartCrash) +{ + loadFromFile(u"docx/FDO75975.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartRotation) +{ + loadFromFile(u"docx/pieChartRotation.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX"_ostr, "val"_ostr, "40"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotY"_ostr, "val"_ostr, "30"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testEmbeddingsOleObjectGrabBag) +{ + // The problem was that .bin files were missing from docx file from embeddings folder + // after saving file. + // This test case tests whether embeddings files grabbagged properly in correct object. + + loadFromFile(u"docx/testchartoleobjectembeddings.docx" ); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY); + uno::Sequence aGrabBag(0); + xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty + bool bEmbeddings = false; + const char* const testEmbeddedFileNames[] = {"word/embeddings/oleObject1.bin"}; + for(beans::PropertyValue const & prop : std::as_const(aGrabBag)) + { + if (prop.Name == "OOXEmbeddings") + { + bEmbeddings = true; + uno::Sequence aEmbeddingsList(0); + uno::Reference aEmbeddingXlsxStream; + OUString aEmbeddedfileName; + CPPUNIT_ASSERT(prop.Value >>= aEmbeddingsList); // PropertyValue of proper type + sal_Int32 length = aEmbeddingsList.getLength(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), length); + for(int j = 0; j < length; ++j) + { + aEmbeddingsList[j].Value >>= aEmbeddingXlsxStream; + aEmbeddedfileName = aEmbeddingsList[j].Name; + CPPUNIT_ASSERT(aEmbeddingXlsxStream); // Reference not empty + CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(testEmbeddedFileNames[j]),aEmbeddedfileName); + } + } + } + CPPUNIT_ASSERT(bEmbeddings); // Grab Bag has all the expected elements +} + +namespace { + +void checkGapWidth(Reference const & xPropSet, sal_Int32 nValue) +{ + uno::Any aAny = xPropSet->getPropertyValue("GapwidthSequence"); + CPPUNIT_ASSERT(aAny.hasValue()); + uno::Sequence< sal_Int32 > aSequence; + aAny >>= aSequence; + CPPUNIT_ASSERT(aSequence.hasElements()); + CPPUNIT_ASSERT_EQUAL(nValue, aSequence[0]); +} + +void checkOverlap(Reference const & xPropSet, sal_Int32 nValue) +{ + uno::Any aAny = xPropSet->getPropertyValue("OverlapSequence"); + CPPUNIT_ASSERT(aAny.hasValue()); + uno::Sequence< sal_Int32 > aSequence; + aAny >>= aSequence; + CPPUNIT_ASSERT(aSequence.hasElements()); + CPPUNIT_ASSERT_EQUAL(nValue, aSequence[0]); +} + +void checkSheetForGapWidthAndOverlap(uno::Reference< chart2::XChartDocument > const & xChartDoc, + sal_Int32 nExpectedGapWidth, sal_Int32 nExpectedOverlap) +{ + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT(xChartType.is()); + + Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW ); + checkGapWidth(xPropSet, nExpectedGapWidth); + checkOverlap(xPropSet, nExpectedOverlap); + +} + +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testGapWidthXLSX) +{ + loadFromFile(u"xlsx/gapWidth.xlsx"); + + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + checkSheetForGapWidthAndOverlap(xChartDoc, 120, -60); + + xChartDoc = getChartDocFromSheet( 1, mxComponent ); + checkSheetForGapWidthAndOverlap(xChartDoc, 50, 30); + + saveAndReload("Calc Office Open XML"); + + xChartDoc = getChartDocFromSheet( 0, mxComponent ); + checkSheetForGapWidthAndOverlap(xChartDoc, 120, -60); + + xChartDoc = getChartDocFromSheet( 1, mxComponent ); + checkSheetForGapWidthAndOverlap(xChartDoc, 50, 30); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSmoothedLines) +{ + loadFromFile(u"ods/smoothedLines.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:smooth"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testLabelStringODS) +{ + loadFromFile(u"ods/labelString.ods"); + + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + Reference< chart2::data::XDataSequence > xLabelSeq = + getLabelDataSequenceFromDoc(xChartDoc); + CPPUNIT_ASSERT(xLabelSeq.is()); + + OUString aLabelString = xLabelSeq->getSourceRangeRepresentation(); + CPPUNIT_ASSERT_EQUAL(OUString("\"LabelName\""), aLabelString); + + saveAndReload("calc8"); + + xChartDoc = getChartDocFromSheet( 0, mxComponent ); + xLabelSeq = getLabelDataSequenceFromDoc(xChartDoc); + CPPUNIT_ASSERT(xLabelSeq.is()); + + aLabelString = xLabelSeq->getSourceRangeRepresentation(); + CPPUNIT_ASSERT_EQUAL(OUString("\"LabelName\""), aLabelString); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx new file mode 100644 index 0000000000..f5378dc944 --- /dev/null +++ b/chart2/qa/extras/chart2export2.cxx @@ -0,0 +1,1685 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" + +#include +#include +#include +#include +#include +#include +#include + +using uno::Reference; +using beans::XPropertySet; + +class Chart2ExportTest2 : public ChartTest +{ +public: + Chart2ExportTest2() + : ChartTest("/chart2/qa/extras/data/") + { + } +}; + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testSetSeriesToSecondaryAxisXLSX) +{ + loadFromFile(u"xlsx/add_series_secondary_axis.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + // Second series + Reference xSeries = getDataSeriesFromDoc(xChartDoc, 1); + CPPUNIT_ASSERT(xSeries.is()); + + Reference xPropSet(xSeries, uno::UNO_QUERY_THROW); + sal_Int32 AxisIndex = 1; + // Attach the second series to the secondary axis. (The third series is already attached.) + xPropSet->setPropertyValue("AttachedAxisIndex", uno::Any(AxisIndex)); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Check there are only two tag in the XML, one for the primary and one for the secondary axis. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart"_ostr, 2); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCombinedChartSecondaryAxisXLSX) +{ + // Original file was created with MS Office + loadFromFile(u"xlsx/combined_chart_secondary_axis.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Collect barchart axID on secondary Axis + OUString XValueIdOfBarchart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[1]"_ostr, "val"_ostr); + OUString YValueIdOfBarchart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[2]"_ostr, "val"_ostr); + // Collect linechart axID on primary Axis + OUString XValueIdOfLinechart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[1]"_ostr, "val"_ostr); + OUString YValueIdOfLinechart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[2]"_ostr, "val"_ostr); + // Check which c:catAx and c:valAx contain the AxisId of charttypes + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[1]/c:axId"_ostr, "val"_ostr, + XValueIdOfLinechart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:axId"_ostr, "val"_ostr, + YValueIdOfLinechart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[2]/c:axId"_ostr, "val"_ostr, + XValueIdOfBarchart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:axId"_ostr, "val"_ostr, + YValueIdOfBarchart); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCombinedChartSecondaryAxisODS) +{ + // Original file was created with LibreOffice + loadFromFile(u"ods/combined_chart_secondary_axis.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Collect barchart axID on secondary Axis + OUString XValueIdOfBarchart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[1]"_ostr, "val"_ostr); + OUString YValueIdOfBarchart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[2]"_ostr, "val"_ostr); + // Collect linechart axID on primary Axis + OUString XValueIdOfLinechart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[1]"_ostr, "val"_ostr); + OUString YValueIdOfLinechart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[2]"_ostr, "val"_ostr); + // Check which c:catAx and c:valAx contain the AxisId of charttypes + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[1]/c:axId"_ostr, "val"_ostr, + XValueIdOfLinechart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:axId"_ostr, "val"_ostr, + YValueIdOfLinechart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[2]/c:axId"_ostr, "val"_ostr, + XValueIdOfBarchart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:axId"_ostr, "val"_ostr, + YValueIdOfBarchart); + // do not need CT_crosses tag if the actual axis is deleted, so we need to make sure it is not saved + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[2]/c:crosses"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenXLSX) +{ + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + // Original files were created with MS Office + { + loadFromFile(u"xlsx/tdf127777.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween"_ostr, + "val"_ostr, "between"); + } + { + loadFromFile(u"xlsx/tdf132076.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween"_ostr, + "val"_ostr, "between"); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenWithDeletedAxis) +{ + // Original file was created with MS Office (the category axis is deleted in the file) + loadFromFile(u"xlsx/tdf128633.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween"_ostr, "val"_ostr, + "between"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenODS) +{ + // Original file was created with LibreOffice + loadFromFile(u"ods/test_CrossBetween.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween"_ostr, "val"_ostr, + "between"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitleRotationXLSX) +{ + loadFromFile(u"xlsx/axis_title_rotation.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:tx/c:rich/a:bodyPr"_ostr, + "rot"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitlePositionDOCX) +{ + loadFromFile(u"docx/testAxisTitlePosition.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // test X Axis title position + OUString aXVal = getXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:title/c:layout/c:manualLayout/c:x"_ostr, + "val"_ostr); + double nX = aXVal.toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.698208543867708, nX, 1e-3); + OUString aYVal = getXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:title/c:layout/c:manualLayout/c:y"_ostr, + "val"_ostr); + double nY = aYVal.toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.805152435594555, nY, 1e-3); + + // test Y Axis title position + aXVal = getXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:layout/c:manualLayout/c:x"_ostr, + "val"_ostr); + nX = aXVal.toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0253953671500755, nX, 1e-3); + aYVal = getXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:layout/c:manualLayout/c:y"_ostr, + "val"_ostr); + nY = aYVal.toDouble(); + // just test the first two decimal digits because it is not perfect in docx yet. + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.384070199122511, nY, 1e-2); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisCrossBetweenDOCX) +{ + loadFromFile(u"odt/axis-position.odt"); + + // FIXME: validation error in OOXML export: Errors: 3 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + assertXPath(pXmlDoc, "(//c:crossBetween)[1]"_ostr, "val"_ostr, "midCat"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testPieChartDataPointExplosionXLSX) +{ + loadFromFile(u"xlsx/pie_chart_datapoint_explosion.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dPt/c:explosion"_ostr, + "val"_ostr, "28"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabel) +{ + loadFromFile(u"pptx/tdf115107.pptx"); + + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + float nFontSize; + sal_Int64 nFontColor; + sal_Int32 nCharUnderline; + uno::Reference xPropertySet; + uno::Sequence> aFields; + + // 1 + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(2), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("90.0 = "), aFields[0]->getString()); + aFields[0]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[0]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(18), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xed7d31), nFontColor); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, + aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("90"), aFields[1]->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("{0C576297-5A9F-4B4E-A675-B6BA406B7D87}"), aFields[1]->getGuid()); + + // 2 + xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(8), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), aFields[0]->getString()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString(" : "), aFields[1]->getString()); + + CPPUNIT_ASSERT_EQUAL( + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CATEGORYNAME, + aFields[2]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("B"), aFields[2]->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("{0CCAAACD-B393-42CE-8DBD-82F9F9ADC852}"), aFields[2]->getGuid()); + aFields[2]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[2]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(16), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xed7d31), nFontColor); + + CPPUNIT_ASSERT_EQUAL( + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE, + aFields[3]->getFieldType()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[4]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Multi"), aFields[4]->getString()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[5]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("line"), aFields[5]->getString()); + aFields[5]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[5]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(11.97), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xbf9000), nFontColor); + + CPPUNIT_ASSERT_EQUAL( + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE, + aFields[6]->getFieldType()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[7]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Abc"), aFields[7]->getString()); + aFields[7]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[7]->getPropertyValue("CharColor") >>= nFontColor; + aFields[7]->getPropertyValue("CharUnderline") >>= nCharUnderline; + CPPUNIT_ASSERT_EQUAL(static_cast(12), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xa9d18e), nFontColor); + CPPUNIT_ASSERT_EQUAL(static_cast(1), nCharUnderline); + + // 3 + xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(1), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL( + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, + aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("DATA"), aFields[0]->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("{C8F3EB90-8960-4F9A-A3AD-B4FAC4FE4566}"), aFields[0]->getGuid()); + + // 4 + xPropertySet.set(xDataSeries->getDataPointByIndex(3), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(2), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL( + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLREF, + aFields[0]->getFieldType()); + //CPPUNIT_ASSERT_EQUAL(OUString("70"), aFields[0]->getString()); TODO: Not implemented yet + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString(" getString()); + + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Check the data labels font color for the complete data series + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/" + "a:defRPr/a:solidFill/a:srgbClr"_ostr, + "val"_ostr, "404040"); +} + +/// Test for tdf#94235 +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataSeriesName) +{ + // ODF + { + loadFromFile(u"ods/ser_labels.ods"); + saveAndReload("calc8"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropertySet; + chart2::DataPointLabel aDataPointLabel; + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aDataPointLabel; + CPPUNIT_ASSERT_EQUAL(sal_True, aDataPointLabel.ShowSeriesName); + } + + // OOXML + { + loadFromFile(u"xlsx/ser_labels.xlsx"); + saveAndReload("Calc Office Open XML"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropertySet; + chart2::DataPointLabel aDataPointLabel; + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aDataPointLabel; + CPPUNIT_ASSERT_EQUAL(sal_True, aDataPointLabel.ShowSeriesName); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomPositionofDataLabel) +{ + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + loadFromFile(u"xlsx/testCustomPosDataLabels.xlsx"); + { + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // test custom position of data label (xlsx) + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:idx"_ostr, + "val"_ostr, "2"); + OUString aXVal = getXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/" + "c:dLbl[1]/c:layout/c:manualLayout/c:x"_ostr, + "val"_ostr); + double nX = aXVal.toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.11027682973075476, nX, 1e-7); + + OUString aYVal = getXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/" + "c:dLbl[1]/c:layout/c:manualLayout/c:y"_ostr, + "val"_ostr); + double nY = aYVal.toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.0742140311063737, nY, 1e-7); + } + + loadFromFile(u"docx/testTdf108110.docx"); + { + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // test custom position of data label (docx) + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[2]/c:idx"_ostr, + "val"_ostr, "2"); + OUString aXVal = getXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/" + "c:dLbl[2]/c:layout/c:manualLayout/c:x"_ostr, + "val"_ostr); + double nX = aXVal.toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0227256488772236, nX, 1e-7); + + OUString aYVal = getXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/" + "c:dLbl[2]/c:layout/c:manualLayout/c:y"_ostr, + "val"_ostr); + double nY = aYVal.toDouble(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.172648731408574, nY, 1e-7); + } + + loadFromFile(u"ods/tdf136024.ods"); + { + saveAndReload("calc8"); + // tdf#136024: test custom position of pie chart data label after an ods export + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), + uno::UNO_SET_THROW); + + chart2::RelativePosition aCustomLabelPosition; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CustomLabelPosition") + >>= aCustomLabelPosition); + CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.0961935120945059, aCustomLabelPosition.Primary, 1e-5); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.209578842093566, aCustomLabelPosition.Secondary, 1e-5); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabelMultipleSeries) +{ + loadFromFile(u"pptx/tdf115107-2.pptx"); + + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + float nFontSize; + sal_Int64 nFontColor; + uno::Reference xPropertySet; + uno::Sequence> aFields; + + // First series + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(3), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, + aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("4.3"), aFields[0]->getString()); + aFields[0]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[0]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(18), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xc00000), nFontColor); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString(" "), aFields[1]->getString()); + + CPPUNIT_ASSERT_EQUAL( + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, + aFields[2]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Bars"), aFields[2]->getString()); + + // Second series + xDataSeries = getDataSeriesFromDoc(xChartDoc, 0, 1); + CPPUNIT_ASSERT(xDataSeries.is()); + + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(3), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, + aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("2"), aFields[0]->getString()); + aFields[0]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[0]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(18), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xffd966), nFontColor); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, + aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString(" "), aFields[1]->getString()); + + CPPUNIT_ASSERT_EQUAL( + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, + aFields[2]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Line"), aFields[2]->getString()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLeaderLines) +{ + // FIXME: validation error in OOXML export: Errors: 2 + skipValidation(); + + loadFromFile(u"xlsx/testTdf90749.xlsx"); + { + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/" + "c15:showLeaderLines"_ostr, + "val"_ostr, "1"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/" + "c15:showLeaderLines"_ostr, + "val"_ostr, "0"); + } + loadFromFile(u"docx/MSO_Custom_Leader_Line.docx"); + { + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // tdf#134571: Check the leader line is switch off. + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:extLst/c:ext/" + "c15:showLeaderLines"_ostr, + "val"_ostr, "0"); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNumberFormatExportPPTX) +{ + loadFromFile(u"pptx/tdf115859.pptx"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt"_ostr, + "formatCode"_ostr, "#,##0.00,\\K"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt"_ostr, + "sourceLinked"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLabelSeparatorExportDOCX) +{ + loadFromFile(u"docx/testLabelSeparator.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // The text separator should be a new line + assertXPathContent( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:separator"_ostr, + "\n"); + // The text separator should be a comma + assertXPathContent( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:separator"_ostr, + ", "); + // The text separator should be a semicolon + assertXPathContent( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:separator"_ostr, + "; "); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesColorFillPPTX) +{ + loadFromFile(u"pptx/testChartTitlePropertiesColorFill.pptx"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr"_ostr, + "val"_ostr, "ff0000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesGradientFillPPTX) +{ + loadFromFile(u"pptx/testChartTitlePropertiesGradientFill.pptx"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr"_ostr, + "val"_ostr, "f6f8fc"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr"_ostr, + "val"_ostr, "c7d5ed"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesBitmapFillPPTX) +{ + loadFromFile(u"pptx/testChartTitlePropertiesBitmapFill.pptx"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip"_ostr, + "embed"_ostr, "rId1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testxAxisLabelsRotation) +{ + loadFromFile(u"xlsx/xAxisLabelsRotation.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc1 = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc1); + + // Chart1 xAxis labels should be 45 degree + assertXPath(pXmlDoc1, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr"_ostr, + "rot"_ostr, "2700000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesXLSX) +{ + loadFromFile(u"ods/multilevelcat.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // check category axis labels number of first level + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/" + "c:multiLvlStrCache/c:ptCount"_ostr, + "val"_ostr, "6"); + // check category axis labels text of first level + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/" + "c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[1]/c:pt[1]/c:v"_ostr, + "Categoria 1"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/" + "c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[1]/c:pt[6]/c:v"_ostr, + "Categoria 6"); + // check category axis labels text of second level + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/" + "c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[2]/c:pt[1]/c:v"_ostr, + "2011"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/" + "c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[2]/c:pt[3]/c:v"_ostr, + "2013"); + // check the 'noMultiLvlLbl' tag - ChartExport.cxx:2950 FIXME: seems not support, so check the default noMultiLvlLbl value. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:noMultiLvlLbl"_ostr, + "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesDOCX) +{ + loadFromFile(u"odt/multilevelcat.odt"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // check category axis labels number of first level + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/" + "c:multiLvlStrCache/c:ptCount"_ostr, + "val"_ostr, "4"); + // check category axis labels text of first level + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/" + "c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[1]/c:pt[1]/c:v"_ostr, + "Categoria 1"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/" + "c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[1]/c:pt[4]/c:v"_ostr, + "Categoria 4"); + // check category axis labels text of second level + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/" + "c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[2]/c:pt[1]/c:v"_ostr, + "2011"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/" + "c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[2]/c:pt[2]/c:v"_ostr, + "2012"); + // check the 'noMultiLvlLbl' tag - ChartExport.cxx:2950 FIXME: seems not support, so check the default noMultiLvlLbl value. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:noMultiLvlLbl"_ostr, + "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf116163) +{ + loadFromFile(u"pptx/tdf116163.pptx"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr"_ostr, + "rot"_ostr, "-5400000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf111824) +{ + loadFromFile(u"xlsx/tdf111824.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Collect 3D barchart Z axID + OUString zAxisIdOf3DBarchart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:axId[3]"_ostr, "val"_ostr); + // 3D barchart Z axis properties should be in a serAx OOXML tag instead of catAx + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:serAx/c:axId"_ostr, "val"_ostr, + zAxisIdOf3DBarchart); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, test3DAreaChartZAxis) +{ + loadFromFile(u"xlsx/test3DAreaChartZAxis.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Collect 3D area chart Z axID + OUString zAxisIdOf3DAreachart = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:area3DChart/c:axId[3]"_ostr, "val"_ostr); + // 3D area chart z-axis properties should be in a serAx OOXML element instead of catAx + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:serAx/c:axId"_ostr, "val"_ostr, + zAxisIdOf3DAreachart); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf119029) +{ + loadFromFile(u"odp/tdf119029.odp"); + // Only use "chart", without number, because the number depends on the previous tests + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:bodyPr"_ostr, + "rot"_ostr, "-5400000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf108022) +{ + loadFromFile(u"odt/tdf108022.odt"); + saveAndReload("Office Open XML Text"); + + // assert we really have two charts + Reference xChartDoc1(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc1.is()); + Reference xChartDoc2(getChartDocFromWriter(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc2.is()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf121744) +{ + loadFromFile(u"docx/tdf121744.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + OUString XValueId = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[1]"_ostr, "val"_ostr); + OUString YValueId = getXPath( + pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[2]"_ostr, "val"_ostr); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[1]"_ostr, "val"_ostr, + XValueId); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[2]"_ostr, "val"_ostr, + YValueId); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf121189) +{ + loadFromFile(u"odp/tdf121189.odp"); + saveAndReload("Impress Office Open XML"); + + uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); + uno::Reference xPage(xDoc->getDrawPages()->getByIndex(0), + uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xPage->getCount()); + uno::Reference xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.OLE2Shape"), xShape->getShapeType()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf122031) +{ + //Checks pie chart data label format. + loadFromFile(u"xlsx/tdf122031.xlsx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt"_ostr, + "formatCode"_ostr, "0.000%"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt"_ostr, + "formatCode"_ostr, "0.000%"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[2]/c:numFmt"_ostr, + "formatCode"_ostr, "0.000%"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[3]/c:numFmt"_ostr, + "formatCode"_ostr, "0.000%"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf115012) +{ + loadFromFile(u"xlsx/tdf115012.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // workaround: use-zero instead of leave-gap to show the original line chart + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs"_ostr, "val"_ostr, "zero"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134118) +{ + loadFromFile(u"xlsx/tdf134118.xlsx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // workaround: use leave-gap instead of zero to show the original line chart + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs"_ostr, "val"_ostr, "gap"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123206_customLabelText) +{ + loadFromFile(u"docx/tdf123206.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // FIXME: validation error in OOXML export: Errors: 2 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[2]/c:tx/" + "c:rich/a:p/a:r/a:t"_ostr, + "kiscica"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomLabelText) +{ + loadFromFile(u"docx/testCustomlabeltext.docx"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // FIXME: validation error in OOXML export: Errors: 3 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[1]/c:idx"_ostr, + "val"_ostr, "2"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[1]/c:tx/" + "c:rich/a:p/a:r[1]/a:t"_ostr, + "3.5"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[1]/c:tx/" + "c:rich/a:p/a:r[3]/a:t"_ostr, + "CustomLabel 1"); + + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[2]/c:idx"_ostr, + "val"_ostr, "3"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[2]/c:tx/" + "c:rich/a:p/a:r[1]/a:t"_ostr, + "4.5"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[2]/c:tx/" + "c:rich/a:p/a:r[3]/a:t"_ostr, + "CustomLabel 2"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDeletedLegendEntries) +{ + loadFromFile(u"xlsx/deleted_legend_entry.xlsx"); + { + saveAndReload("Calc Office Open XML"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 1)); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropertySet(xDataSeries, uno::UNO_QUERY_THROW); + bool bShowLegendEntry = true; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("ShowLegendEntry") >>= bShowLegendEntry); + CPPUNIT_ASSERT(!bShowLegendEntry); + } + + loadFromFile(u"xlsx/deleted_legend_entry2.xlsx"); + { + saveAndReload("Calc Office Open XML"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropertySet(xDataSeries, uno::UNO_QUERY_THROW); + bool bShowLegendEntry = true; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("ShowLegendEntry") >>= bShowLegendEntry); + CPPUNIT_ASSERT(!bShowLegendEntry); + + Reference xChartDoc2 = getChartDocFromSheet(1, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries2(getDataSeriesFromDoc(xChartDoc2, 0)); + CPPUNIT_ASSERT(xDataSeries2.is()); + Reference xPropertySet2(xDataSeries2, uno::UNO_QUERY_THROW); + Sequence deletedLegendEntriesSeq; + CPPUNIT_ASSERT(xPropertySet2->getPropertyValue("DeletedLegendEntries") + >>= deletedLegendEntriesSeq); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), deletedLegendEntriesSeq[0]); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf60316) +{ + loadFromFile(u"pptx/tdf60316.pptx"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Without the fix in place, the shape would have had a solidFill background + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:noFill"_ostr, 1); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:solidFill"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf130225) +{ + loadFromFile(u"docx/piechart_deleted_legend_entry.docx"); + saveAndReload("Office Open XML Text"); + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropertySet(xDataSeries, uno::UNO_QUERY_THROW); + Sequence deletedLegendEntriesSeq; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("DeletedLegendEntries") + >>= deletedLegendEntriesSeq); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), deletedLegendEntriesSeq[0]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf59857) +{ + loadFromFile(u"ods/tdf59857.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:floor/c:spPr/a:ln/a:noFill"_ostr, 1); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:floor/c:spPr/a:solidFill/a:srgbClr"_ostr, + "val"_ostr, "cccccc"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:backWall/c:spPr/a:ln/a:noFill"_ostr, 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:backWall/c:spPr/a:ln/a:solidFill/a:srgbClr"_ostr, + "val"_ostr, "b3b3b3"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf126076) +{ + loadFromFile(u"xlsx/auto_marker_excel10.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // This was 12: all series exported with square markers + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker/c:symbol[@val='square']"_ostr, + 0); + // instead of skipping markers + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf75330) +{ + loadFromFile(u"ods/legend_overlay.ods"); + saveAndReload("calc8"); + { + uno::Reference xChart2Doc = getChartDocFromSheet(0, mxComponent); + uno::Reference xChartDoc(xChart2Doc, uno::UNO_QUERY); + uno::Reference xLegend = xChartDoc->getLegend(); + Reference xPropertySet(xLegend, uno::UNO_QUERY_THROW); + bool bOverlay = false; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Overlay") >>= bOverlay); + CPPUNIT_ASSERT(bOverlay); + } + saveAndReload("Calc Office Open XML"); + { + uno::Reference xChart2Doc = getChartDocFromSheet(0, mxComponent); + uno::Reference xChartDoc(xChart2Doc, uno::UNO_QUERY); + uno::Reference xLegend = xChartDoc->getLegend(); + Reference xPropertySet(xLegend, uno::UNO_QUERY_THROW); + bool bOverlay = false; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Overlay") >>= bOverlay); + CPPUNIT_ASSERT(bOverlay); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf127792) +{ + loadFromFile(u"docx/MSO_axis_position.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween"_ostr, "val"_ostr, + "between"); + + pXmlDoc = parseExport("word/charts/chart2.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween"_ostr, "val"_ostr, + "midCat"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf131979) +{ + loadFromFile(u"ods/tdf131115.ods"); + { + saveAndReload("calc8"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropertySet; + xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW); + bool blinknumberformattosource = true; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) + >>= blinknumberformattosource); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", + !blinknumberformattosource); + } + + loadFromFile(u"ods/tdf131979.ods"); + { + saveAndReload("calc8"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropertySet; + xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW); + bool blinknumberformattosource = true; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) + >>= blinknumberformattosource); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", + blinknumberformattosource); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132076) +{ + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + { + loadFromFile(u"ods/tdf132076.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt"_ostr, + "formatCode"_ostr, "dd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt"_ostr, + "sourceLinked"_ostr, "0"); + } + { + loadFromFile(u"xlsx/tdf132076.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt"_ostr, + "formatCode"_ostr, "dd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt"_ostr, + "sourceLinked"_ostr, "0"); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf125812) +{ + loadFromFile(u"odp/ellipticalGradientFill.odp"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path"_ostr, + "path"_ostr, "circle"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect"_ostr, + "l"_ostr, "50000"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect"_ostr, + "t"_ostr, "49000"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect"_ostr, + "r"_ostr, "50000"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect"_ostr, + "b"_ostr, "51000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133190) +{ + loadFromFile(u"xlsx/tdf133190_tdf133191.xlsx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Test word wrap of data point label + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:txPr/a:bodyPr"_ostr, + "wrap"_ostr, "none"); + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[2]/c:txPr/a:bodyPr"_ostr, + "wrap"_ostr, "square"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133191) +{ + loadFromFile(u"xlsx/tdf133190_tdf133191.xlsx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Test rotation of data point label + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[3]/c:txPr/a:bodyPr"_ostr, + "rot"_ostr, "-4500000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132594) +{ + loadFromFile(u"xlsx/chart_pie2007.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:cat"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134255) +{ + loadFromFile(u"docx/tdf134255.docx"); + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // import test + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropSet(xDataSeries, UNO_QUERY_THROW); + bool bWrap = false; + CPPUNIT_ASSERT((xPropSet->getPropertyValue("TextWordWrap") >>= bWrap)); + CPPUNIT_ASSERT(bWrap); + + // FIXME: validation error in OOXML export: Errors: 11 + skipValidation(); + + // export test + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:txPr/a:bodyPr"_ostr, + "wrap"_ostr, "square"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134977) +{ + loadFromFile(u"xlsx/custom_data_label.xlsx"); + + //import test + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), + uno::UNO_SET_THROW); + uno::Sequence> aFields; + float nFontSize; + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + aFields[0]->getPropertyValue("CharHeight") >>= nFontSize; + CPPUNIT_ASSERT_EQUAL(static_cast(9), nFontSize); + + // FIXME: validation error in OOXML export: Errors: 2 + skipValidation(); + + //export test + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:tx/c:rich/a:p/" + "a:r/a:rPr"_ostr, + "sz"_ostr, "900"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123647) +{ + loadFromFile(u"xlsx/empty_chart.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf136267) +{ + loadFromFile(u"xlsx/tdf136267.xlsx"); + + // FIXME: validation error in OOXML export: Errors: 2 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPathContent( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:cat/c:strRef/c:strCache/c:pt/c:v"_ostr, + "John"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataLabelPlacementPieChart) +{ + loadFromFile(u"xlsx/tdf134978.xlsx"); + saveAndReload("calc8"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + UNO_QUERY_THROW); + // test the placement of the manually positioned label + Reference xDataPointPropSet( + xChartDoc->getDiagram()->getDataPointProperties(2, 0), uno::UNO_SET_THROW); + uno::Any aAny = xDataPointPropSet->getPropertyValue("LabelPlacement"); + CPPUNIT_ASSERT(aAny.hasValue()); + sal_Int32 nLabelPlacement = 0; + CPPUNIT_ASSERT(aAny >>= nLabelPlacement); + CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::OUTSIDE, nLabelPlacement); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf137917) +{ + loadFromFile(u"xlsx/tdf137917.xlsx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:baseTimeUnit"_ostr, + "val"_ostr, "days"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:majorUnit"_ostr, "val"_ostr, + "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:majorTimeUnit"_ostr, + "val"_ostr, "months"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:minorUnit"_ostr, "val"_ostr, + "7"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:minorTimeUnit"_ostr, + "val"_ostr, "days"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf138204) +{ + loadFromFile(u"xlsx/tdf138204.xlsx"); + + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + struct CustomLabelsTestData + { + sal_Int32 nSeriesIdx; + sal_Int32 nNumFields; + // First field attributes. + chart2::DataPointCustomLabelFieldType eFieldType; + OUString aCellRange; + OUString aString; + }; + + const CustomLabelsTestData aTestEntries[2] = { + { + // series id of c:ser[1] is 0. + 0, // nSeriesIdx + 1, // nNumFields + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE, + "Munka1!$F$9", // aCellRange + "67,5%", // aString + }, + { + + // series id of c:ser[2] is 1. + 1, // nSeriesIdx + 1, // nNumFields + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE, + "Munka1!$G$9", // aCellRange + "32,3%", // aString + }, + }; + + for (const auto& aTestEntry : aTestEntries) + { + uno::Reference xDataSeries( + getDataSeriesFromDoc(xChartDoc, aTestEntry.nSeriesIdx)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference xPropertySet; + uno::Sequence> aFields; + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(aTestEntry.nNumFields, aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(aTestEntry.eFieldType, aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(aTestEntry.aCellRange, aFields[0]->getCellRange()); + CPPUNIT_ASSERT_EQUAL(aTestEntry.aString, aFields[0]->getString()); + } + + // FIXME: validation error in OOXML export: Errors: 2 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Check the first data label field type + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLbl/c:tx/c:rich/a:p/a:fld"_ostr, + "type"_ostr, "CELLRANGE"); + + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:dLbl/c:tx/c:rich/a:p/a:fld"_ostr, + "type"_ostr, "CELLRANGE"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf138181) +{ + loadFromFile(u"xlsx/piechart_deleted_legendentry.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xLegendEntry1, xLegendEntry2, xLegendEntry3; + + // first legend entry is visible + xLegendEntry1 + = getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0:LegendEntry=0"); + CPPUNIT_ASSERT(xLegendEntry1.is()); + + // second legend entry is not visible + xLegendEntry2 + = getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1:LegendEntry=0"); + CPPUNIT_ASSERT(!xLegendEntry2.is()); + + // third legend entry is visible + xLegendEntry3 + = getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2:LegendEntry=0"); + CPPUNIT_ASSERT(xLegendEntry3.is()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomShapeText) +{ + loadFromFile(u"ods/tdf72776.ods"); + saveAndReload("calc8"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + // test that the text of custom shape exists inside the chart + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xCustomShape(xDrawPage->getByIndex(1), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xCustomShape.is()); + + Reference xRange(xCustomShape, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(!xRange->getString().isEmpty()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testuserShapesXLSX) +{ + loadFromFile(u"xlsx/tdf128621.xlsx"); + saveAndReload("Calc Office Open XML"); + + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + // test that the custom shape exists + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xCustomShape(xDrawPage->getByIndex(1), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xCustomShape.is()); + // test type of shape + CPPUNIT_ASSERT(xCustomShape->getShapeType().endsWith("CustomShape")); + // test custom shape position + awt::Point aPosition = xCustomShape->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1356, aPosition.X, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(9107, aPosition.Y, 300); + // test custom shape size + awt::Size aSize = xCustomShape->getSize(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(9520, aSize.Width, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1805, aSize.Height, 300); + // test custom shape text + Reference xRange(xCustomShape, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(!xRange->getString().isEmpty()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testuserShapesDOCX) +{ + loadFromFile(u"docx/tdf143130.docx"); + saveAndReload("Office Open XML Text"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // test that the custom shape exists + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xCustomShape(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xCustomShape.is()); + // test type of shape + CPPUNIT_ASSERT(xCustomShape->getShapeType().endsWith("CustomShape")); + // test custom shape position + awt::Point aPosition = xCustomShape->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(9824, aPosition.X, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(547, aPosition.Y, 300); + // test custom shape size + awt::Size aSize = xCustomShape->getSize(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1848, aSize.Width, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1003, aSize.Height, 300); + // test custom shape text + Reference xRange(xCustomShape, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(!xRange->getString().isEmpty()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testGraphicBlipXLSX) +{ + loadFromFile(u"xlsx/tdf143127.xlsx"); + saveAndReload("Calc Office Open XML"); + + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + // test that the Graphic shape exists + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xCustomShape(xDrawPage->getByIndex(1), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xCustomShape.is()); + // test type of shape + CPPUNIT_ASSERT(xCustomShape->getShapeType().endsWith("GraphicObjectShape")); + Reference xShapeProps(xCustomShape, UNO_QUERY); + + uno::Reference xGraphic; + CPPUNIT_ASSERT(xShapeProps->getPropertyValue("Graphic") >>= xGraphic); + + Graphic aGraphic(xGraphic); + GfxLink aLink = aGraphic.GetGfxLink(); + std::size_t nDataSize = aLink.GetDataSize(); + + // test the image size is bigger then 0. + CPPUNIT_ASSERT_GREATER(size_t(0), nDataSize); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNameRangeXLSX) +{ + loadFromFile(u"xlsx/chart_with_name_range.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // test the syntax of local range name on the local sheet. + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:cat/c:strRef/c:f"_ostr, + "Sheet1!local_name_range"); + // test the syntax of a global range name. + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:val/c:numRef/c:f"_ostr, + "[0]!series1"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf143942) +{ + loadFromFile(u"xlsx/tdf143942.xlsx"); + + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + constexpr size_t nLabels = 4; + OUString aCellRange = "Sheet1!$A$2:$A$5"; + OUString aLabels[nLabels] = { + "Test1", + "Test2", + "Tes3", + "Test4", + }; + + uno::Reference xPropertySet; + uno::Sequence> aFields; + for (size_t i = 0; i < nLabels; ++i) + { + xPropertySet.set(xDataSeries->getDataPointByIndex(i), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(1), aFields.getLength()); + CPPUNIT_ASSERT_EQUAL( + chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE, + aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(aCellRange, aFields[0]->getCellRange()); + CPPUNIT_ASSERT_EQUAL(aLabels[i], aFields[0]->getString()); + } + + // FIXME: validation error in OOXML export: Errors: 4 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:extLst/c:ext"_ostr, + "uri"_ostr, "{02D57815-91ED-43cb-92C2-25804820EDAC}"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:extLst/c:ext/" + "c15:datalabelsRange/c15:dlblRangeCache/c:ptCount"_ostr, + "val"_ostr, "4"); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:extLst/c:ext/" + "c15:datalabelsRange/c15:f"_ostr, + aCellRange); + for (size_t i = 0; i < nLabels; ++i) + { + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dLbls/c:dLbl[" + + OString::number(i + 1) + "]/c:tx/c:rich/a:p/a:fld", + "type"_ostr, "CELLRANGE"); + assertXPath(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dLbls/c:dLbl[" + + OString::number(i + 1) + "]/c:extLst/c:ext/c15:showDataLabelsRange", + "val"_ostr, "1"); + // Check if the actual label is stored under c15:datalabelsRange + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:extLst/" + "c:ext/c15:datalabelsRange/c15:dlblRangeCache/c:pt[" + + OString::number(i + 1) + "]/c:v", + aLabels[i]); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDateCategoriesPPTX) +{ + loadFromFile(u"pptx/bnc889755.pptx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + constexpr size_t nCats = 16; + double aDates[nCats] = { + 41183, 41214, 41244, 41275, 41306, 41334, 41365, 41395, + 41426, 41456, 41487, 41518, 41548, 41579, 41609, 41640, + }; + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat"_ostr); + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:numRef/" + "c:numCache/c:formatCode"_ostr, + "mmm\\-yy"); + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:numRef/c:numCache/c:ptCount"_ostr, + "val"_ostr, OUString::number(nCats)); + + for (size_t i = 0; i < nCats; ++i) + { + assertXPath( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:numRef/c:numCache/c:pt[" + + OString::number(i + 1) + "]", + "idx"_ostr, OUString::number(i)); + assertXPathContent( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:numRef/c:numCache/c:pt[" + + OString::number(i + 1) + "]/c:v", + OUString::number(aDates[i])); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataTableImportExport) +{ + loadFromFile(u"xlsx/ChartDataTable.xlsx"); + { + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + auto xDiagram = xChartDoc->getFirstDiagram(); + CPPUNIT_ASSERT(xDiagram.is()); + auto xDataTable = xDiagram->getDataTable(); + CPPUNIT_ASSERT(xDataTable.is()); + uno::Reference xPropertySet(xDataTable, uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropertySet.is()); + bool bHBorder; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("HBorder") >>= bHBorder); + CPPUNIT_ASSERT_EQUAL(true, bHBorder); + bool bVBorder; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("VBorder") >>= bVBorder); + CPPUNIT_ASSERT_EQUAL(true, bVBorder); + bool bOutline; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Outline") >>= bOutline); + CPPUNIT_ASSERT_EQUAL(false, bOutline); + bool bKeys; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Keys") >>= bKeys); + CPPUNIT_ASSERT_EQUAL(false, bKeys); + } + saveAndReload("calc8"); + { + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + auto xDiagram = xChartDoc->getFirstDiagram(); + CPPUNIT_ASSERT(xDiagram.is()); + auto xDataTable = xDiagram->getDataTable(); + CPPUNIT_ASSERT(xDataTable.is()); + uno::Reference xPropertySet(xDataTable, uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropertySet.is()); + bool bHBorder; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("HBorder") >>= bHBorder); + CPPUNIT_ASSERT_EQUAL(true, bHBorder); + bool bVBorder; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("VBorder") >>= bVBorder); + CPPUNIT_ASSERT_EQUAL(true, bVBorder); + bool bOutline; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Outline") >>= bOutline); + CPPUNIT_ASSERT_EQUAL(false, bOutline); + bool bKeys; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Keys") >>= bKeys); + CPPUNIT_ASSERT_EQUAL(false, bKeys); + } +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2export3.cxx b/chart2/qa/extras/chart2export3.cxx new file mode 100644 index 0000000000..838da77191 --- /dev/null +++ b/chart2/qa/extras/chart2export3.cxx @@ -0,0 +1,767 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using uno::Reference; +using beans::XPropertySet; + +class Chart2ExportTest3 : public ChartTest +{ +public: + Chart2ExportTest3() : ChartTest("/chart2/qa/extras/data/") {} +}; + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf108107) +{ + loadFromFile(u"xlsx/tdf108107.xlsx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:idx"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, "2000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf114139) +{ + loadFromFile(u"xlsx/tdf114139.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart"_ostr, 1); + //no fill + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr"_ostr, 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:solidFill"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf64224) +{ + loadFromFile(u"ods/tdf64224.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + //no fill + assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:noFill"_ostr, 1); + assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:solidFill"_ostr, 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillDOCX) +{ + loadFromFile(u"docx/testChartTitlePropertiesColorFill.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "ff0000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillDOCX) +{ + loadFromFile(u"docx/testChartTitlePropertiesGradientFill.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr"_ostr, "val"_ostr, "cccccc"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr"_ostr, "val"_ostr, "666666"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillDOCX) +{ + loadFromFile(u"docx/testChartTitlePropertiesBitmapFill.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip"_ostr, "embed"_ostr, "rId1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyDOCX) +{ + // Test color gradient (two color) with gradient transparency + loadFromFile(u"docx/testColorGradientWithTransparency.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Test the transparency 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]/a:srgbClr/a:alpha"_ostr, "val"_ostr, "60000"); + // Test the transparency 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]/a:srgbClr/a:alpha"_ostr, "val"_ostr, "90000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyODS) +{ + // Test color gradient (two color) with simple transparency + loadFromFile(u"ods/testColorGradientWithTransparency.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Test the transparency 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]/a:srgbClr/a:alpha"_ostr, "val"_ostr, "60000"); + // Test the transparency 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]/a:srgbClr/a:alpha"_ostr, "val"_ostr, "60000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientStopXLSX) +{ + // Test color gradient (two color) stop of the first color + loadFromFile(u"xlsx/tdf128619.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.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]"_ostr, "pos"_ostr, "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]"_ostr, "pos"_ostr, "100000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRadialColorGradientDOCX) +{ + loadFromFile(u"docx/tdf128794.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Test the gradient 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"_ostr, 0); + // Test the linear gradient angle + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:lin"_ostr, "ang"_ostr, "13500000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropDOCX) +{ + loadFromFile(u"docx/testBarChartDataPointPropDOCX.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors"_ostr, "val"_ostr, "0"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:idx"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr"_ostr, "val"_ostr, "f6f8fc"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr"_ostr, "val"_ostr, "c7d5ed"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "70ad47"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx"_ostr, "val"_ostr, "2"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "ff0000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "000000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFdo83058dlblPos) +{ + loadFromFile(u"docx/fdo83058_dlblPos.docx"); + + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[2]/c:dLblPos"_ostr, "val"_ostr, "outEnd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[3]/c:dLblPos"_ostr, "val"_ostr, "outEnd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[4]/c:dLblPos"_ostr, "val"_ostr, "outEnd"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[5]/c:dLblPos"_ostr, "val"_ostr, "outEnd"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDelXLSX) +{ + loadFromFile(u"xlsx/autotitledel_2007.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDispBlanksAsXLSX) +{ + loadFromFile(u"xlsx/dispBlanksAs_2007.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs"_ostr, "val"_ostr, "gap"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMarkerColorXLSX) +{ + loadFromFile(u"xlsx/markerColor.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:marker/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "92d050"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRoundedCornersXLSX) +{ + loadFromFile(u"xlsx/markerColor.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:roundedCorners"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisNumberFormatXLSX) +{ + loadFromFile(u"ods/axis_number_format.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx"_ostr, 2); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:numFmt"_ostr, "formatCode"_ostr, "0.00E+000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:numFmt"_ostr, "sourceLinked"_ostr, "0"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:numFmt"_ostr, "formatCode"_ostr, "[$$-409]#,##0;\\-[$$-409]#,##0"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:numFmt"_ostr, "sourceLinked"_ostr, "1"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataPointLabelNumberFormatXLSX) +{ + // FIXME: validation error in OOXML export: Errors: 1 + skipValidation(); + + loadFromFile(u"ods/tdf123774.ods"); + { + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt"_ostr, "formatCode"_ostr, "[$-40E]0.00%"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt"_ostr, "sourceLinked"_ostr, "0"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt"_ostr, "formatCode"_ostr, "[$-40E]0.00%"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt"_ostr, "sourceLinked"_ostr, "0"); + } + + loadFromFile(u"xlsx/tdf130986.xlsx"); + { + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:idx"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:numFmt"_ostr, "formatCode"_ostr, "0.00E+00"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:numFmt"_ostr, "sourceLinked"_ostr, "0"); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelDefaultValuesXLSX) +{ + loadFromFile(u"xlsx/data_label.xlsx"); + Reference< chart2::XChartDocument> xDoc = getChartDocFromSheet(0, mxComponent); + Reference xSeries = getDataSeriesFromDoc(xDoc, 0); + Reference xPropSet(xSeries, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("Label"); + chart2::DataPointLabel aLabel; + CPPUNIT_ASSERT(aAny >>= aLabel); + CPPUNIT_ASSERT(aLabel.ShowNumber); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:showVal"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLblPos"_ostr, "val"_ostr, "outEnd"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelFillColor) +{ + loadFromFile(u"xlsx/data_labels_fill_color.xlsx"); + Reference< chart2::XChartDocument> xDoc = getChartDocFromSheet(0, mxComponent); + Reference xSeries = getDataSeriesFromDoc(xDoc, 0); + Reference xPropSet(xSeries, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("LabelFillColor"); + sal_Int32 nLabelFillColor; + CPPUNIT_ASSERT(aAny >>= nLabelFillColor); + + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "F79646"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleOverlayXLSX) +{ + loadFromFile(u"xlsx/chart_title.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:overlay"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testInvertIfNegativeXLSX) +{ + loadFromFile(u"xlsx/bar_chart_simple.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBubble3DXLSX) +{ + loadFromFile(u"xlsx/bubble_chart_simple.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[1]/c:bubble3D"_ostr, "val"_ostr, "0"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[2]/c:bubble3D"_ostr, "val"_ostr, "0"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[3]/c:bubble3D"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testNoMarkerXLSX) +{ + loadFromFile(u"xlsx/no_marker.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:marker/c:symbol"_ostr, "val"_ostr, "none"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:marker/c:symbol"_ostr, "val"_ostr, "none"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:marker"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleManualLayoutXLSX) +{ + loadFromFile(u"xlsx/title_manual_layout.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:layoutTarget"_ostr, 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:xMode"_ostr, "val"_ostr, "edge"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:yMode"_ostr, "val"_ostr, "edge"); + + OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:x"_ostr, "val"_ostr); + double nX = aXVal.toDouble(); + CPPUNIT_ASSERT(nX > 0); + CPPUNIT_ASSERT(nX < 1); + + OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:y"_ostr, "val"_ostr); + double nY = aYVal.toDouble(); + CPPUNIT_ASSERT(nY > 0); + CPPUNIT_ASSERT(nY < 1); + CPPUNIT_ASSERT(nX != nY); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:bodyPr"_ostr, "rot"_ostr, "1200000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotAreaManualLayoutXLSX) +{ + loadFromFile(u"xlsx/plot_area_manual_layout.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget"_ostr, "val"_ostr, "inner"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:xMode"_ostr, "val"_ostr, "edge"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:yMode"_ostr, "val"_ostr, "edge"); + + OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:x"_ostr, "val"_ostr); + double nX = aXVal.toDouble(); + CPPUNIT_ASSERT(nX > 0); + CPPUNIT_ASSERT(nX < 1); + + OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:y"_ostr, "val"_ostr); + double nY = aYVal.toDouble(); + CPPUNIT_ASSERT(nY > 0); + CPPUNIT_ASSERT(nY < 1); + CPPUNIT_ASSERT(nX != nY); + + OUString aWVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:w"_ostr, "val"_ostr); + double nW = aWVal.toDouble(); + CPPUNIT_ASSERT(nW > 0); + CPPUNIT_ASSERT(nW < 1); + + OUString aHVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:h"_ostr, "val"_ostr); + double nH = aHVal.toDouble(); + CPPUNIT_ASSERT(nH > 0); + CPPUNIT_ASSERT(nH < 1); + CPPUNIT_ASSERT(nH != nW); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testLegendManualLayoutXLSX) +{ + loadFromFile(u"xlsx/legend_manual_layout.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget"_ostr, 0); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:xMode"_ostr, "val"_ostr, "edge"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:yMode"_ostr, "val"_ostr, "edge"); + + OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:x"_ostr, "val"_ostr); + double nX = aXVal.toDouble(); + CPPUNIT_ASSERT(nX > 0); + CPPUNIT_ASSERT(nX < 1); + + OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:y"_ostr, "val"_ostr); + double nY = aYVal.toDouble(); + CPPUNIT_ASSERT(nY > 0); + CPPUNIT_ASSERT(nY < 1); + CPPUNIT_ASSERT(nX != nY); + + OUString aWVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:w"_ostr, "val"_ostr); + double nW = aWVal.toDouble(); + CPPUNIT_ASSERT(nW > 0); + CPPUNIT_ASSERT(nW < 1); + + OUString aHVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:h"_ostr, "val"_ostr); + double nH = aHVal.toDouble(); + CPPUNIT_ASSERT(nH > 0); + CPPUNIT_ASSERT(nH < 1); + CPPUNIT_ASSERT(nH != nW); + + // Make sure that default text font size is preserved after export + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, "900"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartSubTitle) +{ + loadFromFile(u"ods/testChartSubTitle.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // test properties of subtitle + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, "1100"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "00a933"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:latin"_ostr, "typeface"_ostr, "Times New Roman"); + assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:t"_ostr, "It is a Subtitle"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "b2b2b2"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartMainWithSubTitle) +{ + loadFromFile(u"ods/testChartMainWithSubTitle.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // test properties of title + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, "1300"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, "0"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "i"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "f10d0c"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:latin"_ostr, "typeface"_ostr, "Arial"); + assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:t"_ostr, "It is a Maintitle\nIt is a Subtitle"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "81d41a"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDeleted) +{ + loadFromFile(u"xlsx/testAutoTitleDeleted.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted"_ostr, "val"_ostr, "1"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillXLSX) +{ + loadFromFile(u"xlsx/testChartTitlePropertiesColorFill.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "ff0000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillXLSX) +{ + loadFromFile(u"xlsx/testChartTitlePropertiesGradientFill.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr"_ostr, "val"_ostr, "cccccc"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr"_ostr, "val"_ostr, "666666"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillXLSX) +{ + loadFromFile(u"xlsx/testChartTitlePropertiesBitmapFill.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip"_ostr, "embed"_ostr, "rId1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropXLSX) +{ + loadFromFile(u"xlsx/testBarChartDataPointPropXLSX.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors"_ostr, "val"_ostr, "0"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:idx"_ostr, "val"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "ff0000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "000000"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx"_ostr, "val"_ostr, "2"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr"_ostr, "val"_ostr, "f6f8fc"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr"_ostr, "val"_ostr, "c7d5ed"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "70ad47"); +} + +namespace { + +void checkGapWidth(Reference const & xPropSet, sal_Int32 nValue) +{ + uno::Any aAny = xPropSet->getPropertyValue("GapwidthSequence"); + CPPUNIT_ASSERT(aAny.hasValue()); + uno::Sequence< sal_Int32 > aSequence; + aAny >>= aSequence; + CPPUNIT_ASSERT(aSequence.hasElements()); + CPPUNIT_ASSERT_EQUAL(nValue, aSequence[0]); +} + +void checkOverlap(Reference const & xPropSet, sal_Int32 nValue) +{ + uno::Any aAny = xPropSet->getPropertyValue("OverlapSequence"); + CPPUNIT_ASSERT(aAny.hasValue()); + uno::Sequence< sal_Int32 > aSequence; + aAny >>= aSequence; + CPPUNIT_ASSERT(aSequence.hasElements()); + CPPUNIT_ASSERT_EQUAL(nValue, aSequence[0]); +} + +void checkSheetForGapWidthAndOverlap(uno::Reference< chart2::XChartDocument > const & xChartDoc, + sal_Int32 nExpectedGapWidth, sal_Int32 nExpectedOverlap) +{ + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT(xChartType.is()); + + Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW ); + checkGapWidth(xPropSet, nExpectedGapWidth); + checkOverlap(xPropSet, nExpectedOverlap); + +} + +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataseriesOverlapStackedChartXLSX) +{ + loadFromFile(u"xlsx/testDataseriesOverlapStackedChart.xlsx"); + + // test the overlap value of a simple Stacked Column Chart + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + checkSheetForGapWidthAndOverlap(xChartDoc, 100, 0); + + // test the overlap value of a Percent Stacked Bar Chart + xChartDoc = getChartDocFromSheet( 1, mxComponent ); + checkSheetForGapWidthAndOverlap(xChartDoc, 100, 35); + + saveAndReload("Calc Office Open XML"); + + xChartDoc = getChartDocFromSheet( 0, mxComponent ); + checkSheetForGapWidthAndOverlap(xChartDoc, 100, 100); + + xChartDoc = getChartDocFromSheet( 1, mxComponent ); + checkSheetForGapWidthAndOverlap(xChartDoc, 100, 100); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX) +{ + loadFromFile(u"xlsx/axis_character_properties.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, "1000"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "i"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "u"_ostr, "sng"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, "900"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, "1"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr"_ostr, "strike"_ostr, "sngStrike"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "ff0000"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleCharacterPropertiesXLSX) +{ + loadFromFile(u"xlsx/title_character_properties.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, "2400"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, "1"); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr"_ostr, "sz"_ostr, "2400"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr"_ostr, "b"_ostr, "1"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotVisOnlyXLSX) +{ + loadFromFile(u"xlsx/hidden_cells.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotVisOnly"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartVaryColorsXLSX) +{ + loadFromFile(u"xlsx/tdf90876.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf96161) +{ + loadFromFile(u"ods/tdf96161.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:varyColors"_ostr, "val"_ostr, "0"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTableOnPage3) +{ + loadFromFile(u"docx/TableOnPage3.docx"); + + // FIXME: validation error in OOXML export: Errors: 2 + skipValidation(); + + saveAndReload("Office Open XML Text"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference< chart::XChartDataArray > xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW); + Sequence aColumnDesc = xDataArray->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", static_cast(4), aColumnDesc.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("If oversubscription relative to allowance increases at the same average rate B15-B17"), aColumnDesc[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Known requirements"), aColumnDesc[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Allowance"), aColumnDesc[2]); + CPPUNIT_ASSERT_EQUAL(OUString("If oversubscription relative to allowance holds steady at average oversubscription level B15-B17"), aColumnDesc[3]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, tdf137691) +{ + // given a doc where the banana negative data formats as ($123) and the pineapple data as $(123) + loadFromFile(u"pptx/tdf137691_dataTable.pptx"); + saveAndReload("Impress MS PowerPoint 2007 XML"); + + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + + Reference< chart2::data::XDataSequence > xDataSeq; + xDataSeq.set(getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)); + const sal_Int32 nKey_bananas = xDataSeq->getNumberFormatKeyByIndex(-1); + // This should not be General format (0), but a defined format (129) + CPPUNIT_ASSERT(nKey_bananas); + + xDataSeq.set(getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)); + const sal_Int32 nKey_pineapples = xDataSeq->getNumberFormatKeyByIndex(-1); + // This should not be General format (0), but a defined format (130) + CPPUNIT_ASSERT(nKey_pineapples); + CPPUNIT_ASSERT(nKey_pineapples != nKey_bananas); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMultipleAxisXLSX) +{ + loadFromFile(u"ods/multiple_axis.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart"_ostr, 2); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart[1]/c:ser"_ostr, 1); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart[2]/c:ser"_ostr, 1); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx"_ostr, 4); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:delete[@val='1']"_ostr, 1); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:axPos[@val='l']"_ostr, 1); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:axPos[@val='r']"_ostr, 1); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testSecondaryAxisXLSX) +{ + loadFromFile(u"ods/secondary_axis.ods"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart"_ostr, 2); + // test there is just those series in the first tag which are attached to the primary axis + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[1]/c:ser"_ostr, 2); + assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[1]/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v"_ostr, "b"); + assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[1]/c:ser[2]/c:tx/c:strRef/c:strCache/c:pt/c:v"_ostr, "c"); + // test there is just those series in the second tag which are attached to the secondary axis + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[2]/c:ser"_ostr, 1); + assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[2]/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v"_ostr, "a"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartSecondaryAxisXLSX) +{ + loadFromFile(u"xlsx/testSecondaryAxis.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + // Collect barchart axID on primary Axis + OUString XValueIdOf1Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[1]/c:axId[1]"_ostr, "val"_ostr); + OUString YValueIdOf1Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[1]/c:axId[2]"_ostr, "val"_ostr); + // Collect barchart axID on secondary Axis + OUString XValueIdOf2Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[2]/c:axId[1]"_ostr, "val"_ostr); + OUString YValueIdOf2Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[2]/c:axId[2]"_ostr, "val"_ostr); + // Check which c:catAx and c:valAx contain the AxisId of barcharts + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[1]/c:axId"_ostr, "val"_ostr, XValueIdOf1Barchart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:axId"_ostr, "val"_ostr, YValueIdOf1Barchart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[2]/c:axId"_ostr, "val"_ostr, XValueIdOf2Barchart); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:axId"_ostr, "val"_ostr, YValueIdOf2Barchart); +} + +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf148142) +{ + // The document contains a line chart with "Between tick marks" X axis position. + loadFromFile(u"ods/tdf148142.ods"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + chart2::ScaleData aScaleData = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition); + + // Set the X axis position to "On tick marks". + aScaleData.ShiftedCategoryPosition = false; + xAxis->setScaleData(aScaleData); + + // Check the X axis position after export. + saveAndReload("calc8"); + Reference xChartDoc2 = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc2.is()); + Reference xAxis2 = getAxisFromDoc(xChartDoc2, 0, 0, 0); + CPPUNIT_ASSERT(xAxis2.is()); + chart2::ScaleData aScaleData2 = xAxis2->getScaleData(); + CPPUNIT_ASSERT(!aScaleData2.ShiftedCategoryPosition); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2geometry.cxx b/chart2/qa/extras/chart2geometry.cxx new file mode 100644 index 0000000000..c7de713df1 --- /dev/null +++ b/chart2/qa/extras/chart2geometry.cxx @@ -0,0 +1,493 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" + +#include + +#include +#include +#include +#include + +#include + +#include + +using uno::Reference; +using beans::XPropertySet; + +class Chart2GeometryTest : public ChartTest +{ +public: + Chart2GeometryTest() + : ChartTest("/chart2/qa/extras/data/") + { + } + // Mostly tests for line and fill properties + void testTdf135184RoundLineCap(); + void testTdf135184RoundLineCap2(); + void testTdf135184RoundLineCap3(); + void testTdf135184RoundLineCap4(); + void testTdf128345ChartArea_CG_TS_export(); + void testTdf128345ChartArea_CG_TS_import(); + void testTdf128345ChartWall_CS_TG_export(); + void testTdf128345ChartWall_CS_TG_import(); + void testTdf128345Legend_CS_TG_axial_export(); + void testTdf128345Legend_CS_TG_axial_import(); + void testTdf135366LabelOnSeries(); + void testTdf135366LabelOnPoint(); + void testTdf135366LabelExport(); + void testTdf135366_CustomLabelText(); + + CPPUNIT_TEST_SUITE(Chart2GeometryTest); + CPPUNIT_TEST(testTdf135184RoundLineCap); + CPPUNIT_TEST(testTdf135184RoundLineCap2); + CPPUNIT_TEST(testTdf135184RoundLineCap3); + CPPUNIT_TEST(testTdf135184RoundLineCap4); + CPPUNIT_TEST(testTdf128345ChartArea_CG_TS_export); + CPPUNIT_TEST(testTdf128345ChartArea_CG_TS_import); + CPPUNIT_TEST(testTdf128345ChartWall_CS_TG_export); + CPPUNIT_TEST(testTdf128345ChartWall_CS_TG_import); + CPPUNIT_TEST(testTdf128345Legend_CS_TG_axial_export); + CPPUNIT_TEST(testTdf128345Legend_CS_TG_axial_import); + CPPUNIT_TEST(testTdf135366LabelOnSeries); + CPPUNIT_TEST(testTdf135366LabelOnPoint); + CPPUNIT_TEST(testTdf135366LabelExport); + CPPUNIT_TEST(testTdf135366_CustomLabelText); + + CPPUNIT_TEST_SUITE_END(); +}; + +static OString OU2O(std::u16string_view sOUSource) +{ + return rtl::OUStringToOString(sOUSource, RTL_TEXTENCODING_UTF8); +} + +// Without the patch for tdf#135184, charts were not able to use linecap at all. +// These two tests verify, that round linecaps in the xlsx file are saved in ods. +void Chart2GeometryTest::testTdf135184RoundLineCap() +{ + // It tests chart area, data series line and regression-curve line. + loadFromFile(u"xlsx/tdf135184RoundLineCap.xlsx"); + save("calc8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + static constexpr OString sStyleStart("/office:document-content/office:automatic-styles"_ostr); + static constexpr OString sCap("/style:graphic-properties[@svg:stroke-linecap='round']"_ostr); + static constexpr OString sChartStart( + "/office:document-content/office:body/office:chart/chart:chart"_ostr); + OString sPredicate; + // chart area + const OUString sOUAreaStyleName = getXPathContent(pXmlDoc, sChartStart + "/@chart:style-name"); + sPredicate = "[@style:name='" + OU2O(sOUAreaStyleName) + "']"; + assertXPath(pXmlDoc, sStyleStart + "/style:style" + sPredicate + sCap); + // data series line + const OString sSeries(sChartStart + "/chart:plot-area/chart:series"); + const OUString sOUSeriesStyleName = getXPathContent(pXmlDoc, sSeries + "/@chart:style-name"); + sPredicate = "[@style:name='" + OU2O(sOUSeriesStyleName) + "']"; + assertXPath(pXmlDoc, sStyleStart + "/style:style" + sPredicate + sCap); + // regression-curve (trend line) + const OString sTrend(sChartStart + "/chart:plot-area/chart:series/chart:regression-curve"); + const OUString sOUTrendStyleName = getXPathContent(pXmlDoc, sTrend + "/@chart:style-name"); + sPredicate = "[@style:name='" + OU2O(sOUTrendStyleName) + "']"; + assertXPath(pXmlDoc, sStyleStart + "/style:style" + sPredicate + sCap); +} + +void Chart2GeometryTest::testTdf135184RoundLineCap2() +{ + // It tests legend, data series sector and title. + loadFromFile(u"xlsx/tdf135184RoundLineCap2.xlsx"); + save("calc8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + static constexpr OString sStyleStart("/office:document-content/office:automatic-styles"_ostr); + static constexpr OString sCap("/style:graphic-properties[@svg:stroke-linecap='round']"_ostr); + static constexpr OString sChartStart( + "/office:document-content/office:body/office:chart/chart:chart"_ostr); + OString sPredicate; + // legend + const OString sLegend(sChartStart + "/chart:legend"); + const OUString sOULegendStyleName = getXPathContent(pXmlDoc, sLegend + "/@chart:style-name"); + sPredicate = "[@style:name='" + OU2O(sOULegendStyleName) + "']"; + assertXPath(pXmlDoc, sStyleStart + "/style:style" + sPredicate + sCap); + // title + const OString sTitle(sChartStart + "/chart:title"); + const OUString sOUTitleStyleName = getXPathContent(pXmlDoc, sTitle + "/@chart:style-name"); + sPredicate = "[@style:name='" + OU2O(sOUTitleStyleName) + "']"; + assertXPath(pXmlDoc, sStyleStart + "/style:style" + sPredicate + sCap); + // sector + const OString sSector(sChartStart + "/chart:plot-area/chart:series/chart:data-point[3]"); + const OUString sOUSectorStyleName = getXPathContent(pXmlDoc, sSector + "/@chart:style-name"); + sPredicate = "[@style:name='" + OU2O(sOUSectorStyleName) + "']"; + assertXPath(pXmlDoc, sStyleStart + "/style:style" + sPredicate + sCap); +} + +// These two tests verify the round-trip of preset dash styles in the xlsx file. +void Chart2GeometryTest::testTdf135184RoundLineCap3() +{ + // It tests chart area, data series line and regression-curve line. + loadFromFile(u"xlsx/tdf135184RoundLineCap.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + static constexpr OString sDash("/c:spPr/a:ln/a:prstDash"_ostr); + // chart area + assertXPath(pXmlDoc, "/c:chartSpace" + sDash, "val"_ostr, "dashDot"); + // data series line + static constexpr OString sStart("/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser"_ostr); + assertXPath(pXmlDoc, sStart + sDash, "val"_ostr, "dash"); + // regression-curve (trendline) + assertXPath(pXmlDoc, sStart + "/c:trendline" + sDash, "val"_ostr, "sysDot"); +} + +void Chart2GeometryTest::testTdf135184RoundLineCap4() +{ + // It tests legend, data series sector and title. + loadFromFile(u"xlsx/tdf135184RoundLineCap2.xlsx"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + static constexpr OString sChartStart("/c:chartSpace/c:chart"_ostr); + static constexpr OString sDash("/c:spPr/a:ln/a:prstDash"_ostr); + assertXPath(pXmlDoc, sChartStart + "/c:legend" + sDash, "val"_ostr, "sysDot"); + const OString sSeries(sChartStart + "/c:plotArea/c:pieChart/c:ser/c:dPt[3]"); + assertXPath(pXmlDoc, sSeries + sDash, "val"_ostr, "dash"); + assertXPath(pXmlDoc, sChartStart + "/c:title" + sDash, "val"_ostr, "dashDot"); +} + +void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_export() +{ + // chart area with color gradient and solid transparency + // Without the patch the transparency was lost in saved pptx file. + loadFromFile(u"odp/tdf128345_ChartArea_CG_TS.odp"); + + // MCGR: Similar to testTdf128345Legend_CS_TG_axial_export: + // Checked that it works with the existing import file, + // but will change with ODF MCGR im/export again. + // Adapting for now, but need to re-check values after + // ODF im/export for MCGR is integrated + + // Make sure the chart area has a transparency in gradient stops in saved pptx file. + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + OString sPathStart("//c:chartSpace/c:spPr/a:gradFill"_ostr); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val"_ostr, "30000"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val"_ostr, "30000"); +} + +void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import() +{ + // This works on the file, which was exported from file tdf128345_ChartArea_CG_TS.odp to pptx. + // It has gradient stops with identical transparency values. + // Make sure chart area has transparency when pptx document is opened and resaved as odp. + // As of Aug 2020, the import generates a transparency gradient. When import is changed to + // generate solid transparency, the test needs to be adapted. + + // MCGR: Similar to testTdf128345Legend_CS_TG_axial_export: + // Checked that it works with the existing import file, + // but will change with ODF MCGR im/export again. We will need to + // update the *.odp input file. Disable unclear values for now and + // adapt when ODF im/export for MCGR is integrated + loadFromFile(u"pptx/tdf128345_ChartArea_CG_TS.pptx"); + + // Find transparency gradient name + save("impress8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); + CPPUNIT_ASSERT(pXmlDoc); + const OUString sOUChartStyleName = getXPathContent( + pXmlDoc, + "//office:document-content/office:body/office:chart/chart:chart/@chart:style-name"_ostr); + const OString sStylePath( + "//office:document-content/office:automatic-styles/style:style[@style:name='" + + OU2O(sOUChartStyleName) + "']"); + assertXPath(pXmlDoc, sStylePath, 1); + assertXPath(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name", 1); + const OUString sOUOpacityName + = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); + + // Verify the content of the opacity definition + save("impress8"); + xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml"); + CPPUNIT_ASSERT(pXmlDoc2); + const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); + const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute); + assertXPath(pXmlDoc2, sStart + "]", 1); + assertXPath(pXmlDoc2, sStart + " and @draw:style='linear']"); + assertXPath(pXmlDoc2, sStart + " and @draw:start='30%']"); + assertXPath(pXmlDoc2, sStart + " and @draw:end='30%']"); + assertXPath(pXmlDoc2, sStart + " and @draw:angle='30deg']"); + assertXPath(pXmlDoc2, sStart + " and @draw:border='0%']"); // MCGR: no border anymore 20% -> 0% +} + +void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_export() +{ + // chart wall with solid color and transparency gradient + // Without the patch the transparency was lost. + loadFromFile(u"odp/tdf128345_ChartWall_CS_TG.odp"); + + // Make sure the chart has a gradient with transparency in gradient stops in saved pptx file. + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + OString sPathStart("//c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill"_ostr); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2); //linear + // MS Office has opacity, so 100% transparency is val="0" + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val"_ostr, "0"); + // no element for 0% transparent + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", 0); +} + +void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_import() +{ + // This works on the file, which was exported from file tdf128345_ChartWall_CS_TG.odp to pptx. + // Make sure chart wall has transparency when pptx document is resaved as odp. + loadFromFile(u"pptx/tdf128345_ChartWall_CS_TG.pptx"); + + // Find transparency gradient name + save("impress8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); + CPPUNIT_ASSERT(pXmlDoc); + const OUString sOUChartStyleName + = getXPathContent(pXmlDoc, "//office:document-content/office:body/office:chart/chart:chart/" + "chart:plot-area/chart:wall/@chart:style-name"_ostr); + const OString sStylePath( + "//office:document-content/office:automatic-styles/style:style[@style:name='" + + OU2O(sOUChartStyleName) + "']"); + assertXPath(pXmlDoc, sStylePath, 1); + assertXPath(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name", 1); + const OUString sOUOpacityName + = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); + + // Verify content of the opacity definition + save("impress8"); + xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml"); + CPPUNIT_ASSERT(pXmlDoc2); + const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); + const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute); + assertXPath(pXmlDoc2, sStart + "]", 1); + assertXPath(pXmlDoc2, sStart + " and @draw:style='linear']"); + assertXPath(pXmlDoc2, sStart + " and @draw:start='0%']"); + assertXPath(pXmlDoc2, sStart + " and @draw:end='100%']"); +} + +void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_export() +{ + // legend with solid color and transparency gradient + // Without the patch the transparency was lost. + loadFromFile(u"odp/tdf128345_Legend_CS_TG_axial.odp"); + + // Make sure the chart has a gradient with transparency in gradient stops in saved pptx file. + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + OString sPathStart("//c:chartSpace/c:chart/c:legend/c:spPr/a:gradFill"_ostr); + + // MCGR: three entries due to axial being mirrored+expanded to linear + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 3); + + // MCGR: start entry, no transparence, pos zero + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", 0); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]", "pos"_ostr, "0"); + + // MCGR: middle entry, 100% transparence, pos 0.5 + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val"_ostr, "0"); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]", "pos"_ostr, "50000"); + + // MCGR: end entry, no transparence, pos 1.0 + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[3]/a:srgbClr/a:alpha", 0); + assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[3]", "pos"_ostr, "100000"); +} + +void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import() +{ + // This works on the file, which was exported from file tdf128345_Legend_CS_TG_axial.odp to pptx. + // Error was, that in case of axial not the middle value was taken but start and end value. + loadFromFile(u"pptx/tdf128345_Legend_CS_TG_axial.pptx"); + + // Find transparency gradient name + save("impress8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); + CPPUNIT_ASSERT(pXmlDoc); + const OUString sOUChartStyleName + = getXPathContent(pXmlDoc, "//office:document-content/office:body/office:chart/chart:chart/" + "chart:legend/@chart:style-name"_ostr); + const OString sStylePath( + "//office:document-content/office:automatic-styles/style:style[@style:name='" + + OU2O(sOUChartStyleName) + "']"); + assertXPath(pXmlDoc, sStylePath, 1); + assertXPath(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name", 1); + const OUString sOUOpacityName + = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); + + // Verify content of the opacity definition + save("impress8"); + xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml"); + CPPUNIT_ASSERT(pXmlDoc2); + const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); + const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute); + assertXPath(pXmlDoc2, sStart + "]", 1); + assertXPath(pXmlDoc2, sStart + " and @draw:style='axial']"); + assertXPath(pXmlDoc2, sStart + " and @draw:start='0%']"); + assertXPath(pXmlDoc2, sStart + " and @draw:end='100%']"); +} + +void Chart2GeometryTest::testTdf135366LabelOnSeries() +{ + // Error was, that the fill and line properties of a were not + // imported at all. Here they should be at the series. + loadFromFile(u"ods/tdf135366_data_label_series.ods"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropSet(xDataSeries, UNO_QUERY_THROW); + uno::Any aAny; + + aAny = xPropSet->getPropertyValue("LabelBorderStyle"); + drawing::LineStyle eLineStyle; + CPPUNIT_ASSERT_MESSAGE("No LabelBorderStyle set.", aAny >>= eLineStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("solid line expected", drawing::LineStyle_SOLID, eLineStyle); + + sal_Int32 nBorderWidth; + sal_Int32 nExpectedWidth = 95; + xPropSet->getPropertyValue("LabelBorderWidth") >>= nBorderWidth; + CPPUNIT_ASSERT_EQUAL_MESSAGE("LabelBorderWidth", nExpectedWidth, nBorderWidth); + + sal_Int32 nLineColor; + sal_Int32 nExpectedLineColor = 255; + xPropSet->getPropertyValue("LabelBorderColor") >>= nLineColor; + CPPUNIT_ASSERT_EQUAL_MESSAGE("line color blue, 255=#0000FF", nExpectedLineColor, nLineColor); + + aAny = xPropSet->getPropertyValue("LabelFillStyle"); + drawing::FillStyle eFillStyle; + CPPUNIT_ASSERT_MESSAGE("No LabelFillStyle set", aAny >>= eFillStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("solid fill expected", drawing::FillStyle_SOLID, eFillStyle); + + sal_Int32 nFillColor; + sal_Int32 nExpectedFillColor = 65280; + xPropSet->getPropertyValue("LabelFillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL_MESSAGE("fill color green, 65280=#00FF00", nExpectedFillColor, nFillColor); +} + +void Chart2GeometryTest::testTdf135366LabelOnPoint() +{ + // Error was, that the fill and line properties of a were not + // imported at all. Here they should be at point 2. + loadFromFile(u"odt/tdf135366_data_label_point.odt"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropSet(xDataSeries->getDataPointByIndex(2), + uno::UNO_SET_THROW); + uno::Any aAny; + + aAny = xPropSet->getPropertyValue("LabelBorderStyle"); + drawing::LineStyle eLineStyle; + CPPUNIT_ASSERT_MESSAGE("No LabelBorderStyle set.", aAny >>= eLineStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("solid line expected", drawing::LineStyle_SOLID, eLineStyle); + + sal_Int32 nBorderWidth; + sal_Int32 nExpectedWidth = 381; + xPropSet->getPropertyValue("LabelBorderWidth") >>= nBorderWidth; + CPPUNIT_ASSERT_EQUAL_MESSAGE("LabelBorderWidth", nExpectedWidth, nBorderWidth); + + sal_Int32 nLineTransparency; + sal_Int32 nExpectedTransparency = 30; + xPropSet->getPropertyValue("LabelBorderTransparency") >>= nLineTransparency; + CPPUNIT_ASSERT_EQUAL_MESSAGE("line transparency", nExpectedTransparency, nLineTransparency); + + sal_Int32 nLineColor; + sal_Int32 nExpectedLineColor = 10206041; + xPropSet->getPropertyValue("LabelBorderColor") >>= nLineColor; + CPPUNIT_ASSERT_EQUAL_MESSAGE("line color greenish, 10206041=#9BBB59", nExpectedLineColor, + nLineColor); + + aAny = xPropSet->getPropertyValue("LabelFillStyle"); + drawing::FillStyle eFillStyle; + CPPUNIT_ASSERT_MESSAGE("No LabelFillStyle set", aAny >>= eFillStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("solid fill expected", drawing::FillStyle_SOLID, eFillStyle); + + sal_Int32 nFillColor; + sal_Int32 nExpectedFillColor = 14277081; + xPropSet->getPropertyValue("LabelFillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL_MESSAGE("fill color gray, 14277081=#d9d9d9", nExpectedFillColor, + nFillColor); +} + +void Chart2GeometryTest::testTdf135366LabelExport() +{ + // Error was, that line and fill properties were not exported as + // graphic-properties of a element, but only + // as loext chart-properties of the element. + loadFromFile(u"odt/tdf135366_data_label_export.odt"); + + // FIXME: Error: unexpected attribute "loext:label-stroke-color" + skipValidation(); + + save("writer8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Find label style + const OUString sOULabelStyleName = getXPathContent( + pXmlDoc, "//office:document-content/office:body/office:chart/chart:chart/chart:plot-area" + "/chart:series/chart:data-point[1]/chart:data-label/@chart:style-name"_ostr); + + // Verify content of graphic properties of label style + const OString sStylePath( + "//office:document-content/office:automatic-styles/style:style[@style:name='" + + OU2O(sOULabelStyleName) + "']/style:graphic-properties"); + assertXPath(pXmlDoc, sStylePath, 1); + assertXPath(pXmlDoc, sStylePath + "[@draw:fill='solid']"); + assertXPath(pXmlDoc, sStylePath + "[@draw:fill-color='#5050a0']"); + assertXPath(pXmlDoc, sStylePath + "[@draw:stroke='solid']"); + assertXPath(pXmlDoc, sStylePath + "[@svg:stroke-width='0.254cm']"); + assertXPath(pXmlDoc, sStylePath + "[@svg:stroke-color='#00ffff']"); +} + +void Chart2GeometryTest::testTdf135366_CustomLabelText() +{ + // Error was, that custom text in a data label was only exported in ODF extended, + // although the used element exists since ODF 1.2. + const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion(GetODFDefaultVersion()); + SetODFDefaultVersion(SvtSaveOptions::ODFVER_012); + loadFromFile(u"pptx/tdf135366_CustomLabelText.pptx"); + save("impress8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); + CPPUNIT_ASSERT(pXmlDoc); + + // Find custom text. As of version 7.0 it is in a element. + static constexpr OString sCustomTextPath( + "//office:document-content/office:body/office:chart/chart:chart/chart:plot-area" + "/chart:series/chart:data-point[2]/chart:data-label/text:p/text:span"_ostr); + assertXPath(pXmlDoc, sCustomTextPath, 1); + + // Verify text content + const OUString sOUTextContent = getXPathContent(pXmlDoc, sCustomTextPath); + CPPUNIT_ASSERT_EQUAL(OUString("Custom"), sOUTextContent); + + SetODFDefaultVersion(nCurrentODFVersion); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Chart2GeometryTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx new file mode 100644 index 0000000000..f7324c9475 --- /dev/null +++ b/chart2/qa/extras/chart2import.cxx @@ -0,0 +1,2242 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +class Chart2ImportTest : public ChartTest +{ +public: + Chart2ImportTest() : ChartTest("/chart2/qa/extras/data/") {} + +protected: + void testTransparentBackground(std::u16string_view filename); +}; + +// error bar import +// split method up into smaller chunks for more detailed tests +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo60083) +{ + loadFromFile(u"ods/fdo60083.ods"); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW ); + + // test that y error bars are there + Reference< beans::XPropertySet > xErrorBarYProps; + xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps; + CPPUNIT_ASSERT(xErrorBarYProps.is()); + { + sal_Int32 nErrorBarStyle; + CPPUNIT_ASSERT( + xErrorBarYProps->getPropertyValue("ErrorBarStyle") + >>= nErrorBarStyle); + CPPUNIT_ASSERT_EQUAL( + chart::ErrorBarStyle::RELATIVE, + nErrorBarStyle); + + double nVal = 0.0; + CPPUNIT_ASSERT( + xErrorBarYProps->getPropertyValue("PositiveError") >>= nVal); + CPPUNIT_ASSERT_DOUBLES_EQUAL(5.0, nVal, 1e-8); + + CPPUNIT_ASSERT( + xErrorBarYProps->getPropertyValue("NegativeError") >>= nVal); + CPPUNIT_ASSERT_DOUBLES_EQUAL(5.0, nVal, 1e-8); + + bool bVal; + CPPUNIT_ASSERT( + xErrorBarYProps->getPropertyValue("ShowPositiveError") >>= bVal); + CPPUNIT_ASSERT_EQUAL(true, bVal); + + CPPUNIT_ASSERT( + xErrorBarYProps->getPropertyValue("ShowNegativeError") >>= bVal); + CPPUNIT_ASSERT_EQUAL(true, bVal); + } + + // test that x error bars are not imported + Reference< beans::XPropertySet > xErrorBarXProps; + xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarXProps; + CPPUNIT_ASSERT(!xErrorBarXProps.is()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testErrorBarRange) +{ + loadFromFile(u"ods/error_bar_range.ods"); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW ); + + // test that y error bars are there + Reference< beans::XPropertySet > xErrorBarYProps; + xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps; + CPPUNIT_ASSERT(xErrorBarYProps.is()); + + sal_Int32 nErrorBarStyle; + CPPUNIT_ASSERT( + xErrorBarYProps->getPropertyValue("ErrorBarStyle") + >>= nErrorBarStyle); + CPPUNIT_ASSERT_EQUAL( + chart::ErrorBarStyle::FROM_DATA, + nErrorBarStyle); + + OUString aRangePos; + CPPUNIT_ASSERT(xErrorBarYProps->getPropertyValue("ErrorBarRangePositive") >>= aRangePos); + CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$C$2:$C$4"), aRangePos); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testErrorBarFormatting) +{ + loadFromFile(u"ods/error_bar_properties.ods"); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT( xDataSeries.is() ); + + Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW ); + + // test that y error bars are there + Reference< beans::XPropertySet > xErrorBarYProps; + xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps; + CPPUNIT_ASSERT(xErrorBarYProps.is()); + + util::Color aColor(0); + xErrorBarYProps->getPropertyValue("LineColor") >>= aColor; + sal_uInt32 nColorValue = aColor; + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0xff3333), nColorValue); +} + +// stepped line interpolation +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSteppedLines) +{ + const sal_Int32 MAXSHEET = 14; + chart2::CurveStyle const curveStyle[] = { + chart2::CurveStyle_LINES, + chart2::CurveStyle_CUBIC_SPLINES, + chart2::CurveStyle_B_SPLINES, + chart2::CurveStyle_STEP_START, + chart2::CurveStyle_STEP_END, + chart2::CurveStyle_STEP_CENTER_X, + chart2::CurveStyle_STEP_CENTER_Y, + chart2::CurveStyle_LINES, + chart2::CurveStyle_CUBIC_SPLINES, + chart2::CurveStyle_B_SPLINES, + chart2::CurveStyle_STEP_START, + chart2::CurveStyle_STEP_END, + chart2::CurveStyle_STEP_CENTER_X, + chart2::CurveStyle_STEP_CENTER_Y + }; + + loadFromFile(u"ods/stepped_lines.ods"); + for(sal_Int32 nSheet = 0; nSheet < MAXSHEET; ++nSheet) + { + uno::Reference< chart2::XChartDocument > xChart2Doc = getChartDocFromSheet( nSheet, mxComponent ); + CPPUNIT_ASSERT(xChart2Doc.is()); + + Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChart2Doc, 0 ); + CPPUNIT_ASSERT(xChartType.is()); + + Reference< beans::XPropertySet > xPropSet( xChartType, UNO_QUERY ); + CPPUNIT_ASSERT(xPropSet.is()); + + chart2::CurveStyle eCurveStyle; + xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle; + CPPUNIT_ASSERT_EQUAL(eCurveStyle, curveStyle[nSheet]); + } +} + +static uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< chart::XChartDocument > const & xChart1Doc) +{ + CPPUNIT_ASSERT(xChart1Doc.is()); + uno::Reference< chart::XChartDataArray > xChartData ( xChart1Doc->getData(), UNO_QUERY_THROW); + uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions(); + return seriesList; +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testODSChartSeries) +{ + loadFromFile(u"ods/chart.ods"); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); + uno::Sequence < OUString > seriesList = getChartColumnDescriptions( xChart1Doc); + CPPUNIT_ASSERT_EQUAL(OUString("Col 1"), seriesList[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Col2"), seriesList[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Col 33"), seriesList[2]); + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testXLSXChartSeries) +{ + loadFromFile(u"xlsx/chart.xlsx"); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); + uno::Sequence < OUString > seriesList = getChartColumnDescriptions(xChart1Doc ); + CPPUNIT_ASSERT_EQUAL(OUString("Col 1"), seriesList[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Col2"), seriesList[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Col 33"), seriesList[2]); + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testXLSChartSeries) +{ + loadFromFile(u"xls/chart.xls"); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); + uno::Sequence < OUString > seriesList = getChartColumnDescriptions(xChart1Doc ); + CPPUNIT_ASSERT_EQUAL(OUString("Col 1"), seriesList[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Col 2"), seriesList[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Col 3"), seriesList[2]); + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testODTChartSeries) +{ + loadFromFile(u"odt/chart.odt"); + uno::Sequence< OUString > seriesList = getWriterChartColumnDescriptions(mxComponent); + CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[2]); + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDOCChartSeries) +{ + loadFromFile(u"doc/chart.doc"); + uno::Sequence< OUString > seriesList = getWriterChartColumnDescriptions(mxComponent); + CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[2]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDOCXChartSeries) +{ + loadFromFile(u"docx/chart.docx"); + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + std::vector > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 1"), aLabels[0][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 2"), aLabels[1][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), aLabels[2][0].get()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDOCXChartEmptySeries) +{ + loadFromFile(u"docx/tdf125337.docx"); + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + std::vector > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("1. dataseries"), aLabels[0][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("2. dataseries"), aLabels[1][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), aLabels[2][0].get()); + + //test chart series sparse data for docx + std::vector > aValues = getDataSeriesYValuesFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aValues.size()); + //test the second series values + CPPUNIT_ASSERT_EQUAL(2.4, aValues[1][0]); + CPPUNIT_ASSERT_EQUAL(4.4, aValues[1][1]); + //test the third series (empty) values + CPPUNIT_ASSERT(std::isnan(aValues[2][0])); + CPPUNIT_ASSERT(std::isnan(aValues[2][1])); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf81396) +{ + loadFromFile(u"xlsx/tdf81396.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference xChartType(getChartTypeFromDoc(xChartDoc2, 0), UNO_SET_THROW); + std::vector aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + CPPUNIT_ASSERT_EQUAL(size_t(1), aDataSeriesYValues.size()); + + // Without the fix in place, this test would have failed with + // - Expected: 105.210801910481 + // - Actual : nan + CPPUNIT_ASSERT_EQUAL(105.210801910481, aDataSeriesYValues[0][0]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXChartErrorBars) +{ + loadFromFile(u"pptx/tdf127720.pptx"); + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference< chart::XChartDataArray > xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW); + Sequence aColumnDesc = xDataArray->getColumnDescriptions(); + // Number of columns = 4 (Y-values, X-values and positive/negative error bars). + // Without the fix there would only be 2 columns (no error range). + CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", static_cast(4), aColumnDesc.getLength()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDOCXChartValuesSize) +{ + loadFromFile(u"docx/bubblechart.docx" ); + Reference xChartDoc( getChartDocFromWriter(0), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xChartDoc.is() ); + + uno::Reference< chart::XChartDataArray > xDataArray( xChartDoc->getDataProvider(), UNO_QUERY_THROW ); + Sequence aColumnDesc = xDataArray->getColumnDescriptions(); + // Number of columns = 3 (Y-values, X-values and bubble sizes). + // Without the fix there would only be 2 columns (no bubble sizes). + CPPUNIT_ASSERT_EQUAL_MESSAGE( "There must be 3 columns and descriptions", static_cast(3), aColumnDesc.getLength() ); + Sequence> aData = xDataArray->getData(); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "There must be exactly 3 data points", static_cast(3), aData.getLength() ); + + std::vector> aExpected = { { 2.7, 0.7, 10.0 }, { 3.2, 1.8, 4.0 }, { 0.8, 2.6, 8.0 } }; + + for ( sal_Int32 nRowIdx = 0; nRowIdx < 3; ++nRowIdx ) + for( sal_Int32 nColIdx = 0; nColIdx < 3; ++nColIdx ) + CPPUNIT_ASSERT_DOUBLES_EQUAL( aExpected[nRowIdx][nColIdx], aData[nRowIdx][nColIdx], 1e-1 ); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTChartSeries) +{ + //test chart series names for ppt + loadFromFile(u"ppt/chart.ppt"); + uno::Sequence < OUString > seriesList = getImpressChartColumnDescriptions(0, 0); + + CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[2]); + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXChartSeries) +{ + //test chart series names for pptx + loadFromFile(u"pptx/chart.pptx"); + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + std::vector > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), aLabels[0][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), aLabels[1][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), aLabels[2][0].get()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXSparseChartSeries) +{ + //test chart series sparse data for pptx + loadFromFile(u"pptx/sparse-chart.pptx"); + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + std::vector > aValues = getDataSeriesYValuesFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(2), aValues.size()); + CPPUNIT_ASSERT( std::isnan( aValues[0][0] ) ); + CPPUNIT_ASSERT_EQUAL(2.5, aValues[0][1]); + CPPUNIT_ASSERT_EQUAL(3.5, aValues[0][2]); + CPPUNIT_ASSERT( std::isnan( aValues[0][3] ) ); + CPPUNIT_ASSERT_EQUAL(-2.4, aValues[1][0]); + CPPUNIT_ASSERT( std::isnan( aValues[1][1] ) ); + CPPUNIT_ASSERT( std::isnan( aValues[1][2] ) ); + CPPUNIT_ASSERT_EQUAL(-2.8, aValues[1][3]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXHiddenDataSeries) +{ + /** + * Original data contains 3 series but 2 of them are hidden. For now, we + * detect and skip those hidden series on import (since we don't support + * hidden columns for internal data table yet). + */ + loadFromFile(u"pptx/stacked-bar-chart-hidden-series.pptx"); + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // "Automatic" chart background fill in pptx should be loaded as no fill. + Reference xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in pptx should be loaded as no fill (transparent).", + drawing::FillStyle_NONE, eStyle); + + Reference xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + // There should be only one data series present. + std::vector > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(1), aLabels.size()); + CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), aLabels[0][0].get()); + + // Test the internal data. + CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider()); + + Reference xInternalProvider(xChartDoc->getDataProvider(), uno::UNO_QUERY); + CPPUNIT_ASSERT(xInternalProvider.is()); + + Reference xDescAccess(xInternalProvider, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDescAccess.is()); + + // Get the category labels. + Sequence > aCategories = xDescAccess->getComplexRowDescriptions(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aCategories.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("Category 1"), aCategories[0][0]); + CPPUNIT_ASSERT_EQUAL(OUString("Category 2"), aCategories[1][0]); + CPPUNIT_ASSERT_EQUAL(OUString("Category 3"), aCategories[2][0]); + CPPUNIT_ASSERT_EQUAL(OUString("Category 4"), aCategories[3][0]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXPercentageNumberFormats) +{ + loadFromFile(u"pptx/percentage-number-formats.pptx"); + + // 1st chart + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropertySet; + chart2::DataPointLabel aLabel; + sal_Int32 nNumberFormat; + const sal_Int32 nPercentFormatSimple = getNumberFormat(xChartDoc, "0%"); + const sal_Int32 nPercentFormatDecimal = getNumberFormat(xChartDoc, "0.00%"); + + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber); + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); + xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nPercentFormatSimple, nNumberFormat); + + xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber); + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); + xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nPercentFormatDecimal, nNumberFormat); + + xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber); + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); + xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nPercentFormatSimple, nNumberFormat); + + xPropertySet.set(xDataSeries->getDataPointByIndex(3), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber); + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); + xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nPercentFormatDecimal, nNumberFormat); + + // 2nd chart + xChartDoc.set(getChartDocFromDrawImpress(1, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xYAxis.is()); + + Reference xPS(xYAxis, uno::UNO_QUERY_THROW); + bool bLinkNumberFormatToSource = true; + bool bSuccess = xPS->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", !bLinkNumberFormatToSource); + + // FIXME: This should be in fact "0.00%". + // see TODO in oox/source/drawingml/chart/modelbase.cxx + const sal_Int32 nPercentFormatDecimalShort = getNumberFormat(xChartDoc, "0.0%"); + nNumberFormat = getNumberFormatFromAxis(xYAxis); + CPPUNIT_ASSERT_EQUAL(nPercentFormatDecimalShort, nNumberFormat); + sal_Int16 nType = getNumberFormatType(xChartDoc, nNumberFormat); + CPPUNIT_ASSERT_MESSAGE("Y axis should be a percent format.", (nType & util::NumberFormat::PERCENT)); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPieChartLabelsNumFormat) +{ + loadFromFile(u"xlsx/tdfPieNumFormat.xlsx"); + uno::Reference< chart::XChartDocument > xChartDoc(getChartCompFromSheet(0, 0, mxComponent), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc.is()); + // test data point labels format + Reference xDataPointPropSet(xChartDoc->getDiagram()->getDataPointProperties(0, 0), uno::UNO_SET_THROW); + chart2::DataPointLabel aLabel; + xDataPointPropSet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXStackedNonStackedYAxis) +{ + loadFromFile(u"pptx/stacked-non-stacked-mix-y-axis.pptx"); + + // 1st chart is a normal stacked column. + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xTitled(xChartDoc, uno::UNO_QUERY_THROW); + OUString aTitle = getTitleString(xTitled); + CPPUNIT_ASSERT_EQUAL(OUString("Stacked"), aTitle); + + // Get the Y-axis. + Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xYAxis.is()); + + sal_Int32 nNumberFormat = getNumberFormatFromAxis(xYAxis); + sal_Int16 nType = getNumberFormatType(xChartDoc, nNumberFormat); + CPPUNIT_ASSERT_MESSAGE("Y axis should be a normal number format.", (nType & util::NumberFormat::NUMBER)); + CPPUNIT_ASSERT_MESSAGE("Y axis should NOT be a percent format.", !(nType & util::NumberFormat::PERCENT)); + + // 2nd chart is a percent-stacked column. + xChartDoc.set(getChartDocFromDrawImpress(1, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + xTitled.set(xChartDoc, uno::UNO_QUERY_THROW); + aTitle = getTitleString(xTitled); + CPPUNIT_ASSERT_EQUAL(OUString("100% Stacked"), aTitle); + + // Get the Y-axis. + xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xYAxis.is()); + + // Get the number format of the Y-axis. + nNumberFormat = getNumberFormatFromAxis(xYAxis); + nType = getNumberFormatType(xChartDoc, nNumberFormat); + CPPUNIT_ASSERT_MESSAGE("Y axis should be a percent format.", (nType & util::NumberFormat::PERCENT)); + + // 3rd chart is a mixture of normal-stacked column with a percent-stacked + // area chart series. Excel in this case sets the Y-axis to be + // non-percent axis and we should do the same for interoperability. + xChartDoc.set(getChartDocFromDrawImpress(2, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + xTitled.set(xChartDoc, uno::UNO_QUERY_THROW); + aTitle = getTitleString(xTitled); + CPPUNIT_ASSERT_EQUAL(OUString("Stacked column mixed with 100% stacked area"), aTitle); + + // Get the Y-axis. + xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xYAxis.is()); + + // Get the number format of the Y-axis. + nNumberFormat = getNumberFormatFromAxis(xYAxis); + nType = getNumberFormatType(xChartDoc, nNumberFormat); + CPPUNIT_ASSERT_MESSAGE("Y axis should be a normal number format.", (nType & util::NumberFormat::NUMBER)); + CPPUNIT_ASSERT_MESSAGE("Y axis should NOT be a percent format.", !(nType & util::NumberFormat::PERCENT)); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testODPChartSeries) +{ + //test chart series names for odp + loadFromFile(u"odp/chart.odp"); + uno::Sequence < OUString > seriesList = getImpressChartColumnDescriptions(0, 0); + CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[2]); + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc864396) +{ + loadFromFile(u"pptx/bnc864396.pptx"); + uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0,0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider()); + + uno::Reference< chart2::XInternalDataProvider > xDataProvider( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW ); + uno::Reference< chart::XChartDataArray > xChartDataArray(xDataProvider, uno::UNO_QUERY_THROW); + uno::Sequence< OUString > aRowLabels = xChartDataArray->getRowDescriptions(); + for(sal_Int32 i = 0; i < aRowLabels.getLength(); ++i) + { + OUString aExpected = "cat" + OUString::number(i+1); + CPPUNIT_ASSERT_EQUAL(aExpected, aRowLabels[i]); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc889755) +{ + loadFromFile(u"pptx/bnc889755.pptx"); + uno::Reference xChartDoc(getChartDocFromDrawImpress(0, 5), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider()); + + constexpr sal_Int32 nNumCategories = 16; + Sequence aDateSeq = getFormattedDateCategories(xChartDoc); + + CPPUNIT_ASSERT_EQUAL(nNumCategories, aDateSeq.getLength()); + + const OUString aExpectedDateCategories[nNumCategories] = { + "Oct-12", "Nov-12", "Dec-12", "Jan-13", + "Feb-13", "Mar-13", "Apr-13", "May-13", + "Jun-13", "Jul-13", "Aug-13", "Sep-13", + "Oct-13", "Nov-13", "Dec-13", "Jan-14", + }; + + for (size_t nIdx = 0; nIdx < nNumCategories; ++nIdx) + CPPUNIT_ASSERT_EQUAL(aExpectedDateCategories[nIdx], aDateSeq[nIdx]); + + //tdf#139940 - the title's gradient was lost and was filled with solid blue, instead of a "blue underline". + uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); + uno::Reference xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW); + + // Shape "Title 3" + // MCGR: Use the whole completely imported transparency gradient to check for correctness + uno::Reference xShapeProps(xPage->getByIndex(4), uno::UNO_QUERY_THROW); + awt::Gradient2 aTransparence; + xShapeProps->getPropertyValue("FillTransparenceGradient") >>= aTransparence; + const basegfx::BColorStops aColorStops = model::gradient::getColorStopsFromUno(aTransparence.ColorStops); + + CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size()); + CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); + CPPUNIT_ASSERT_EQUAL(Color(0x404040), Color(aColorStops[0].getStopColor())); + CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 0.070000000000000007)); + CPPUNIT_ASSERT_EQUAL(Color(0x404040), Color(aColorStops[1].getStopColor())); + CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[2].getStopOffset(), 0.080000000000000002)); + CPPUNIT_ASSERT_EQUAL(Color(0xffffff), Color(aColorStops[2].getStopColor())); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc882383) +{ + loadFromFile(u"pptx/bnc882383.pptx"); + uno::Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY_THROW); + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + OUString sGradientName; + xPropertySet->getPropertyValue("GradientName") >>= sGradientName; + CPPUNIT_ASSERT(!sGradientName.isEmpty()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTransparencyGradientValue) +{ + loadFromFile(u"xlsx/tdf128732.xlsx"); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + OUString sTranspGradientName; + xPropertySet->getPropertyValue("FillTransparenceGradientName") >>= sTranspGradientName; + CPPUNIT_ASSERT(!sTranspGradientName.isEmpty()); + + awt::Gradient2 aTransparenceGradient; + uno::Reference< lang::XMultiServiceFactory > xFact(xChartDoc, uno::UNO_QUERY); + CPPUNIT_ASSERT(xFact.is()); + uno::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance("com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY); + uno::Any rTransparenceValue = xTransparenceGradient->getByName(sTranspGradientName); + CPPUNIT_ASSERT(rTransparenceValue >>= aTransparenceGradient); + const basegfx::BColorStops aColorStops = model::gradient::getColorStopsFromUno(aTransparenceGradient.ColorStops); + + // MCGR: Use the whole completely imported transparency gradient to check for correctness + CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size()); + CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); + CPPUNIT_ASSERT_EQUAL(Color(0x4d4d4d), Color(aColorStops[0].getStopColor())); + CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); + CPPUNIT_ASSERT_EQUAL(Color(0x333333), Color(aColorStops[1].getStopColor())); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSimpleStrictXLSX) +{ + loadFromFile(u"xlsx/strict_chart.xlsx"); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT(xDataSeries.is()); + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDelayedCellImport) +{ + // chart range referencing content on later sheets + loadFromFile(u"xlsx/fdo70609.xlsx"); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent ); + Reference< chart2::data::XDataSequence > xDataSeq = + getDataSequenceFromDocByRole(xChartDoc, u"values-x"); + + OUString aRange = xDataSeq->getSourceRangeRepresentation(); + CPPUNIT_ASSERT_EQUAL(OUString("$Sheet2.$C$5:$C$9"), aRange); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFlatODSStackedColumnChart) +{ + loadFromFile(u"fods/stacked-column-chart.fods"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xChartType = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xChartType.is()); + + Reference xDSCont(xChartType, UNO_QUERY); + CPPUNIT_ASSERT(xDSCont.is()); + Sequence > aSeriesSeq = xDSCont->getDataSeries(); + + // The stacked column chart should consist of 5 data series. + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aSeriesSeq.getLength()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo78080) +{ + loadFromFile(u"xlsx/fdo78080.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xTitled(xChartDoc, uno::UNO_QUERY_THROW); + Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(!xTitle.is()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf127811) +{ + loadFromFile(u"pptx/tdf127811.pptx"); + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xCT = getChartTypeFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xCT.is()); + + std::vector > aLabels = getDataSeriesLabelsFromChartType(xCT); + CPPUNIT_ASSERT_EQUAL(size_t(2), aLabels.size()); + + // Without the fix in place, this test would have failed with + // - Expected: 1. first + // - Actual : 2. second + CPPUNIT_ASSERT_EQUAL(OUString("1. first"), aLabels[0][0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("2. second"), aLabels[1][0].get()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf86624) +{ + // manually placed legends + loadFromFile(u"ods/tdf86624.ods"); + uno::Reference< chart2::XChartDocument > xChart2Doc = getChartDocFromSheet(0, mxComponent); + uno::Reference< chart::XChartDocument > xChartDoc (xChart2Doc, uno::UNO_QUERY); + uno::Reference xLegend = xChartDoc->getLegend(); + awt::Point aPos = xLegend->getPosition(); + CPPUNIT_ASSERT(aPos.X > 5000); // real value for me is above 8000 but before bug fix is below 1000 + CPPUNIT_ASSERT(aPos.Y > 4000); // real value for ms is above 7000 +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf105517) +{ + loadFromFile(u"pptx/tdf105517.pptx"); + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xCoordContainer(xChartDoc->getFirstDiagram(), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCoordContainer.is()); + Reference xChartTypeContainer(xCoordContainer->getCoordinateSystems()[0], uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartTypeContainer.is()); + Reference xDSContainer(xChartTypeContainer->getChartTypes()[0], uno::UNO_QUERY); + CPPUNIT_ASSERT(xDSContainer.is()); + Reference xPropSet1(xDSContainer->getDataSeries()[0], uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropSet1.is()); + + tools::Long lineColor; + xPropSet1->getPropertyValue("Color") >>= lineColor; + // incorrect line color was 0x4a7ebb due to not handling themeOverride + CPPUNIT_ASSERT_EQUAL(tools::Long(0xeaa700), lineColor); + + Reference xPropSet2(xDSContainer->getDataSeries()[1], uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropSet2.is()); + + xPropSet2->getPropertyValue("Color") >>= lineColor; + // incorrect line color was 0x98b855 + CPPUNIT_ASSERT_EQUAL(tools::Long(0x1e69a8), lineColor); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf106217) +{ + loadFromFile(u"pptx/tdf106217.pptx"); + uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromDrawImpress(0, 0); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xCircle(xDrawPage->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCircle.is()); + + uno::Reference xNamedShape(xCircle, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Oval 1"), xNamedShape->getName()); + + awt::Point aPosition = xCircle->getPosition(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6870), aPosition.X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7261), aPosition.Y); + awt::Size aSize = xCircle->getSize(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2701), aSize.Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2700), aSize.Height); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf108021) +{ + // Tdf108021 : To check TextBreak value is true. + loadFromFile(u"ods/tdf108021.ods"); + uno::Reference< chart::XDiagram > mxDiagram; + uno::Reference< beans::XPropertySet > xAxisProp; + bool bTextBreak = false; + uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); + mxDiagram.set(xChartDoc->getDiagram()); + CPPUNIT_ASSERT(mxDiagram.is()); + uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY ); + CPPUNIT_ASSERT(xAxisXSupp.is()); + xAxisProp = xAxisXSupp->getXAxis(); + xAxisProp->getPropertyValue("TextBreak") >>= bTextBreak; + // Expected value of 'TextBreak' is true + CPPUNIT_ASSERT(bTextBreak); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf100084) +{ + // The test file was created with IBM Cognos, make sure there is a diagram. + loadFromFile(u"xlsx/tdf100084.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY); + CPPUNIT_ASSERT_MESSAGE("There should be a Diagram.", xDiagram.is()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf124817) +{ + loadFromFile(u"xlsx/tdf124817.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + uno::Reference xDataSeries; + chart2::Symbol aSymblProp; + + // Check the symbol of data series 1 (marker style none) + xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropSet_0(xDataSeries, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT((xPropSet_0->getPropertyValue("Symbol") >>= aSymblProp)); + CPPUNIT_ASSERT_EQUAL(chart2::SymbolStyle_NONE, aSymblProp.Style); + + // Check the symbol of data series 2 (marker style square) + xDataSeries = getDataSeriesFromDoc(xChartDoc, 1); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropSet_1(xDataSeries, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT((xPropSet_1->getPropertyValue("Symbol") >>= aSymblProp)); + CPPUNIT_ASSERT_EQUAL(static_cast(0xED7D31), aSymblProp.FillColor); + + // Check the symbol of data series 3 (marker style diagonal cross) + xDataSeries = getDataSeriesFromDoc(xChartDoc, 2); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropSet_2(xDataSeries, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT((xPropSet_2->getPropertyValue("Symbol") >>= aSymblProp)); + CPPUNIT_ASSERT_EQUAL(static_cast(0xFF0000), aSymblProp.BorderColor); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf126033) +{ + loadFromFile(u"xlsx/tdf126033.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + // Check symbol style and size of data points + chart2::Symbol aSymblProp; + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Symbol") >>= aSymblProp); + CPPUNIT_ASSERT_EQUAL(chart2::SymbolStyle_NONE, aSymblProp.Style); + CPPUNIT_ASSERT_EQUAL(static_cast(176), aSymblProp.Size.Width); + CPPUNIT_ASSERT_EQUAL(static_cast(176), aSymblProp.Size.Height); +} + +void Chart2ImportTest::testTransparentBackground(std::u16string_view filename) +{ + loadFromFile(filename); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + uno::Reference< chart::XChartDocument > xChart2Doc (xChartDoc, uno::UNO_QUERY); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChart2Doc.is()); + + Reference< beans::XPropertySet > xPropSet = xChart2Doc->getArea(); + CPPUNIT_ASSERT_MESSAGE("failed to get Area", xPropSet.is()); + + css::drawing::FillStyle aStyle; + xPropSet -> getPropertyValue("FillStyle") >>= aStyle; + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Background needs to be with solid fill style", css::drawing::FillStyle_SOLID, aStyle); +} + +// 2 test methods here so that tearDown() can dispose the document +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo54361) +{ + testTransparentBackground(u"xlsx/fdo54361.xlsx"); +} +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo54361_1) +{ + testTransparentBackground(u"xlsx/fdo54361-1.xlsx"); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoBackgroundXLSX) +{ + loadFromFile(u"xlsx/chart-auto-background.xlsx"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + // "Automatic" chart background fill in xlsx should be loaded as solid white. + Reference xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); + sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid fill.", + drawing::FillStyle_SOLID, eStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid white.", + sal_Int32(0x00FFFFFF), sal_Int32(nColor & 0x00FFFFFF)); // highest 2 bytes are transparency which we ignore here. +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoChartAreaBorderPropXLSX) +{ + loadFromFile(u"xlsx/chart-area-style-border.xlsx"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + // Test "Automatic" chartarea border style/color/width. + Reference xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::LineStyle eStyle = xPropSet->getPropertyValue("LineStyle").get(); + sal_Int32 nColor = xPropSet->getPropertyValue("LineColor").get(); + sal_Int32 nWidth = xPropSet->getPropertyValue("LineWidth").get(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chartarea border should be loaded as solid style.", + drawing::LineStyle_SOLID, eStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chartarea border color should be loaded as light gray.", + sal_Int32(0xD9D9D9), nColor); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chartarea border width should be loaded as 0.75 pt (~0.026 cm)", + sal_Int32(26), nWidth); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoChartAreaBorderPropPPTX) +{ + loadFromFile(u"pptx/tdf150176.pptx"); + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + // Test "Automatic" chartarea border style/color/width. + Reference xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::LineStyle eStyle = xPropSet->getPropertyValue("LineStyle").get(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chartarea border should be loaded as none style for pptx.", + drawing::LineStyle_NONE, eStyle); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testChartAreaStyleBackgroundXLSX) +{ + loadFromFile(u"xlsx/chart-area-style-background.xlsx"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + // "Automatic" chart background fill in xlsx should be loaded as solid white. + Reference xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); + sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid fill.", + drawing::FillStyle_SOLID, eStyle); + CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid white.", + sal_Int32(0), nColor); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testChartHatchFillXLSX) +{ + loadFromFile(u"xlsx/chart-hatch-fill.xlsx"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + // Check the chart background FillStyle is HATCH + Reference xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Chart background fill in this xlsx should be loaded as hatch fill.", + drawing::FillStyle_HATCH, eStyle); + + // Check the FillBackground of chart background + bool bBackgroundFill = false; + xPropSet->getPropertyValue("FillBackground") >>= bBackgroundFill; + CPPUNIT_ASSERT(bBackgroundFill); + + Color nBackgroundColor; + xPropSet->getPropertyValue("FillColor") >>= nBackgroundColor; + CPPUNIT_ASSERT_EQUAL(COL_WHITE, nBackgroundColor); + + // Check the datapoint has HatchName value + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW); + OUString sHatchName; + xPropertySet->getPropertyValue("HatchName") >>= sHatchName; + CPPUNIT_ASSERT(!sHatchName.isEmpty()); + + // Check the FillBackground of datapoint + bool bBackgroundFillofDatapoint = false; + xPropertySet->getPropertyValue("FillBackground") >>= bBackgroundFillofDatapoint; + CPPUNIT_ASSERT(bBackgroundFillofDatapoint); + + sal_Int32 nBackgroundColorofDatapoint; + xPropertySet->getPropertyValue("FillColor") >>= nBackgroundColorofDatapoint; + CPPUNIT_ASSERT_EQUAL(static_cast(0x00B050), nBackgroundColorofDatapoint); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAxisTextRotationXLSX) +{ + loadFromFile(u"xlsx/axis-label-rotation.xlsx"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xYAxis.is()); + + Reference xPS(xYAxis, uno::UNO_QUERY_THROW); + double nRotation = 0; + bool bSuccess = xPS->getPropertyValue("TextRotation") >>= nRotation; + + CPPUNIT_ASSERT(bSuccess); + CPPUNIT_ASSERT_DOUBLES_EQUAL(90, nRotation, 1e-10); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTextCanOverlapXLSX) +{ + // fdo#84647 : To check textoverlap value is imported correctly. + loadFromFile(u"xlsx/chart-text-can-overlap.xlsx"); + uno::Reference< chart::XDiagram > mxDiagram; + uno::Reference< beans::XPropertySet > xAxisProp; + bool bTextCanOverlap = false; + uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); + mxDiagram.set(xChartDoc->getDiagram()); + CPPUNIT_ASSERT(mxDiagram.is()); + uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY ); + CPPUNIT_ASSERT(xAxisXSupp.is()); + xAxisProp = xAxisXSupp->getXAxis(); + xAxisProp->getPropertyValue("TextCanOverlap") >>= bTextCanOverlap; + CPPUNIT_ASSERT(!bTextCanOverlap); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTextBreakXLSX) +{ + // tdf#122091: To check textbreak value is true in case of 0° degree of Axis label rotation. + loadFromFile(u"xlsx/chart_label_text_break.xlsx"); + uno::Reference< chart::XDiagram > mxDiagram; + uno::Reference< beans::XPropertySet > xAxisProp; + bool textBreak = false; + uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc.is()); + mxDiagram.set(xChartDoc->getDiagram()); + CPPUNIT_ASSERT(mxDiagram.is()); + uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY ); + CPPUNIT_ASSERT(xAxisXSupp.is()); + xAxisProp = xAxisXSupp->getXAxis(); + xAxisProp->getPropertyValue("TextBreak") >>= textBreak; + // Expected value of 'TextBreak' is true + CPPUNIT_ASSERT(textBreak); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testNumberFormatsXLSX) +{ + loadFromFile(u"xlsx/number-formats.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropertySet; + chart2::DataPointLabel aLabel; + sal_Int32 nNumberFormat; + bool bLinkNumberFormatToSource = false; + const sal_Int32 nChartDataNumberFormat = getNumberFormat( + xChartDoc, "_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"??_);_(@_)"); + + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber); + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); + xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat); + bool bSuccess = xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(false, bSuccess); + bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource); + + xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber); + CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumberInPercent); + xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat); + bSuccess = xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(false, bSuccess); + bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource); + + xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber); + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); + xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat); + bSuccess = xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(false, bSuccess); + bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testNumberFormatsDOCX) +{ + loadFromFile(u"docx/tdf132174.docx"); + { + uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + css::uno::Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + uno::Reference xPropertySet(xDataSeries, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xPropertySet.is()); + + sal_Int32 nNumberFormat; + bool bLinkNumberFormatToSource = true; + const sal_Int32 nChartDataNumberFormat = getNumberFormat(xChartDoc, "0%"); + xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat); + xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; + // LinkNumberFormatToSource should be set to false even if the original OOXML contain a true value, + // because the inner data table of charts have no own number format! + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", !bLinkNumberFormatToSource); + } + + loadFromFile(u"docx/tdf136650.docx"); + { + uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + css::uno::Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropertySet(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW); + + sal_Int32 nNumberFormat; + bool bLinkNumberFormatToSource = true; + const sal_Int32 nChartDataNumberFormat = getNumberFormat(xChartDoc, "0%"); + xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat; + CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat); + xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; + // LinkNumberFormatToSource should be set to false even if the original OOXML file contain a true value, + // because the inner data table of charts have no own number format! + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", !bLinkNumberFormatToSource); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPercentageNumberFormatsDOCX) +{ + loadFromFile(u"docx/tdf133632.docx"); + uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + css::uno::Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + uno::Reference xPropertySet(xDataSeries, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xPropertySet.is()); + + bool bLinkNumberFormatToSource = false; + chart2::DataPointLabel aLabel; + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber); + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); + bool bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess); + CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoTitleDelDefaultValue2007XLSX) +{ + // below are OOXML default value tests for cases + // where we fixed the handling of MSO 2007 vs OOXML + loadFromFile(u"xlsx/autotitledel_2007.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xTitled(xChartDoc, uno::UNO_QUERY_THROW); + OUString aTitle = getTitleString(xTitled); + CPPUNIT_ASSERT_MESSAGE("autoTitleDel default value is false in MSO 2007 documents", + !aTitle.isEmpty()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoTitleDelDefaultValue2013XLSX) +{ + loadFromFile(u"xlsx/autotitledel_2013.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xTitled(xChartDoc, uno::UNO_QUERY_THROW); + uno::Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT_MESSAGE("autoTitleDel default value is true in the OOXML spec", + !xTitle.is()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDispBlanksAsDefaultValue2007XLSX) +{ + loadFromFile(u"xlsx/dispBlanksAs_2007.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY); + CPPUNIT_ASSERT(xDiagram.is()); + uno::Any aAny = xDiagram->getPropertyValue("MissingValueTreatment"); + sal_Int32 nMissingValueTreatment = -2; + CPPUNIT_ASSERT(aAny >>= nMissingValueTreatment); + CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::LEAVE_GAP, nMissingValueTreatment); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDispBlanksAsDefaultValue2013XLSX) +{ + loadFromFile(u"xlsx/dispBlanksAs_2013.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY); + CPPUNIT_ASSERT(xDiagram.is()); + uno::Any aAny = xDiagram->getPropertyValue("MissingValueTreatment"); + sal_Int32 nMissingValueTreatment = -2; + CPPUNIT_ASSERT(aAny >>= nMissingValueTreatment); + CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::USE_ZERO, nMissingValueTreatment); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSmoothDefaultValue2007XLSX) +{ + loadFromFile(u"xlsx/smoothed_series2007.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT(xChartType.is()); + + Reference< beans::XPropertySet > xPropSet( xChartType, UNO_QUERY ); + CPPUNIT_ASSERT(xPropSet.is()); + + chart2::CurveStyle eCurveStyle; + xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle; + CPPUNIT_ASSERT_EQUAL(chart2::CurveStyle_LINES, eCurveStyle); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSmoothDefaultValue2013XLSX) +{ + loadFromFile(u"xlsx/smoothed_series.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 ); + CPPUNIT_ASSERT(xChartType.is()); + + Reference< beans::XPropertySet > xPropSet( xChartType, UNO_QUERY ); + CPPUNIT_ASSERT(xPropSet.is()); + + chart2::CurveStyle eCurveStyle; + xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle; + CPPUNIT_ASSERT(eCurveStyle != chart2::CurveStyle_LINES); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTrendlineDefaultValue2007XLSX) +{ + loadFromFile(u"xlsx/trendline2007.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xRegressionCurveContainer(xDataSeries, UNO_QUERY_THROW); + Sequence< Reference > xRegressionCurveSequence = xRegressionCurveContainer->getRegressionCurves(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xRegressionCurveSequence.getLength()); + + Reference xCurve = xRegressionCurveSequence[0]; + + Reference xPropSet(xCurve->getEquationProperties(), uno::UNO_SET_THROW); + uno::Any aAny = xPropSet->getPropertyValue("ShowEquation"); + bool bShowEquation = true; + CPPUNIT_ASSERT(aAny >>= bShowEquation); + CPPUNIT_ASSERT(!bShowEquation); + + aAny = xPropSet->getPropertyValue("ShowCorrelationCoefficient"); + bool bShowCorrelation = true; + CPPUNIT_ASSERT(aAny >>= bShowCorrelation); + CPPUNIT_ASSERT(!bShowCorrelation); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTrendlineDefaultValue2013XLSX) +{ + loadFromFile(u"xlsx/trendline.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xRegressionCurveContainer(xDataSeries, UNO_QUERY_THROW); + Sequence< Reference > xRegressionCurveSequence = xRegressionCurveContainer->getRegressionCurves(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xRegressionCurveSequence.getLength()); + + Reference xCurve = xRegressionCurveSequence[0]; + + Reference xPropSet(xCurve->getEquationProperties(), uno::UNO_SET_THROW); + uno::Any aAny = xPropSet->getPropertyValue("ShowEquation"); + bool bShowEquation = false; + CPPUNIT_ASSERT(aAny >>= bShowEquation); + CPPUNIT_ASSERT(bShowEquation); + + aAny = xPropSet->getPropertyValue("ShowCorrelationCoefficient"); + bool bShowCorrelation = false; + CPPUNIT_ASSERT(aAny >>= bShowCorrelation); + CPPUNIT_ASSERT(bShowCorrelation); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testVaryColorDefaultValues2007XLSX) +{ + loadFromFile(u"xlsx/vary_color2007.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropSet(xDataSeries, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint"); + bool bVaryColor = true; + CPPUNIT_ASSERT(aAny >>= bVaryColor); + CPPUNIT_ASSERT(!bVaryColor); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testVaryColorDefaultValues2013XLSX) +{ + loadFromFile(u"xlsx/vary_color.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropSet(xDataSeries, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint"); + bool bVaryColor = false; + CPPUNIT_ASSERT(aAny >>= bVaryColor); + CPPUNIT_ASSERT(!bVaryColor); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPlotVisOnlyDefaultValue2013XLSX) +{ + loadFromFile(u"xlsx/plotVisOnly.xlsx"); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); + Reference xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("IncludeHiddenCells"); + CPPUNIT_ASSERT(aAny.hasValue()); + bool bShowHiddenValues = true; + CPPUNIT_ASSERT(aAny >>= bShowHiddenValues); + CPPUNIT_ASSERT(!bShowHiddenValues); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testRAngAxDefaultValue2013XLSX) +{ + loadFromFile(u"xlsx/rAngAx.xlsx"); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); + Reference xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("RightAngledAxes"); + CPPUNIT_ASSERT(aAny.hasValue()); + bool bRightAngleAxes = false; + CPPUNIT_ASSERT(aAny >>= bRightAngleAxes); + CPPUNIT_ASSERT(bRightAngleAxes); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testMajorTickMarksDefaultValue2013XLSX) +{ + loadFromFile(u"xlsx/majorTickMark.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + Reference xXAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xXAxis.is()); + Reference xPropSet(xXAxis, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("MajorTickmarks"); + sal_Int32 nMajorTickmarks = chart2::TickmarkStyle::NONE; + CPPUNIT_ASSERT(aAny.hasValue()); + CPPUNIT_ASSERT(aAny >>= nMajorTickmarks); + CPPUNIT_ASSERT_EQUAL(chart2::TickmarkStyle::INNER | chart2::TickmarkStyle::OUTER, nMajorTickmarks); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testMinorTickMarksDefaultValue2013XLSX) +{ + loadFromFile(u"xlsx/minorTickMark.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + Reference xXAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xXAxis.is()); + Reference xPropSet(xXAxis, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("MinorTickmarks"); + sal_Int32 nMajorTickmarks = chart2::TickmarkStyle::NONE; + CPPUNIT_ASSERT(aAny.hasValue()); + CPPUNIT_ASSERT(aAny >>= nMajorTickmarks); + CPPUNIT_ASSERT_EQUAL(chart2::TickmarkStyle::INNER | chart2::TickmarkStyle::OUTER, nMajorTickmarks); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAxisTitleDefaultRotationXLSX) +{ + loadFromFile(u"xlsx/axis_title_default_rotation.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xYAxis.is()); + Reference xTitled(xYAxis, uno::UNO_QUERY_THROW); + Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(xTitle.is()); + Reference xPropSet(xTitle, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); + double nRotation = 0; + CPPUNIT_ASSERT(aAny >>= nRotation); + CPPUNIT_ASSERT_EQUAL(90.0, nRotation); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSecondaryAxisTitleDefaultRotationXLSX) +{ + loadFromFile(u"xlsx/secondary_axis_title_default_rotation.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 1); + CPPUNIT_ASSERT(xYAxis.is()); + Reference xTitled(xYAxis, uno::UNO_QUERY_THROW); + Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(xTitle.is()); + Reference xPropSet(xTitle, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); + double nRotation = 0; + CPPUNIT_ASSERT(aAny >>= nRotation); + CPPUNIT_ASSERT_EQUAL(90.0, nRotation); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAxisTitleRotationXLSX) +{ + loadFromFile(u"xlsx/axis_title_rotated.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + { + Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xYAxis.is()); + Reference xTitled(xYAxis, uno::UNO_QUERY_THROW); + Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(xTitle.is()); + Reference xPropSet(xTitle, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); + double nRotation = 0; + CPPUNIT_ASSERT(aAny >>= nRotation); + CPPUNIT_ASSERT_EQUAL(340.0, nRotation); + } + { + Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 1); + CPPUNIT_ASSERT(xYAxis.is()); + Reference xTitled(xYAxis, uno::UNO_QUERY_THROW); + Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(xTitle.is()); + Reference xPropSet(xTitle, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); + double nRotation = 0; + CPPUNIT_ASSERT(aAny >>= nRotation); + CPPUNIT_ASSERT_EQUAL(270.0, nRotation); + } + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAxisTitlePositionDOCX) +{ + loadFromFile(u"docx/testAxisTitlePosition.docx"); + uno::Reference< chart::XDiagram > mxDiagram; + uno::Reference< drawing::XShape > xAxisTitle; + uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromWriter(0); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + mxDiagram.set(xChartDoc->getDiagram()); + CPPUNIT_ASSERT(mxDiagram.is()); + // test X Axis title position + uno::Reference< chart::XAxisXSupplier > xAxisXSupp(mxDiagram, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisXSupp.is()); + + xAxisTitle = xAxisXSupp->getXAxisTitle(); + CPPUNIT_ASSERT(xAxisTitle.is()); + + awt::Point aPos = xAxisTitle->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(10640, aPos.X, 2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(7157, aPos.Y, 2); + + // test Y Axis title position + uno::Reference< chart::XAxisYSupplier > xAxisYSupp(mxDiagram, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisYSupp.is()); + + xAxisTitle = xAxisYSupp->getYAxisTitle(); + CPPUNIT_ASSERT(xAxisTitle.is()); + + aPos = xAxisTitle->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(387, aPos.X, 2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(6378, aPos.Y, 300); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testCombinedChartAttachedAxisXLSX) +{ + loadFromFile(u"xlsx/testCombinedChartAxis.xlsx"); + Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + // First series + Reference xSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xSeries.is()); + + Reference xPropSet(xSeries, uno::UNO_QUERY_THROW); + sal_Int32 nAxisIndex = -1; + // First series (column chart) should be attached to secondary axis! + uno::Any aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + CPPUNIT_ASSERT(aAny >>= nAxisIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nAxisIndex); + + // Second series + xSeries = getDataSeriesFromDoc(xChartDoc, 0, 1); + CPPUNIT_ASSERT(xSeries.is()); + + xPropSet.set(xSeries, uno::UNO_QUERY_THROW); + // Second series (line chart) should be attached to primary axis! + aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + CPPUNIT_ASSERT(aAny >>= nAxisIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf140489MultiSeriesChartAxisXLSX) +{ + loadFromFile(u"xlsx/tdf140489.xlsx"); + Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + // First series + Reference xSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xSeries.is()); + + Reference xPropSet(xSeries, uno::UNO_QUERY_THROW); + sal_Int32 nAxisIndex = -1; + uno::Any aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + CPPUNIT_ASSERT(aAny >>= nAxisIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex); + + // Second series + xSeries = getDataSeriesFromDoc(xChartDoc, 0, 1); + CPPUNIT_ASSERT(xSeries.is()); + + xPropSet.set(xSeries, uno::UNO_QUERY_THROW); + aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + CPPUNIT_ASSERT(aAny >>= nAxisIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex); + + // Third series + xSeries = getDataSeriesFromDoc(xChartDoc, 0, 2); + CPPUNIT_ASSERT(xSeries.is()); + + xPropSet.set(xSeries, uno::UNO_QUERY_THROW); + aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + CPPUNIT_ASSERT(aAny >>= nAxisIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nAxisIndex); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testInternalDataProvider) +{ + loadFromFile(u"odp/chart.odp"); + uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0,0), uno::UNO_QUERY_THROW); + const uno::Reference< chart2::data::XDataProvider >& rxDataProvider = xChartDoc->getDataProvider(); + + // Parse 42 array + Reference xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{42;42;42;42}", ""); + Sequence xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[0]); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[3]); + + // Parse empty first and last + xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{\"\";42;42;\"\"}", ""); + xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT( std::isnan( *static_cast(xSequence[0].getValue()))); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[2]); + CPPUNIT_ASSERT( std::isnan( *static_cast(xSequence[3].getValue()))); + + // Parse empty middle + xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{42;\"\";\"\";42}", ""); + xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[0]); + CPPUNIT_ASSERT( std::isnan( *static_cast(xSequence[1].getValue())) ); + CPPUNIT_ASSERT( std::isnan( *static_cast(xSequence[2].getValue())) ); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[3]); + + // Parse mixed types, numeric only role + xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{42;\"hello\";0;\"world\"}", ""); + xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[0]); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)), xSequence[3]); + + // Parse mixed types, mixed role + xDataSeq = rxDataProvider->createDataSequenceByValueArray("categories", "{42;\"hello\";0;\"world\"}", ""); + xSequence = xDataSeq->getData(); + CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Row 1 42")), xSequence[0]); + CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Row 2 hello")), xSequence[1]); + CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Row 3 0")), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Row 4 world")), xSequence[3]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf90510) +{ + // Pie chart label placement settings(XLS) + loadFromFile(u"xls/piechart_outside.xls"); + uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW ); + Reference xPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_SET_THROW ); + uno::Any aAny = xPropSet->getPropertyValue( "LabelPlacement" ); + CPPUNIT_ASSERT( aAny.hasValue() ); + sal_Int32 nLabelPlacement = 0; + CPPUNIT_ASSERT( aAny >>= nLabelPlacement ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data labels should be placed outside", chart::DataLabelPlacement::OUTSIDE, nLabelPlacement ); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf109858) +{ + // Pie chart label placement settings(XLSX) + loadFromFile(u"xlsx/piechart_outside.xlsx"); + uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW ); + + // test data point labels position + Reference xDataPointPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_SET_THROW ); + uno::Any aAny = xDataPointPropSet->getPropertyValue( "LabelPlacement" ); + CPPUNIT_ASSERT( aAny.hasValue() ); + sal_Int32 nLabelPlacement = 0; + CPPUNIT_ASSERT( aAny >>= nLabelPlacement ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data point label should be placed bestfit", chart::DataLabelPlacement::CUSTOM, nLabelPlacement ); + + // test data series label position + Reference xSeriesPropSet(xChart1Doc->getDiagram()->getDataRowProperties(0), uno::UNO_SET_THROW); + aAny = xSeriesPropSet->getPropertyValue( "LabelPlacement" ); + CPPUNIT_ASSERT( aAny >>= nLabelPlacement ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data series labels should be placed outside", chart::DataLabelPlacement::OUTSIDE, nLabelPlacement ); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf130105) +{ + loadFromFile(u"xlsx/barchart_outend.xlsx"); + uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + uno::Any aAny = xPropertySet->getPropertyValue("LabelPlacement"); + CPPUNIT_ASSERT(aAny.hasValue()); + sal_Int32 nLabelPlacement = 0; + CPPUNIT_ASSERT(aAny >>= nLabelPlacement); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Data label should be placed outend", chart::DataLabelPlacement::OUTSIDE, nLabelPlacement); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf111173) +{ + loadFromFile(u"xlsx/tdf111173.xlsx"); + uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW ); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf122226) +{ + loadFromFile(u"docx/testTdf122226.docx" ); + uno::Reference< chart2::XChartDocument > xChartDoc ( getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT( xChartDoc.is() ); + + css::uno::Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xPropertySet.is()); + + uno::Any aAny = xPropertySet->getPropertyValue( "LabelSeparator" ); + CPPUNIT_ASSERT( aAny.hasValue() ); + OUString nLabelSeparator; + CPPUNIT_ASSERT( aAny >>= nLabelSeparator ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data labels should be separated into new lines", OUString("\n"), nLabelSeparator ); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf115107) +{ + // import complex data point labels + loadFromFile(u"pptx/tdf115107.pptx"); + + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + float nFontSize; + sal_Int64 nFontColor; + sal_Int32 nCharUnderline; + uno::Reference xPropertySet; + uno::Sequence> aFields; + + // 1 + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(2), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("90.0 = "), aFields[0]->getString()); + aFields[0]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[0]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(18), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xed7d31), nFontColor); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("90"), aFields[1]->getString()); + + // 2 + xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(8), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), aFields[0]->getString()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString(" : "), aFields[1]->getString()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CATEGORYNAME, aFields[2]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("B"), aFields[2]->getString()); + aFields[2]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[2]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(16), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xed7d31), nFontColor); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE, aFields[3]->getFieldType()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[4]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Multi"), aFields[4]->getString()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[5]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("line"), aFields[5]->getString()); + aFields[5]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[5]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(11.97), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xbf9000), nFontColor); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE, aFields[6]->getFieldType()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[7]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Abc"), aFields[7]->getString()); + aFields[7]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[7]->getPropertyValue("CharColor") >>= nFontColor; + aFields[7]->getPropertyValue("CharUnderline") >>= nCharUnderline; + CPPUNIT_ASSERT_EQUAL(static_cast(12), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xa9d18e), nFontColor); + CPPUNIT_ASSERT_EQUAL(static_cast(1), nCharUnderline); + + // 3 + xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(1), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("DATA"), aFields[0]->getString()); + + // 4 + xPropertySet.set(xDataSeries->getDataPointByIndex(3), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(2), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLREF, aFields[0]->getFieldType()); + //CPPUNIT_ASSERT_EQUAL(OUString("70"), aFields[0]->getString()); TODO: Not implemented yet + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString(" getString()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf115107_2) +{ + // import complex data point labels in cobo charts with multiple data series + loadFromFile(u"pptx/tdf115107-2.pptx"); + + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + float nFontSize; + sal_Int64 nFontColor; + uno::Reference xPropertySet; + uno::Sequence> aFields; + + // First series + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(3), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("4.3"), aFields[0]->getString()); + aFields[0]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[0]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(18), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xc00000), nFontColor); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString(" "), aFields[1]->getString()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[2]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Bars"), aFields[2]->getString()); + + // Second series + xDataSeries = getDataSeriesFromDoc(xChartDoc, 0, 1); + CPPUNIT_ASSERT(xDataSeries.is()); + + xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields; + CPPUNIT_ASSERT_EQUAL(static_cast(3), aFields.getLength()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, aFields[0]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("2"), aFields[0]->getString()); + aFields[0]->getPropertyValue("CharHeight") >>= nFontSize; + aFields[0]->getPropertyValue("CharColor") >>= nFontColor; + CPPUNIT_ASSERT_EQUAL(static_cast(18), nFontSize); + CPPUNIT_ASSERT_EQUAL(static_cast(0xffd966), nFontColor); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString(" "), aFields[1]->getString()); + + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[2]->getFieldType()); + CPPUNIT_ASSERT_EQUAL(OUString("Line"), aFields[2]->getString()); + +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf116163) +{ + loadFromFile(u"pptx/tdf116163.pptx"); + + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xHAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xHAxis.is()); + + chart2::ScaleData aScaleData = xHAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + + Reference xLabeledDataSequence = aScaleData.Categories; + CPPUNIT_ASSERT(xLabeledDataSequence.is()); + + Reference xDataSequence = xLabeledDataSequence->getValues(); + CPPUNIT_ASSERT(xDataSequence.is()); + + Reference xTextualDataSequence(xDataSequence, uno::UNO_QUERY); + CPPUNIT_ASSERT(xTextualDataSequence.is()); + + std::vector aCategories; + const Sequence aTextData(xTextualDataSequence->getTextualData()); + ::std::copy(aTextData.begin(), aTextData.end(), + ::std::back_inserter(aCategories)); + + CPPUNIT_ASSERT_EQUAL(OUString("Aaaa"), aCategories[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Bbbbbbb"), aCategories[1]); + CPPUNIT_ASSERT_EQUAL(OUString("Ccc"), aCategories[2]); + CPPUNIT_ASSERT_EQUAL(OUString("Ddddddddddddd"), aCategories[3]); + + // Check visible text + + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xXAxis = getShapeByName(xShapes, "CID/D=0:CS=0:Axis=0,0", + // Axis occurs twice in chart xshape representation so need to get the one related to labels + [](const uno::Reference& rXShape) -> bool + { + uno::Reference xAxisShapes(rXShape, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisShapes.is()); + uno::Reference xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY); + uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xChildShape, uno::UNO_QUERY_THROW); + return (xShapeDescriptor->getShapeType() == "com.sun.star.drawing.TextShape"); + }); + CPPUNIT_ASSERT(xXAxis.is()); + + uno::Reference xIndexAccess(xXAxis, UNO_QUERY_THROW); + + // Check text + uno::Reference xLabel0(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Aaaa"), xLabel0->getString()); + uno::Reference xLabel1(xIndexAccess->getByIndex(1), uno::UNO_QUERY); + // If there is space for 3 chars only then don't show "..." + CPPUNIT_ASSERT_EQUAL(OUString("Bbb"), xLabel1->getString()); + uno::Reference xLabel2(xIndexAccess->getByIndex(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Ccc"), xLabel2->getString()); + uno::Reference xLabel3(xIndexAccess->getByIndex(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Dddd..."), xLabel3->getString()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf48041) +{ + loadFromFile(u"pptx/tdf48041.pptx"); + + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xYAxis.is()); + + chart2::ScaleData aScaleData = xYAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Scaling.is()); + + // Check visible text + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xYAxisShape = getShapeByName(xShapes, "CID/D=0:CS=0:Axis=1,0", // Y Axis + // Axis occurs twice in chart xshape representation so need to get the one related to labels + [](const uno::Reference& rXShape) -> bool + { + uno::Reference xAxisShapes(rXShape, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisShapes.is()); + uno::Reference xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY); + uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xChildShape, uno::UNO_QUERY_THROW); + return (xShapeDescriptor->getShapeType() == "com.sun.star.drawing.TextShape"); + }); + CPPUNIT_ASSERT(xYAxisShape.is()); + + // Check label count + uno::Reference xIndexAccess(xYAxisShape, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(static_cast(6), xIndexAccess->getCount()); + + // Check text + uno::Reference xLabel0(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("0"), xLabel0->getString()); + uno::Reference xLabel1(xIndexAccess->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1"), xLabel1->getString()); + uno::Reference xLabel2(xIndexAccess->getByIndex(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("2"), xLabel2->getString()); + uno::Reference xLabel3(xIndexAccess->getByIndex(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("3"), xLabel3->getString()); + uno::Reference xLabel4(xIndexAccess->getByIndex(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("4"), xLabel4->getString()); + uno::Reference xLabel5(xIndexAccess->getByIndex(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("5"), xLabel5->getString()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf121205) +{ + loadFromFile(u"pptx/tdf121205.pptx"); + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + + uno::Reference xTitled(xChartDoc, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("chart doc does not have title", xTitled.is()); + OUString aTitle = getTitleString(xTitled); + + // We expect title split in 3 lines + CPPUNIT_ASSERT_EQUAL(OUString("Firstline\nSecondline\nThirdline"), aTitle); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFixedSizeBarChartVeryLongLabel) +{ + // Bar chart area size is fixed (not automatic) so we can't resize + // the chart area to let the label break into multiple lines. In this + // case the best course of action is to just crop the label text. This + // test checks that the rendered text is actually cropped. + + loadFromFile(u"odp/BarChartVeryLongLabel.odp"); + + // Select shape 0 which has fixed size chart + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xHAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xHAxis.is()); + + chart2::ScaleData aScaleData = xHAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + + Reference xLabeledDataSequence = aScaleData.Categories; + CPPUNIT_ASSERT(xLabeledDataSequence.is()); + + Reference xDataSequence = xLabeledDataSequence->getValues(); + CPPUNIT_ASSERT(xDataSequence.is()); + + Reference xTextualDataSequence(xDataSequence, uno::UNO_QUERY); + CPPUNIT_ASSERT(xTextualDataSequence.is()); + + std::vector aCategories; + const Sequence aTextData(xTextualDataSequence->getTextualData()); + ::std::copy(aTextData.begin(), aTextData.end(), + ::std::back_inserter(aCategories)); + + // Check that we have a very very long label text + CPPUNIT_ASSERT_EQUAL(OUString("Very very very very very very very very very very very loooooooooooong label"), aCategories[0]); + + // Check visible text + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xXAxis = getShapeByName(xShapes, "CID/D=0:CS=0:Axis=0,0", + // Axis occurs twice in chart xshape representation so need to get the one related to labels + [](const uno::Reference& rXShape) -> bool + { + uno::Reference xAxisShapes(rXShape, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisShapes.is()); + uno::Reference xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY); + uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xChildShape, uno::UNO_QUERY_THROW); + return (xShapeDescriptor->getShapeType() == "com.sun.star.drawing.TextShape"); + }); + CPPUNIT_ASSERT(xXAxis.is()); + + uno::Reference xIndexAccess(xXAxis, UNO_QUERY_THROW); + + // Check text is actually cropped. Depending on DPI, + // it may be "Very very very very very very..." or "Very very very very very ver..." + uno::Reference xLabel(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW); + const OUString aLabelString = xLabel->getString(); + CPPUNIT_ASSERT_LESSEQUAL(sal_Int32(32), aLabelString.getLength()); + CPPUNIT_ASSERT(aLabelString.endsWith(u"...")); + + uno::Reference xChartWall = getShapeByName(xShapes, "CID/DiagramWall="); + CPPUNIT_ASSERT(xChartWall.is()); + + // The text shape width should be smaller than the chart wall + CPPUNIT_ASSERT_LESS(xChartWall->getSize().Width, xXAxis->getSize().Width); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(7113, xChartWall->getSize().Height, 100); + CPPUNIT_ASSERT_DOUBLES_EQUAL(398, xXAxis->getSize().Height, 100); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutomaticSizeBarChartVeryLongLabel) +{ + // Bar chart area size is automatic so we expect the label to be broken + // into multiple lines. + + loadFromFile(u"odp/BarChartVeryLongLabel.odp"); + + // Select shape 1, which has an automatic sized chart + Reference xChartDoc(getChartDocFromDrawImpress(0, 1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xHAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xHAxis.is()); + + chart2::ScaleData aScaleData = xHAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + + Reference xLabeledDataSequence = aScaleData.Categories; + CPPUNIT_ASSERT(xLabeledDataSequence.is()); + + Reference xDataSequence = xLabeledDataSequence->getValues(); + CPPUNIT_ASSERT(xDataSequence.is()); + + Reference xTextualDataSequence(xDataSequence, uno::UNO_QUERY); + CPPUNIT_ASSERT(xTextualDataSequence.is()); + + std::vector aCategories; + const Sequence aTextData(xTextualDataSequence->getTextualData()); + ::std::copy(aTextData.begin(), aTextData.end(), + ::std::back_inserter(aCategories)); + + // Check that we have a very very long label text + CPPUNIT_ASSERT_EQUAL(OUString("Very very very very very very very very very very very loooooooooooong label"), aCategories[0]); + + // Check visible text + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xXAxis = getShapeByName(xShapes, "CID/D=0:CS=0:Axis=0,0", + // Axis occurs twice in chart xshape representation so need to get the one related to labels + [](const uno::Reference& rXShape) -> bool + { + uno::Reference xAxisShapes(rXShape, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisShapes.is()); + uno::Reference xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY); + uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xChildShape, uno::UNO_QUERY_THROW); + return (xShapeDescriptor->getShapeType() == "com.sun.star.drawing.TextShape"); + }); + CPPUNIT_ASSERT(xXAxis.is()); + + uno::Reference xIndexAccess(xXAxis, UNO_QUERY_THROW); + + // Check text is unmodified + uno::Reference xLabel(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Very very very very very very very very very very very loooooooooooong label"), xLabel->getString()); + + uno::Reference xChartWall = getShapeByName(xShapes, "CID/DiagramWall="); + CPPUNIT_ASSERT(xChartWall.is()); + + // The text shape width should be smaller than the chart wall + CPPUNIT_ASSERT_LESS(xChartWall->getSize().Width, xXAxis->getSize().Width); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(7200, xChartWall->getSize().Height, 100); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1192, xXAxis->getSize().Height, 100); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTotalsRowIgnored) +{ + loadFromFile(u"xlsx/barchart_totalsrow.xlsx"); + { + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xDataSeq = + getDataSequenceFromDocByRole(xChartDoc, u"values-y"); + CPPUNIT_ASSERT(xDataSeq.is()); + + // Table data range is D2:D9 (8 rows) but because last row is totals row it is ignored + CPPUNIT_ASSERT_EQUAL(static_cast(7u), xDataSeq->getData().size()); + } + { + uno::Reference xChartDoc = getChartDocFromSheet(1, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xDataSeq = + getDataSequenceFromDocByRole(xChartDoc, u"values-y"); + CPPUNIT_ASSERT(xDataSeq.is()); + + // Table data range is D2:D10 (9 rows) and totals row isn't the last row so it's not ignored + CPPUNIT_ASSERT_EQUAL(static_cast(9u), xDataSeq->getData().size()); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPieChartPlotAreaMarginWithAutomaticLayout) +{ + // tdf#91265 + // Checks the margin and calculation of the plot area for the pie chart inside the chart area. + + loadFromFile(u"pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx"); + + OUString aCheckShapeName = "CID/D=0:CS=0:CT=0:Series=0"; + // Chart Wuse case Width == Height + { + // Load chart Chart_2_2 - 2cm x 2cm - + auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_2_2"); + CPPUNIT_ASSERT(xDocument.is()); + + uno::ReferencexChartDocument(xDocument, uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDocument.is()); + + // Get the shape of the diagram / chart + uno::Reference xDrawPageSupplier(xChartDocument, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDrawPageSupplier.is()); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xChartDiagramShape = getShapeByName(xShapes, aCheckShapeName); + CPPUNIT_ASSERT(xChartDiagramShape.is()); + + // Size + CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, xChartDiagramShape->getSize().Width, 5); // calculated chart area size - 2 * margin + CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, xChartDiagramShape->getSize().Height, 5); // calculated chart area size - 2 * margin + // Position + CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().X, 5); // margin + CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().Y, 5); // margin + } + + // Chart use case - Width < Height + { + // Load chart Chart_3_4 - 3cm x 4cm + auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_3_4"); + CPPUNIT_ASSERT(xDocument.is()); + + uno::ReferencexChartDocument(xDocument, uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDocument.is()); + + // Get the shape of the diagram / chart + uno::Reference xDrawPageSupplier(xChartDocument, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDrawPageSupplier.is()); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xChartDiagramShape = getShapeByName(xShapes, aCheckShapeName); + CPPUNIT_ASSERT(xChartDiagramShape.is()); + + // Size + CPPUNIT_ASSERT_DOUBLES_EQUAL(2300, xChartDiagramShape->getSize().Width, 5); // calculated chart area size - 2 * margin + CPPUNIT_ASSERT_DOUBLES_EQUAL(2300, xChartDiagramShape->getSize().Height, 5); // calculated chart area size - 2 * margin + // Position + CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().X, 5); // margin + CPPUNIT_ASSERT_DOUBLES_EQUAL(850, xChartDiagramShape->getPosition().Y, 5); // margin + calculated centering + } + + // Chart use case - Width > Height + { + // Load chart Chart_3_2 - 3cm x 2cm + auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_3_2"); + CPPUNIT_ASSERT(xDocument.is()); + + uno::ReferencexChartDocument(xDocument, uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDocument.is()); + + // Get the shape of the diagram / chart + uno::Reference xDrawPageSupplier(xChartDocument, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDrawPageSupplier.is()); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xChartDiagramShape = getShapeByName(xShapes, aCheckShapeName); + CPPUNIT_ASSERT(xChartDiagramShape.is()); + + // Size + CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, xChartDiagramShape->getSize().Width, 5); // calculated chart area size - 2 * margin + CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, xChartDiagramShape->getSize().Height, 5); // calculated chart area size - 2 * margin + // Position + CPPUNIT_ASSERT_DOUBLES_EQUAL(850, xChartDiagramShape->getPosition().X, 5); // margin + calculated centering + CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().Y, 5); // margin + } +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2import2.cxx b/chart2/qa/extras/chart2import2.cxx new file mode 100644 index 0000000000..863d425ae9 --- /dev/null +++ b/chart2/qa/extras/chart2import2.cxx @@ -0,0 +1,892 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Chart2ImportTest2 : public ChartTest +{ +public: + Chart2ImportTest2() + : ChartTest("/chart2/qa/extras/data/") + { + } +}; + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf114179) +{ + loadFromFile(u"docx/testTdf114179.docx"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + css::uno::Reference xDiagram; + xDiagram.set(xChartDoc->getFirstDiagram()); + CPPUNIT_ASSERT_MESSAGE("There is a Diagram.", xDiagram.is()); + awt::Size aPage = getPageSize(xChartDoc); + awt::Size aSize = getSize(xDiagram, aPage); + CPPUNIT_ASSERT(aSize.Width > 0); + CPPUNIT_ASSERT(aSize.Height > 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf124243) +{ + loadFromFile(u"docx/tdf124243.docx"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + + Reference xPS(xAxis, uno::UNO_QUERY_THROW); + bool bShow = true; + // test X Axis is not visible. + bool bSuccess = xPS->getPropertyValue("Show") >>= bShow; + CPPUNIT_ASSERT(bSuccess); + CPPUNIT_ASSERT(!bShow); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf127393) +{ + loadFromFile(u"pptx/tdf127393.pptx"); + + // 1st chart + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + + chart2::ScaleData aScaleData1 = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData1.Categories.is()); + CPPUNIT_ASSERT(aScaleData1.ShiftedCategoryPosition); + + // 2nd chart + xChartDoc.set(getChartDocFromDrawImpress(1, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + xAxis.set(getAxisFromDoc(xChartDoc, 0, 0, 0)); + CPPUNIT_ASSERT(xAxis.is()); + + chart2::ScaleData aScaleData2 = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData2.Categories.is()); + CPPUNIT_ASSERT(!aScaleData2.ShiftedCategoryPosition); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf128733) +{ + loadFromFile(u"odt/tdf128733.odt"); + + Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + // test secondary X axis ShiftedCategoryPosition value + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 1); + CPPUNIT_ASSERT(xAxis.is()); + + chart2::ScaleData aScaleData = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf128432) +{ + loadFromFile(u"ods/tdf128432.ods"); + + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + + chart2::ScaleData aScaleData = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf128627) +{ + loadFromFile(u"xlsx/tdf128627.xlsx"); + // Test ShiftedCategoryPosition for Radar Chart + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + + chart2::ScaleData aScaleData = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + CPPUNIT_ASSERT(!aScaleData.ShiftedCategoryPosition); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf128634) +{ + loadFromFile(u"xlsx/tdf128634.xlsx"); + // Test ShiftedCategoryPosition for 3D Charts + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + + chart2::ScaleData aScaleData = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf130657) +{ + loadFromFile(u"xlsx/tdf130657.xlsx"); + // Test ShiftedCategoryPosition for charts which is not contain a "crossbetween" OOXML tag. + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + + chart2::ScaleData aScaleData = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition); +} + +namespace +{ +void checkDataLabelProperties(const Reference& xDataSeries, + sal_Int32 nDataPointIndex, bool bValueVisible) +{ + uno::Reference xPropertySet( + xDataSeries->getDataPointByIndex(nDataPointIndex), uno::UNO_SET_THROW); + chart2::DataPointLabel aLabel; + xPropertySet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(bValueVisible, static_cast(aLabel.ShowNumber)); + CPPUNIT_ASSERT_EQUAL(false, static_cast(aLabel.ShowNumberInPercent)); +} +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testDeletedDataLabel) +{ + loadFromFile(u"xlsx/deleted_data_labels.xlsx"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + UNO_QUERY_THROW); + Reference xDataSeries0 = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries0.is()); + checkDataLabelProperties(xDataSeries0, 0, true); + checkDataLabelProperties(xDataSeries0, 1, false); + checkDataLabelProperties(xDataSeries0, 2, true); + Reference xDataSeries1 = getDataSeriesFromDoc(xChartDoc, 1); + CPPUNIT_ASSERT(xDataSeries1.is()); + checkDataLabelProperties(xDataSeries1, 0, false); + checkDataLabelProperties(xDataSeries1, 1, false); + checkDataLabelProperties(xDataSeries1, 2, false); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testDataPointInheritedColorDOCX) +{ + loadFromFile(u"docx/data_point_inherited_color.docx"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + css::uno::Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW); + + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), + uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xPropertySet.is()); + sal_Int32 nColor = xPropertySet->getPropertyValue("FillColor").get(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), nColor); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testExternalStrRefsXLSX) +{ + loadFromFile(u"xlsx/external_str_ref.xlsx"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + chart2::ScaleData aScaleData = xAxis->getScaleData(); + css::uno::Sequence aValues = aScaleData.Categories->getValues()->getData(); + CPPUNIT_ASSERT_EQUAL(OUString("test1"), aValues[0].get()); + CPPUNIT_ASSERT_EQUAL(OUString("test2"), aValues[1].get()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testSourceNumberFormatComplexCategoriesXLS) +{ + loadFromFile(u"xls/source_number_format_axis.xls"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + chart2::ScaleData aScaleData = xAxis->getScaleData(); + sal_Int32 nNumberFormat = aScaleData.Categories->getValues()->getNumberFormatKeyByIndex(-1); + CPPUNIT_ASSERT(nNumberFormat != 0); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testSimpleCategoryAxis) +{ + loadFromFile(u"docx/testSimpleCategoryAxis.docx"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // Test the internal data. + CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider()); + + Reference xInternalProvider(xChartDoc->getDataProvider(), + uno::UNO_QUERY); + CPPUNIT_ASSERT(xInternalProvider.is()); + + Reference xDescAccess(xInternalProvider, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDescAccess.is()); + + // Get the category labels. + Sequence> aCategories = xDescAccess->getComplexRowDescriptions(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aCategories[0].getLength()); + CPPUNIT_ASSERT(aCategories[0][0].endsWith("ria 1")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aCategories[1].getLength()); + CPPUNIT_ASSERT(aCategories[1][0].endsWith("ria 2")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aCategories[2].getLength()); + CPPUNIT_ASSERT(aCategories[2][0].endsWith("ria 3")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aCategories[3].getLength()); + CPPUNIT_ASSERT(aCategories[3][0].endsWith("ria 4")); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testMultilevelCategoryAxis) +{ + loadFromFile(u"docx/testMultilevelCategoryAxis.docx"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + // Test the internal data. + CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider()); + + Reference xInternalProvider(xChartDoc->getDataProvider(), + uno::UNO_QUERY); + CPPUNIT_ASSERT(xInternalProvider.is()); + + Reference xDescAccess(xInternalProvider, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDescAccess.is()); + + // Get the complex category labels. + Sequence> aCategories = xDescAccess->getComplexRowDescriptions(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aCategories.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("2011"), aCategories[0][0]); + CPPUNIT_ASSERT_EQUAL(OUString(""), aCategories[1][0]); + CPPUNIT_ASSERT_EQUAL(OUString("2012"), aCategories[2][0]); + CPPUNIT_ASSERT_EQUAL(OUString(""), aCategories[3][0]); + CPPUNIT_ASSERT_EQUAL(OUString("Categoria 1"), aCategories[0][1]); + CPPUNIT_ASSERT_EQUAL(OUString("Categoria 2"), aCategories[1][1]); + CPPUNIT_ASSERT_EQUAL(OUString("Categoria 3"), aCategories[2][1]); + CPPUNIT_ASSERT_EQUAL(OUString("Categoria 4"), aCategories[3][1]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testXaxisValues) +{ + loadFromFile(u"docx/tdf124083.docx"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + const uno::Reference xDataSeq + = getDataSequenceFromDocByRole(xChartDoc, u"values-x"); + Sequence xSequence = xDataSeq->getData(); + // test X values + CPPUNIT_ASSERT_EQUAL(uno::Any(0.04), xSequence[0]); + CPPUNIT_ASSERT(std::isnan(*static_cast(xSequence[1].getValue()))); + CPPUNIT_ASSERT_EQUAL(uno::Any(0.16), xSequence[2]); + CPPUNIT_ASSERT_EQUAL(uno::Any(0.11), xSequence[3]); + CPPUNIT_ASSERT(std::isnan(*static_cast(xSequence[4].getValue()))); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf123504) +{ + loadFromFile(u"ods/pie_chart_100_and_0.ods"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference xChartType(getChartTypeFromDoc(xChartDoc2, 0), UNO_SET_THROW); + std::vector aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + CPPUNIT_ASSERT_EQUAL(size_t(1), aDataSeriesYValues.size()); + + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xSeriesSlices(getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=0"), + UNO_SET_THROW); + + Reference xIndexAccess(xSeriesSlices, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + Reference xSlice(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); + + // Check size and position of the only slice in the chart (100%) + // In the regressed state, it used to be 0-sized at position 0,0 + awt::Point aSlicePosition = xSlice->getPosition(); + CPPUNIT_ASSERT_GREATER(sal_Int32(3000), aSlicePosition.X); + CPPUNIT_ASSERT_GREATER(sal_Int32(150), aSlicePosition.Y); + awt::Size aSliceSize = xSlice->getSize(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(8300.0, aSliceSize.Height, 10); + CPPUNIT_ASSERT_DOUBLES_EQUAL(8300.0, aSliceSize.Width, 10); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf122765) +{ + // The horizontal position of the slices was wrong. + loadFromFile(u"pptx/tdf122765.pptx"); + Reference xChartDoc = getChartDocFromDrawImpress(0, 0); + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xSeriesSlices(getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=0"), + UNO_SET_THROW); + + Reference xIndexAccess(xSeriesSlices, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), xIndexAccess->getCount()); + Reference xSlice(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); + + // Check position of the first slice, all slices move together, so enough to check only one. + // Wrong position was around 5856. + awt::Point aSlicePosition = xSlice->getPosition(); + CPPUNIT_ASSERT_GREATER(sal_Int32(7000), aSlicePosition.X); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf123206CustomLabelField) +{ + // File contains the deprecated "custom-label-field" attribute of the + // "data-point" element. It should be interpreted and stored as a data point + // property. + loadFromFile(u"odp/tdf123206.odp"); + uno::Reference xChartDoc(getChartDocFromDrawImpress(0, 0), + uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xDp = xDataSeries->getDataPointByIndex(1); + Sequence> aLabelFields; + CPPUNIT_ASSERT(xDp->getPropertyValue("CustomLabelFields") >>= aLabelFields); + CPPUNIT_ASSERT_EQUAL(static_cast(1), aLabelFields.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("Kiskacsa"), aLabelFields[0]->getString()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf125444PercentageCustomLabel) +{ + loadFromFile(u"pptx/tdf125444.pptx"); + + // 1st chart + Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xDp = xDataSeries->getDataPointByIndex(1); + Sequence> aLabelFields; + CPPUNIT_ASSERT(xDp->getPropertyValue("CustomLabelFields") >>= aLabelFields); + // There are three label field: a value label, a newline and a percentage label. We want + // to assert the latter. + CPPUNIT_ASSERT_EQUAL(static_cast(3), aLabelFields.getLength()); + CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType_PERCENTAGE, + aLabelFields[2]->getFieldType()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testDataPointLabelCustomPos) +{ + // test CustomLabelPosition on Bar chart + loadFromFile(u"xlsx/testDataPointLabelCustomPos.xlsx"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(0), + uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xPropertySet.is()); + + chart2::RelativePosition aCustomLabelPosition; + xPropertySet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition; + CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.14621409921671025, aCustomLabelPosition.Primary, 1e-7); + CPPUNIT_ASSERT_DOUBLES_EQUAL(-5.2887961029923464E-2, aCustomLabelPosition.Secondary, 1e-7); + + sal_Int32 aPlacement; + xPropertySet->getPropertyValue("LabelPlacement") >>= aPlacement; + CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::OUTSIDE, aPlacement); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf130032) +{ + // test CustomLabelPosition on Line chart + loadFromFile(u"xlsx/testTdf130032.xlsx"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(1), + uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xPropertySet.is()); + + chart2::RelativePosition aCustomLabelPosition; + xPropertySet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition; + CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.0438333333333334, aCustomLabelPosition.Primary, 1e-7); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.086794050743657, aCustomLabelPosition.Secondary, 1e-7); + + sal_Int32 aPlacement; + xPropertySet->getPropertyValue("LabelPlacement") >>= aPlacement; + CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::RIGHT, aPlacement); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf134978) +{ + // test CustomLabelPosition on Pie chart + loadFromFile(u"xlsx/tdf134978.xlsx"); + uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference xPropertySet(xDataSeries->getDataPointByIndex(2), + uno::UNO_SET_THROW); + CPPUNIT_ASSERT(xPropertySet.is()); + + chart2::RelativePosition aCustomLabelPosition; + xPropertySet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition; + CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.040273622047244093, aCustomLabelPosition.Primary, 1e-7); + CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.25635352872557599, aCustomLabelPosition.Secondary, 1e-7); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf119138MissingAutoTitleDeleted) +{ + loadFromFile(u"xlsx/tdf119138-missing-autotitledeleted.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference xTitled(xChartDoc, uno::UNO_QUERY_THROW); + uno::Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT_MESSAGE( + "Missing autoTitleDeleted is implied to be True if title text is present", xTitle.is()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testStockChartShiftedCategoryPosition) +{ + loadFromFile(u"odt/stock_chart_LO_6_2.odt"); + + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + + chart2::ScaleData aScaleData = xAxis->getScaleData(); + CPPUNIT_ASSERT(aScaleData.Categories.is()); + CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf133376) +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + loadFromFile(u"xlsx/tdf133376.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xDataPointLabel( + getShapeByName(xShapes, + "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2"), + UNO_SET_THROW); + + CPPUNIT_ASSERT(xDataPointLabel.is()); + // Check the position of the 3rd data point label, which is out from the pie slice + awt::Point aLabelPosition = xDataPointLabel->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1208, aLabelPosition.X, 30); + CPPUNIT_ASSERT_DOUBLES_EQUAL(5370, aLabelPosition.Y, 30); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf134225) +{ + loadFromFile(u"xlsx/tdf134225.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xDataPointLabel1( + getShapeByName(xShapes, + "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), + UNO_SET_THROW); + CPPUNIT_ASSERT(xDataPointLabel1.is()); + + Reference xDataPointLabel2( + getShapeByName(xShapes, + "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1"), + UNO_SET_THROW); + CPPUNIT_ASSERT(xDataPointLabel2.is()); + +#if defined(_WIN32) + // font is MS Comic Sans which we can only assume is available under windows + awt::Point aLabelPosition1 = xDataPointLabel1->getPosition(); + awt::Point aLabelPosition2 = xDataPointLabel2->getPosition(); + + // Check the distance between the position of the 1st data point label and the second one + CPPUNIT_ASSERT_DOUBLES_EQUAL(1493, sal_Int32(aLabelPosition2.X - aLabelPosition1.X), 30); + CPPUNIT_ASSERT_DOUBLES_EQUAL(2015, sal_Int32(aLabelPosition2.Y - aLabelPosition1.Y), 30); +#endif +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf136105) +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + loadFromFile(u"xlsx/tdf136105.xlsx"); + // 1st chart with fix inner position and size + { + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xDataPointLabel( + getShapeByName(xShapes, + "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), + UNO_SET_THROW); + + CPPUNIT_ASSERT(xDataPointLabel.is()); + // Check the position of the 1st data point label, which is out from the pie slice + awt::Point aLabelPosition = xDataPointLabel->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(8797, aLabelPosition.X, 500); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1374, aLabelPosition.Y, 500); + } + // 2nd chart with auto inner position and size + { + Reference xChartDoc(getChartDocFromSheet(1, mxComponent), + UNO_QUERY_THROW); + + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xDataPointLabel( + getShapeByName(xShapes, + "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), + UNO_SET_THROW); + + CPPUNIT_ASSERT(xDataPointLabel.is()); + // Check the position of the 1st data point label, which is out from the pie slice + awt::Point aLabelPosition = xDataPointLabel->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(7978, aLabelPosition.X, 500); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1550, aLabelPosition.Y, 500); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf91250) +{ + loadFromFile(u"docx/tdf91250.docx"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xInternalProvider(xChartDoc->getDataProvider(), + uno::UNO_QUERY); + CPPUNIT_ASSERT(xInternalProvider.is()); + + Reference xDescAccess(xInternalProvider, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDescAccess.is()); + + // Get the category labels. + Sequence aCategories = xDescAccess->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aCategories.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("12.3254"), aCategories[0]); + CPPUNIT_ASSERT_EQUAL(OUString("11.62315"), aCategories[1]); + CPPUNIT_ASSERT_EQUAL(OUString("9.26"), aCategories[2]); + CPPUNIT_ASSERT_EQUAL(OUString("8.657"), aCategories[3]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf134111) +{ + // tdf134111 : To check TextBreak value is true + loadFromFile(u"docx/tdf134111.docx"); + uno::Reference xChartDoc = getChartDocFromWriter(0); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + uno::Reference mxDiagram(xChartDoc->getDiagram()); + CPPUNIT_ASSERT(mxDiagram.is()); + uno::Reference xAxisXSupp(mxDiagram, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisXSupp.is()); + uno::Reference xAxisProp(xAxisXSupp->getXAxis()); + bool bTextBreak = false; + xAxisProp->getPropertyValue("TextBreak") >>= bTextBreak; + // Expected value of 'TextBreak' is true + CPPUNIT_ASSERT(bTextBreak); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf136752) +{ + loadFromFile(u"xlsx/tdf136752.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xDataPointLabel( + getShapeByName(xShapes, + "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), + UNO_SET_THROW); + + CPPUNIT_ASSERT(xDataPointLabel.is()); + // Check the position of the 1st data point label, which is out from the pie slice + awt::Point aLabelPosition = xDataPointLabel->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(8675, aLabelPosition.X, 500); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1458, aLabelPosition.Y, 500); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf137505) +{ + loadFromFile(u"xlsx/tdf137505.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xCustomShape(xDrawPage->getByIndex(1), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xCustomShape.is()); + + float nFontSize; + Reference xRange(xCustomShape, uno::UNO_QUERY_THROW); + Reference xAt = xRange->createTextCursor(); + Reference xProps(xAt, UNO_QUERY); + // check the text size of custom shape, inside the chart. + CPPUNIT_ASSERT(xProps->getPropertyValue("CharHeight") >>= nFontSize); + CPPUNIT_ASSERT_EQUAL(float(12), nFontSize); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf137734) +{ + loadFromFile(u"xlsx/tdf137734.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference xPropSet(xDataSeries, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint"); + bool bVaryColor = true; + CPPUNIT_ASSERT(aAny >>= bVaryColor); + CPPUNIT_ASSERT(!bVaryColor); + + // tdf#126133 Test primary X axis Rotation value + Reference xXAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xXAxis.is()); + Reference xTitled(xXAxis, uno::UNO_QUERY_THROW); + Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(xTitle.is()); + Reference xTitlePropSet(xTitle, uno::UNO_QUERY_THROW); + uno::Any aAny2 = xTitlePropSet->getPropertyValue("TextRotation"); + double nRotation = -1; + CPPUNIT_ASSERT(aAny2 >>= nRotation); + CPPUNIT_ASSERT_EQUAL(0.0, nRotation); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf137874) +{ + loadFromFile(u"xlsx/piechart_legend.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xLegendEntry; + xLegendEntry + = getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0:LegendEntry=0"); + CPPUNIT_ASSERT(xLegendEntry.is()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf146463) +{ + loadFromFile(u"ods/tdf146463.ods"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent)); + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xChartType = getChartTypeFromDoc(xChartDoc, 0); + std::vector> aDataSeriesYValues + = getDataSeriesYValuesFromChartType(xChartType); + size_t nLegendEntryCount = aDataSeriesYValues.size(); + CPPUNIT_ASSERT_EQUAL(size_t(14), nLegendEntryCount); + + for (size_t nSeriesIndex = 0; nSeriesIndex < nLegendEntryCount; ++nSeriesIndex) + { + uno::Reference xLegendEntry + = getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=" + + OUString::number(nSeriesIndex) + ":LegendEntry=0"); + if (nSeriesIndex == 0) + CPPUNIT_ASSERT_MESSAGE("Legend 0 is not visible", xLegendEntry.is()); + else + CPPUNIT_ASSERT_MESSAGE( + OString("Legend " + OString::number(nSeriesIndex) + " is visible").getStr(), + !xLegendEntry.is()); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdfCustomShapePos) +{ + loadFromFile(u"docx/testcustomshapepos.docx"); + Reference xChartDoc(getChartDocFromWriter(0), UNO_QUERY_THROW); + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + // test position and size of a custom shape within a chart, rotated by 0 degree. + { + Reference xCustomShape(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + awt::Point aPosition = xCustomShape->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(8845, aPosition.X, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(855, aPosition.Y, 300); + awt::Size aSize = xCustomShape->getSize(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(4831, aSize.Width, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1550, aSize.Height, 300); + } + // test position and size of a custom shape within a chart, rotated by 90 degree. + { + Reference xCustomShape(xDrawPage->getByIndex(1), UNO_QUERY_THROW); + awt::Point aPosition = xCustomShape->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1658, aPosition.X, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(6119, aPosition.Y, 300); + awt::Size aSize = xCustomShape->getSize(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(4165, aSize.Width, 300); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1334, aSize.Height, 300); + } +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf121281) +{ + loadFromFile(u"xlsx/incorrect_label_position.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xDataPointLabel( + getShapeByName(xShapes, + "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), + UNO_SET_THROW); + + CPPUNIT_ASSERT(xDataPointLabel.is()); + awt::Point aLabelPosition = xDataPointLabel->getPosition(); + // This failed, if the data label flowed out of the chart area. + CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), aLabelPosition.Y); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf139658) +{ + loadFromFile(u"docx/tdf139658.docx"); + uno::Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference xInternalProvider(xChartDoc->getDataProvider(), + uno::UNO_QUERY); + CPPUNIT_ASSERT(xInternalProvider.is()); + + Reference xDescAccess(xInternalProvider, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDescAccess.is()); + + // Get the category labels. + Sequence aCategories = xDescAccess->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aCategories.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("category1"), aCategories[0]); + CPPUNIT_ASSERT_EQUAL(OUString("\"category2\""), aCategories[1]); + CPPUNIT_ASSERT_EQUAL(OUString("category\"3"), aCategories[2]); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf146066) +{ + loadFromFile(u"ods/tdf146066.ods"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + uno::Reference xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapes.is()); + + uno::Reference xYAxisShape = getShapeByName( + xShapes, "CID/D=0:CS=0:Axis=1,0", // Y Axis + // Axis occurs twice in chart xshape representation so need to get the one related to labels + [](const uno::Reference& rXShape) -> bool { + uno::Reference xAxisShapes(rXShape, uno::UNO_QUERY); + CPPUNIT_ASSERT(xAxisShapes.is()); + uno::Reference xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY); + uno::Reference xShapeDescriptor(xChildShape, + uno::UNO_QUERY_THROW); + return (xShapeDescriptor->getShapeType() == "com.sun.star.drawing.TextShape"); + }); + CPPUNIT_ASSERT(xYAxisShape.is()); + + // Check label count + uno::Reference xIndexAccess(xYAxisShape, UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(static_cast(8), xIndexAccess->getCount()); + + // Check text + uno::Reference xLabel0(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("0"), xLabel0->getString()); + uno::Reference xLabel1(xIndexAccess->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("5"), xLabel1->getString()); + uno::Reference xLabel2(xIndexAccess->getByIndex(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("10"), xLabel2->getString()); + uno::Reference xLabel3(xIndexAccess->getByIndex(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("15"), xLabel3->getString()); + uno::Reference xLabel4(xIndexAccess->getByIndex(4), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("20"), xLabel4->getString()); + uno::Reference xLabel5(xIndexAccess->getByIndex(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("25"), xLabel5->getString()); + uno::Reference xLabel6(xIndexAccess->getByIndex(6), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("30"), xLabel6->getString()); + uno::Reference xLabel7(xIndexAccess->getByIndex(7), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("35"), xLabel7->getString()); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf150434) +{ + loadFromFile(u"xlsx/tdf150434.xlsx"); + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xLegend = getShapeByName(xShapes, "CID/D=0:Legend="); + CPPUNIT_ASSERT(xLegend.is()); + awt::Point aPosition = xLegend->getPosition(); + + // This failed, if the legend flowed out of the chart area. + CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), aPosition.Y); +} + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testChartDataTableWithMultipleLegendEntriesForOneDataSeries) +{ + loadFromFile(u"xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx"); + // Loading this file caused a crash in the data table code + + Reference xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference xDataTableShape = getShapeByName(xShapes, "CID/D=0:DataTable="); + CPPUNIT_ASSERT(xDataTableShape.is()); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx new file mode 100644 index 0000000000..db416affaa --- /dev/null +++ b/chart2/qa/extras/charttest.hxx @@ -0,0 +1,605 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +using namespace css; +using namespace css::uno; + +namespace com::sun::star::chart2 { class XDataSeries; } +namespace com::sun::star::chart2 { class XDiagram; } +namespace com::sun::star::table { class XTableCharts; } +namespace com::sun::star::table { class XTablePivotCharts; } + +class ChartTest : public UnoApiXmlTest +{ +public: + ChartTest(OUString path) + : UnoApiXmlTest(path) + { + } + + uno::Sequence < OUString > getImpressChartColumnDescriptions(sal_Int32 nPage, sal_Int32 nShape); + + uno::Reference getChartDocFromDrawImpress( sal_Int32 nPage, sal_Int32 nShape ); + uno::Reference getChartDocFromDrawImpressNamed( sal_Int32 nPage, std::u16string_view rName); + + + uno::Reference getChartDocFromWriter( sal_Int32 nShape ); + Sequence< OUString > getFormattedDateCategories( const Reference& xChartDoc ); + awt::Size getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ); + awt::Size getSize(css::uno::Reference xDiagram, const awt::Size& rPageSize); +}; + +Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, sal_Int32 nChart, uno::Reference< lang::XComponent > const & xComponent ) +{ + // let us assume that we only have one chart per sheet + + uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComponent, UNO_QUERY_THROW); + + uno::Reference< container::XIndexAccess > xIA(xDoc->getSheets(), UNO_QUERY_THROW); + + uno::Reference< table::XTableChartsSupplier > xChartSupplier( xIA->getByIndex(nSheet), UNO_QUERY_THROW); + + uno::Reference< table::XTableCharts > xCharts = xChartSupplier->getCharts(); + CPPUNIT_ASSERT(xCharts.is()); + + uno::Reference< container::XIndexAccess > xIACharts(xCharts, UNO_QUERY_THROW); + uno::Reference< table::XTableChart > xChart( xIACharts->getByIndex(nChart), UNO_QUERY_THROW); + + uno::Reference< document::XEmbeddedObjectSupplier > xEmbObjectSupplier(xChart, UNO_QUERY_THROW); + + uno::Reference< lang::XComponent > xChartComp( xEmbObjectSupplier->getEmbeddedObject(), UNO_SET_THROW ); + + return xChartComp; + +} + +Reference< chart2::XChartDocument > getChartDocFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > const & xComponent ) +{ + uno::Reference< chart2::XChartDocument > xChartDoc ( getChartCompFromSheet(nSheet, 0, xComponent), UNO_QUERY_THROW ); + + // Update the chart view, so that its draw page is updated and ready for the test + css::uno::Reference xModel(xChartDoc, css::uno::UNO_QUERY_THROW); + ChartHelper::updateChart(xModel); + + return xChartDoc; +} + +uno::Reference getTablePivotChartsFromSheet(sal_Int32 nSheet, uno::Reference const & xComponent) +{ + uno::Reference xDoc(xComponent, UNO_QUERY_THROW); + + uno::Reference xIA(xDoc->getSheets(), UNO_QUERY_THROW); + + uno::Reference xChartSupplier(xIA->getByIndex(nSheet), UNO_QUERY_THROW); + + uno::Reference xTablePivotCharts = xChartSupplier->getPivotCharts(); + CPPUNIT_ASSERT(xTablePivotCharts.is()); + + return xTablePivotCharts; +} + +Reference getPivotChartCompFromSheet(sal_Int32 nSheet, uno::Reference const & xComponent) +{ + uno::Reference xTablePivotCharts = getTablePivotChartsFromSheet(nSheet, xComponent); + + uno::Reference xIACharts(xTablePivotCharts, UNO_QUERY_THROW); + uno::Reference xTablePivotChart(xIACharts->getByIndex(0), UNO_QUERY_THROW); + + uno::Reference xEmbObjectSupplier(xTablePivotChart, UNO_QUERY_THROW); + + uno::Reference xChartComp(xEmbObjectSupplier->getEmbeddedObject(), UNO_SET_THROW); + + return xChartComp; +} + +Reference getPivotChartDocFromSheet(sal_Int32 nSheet, uno::Reference const & xComponent) +{ + uno::Reference xChartDoc(getPivotChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW); + return xChartDoc; +} + +Reference getPivotChartDocFromSheet(uno::Reference const & xTablePivotCharts, sal_Int32 nIndex) +{ + uno::Reference xIACharts(xTablePivotCharts, UNO_QUERY_THROW); + uno::Reference xTablePivotChart(xIACharts->getByIndex(nIndex), UNO_QUERY_THROW); + + uno::Reference xEmbObjectSupplier(xTablePivotChart, UNO_QUERY_THROW); + + uno::Reference xChartComp(xEmbObjectSupplier->getEmbeddedObject(), UNO_SET_THROW); + + uno::Reference xChartDoc(xChartComp, UNO_QUERY_THROW); + return xChartDoc; +} + +Reference< chart2::XChartType > getChartTypeFromDoc( Reference< chart2::XChartDocument > const & xChartDoc, + sal_Int32 nChartType, sal_Int32 nCooSys = 0 ) +{ + CPPUNIT_ASSERT( xChartDoc.is() ); + + Reference xDiagram = xChartDoc->getFirstDiagram(); + CPPUNIT_ASSERT( xDiagram.is() ); + + Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, UNO_QUERY_THROW ); + + Sequence< Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems()); + CPPUNIT_ASSERT( xCooSysSequence.getLength() > nCooSys ); + + Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSysSequence[nCooSys], UNO_QUERY_THROW ); + + Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() ); + CPPUNIT_ASSERT( xChartTypeSequence.getLength() > nChartType ); + + return xChartTypeSequence[nChartType]; +} + +Reference getAxisFromDoc( + const Reference& xChartDoc, sal_Int32 nCooSys, sal_Int32 nAxisDim, sal_Int32 nAxisIndex ) +{ + Reference xDiagram = xChartDoc->getFirstDiagram(); + CPPUNIT_ASSERT(xDiagram.is()); + + Reference xCooSysContainer(xDiagram, UNO_QUERY_THROW); + + Sequence > xCooSysSequence = xCooSysContainer->getCoordinateSystems(); + CPPUNIT_ASSERT(xCooSysSequence.getLength() > nCooSys); + + Reference xCoord = xCooSysSequence[nCooSys]; + CPPUNIT_ASSERT(xCoord.is()); + + Reference xAxis = xCoord->getAxisByDimension(nAxisDim, nAxisIndex); + CPPUNIT_ASSERT(xAxis.is()); + + return xAxis; +} + +sal_Int32 getNumberOfDataSeries(uno::Reference const & xChartDoc, + sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0) +{ + Reference xChartType = getChartTypeFromDoc(xChartDoc, nChartType, nCooSys); + Reference xDataSeriesContainer(xChartType, UNO_QUERY_THROW); + + uno::Sequence> xSeriesSequence(xDataSeriesContainer->getDataSeries()); + return xSeriesSequence.getLength(); +} + +Reference< chart2::XDataSeries > getDataSeriesFromDoc(uno::Reference const & xChartDoc, + sal_Int32 nDataSeries, sal_Int32 nChartType = 0, + sal_Int32 nCooSys = 0) +{ + Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, nChartType, nCooSys ); + Reference< chart2::XDataSeriesContainer > xDataSeriesContainer( xChartType, UNO_QUERY_THROW ); + + Sequence< Reference< chart2::XDataSeries > > xSeriesSequence( xDataSeriesContainer->getDataSeries() ); + CPPUNIT_ASSERT( xSeriesSequence.getLength() > nDataSeries ); + + Reference< chart2::XDataSeries > xSeries = xSeriesSequence[nDataSeries]; + + return xSeries; +} + +Reference< chart2::data::XDataSequence > getLabelDataSequenceFromDoc( + Reference< chart2::XChartDocument > const & xChartDoc, + sal_Int32 nDataSeries = 0, sal_Int32 nChartType = 0 ) +{ + Reference< chart2::XDataSeries > xDataSeries = + getDataSeriesFromDoc( xChartDoc, nDataSeries, nChartType ); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference< chart2::data::XDataSource > xDataSource( xDataSeries, uno::UNO_QUERY_THROW ); + const Sequence< Reference< chart2::data::XLabeledDataSequence > > xDataSequences = + xDataSource->getDataSequences(); + for(auto const & lds : xDataSequences) + { + Reference< chart2::data::XDataSequence> xLabelSeq = lds->getLabel(); + if(!xLabelSeq.is()) + continue; + + return xLabelSeq; + } + + CPPUNIT_FAIL("no Label sequence found"); +} + +Reference< chart2::data::XDataSequence > getDataSequenceFromDocByRole( + Reference< chart2::XChartDocument > const & xChartDoc, std::u16string_view rRole, + sal_Int32 nDataSeries = 0, sal_Int32 nChartType = 0 ) +{ + Reference< chart2::XDataSeries > xDataSeries = + getDataSeriesFromDoc( xChartDoc, nDataSeries, nChartType ); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference< chart2::data::XDataSource > xDataSource( xDataSeries, uno::UNO_QUERY_THROW ); + const Sequence< Reference< chart2::data::XLabeledDataSequence > > xDataSequences = + xDataSource->getDataSequences(); + for(auto const & lds : xDataSequences) + { + Reference< chart2::data::XDataSequence> xLabelSeq = lds->getValues(); + uno::Reference< beans::XPropertySet > xProps(xLabelSeq, uno::UNO_QUERY); + if(!xProps.is()) + continue; + + OUString aRoleName = xProps->getPropertyValue("Role").get(); + + if(aRoleName == rRole) + return xLabelSeq; + } + + return Reference< chart2::data::XDataSequence > (); +} + +uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XComponent > const & mxComponent ) +{ + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT( xShape.is() ); + uno::Reference xPropertySet(xShape, uno::UNO_QUERY); + uno::Reference< chart2::XChartDocument > xChartDoc; + xChartDoc.set( xPropertySet->getPropertyValue( "Model" ), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xChartDoc.is() ); + CPPUNIT_ASSERT( xChartDoc->getDataProvider().is() ); + uno::Reference< chart2::XAnyDescriptionAccess > xAnyDescriptionAccess ( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW ); + uno::Sequence< OUString > seriesList = xAnyDescriptionAccess->getColumnDescriptions(); + return seriesList; +} + +std::vector > getDataSeriesYValuesFromChartType( const Reference& xCT ) +{ + Reference xDSCont(xCT, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDSCont.is()); + const Sequence > aDataSeriesSeq = xDSCont->getDataSeries(); + + std::vector > aRet; + for (uno::Reference const & ds : aDataSeriesSeq) + { + uno::Reference xDSrc(ds, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDSrc.is()); + const uno::Sequence > aDataSeqs = xDSrc->getDataSequences(); + for (auto const & lds : aDataSeqs) + { + Reference xValues = lds->getValues(); + CPPUNIT_ASSERT(xValues.is()); + Reference xPropSet(xValues, uno::UNO_QUERY); + if (!xPropSet.is()) + continue; + + OUString aRoleName; + xPropSet->getPropertyValue("Role") >>= aRoleName; + if (aRoleName == "values-y") + { + const uno::Sequence aData = xValues->getData(); + std::vector aValues; + aValues.reserve(aData.getLength()); + for (uno::Any const & any : aData) + { + double fVal; + if (any >>= fVal) + aValues.push_back(fVal); + else + aValues.push_back(std::numeric_limits::quiet_NaN()); + } + aRet.push_back(aValues); + } + } + } + + return aRet; +} + +std::vector > getDataSeriesLabelsFromChartType( const Reference& xCT ) +{ + OUString aLabelRole = xCT->getRoleOfSequenceForSeriesLabel(); + + Reference xDSCont(xCT, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDSCont.is()); + const Sequence > aDataSeriesSeq = xDSCont->getDataSeries(); + + std::vector > aRet; + for (auto const & ds : aDataSeriesSeq) + { + uno::Reference xDSrc(ds, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDSrc.is()); + const uno::Sequence > aDataSeqs = xDSrc->getDataSequences(); + for (auto const & lds : aDataSeqs) + { + Reference xValues = lds->getValues(); + CPPUNIT_ASSERT(xValues.is()); + Reference xPropSet(xValues, uno::UNO_QUERY); + if (!xPropSet.is()) + continue; + + OUString aRoleName; + xPropSet->getPropertyValue("Role") >>= aRoleName; + if (aRoleName == aLabelRole) + { + Reference xLabel = lds; + CPPUNIT_ASSERT(xLabel.is()); + Reference xDS2 = xLabel->getLabel(); + CPPUNIT_ASSERT(xDS2.is()); + uno::Sequence aData = xDS2->getData(); + aRet.push_back(aData); + } + } + } + + return aRet; +} + +uno::Reference ChartTest::getChartDocFromDrawImpress( + sal_Int32 nPage, sal_Int32 nShape ) +{ + uno::Reference xEmpty; + + uno::Reference xPages(mxComponent, uno::UNO_QUERY); + if (!xPages.is()) + return xEmpty; + + uno::Reference xPage( + xPages->getDrawPages()->getByIndex(nPage), uno::UNO_QUERY_THROW); + + uno::Reference xShapeProps(xPage->getByIndex(nShape), uno::UNO_QUERY); + if (!xShapeProps.is()) + return xEmpty; + + uno::Reference xDocModel; + xShapeProps->getPropertyValue("Model") >>= xDocModel; + if (!xDocModel.is()) + return xEmpty; + + uno::Reference xChartDoc(xDocModel, uno::UNO_QUERY); + return xChartDoc; +} + +uno::Reference ChartTest::getChartDocFromDrawImpressNamed(sal_Int32 nPage, std::u16string_view rName) +{ + uno::Reference xChart; + + uno::Reference xPages(mxComponent, uno::UNO_QUERY); + if (!xPages.is()) + return xChart; + + uno::Reference xPage(xPages->getDrawPages()->getByIndex(nPage), uno::UNO_QUERY); + if (!xPage.is()) + return xChart; + + for (sal_Int32 i=0; i < xPage->getCount(); ++i) + { + uno::Reference xNamedShape(xPage->getByIndex(i), uno::UNO_QUERY); + if (!xNamedShape.is()) + continue; + + if (xNamedShape->getName() != rName) + continue; + + uno::Reference xShapeProps(xNamedShape, uno::UNO_QUERY); + if (!xShapeProps.is()) + continue; + + uno::Reference xDocModel; + xShapeProps->getPropertyValue("Model") >>= xDocModel; + if (!xDocModel.is()) + continue; + + return uno::Reference(xDocModel, uno::UNO_QUERY); + } + + return xChart; +} + +uno::Reference ChartTest::getChartDocFromWriter( sal_Int32 nShape ) +{ + // DO NOT use XDrawPageSupplier since SwVirtFlyDrawObj are not created + // during import, only in layout! + Reference xEOS(mxComponent, uno::UNO_QUERY); + CPPUNIT_ASSERT(xEOS.is()); + Reference xEmbeddeds(xEOS->getEmbeddedObjects(), uno::UNO_QUERY); + CPPUNIT_ASSERT(xEmbeddeds.is()); + + Reference xShapeProps(xEmbeddeds->getByIndex(nShape), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShapeProps.is()); + + Reference xDocModel; + xShapeProps->getPropertyValue("Model") >>= xDocModel; + CPPUNIT_ASSERT(xDocModel.is()); + + uno::Reference xChartDoc(xDocModel, uno::UNO_QUERY); + return xChartDoc; +} + +uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions(sal_Int32 nPage, sal_Int32 nShape) +{ + uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromDrawImpress( nPage, nShape ); + uno::Reference< chart::XChartDataArray > xChartData ( xChartDoc->getData(), uno::UNO_QUERY_THROW); + uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions(); + return seriesList; +} + +OUString getTitleString( const Reference& xTitled ) +{ + uno::Reference xTitle = xTitled->getTitleObject(); + CPPUNIT_ASSERT(xTitle.is()); + const uno::Sequence > aFSSeq = xTitle->getText(); + OUString aText; + for (auto const & fs : aFSSeq) + aText += fs->getString(); + + return aText; +} + +sal_Int32 getNumberFormat( const Reference& xChartDoc, const OUString& sFormat ) +{ + Reference xNFS(xChartDoc, uno::UNO_QUERY_THROW); + Reference xNumberFormats = xNFS->getNumberFormats(); + CPPUNIT_ASSERT(xNumberFormats.is()); + + return xNumberFormats->queryKey(sFormat, css::lang::Locale(), false); +} + +sal_Int32 getNumberFormatFromAxis( const Reference& xAxis ) +{ + Reference xPS(xAxis, uno::UNO_QUERY); + CPPUNIT_ASSERT(xPS.is()); + sal_Int32 nNumberFormat = -1; + bool bSuccess = xPS->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat; + CPPUNIT_ASSERT(bSuccess); + + return nNumberFormat; +} + +sal_Int16 getNumberFormatType( const Reference& xChartDoc, sal_Int32 nNumberFormat ) +{ + Reference xNFS(xChartDoc, uno::UNO_QUERY_THROW); + Reference xNumberFormats = xNFS->getNumberFormats(); + CPPUNIT_ASSERT(xNumberFormats.is()); + + Reference xNumPS = xNumberFormats->getByKey(nNumberFormat); + CPPUNIT_ASSERT(xNumPS.is()); + + sal_Int16 nType = util::NumberFormat::UNDEFINED; + xNumPS->getPropertyValue("Type") >>= nType; + + return nType; +} + +Sequence< double > getDateCategories(const Reference& xChartDoc) +{ + CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider()); + uno::Reference< chart2::XInternalDataProvider > xDataProvider( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW ); + uno::Reference< chart::XDateCategories > xDateCategories( xDataProvider, uno::UNO_QUERY_THROW ); + CPPUNIT_ASSERT(xDateCategories.is()); + return xDateCategories->getDateCategories(); +} + +Sequence< OUString > ChartTest::getFormattedDateCategories( const Reference& xChartDoc ) +{ + Reference xNFS(xChartDoc, uno::UNO_QUERY_THROW); + Reference< util::XNumberFormatter > xNumFormatter( + util::NumberFormatter::create(comphelper::getComponentContext(m_xSFactory)), uno::UNO_QUERY_THROW ); + xNumFormatter->attachNumberFormatsSupplier(xNFS); + + Reference xAxisX = getAxisFromDoc(xChartDoc, 0, 0, 0); + chart2::ScaleData aScaleData = xAxisX->getScaleData(); + CPPUNIT_ASSERT_EQUAL(chart2::AxisType::DATE, aScaleData.AxisType); + + sal_Int32 nNumFmt = getNumberFormatFromAxis(xAxisX); + + Sequence aDateSeq = getDateCategories(xChartDoc); + const sal_Int32 nNumCategories = aDateSeq.getLength(); + Sequence aFormattedDates(nNumCategories); + auto aFormattedDatesRange = asNonConstRange(aFormattedDates); + + for (sal_Int32 nIdx = 0; nIdx < nNumCategories; ++nIdx) + aFormattedDatesRange[nIdx] = xNumFormatter->convertNumberToString(nNumFmt, aDateSeq[nIdx]); + + return aFormattedDates; +} + +awt::Size ChartTest::getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ) +{ + awt::Size aSize( 0, 0 ); + uno::Reference< com::sun::star::embed::XVisualObject > xVisualObject( xChartDoc, uno::UNO_QUERY ); + CPPUNIT_ASSERT( xVisualObject.is() ); + aSize = xVisualObject->getVisualAreaSize( com::sun::star::embed::Aspects::MSOLE_CONTENT ); + return aSize; +} + +awt::Size ChartTest::getSize(css::uno::Reference xDiagram, const awt::Size& rPageSize) +{ + Reference< beans::XPropertySet > xProp(xDiagram, uno::UNO_QUERY); + chart2::RelativeSize aRelativeSize; + xProp->getPropertyValue( "RelativeSize" ) >>= aRelativeSize; + double fX = aRelativeSize.Primary * rPageSize.Width; + double fY = aRelativeSize.Secondary * rPageSize.Height; + awt::Size aSize; + aSize.Width = static_cast< sal_Int32 >( ::rtl::math::round( fX ) ); + aSize.Height = static_cast< sal_Int32 >( ::rtl::math::round( fY ) ); + return aSize; +} + +uno::Reference +getShapeByName(const uno::Reference& rShapes, const OUString& rName, + const std::function&)>& pCondition + = nullptr) +{ + for (sal_Int32 i = 0; i < rShapes->getCount(); ++i) + { + uno::Reference xShapes(rShapes->getByIndex(i), uno::UNO_QUERY); + if (xShapes.is()) + { + uno::Reference xRet = getShapeByName(xShapes, rName, pCondition); + if (xRet.is()) + return xRet; + } + uno::Reference xNamedShape(rShapes->getByIndex(i), uno::UNO_QUERY); + if (xNamedShape->getName() == rName) + { + uno::Reference xShape(xNamedShape, uno::UNO_QUERY); + if (pCondition == nullptr || pCondition(xShape)) + return xShape; + } + } + return uno::Reference(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/data/doc/chart.doc b/chart2/qa/extras/data/doc/chart.doc new file mode 100644 index 0000000000..2bfa5aed2c Binary files /dev/null and b/chart2/qa/extras/data/doc/chart.doc differ diff --git a/chart2/qa/extras/data/docx/3d-bar-label.docx b/chart2/qa/extras/data/docx/3d-bar-label.docx new file mode 100644 index 0000000000..69cab8e719 Binary files /dev/null and b/chart2/qa/extras/data/docx/3d-bar-label.docx differ diff --git a/chart2/qa/extras/data/docx/Bar_horizontal_cone.docx b/chart2/qa/extras/data/docx/Bar_horizontal_cone.docx new file mode 100644 index 0000000000..2280d89fc1 Binary files /dev/null and b/chart2/qa/extras/data/docx/Bar_horizontal_cone.docx differ diff --git a/chart2/qa/extras/data/docx/DisplayUnits.docx b/chart2/qa/extras/data/docx/DisplayUnits.docx new file mode 100644 index 0000000000..97092a3ed6 Binary files /dev/null and b/chart2/qa/extras/data/docx/DisplayUnits.docx differ diff --git a/chart2/qa/extras/data/docx/FDO74430.docx b/chart2/qa/extras/data/docx/FDO74430.docx new file mode 100644 index 0000000000..f4a68b519d Binary files /dev/null and b/chart2/qa/extras/data/docx/FDO74430.docx differ diff --git a/chart2/qa/extras/data/docx/FDO75975.docx b/chart2/qa/extras/data/docx/FDO75975.docx new file mode 100644 index 0000000000..30f251014b Binary files /dev/null and b/chart2/qa/extras/data/docx/FDO75975.docx differ diff --git a/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx b/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx new file mode 100644 index 0000000000..c158a0d765 Binary files /dev/null and b/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx differ diff --git a/chart2/qa/extras/data/docx/MSO_axis_position.docx b/chart2/qa/extras/data/docx/MSO_axis_position.docx new file mode 100644 index 0000000000..a9955b7b1a Binary files /dev/null and b/chart2/qa/extras/data/docx/MSO_axis_position.docx differ diff --git a/chart2/qa/extras/data/docx/PieChartDataLabels.docx b/chart2/qa/extras/data/docx/PieChartDataLabels.docx new file mode 100644 index 0000000000..99a72c0f29 Binary files /dev/null and b/chart2/qa/extras/data/docx/PieChartDataLabels.docx differ diff --git a/chart2/qa/extras/data/docx/TableOnPage3.docx b/chart2/qa/extras/data/docx/TableOnPage3.docx new file mode 100644 index 0000000000..79763bd352 Binary files /dev/null and b/chart2/qa/extras/data/docx/TableOnPage3.docx differ diff --git a/chart2/qa/extras/data/docx/UpDownBars.docx b/chart2/qa/extras/data/docx/UpDownBars.docx new file mode 100644 index 0000000000..755f814996 Binary files /dev/null and b/chart2/qa/extras/data/docx/UpDownBars.docx differ diff --git a/chart2/qa/extras/data/docx/area-chart-labels.docx b/chart2/qa/extras/data/docx/area-chart-labels.docx new file mode 100644 index 0000000000..4db844112d Binary files /dev/null and b/chart2/qa/extras/data/docx/area-chart-labels.docx differ diff --git a/chart2/qa/extras/data/docx/bar-chart-labels.docx b/chart2/qa/extras/data/docx/bar-chart-labels.docx new file mode 100644 index 0000000000..9ff8b4fd17 Binary files /dev/null and b/chart2/qa/extras/data/docx/bar-chart-labels.docx differ diff --git a/chart2/qa/extras/data/docx/barChartRotation.docx b/chart2/qa/extras/data/docx/barChartRotation.docx new file mode 100644 index 0000000000..bf4be47b34 Binary files /dev/null and b/chart2/qa/extras/data/docx/barChartRotation.docx differ diff --git a/chart2/qa/extras/data/docx/bubblechart.docx b/chart2/qa/extras/data/docx/bubblechart.docx new file mode 100644 index 0000000000..c2040730cf Binary files /dev/null and b/chart2/qa/extras/data/docx/bubblechart.docx differ diff --git a/chart2/qa/extras/data/docx/chart.docx b/chart2/qa/extras/data/docx/chart.docx new file mode 100644 index 0000000000..f9cddd4949 Binary files /dev/null and b/chart2/qa/extras/data/docx/chart.docx differ diff --git a/chart2/qa/extras/data/docx/clustered-bar-chart-labels.docx b/chart2/qa/extras/data/docx/clustered-bar-chart-labels.docx new file mode 100644 index 0000000000..3b9941cc1e Binary files /dev/null and b/chart2/qa/extras/data/docx/clustered-bar-chart-labels.docx differ diff --git a/chart2/qa/extras/data/docx/data-label-borders.docx b/chart2/qa/extras/data/docx/data-label-borders.docx new file mode 100644 index 0000000000..6f2b94d98e Binary files /dev/null and b/chart2/qa/extras/data/docx/data-label-borders.docx differ diff --git a/chart2/qa/extras/data/docx/data_point_inherited_color.docx b/chart2/qa/extras/data/docx/data_point_inherited_color.docx new file mode 100644 index 0000000000..70de8b2188 Binary files /dev/null and b/chart2/qa/extras/data/docx/data_point_inherited_color.docx differ diff --git a/chart2/qa/extras/data/docx/doughnut-chart-labels.docx b/chart2/qa/extras/data/docx/doughnut-chart-labels.docx new file mode 100644 index 0000000000..559208578f Binary files /dev/null and b/chart2/qa/extras/data/docx/doughnut-chart-labels.docx differ diff --git a/chart2/qa/extras/data/docx/doughnutChart.docx b/chart2/qa/extras/data/docx/doughnutChart.docx new file mode 100644 index 0000000000..f0642d4d5c Binary files /dev/null and b/chart2/qa/extras/data/docx/doughnutChart.docx differ diff --git a/chart2/qa/extras/data/docx/fdo74115_WallBitmapFill.docx b/chart2/qa/extras/data/docx/fdo74115_WallBitmapFill.docx new file mode 100644 index 0000000000..15f42b0cf3 Binary files /dev/null and b/chart2/qa/extras/data/docx/fdo74115_WallBitmapFill.docx differ diff --git a/chart2/qa/extras/data/docx/fdo74115_WallGradientFill.docx b/chart2/qa/extras/data/docx/fdo74115_WallGradientFill.docx new file mode 100644 index 0000000000..e10334bd9a Binary files /dev/null and b/chart2/qa/extras/data/docx/fdo74115_WallGradientFill.docx differ 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 new file mode 100644 index 0000000000..ee2489d21a Binary files /dev/null and b/chart2/qa/extras/data/docx/fdo78290_Combination_Chart_Marker_x.docx differ 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 new file mode 100644 index 0000000000..7e4b096b83 Binary files /dev/null and b/chart2/qa/extras/data/docx/fdo78290_Line_Chart_Marker_x.docx differ 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 new file mode 100644 index 0000000000..2edc8f0862 Binary files /dev/null and b/chart2/qa/extras/data/docx/fdo78290_Scatter_Chart_Marker_x.docx differ diff --git a/chart2/qa/extras/data/docx/fdo83058_dlblPos.docx b/chart2/qa/extras/data/docx/fdo83058_dlblPos.docx new file mode 100644 index 0000000000..721a717897 Binary files /dev/null and b/chart2/qa/extras/data/docx/fdo83058_dlblPos.docx differ diff --git a/chart2/qa/extras/data/docx/line-chart-label-default-placement.docx b/chart2/qa/extras/data/docx/line-chart-label-default-placement.docx new file mode 100644 index 0000000000..ab9548d59c Binary files /dev/null and b/chart2/qa/extras/data/docx/line-chart-label-default-placement.docx differ diff --git a/chart2/qa/extras/data/docx/pieChartRotation.docx b/chart2/qa/extras/data/docx/pieChartRotation.docx new file mode 100644 index 0000000000..f76f602374 Binary files /dev/null and b/chart2/qa/extras/data/docx/pieChartRotation.docx differ diff --git a/chart2/qa/extras/data/docx/piechart_deleted_legend_entry.docx b/chart2/qa/extras/data/docx/piechart_deleted_legend_entry.docx new file mode 100644 index 0000000000..da6b2fa19a Binary files /dev/null and b/chart2/qa/extras/data/docx/piechart_deleted_legend_entry.docx differ diff --git a/chart2/qa/extras/data/docx/radar-chart-labels.docx b/chart2/qa/extras/data/docx/radar-chart-labels.docx new file mode 100644 index 0000000000..2cb876dd26 Binary files /dev/null and b/chart2/qa/extras/data/docx/radar-chart-labels.docx differ diff --git a/chart2/qa/extras/data/docx/scatter-chart-text-x-values.docx b/chart2/qa/extras/data/docx/scatter-chart-text-x-values.docx new file mode 100644 index 0000000000..b741bbce21 Binary files /dev/null and b/chart2/qa/extras/data/docx/scatter-chart-text-x-values.docx differ diff --git a/chart2/qa/extras/data/docx/tdf121744.docx b/chart2/qa/extras/data/docx/tdf121744.docx new file mode 100644 index 0000000000..b5ff10098c Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf121744.docx differ diff --git a/chart2/qa/extras/data/docx/tdf123206.docx b/chart2/qa/extras/data/docx/tdf123206.docx new file mode 100644 index 0000000000..f47089fe3b Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf123206.docx differ diff --git a/chart2/qa/extras/data/docx/tdf124083.docx b/chart2/qa/extras/data/docx/tdf124083.docx new file mode 100644 index 0000000000..b8030ca9a8 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf124083.docx differ diff --git a/chart2/qa/extras/data/docx/tdf124243.docx b/chart2/qa/extras/data/docx/tdf124243.docx new file mode 100644 index 0000000000..e58ef6a02e Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf124243.docx differ diff --git a/chart2/qa/extras/data/docx/tdf125337.docx b/chart2/qa/extras/data/docx/tdf125337.docx new file mode 100644 index 0000000000..811f12d898 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf125337.docx differ diff --git a/chart2/qa/extras/data/docx/tdf128794.docx b/chart2/qa/extras/data/docx/tdf128794.docx new file mode 100644 index 0000000000..098c0a00e3 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf128794.docx differ diff --git a/chart2/qa/extras/data/docx/tdf132174.docx b/chart2/qa/extras/data/docx/tdf132174.docx new file mode 100644 index 0000000000..4f43695784 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf132174.docx differ diff --git a/chart2/qa/extras/data/docx/tdf133632.docx b/chart2/qa/extras/data/docx/tdf133632.docx new file mode 100644 index 0000000000..b970e73f4c Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf133632.docx differ diff --git a/chart2/qa/extras/data/docx/tdf134111.docx b/chart2/qa/extras/data/docx/tdf134111.docx new file mode 100644 index 0000000000..26e3a03e0b Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf134111.docx differ diff --git a/chart2/qa/extras/data/docx/tdf134255.docx b/chart2/qa/extras/data/docx/tdf134255.docx new file mode 100644 index 0000000000..ff3cd8b67b Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf134255.docx differ diff --git a/chart2/qa/extras/data/docx/tdf136650.docx b/chart2/qa/extras/data/docx/tdf136650.docx new file mode 100644 index 0000000000..cd095ec631 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf136650.docx differ diff --git a/chart2/qa/extras/data/docx/tdf139658.docx b/chart2/qa/extras/data/docx/tdf139658.docx new file mode 100644 index 0000000000..59deda9f83 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf139658.docx differ diff --git a/chart2/qa/extras/data/docx/tdf143130.docx b/chart2/qa/extras/data/docx/tdf143130.docx new file mode 100644 index 0000000000..a364f4811a Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf143130.docx differ diff --git a/chart2/qa/extras/data/docx/tdf91250.docx b/chart2/qa/extras/data/docx/tdf91250.docx new file mode 100644 index 0000000000..4cb199b457 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf91250.docx differ diff --git a/chart2/qa/extras/data/docx/testAreaChartLoad.docx b/chart2/qa/extras/data/docx/testAreaChartLoad.docx new file mode 100644 index 0000000000..9383f75cde Binary files /dev/null and b/chart2/qa/extras/data/docx/testAreaChartLoad.docx differ diff --git a/chart2/qa/extras/data/docx/testAxisTitlePosition.docx b/chart2/qa/extras/data/docx/testAxisTitlePosition.docx new file mode 100644 index 0000000000..6abd37eec5 Binary files /dev/null and b/chart2/qa/extras/data/docx/testAxisTitlePosition.docx differ diff --git a/chart2/qa/extras/data/docx/testBarChart.docx b/chart2/qa/extras/data/docx/testBarChart.docx new file mode 100644 index 0000000000..b92260f718 Binary files /dev/null and b/chart2/qa/extras/data/docx/testBarChart.docx differ diff --git a/chart2/qa/extras/data/docx/testBarChartDataPointPropDOCX.docx b/chart2/qa/extras/data/docx/testBarChartDataPointPropDOCX.docx new file mode 100644 index 0000000000..66df9153d3 Binary files /dev/null and b/chart2/qa/extras/data/docx/testBarChartDataPointPropDOCX.docx differ diff --git a/chart2/qa/extras/data/docx/testChartDataTable.docx b/chart2/qa/extras/data/docx/testChartDataTable.docx new file mode 100644 index 0000000000..8663e8937e Binary files /dev/null and b/chart2/qa/extras/data/docx/testChartDataTable.docx differ diff --git a/chart2/qa/extras/data/docx/testChartTitlePropertiesBitmapFill.docx b/chart2/qa/extras/data/docx/testChartTitlePropertiesBitmapFill.docx new file mode 100644 index 0000000000..462c15976a Binary files /dev/null and b/chart2/qa/extras/data/docx/testChartTitlePropertiesBitmapFill.docx differ diff --git a/chart2/qa/extras/data/docx/testChartTitlePropertiesColorFill.docx b/chart2/qa/extras/data/docx/testChartTitlePropertiesColorFill.docx new file mode 100644 index 0000000000..d86928d615 Binary files /dev/null and b/chart2/qa/extras/data/docx/testChartTitlePropertiesColorFill.docx differ diff --git a/chart2/qa/extras/data/docx/testChartTitlePropertiesGradientFill.docx b/chart2/qa/extras/data/docx/testChartTitlePropertiesGradientFill.docx new file mode 100644 index 0000000000..a72600d09e Binary files /dev/null and b/chart2/qa/extras/data/docx/testChartTitlePropertiesGradientFill.docx differ diff --git a/chart2/qa/extras/data/docx/testColorGradientWithTransparency.docx b/chart2/qa/extras/data/docx/testColorGradientWithTransparency.docx new file mode 100644 index 0000000000..adc2aff042 Binary files /dev/null and b/chart2/qa/extras/data/docx/testColorGradientWithTransparency.docx differ diff --git a/chart2/qa/extras/data/docx/testCustomlabeltext.docx b/chart2/qa/extras/data/docx/testCustomlabeltext.docx new file mode 100644 index 0000000000..db28209c9c Binary files /dev/null and b/chart2/qa/extras/data/docx/testCustomlabeltext.docx differ diff --git a/chart2/qa/extras/data/docx/testLabelSeparator.docx b/chart2/qa/extras/data/docx/testLabelSeparator.docx new file mode 100644 index 0000000000..452fdccc94 Binary files /dev/null and b/chart2/qa/extras/data/docx/testLabelSeparator.docx differ diff --git a/chart2/qa/extras/data/docx/testMultilevelCategoryAxis.docx b/chart2/qa/extras/data/docx/testMultilevelCategoryAxis.docx new file mode 100644 index 0000000000..75605de72f Binary files /dev/null and b/chart2/qa/extras/data/docx/testMultilevelCategoryAxis.docx differ diff --git a/chart2/qa/extras/data/docx/testMultipleChart.docx b/chart2/qa/extras/data/docx/testMultipleChart.docx new file mode 100644 index 0000000000..28d8bbcfe1 Binary files /dev/null and b/chart2/qa/extras/data/docx/testMultipleChart.docx differ diff --git a/chart2/qa/extras/data/docx/testMultiplechartembeddings.docx b/chart2/qa/extras/data/docx/testMultiplechartembeddings.docx new file mode 100644 index 0000000000..28d8bbcfe1 Binary files /dev/null and b/chart2/qa/extras/data/docx/testMultiplechartembeddings.docx differ diff --git a/chart2/qa/extras/data/docx/testSeriesIdxOrder.docx b/chart2/qa/extras/data/docx/testSeriesIdxOrder.docx new file mode 100644 index 0000000000..9274e2c2c2 Binary files /dev/null and b/chart2/qa/extras/data/docx/testSeriesIdxOrder.docx differ diff --git a/chart2/qa/extras/data/docx/testSimpleCategoryAxis.docx b/chart2/qa/extras/data/docx/testSimpleCategoryAxis.docx new file mode 100644 index 0000000000..de511664a5 Binary files /dev/null and b/chart2/qa/extras/data/docx/testSimpleCategoryAxis.docx differ diff --git a/chart2/qa/extras/data/docx/testStockChart.docx b/chart2/qa/extras/data/docx/testStockChart.docx new file mode 100644 index 0000000000..a804e7df2d Binary files /dev/null and b/chart2/qa/extras/data/docx/testStockChart.docx differ diff --git a/chart2/qa/extras/data/docx/testTdf108110.docx b/chart2/qa/extras/data/docx/testTdf108110.docx new file mode 100644 index 0000000000..769360c152 Binary files /dev/null and b/chart2/qa/extras/data/docx/testTdf108110.docx differ diff --git a/chart2/qa/extras/data/docx/testTdf114179.docx b/chart2/qa/extras/data/docx/testTdf114179.docx new file mode 100644 index 0000000000..36fb11e170 Binary files /dev/null and b/chart2/qa/extras/data/docx/testTdf114179.docx differ diff --git a/chart2/qa/extras/data/docx/testTdf122226.docx b/chart2/qa/extras/data/docx/testTdf122226.docx new file mode 100644 index 0000000000..7205525a76 Binary files /dev/null and b/chart2/qa/extras/data/docx/testTdf122226.docx differ diff --git a/chart2/qa/extras/data/docx/testchartoleobjectembeddings.docx b/chart2/qa/extras/data/docx/testchartoleobjectembeddings.docx new file mode 100644 index 0000000000..8167de7a35 Binary files /dev/null and b/chart2/qa/extras/data/docx/testchartoleobjectembeddings.docx differ diff --git a/chart2/qa/extras/data/docx/testcustomshapepos.docx b/chart2/qa/extras/data/docx/testcustomshapepos.docx new file mode 100644 index 0000000000..640c48ea46 Binary files /dev/null and b/chart2/qa/extras/data/docx/testcustomshapepos.docx differ diff --git a/chart2/qa/extras/data/fods/stacked-column-chart.fods b/chart2/qa/extras/data/fods/stacked-column-chart.fods new file mode 100644 index 0000000000..8a142120ba --- /dev/null +++ b/chart2/qa/extras/data/fods/stacked-column-chart.fods @@ -0,0 +1,861 @@ + + + + Michael Meeks2014-06-05T11:25:47.3465744642014-06-05T11:32:25.317381922Michael MeeksPT3M51S6LibreOffice/3.5$Linux_X86_64 LibreOffice_project/f647884-246edd6 + + + 0 + 0 + 27093 + 9934 + + + view1 + + + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 130 + 60 + true + + + 1 + 16 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 130 + 60 + true + + + Summary + 270 + 0 + 130 + 60 + false + true + true + true + 12632256 + true + true + true + true + false + false + 1000 + 1000 + 1 + 1 + true + + + + + true + false + true + 12632256 + true + false + 1 + 1 + + + en + GB + + + + + + true + fwH+/0Nhbm9uLTg2MGkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ1VQUzpDYW5vbi04NjBpAAAAAAAAAAAAAAAAAAAAAAAWAAMApQAAAAAAAAAIAFZUAAAkbQAASm9iRGF0YSAxCnByaW50ZXI9Q2Fub24tODYwaQpvcmllbnRhdGlvbj1Qb3J0cmFpdApjb3BpZXM9MQptYXJnaW5kYWp1c3RtZW50PTAsMCwwLDAKY29sb3JkZXB0aD0yNApwc2xldmVsPTAKcGRmZGV2aWNlPTEKY29sb3JkZXZpY2U9MApQUERDb250ZXhEYXRhClBhZ2VTaXplOkxldHRlcgAAEgBDT01QQVRfRFVQTEVYX01PREUKAERVUExFWF9PRkY= + true + false + true + Canon-860i + 3 + false + false + false + true + 1000 + 1000 + true + true + true + 0 + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + £ + + + + + - + £ + + + + + £ + + + + + - + £ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ??? + + + + Page 1 + + + + + + + ??? (???) + + + 00/00/0000, 00:00:00 + + + + + Page 1 / 99 + + + + + + + + + + + + LibreOffice/3.5$Linux_X86_64 LibreOffice_project/f647884-246edd6 + + + + + + + £ + + + + + - + £ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Some + + Summary.B1:Summary.B1 + + + + + + + One + + Summary.A2:Summary.A2 + + + 956.594173563644 + + Summary.B2:Summary.B2 + + + + + Two + + Summary.A3:Summary.A3 + + + 207.425649510697 + + Summary.B3:Summary.B3 + + + + + Three + + Summary.A4:Summary.A4 + + + 689.508363604546 + + Summary.B4:Summary.B4 + + + + + Four + + Summary.A5:Summary.A5 + + + 346.062566153705 + + Summary.B5:Summary.B5 + + + + + Five + + Summary.A6:Summary.A6 + + + 893.98120646365 + + Summary.B6:Summary.B6 + + + + + + + + + + VkNMTVRGAQAxAAAAAAAAAAEAGwAAAAAAAAAAAAAAAAA7EwAAoA8AAPsIAAAIBwAAAIA+AAAo + IwAArQEAAIsAAQACAAAA//+BAAEAEAAAAAAAAAAAAAAAfz4AACcjAACLAAEAAgAAACAAggAB + ACEAAAACABsAAAACAAIAAAAAAAAAJyMAAAEAAAAAAH8+AAACAACVAAEABAAAAAAAAACWAAEA + AgAAAAkAhQABAAUAAAD///8AAYQAAQAFAAAAAAAAAABvAAIANgAAAAEABgBAHwAAKCMAAAAA + AAAoIwAAAAAAAAAAAACAPgAAAAAAAIA+AAAoIwAAQB8AACgjAAAAAIQAAQAFAAAAs7OzAAEA + AgEAjgAAABUAWFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAG8AAAABAGkAAAABADMAAAAGAOEe + AABNHgAA+gcAAE0eAAD6BwAAHAQAAMc1AAAcBAAAxzUAAE0eAADhHgAATR4AAAABAAIAAAAA + AAEAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAACEAAEABQAAALOzswAB + hQABAAUAAAAAAAAAAG0AAwBTAAAABgDhHgAATR4AAPoHAABNHgAA+gcAABwEAADHNQAAHAQA + AMc1AABNHgAA4R4AAE0eAAAEABoAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAgEA + HQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAhAABAAUAAACzs7MAAQACAQBuAAAA + FQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAAAAEAEwAAAAIAxzUAAEweAAD6 + BwAATB4AAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA + AACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0AAwAzAAAAAgDHNQAATB4AAPoHAABMHgAA + BAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIBAB0AAAATAFhQQVRIU1RST0tF + X1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEAAgEAbgAAABUAWFBBVEhTVFJPS0VfU0VR + X0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAMc1AACOGgAA+gcAAI4aAAAAAQACAAAAAAAB + AAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAhAABAAUAAACzs7MAAYUA + AQAFAAAAAAAAAABtAAMAMwAAAAIAxzUAAI4aAAD6BwAAjhoAAAQAGgAAAAEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFUSFNUUk9LRV9TRVFfRU5EAAAAAAAAAACE + AAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9CRUdJTgAAAABPAAAAAQBJ + AAAAAQATAAAAAgDHNQAA0BYAAPoHAADQFgAAAAEAAgAAAAAAAQACAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAAs7OzAAGFAAEABQAAAAAAAAAAbQADADMA + AAACAMc1AADQFgAA+gcAANAWAAAEABoAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAA + AgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAhAABAAUAAACzs7MAAQACAQBu + AAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAAAAEAEwAAAAIAxzUAABIT + AAD6BwAAEhMAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAA + AAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0AAwAzAAAAAgDHNQAAEhMAAPoHAAAS + EwAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIBAB0AAAATAFhQQVRIU1RS + T0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEAAgEAbgAAABUAWFBBVEhTVFJPS0Vf + U0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAMc1AABUDwAA+gcAAFQPAAAAAQACAAAA + AAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAhAABAAUAAACzs7MA + AYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAxzUAAFQPAAD6BwAAVA8AAAQAGgAAAAEAAAAAAAAA + AAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFUSFNUUk9LRV9TRVFfRU5EAAAAAAAA + AACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9CRUdJTgAAAABPAAAA + AQBJAAAAAQATAAAAAgDHNQAAlgsAAPoHAACWCwAAAAEAAgAAAAAAAQACAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAAs7OzAAGFAAEABQAAAAAAAAAAbQAD + ADMAAAACAMc1AACWCwAA+gcAAJYLAAAEABoAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAA + AAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAhAABAAUAAACzs7MAAQAC + AQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAAAAEAEwAAAAIAxzUA + ANgHAAD6BwAA2AcAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAA + AAAAAAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0AAwAzAAAAAgDHNQAA2AcAAPoH + AADYBwAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIBAB0AAAATAFhQQVRI + U1RST0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEAAgEAbgAAABUAWFBBVEhTVFJP + S0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAMc1AAAbBAAA+gcAABsEAAAAAQAC + AAAAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAhAABAAUAAACz + s7MAAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAxzUAABsEAAD6BwAAGwQAAAQAGgAAAAEAAAAA + AAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFUSFNUUk9LRV9TRVFfRU5EAAAA + AAAAAACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9CRUdJTgAAAABP + AAAAAQBJAAAAAQATAAAAAgD6BwAA4h4AAPoHAABMHgAAAAEAAgAAAAAAAQACAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAAs7OzAAGFAAEABQAAAAAAAAAA + bQADADMAAAACAPoHAADiHgAA+gcAAEweAAAEABoAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA + BAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAhAABAAUAAACzs7MA + AQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAAAAEAEwAAAAIA + +gcAAOIeAAD6BwAATB4AAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA + AAAAAAAAAAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0AAwAzAAAAAgD6BwAA4h4A + APoHAABMHgAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIBAB0AAAATAFhQ + QVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEAAgEAbgAAABUAWFBBVEhT + VFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAMc1AADiHgAAxzUAAEweAAAA + AQACAAAAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAhAABAAUA + AACzs7MAAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAxzUAAOIeAADHNQAATB4AAAQAGgAAAAEA + AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFUSFNUUk9LRV9TRVFfRU5E + AAAAAAAAAACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9CRUdJTgAA + AABPAAAAAQBJAAAAAQATAAAAAgDHNQAA4h4AAMc1AABMHgAAAAEAAgAAAAAAAQACAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAAs7OzAAGFAAEABQAAAAAA + AAAAbQADADMAAAACAMc1AADiHgAAxzUAAEweAAAEABoAAAABAAAAAAAAAAAAAAAAAAAAAAAA + AAAABAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAhAABAAUAAACz + s7MAAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAAAAEAEwAA + AAIA+gcAAEweAADHNQAATB4AAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AQAAAAAAAAAAAAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0AAwAzAAAAAgD6BwAA + TB4AAMc1AABMHgAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIBAB0AAAAT + AFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEAAgEAbgAAABUAWFBB + VEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAGQHAABMHgAA+gcAAEwe + AAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAhAAB + AAUAAACzs7MAAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAZAcAAEweAAD6BwAATB4AAAQAGgAA + AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFUSFNUUk9LRV9TRVFf + RU5EAAAAAAAAAACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9CRUdJ + TgAAAABPAAAAAQBJAAAAAQATAAAAAgBkBwAATB4AAPoHAABMHgAAAAEAAgAAAAAAAQACAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAAs7OzAAGFAAEABQAA + AAAAAAAAbQADADMAAAACAGQHAABMHgAA+gcAAEweAAAEABoAAAABAAAAAAAAAAAAAAAAAAAA + AAAAAAAABAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAhAABAAUA + AACzs7MAAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAAAAEA + EwAAAAIAZAcAAI4aAAD6BwAAjhoAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAQAAAAAAAAAAAAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0AAwAzAAAAAgBk + BwAAjhoAAPoHAACOGgAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIBAB0A + AAATAFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEAAgEAbgAAABUA + WFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAGQHAACOGgAA+gcA + AI4aAAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAA + hAABAAUAAACzs7MAAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAZAcAAI4aAAD6BwAAjhoAAAQA + GgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFUSFNUUk9LRV9T + RVFfRU5EAAAAAAAAAACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NFUV9C + RUdJTgAAAABPAAAAAQBJAAAAAQATAAAAAgBkBwAA0BYAAPoHAADQFgAAAAEAAgAAAAAAAQAC + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAAs7OzAAGFAAEA + BQAAAAAAAAAAbQADADMAAAACAGQHAADQFgAA+gcAANAWAAAEABoAAAABAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAhAAB + AAUAAACzs7MAAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAA + AAEAEwAAAAIAZAcAANAWAAD6BwAA0BYAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAQAAAAAAAAAAAAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0AAwAzAAAA + AgBkBwAA0BYAAPoHAADQFgAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAIB + AB0AAAATAFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEAAgEAbgAA + ABUAWFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAGQHAAASEwAA + +gcAABITAAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAA + AAAAhAABAAUAAACzs7MAAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAZAcAABITAAD6BwAAEhMA + AAQAGgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFUSFNUUk9L + RV9TRVFfRU5EAAAAAAAAAACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RST0tFX1NF + UV9CRUdJTgAAAABPAAAAAQBJAAAAAQATAAAAAgBkBwAAEhMAAPoHAAASEwAAAAEAAgAAAAAA + AQACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAAs7OzAAGF + AAEABQAAAAAAAAAAbQADADMAAAACAGQHAAASEwAA+gcAABITAAAEABoAAAABAAAAAAAAAAAA + AAAAAAAAAAAAAAAABAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAA + hAABAAUAAACzs7MAAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEA + SQAAAAEAEwAAAAIAZAcAAFQPAAD6BwAAVA8AAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAQAAAAAAAAAAAAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0AAwAz + AAAAAgBkBwAAVA8AAPoHAABUDwAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAA + AAIBAB0AAAATAFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEAAgEA + bgAAABUAWFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAGQHAABU + DwAA+gcAAFQPAAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAA + AAAAAAAAhAABAAUAAACzs7MAAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAZAcAAFQPAAD6BwAA + VA8AAAQAGgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFUSFNU + Uk9LRV9TRVFfRU5EAAAAAAAAAACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RST0tF + X1NFUV9CRUdJTgAAAABPAAAAAQBJAAAAAQATAAAAAgBkBwAAlgsAAPoHAACWCwAAAAEAAgAA + AAAAAQACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAAs7Oz + AAGFAAEABQAAAAAAAAAAbQADADMAAAACAGQHAACWCwAA+gcAAJYLAAAEABoAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAABAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAA + AAAAhAABAAUAAACzs7MAAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAA + AAEASQAAAAEAEwAAAAIAZAcAAJYLAAD6BwAAlgsAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAAAG0A + AwAzAAAAAgBkBwAAlgsAAPoHAACWCwAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQA + AAAAAAIBAB0AAAATAFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7OzAAEA + AgEAbgAAABUAWFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAACAGQH + AADYBwAA+gcAANgHAAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAA + AAAAAAAAAAAAhAABAAUAAACzs7MAAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAZAcAANgHAAD6 + BwAA2AcAAAQAGgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBYUEFU + SFNUUk9LRV9TRVFfRU5EAAAAAAAAAACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRIU1RS + T0tFX1NFUV9CRUdJTgAAAABPAAAAAQBJAAAAAQATAAAAAgBkBwAA2AcAAPoHAADYBwAAAAEA + AgAAAAAAAQACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAFAAAA + s7OzAAGFAAEABQAAAAAAAAAAbQADADMAAAACAGQHAADYBwAA+gcAANgHAAAEABoAAAABAAAA + AAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAA + AAAAAAAAhAABAAUAAACzs7MAAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAA + TwAAAAEASQAAAAEAEwAAAAIAZAcAABsEAAD6BwAAGwQAAAABAAIAAAAAAAEAAgAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAACEAAEABQAAALOzswABhQABAAUAAAAAAAAA + AG0AAwAzAAAAAgBkBwAAGwQAAPoHAAAbBAAABAAaAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAA + AAQAAAAAAAIBAB0AAAATAFhQQVRIU1RST0tFX1NFUV9FTkQAAAAAAAAAAIQAAQAFAAAAs7Oz + AAEAAgEAbgAAABUAWFBBVEhTVFJPS0VfU0VRX0JFR0lOAAAAAE8AAAABAEkAAAABABMAAAAC + AGQHAAAbBAAA+gcAABsEAAAAAQACAAAAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEA + AAAAAAAAAAAAAAAAhAABAAUAAACzs7MAAYUAAQAFAAAAAAAAAABtAAMAMwAAAAIAZAcAABsE + AAD6BwAAGwQAAAQAGgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAACAQAdAAAAEwBY + UEFUSFNUUk9LRV9TRVFfRU5EAAAAAAAAAACEAAEABQAAALOzswABAAIBAG4AAAAVAFhQQVRI + U1RST0tFX1NFUV9CRUdJTgAAAABPAAAAAQBJAAAAAQATAAAAAgD6BwAATB4AAPoHAAAbBAAA + AAEAAgAAAAAAAQACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAIQAAQAF + AAAAs7OzAAGFAAEABQAAAAAAAAAAbQADADMAAAACAPoHAABMHgAA+gcAABsEAAAEABoAAAAB + AAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VO + RAAAAAAAAAAAhQABAAUAAACGRQAAAYQAAQAFAAAAAAAAAABvAAIALgAAAAEABQBtEwAATB4A + AFMqAABMHgAAUyoAACMXAABtEwAAIxcAAG0TAABMHgAAAACFAAEABQAAAA5C/wABhAABAAUA + AAAAAAAAAG8AAgAuAAAAAQAFAG0TAAAjFwAAUyoAACMXAABTKgAAlhUAAG0TAACWFQAAbRMA + ACMXAAAAAIUAAQAFAAAAINP/AAGEAAEABQAAAAAAAAAAbwACAC4AAAABAAUAbRMAAJYVAABT + KgAAlhUAAFMqAABtEAAAbRMAAG0QAABtEwAAlhUAAAAAhQABAAUAAAAcnVcAAYQAAQAFAAAA + AAAAAABvAAIALgAAAAEABQBtEwAAbRAAAFMqAABtEAAAUyoAANYNAABtEwAA1g0AAG0TAABt + EAAAAACFAAEABQAAACEAfgABhAABAAUAAAAAAAAAAG8AAgAuAAAAAQAFAG0TAADWDQAAUyoA + ANYNAABTKgAAJQcAAG0TAAAlBwAAbRMAANYNAAAAAAACAQAgAAAAFgBYVEVYVF9QQUlOVFNI + QVBFX0JFR0lOAAAAAAAAAACKAAEAQQAAAAMAOwAAAA8ATGliZXJhdGlvbiBTYW5zAAAAAAAA + YQEAAP//AAACAAUAAAAAAAAACQgAAAAAAAAAAAD/AwAAAAAAiAABAAIAAAABAIcAAQAFAAAA + /////wCGAAEABAAAAAAAAABxAAIANgAAACQdAACAIAAABAAAAFMAbwBtAGUAAAAEAAQAAADs + AAAAowEAAMMCAAB6AwAABABTAG8AbQBlAAACAQATAAAACQBYVEVYVF9FT0MAAAAAAAAAAAAC + AQATAAAACQBYVEVYVF9FT0MBAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MCAAAAAAAAAAAC + AQATAAAACQBYVEVYVF9FT0MDAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0wAAAAAAAAAAAAC + AQATAAAACQBYVEVYVF9FT1AAAAAAAAAAAAACAQAeAAAAFABYVEVYVF9QQUlOVFNIQVBFX0VO + RAAAAAAAAAAAAAIBACAAAAAWAFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBB + AAAAAwA7AAAADwBMaWJlcmF0aW9uIFNhbnMAAAAAAABhAQAA//8AAAIABQAAAAAAAAAJCAAA + AAAAAAAAAP8DAAAAAACIAAEAAgAAAAEAhwABAAUAAAD/////AIYAAQAEAAAAAAAAAHEAAgAm + AAAAkQUAAMMeAAACAAAAowAwAAAAAgACAAAAtwAAAG8BAAACAKMAMAAAAgEAEwAAAAkAWFRF + WFRfRU9DAAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9DAQAAAAAAAAAAAgEAEwAAAAkAWFRF + WFRfRU9XAQAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9MAAAAAAAAAAAAAgEAEwAAAAkAWFRF + WFRfRU9QAAAAAAAAAAAAAgEAHgAAABQAWFRFWFRfUEFJTlRTSEFQRV9FTkQAAAAAAAAAAAAC + AQAgAAAAFgBYVEVYVF9QQUlOVFNIQVBFX0JFR0lOAAAAAAAAAACKAAEAQQAAAAMAOwAAAA8A + TGliZXJhdGlvbiBTYW5zAAAAAAAAYQEAAP//AAACAAUAAAAAAAAACQgAAAAAAAAAAAD/AwAA + AAAAiAABAAIAAAABAIcAAQAFAAAA/////wCGAAEABAAAAAAAAABxAAIANgAAACMEAAAFGwAA + BAAAAKMANQAwADAAAAAEAAQAAAC3AAAAbwEAACYCAADdAgAABACjADUAMAAwAAACAQATAAAA + CQBYVEVYVF9FT0MAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MBAAAAAAAAAAACAQATAAAA + CQBYVEVYVF9FT1cBAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MCAAAAAAAAAAACAQATAAAA + CQBYVEVYVF9FT0MDAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0wAAAAAAAAAAAACAQATAAAA + CQBYVEVYVF9FT1AAAAAAAAAAAAACAQAeAAAAFABYVEVYVF9QQUlOVFNIQVBFX0VORAAAAAAA + AAAAAAIBACAAAAAWAFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBBAAAAAwA7 + AAAADwBMaWJlcmF0aW9uIFNhbnMAAAAAAABhAQAA//8AAAIABQAAAAAAAAAJCAAAAAAAAAAA + AP8DAAAAAACIAAEAAgAAAAEAhwABAAUAAAD/////AIYAAQAEAAAAAAAAAHEAAgBGAAAAAwMA + AEcXAAAGAAAAowAxACwAMAAwADAAAAAGAAYAAAC3AAAAbwEAANcBAACPAgAARgMAAP0DAAAG + AKMAMQAsADAAMAAwAAACAQATAAAACQBYVEVYVF9FT0MAAAAAAAAAAAACAQATAAAACQBYVEVY + VF9FT0MBAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1cBAAAAAAAAAAACAQATAAAACQBYVEVY + VF9FT0MCAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MDAAAAAAAAAAACAQATAAAACQBYVEVY + VF9FT0MEAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MFAAAAAAAAAAACAQATAAAACQBYVEVY + VF9FT0wAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1AAAAAAAAAAAAACAQAeAAAAFABYVEVY + VF9QQUlOVFNIQVBFX0VORAAAAAAAAAAAAAIBACAAAAAWAFhURVhUX1BBSU5UU0hBUEVfQkVH + SU4AAAAAAAAAAIoAAQBBAAAAAwA7AAAADwBMaWJlcmF0aW9uIFNhbnMAAAAAAABhAQAA//8A + AAIABQAAAAAAAAAJCAAAAAAAAAAAAP8DAAAAAACIAAEAAgAAAAEAhwABAAUAAAD/////AIYA + AQAEAAAAAAAAAHEAAgBGAAAAAwMAAIkTAAAGAAAAowAxACwANQAwADAAAAAGAAYAAAC3AAAA + bwEAANcBAACPAgAARgMAAP0DAAAGAKMAMQAsADUAMAAwAAACAQATAAAACQBYVEVYVF9FT0MA + AAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MBAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1cB + AAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MCAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MD + AAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MEAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MF + AAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0wAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1AA + AAAAAAAAAAACAQAeAAAAFABYVEVYVF9QQUlOVFNIQVBFX0VORAAAAAAAAAAAAAIBACAAAAAW + AFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBBAAAAAwA7AAAADwBMaWJlcmF0 + aW9uIFNhbnMAAAAAAABhAQAA//8AAAIABQAAAAAAAAAJCAAAAAAAAAAAAP8DAAAAAACIAAEA + AgAAAAEAhwABAAUAAAD/////AIYAAQAEAAAAAAAAAHEAAgBGAAAAAwMAAMsPAAAGAAAAowAy + ACwAMAAwADAAAAAGAAYAAAC3AAAAbwEAANcBAACPAgAARgMAAP0DAAAGAKMAMgAsADAAMAAw + AAACAQATAAAACQBYVEVYVF9FT0MAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MBAAAAAAAA + AAACAQATAAAACQBYVEVYVF9FT1cBAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MCAAAAAAAA + AAACAQATAAAACQBYVEVYVF9FT0MDAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MEAAAAAAAA + AAACAQATAAAACQBYVEVYVF9FT0MFAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0wAAAAAAAAA + AAACAQATAAAACQBYVEVYVF9FT1AAAAAAAAAAAAACAQAeAAAAFABYVEVYVF9QQUlOVFNIQVBF + X0VORAAAAAAAAAAAAAIBACAAAAAWAFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoA + AQBBAAAAAwA7AAAADwBMaWJlcmF0aW9uIFNhbnMAAAAAAABhAQAA//8AAAIABQAAAAAAAAAJ + CAAAAAAAAAAAAP8DAAAAAACIAAEAAgAAAAEAhwABAAUAAAD/////AIYAAQAEAAAAAAAAAHEA + AgBGAAAAAwMAAA0MAAAGAAAAowAyACwANQAwADAAAAAGAAYAAAC3AAAAbwEAANcBAACPAgAA + RgMAAP0DAAAGAKMAMgAsADUAMAAwAAACAQATAAAACQBYVEVYVF9FT0MAAAAAAAAAAAACAQAT + AAAACQBYVEVYVF9FT0MBAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1cBAAAAAAAAAAACAQAT + AAAACQBYVEVYVF9FT0MCAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MDAAAAAAAAAAACAQAT + AAAACQBYVEVYVF9FT0MEAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MFAAAAAAAAAAACAQAT + AAAACQBYVEVYVF9FT0wAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1AAAAAAAAAAAAACAQAe + AAAAFABYVEVYVF9QQUlOVFNIQVBFX0VORAAAAAAAAAAAAAIBACAAAAAWAFhURVhUX1BBSU5U + U0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBBAAAAAwA7AAAADwBMaWJlcmF0aW9uIFNhbnMAAAAA + AABhAQAA//8AAAIABQAAAAAAAAAJCAAAAAAAAAAAAP8DAAAAAACIAAEAAgAAAAEAhwABAAUA + AAD/////AIYAAQAEAAAAAAAAAHEAAgBGAAAAAwMAAE8IAAAGAAAAowAzACwAMAAwADAAAAAG + AAYAAAC3AAAAbwEAANcBAACPAgAARgMAAP0DAAAGAKMAMwAsADAAMAAwAAACAQATAAAACQBY + VEVYVF9FT0MAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MBAAAAAAAAAAACAQATAAAACQBY + VEVYVF9FT1cBAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MCAAAAAAAAAAACAQATAAAACQBY + VEVYVF9FT0MDAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MEAAAAAAAAAAACAQATAAAACQBY + VEVYVF9FT0MFAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0wAAAAAAAAAAAACAQATAAAACQBY + VEVYVF9FT1AAAAAAAAAAAAACAQAeAAAAFABYVEVYVF9QQUlOVFNIQVBFX0VORAAAAAAAAAAA + AAIBACAAAAAWAFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBBAAAAAwA7AAAA + DwBMaWJlcmF0aW9uIFNhbnMAAAAAAABhAQAA//8AAAIABQAAAAAAAAAJCAAAAAAAAAAAAP8D + AAAAAACIAAEAAgAAAAEAhwABAAUAAAD/////AIYAAQAEAAAAAAAAAHEAAgBGAAAAAwMAAJIE + AAAGAAAAowAzACwANQAwADAAAAAGAAYAAAC3AAAAbwEAANcBAACPAgAARgMAAP0DAAAGAKMA + MwAsADUAMAAwAAACAQATAAAACQBYVEVYVF9FT0MAAAAAAAAAAAACAQATAAAACQBYVEVYVF9F + T0MBAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1cBAAAAAAAAAAACAQATAAAACQBYVEVYVF9F + T0MCAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MDAAAAAAAAAAACAQATAAAACQBYVEVYVF9F + T0MEAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MFAAAAAAAAAAACAQATAAAACQBYVEVYVF9F + T0wAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1AAAAAAAAAAAAACAQAeAAAAFABYVEVYVF9Q + QUlOVFNIQVBFX0VORAAAAAAAAAAAhQABAAUAAACGRQAAAYQAAQAFAAAAAAAAAABvAAIANgAA + AAEABgAlOQAA2RUAALs4AADZFQAAuzgAAAYVAACOOQAABhUAAI45AADZFQAAJTkAANkVAAAA + AIUAAQAFAAAADkL/AAGEAAEABQAAAAAAAAAAbwACADYAAAABAAYAJTkAAOsTAAC7OAAA6xMA + ALs4AAAYEwAAjjkAABgTAACOOQAA6xMAACU5AADrEwAAAACFAAEABQAAACDT/wABhAABAAUA + AAAAAAAAAG8AAgA2AAAAAQAGACU5AAD9EQAAuzgAAP0RAAC7OAAAKhEAAI45AAAqEQAAjjkA + AP0RAAAlOQAA/REAAAAAhQABAAUAAAAcnVcAAYQAAQAFAAAAAAAAAABvAAIANgAAAAEABgAl + OQAADxAAALs4AAAPEAAAuzgAADwPAACOOQAAPA8AAI45AAAPEAAAJTkAAA8QAAAAAIUAAQAF + AAAAIQB+AAGEAAEABQAAAAAAAAAAbwACADYAAAABAAYAJTkAACEOAAC7OAAAIQ4AALs4AABO + DQAAjjkAAE4NAACOOQAAIQ4AACU5AAAhDgAAAAAAAgEAIAAAABYAWFRFWFRfUEFJTlRTSEFQ + RV9CRUdJTgAAAAAAAAAAigABAEEAAAADADsAAAAPAExpYmVyYXRpb24gU2FucwAAAAAAAGEB + AAD//wAAAgAFAAAAAAAAAAkIAAAAAAAAAAAA/wMAAAAAAIgAAQACAAAAAQCHAAEABQAAAP// + //8AhgABAAQAAAAAAAAAcQACADYAAADyOQAALQ4AAAQAAABGAGkAdgBlAAAABAAEAAAA0QAA + ACABAACjAQAAWgIAAAQARgBpAHYAZQAAAgEAEwAAAAkAWFRFWFRfRU9DAAAAAAAAAAAAAgEA + EwAAAAkAWFRFWFRfRU9DAQAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9DAgAAAAAAAAAAAgEA + EwAAAAkAWFRFWFRfRU9DAwAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9MAAAAAAAAAAAAAgEA + EwAAAAkAWFRFWFRfRU9QAAAAAAAAAAAAAgEAHgAAABQAWFRFWFRfUEFJTlRTSEFQRV9FTkQA + AAAAAAAAAAACAQAgAAAAFgBYVEVYVF9QQUlOVFNIQVBFX0JFR0lOAAAAAAAAAACKAAEAQQAA + AAMAOwAAAA8ATGliZXJhdGlvbiBTYW5zAAAAAAAAYQEAAP//AAACAAUAAAAAAAAACQgAAAAA + AAAAAAD/AwAAAAAAiAABAAIAAAABAIcAAQAFAAAA/////wCGAAEABAAAAAAAAABxAAIANgAA + API5AAAbEAAABAAAAEYAbwB1AHIAAAAEAAQAAADRAAAAiQEAAEACAACpAgAABABGAG8AdQBy + AAACAQATAAAACQBYVEVYVF9FT0MAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MBAAAAAAAA + AAACAQATAAAACQBYVEVYVF9FT0MCAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT0MDAAAAAAAA + AAACAQATAAAACQBYVEVYVF9FT0wAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1AAAAAAAAAA + AAACAQAeAAAAFABYVEVYVF9QQUlOVFNIQVBFX0VORAAAAAAAAAAAAAIBACAAAAAWAFhURVhU + X1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBBAAAAAwA7AAAADwBMaWJlcmF0aW9uIFNh + bnMAAAAAAABhAQAA//8AAAIABQAAAAAAAAAJCAAAAAAAAAAAAP8DAAAAAACIAAEAAgAAAAEA + hwABAAUAAAD/////AIYAAQAEAAAAAAAAAHEAAgA+AAAA8jkAAAkSAAAFAAAAVABoAHIAZQBl + AAAABQAFAAAAtwAAAG8BAADXAQAAjwIAAEYDAAAFAFQAaAByAGUAZQAAAgEAEwAAAAkAWFRF + WFRfRU9DAAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9DAQAAAAAAAAAAAgEAEwAAAAkAWFRF + WFRfRU9DAgAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9DAwAAAAAAAAAAAgEAEwAAAAkAWFRF + WFRfRU9DBAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9MAAAAAAAAAAAAAgEAEwAAAAkAWFRF + WFRfRU9QAAAAAAAAAAAAAgEAHgAAABQAWFRFWFRfUEFJTlRTSEFQRV9FTkQAAAAAAAAAAAAC + AQAgAAAAFgBYVEVYVF9QQUlOVFNIQVBFX0JFR0lOAAAAAAAAAACKAAEAQQAAAAMAOwAAAA8A + TGliZXJhdGlvbiBTYW5zAAAAAAAAYQEAAP//AAACAAUAAAAAAAAACQgAAAAAAAAAAAD/AwAA + AAAAiAABAAIAAAABAIcAAQAFAAAA/////wCGAAEABAAAAAAAAABxAAIALgAAAPI5AAD3EwAA + AwAAAFQAdwBvAAAAAwADAAAAnQAAAIkBAABAAgAAAwBUAHcAbwAAAgEAEwAAAAkAWFRFWFRf + RU9DAAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9DAQAAAAAAAAAAAgEAEwAAAAkAWFRFWFRf + RU9DAgAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9MAAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRf + RU9QAAAAAAAAAAAAAgEAHgAAABQAWFRFWFRfUEFJTlRTSEFQRV9FTkQAAAAAAAAAAAACAQAg + AAAAFgBYVEVYVF9QQUlOVFNIQVBFX0JFR0lOAAAAAAAAAACKAAEAQQAAAAMAOwAAAA8ATGli + ZXJhdGlvbiBTYW5zAAAAAAAAYQEAAP//AAACAAUAAAAAAAAACQgAAAAAAAAAAAD/AwAAAAAA + iAABAAIAAAABAIcAAQAFAAAA/////wCGAAEABAAAAAAAAABxAAIALgAAAPI5AADlFQAAAwAA + AE8AbgBlAAAAAwADAAAABgEAAL0BAAB0AgAAAwBPAG4AZQAAAgEAEwAAAAkAWFRFWFRfRU9D + AAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9DAQAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9D + AgAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9MAAAAAAAAAAAAAgEAEwAAAAkAWFRFWFRfRU9Q + AAAAAAAAAAAAAgEAHgAAABQAWFRFWFRfUEFJTlRTSEFQRV9FTkQAAAAAAAAAAIwAAQAAAAAA + iwABAAIAAAAgAIIAAQAhAAAAAgAbAAAAAgACAAAAAAAAACcjAAABAAAAAAB/PgAAAgAAjAAB + AAAAAACMAAEAAAAAAA== + + + + + + + + Summary + + + Some + + + + + + One + + + £957 + + + + + + Two + + + £207 + + + + + + Three + + + £690 + + + + + + Four + + + £346 + + + + + + Five + + + £894 + + + + + + + + + + To reproduce bug: + + + + + + + Save as Flat ODS: extension '.fods' + + + + + + + Reload … bingo … + + + + + + + + + 956.5941735636 + + + 573.4103277791 + + + + + 207.4256495107 + + + 604.592139367 + + + + + 689.5083636045 + + + 44.302029768 + + + + + 346.0625661537 + + + 835.6307845097 + + + + + 893.9812064637 + + + 220.4455654137 + + + + + 140.1847645175 + + + 130.7745140512 + + + + + + + \ No newline at end of file diff --git a/chart2/qa/extras/data/odp/BarChartVeryLongLabel.odp b/chart2/qa/extras/data/odp/BarChartVeryLongLabel.odp new file mode 100644 index 0000000000..c627af79e4 Binary files /dev/null and b/chart2/qa/extras/data/odp/BarChartVeryLongLabel.odp differ diff --git a/chart2/qa/extras/data/odp/chart.odp b/chart2/qa/extras/data/odp/chart.odp new file mode 100644 index 0000000000..81a5f56b27 Binary files /dev/null and b/chart2/qa/extras/data/odp/chart.odp differ diff --git a/chart2/qa/extras/data/odp/ellipticalGradientFill.odp b/chart2/qa/extras/data/odp/ellipticalGradientFill.odp new file mode 100644 index 0000000000..754f439e58 Binary files /dev/null and b/chart2/qa/extras/data/odp/ellipticalGradientFill.odp differ diff --git a/chart2/qa/extras/data/odp/tdf119029.odp b/chart2/qa/extras/data/odp/tdf119029.odp new file mode 100644 index 0000000000..87e4a03c84 Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf119029.odp differ diff --git a/chart2/qa/extras/data/odp/tdf121189.odp b/chart2/qa/extras/data/odp/tdf121189.odp new file mode 100644 index 0000000000..6f99e00549 Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf121189.odp differ diff --git a/chart2/qa/extras/data/odp/tdf123206.odp b/chart2/qa/extras/data/odp/tdf123206.odp new file mode 100644 index 0000000000..1975756bce Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf123206.odp differ diff --git a/chart2/qa/extras/data/odp/tdf128345_ChartArea_CG_TS.odp b/chart2/qa/extras/data/odp/tdf128345_ChartArea_CG_TS.odp new file mode 100644 index 0000000000..754e71d512 Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf128345_ChartArea_CG_TS.odp differ diff --git a/chart2/qa/extras/data/odp/tdf128345_ChartWall_CS_TG.odp b/chart2/qa/extras/data/odp/tdf128345_ChartWall_CS_TG.odp new file mode 100644 index 0000000000..4c09ebb7bb Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf128345_ChartWall_CS_TG.odp differ diff --git a/chart2/qa/extras/data/odp/tdf128345_Legend_CS_TG_axial.odp b/chart2/qa/extras/data/odp/tdf128345_Legend_CS_TG_axial.odp new file mode 100644 index 0000000000..bfcd8a5dd5 Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf128345_Legend_CS_TG_axial.odp differ diff --git a/chart2/qa/extras/data/ods/ErrorBarRange.ods b/chart2/qa/extras/data/ods/ErrorBarRange.ods new file mode 100644 index 0000000000..28e6aeeddb Binary files /dev/null and b/chart2/qa/extras/data/ods/ErrorBarRange.ods differ diff --git a/chart2/qa/extras/data/ods/PivotChartRoundTrip.ods b/chart2/qa/extras/data/ods/PivotChartRoundTrip.ods new file mode 100644 index 0000000000..c34521e0bc Binary files /dev/null and b/chart2/qa/extras/data/ods/PivotChartRoundTrip.ods differ diff --git a/chart2/qa/extras/data/ods/PivotTableExample.ods b/chart2/qa/extras/data/ods/PivotTableExample.ods new file mode 100644 index 0000000000..bc8df81702 Binary files /dev/null and b/chart2/qa/extras/data/ods/PivotTableExample.ods differ diff --git a/chart2/qa/extras/data/ods/axis-numformats-linked.ods b/chart2/qa/extras/data/ods/axis-numformats-linked.ods new file mode 100644 index 0000000000..ddaa9c9014 Binary files /dev/null and b/chart2/qa/extras/data/ods/axis-numformats-linked.ods differ diff --git a/chart2/qa/extras/data/ods/axis_number_format.ods b/chart2/qa/extras/data/ods/axis_number_format.ods new file mode 100644 index 0000000000..52e979a490 Binary files /dev/null and b/chart2/qa/extras/data/ods/axis_number_format.ods differ diff --git a/chart2/qa/extras/data/ods/chart.ods b/chart2/qa/extras/data/ods/chart.ods new file mode 100644 index 0000000000..2a9916aca0 Binary files /dev/null and b/chart2/qa/extras/data/ods/chart.ods differ diff --git a/chart2/qa/extras/data/ods/chartWithDotInSheetName.ods b/chart2/qa/extras/data/ods/chartWithDotInSheetName.ods new file mode 100644 index 0000000000..873d45f4be Binary files /dev/null and b/chart2/qa/extras/data/ods/chartWithDotInSheetName.ods differ diff --git a/chart2/qa/extras/data/ods/combined_chart_secondary_axis.ods b/chart2/qa/extras/data/ods/combined_chart_secondary_axis.ods new file mode 100644 index 0000000000..d125bc23d3 Binary files /dev/null and b/chart2/qa/extras/data/ods/combined_chart_secondary_axis.ods differ diff --git a/chart2/qa/extras/data/ods/error_bar.ods b/chart2/qa/extras/data/ods/error_bar.ods new file mode 100644 index 0000000000..9c3adbbca8 Binary files /dev/null and b/chart2/qa/extras/data/ods/error_bar.ods differ diff --git a/chart2/qa/extras/data/ods/error_bar_properties.ods b/chart2/qa/extras/data/ods/error_bar_properties.ods new file mode 100644 index 0000000000..056be88b22 Binary files /dev/null and b/chart2/qa/extras/data/ods/error_bar_properties.ods differ diff --git a/chart2/qa/extras/data/ods/error_bar_range.ods b/chart2/qa/extras/data/ods/error_bar_range.ods new file mode 100644 index 0000000000..27a0103e57 Binary files /dev/null and b/chart2/qa/extras/data/ods/error_bar_range.ods differ diff --git a/chart2/qa/extras/data/ods/fdo60083.ods b/chart2/qa/extras/data/ods/fdo60083.ods new file mode 100644 index 0000000000..74704f6185 Binary files /dev/null and b/chart2/qa/extras/data/ods/fdo60083.ods differ diff --git a/chart2/qa/extras/data/ods/labelString.ods b/chart2/qa/extras/data/ods/labelString.ods new file mode 100644 index 0000000000..2b7e03c8eb Binary files /dev/null and b/chart2/qa/extras/data/ods/labelString.ods differ diff --git a/chart2/qa/extras/data/ods/legend_overlay.ods b/chart2/qa/extras/data/ods/legend_overlay.ods new file mode 100644 index 0000000000..fade626405 Binary files /dev/null and b/chart2/qa/extras/data/ods/legend_overlay.ods differ diff --git a/chart2/qa/extras/data/ods/moving-type.ods b/chart2/qa/extras/data/ods/moving-type.ods new file mode 100644 index 0000000000..8a8568cfa7 Binary files /dev/null and b/chart2/qa/extras/data/ods/moving-type.ods differ diff --git a/chart2/qa/extras/data/ods/multilevelcat.ods b/chart2/qa/extras/data/ods/multilevelcat.ods new file mode 100644 index 0000000000..76b140a879 Binary files /dev/null and b/chart2/qa/extras/data/ods/multilevelcat.ods differ diff --git a/chart2/qa/extras/data/ods/multiple_axis.ods b/chart2/qa/extras/data/ods/multiple_axis.ods new file mode 100644 index 0000000000..7e2a505ccb Binary files /dev/null and b/chart2/qa/extras/data/ods/multiple_axis.ods differ diff --git a/chart2/qa/extras/data/ods/pie_chart_100_and_0.ods b/chart2/qa/extras/data/ods/pie_chart_100_and_0.ods new file mode 100644 index 0000000000..a6ff5d6aa0 Binary files /dev/null and b/chart2/qa/extras/data/ods/pie_chart_100_and_0.ods differ diff --git a/chart2/qa/extras/data/ods/secondary_axis.ods b/chart2/qa/extras/data/ods/secondary_axis.ods new file mode 100644 index 0000000000..3f8f269c0f Binary files /dev/null and b/chart2/qa/extras/data/ods/secondary_axis.ods differ diff --git a/chart2/qa/extras/data/ods/ser_labels.ods b/chart2/qa/extras/data/ods/ser_labels.ods new file mode 100644 index 0000000000..c7bd966382 Binary files /dev/null and b/chart2/qa/extras/data/ods/ser_labels.ods differ diff --git a/chart2/qa/extras/data/ods/smoothedLines.ods b/chart2/qa/extras/data/ods/smoothedLines.ods new file mode 100644 index 0000000000..725827e639 Binary files /dev/null and b/chart2/qa/extras/data/ods/smoothedLines.ods differ diff --git a/chart2/qa/extras/data/ods/stepped_lines.ods b/chart2/qa/extras/data/ods/stepped_lines.ods new file mode 100644 index 0000000000..23d443ab5d Binary files /dev/null and b/chart2/qa/extras/data/ods/stepped_lines.ods differ diff --git a/chart2/qa/extras/data/ods/tdf101894.ods b/chart2/qa/extras/data/ods/tdf101894.ods new file mode 100644 index 0000000000..70d8b3a0dd Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf101894.ods differ diff --git a/chart2/qa/extras/data/ods/tdf107097.ods b/chart2/qa/extras/data/ods/tdf107097.ods new file mode 100644 index 0000000000..efa9f1c013 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf107097.ods differ diff --git a/chart2/qa/extras/data/ods/tdf108021.ods b/chart2/qa/extras/data/ods/tdf108021.ods new file mode 100644 index 0000000000..ebbc5e56f2 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf108021.ods differ diff --git a/chart2/qa/extras/data/ods/tdf120348.ods b/chart2/qa/extras/data/ods/tdf120348.ods new file mode 100644 index 0000000000..7a593c1bff Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf120348.ods differ diff --git a/chart2/qa/extras/data/ods/tdf123774.ods b/chart2/qa/extras/data/ods/tdf123774.ods new file mode 100644 index 0000000000..5c422b58c3 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf123774.ods differ diff --git a/chart2/qa/extras/data/ods/tdf128432.ods b/chart2/qa/extras/data/ods/tdf128432.ods new file mode 100644 index 0000000000..a93822fc9b Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf128432.ods differ diff --git a/chart2/qa/extras/data/ods/tdf131115.ods b/chart2/qa/extras/data/ods/tdf131115.ods new file mode 100644 index 0000000000..76a87c2c22 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf131115.ods differ diff --git a/chart2/qa/extras/data/ods/tdf131979.ods b/chart2/qa/extras/data/ods/tdf131979.ods new file mode 100644 index 0000000000..3dfcf6b699 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf131979.ods differ diff --git a/chart2/qa/extras/data/ods/tdf132076.ods b/chart2/qa/extras/data/ods/tdf132076.ods new file mode 100644 index 0000000000..348dd0d71f Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf132076.ods differ diff --git a/chart2/qa/extras/data/ods/tdf135366_data_label_series.ods b/chart2/qa/extras/data/ods/tdf135366_data_label_series.ods new file mode 100644 index 0000000000..e7c1f7d89d Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf135366_data_label_series.ods differ diff --git a/chart2/qa/extras/data/ods/tdf136011.ods b/chart2/qa/extras/data/ods/tdf136011.ods new file mode 100644 index 0000000000..03a0a7dd63 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf136011.ods differ diff --git a/chart2/qa/extras/data/ods/tdf136024.ods b/chart2/qa/extras/data/ods/tdf136024.ods new file mode 100644 index 0000000000..c8d004f544 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf136024.ods differ diff --git a/chart2/qa/extras/data/ods/tdf146066.ods b/chart2/qa/extras/data/ods/tdf146066.ods new file mode 100644 index 0000000000..03abe9ae68 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf146066.ods differ diff --git a/chart2/qa/extras/data/ods/tdf146463.ods b/chart2/qa/extras/data/ods/tdf146463.ods new file mode 100644 index 0000000000..6214f4a500 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf146463.ods differ diff --git a/chart2/qa/extras/data/ods/tdf148142.ods b/chart2/qa/extras/data/ods/tdf148142.ods new file mode 100644 index 0000000000..9b736a06d1 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf148142.ods differ diff --git a/chart2/qa/extras/data/ods/tdf151091.ods b/chart2/qa/extras/data/ods/tdf151091.ods new file mode 100644 index 0000000000..b3a43b3cea Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf151091.ods differ diff --git a/chart2/qa/extras/data/ods/tdf158223.ods b/chart2/qa/extras/data/ods/tdf158223.ods new file mode 100644 index 0000000000..33a7169744 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf158223.ods differ diff --git a/chart2/qa/extras/data/ods/tdf59857.ods b/chart2/qa/extras/data/ods/tdf59857.ods new file mode 100644 index 0000000000..e60e9c4c12 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf59857.ods differ diff --git a/chart2/qa/extras/data/ods/tdf62057.ods b/chart2/qa/extras/data/ods/tdf62057.ods new file mode 100644 index 0000000000..3945c41d03 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf62057.ods differ diff --git a/chart2/qa/extras/data/ods/tdf64224.ods b/chart2/qa/extras/data/ods/tdf64224.ods new file mode 100644 index 0000000000..e60e9c4c12 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf64224.ods differ diff --git a/chart2/qa/extras/data/ods/tdf72776.ods b/chart2/qa/extras/data/ods/tdf72776.ods new file mode 100644 index 0000000000..4ddad64a5e Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf72776.ods differ diff --git a/chart2/qa/extras/data/ods/tdf86624.ods b/chart2/qa/extras/data/ods/tdf86624.ods new file mode 100644 index 0000000000..05702371a1 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf86624.ods differ diff --git a/chart2/qa/extras/data/ods/tdf96161.ods b/chart2/qa/extras/data/ods/tdf96161.ods new file mode 100644 index 0000000000..797a712a74 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf96161.ods differ diff --git a/chart2/qa/extras/data/ods/testChartMainWithSubTitle.ods b/chart2/qa/extras/data/ods/testChartMainWithSubTitle.ods new file mode 100644 index 0000000000..5ae4fa7d99 Binary files /dev/null and b/chart2/qa/extras/data/ods/testChartMainWithSubTitle.ods differ diff --git a/chart2/qa/extras/data/ods/testChartSubTitle.ods b/chart2/qa/extras/data/ods/testChartSubTitle.ods new file mode 100644 index 0000000000..1c7814195d Binary files /dev/null and b/chart2/qa/extras/data/ods/testChartSubTitle.ods differ diff --git a/chart2/qa/extras/data/ods/testColorGradientWithTransparency.ods b/chart2/qa/extras/data/ods/testColorGradientWithTransparency.ods new file mode 100644 index 0000000000..d8a41c02c1 Binary files /dev/null and b/chart2/qa/extras/data/ods/testColorGradientWithTransparency.ods differ diff --git a/chart2/qa/extras/data/ods/test_CrossBetween.ods b/chart2/qa/extras/data/ods/test_CrossBetween.ods new file mode 100644 index 0000000000..e59546b3d0 Binary files /dev/null and b/chart2/qa/extras/data/ods/test_CrossBetween.ods differ diff --git a/chart2/qa/extras/data/ods/trend_calculators.ods b/chart2/qa/extras/data/ods/trend_calculators.ods new file mode 100644 index 0000000000..fdc5ea42dc Binary files /dev/null and b/chart2/qa/extras/data/ods/trend_calculators.ods differ diff --git a/chart2/qa/extras/data/ods/trendline.ods b/chart2/qa/extras/data/ods/trendline.ods new file mode 100644 index 0000000000..707d510203 Binary files /dev/null and b/chart2/qa/extras/data/ods/trendline.ods differ diff --git a/chart2/qa/extras/data/odt/axis-position.odt b/chart2/qa/extras/data/odt/axis-position.odt new file mode 100644 index 0000000000..35ea152aa0 Binary files /dev/null and b/chart2/qa/extras/data/odt/axis-position.odt differ diff --git a/chart2/qa/extras/data/odt/chart.odt b/chart2/qa/extras/data/odt/chart.odt new file mode 100644 index 0000000000..5f2dd34d2a Binary files /dev/null and b/chart2/qa/extras/data/odt/chart.odt differ diff --git a/chart2/qa/extras/data/odt/multilevelcat.odt b/chart2/qa/extras/data/odt/multilevelcat.odt new file mode 100644 index 0000000000..8148e1be10 Binary files /dev/null and b/chart2/qa/extras/data/odt/multilevelcat.odt differ diff --git a/chart2/qa/extras/data/odt/scatter-plot-labels.odt b/chart2/qa/extras/data/odt/scatter-plot-labels.odt new file mode 100644 index 0000000000..ab8f243242 Binary files /dev/null and b/chart2/qa/extras/data/odt/scatter-plot-labels.odt differ diff --git a/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt b/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt new file mode 100644 index 0000000000..06e15a6b0d Binary files /dev/null and b/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt differ diff --git a/chart2/qa/extras/data/odt/tdf108022.odt b/chart2/qa/extras/data/odt/tdf108022.odt new file mode 100644 index 0000000000..b8659ec32c Binary files /dev/null and b/chart2/qa/extras/data/odt/tdf108022.odt differ diff --git a/chart2/qa/extras/data/odt/tdf114657.odt b/chart2/qa/extras/data/odt/tdf114657.odt new file mode 100644 index 0000000000..4c99963b0d Binary files /dev/null and b/chart2/qa/extras/data/odt/tdf114657.odt differ diff --git a/chart2/qa/extras/data/odt/tdf128733.odt b/chart2/qa/extras/data/odt/tdf128733.odt new file mode 100644 index 0000000000..18aace26c0 Binary files /dev/null and b/chart2/qa/extras/data/odt/tdf128733.odt differ diff --git a/chart2/qa/extras/data/odt/tdf131143.odt b/chart2/qa/extras/data/odt/tdf131143.odt new file mode 100644 index 0000000000..e8ffeaf5a9 Binary files /dev/null and b/chart2/qa/extras/data/odt/tdf131143.odt differ diff --git a/chart2/qa/extras/data/odt/tdf135366_data_label_export.odt b/chart2/qa/extras/data/odt/tdf135366_data_label_export.odt new file mode 100644 index 0000000000..85759f2ade Binary files /dev/null and b/chart2/qa/extras/data/odt/tdf135366_data_label_export.odt differ diff --git a/chart2/qa/extras/data/odt/tdf135366_data_label_point.odt b/chart2/qa/extras/data/odt/tdf135366_data_label_point.odt new file mode 100644 index 0000000000..3c176a37ad Binary files /dev/null and b/chart2/qa/extras/data/odt/tdf135366_data_label_point.odt differ diff --git a/chart2/qa/extras/data/odt/testPieChartWallLineStyle.odt b/chart2/qa/extras/data/odt/testPieChartWallLineStyle.odt new file mode 100644 index 0000000000..0e1ab533b1 Binary files /dev/null and b/chart2/qa/extras/data/odt/testPieChartWallLineStyle.odt differ diff --git a/chart2/qa/extras/data/ppt/chart.ppt b/chart2/qa/extras/data/ppt/chart.ppt new file mode 100644 index 0000000000..0efffaf36a Binary files /dev/null and b/chart2/qa/extras/data/ppt/chart.ppt differ diff --git a/chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx b/chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx new file mode 100644 index 0000000000..3f95e932b1 Binary files /dev/null and b/chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx differ diff --git a/chart2/qa/extras/data/pptx/bnc864396.pptx b/chart2/qa/extras/data/pptx/bnc864396.pptx new file mode 100644 index 0000000000..e2e05c5161 Binary files /dev/null and b/chart2/qa/extras/data/pptx/bnc864396.pptx differ diff --git a/chart2/qa/extras/data/pptx/bnc882383.pptx b/chart2/qa/extras/data/pptx/bnc882383.pptx new file mode 100644 index 0000000000..18b44f0c1b Binary files /dev/null and b/chart2/qa/extras/data/pptx/bnc882383.pptx differ diff --git a/chart2/qa/extras/data/pptx/bnc889755.pptx b/chart2/qa/extras/data/pptx/bnc889755.pptx new file mode 100644 index 0000000000..f3af677656 Binary files /dev/null and b/chart2/qa/extras/data/pptx/bnc889755.pptx differ diff --git a/chart2/qa/extras/data/pptx/chart.pptx b/chart2/qa/extras/data/pptx/chart.pptx new file mode 100644 index 0000000000..8f11ea53d0 Binary files /dev/null and b/chart2/qa/extras/data/pptx/chart.pptx differ diff --git a/chart2/qa/extras/data/pptx/percentage-number-formats.pptx b/chart2/qa/extras/data/pptx/percentage-number-formats.pptx new file mode 100644 index 0000000000..280c7ef291 Binary files /dev/null and b/chart2/qa/extras/data/pptx/percentage-number-formats.pptx differ diff --git a/chart2/qa/extras/data/pptx/sparse-chart.pptx b/chart2/qa/extras/data/pptx/sparse-chart.pptx new file mode 100644 index 0000000000..d91e8f52f4 Binary files /dev/null and b/chart2/qa/extras/data/pptx/sparse-chart.pptx differ diff --git a/chart2/qa/extras/data/pptx/stacked-bar-chart-hidden-series.pptx b/chart2/qa/extras/data/pptx/stacked-bar-chart-hidden-series.pptx new file mode 100644 index 0000000000..20ba89a0b7 Binary files /dev/null and b/chart2/qa/extras/data/pptx/stacked-bar-chart-hidden-series.pptx differ diff --git a/chart2/qa/extras/data/pptx/stacked-non-stacked-mix-y-axis.pptx b/chart2/qa/extras/data/pptx/stacked-non-stacked-mix-y-axis.pptx new file mode 100644 index 0000000000..27d099d40f Binary files /dev/null and b/chart2/qa/extras/data/pptx/stacked-non-stacked-mix-y-axis.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf105517.pptx b/chart2/qa/extras/data/pptx/tdf105517.pptx new file mode 100644 index 0000000000..ff9d747f03 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf105517.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf106217.pptx b/chart2/qa/extras/data/pptx/tdf106217.pptx new file mode 100644 index 0000000000..64fb968b8a Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf106217.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf115107-2.pptx b/chart2/qa/extras/data/pptx/tdf115107-2.pptx new file mode 100644 index 0000000000..629056ecc8 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf115107-2.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf115107.pptx b/chart2/qa/extras/data/pptx/tdf115107.pptx new file mode 100644 index 0000000000..2ec5c2cd22 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf115107.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf115859.pptx b/chart2/qa/extras/data/pptx/tdf115859.pptx new file mode 100644 index 0000000000..07943041be Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf115859.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf116163.pptx b/chart2/qa/extras/data/pptx/tdf116163.pptx new file mode 100644 index 0000000000..5fbee8304a Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf116163.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf121205.pptx b/chart2/qa/extras/data/pptx/tdf121205.pptx new file mode 100644 index 0000000000..e60849ec02 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf121205.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf122765.pptx b/chart2/qa/extras/data/pptx/tdf122765.pptx new file mode 100644 index 0000000000..948190c30b Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf122765.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf125444.pptx b/chart2/qa/extras/data/pptx/tdf125444.pptx new file mode 100644 index 0000000000..e78efecd65 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf125444.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf127393.pptx b/chart2/qa/extras/data/pptx/tdf127393.pptx new file mode 100644 index 0000000000..7c4047817a Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127393.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf127720.pptx b/chart2/qa/extras/data/pptx/tdf127720.pptx new file mode 100644 index 0000000000..b10a4c5ab4 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127720.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf127811.pptx b/chart2/qa/extras/data/pptx/tdf127811.pptx new file mode 100644 index 0000000000..cf3fdee606 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127811.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf128345_ChartArea_CG_TS.pptx b/chart2/qa/extras/data/pptx/tdf128345_ChartArea_CG_TS.pptx new file mode 100644 index 0000000000..986dbe0dfd Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf128345_ChartArea_CG_TS.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf128345_ChartWall_CS_TG.pptx b/chart2/qa/extras/data/pptx/tdf128345_ChartWall_CS_TG.pptx new file mode 100644 index 0000000000..63d126b78d Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf128345_ChartWall_CS_TG.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf128345_Legend_CS_TG_axial.pptx b/chart2/qa/extras/data/pptx/tdf128345_Legend_CS_TG_axial.pptx new file mode 100644 index 0000000000..67e383cfb1 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf128345_Legend_CS_TG_axial.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf135366_CustomLabelText.pptx b/chart2/qa/extras/data/pptx/tdf135366_CustomLabelText.pptx new file mode 100644 index 0000000000..58d73fcd26 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf135366_CustomLabelText.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx b/chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx new file mode 100644 index 0000000000..edb465d729 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf150176.pptx b/chart2/qa/extras/data/pptx/tdf150176.pptx new file mode 100644 index 0000000000..fa217f92c8 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf150176.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf48041.pptx b/chart2/qa/extras/data/pptx/tdf48041.pptx new file mode 100644 index 0000000000..b0872f84f2 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf48041.pptx differ diff --git a/chart2/qa/extras/data/pptx/tdf60316.pptx b/chart2/qa/extras/data/pptx/tdf60316.pptx new file mode 100644 index 0000000000..d1da03e5fa Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf60316.pptx differ diff --git a/chart2/qa/extras/data/pptx/testChartTitlePropertiesBitmapFill.pptx b/chart2/qa/extras/data/pptx/testChartTitlePropertiesBitmapFill.pptx new file mode 100644 index 0000000000..395546edb4 Binary files /dev/null and b/chart2/qa/extras/data/pptx/testChartTitlePropertiesBitmapFill.pptx differ diff --git a/chart2/qa/extras/data/pptx/testChartTitlePropertiesColorFill.pptx b/chart2/qa/extras/data/pptx/testChartTitlePropertiesColorFill.pptx new file mode 100644 index 0000000000..361bdd643c Binary files /dev/null and b/chart2/qa/extras/data/pptx/testChartTitlePropertiesColorFill.pptx differ diff --git a/chart2/qa/extras/data/pptx/testChartTitlePropertiesGradientFill.pptx b/chart2/qa/extras/data/pptx/testChartTitlePropertiesGradientFill.pptx new file mode 100644 index 0000000000..a77896dcdf Binary files /dev/null and b/chart2/qa/extras/data/pptx/testChartTitlePropertiesGradientFill.pptx differ diff --git a/chart2/qa/extras/data/xls/axis_sourceformatting.xls b/chart2/qa/extras/data/xls/axis_sourceformatting.xls new file mode 100644 index 0000000000..2ee38b7208 Binary files /dev/null and b/chart2/qa/extras/data/xls/axis_sourceformatting.xls differ diff --git a/chart2/qa/extras/data/xls/chart.xls b/chart2/qa/extras/data/xls/chart.xls new file mode 100644 index 0000000000..7c81d7f49e Binary files /dev/null and b/chart2/qa/extras/data/xls/chart.xls differ diff --git a/chart2/qa/extras/data/xls/piechart_outside.xls b/chart2/qa/extras/data/xls/piechart_outside.xls new file mode 100644 index 0000000000..02a4f7b855 Binary files /dev/null and b/chart2/qa/extras/data/xls/piechart_outside.xls differ diff --git a/chart2/qa/extras/data/xls/source_number_format_axis.xls b/chart2/qa/extras/data/xls/source_number_format_axis.xls new file mode 100644 index 0000000000..bc54593ac1 Binary files /dev/null and b/chart2/qa/extras/data/xls/source_number_format_axis.xls differ diff --git a/chart2/qa/extras/data/xlsx/ChartDataTable.xlsx b/chart2/qa/extras/data/xlsx/ChartDataTable.xlsx new file mode 100644 index 0000000000..fff4f00aea Binary files /dev/null and b/chart2/qa/extras/data/xlsx/ChartDataTable.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx b/chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx new file mode 100644 index 0000000000..b077fd2e03 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/add_series_secondary_axis.xlsx b/chart2/qa/extras/data/xlsx/add_series_secondary_axis.xlsx new file mode 100644 index 0000000000..03d7a47f6c Binary files /dev/null and b/chart2/qa/extras/data/xlsx/add_series_secondary_axis.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/auto_marker_excel10.xlsx b/chart2/qa/extras/data/xlsx/auto_marker_excel10.xlsx new file mode 100644 index 0000000000..c157562572 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/auto_marker_excel10.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx b/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx new file mode 100644 index 0000000000..9ce71cf4e0 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx b/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx new file mode 100644 index 0000000000..a5070273a8 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/axis-label-rotation.xlsx b/chart2/qa/extras/data/xlsx/axis-label-rotation.xlsx new file mode 100644 index 0000000000..cc3b1df8a4 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/axis-label-rotation.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/axis_character_properties.xlsx b/chart2/qa/extras/data/xlsx/axis_character_properties.xlsx new file mode 100644 index 0000000000..635aafe81b Binary files /dev/null and b/chart2/qa/extras/data/xlsx/axis_character_properties.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/axis_title_default_rotation.xlsx b/chart2/qa/extras/data/xlsx/axis_title_default_rotation.xlsx new file mode 100644 index 0000000000..5cda3af37e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/axis_title_default_rotation.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx b/chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx new file mode 100644 index 0000000000..29e42d8a47 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/axis_title_rotated.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/axis_title_rotation.xlsx b/chart2/qa/extras/data/xlsx/axis_title_rotation.xlsx new file mode 100644 index 0000000000..fc90e2bf4c Binary files /dev/null and b/chart2/qa/extras/data/xlsx/axis_title_rotation.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx b/chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx new file mode 100644 index 0000000000..52040bf2cd Binary files /dev/null and b/chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/barchart_outend.xlsx b/chart2/qa/extras/data/xlsx/barchart_outend.xlsx new file mode 100644 index 0000000000..621c0c2844 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/barchart_outend.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/barchart_totalsrow.xlsx b/chart2/qa/extras/data/xlsx/barchart_totalsrow.xlsx new file mode 100644 index 0000000000..c87b2b3186 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/barchart_totalsrow.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/bubble_chart_simple.xlsx b/chart2/qa/extras/data/xlsx/bubble_chart_simple.xlsx new file mode 100644 index 0000000000..d13fe5ef48 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/bubble_chart_simple.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx b/chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx new file mode 100644 index 0000000000..2baf1e2063 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart-area-style-border.xlsx b/chart2/qa/extras/data/xlsx/chart-area-style-border.xlsx new file mode 100644 index 0000000000..81a6a6e606 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart-area-style-border.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart-auto-background.xlsx b/chart2/qa/extras/data/xlsx/chart-auto-background.xlsx new file mode 100644 index 0000000000..a4594ad4fc Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart-auto-background.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx b/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx new file mode 100644 index 0000000000..4e3394c8ef Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart-text-can-overlap.xlsx b/chart2/qa/extras/data/xlsx/chart-text-can-overlap.xlsx new file mode 100644 index 0000000000..59f907dffe Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart-text-can-overlap.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart.xlsx b/chart2/qa/extras/data/xlsx/chart.xlsx new file mode 100644 index 0000000000..193bfc49d5 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart_label_text_break.xlsx b/chart2/qa/extras/data/xlsx/chart_label_text_break.xlsx new file mode 100644 index 0000000000..81c4958604 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart_label_text_break.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx new file mode 100644 index 0000000000..583c6720a4 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart_title.xlsx b/chart2/qa/extras/data/xlsx/chart_title.xlsx new file mode 100644 index 0000000000..0b79855462 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart_title.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx b/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx new file mode 100644 index 0000000000..2f2b814011 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/combined_chart_secondary_axis.xlsx b/chart2/qa/extras/data/xlsx/combined_chart_secondary_axis.xlsx new file mode 100644 index 0000000000..e922d4df4a Binary files /dev/null and b/chart2/qa/extras/data/xlsx/combined_chart_secondary_axis.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/custom_data_label.xlsx b/chart2/qa/extras/data/xlsx/custom_data_label.xlsx new file mode 100644 index 0000000000..cc69aaf0dc Binary files /dev/null and b/chart2/qa/extras/data/xlsx/custom_data_label.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/data_label.xlsx b/chart2/qa/extras/data/xlsx/data_label.xlsx new file mode 100644 index 0000000000..1ccf9b6987 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/data_label.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/data_labels_fill_color.xlsx b/chart2/qa/extras/data/xlsx/data_labels_fill_color.xlsx new file mode 100644 index 0000000000..1a55f5b868 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/data_labels_fill_color.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/deleted_data_labels.xlsx b/chart2/qa/extras/data/xlsx/deleted_data_labels.xlsx new file mode 100644 index 0000000000..587c956082 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/deleted_data_labels.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/deleted_legend_entry.xlsx b/chart2/qa/extras/data/xlsx/deleted_legend_entry.xlsx new file mode 100644 index 0000000000..06a052646f Binary files /dev/null and b/chart2/qa/extras/data/xlsx/deleted_legend_entry.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/deleted_legend_entry2.xlsx b/chart2/qa/extras/data/xlsx/deleted_legend_entry2.xlsx new file mode 100644 index 0000000000..ea02464b1c Binary files /dev/null and b/chart2/qa/extras/data/xlsx/deleted_legend_entry2.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx b/chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx new file mode 100644 index 0000000000..64e673e7c7 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/dispBlanksAs_2007.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx b/chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx new file mode 100644 index 0000000000..86a0a35961 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/dispBlanksAs_2013.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/empty_chart.xlsx b/chart2/qa/extras/data/xlsx/empty_chart.xlsx new file mode 100644 index 0000000000..449902146a Binary files /dev/null and b/chart2/qa/extras/data/xlsx/empty_chart.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/external_str_ref.xlsx b/chart2/qa/extras/data/xlsx/external_str_ref.xlsx new file mode 100644 index 0000000000..f2dde80e1f Binary files /dev/null and b/chart2/qa/extras/data/xlsx/external_str_ref.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/fdo54361-1.xlsx b/chart2/qa/extras/data/xlsx/fdo54361-1.xlsx new file mode 100644 index 0000000000..dba79ef9cf Binary files /dev/null and b/chart2/qa/extras/data/xlsx/fdo54361-1.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/fdo54361.xlsx b/chart2/qa/extras/data/xlsx/fdo54361.xlsx new file mode 100644 index 0000000000..2c49802a05 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/fdo54361.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/fdo70609.xlsx b/chart2/qa/extras/data/xlsx/fdo70609.xlsx new file mode 100644 index 0000000000..261ef88058 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/fdo70609.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/fdo78080.xlsx b/chart2/qa/extras/data/xlsx/fdo78080.xlsx new file mode 100644 index 0000000000..c4a4e3e003 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/fdo78080.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/gapWidth.xlsx b/chart2/qa/extras/data/xlsx/gapWidth.xlsx new file mode 100644 index 0000000000..0e9c0eec08 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/gapWidth.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/hidden_cells.xlsx b/chart2/qa/extras/data/xlsx/hidden_cells.xlsx new file mode 100644 index 0000000000..da3e2da77e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/hidden_cells.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/incorrect_label_position.xlsx b/chart2/qa/extras/data/xlsx/incorrect_label_position.xlsx new file mode 100644 index 0000000000..4f133b5581 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/incorrect_label_position.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx b/chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx new file mode 100644 index 0000000000..16ea01142e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/legend_manual_layout.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/majorTickMark.xlsx b/chart2/qa/extras/data/xlsx/majorTickMark.xlsx new file mode 100644 index 0000000000..2b6cdcfb36 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/majorTickMark.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/markerColor.xlsx b/chart2/qa/extras/data/xlsx/markerColor.xlsx new file mode 100644 index 0000000000..65e87ff38d Binary files /dev/null and b/chart2/qa/extras/data/xlsx/markerColor.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/minorTickMark.xlsx b/chart2/qa/extras/data/xlsx/minorTickMark.xlsx new file mode 100644 index 0000000000..2d68792474 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/minorTickMark.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/no_marker.xlsx b/chart2/qa/extras/data/xlsx/no_marker.xlsx new file mode 100644 index 0000000000..228c4590fa Binary files /dev/null and b/chart2/qa/extras/data/xlsx/no_marker.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/number-formats.xlsx b/chart2/qa/extras/data/xlsx/number-formats.xlsx new file mode 100644 index 0000000000..f5250c52ec Binary files /dev/null and b/chart2/qa/extras/data/xlsx/number-formats.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/pie_chart_datapoint_explosion.xlsx b/chart2/qa/extras/data/xlsx/pie_chart_datapoint_explosion.xlsx new file mode 100644 index 0000000000..273ebeb82e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/pie_chart_datapoint_explosion.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/piechart_deleted_legendentry.xlsx b/chart2/qa/extras/data/xlsx/piechart_deleted_legendentry.xlsx new file mode 100644 index 0000000000..8428686ff6 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/piechart_deleted_legendentry.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/piechart_legend.xlsx b/chart2/qa/extras/data/xlsx/piechart_legend.xlsx new file mode 100644 index 0000000000..baea1de9b0 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/piechart_legend.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/piechart_outside.xlsx b/chart2/qa/extras/data/xlsx/piechart_outside.xlsx new file mode 100644 index 0000000000..e90eab1e90 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/piechart_outside.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/plotVisOnly.xlsx b/chart2/qa/extras/data/xlsx/plotVisOnly.xlsx new file mode 100644 index 0000000000..8e4fcbd5ea Binary files /dev/null and b/chart2/qa/extras/data/xlsx/plotVisOnly.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/plot_area_manual_layout.xlsx b/chart2/qa/extras/data/xlsx/plot_area_manual_layout.xlsx new file mode 100644 index 0000000000..f0bc588134 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/plot_area_manual_layout.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/rAngAx.xlsx b/chart2/qa/extras/data/xlsx/rAngAx.xlsx new file mode 100644 index 0000000000..f6d521a3ed Binary files /dev/null and b/chart2/qa/extras/data/xlsx/rAngAx.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/secondary_axis_title_default_rotation.xlsx b/chart2/qa/extras/data/xlsx/secondary_axis_title_default_rotation.xlsx new file mode 100644 index 0000000000..de5d0391d2 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/secondary_axis_title_default_rotation.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/ser_labels.xlsx b/chart2/qa/extras/data/xlsx/ser_labels.xlsx new file mode 100644 index 0000000000..ba2315666e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/ser_labels.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/smoothed_series.xlsx b/chart2/qa/extras/data/xlsx/smoothed_series.xlsx new file mode 100644 index 0000000000..bab00ce139 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/smoothed_series.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/smoothed_series2007.xlsx b/chart2/qa/extras/data/xlsx/smoothed_series2007.xlsx new file mode 100644 index 0000000000..3c8f0cc460 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/smoothed_series2007.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/strict_chart.xlsx b/chart2/qa/extras/data/xlsx/strict_chart.xlsx new file mode 100644 index 0000000000..43789331a5 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/strict_chart.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf100084.xlsx b/chart2/qa/extras/data/xlsx/tdf100084.xlsx new file mode 100644 index 0000000000..5f03f39244 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf100084.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf108107.xlsx b/chart2/qa/extras/data/xlsx/tdf108107.xlsx new file mode 100644 index 0000000000..3f86326fa2 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf108107.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf111173.xlsx b/chart2/qa/extras/data/xlsx/tdf111173.xlsx new file mode 100644 index 0000000000..e62c6747b5 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf111173.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf111824.xlsx b/chart2/qa/extras/data/xlsx/tdf111824.xlsx new file mode 100644 index 0000000000..ae86756c47 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf111824.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf114139.xlsx b/chart2/qa/extras/data/xlsx/tdf114139.xlsx new file mode 100644 index 0000000000..ef09575c1f Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf114139.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf115012.xlsx b/chart2/qa/extras/data/xlsx/tdf115012.xlsx new file mode 100644 index 0000000000..cf8ac7d81e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf115012.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx b/chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx new file mode 100644 index 0000000000..a20aa0bb1b Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf122031.xlsx b/chart2/qa/extras/data/xlsx/tdf122031.xlsx new file mode 100644 index 0000000000..ac937a8c7a Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf122031.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf122915.xlsx b/chart2/qa/extras/data/xlsx/tdf122915.xlsx new file mode 100644 index 0000000000..ff20e04baf Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf122915.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf124817.xlsx b/chart2/qa/extras/data/xlsx/tdf124817.xlsx new file mode 100644 index 0000000000..d9b09644e4 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf124817.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf126033.xlsx b/chart2/qa/extras/data/xlsx/tdf126033.xlsx new file mode 100644 index 0000000000..ee60103c98 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf126033.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf126115.xlsx b/chart2/qa/extras/data/xlsx/tdf126115.xlsx new file mode 100644 index 0000000000..f845c06e31 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf126115.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf127777.xlsx b/chart2/qa/extras/data/xlsx/tdf127777.xlsx new file mode 100644 index 0000000000..c04de30fc8 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf127777.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf128619.xlsx b/chart2/qa/extras/data/xlsx/tdf128619.xlsx new file mode 100644 index 0000000000..e6eb142593 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf128619.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf128621.xlsx b/chart2/qa/extras/data/xlsx/tdf128621.xlsx new file mode 100644 index 0000000000..93a6822da9 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf128621.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf128627.xlsx b/chart2/qa/extras/data/xlsx/tdf128627.xlsx new file mode 100644 index 0000000000..419c1ad2f9 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf128627.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf128633.xlsx b/chart2/qa/extras/data/xlsx/tdf128633.xlsx new file mode 100644 index 0000000000..fa186895d6 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf128633.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf128634.xlsx b/chart2/qa/extras/data/xlsx/tdf128634.xlsx new file mode 100644 index 0000000000..91baa780ce Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf128634.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf128732.xlsx b/chart2/qa/extras/data/xlsx/tdf128732.xlsx new file mode 100644 index 0000000000..b92afb1ed6 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf128732.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf130657.xlsx b/chart2/qa/extras/data/xlsx/tdf130657.xlsx new file mode 100644 index 0000000000..036da200ab Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf130657.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf130986.xlsx b/chart2/qa/extras/data/xlsx/tdf130986.xlsx new file mode 100644 index 0000000000..9674fd1ab1 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf130986.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf132076.xlsx b/chart2/qa/extras/data/xlsx/tdf132076.xlsx new file mode 100644 index 0000000000..799ef9c855 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf132076.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf133190_tdf133191.xlsx b/chart2/qa/extras/data/xlsx/tdf133190_tdf133191.xlsx new file mode 100644 index 0000000000..f8cad0e8cf Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf133190_tdf133191.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf133376.xlsx b/chart2/qa/extras/data/xlsx/tdf133376.xlsx new file mode 100644 index 0000000000..2000733ec8 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf133376.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf134118.xlsx b/chart2/qa/extras/data/xlsx/tdf134118.xlsx new file mode 100644 index 0000000000..ca86fb8cf1 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf134118.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf134225.xlsx b/chart2/qa/extras/data/xlsx/tdf134225.xlsx new file mode 100644 index 0000000000..ae7bdc66e3 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf134225.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf134978.xlsx b/chart2/qa/extras/data/xlsx/tdf134978.xlsx new file mode 100644 index 0000000000..ad5522a914 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf134978.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf135184RoundLineCap.xlsx b/chart2/qa/extras/data/xlsx/tdf135184RoundLineCap.xlsx new file mode 100644 index 0000000000..69cad0d671 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf135184RoundLineCap.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf135184RoundLineCap2.xlsx b/chart2/qa/extras/data/xlsx/tdf135184RoundLineCap2.xlsx new file mode 100644 index 0000000000..ced797258a Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf135184RoundLineCap2.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf136105.xlsx b/chart2/qa/extras/data/xlsx/tdf136105.xlsx new file mode 100644 index 0000000000..bc3a909224 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf136105.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf136267.xlsx b/chart2/qa/extras/data/xlsx/tdf136267.xlsx new file mode 100644 index 0000000000..741a33c429 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf136267.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf136752.xlsx b/chart2/qa/extras/data/xlsx/tdf136752.xlsx new file mode 100644 index 0000000000..05fad58cff Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf136752.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf137505.xlsx b/chart2/qa/extras/data/xlsx/tdf137505.xlsx new file mode 100644 index 0000000000..08fa6778bb Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf137505.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf137734.xlsx b/chart2/qa/extras/data/xlsx/tdf137734.xlsx new file mode 100644 index 0000000000..8c177becc3 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf137734.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf137917.xlsx b/chart2/qa/extras/data/xlsx/tdf137917.xlsx new file mode 100644 index 0000000000..4d08a23acd Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf137917.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf138204.xlsx b/chart2/qa/extras/data/xlsx/tdf138204.xlsx new file mode 100644 index 0000000000..04c2e50d79 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf138204.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf140489.xlsx b/chart2/qa/extras/data/xlsx/tdf140489.xlsx new file mode 100644 index 0000000000..bd24f40be7 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf140489.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf142351.xlsx b/chart2/qa/extras/data/xlsx/tdf142351.xlsx new file mode 100644 index 0000000000..0414bb3f16 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf142351.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf143127.xlsx b/chart2/qa/extras/data/xlsx/tdf143127.xlsx new file mode 100644 index 0000000000..116a00b60c Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf143127.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf143942.xlsx b/chart2/qa/extras/data/xlsx/tdf143942.xlsx new file mode 100644 index 0000000000..33ff6696b7 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf143942.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf150434.xlsx b/chart2/qa/extras/data/xlsx/tdf150434.xlsx new file mode 100644 index 0000000000..309a0c4c25 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf150434.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf81396.xlsx b/chart2/qa/extras/data/xlsx/tdf81396.xlsx new file mode 100644 index 0000000000..2a557262a2 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf81396.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf90876.xlsx b/chart2/qa/extras/data/xlsx/tdf90876.xlsx new file mode 100644 index 0000000000..3cf60e8168 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf90876.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdf98690.xlsx b/chart2/qa/extras/data/xlsx/tdf98690.xlsx new file mode 100644 index 0000000000..4269afa9ea Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf98690.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx b/chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx new file mode 100644 index 0000000000..0835cb3332 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx b/chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx new file mode 100644 index 0000000000..01c6fe56f1 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx b/chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx new file mode 100644 index 0000000000..409389e23b Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testBarChartDataPointPropXLSX.xlsx b/chart2/qa/extras/data/xlsx/testBarChartDataPointPropXLSX.xlsx new file mode 100644 index 0000000000..e73d16bd2d Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testBarChartDataPointPropXLSX.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testChartTitlePropertiesBitmapFill.xlsx b/chart2/qa/extras/data/xlsx/testChartTitlePropertiesBitmapFill.xlsx new file mode 100644 index 0000000000..9d2dff9b3e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testChartTitlePropertiesBitmapFill.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testChartTitlePropertiesColorFill.xlsx b/chart2/qa/extras/data/xlsx/testChartTitlePropertiesColorFill.xlsx new file mode 100644 index 0000000000..9e9aa0beaf Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testChartTitlePropertiesColorFill.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testChartTitlePropertiesGradientFill.xlsx b/chart2/qa/extras/data/xlsx/testChartTitlePropertiesGradientFill.xlsx new file mode 100644 index 0000000000..b5b6177543 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testChartTitlePropertiesGradientFill.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testCombinedChartAxis.xlsx b/chart2/qa/extras/data/xlsx/testCombinedChartAxis.xlsx new file mode 100644 index 0000000000..47f8246e23 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testCombinedChartAxis.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testCustomPosDataLabels.xlsx b/chart2/qa/extras/data/xlsx/testCustomPosDataLabels.xlsx new file mode 100644 index 0000000000..caa08956cd Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testCustomPosDataLabels.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testDataPointLabelCustomPos.xlsx b/chart2/qa/extras/data/xlsx/testDataPointLabelCustomPos.xlsx new file mode 100644 index 0000000000..69f89ec0e4 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testDataPointLabelCustomPos.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testDataseriesOverlapStackedChart.xlsx b/chart2/qa/extras/data/xlsx/testDataseriesOverlapStackedChart.xlsx new file mode 100644 index 0000000000..ba1c526b41 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testDataseriesOverlapStackedChart.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx b/chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx new file mode 100644 index 0000000000..ac9dde9b79 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testSecondaryAxis.xlsx b/chart2/qa/extras/data/xlsx/testSecondaryAxis.xlsx new file mode 100644 index 0000000000..6faa39b294 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testSecondaryAxis.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testTdf130032.xlsx b/chart2/qa/extras/data/xlsx/testTdf130032.xlsx new file mode 100644 index 0000000000..03a3dbf403 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testTdf130032.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/testTdf90749.xlsx b/chart2/qa/extras/data/xlsx/testTdf90749.xlsx new file mode 100644 index 0000000000..ca3bc806c0 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testTdf90749.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/title_character_properties.xlsx b/chart2/qa/extras/data/xlsx/title_character_properties.xlsx new file mode 100644 index 0000000000..2a239936ca Binary files /dev/null and b/chart2/qa/extras/data/xlsx/title_character_properties.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/title_manual_layout.xlsx b/chart2/qa/extras/data/xlsx/title_manual_layout.xlsx new file mode 100644 index 0000000000..c89b2af4dc Binary files /dev/null and b/chart2/qa/extras/data/xlsx/title_manual_layout.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/trendline.xlsx b/chart2/qa/extras/data/xlsx/trendline.xlsx new file mode 100644 index 0000000000..701fcfd012 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/trendline.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/trendline2007.xlsx b/chart2/qa/extras/data/xlsx/trendline2007.xlsx new file mode 100644 index 0000000000..87d4d5a9cf Binary files /dev/null and b/chart2/qa/extras/data/xlsx/trendline2007.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/vary_color.xlsx b/chart2/qa/extras/data/xlsx/vary_color.xlsx new file mode 100644 index 0000000000..980cdda341 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/vary_color.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/vary_color2007.xlsx b/chart2/qa/extras/data/xlsx/vary_color2007.xlsx new file mode 100644 index 0000000000..657c2176d6 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/vary_color2007.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/xAxisLabelsRotation.xlsx b/chart2/qa/extras/data/xlsx/xAxisLabelsRotation.xlsx new file mode 100644 index 0000000000..cf511dfaf2 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/xAxisLabelsRotation.xlsx differ diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx new file mode 100644 index 0000000000..84b8658d29 --- /dev/null +++ b/chart2/qa/extras/uichart.cxx @@ -0,0 +1,441 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "charttest.hxx" + +#include +#include + +using namespace ::com::sun::star; + +class Chart2UiChartTest : public ChartTest +{ +public: + Chart2UiChartTest() + : ChartTest("/chart2/qa/extras/data/") + { + } + + void testCopyPasteToNewSheet(uno::Reference xChartDoc, + OUString aObjectName, sal_Int32 nColumns, sal_Int32 nRows); +}; + +void Chart2UiChartTest::testCopyPasteToNewSheet(uno::Reference xChartDoc, + OUString aObjectName, sal_Int32 nColumns, + sal_Int32 nRows) +{ + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW); + + uno::Sequence aExpectedColumnDescriptions = xChartData->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file", nColumns, + aExpectedColumnDescriptions.getLength()); + + uno::Sequence aExpectedRowDescriptions = xChartData->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file", nRows, + aExpectedRowDescriptions.getLength()); + + Sequence> aExpectedData = xChartData->getData(); + + uno::Sequence aPropertyValues = { + comphelper::makePropertyValue("ToObject", aObjectName), + }; + dispatchCommand(mxComponent, ".uno:GoToObject", aPropertyValues); + + dispatchCommand(mxComponent, ".uno:Copy", {}); + + // create a new document + load("private:factory/scalc"); + + dispatchCommand(mxComponent, ".uno:Paste", {}); + + uno::Reference xChartDoc2 = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc2.is()); + + uno::Reference xDataArray(xChartDoc2->getDataProvider(), + UNO_QUERY_THROW); + + Sequence aColumnDesc = xDataArray->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in destination file", nColumns, + aColumnDesc.getLength()); + for (sal_Int32 i = 0; i < nColumns; ++i) + { + OString sMessage("Incorrect description in column: " + OString::number(i)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedColumnDescriptions[i], + aColumnDesc[i]); + } + + Sequence aRowDesc = xDataArray->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in destination file", nRows, + aRowDesc.getLength()); + for (sal_Int32 i = 0; i < nRows; ++i) + { + OString sMessage("Incorrect description in row: " + OString::number(i)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedRowDescriptions[i], aRowDesc[i]); + } + + Sequence> aData = xDataArray->getData(); + + for (sal_Int32 nRowIdx = 0; nRowIdx < nRows; ++nRowIdx) + { + for (sal_Int32 nColIdx = 0; nColIdx < nColumns; ++nColIdx) + { + double nValue = aData[nRowIdx][nColIdx]; + double nExpected = aExpectedData[nRowIdx][nColIdx]; + OString sMessage("Incorrect value in Col: " + OString::number(nColIdx) + + " Row: " + OString::number(nRowIdx)); + + if (std::isnan(nValue)) + { + // On paste, 0 becomes NaN, check whether it's expected + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sMessage.getStr(), 0.0, nExpected, 1e-1); + } + else + { + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sMessage.getStr(), nExpected, nValue, 1e-1); + } + } + } +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf120348) +{ + loadFromFile(u"ods/tdf120348.ods"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + + // Without the fix in place, this test would have failed with + // - Expected: 0 + // - Actual : 3.33625955201419 + // - Incorrect value in Col: 2 Row: 51 + testCopyPasteToNewSheet(xChartDoc, "Object 2", 4, 158); +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf151091) +{ + std::vector aExpected + = { u"Ωφέλιμο"_ustr, u"Επικίνδυνο"_ustr, u"Απόσταση"_ustr, u"Μάσκα"_ustr, u"Εμβόλιο"_ustr }; + + loadFromFile(u"ods/tdf151091.ods"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW); + uno::Sequence aSeriesList = xChartData->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL(static_cast(5), aSeriesList.getLength()); + + for (size_t i = 0; i < 5; ++i) + CPPUNIT_ASSERT_EQUAL(aExpected[i], aSeriesList[i]); + + uno::Sequence aPropertyValues = { + comphelper::makePropertyValue("ToObject", OUString("Object 1")), + }; + dispatchCommand(mxComponent, ".uno:GoToObject", aPropertyValues); + + dispatchCommand(mxComponent, ".uno:Copy", {}); + + // create a new writer document + load("private:factory/swriter"); + + dispatchCommand(mxComponent, ".uno:Paste", {}); + + aSeriesList = getWriterChartColumnDescriptions(mxComponent); + + // Without the fix in place, this test would have failed with + // - Expected: 5 + // - Actual : 1 + CPPUNIT_ASSERT_EQUAL(static_cast(5), aSeriesList.getLength()); + + for (size_t i = 0; i < 5; ++i) + CPPUNIT_ASSERT_EQUAL(aExpected[i], aSeriesList[i]); +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf107097) +{ + loadFromFile(u"ods/tdf107097.ods"); + uno::Reference xChartDoc(getPivotChartDocFromSheet(1, mxComponent), + uno::UNO_QUERY_THROW); + testCopyPasteToNewSheet(xChartDoc, "Object 1", 4, 12); +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf136011) +{ + loadFromFile(u"ods/tdf136011.ods"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + testCopyPasteToNewSheet(xChartDoc, "Object 1", 3, 9); + + loadFromFile(u"ods/tdf136011.ods"); + uno::Reference xChartDoc2(getChartCompFromSheet(0, 1, mxComponent), + uno::UNO_QUERY_THROW); + + // Without the fix in place, this test would have failed with + // - Expected: Test 1 1 + // - Actual : Test 1 + // - Incorrect description in row: 0 + testCopyPasteToNewSheet(xChartDoc2, "Object 2", 3, 9); +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf62057) +{ + loadFromFile(u"ods/tdf62057.ods"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + + // Without the fix in place, this test would have failed with + // - Expected: 2 + // - Actual : 7 + // - Incorrect number of columns in destination file + testCopyPasteToNewSheet(xChartDoc, "Object 1", 2, 6); +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf98690) +{ + loadFromFile(u"xlsx/tdf98690.xlsx"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW); + uno::Sequence aSeriesList = xChartData->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL(static_cast(6), aSeriesList.getLength()); + + uno::Sequence aPropertyValues = { + comphelper::makePropertyValue("ToObject", OUString("Chart 2")), + }; + dispatchCommand(mxComponent, ".uno:GoToObject", aPropertyValues); + + dispatchCommand(mxComponent, ".uno:Copy", {}); + + // create a new document + load("private:factory/scalc"); + + dispatchCommand(mxComponent, ".uno:Paste", {}); + + uno::Reference xChartDoc2(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc2.is()); + uno::Reference xChartData2(xChartDoc2->getData(), uno::UNO_QUERY_THROW); + uno::Sequence aSeriesList2 = xChartData2->getColumnDescriptions(); + + // Without the fix in place, this test would have failed with + // - Expected: 12 + // - Actual : 0 + CPPUNIT_ASSERT_EQUAL(static_cast(12), aSeriesList2.getLength()); +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf101894) +{ + loadFromFile(u"ods/tdf101894.ods"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW); + + uno::Sequence aExpectedColumnDescriptions = xChartData->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file", + static_cast(12), + aExpectedColumnDescriptions.getLength()); + + uno::Sequence aExpectedRowDescriptions = xChartData->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file", + static_cast(8), aExpectedRowDescriptions.getLength()); + + Sequence> aExpectedData = xChartData->getData(); + + // Create a copy of the sheet and move to the end + uno::Sequence aArgs( + comphelper::InitPropertySequence({ { "DocName", uno::Any(OUString("tdf101894")) }, + { "Index", uno::Any(sal_uInt16(32767)) }, + { "Copy", uno::Any(true) } })); + dispatchCommand(mxComponent, ".uno:Move", aArgs); + + uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); + uno::Reference xIA(xDoc->getSheets(), UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(static_cast(2), xIA->getCount()); + + for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex) + { + uno::Reference xChartDoc2( + getChartCompFromSheet(sheetIndex, 0, mxComponent), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc2.is()); + uno::Reference xChartData2(xChartDoc2->getData(), + uno::UNO_QUERY_THROW); + + uno::Sequence aColumnDescriptions = xChartData2->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file", + static_cast(12), aColumnDescriptions.getLength()); + for (sal_Int32 i = 0; i < 12; ++i) + { + OString sMessage("Incorrect description in column: " + OString::number(i)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedColumnDescriptions[i], + aColumnDescriptions[i]); + } + + uno::Sequence aRowDescriptions = xChartData2->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file", + static_cast(8), aRowDescriptions.getLength()); + for (sal_Int32 i = 0; i < 8; ++i) + { + OString sMessage("Incorrect description in row: " + OString::number(i)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedRowDescriptions[i], + aRowDescriptions[i]); + } + + Sequence> aData = xChartData2->getData(); + + for (sal_Int32 nRowIdx = 0; nRowIdx < 8; ++nRowIdx) + { + for (sal_Int32 nColIdx = 0; nColIdx < 12; ++nColIdx) + { + double nValue = aData[nRowIdx][nColIdx]; + double nExpected = aExpectedData[nRowIdx][nColIdx]; + OString sMessage("Incorrect value in Col: " + OString::number(nColIdx) + + " Row: " + OString::number(nRowIdx)); + + // Without the fix in place, this test would have failed with + // - Expected: 1 + // - Actual : 2.2250738585072e-308 + // - Incorrect value in Col: 0 Row: 0 + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sMessage.getStr(), nExpected, nValue, 1e-1); + } + } + } +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testCopyPasteChartWithDotInSheetName) +{ + loadFromFile(u"ods/chartWithDotInSheetName.ods"); + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW); + + uno::Sequence aExpectedColumnDescriptions = xChartData->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file", + static_cast(4), + aExpectedColumnDescriptions.getLength()); + + uno::Sequence aExpectedRowDescriptions = xChartData->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file", + static_cast(7), aExpectedRowDescriptions.getLength()); + + Sequence> aExpectedData = xChartData->getData(); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + dispatchCommand(mxComponent, ".uno:Copy", {}); + + uno::Sequence aArgs(comphelper::InitPropertySequence( + { { "Name", uno::Any(OUString("NewTab")) }, { "Index", uno::Any(sal_uInt16(2)) } })); + dispatchCommand(mxComponent, ".uno:Insert", aArgs); + + uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); + uno::Reference xIA(xDoc->getSheets(), UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(static_cast(2), xIA->getCount()); + + dispatchCommand(mxComponent, ".uno:Paste", {}); + + for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex) + { + uno::Reference xChartDoc2( + getChartCompFromSheet(sheetIndex, 0, mxComponent), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc2.is()); + uno::Reference xChartData2(xChartDoc2->getData(), + uno::UNO_QUERY_THROW); + + uno::Sequence aColumnDescriptions = xChartData2->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file", + static_cast(4), aColumnDescriptions.getLength()); + for (sal_Int32 i = 0; i < 4; ++i) + { + OString sMessage("Incorrect description in column: " + OString::number(i)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedColumnDescriptions[i], + aColumnDescriptions[i]); + } + + uno::Sequence aRowDescriptions = xChartData2->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file", + static_cast(7), aRowDescriptions.getLength()); + for (sal_Int32 i = 0; i < 7; ++i) + { + OString sMessage("Incorrect description in row: " + OString::number(i)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedRowDescriptions[i], + aRowDescriptions[i]); + } + + Sequence> aData = xChartData2->getData(); + + for (sal_Int32 nRowIdx = 0; nRowIdx < 7; ++nRowIdx) + { + for (sal_Int32 nColIdx = 0; nColIdx < 4; ++nColIdx) + { + double nValue = aData[nRowIdx][nColIdx]; + double nExpected = aExpectedData[nRowIdx][nColIdx]; + OString sMessage("Incorrect value in Col: " + OString::number(nColIdx) + + " Row: " + OString::number(nRowIdx)); + + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sMessage.getStr(), nExpected, nValue, 1e-1); + } + } + } +} + +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf158223) +{ + loadFromFile(u"ods/tdf158223.ods"); + + uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); + uno::Reference xIA(xDoc->getSheets(), UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(static_cast(3), xIA->getCount()); + + for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex) + { + OUString sExpectedValuesX("$Tabelle" + OUString::number(sheetIndex + 1) + ".$A$2:$A$11"); + OUString sExpectedValuesY("$Tabelle" + OUString::number(sheetIndex + 1) + ".$B$2:$B$11"); + uno::Reference xChartDoc + = getChartDocFromSheet(sheetIndex, mxComponent); + Reference xValuesX + = getDataSequenceFromDocByRole(xChartDoc, u"values-x"); + CPPUNIT_ASSERT_EQUAL(sExpectedValuesX, xValuesX->getSourceRangeRepresentation()); + Reference xValuesY + = getDataSequenceFromDocByRole(xChartDoc, u"values-y"); + CPPUNIT_ASSERT_EQUAL(sExpectedValuesY, xValuesY->getSourceRangeRepresentation()); + } + + // Remove last sheet + uno::Sequence aArgs( + comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(3)) } })); + dispatchCommand(mxComponent, ".uno:Remove", aArgs); + + CPPUNIT_ASSERT_EQUAL(static_cast(2), xIA->getCount()); + + for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex) + { + OUString sExpectedValuesX("$Tabelle" + OUString::number(sheetIndex + 1) + ".$A$2:$A$11"); + OUString sExpectedValuesY("$Tabelle" + OUString::number(sheetIndex + 1) + ".$B$2:$B$11"); + uno::Reference xChartDoc + = getChartDocFromSheet(sheetIndex, mxComponent); + Reference xValuesX + = getDataSequenceFromDocByRole(xChartDoc, u"values-x"); + + // Without the fix in place, this test would have failed with + // - Expected: $Tabelle2.$A$2:$A$11 + // - Actual : $Tabelle2.$A$2:$Tabelle1.$A$11 + CPPUNIT_ASSERT_EQUAL(sExpectedValuesX, xValuesX->getSourceRangeRepresentation()); + Reference xValuesY + = getDataSequenceFromDocByRole(xChartDoc, u"values-y"); + CPPUNIT_ASSERT_EQUAL(sExpectedValuesY, xValuesY->getSourceRangeRepresentation()); + } +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx new file mode 100644 index 0000000000..f247b7507a --- /dev/null +++ b/chart2/qa/extras/xshape/chart2xshape.cxx @@ -0,0 +1,322 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include + +#include + +#include +#include + +#include +#include + +class Chart2XShapeTest : public ChartTest +{ +public: + Chart2XShapeTest() + : ChartTest("/chart2/qa/extras/xshape/data/") + { + } + + void testTdf150832(); + void testTdf149204(); + void testTdf151424(); + void testFdo75075(); + void testPropertyMappingBarChart(); + void testPieChartLabels1(); + void testPieChartLabels2(); + void testPieChartLabels3(); + void testPieChartLabels4(); + void testChart(); + void testTdf76649TrendLineBug(); + void testTdf88154LabelRotatedLayout(); + + CPPUNIT_TEST_SUITE(Chart2XShapeTest); + CPPUNIT_TEST(testTdf150832); + CPPUNIT_TEST(testTdf149204); + CPPUNIT_TEST(testTdf151424); + CPPUNIT_TEST(testFdo75075); + CPPUNIT_TEST(testPropertyMappingBarChart); + CPPUNIT_TEST(testPieChartLabels1); + CPPUNIT_TEST(testPieChartLabels2); + CPPUNIT_TEST(testPieChartLabels3); + CPPUNIT_TEST(testPieChartLabels4); + CPPUNIT_TEST(testChart); + CPPUNIT_TEST(testTdf76649TrendLineBug); + CPPUNIT_TEST(testTdf88154LabelRotatedLayout); + + CPPUNIT_TEST_SUITE_END(); + +private: + void compareAgainstReference(std::u16string_view rDump, std::u16string_view rReferenceFile); + OUString getXShapeDumpString(); + xmlDocUniquePtr getXShapeDumpXmlDoc(); +}; + +namespace +{ +OUString getShapeDump(css::uno::Reference const& doc) +{ + return css::uno::Reference(doc, css::uno::UNO_QUERY_THROW)->dump("shapes"); +} + +bool checkDumpAgainstFile(std::u16string_view rDump, std::u16string_view aFilePath, + char const* toleranceFile) +{ + OString aOFile = OUStringToOString(aFilePath, RTL_TEXTENCODING_UTF8); + + CPPUNIT_ASSERT_MESSAGE("dump is empty", !rDump.empty()); + + OString aDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8); + return doXMLDiff(aOFile.getStr(), aDump.getStr(), static_cast(rDump.size()), + toleranceFile); +} +} + +OUString Chart2XShapeTest::getXShapeDumpString() +{ + uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + UNO_QUERY_THROW); + return getShapeDump(xChartDoc); +} + +xmlDocUniquePtr Chart2XShapeTest::getXShapeDumpXmlDoc() +{ + OUString rDump = getXShapeDumpString(); + OString aXmlDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8); + return xmlDocUniquePtr(xmlParseDoc(reinterpret_cast(aXmlDump.getStr()))); +} + +void Chart2XShapeTest::compareAgainstReference(std::u16string_view rDump, + std::u16string_view rReferenceFile) +{ + checkDumpAgainstFile( + rDump, + Concat2View(m_directories.getPathFromSrc(u"/chart2/qa/extras/xshape/data/reference/") + + rReferenceFile), + OUStringToOString( + m_directories.getPathFromSrc(u"/chart2/qa/extras/xshape/data/reference/tolerance.xml"), + RTL_TEXTENCODING_UTF8) + .getStr()); +} + +void Chart2XShapeTest::testTdf150832() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + // Without the fix in place, this test would have failed with + // - Expected: 319 + // - Actual : 0 + loadFromFile(u"xls/tdf150832.xls"); + compareAgainstReference(getXShapeDumpString(), u"tdf150832.xml"); +} + +void Chart2XShapeTest::testTdf149204() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + // Without the fix in place, this test would have failed with + // - Expected: 12230 + // - Actual : 12940 + // - Node: /XShapes/XShape[2] + // - Attr: sizeX + loadFromFile(u"pptx/tdf149204.pptx"); + uno::Reference xChartDoc = getChartDocFromDrawImpress(0, 0); + compareAgainstReference(getShapeDump(xChartDoc), u"tdf149204.xml"); +} + +void Chart2XShapeTest::testTdf151424() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + // Without the fix in place, this test would have failed with + // - Expected: 3717 + // - Actual : 3530 + // - Node: /XShapes/XShape[2]/XShapes/XShape[1] + // - Attr: positionX + loadFromFile(u"ods/tdf151424.ods"); + compareAgainstReference(getXShapeDumpString(), u"tdf151424.xml"); +} + +void Chart2XShapeTest::testFdo75075() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + loadFromFile(u"ods/fdo75075.ods"); + compareAgainstReference(getXShapeDumpString(), u"fdo75075.xml"); +} + +void Chart2XShapeTest::testPropertyMappingBarChart() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + loadFromFile(u"ods/property-mapping-bar.ods"); + compareAgainstReference(getXShapeDumpString(), u"property-mapping-bar.xml"); +} + +void Chart2XShapeTest::testPieChartLabels1() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + // inside placement for the best fit case + loadFromFile(u"xlsx/tdf90839-1.xlsx"); + compareAgainstReference(getXShapeDumpString(), u"tdf90839-1.xml"); +} + +void Chart2XShapeTest::testPieChartLabels2() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + // text wrap: wrap all text labels except one + loadFromFile(u"xlsx/tdf90839-2.xlsx"); + compareAgainstReference(getXShapeDumpString(), u"tdf90839-2.xml"); +} + +void Chart2XShapeTest::testPieChartLabels3() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + // text wrap: wrap no text label except one + loadFromFile(u"xlsx/tdf90839-3.xlsx"); + compareAgainstReference(getXShapeDumpString(), u"tdf90839-3.xml"); +} + +void Chart2XShapeTest::testPieChartLabels4() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + // data value and percent value are centered horizontally + loadFromFile(u"ods/tdf90839-4.ods"); + compareAgainstReference(getXShapeDumpString(), u"tdf90839-4.xml"); +} + +void Chart2XShapeTest::testChart() +{ + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + + loadFromFile(u"ods/testChart.ods"); + compareAgainstReference(getXShapeDumpString(), u"testChart.xml"); +} + +void Chart2XShapeTest::testTdf76649TrendLineBug() +{ + // This bug prevents that the trendline (regression curve) is drawn + // if the first cell is empty. See tdf#76649 for details. + + loadFromFile(u"ods/tdf76649_TrendLineBug.ods"); + + xmlDocUniquePtr pXmlDoc = getXShapeDumpXmlDoc(); + + // Check if the regression curve exists (which means a XShape with a certain + // name should exist in the dump) + assertXPath(pXmlDoc, "//XShape[@name='CID/D=0:CS=0:CT=0:Series=0:Curve=0']"_ostr, 1); +} + +void Chart2XShapeTest::testTdf88154LabelRotatedLayout() +{ + loadFromFile(u"pptx/tdf88154_LabelRotatedLayout.pptx"); + uno::Reference xChartDoc = getChartDocFromDrawImpress(0, 5); + OUString rDump = getShapeDump(xChartDoc); + OString aXmlDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8); + xmlDocUniquePtr pXmlDoc(xmlParseDoc(reinterpret_cast(aXmlDump.getStr()))); + + { + OString aPath("//XShape[@text='Oct-12']/Transformation"_ostr); + assertXPath(pXmlDoc, aPath, 1); + double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1"_ostr).toDouble(); + double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2"_ostr).toDouble(); + double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1"_ostr).toDouble(); + double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2"_ostr).toDouble(); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8); + } + { + OString aPath("//XShape[@text='Nov-12']/Transformation"_ostr); + assertXPath(pXmlDoc, aPath, 1); + double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1"_ostr).toDouble(); + double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2"_ostr).toDouble(); + double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1"_ostr).toDouble(); + double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2"_ostr).toDouble(); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8); + } + { + OString aPath("//XShape[@text='Dec-12']/Transformation"_ostr); + assertXPath(pXmlDoc, aPath, 1); + double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1"_ostr).toDouble(); + double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2"_ostr).toDouble(); + double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1"_ostr).toDouble(); + double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2"_ostr).toDouble(); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8); + } + { + OString aPath("//XShape[@text='May-13']/Transformation"_ostr); + assertXPath(pXmlDoc, aPath, 1); + double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1"_ostr).toDouble(); + double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2"_ostr).toDouble(); + double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1"_ostr).toDouble(); + double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2"_ostr).toDouble(); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8); + } + { + OString aPath("//XShape[@text='Jan-14']/Transformation"_ostr); + assertXPath(pXmlDoc, aPath, 1); + double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1"_ostr).toDouble(); + double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2"_ostr).toDouble(); + double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1"_ostr).toDouble(); + double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2"_ostr).toDouble(); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8); + } +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Chart2XShapeTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/xshape/data/ods/fdo75075.ods b/chart2/qa/extras/xshape/data/ods/fdo75075.ods new file mode 100644 index 0000000000..d2a1be49bf Binary files /dev/null and b/chart2/qa/extras/xshape/data/ods/fdo75075.ods differ diff --git a/chart2/qa/extras/xshape/data/ods/property-mapping-bar.ods b/chart2/qa/extras/xshape/data/ods/property-mapping-bar.ods new file mode 100644 index 0000000000..1a4e826dfb Binary files /dev/null and b/chart2/qa/extras/xshape/data/ods/property-mapping-bar.ods differ diff --git a/chart2/qa/extras/xshape/data/ods/tdf151424.ods b/chart2/qa/extras/xshape/data/ods/tdf151424.ods new file mode 100644 index 0000000000..d1f6adcc24 Binary files /dev/null and b/chart2/qa/extras/xshape/data/ods/tdf151424.ods differ diff --git a/chart2/qa/extras/xshape/data/ods/tdf76649_TrendLineBug.ods b/chart2/qa/extras/xshape/data/ods/tdf76649_TrendLineBug.ods new file mode 100644 index 0000000000..1032e960b9 Binary files /dev/null and b/chart2/qa/extras/xshape/data/ods/tdf76649_TrendLineBug.ods differ diff --git a/chart2/qa/extras/xshape/data/ods/tdf90839-4.ods b/chart2/qa/extras/xshape/data/ods/tdf90839-4.ods new file mode 100644 index 0000000000..3126ac1759 Binary files /dev/null and b/chart2/qa/extras/xshape/data/ods/tdf90839-4.ods differ diff --git a/chart2/qa/extras/xshape/data/ods/testChart.ods b/chart2/qa/extras/xshape/data/ods/testChart.ods new file mode 100644 index 0000000000..956f57d525 Binary files /dev/null and b/chart2/qa/extras/xshape/data/ods/testChart.ods differ diff --git a/chart2/qa/extras/xshape/data/pptx/tdf149204.pptx b/chart2/qa/extras/xshape/data/pptx/tdf149204.pptx new file mode 100644 index 0000000000..60d006547a Binary files /dev/null and b/chart2/qa/extras/xshape/data/pptx/tdf149204.pptx differ diff --git a/chart2/qa/extras/xshape/data/pptx/tdf88154_LabelRotatedLayout.pptx b/chart2/qa/extras/xshape/data/pptx/tdf88154_LabelRotatedLayout.pptx new file mode 100644 index 0000000000..f3af677656 Binary files /dev/null and b/chart2/qa/extras/xshape/data/pptx/tdf88154_LabelRotatedLayout.pptx differ diff --git a/chart2/qa/extras/xshape/data/reference/fdo75075.xml b/chart2/qa/extras/xshape/data/reference/fdo75075.xml new file mode 100644 index 0000000000..fe8cb00cf1 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/fdo75075.xml @@ -0,0 +1,1692 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml b/chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml new file mode 100644 index 0000000000..6e28467c19 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml @@ -0,0 +1,1164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/tdf149204.xml b/chart2/qa/extras/xshape/data/reference/tdf149204.xml new file mode 100644 index 0000000000..5e157983d0 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tdf149204.xml @@ -0,0 +1,397 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/tdf150832.xml b/chart2/qa/extras/xshape/data/reference/tdf150832.xml new file mode 100644 index 0000000000..66730ab850 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tdf150832.xml @@ -0,0 +1,974 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/tdf151424.xml b/chart2/qa/extras/xshape/data/reference/tdf151424.xml new file mode 100644 index 0000000000..c1aafbbd6a --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tdf151424.xml @@ -0,0 +1,1160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml new file mode 100644 index 0000000000..222e595157 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml new file mode 100644 index 0000000000..9ea3f9c16c --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml new file mode 100644 index 0000000000..a042916da8 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml new file mode 100644 index 0000000000..83d7217861 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/testChart.xml b/chart2/qa/extras/xshape/data/reference/testChart.xml new file mode 100644 index 0000000000..ad64e5f3b6 --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/testChart.xml @@ -0,0 +1,1218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/reference/tolerance.xml b/chart2/qa/extras/xshape/data/reference/tolerance.xml new file mode 100644 index 0000000000..17ec7220fc --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/tolerance.xml @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/chart2/qa/extras/xshape/data/xls/tdf150832.xls b/chart2/qa/extras/xshape/data/xls/tdf150832.xls new file mode 100644 index 0000000000..1044345619 Binary files /dev/null and b/chart2/qa/extras/xshape/data/xls/tdf150832.xls differ diff --git a/chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx b/chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx new file mode 100644 index 0000000000..05db435f60 Binary files /dev/null and b/chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx differ diff --git a/chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx b/chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx new file mode 100644 index 0000000000..d3922f7f20 Binary files /dev/null and b/chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx differ diff --git a/chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx b/chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx new file mode 100644 index 0000000000..5a3ee4cf49 Binary files /dev/null and b/chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx differ diff --git a/chart2/qa/unit/chart2-dialogs-test.cxx b/chart2/qa/unit/chart2-dialogs-test.cxx new file mode 100644 index 0000000000..00bb9179df --- /dev/null +++ b/chart2/qa/unit/chart2-dialogs-test.cxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include + +using namespace ::com::sun::star; + +/// Test opening a dialog in chart2 +class Chart2DialogsTest : public ScreenshotTest +{ +private: + /// helper method to populate KnownDialogs, called in setUp(). Needs to be + /// written and has to add entries to KnownDialogs + virtual void registerKnownDialogsByID(mapType& rKnownDialogs) override; + + /// dialog creation for known dialogs by ID. Has to be implemented for + /// each registered known dialog + virtual VclPtr createDialogByID(sal_uInt32 nID) override; + +public: + Chart2DialogsTest(); + + // try to open a dialog + void openAnyDialog(); + + CPPUNIT_TEST_SUITE(Chart2DialogsTest); + CPPUNIT_TEST(openAnyDialog); + CPPUNIT_TEST_SUITE_END(); +}; + +Chart2DialogsTest::Chart2DialogsTest() {} + +void Chart2DialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) +{ + // fill map of known dialogs +} + +VclPtr Chart2DialogsTest::createDialogByID(sal_uInt32 /*nID*/) +{ + return nullptr; +} + +void Chart2DialogsTest::openAnyDialog() +{ + /// process input file containing the UXMLDescriptions of the dialogs to dump + processDialogBatchFile(u"chart2/qa/unit/data/chart2-dialogs-test.txt"); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Chart2DialogsTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/unit/common_functor_test.cxx b/chart2/qa/unit/common_functor_test.cxx new file mode 100644 index 0000000000..b2e404e135 --- /dev/null +++ b/chart2/qa/unit/common_functor_test.cxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + + +class CommonFunctorsTest : public CppUnit::TestFixture +{ +public: + CPPUNIT_TEST_SUITE(CommonFunctorsTest); + CPPUNIT_TEST(testAnyToString); + CPPUNIT_TEST(testDoubleToString); + CPPUNIT_TEST_SUITE_END(); + + void testAnyToString(); + void testDoubleToString(); + +private: +}; + +void CommonFunctorsTest::testAnyToString() +{ + std::vector aInput; + aInput.emplace_back(2.0); + aInput.emplace_back(10.0); + aInput.emplace_back(12.0); + aInput.emplace_back(15.0); + aInput.emplace_back(25.234); + aInput.emplace_back(123.456); + aInput.emplace_back(0.123450); + + std::vector aOutput; + std::transform(aInput.begin(), aInput.end(), + std::back_inserter(aOutput), chart::CommonFunctors::AnyToString()); + + CPPUNIT_ASSERT_EQUAL(OUString("2"), aOutput[0]); + CPPUNIT_ASSERT_EQUAL(OUString("10"), aOutput[1]); + CPPUNIT_ASSERT_EQUAL(OUString("12"), aOutput[2]); + CPPUNIT_ASSERT_EQUAL(OUString("15"), aOutput[3]); + CPPUNIT_ASSERT_EQUAL(OUString("25.234"), aOutput[4]); + CPPUNIT_ASSERT_EQUAL(OUString("123.456"), aOutput[5]); + CPPUNIT_ASSERT_EQUAL(OUString("0.12345"), aOutput[6]); +} + +void CommonFunctorsTest::testDoubleToString() +{ + std::vector aInput { 2.0, 10.0, 12.0, 15.0, 25.234, 123.456, 0.123450 }; + + std::vector aOutput; + std::transform(aInput.begin(), aInput.end(), + std::back_inserter(aOutput), chart::CommonFunctors::DoubleToOUString()); + + CPPUNIT_ASSERT_EQUAL(OUString("2"), aOutput[0]); + CPPUNIT_ASSERT_EQUAL(OUString("10"), aOutput[1]); + CPPUNIT_ASSERT_EQUAL(OUString("12"), aOutput[2]); + CPPUNIT_ASSERT_EQUAL(OUString("15"), aOutput[3]); + CPPUNIT_ASSERT_EQUAL(OUString("25.234"), aOutput[4]); + CPPUNIT_ASSERT_EQUAL(OUString("123.456"), aOutput[5]); + CPPUNIT_ASSERT_EQUAL(OUString("0.12345"), aOutput[6]); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(CommonFunctorsTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/unit/data/chart2-dialogs-test.txt b/chart2/qa/unit/data/chart2-dialogs-test.txt new file mode 100644 index 0000000000..92cc0880b0 --- /dev/null +++ b/chart2/qa/unit/data/chart2-dialogs-test.txt @@ -0,0 +1,69 @@ +# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# This file contains all dialogs that the unit tests in the module +# will work on if it is in script mode. It will read one-by-one, +# try to open it and create a screenshot that will be saved in +# workdir/screenshots using the pattern of the ui-file name. +# +# Syntax: +# - empty lines are allowed +# - lines starting with '#' are treated as comment +# - all other lines should contain a *.ui filename in the same +# notation as in the dialog constructors (see code) + +# +# The 'known' dialogs which have a hard-coded representation +# in registerKnownDialogsByID/createDialogByID +# + +# No known dialogs in chart2 for now + +# +# Dialogs without a hard-coded representation. These will +# be visualized using a fallback based on weld::Builder +# + +# currently deactivated, leads to problems and the test to not work +# This is typically a hint that these should be hard-coded in the +# test case since they need some document and model data to work + +modules/schart/ui/datarangedialog.ui +modules/schart/ui/attributedialog.ui +modules/schart/ui/chardialog.ui +modules/schart/ui/paradialog.ui +modules/schart/ui/3dviewdialog.ui +modules/schart/ui/tp_3D_SceneAppearance.ui +modules/schart/ui/tp_3D_SceneGeometry.ui +modules/schart/ui/tp_3D_SceneIllumination.ui +modules/schart/ui/tp_axisLabel.ui +modules/schart/ui/tp_AxisPositions.ui +modules/schart/ui/tp_DataLabel.ui +modules/schart/ui/tp_ErrorBars.ui +modules/schart/ui/tp_LegendPosition.ui +modules/schart/ui/tp_ChartType.ui +modules/schart/ui/tp_PolarOptions.ui +modules/schart/ui/tp_Scale.ui +modules/schart/ui/tp_SeriesToAxis.ui +modules/schart/ui/titlerotationtabpage.ui +modules/schart/ui/tp_Trendline.ui +modules/schart/ui/tp_ChartType.ui +modules/schart/ui/tp_DataSource.ui +modules/schart/ui/tp_RangeChooser.ui +modules/schart/ui/wizelementspage.ui +modules/schart/ui/charttypedialog.ui +modules/schart/ui/chartdatadialog.ui +modules/schart/ui/insertaxisdlg.ui +modules/schart/ui/insertgriddlg.ui +modules/schart/ui/dlg_DataLabel.ui +modules/schart/ui/dlg_InsertErrorBars.ui +modules/schart/ui/dlg_InsertLegend.ui +modules/schart/ui/inserttitledlg.ui +modules/schart/ui/smoothlinesdlg.ui +modules/schart/ui/steppedlinesdlg.ui diff --git a/chart2/qa/unit/data/tolerance.xml b/chart2/qa/unit/data/tolerance.xml new file mode 100644 index 0000000000..b73b0ff155 --- /dev/null +++ b/chart2/qa/unit/data/tolerance.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/chart2/qa/unoapi/knownissues.xcl b/chart2/qa/unoapi/knownissues.xcl new file mode 100644 index 0000000000..8321f45d00 --- /dev/null +++ b/chart2/qa/unoapi/knownissues.xcl @@ -0,0 +1,58 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +#i83851 +sch.ChXChartDocument::com::sun::star::frame::XModel +#i83833 +sch.ChXChartDocument::com::sun::star::chart::XChartDocument +#i83834 +sch.ChXChartDocument::com::sun::star::chart::ChartTableAddressSupplier + +#i83852 +sch.ChXChartView::com::sun::star::view::XSelectionSupplier + +#i83855 +sch.ChXDiagram::com::sun::star::chart::LineDiagram +#i83853 +sch.ChXDiagram::com::sun::star::beans::XPropertySet +#i83854 +sch.ChXDiagram::com::sun::star::chart::ChartAxisXSupplier +sch.ChXDiagram::com::sun::star::chart::ChartAxisYSupplier +sch.ChXDiagram::com::sun::star::chart::ChartAxisZSupplier +#i83856 +sch.ChXDiagram::com::sun::star::chart::StockDiagram + +sch.ChartLegend::com::sun::star::drawing::XShape +#i83830 +sch.ChartTitle::com::sun::star::drawing::XShape + +#i78867 +sch.ChXChartDocument::com::sun::star::xml::UserDefinedAttributesSupplier +sch.ChXChartAxis::com::sun::star::xml::UserDefinedAttributesSupplier +sch.ChXDiagram::com::sun::star::xml::UserDefinedAttributesSupplier +sch.ChartArea::com::sun::star::xml::UserDefinedAttributesSupplier +sch.ChartGrid::com::sun::star::xml::UserDefinedAttributesSupplier +sch.ChartLegend::com::sun::star::xml::UserDefinedAttributesSupplier +sch.ChartLine::com::sun::star::xml::UserDefinedAttributesSupplier +sch.ChartTitle::com::sun::star::xml::UserDefinedAttributesSupplier +sch.ChXDataPoint::com::sun::star::xml::UserDefinedAttributesSupplier + +#i83865 +sch.ChXDataPoint::com::sun::star::drawing::LineProperties +#112078 +sch.ChartLegend::com::sun::star::beans::XPropertySet diff --git a/chart2/qa/unoapi/sch.sce b/chart2/qa/unoapi/sch.sce new file mode 100644 index 0000000000..54842bfd7e --- /dev/null +++ b/chart2/qa/unoapi/sch.sce @@ -0,0 +1,42 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# +-o sch.ChXChartDocument +#i79073 -o sch.AccArea +#i79073 -o sch.AccAxis +#i79073 -o sch.AccDataPoint +#i79073 -o sch.AccDataSeries +#i79073 -o sch.AccDiagram +#i79073 -o sch.AccFloor +#i79073 -o sch.AccGrid +#i79073 -o sch.AccLegend +#i79073 -o sch.AccLegendEntry +#i79073 -o sch.AccTitle +#i79073 -o sch.AccWall +#i79073 -o sch.AccessibleDocumentView +-o sch.ChXChartAxis +-o sch.ChXChartData +-o sch.ChXChartDataArray +-o sch.ChXChartView +-o sch.ChXDataPoint +#i83868 -o sch.ChXDataRow +-o sch.ChXDiagram +-o sch.ChartArea +-o sch.ChartGrid +-o sch.ChartLegend +-o sch.ChartLine +-o sch.ChartTitle diff --git a/chart2/qa/unoapi/testdocuments/TransparencyChart.sxs b/chart2/qa/unoapi/testdocuments/TransparencyChart.sxs new file mode 100644 index 0000000000..c3a5833ae2 Binary files /dev/null and b/chart2/qa/unoapi/testdocuments/TransparencyChart.sxs differ diff --git a/chart2/qa/unoapi/testdocuments/emptyChart.sds b/chart2/qa/unoapi/testdocuments/emptyChart.sds new file mode 100644 index 0000000000..853a44a12c Binary files /dev/null and b/chart2/qa/unoapi/testdocuments/emptyChart.sds differ diff --git a/chart2/qa/unoapi/testdocuments/space-metal.jpg b/chart2/qa/unoapi/testdocuments/space-metal.jpg new file mode 100644 index 0000000000..d233443890 Binary files /dev/null and b/chart2/qa/unoapi/testdocuments/space-metal.jpg differ -- cgit v1.2.3