summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rw-r--r--chart2/CppunitTest_chart2_dump.mk7
-rw-r--r--chart2/CppunitTest_chart2_export3.mk14
-rw-r--r--chart2/CppunitTest_chart2_geometry.mk11
-rw-r--r--chart2/CppunitTest_chart2_pivot_chart_test.mk7
-rw-r--r--chart2/CppunitTest_chart2_trendcalculators.mk7
-rw-r--r--chart2/CppunitTest_chart2_uichart.mk58
-rw-r--r--chart2/CppunitTest_chart2_xshape.mk7
-rw-r--r--chart2/IwyuFilter_chart2.yaml257
-rw-r--r--chart2/Library_chart2.mk (renamed from chart2/Library_chartcontroller.mk)235
-rw-r--r--chart2/Library_chartcore.mk238
-rw-r--r--chart2/Module_chart2.mk7
-rw-r--r--chart2/UIConfig_chart2.mk7
-rw-r--r--chart2/export_setup.mk62
-rw-r--r--chart2/import_setup.mk8
-rw-r--r--chart2/inc/ChartModel.hxx74
-rw-r--r--chart2/inc/ChartTypeManager.hxx9
-rw-r--r--chart2/inc/ChartView.hxx88
-rw-r--r--chart2/inc/bitmaps.hlst243
-rw-r--r--chart2/inc/chart.hrc2
-rw-r--r--chart2/inc/pch/precompiled_chart2.cxx (renamed from chart2/inc/pch/precompiled_chartcore.cxx)2
-rw-r--r--chart2/inc/pch/precompiled_chart2.hxx (renamed from chart2/inc/pch/precompiled_chartcontroller.hxx)205
-rw-r--r--chart2/inc/pch/precompiled_chartcontroller.cxx12
-rw-r--r--chart2/inc/pch/precompiled_chartcore.hxx336
-rw-r--r--chart2/inc/strings.hrc9
-rw-r--r--chart2/inc/unonames.hxx46
-rw-r--r--chart2/qa/TestCaseOldAPI.java18
-rw-r--r--chart2/qa/extras/PivotChartTest.cxx262
-rw-r--r--chart2/qa/extras/chart2_trendcalculators.cxx32
-rw-r--r--chart2/qa/extras/chart2dump/chart2dump.cxx253
-rw-r--r--chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt2
-rw-r--r--chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt10
-rw-r--r--chart2/qa/extras/chart2export.cxx1832
-rw-r--r--chart2/qa/extras/chart2export2.cxx1247
-rw-r--r--chart2/qa/extras/chart2export3.cxx890
-rw-r--r--chart2/qa/extras/chart2geometry.cxx201
-rw-r--r--chart2/qa/extras/chart2import.cxx1464
-rw-r--r--chart2/qa/extras/chart2import2.cxx599
-rw-r--r--chart2/qa/extras/charttest.hxx395
-rw-r--r--chart2/qa/extras/data/docx/TableOnPage3.docxbin0 -> 35511 bytes
-rw-r--r--chart2/qa/extras/data/fods/tdf161483_AngleUnits.fods1851
-rw-r--r--chart2/qa/extras/data/odp/BarChartVeryLongLabel.odpbin0 -> 16390 bytes
-rw-r--r--chart2/qa/extras/data/ods/chartWithDotInSheetName.odsbin0 -> 15057 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf101894.odsbin0 -> 18221 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf107097.odsbin0 -> 17945 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf120348.odsbin0 -> 43612 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf136011.odsbin0 -> 23559 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf146066.odsbin0 -> 15079 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf146463.odsbin0 -> 21780 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf148142.odsbin0 -> 15349 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf151091.odsbin0 -> 14140 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf153706_XY_scatter_chart.odsbin0 -> 16152 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf158223.odsbin0 -> 27391 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf161800_barOfPie_split_pos.odsbin0 -> 15011 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf161800_pieOfPie_split_pos.odsbin0 -> 15964 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf166428_Low_High_StockChart_LO248.odsbin0 -> 20390 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf39052.odsbin0 -> 15941 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf50934_barOfPie.odsbin0 -> 14588 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf50934_pieOfPie.odsbin0 -> 15834 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf62057.odsbin0 -> 16852 bytes
-rw-r--r--chart2/qa/extras/data/ods/tdf99969.odsbin0 -> 14472 bytes
-rw-r--r--chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptxbin0 -> 165804 bytes
-rw-r--r--chart2/qa/extras/data/pptx/tdf127720.pptxbin0 -> 38935 bytes
-rw-r--r--chart2/qa/extras/data/pptx/tdf137691_dataTable.pptxbin0 -> 49901 bytes
-rw-r--r--chart2/qa/extras/data/pptx/tdf146487.pptxbin0 -> 33891 bytes
-rw-r--r--chart2/qa/extras/data/pptx/tdf146756_bestFit.pptxbin0 -> 65093 bytes
-rw-r--r--chart2/qa/extras/data/pptx/tdf150176.pptxbin0 -> 52342 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/ChartDataTable.xlsxbin0 -> 8142 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsxbin0 -> 15745 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/barOfPieChart.xlsxbin0 -> 7741 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/barOfPieChart2.xlsxbin0 -> 8130 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/barchart_totalsrow.xlsxbin0 -> 20117 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/bartest-stroke.xlsxbin0 -> 8809 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/chart_pie2007.xlsxbin11299 -> 9091 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/color_funnel.xlsxbin0 -> 13156 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/funnel1.xlsxbin0 -> 11503 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/invertIfNeg_bar.xlsxbin0 -> 13067 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/invertIfNeg_bubble.xlsxbin0 -> 9327 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/pieOfPieChart.xlsxbin0 -> 7656 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/pieOfPieChart2.xlsxbin0 -> 8036 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/tdf150434.xlsxbin0 -> 14918 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsxbin0 -> 14707 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/tdf166249.xlsxbin0 -> 14004 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/tdf39052.xlsxbin0 -> 9210 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/tdf98690.xlsxbin0 -> 17975 bytes
-rw-r--r--chart2/qa/extras/uichart.cxx567
-rw-r--r--chart2/qa/extras/xshape/chart2xshape.cxx160
-rw-r--r--chart2/qa/extras/xshape/data/ods/tdf151424.odsbin0 -> 17727 bytes
-rw-r--r--chart2/qa/extras/xshape/data/ods/tdf90839-4.odsbin19789 -> 19765 bytes
-rw-r--r--chart2/qa/extras/xshape/data/ods/testChart.ods (renamed from chart2/qa/unit/data/ods/testChart.ods)bin11156 -> 11156 bytes
-rw-r--r--chart2/qa/extras/xshape/data/pptx/tdf149204.pptxbin0 -> 33324 bytes
-rw-r--r--chart2/qa/extras/xshape/data/reference/fdo75075.xml1184
-rw-r--r--chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml814
-rw-r--r--chart2/qa/extras/xshape/data/reference/tdf149204.xml397
-rw-r--r--chart2/qa/extras/xshape/data/reference/tdf150832.xml974
-rw-r--r--chart2/qa/extras/xshape/data/reference/tdf151424.xml1160
-rw-r--r--chart2/qa/extras/xshape/data/reference/tdf90839-1.xml142
-rw-r--r--chart2/qa/extras/xshape/data/reference/tdf90839-2.xml150
-rw-r--r--chart2/qa/extras/xshape/data/reference/tdf90839-3.xml150
-rw-r--r--chart2/qa/extras/xshape/data/reference/tdf90839-4.xml98
-rw-r--r--chart2/qa/extras/xshape/data/reference/testChart.xml1218
-rw-r--r--chart2/qa/extras/xshape/data/xls/tdf150832.xlsbin0 -> 7168 bytes
-rw-r--r--chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsxbin13209 -> 13080 bytes
-rw-r--r--chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsxbin12601 -> 12498 bytes
-rw-r--r--chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsxbin13312 -> 13200 bytes
-rw-r--r--chart2/qa/unit/common_functor_test.cxx36
-rw-r--r--chart2/qa/unit/data/reference/testChart.xml1216
-rw-r--r--chart2/source/chart2.component (renamed from chart2/source/chartcore.component)52
-rw-r--r--chart2/source/controller/accessibility/AccessibleBase.cxx341
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartElement.cxx121
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartElement.hxx41
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartShape.cxx73
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartShape.hxx28
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartView.cxx285
-rw-r--r--chart2/source/controller/accessibility/AccessibleTextHelper.cxx51
-rw-r--r--chart2/source/controller/accessibility/AccessibleViewForwarder.cxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/AreaWrapper.cxx78
-rw-r--r--chart2/source/controller/chartapiwrapper/AreaWrapper.hxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/AxisWrapper.cxx109
-rw-r--r--chart2/source/controller/chartapiwrapper/AxisWrapper.hxx16
-rw-r--r--chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx139
-rw-r--r--chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx14
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx89
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx24
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx246
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx220
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx16
-rw-r--r--chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx470
-rw-r--r--chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx50
-rw-r--r--chart2/source/controller/chartapiwrapper/GridWrapper.cxx79
-rw-r--r--chart2/source/controller/chartapiwrapper/GridWrapper.hxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/LegendWrapper.cxx108
-rw-r--r--chart2/source/controller/chartapiwrapper/LegendWrapper.hxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx190
-rw-r--r--chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx11
-rw-r--r--chart2/source/controller/chartapiwrapper/TitleWrapper.cxx190
-rw-r--r--chart2/source/controller/chartapiwrapper/TitleWrapper.hxx10
-rw-r--r--chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx165
-rw-r--r--chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx11
-rw-r--r--chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx79
-rw-r--r--chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx16
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx12
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx43
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.hxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx71
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.hxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx17
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx10
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx17
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx12
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx10
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.hxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx58
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx42
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx95
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx83
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx57
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx2
-rw-r--r--chart2/source/controller/chartcontroller.component58
-rw-r--r--chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx22
-rw-r--r--chart2/source/controller/dialogs/ChartResourceGroups.cxx114
-rw-r--r--chart2/source/controller/dialogs/ChartTypeDialogController.cxx260
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx120
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.hxx5
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.cxx385
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx354
-rw-r--r--chart2/source/controller/dialogs/DialogModel.hxx47
-rw-r--r--chart2/source/controller/dialogs/ObjectNameProvider.cxx262
-rw-r--r--chart2/source/controller/dialogs/RangeSelectionHelper.cxx16
-rw-r--r--chart2/source/controller/dialogs/RangeSelectionListener.cxx25
-rw-r--r--chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx6
-rw-r--r--chart2/source/controller/dialogs/TitleDialogData.cxx26
-rw-r--r--chart2/source/controller/dialogs/dlg_ChartType.cxx12
-rw-r--r--chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx7
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard.cxx15
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx29
-rw-r--r--chart2/source/controller/dialogs/dlg_DataEditor.cxx60
-rw-r--r--chart2/source/controller/dialogs/dlg_DataSource.cxx58
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx20
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertDataTable.cxx61
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx25
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertLegend.cxx3
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertTitle.cxx3
-rw-r--r--chart2/source/controller/dialogs/dlg_NumberFormat.cxx5
-rw-r--r--chart2/source/controller/dialogs/dlg_NumberFormat.hxx6
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx214
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeFont.cxx10
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx14
-rw-r--r--chart2/source/controller/dialogs/dlg_View3D.cxx25
-rw-r--r--chart2/source/controller/dialogs/res_BarGeometry.cxx11
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx143
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.hxx12
-rw-r--r--chart2/source/controller/dialogs/res_DataTableProperties.cxx111
-rw-r--r--chart2/source/controller/dialogs/res_ErrorBar.cxx88
-rw-r--r--chart2/source/controller/dialogs/res_LegendPosition.cxx65
-rw-r--r--chart2/source/controller/dialogs/res_Titles.cxx28
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.cxx105
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx41
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx3
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx51
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx7
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx95
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx25
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.cxx61
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.hxx7
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.cxx80
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.hxx4
-rw-r--r--chart2/source/controller/dialogs/tp_ChartColorPalette.cxx188
-rw-r--r--chart2/source/controller/dialogs/tp_ChartColorPalette.hxx64
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.cxx58
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_DataPointOption.cxx14
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx187
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.hxx10
-rw-r--r--chart2/source/controller/dialogs/tp_DataTable.cxx43
-rw-r--r--chart2/source/controller/dialogs/tp_DataTable.hxx37
-rw-r--r--chart2/source/controller/dialogs/tp_ErrorBars.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.cxx20
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.hxx5
-rw-r--r--chart2/source/controller/dialogs/tp_PointGeometry.cxx8
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.cxx30
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.hxx1
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.cxx48
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.cxx142
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.cxx76
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.hxx1
-rw-r--r--chart2/source/controller/dialogs/tp_TitleRotation.cxx22
-rw-r--r--chart2/source/controller/dialogs/tp_TitleRotation.hxx7
-rw-r--r--chart2/source/controller/dialogs/tp_Trendline.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx20
-rw-r--r--chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx3
-rw-r--r--chart2/source/controller/drawinglayer/DrawViewWrapper.cxx52
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx18
-rw-r--r--chart2/source/controller/inc/AccessibleBase.hxx121
-rw-r--r--chart2/source/controller/inc/AccessibleChartView.hxx50
-rw-r--r--chart2/source/controller/inc/AccessibleTextHelper.hxx30
-rw-r--r--chart2/source/controller/inc/AxisItemConverter.hxx9
-rw-r--r--chart2/source/controller/inc/CharacterPropertyItemConverter.hxx4
-rw-r--r--chart2/source/controller/inc/ChartController.hxx131
-rw-r--r--chart2/source/controller/inc/ChartDocumentWrapper.hxx18
-rw-r--r--chart2/source/controller/inc/ChartWindow.hxx9
-rw-r--r--chart2/source/controller/inc/CommandDispatch.hxx (renamed from chart2/source/controller/main/CommandDispatch.hxx)16
-rw-r--r--chart2/source/controller/inc/CommandDispatchContainer.hxx14
-rw-r--r--chart2/source/controller/inc/ControllerCommandDispatch.hxx (renamed from chart2/source/controller/main/ControllerCommandDispatch.hxx)5
-rw-r--r--chart2/source/controller/inc/DataPointItemConverter.hxx12
-rw-r--r--chart2/source/controller/inc/DataTableItemConverter.hxx56
-rw-r--r--chart2/source/controller/inc/ErrorBarItemConverter.hxx7
-rw-r--r--chart2/source/controller/inc/GraphicPropertyItemConverter.hxx8
-rw-r--r--chart2/source/controller/inc/ItemConverter.hxx2
-rw-r--r--chart2/source/controller/inc/LegendItemConverter.hxx10
-rw-r--r--chart2/source/controller/inc/MultipleChartConverters.hxx15
-rw-r--r--chart2/source/controller/inc/ObjectHierarchy.hxx50
-rw-r--r--chart2/source/controller/inc/ObjectNameProvider.hxx17
-rw-r--r--chart2/source/controller/inc/PositionAndSizeHelper.hxx3
-rw-r--r--chart2/source/controller/inc/RegressionCurveItemConverter.hxx10
-rw-r--r--chart2/source/controller/inc/RegressionEquationItemConverter.hxx10
-rw-r--r--chart2/source/controller/inc/SelectionHelper.hxx5
-rw-r--r--chart2/source/controller/inc/SeriesOptionsItemConverter.hxx10
-rw-r--r--chart2/source/controller/inc/ShapeController.h38
-rw-r--r--chart2/source/controller/inc/StatisticsItemConverter.hxx3
-rw-r--r--chart2/source/controller/inc/TabPageNotifiable.hxx7
-rw-r--r--chart2/source/controller/inc/TextLabelItemConverter.hxx10
-rw-r--r--chart2/source/controller/inc/TitleDialogData.hxx8
-rw-r--r--chart2/source/controller/inc/TitleItemConverter.hxx9
-rw-r--r--chart2/source/controller/inc/dlg_ChartType.hxx7
-rw-r--r--chart2/source/controller/inc/dlg_ChartType_UNO.hxx1
-rw-r--r--chart2/source/controller/inc/dlg_CreationWizard.hxx11
-rw-r--r--chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx5
-rw-r--r--chart2/source/controller/inc/dlg_DataEditor.hxx11
-rw-r--r--chart2/source/controller/inc/dlg_DataSource.hxx14
-rw-r--r--chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx1
-rw-r--r--chart2/source/controller/inc/dlg_InsertDataTable.hxx52
-rw-r--r--chart2/source/controller/inc/dlg_InsertErrorBars.hxx15
-rw-r--r--chart2/source/controller/inc/dlg_InsertLegend.hxx1
-rw-r--r--chart2/source/controller/inc/dlg_ObjectProperties.hxx12
-rw-r--r--chart2/source/controller/inc/dlg_ShapeFont.hxx2
-rw-r--r--chart2/source/controller/inc/dlg_ShapeParagraph.hxx2
-rw-r--r--chart2/source/controller/inc/dlg_View3D.hxx7
-rw-r--r--chart2/source/controller/inc/helpids.h10
-rw-r--r--chart2/source/controller/inc/res_DataTableProperties.hxx48
-rw-r--r--chart2/source/controller/inc/res_ErrorBar.hxx5
-rw-r--r--chart2/source/controller/inc/res_LegendPosition.hxx6
-rw-r--r--chart2/source/controller/inc/uiobject.hxx4
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx163
-rw-r--r--chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx45
-rw-r--r--chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx166
-rw-r--r--chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx92
-rw-r--r--chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx47
-rw-r--r--chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx130
-rw-r--r--chart2/source/controller/itemsetwrapper/ItemConverter.cxx39
-rw-r--r--chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx48
-rw-r--r--chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx71
-rw-r--r--chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx64
-rw-r--r--chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx9
-rw-r--r--chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx10
-rw-r--r--chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx131
-rw-r--r--chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx118
-rw-r--r--chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx144
-rw-r--r--chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx21
-rw-r--r--chart2/source/controller/main/ChartController.cxx613
-rw-r--r--chart2/source/controller/main/ChartController_EditData.cxx7
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx449
-rw-r--r--chart2/source/controller/main/ChartController_Position.cxx52
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx259
-rw-r--r--chart2/source/controller/main/ChartController_TextEdit.cxx187
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx560
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx755
-rw-r--r--chart2/source/controller/main/ChartDropTargetHelper.cxx24
-rw-r--r--chart2/source/controller/main/ChartDropTargetHelper.hxx8
-rw-r--r--chart2/source/controller/main/ChartFrameloader.cxx46
-rw-r--r--chart2/source/controller/main/ChartModelClone.cxx16
-rw-r--r--chart2/source/controller/main/ChartModelClone.hxx1
-rw-r--r--chart2/source/controller/main/ChartTransferable.cxx27
-rw-r--r--chart2/source/controller/main/ChartTransferable.hxx4
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx46
-rw-r--r--chart2/source/controller/main/CommandDispatch.cxx57
-rw-r--r--chart2/source/controller/main/CommandDispatchContainer.cxx113
-rw-r--r--chart2/source/controller/main/ConfigurationAccess.cxx93
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx542
-rw-r--r--chart2/source/controller/main/DragMethod_Base.cxx8
-rw-r--r--chart2/source/controller/main/DragMethod_Base.hxx3
-rw-r--r--chart2/source/controller/main/DragMethod_PieSegment.cxx13
-rw-r--r--chart2/source/controller/main/DragMethod_PieSegment.hxx2
-rw-r--r--chart2/source/controller/main/DragMethod_RotateDiagram.cxx37
-rw-r--r--chart2/source/controller/main/DragMethod_RotateDiagram.hxx2
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx191
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.h42
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.hxx7
-rw-r--r--chart2/source/controller/main/ElementSelector.cxx26
-rw-r--r--chart2/source/controller/main/ElementSelector.hxx1
-rw-r--r--chart2/source/controller/main/FeatureCommandDispatchBase.cxx16
-rw-r--r--chart2/source/controller/main/FeatureCommandDispatchBase.hxx56
-rw-r--r--chart2/source/controller/main/ObjectHierarchy.cxx272
-rw-r--r--chart2/source/controller/main/PositionAndSizeHelper.cxx63
-rw-r--r--chart2/source/controller/main/SelectionHelper.cxx28
-rw-r--r--chart2/source/controller/main/ShapeController.cxx204
-rw-r--r--chart2/source/controller/main/ShapeController.hxx4
-rw-r--r--chart2/source/controller/main/StatusBarCommandDispatch.cxx17
-rw-r--r--chart2/source/controller/main/StatusBarCommandDispatch.hxx10
-rw-r--r--chart2/source/controller/main/ToolbarController.cxx4
-rw-r--r--chart2/source/controller/main/UndoActions.cxx13
-rw-r--r--chart2/source/controller/main/UndoActions.hxx8
-rw-r--r--chart2/source/controller/main/UndoCommandDispatch.cxx19
-rw-r--r--chart2/source/controller/main/UndoCommandDispatch.hxx9
-rw-r--r--chart2/source/controller/main/UndoGuard.cxx8
-rw-r--r--chart2/source/controller/main/UndoGuard.hxx3
-rw-r--r--chart2/source/controller/sidebar/Chart2PanelFactory.cxx23
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.cxx88
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.hxx4
-rw-r--r--chart2/source/controller/sidebar/ChartAxisPanel.cxx72
-rw-r--r--chart2/source/controller/sidebar/ChartAxisPanel.hxx2
-rw-r--r--chart2/source/controller/sidebar/ChartColorPaletteControl.cxx353
-rw-r--r--chart2/source/controller/sidebar/ChartColorPaletteControl.hxx94
-rw-r--r--chart2/source/controller/sidebar/ChartColorWrapper.cxx47
-rw-r--r--chart2/source/controller/sidebar/ChartColorWrapper.hxx15
-rw-r--r--chart2/source/controller/sidebar/ChartColorsPanel.cxx310
-rw-r--r--chart2/source/controller/sidebar/ChartColorsPanel.hxx87
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx128
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.hxx2
-rw-r--r--chart2/source/controller/sidebar/ChartErrorBarPanel.cxx53
-rw-r--r--chart2/source/controller/sidebar/ChartErrorBarPanel.hxx2
-rw-r--r--chart2/source/controller/sidebar/ChartLinePanel.cxx46
-rw-r--r--chart2/source/controller/sidebar/ChartLinePanel.hxx10
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.cxx116
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.hxx2
-rw-r--r--chart2/source/controller/sidebar/ChartTypePanel.cxx57
-rw-r--r--chart2/source/controller/sidebar/ChartTypePanel.hxx2
-rw-r--r--chart2/source/controller/uitest/uiobject.cxx49
-rw-r--r--chart2/source/inc/Axis.hxx (renamed from chart2/source/model/main/Axis.hxx)25
-rw-r--r--chart2/source/inc/AxisHelper.hxx141
-rw-r--r--chart2/source/inc/BaseColorScheme.hxx (renamed from chart2/source/controller/inc/ConfigurationAccess.hxx)30
-rw-r--r--chart2/source/inc/BaseCoordinateSystem.hxx27
-rw-r--r--chart2/source/inc/BaseGFXHelper.hxx23
-rw-r--r--chart2/source/inc/CachedDataSequence.hxx12
-rw-r--r--chart2/source/inc/ChangingResource.hxx1
-rw-r--r--chart2/source/inc/CharacterProperties.hxx9
-rw-r--r--chart2/source/inc/ChartColorPaletteHelper.hxx47
-rw-r--r--chart2/source/inc/ChartColorPalettes.hxx36
-rw-r--r--chart2/source/inc/ChartColorScheme.hxx (renamed from chart2/source/inc/TrueGuard.hxx)20
-rw-r--r--chart2/source/inc/ChartModelHelper.hxx96
-rw-r--r--chart2/source/inc/ChartResourceGroups.hxx9
-rw-r--r--chart2/source/inc/ChartType.hxx (renamed from chart2/source/model/template/ChartType.hxx)74
-rw-r--r--chart2/source/inc/ChartTypeDialogController.hxx64
-rw-r--r--chart2/source/inc/ChartTypeHelper.hxx64
-rw-r--r--chart2/source/inc/ChartTypeTemplate.hxx119
-rw-r--r--chart2/source/inc/ChartViewHelper.hxx22
-rw-r--r--chart2/source/inc/CloneHelper.hxx12
-rw-r--r--chart2/source/inc/ColorPerPointHelper.hxx48
-rw-r--r--chart2/source/inc/CommonConverters.hxx86
-rw-r--r--chart2/source/inc/CommonFunctors.hxx68
-rw-r--r--chart2/source/inc/ConfigColorScheme.hxx23
-rw-r--r--chart2/source/inc/ControllerLockGuard.hxx27
-rw-r--r--chart2/source/inc/DataBrowserModel.hxx (renamed from chart2/source/controller/dialogs/DataBrowserModel.hxx)29
-rw-r--r--chart2/source/inc/DataInterpreter.hxx152
-rw-r--r--chart2/source/inc/DataSeries.hxx (renamed from chart2/source/model/inc/DataSeries.hxx)94
-rw-r--r--chart2/source/inc/DataSeriesHelper.hxx116
-rw-r--r--chart2/source/inc/DataSeriesProperties.hxx (renamed from chart2/source/model/main/DataSeriesProperties.hxx)7
-rw-r--r--chart2/source/inc/DataSource.hxx5
-rw-r--r--chart2/source/inc/DataSourceHelper.hxx55
-rw-r--r--chart2/source/inc/DataTable.hxx85
-rw-r--r--chart2/source/inc/Diagram.hxx245
-rw-r--r--chart2/source/inc/DiagramHelper.hxx234
-rw-r--r--chart2/source/inc/DisposeHelper.hxx11
-rw-r--r--chart2/source/inc/ErrorBar.hxx9
-rw-r--r--chart2/source/inc/EventListenerHelper.hxx10
-rw-r--r--chart2/source/inc/ExplicitCategoriesProvider.hxx29
-rw-r--r--chart2/source/inc/FillProperties.hxx5
-rw-r--r--chart2/source/inc/FormattedString.hxx (renamed from chart2/source/model/main/FormattedString.hxx)11
-rw-r--r--chart2/source/inc/FormattedStringHelper.hxx14
-rw-r--r--chart2/source/inc/GridProperties.hxx (renamed from chart2/source/model/main/GridProperties.hxx)12
-rw-r--r--chart2/source/inc/HistogramDataSequence.hxx104
-rw-r--r--chart2/source/inc/InternalData.hxx1
-rw-r--r--chart2/source/inc/InternalDataProvider.hxx11
-rw-r--r--chart2/source/inc/LabeledDataSequence.hxx11
-rw-r--r--chart2/source/inc/Legend.hxx (renamed from chart2/source/model/main/Legend.hxx)13
-rw-r--r--chart2/source/inc/LegendHelper.hxx15
-rw-r--r--chart2/source/inc/LifeTime.hxx68
-rw-r--r--chart2/source/inc/LinePropertiesHelper.hxx5
-rw-r--r--chart2/source/inc/MediaDescriptorHelper.hxx6
-rw-r--r--chart2/source/inc/ModifyListenerCallBack.hxx10
-rw-r--r--chart2/source/inc/ModifyListenerHelper.hxx75
-rw-r--r--chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx4
-rw-r--r--chart2/source/inc/NameContainer.hxx1
-rw-r--r--chart2/source/inc/NumberFormatterWrapper.hxx4
-rw-r--r--chart2/source/inc/OPropertySet.hxx48
-rw-r--r--chart2/source/inc/ObjectIdentifier.hxx117
-rw-r--r--chart2/source/inc/PopupRequest.hxx4
-rw-r--r--chart2/source/inc/PropertyHelper.hxx18
-rw-r--r--chart2/source/inc/RangeHighlighter.hxx9
-rw-r--r--chart2/source/inc/RangeSelectionHelper.hxx (renamed from chart2/source/controller/inc/RangeSelectionHelper.hxx)3
-rw-r--r--chart2/source/inc/RangeSelectionListener.hxx (renamed from chart2/source/controller/inc/RangeSelectionListener.hxx)13
-rw-r--r--chart2/source/inc/ReferenceSizeProvider.hxx26
-rw-r--r--chart2/source/inc/RegressionCurveCalculator.hxx44
-rw-r--r--chart2/source/inc/RegressionCurveHelper.hxx123
-rw-r--r--chart2/source/inc/RegressionCurveModel.hxx (renamed from chart2/source/tools/RegressionCurveModel.hxx)15
-rw-r--r--chart2/source/inc/RelativePositionHelper.hxx6
-rw-r--r--chart2/source/inc/RelativeSizeHelper.hxx5
-rw-r--r--chart2/source/inc/ResId.hxx3
-rw-r--r--chart2/source/inc/SceneProperties.hxx6
-rw-r--r--chart2/source/inc/StatisticsHelper.hxx39
-rw-r--r--chart2/source/inc/ThreeDHelper.hxx63
-rw-r--r--chart2/source/inc/TimerTriggeredControllerLock.hxx (renamed from chart2/source/controller/inc/TimerTriggeredControllerLock.hxx)7
-rw-r--r--chart2/source/inc/Title.hxx (renamed from chart2/source/model/main/Title.hxx)9
-rw-r--r--chart2/source/inc/TitleHelper.hxx45
-rw-r--r--chart2/source/inc/UncachedDataSequence.hxx23
-rw-r--r--chart2/source/inc/UserDefinedProperties.hxx5
-rw-r--r--chart2/source/inc/WeakListenerAdapter.hxx57
-rw-r--r--chart2/source/inc/WrappedDefaultProperty.hxx5
-rw-r--r--chart2/source/inc/WrappedDirectStateProperty.hxx3
-rw-r--r--chart2/source/inc/WrappedIgnoreProperty.hxx15
-rw-r--r--chart2/source/inc/WrappedProperty.hxx6
-rw-r--r--chart2/source/inc/WrappedPropertySet.hxx17
-rw-r--r--chart2/source/inc/XMLRangeHelper.hxx5
-rw-r--r--chart2/source/inc/charttoolsdllapi.hxx32
-rw-r--r--chart2/source/inc/chartview/ChartSfxItemIds.hxx268
-rw-r--r--chart2/source/inc/chartview/DataPointSymbolSupplier.hxx4
-rw-r--r--chart2/source/inc/chartview/DrawModelWrapper.hxx22
-rw-r--r--chart2/source/inc/chartview/ExplicitScaleValues.hxx6
-rw-r--r--chart2/source/inc/chartview/ExplicitValueProvider.hxx96
-rw-r--r--chart2/source/inc/chartview/chartviewdllapi.hxx32
-rw-r--r--chart2/source/inc/defines.hxx2
-rw-r--r--chart2/source/inc/servicenames.hxx40
-rw-r--r--chart2/source/inc/servicenames_charttypes.hxx44
-rw-r--r--chart2/source/inc/servicenames_coosystems.hxx4
-rw-r--r--chart2/source/model/filter/XMLFilter.cxx143
-rw-r--r--chart2/source/model/inc/StockBar.hxx5
-rw-r--r--chart2/source/model/inc/XMLFilter.hxx14
-rw-r--r--chart2/source/model/main/Axis.cxx243
-rw-r--r--chart2/source/model/main/BaseCoordinateSystem.cxx185
-rw-r--r--chart2/source/model/main/CartesianCoordinateSystem.cxx12
-rw-r--r--chart2/source/model/main/ChartModel.cxx490
-rw-r--r--chart2/source/model/main/ChartModel_Persistence.cxx179
-rw-r--r--chart2/source/model/main/DataPoint.cxx71
-rw-r--r--chart2/source/model/main/DataPoint.hxx2
-rw-r--r--chart2/source/model/main/DataPointProperties.cxx55
-rw-r--r--chart2/source/model/main/DataPointProperties.hxx4
-rw-r--r--chart2/source/model/main/DataSeries.cxx669
-rw-r--r--chart2/source/model/main/DataSeriesProperties.cxx11
-rw-r--r--chart2/source/model/main/DataTable.cxx210
-rw-r--r--chart2/source/model/main/Diagram.cxx1722
-rw-r--r--chart2/source/model/main/FormattedString.cxx89
-rw-r--r--chart2/source/model/main/GridProperties.cxx102
-rw-r--r--chart2/source/model/main/Legend.cxx133
-rw-r--r--chart2/source/model/main/PageBackground.cxx124
-rw-r--r--chart2/source/model/main/PageBackground.hxx5
-rw-r--r--chart2/source/model/main/PolarCoordinateSystem.cxx14
-rw-r--r--chart2/source/model/main/StockBar.cxx102
-rw-r--r--chart2/source/model/main/Title.cxx147
-rw-r--r--chart2/source/model/main/UndoManager.cxx16
-rw-r--r--chart2/source/model/main/UndoManager.hxx3
-rw-r--r--chart2/source/model/main/Wall.cxx105
-rw-r--r--chart2/source/model/main/Wall.hxx5
-rw-r--r--chart2/source/model/template/AreaChartType.cxx9
-rw-r--r--chart2/source/model/template/AreaChartType.hxx4
-rw-r--r--chart2/source/model/template/AreaChartTypeTemplate.cxx135
-rw-r--r--chart2/source/model/template/AreaChartTypeTemplate.hxx20
-rw-r--r--chart2/source/model/template/BarChartType.cxx11
-rw-r--r--chart2/source/model/template/BarChartType.hxx4
-rw-r--r--chart2/source/model/template/BarChartTypeTemplate.cxx175
-rw-r--r--chart2/source/model/template/BarChartTypeTemplate.hxx30
-rw-r--r--chart2/source/model/template/BubbleChartType.cxx93
-rw-r--r--chart2/source/model/template/BubbleChartType.hxx9
-rw-r--r--chart2/source/model/template/BubbleChartTypeTemplate.cxx118
-rw-r--r--chart2/source/model/template/BubbleChartTypeTemplate.hxx17
-rw-r--r--chart2/source/model/template/BubbleDataInterpreter.cxx116
-rw-r--r--chart2/source/model/template/BubbleDataInterpreter.hxx16
-rw-r--r--chart2/source/model/template/CandleStickChartType.cxx106
-rw-r--r--chart2/source/model/template/CandleStickChartType.hxx8
-rw-r--r--chart2/source/model/template/ChartType.cxx458
-rw-r--r--chart2/source/model/template/ChartTypeManager.cxx69
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx506
-rw-r--r--chart2/source/model/template/ColumnChartType.cxx99
-rw-r--r--chart2/source/model/template/ColumnChartType.hxx4
-rw-r--r--chart2/source/model/template/ColumnLineChartTypeTemplate.cxx243
-rw-r--r--chart2/source/model/template/ColumnLineChartTypeTemplate.hxx42
-rw-r--r--chart2/source/model/template/ColumnLineDataInterpreter.cxx27
-rw-r--r--chart2/source/model/template/ColumnLineDataInterpreter.hxx9
-rw-r--r--chart2/source/model/template/DataInterpreter.cxx134
-rw-r--r--chart2/source/model/template/DataInterpreter.hxx77
-rw-r--r--chart2/source/model/template/FilledNetChartType.cxx12
-rw-r--r--chart2/source/model/template/FilledNetChartType.hxx2
-rw-r--r--chart2/source/model/template/FunnelChartType.cxx75
-rw-r--r--chart2/source/model/template/FunnelChartType.hxx40
-rw-r--r--chart2/source/model/template/FunnelChartTypeTemplate.cxx192
-rw-r--r--chart2/source/model/template/FunnelChartTypeTemplate.hxx61
-rw-r--r--chart2/source/model/template/HistogramCalculator.cxx122
-rw-r--r--chart2/source/model/template/HistogramCalculator.hxx36
-rw-r--r--chart2/source/model/template/HistogramChartType.cxx295
-rw-r--r--chart2/source/model/template/HistogramChartType.hxx52
-rw-r--r--chart2/source/model/template/HistogramChartTypeTemplate.cxx160
-rw-r--r--chart2/source/model/template/HistogramChartTypeTemplate.hxx67
-rw-r--r--chart2/source/model/template/HistogramDataInterpreter.cxx63
-rw-r--r--chart2/source/model/template/HistogramDataInterpreter.hxx35
-rw-r--r--chart2/source/model/template/LineChartType.cxx126
-rw-r--r--chart2/source/model/template/LineChartType.hxx4
-rw-r--r--chart2/source/model/template/LineChartTypeTemplate.cxx222
-rw-r--r--chart2/source/model/template/LineChartTypeTemplate.hxx23
-rw-r--r--chart2/source/model/template/NetChartType.cxx58
-rw-r--r--chart2/source/model/template/NetChartType.hxx11
-rw-r--r--chart2/source/model/template/NetChartTypeTemplate.cxx79
-rw-r--r--chart2/source/model/template/NetChartTypeTemplate.hxx19
-rw-r--r--chart2/source/model/template/PieChartType.cxx141
-rw-r--r--chart2/source/model/template/PieChartType.hxx10
-rw-r--r--chart2/source/model/template/PieChartTypeTemplate.cxx350
-rw-r--r--chart2/source/model/template/PieChartTypeTemplate.hxx55
-rw-r--r--chart2/source/model/template/ScatterChartType.cxx135
-rw-r--r--chart2/source/model/template/ScatterChartType.hxx9
-rw-r--r--chart2/source/model/template/ScatterChartTypeTemplate.cxx231
-rw-r--r--chart2/source/model/template/ScatterChartTypeTemplate.hxx24
-rw-r--r--chart2/source/model/template/StockChartTypeTemplate.cxx235
-rw-r--r--chart2/source/model/template/StockChartTypeTemplate.hxx45
-rw-r--r--chart2/source/model/template/StockDataInterpreter.cxx138
-rw-r--r--chart2/source/model/template/StockDataInterpreter.hxx16
-rw-r--r--chart2/source/model/template/XYDataInterpreter.cxx106
-rw-r--r--chart2/source/model/template/XYDataInterpreter.hxx16
-rw-r--r--chart2/source/tools/AxisHelper.cxx522
-rw-r--r--chart2/source/tools/BaseColorScheme.cxx (renamed from chart2/source/tools/TrueGuard.cxx)19
-rw-r--r--chart2/source/tools/BaseGFXHelper.cxx8
-rw-r--r--chart2/source/tools/CachedDataSequence.cxx125
-rw-r--r--chart2/source/tools/CharacterProperties.cxx53
-rw-r--r--chart2/source/tools/ChartColorPaletteHelper.cxx199
-rw-r--r--chart2/source/tools/ChartColorPalettes.cxx59
-rw-r--r--chart2/source/tools/ChartColorScheme.cxx (renamed from chart2/source/view/inc/ConfigAccess.hxx)36
-rw-r--r--chart2/source/tools/ChartModelHelper.cxx306
-rw-r--r--chart2/source/tools/ChartTypeHelper.cxx419
-rw-r--r--chart2/source/tools/ChartViewHelper.cxx24
-rw-r--r--chart2/source/tools/ColorPerPointHelper.cxx78
-rw-r--r--chart2/source/tools/CommonConverters.cxx41
-rw-r--r--chart2/source/tools/ConfigColorScheme.cxx50
-rw-r--r--chart2/source/tools/ControllerLockGuard.cxx11
-rw-r--r--chart2/source/tools/DataSeriesHelper.cxx636
-rw-r--r--chart2/source/tools/DataSource.cxx11
-rw-r--r--chart2/source/tools/DataSourceHelper.cxx169
-rw-r--r--chart2/source/tools/DiagramHelper.cxx1258
-rw-r--r--chart2/source/tools/ErrorBar.cxx41
-rw-r--r--chart2/source/tools/ExplicitCategoriesProvider.cxx163
-rw-r--r--chart2/source/tools/FillProperties.cxx18
-rw-r--r--chart2/source/tools/FormattedStringHelper.cxx29
-rw-r--r--chart2/source/tools/HistogramDataSequence.cxx154
-rw-r--r--chart2/source/tools/InternalData.cxx91
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx297
-rw-r--r--chart2/source/tools/LabeledDataSequence.cxx40
-rw-r--r--chart2/source/tools/LegendHelper.cxx47
-rw-r--r--chart2/source/tools/LifeTime.cxx111
-rw-r--r--chart2/source/tools/LinePropertiesHelper.cxx27
-rw-r--r--chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx2
-rw-r--r--chart2/source/tools/MeanValueRegressionCurveCalculator.cxx20
-rw-r--r--chart2/source/tools/ModifyListenerCallBack.cxx4
-rw-r--r--chart2/source/tools/ModifyListenerHelper.cxx3
-rw-r--r--chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx22
-rw-r--r--chart2/source/tools/NameContainer.cxx8
-rw-r--r--chart2/source/tools/NumberFormatterWrapper.cxx27
-rw-r--r--chart2/source/tools/OPropertySet.cxx25
-rw-r--r--chart2/source/tools/ObjectIdentifier.cxx731
-rw-r--r--chart2/source/tools/PolynomialRegressionCurveCalculator.cxx2
-rw-r--r--chart2/source/tools/PotentialRegressionCurveCalculator.cxx4
-rw-r--r--chart2/source/tools/PropertyHelper.cxx137
-rw-r--r--chart2/source/tools/RangeHighlighter.cxx77
-rw-r--r--chart2/source/tools/ReferenceSizeProvider.cxx171
-rw-r--r--chart2/source/tools/RegressionCurveCalculator.cxx28
-rw-r--r--chart2/source/tools/RegressionCurveHelper.cxx403
-rw-r--r--chart2/source/tools/RegressionCurveModel.cxx67
-rw-r--r--chart2/source/tools/RegressionEquation.cxx28
-rw-r--r--chart2/source/tools/RegressionEquation.hxx2
-rw-r--r--chart2/source/tools/RelativeSizeHelper.cxx9
-rw-r--r--chart2/source/tools/Scaling.cxx12
-rw-r--r--chart2/source/tools/SceneProperties.cxx7
-rw-r--r--chart2/source/tools/StatisticsHelper.cxx71
-rw-r--r--chart2/source/tools/ThreeDHelper.cxx726
-rw-r--r--chart2/source/tools/TitleHelper.cxx351
-rw-r--r--chart2/source/tools/UncachedDataSequence.cxx98
-rw-r--r--chart2/source/tools/WeakListenerAdapter.cxx22
-rw-r--r--chart2/source/tools/WrappedDefaultProperty.cxx7
-rw-r--r--chart2/source/tools/WrappedIgnoreProperty.cxx44
-rw-r--r--chart2/source/tools/WrappedProperty.cxx9
-rw-r--r--chart2/source/tools/WrappedPropertySet.cxx16
-rw-r--r--chart2/source/tools/XMLRangeHelper.cxx28
-rw-r--r--chart2/source/view/axes/DateScaling.cxx6
-rw-r--r--chart2/source/view/axes/MinimumAndMaximumSupplier.cxx35
-rw-r--r--chart2/source/view/axes/Tickmarks.cxx16
-rw-r--r--chart2/source/view/axes/Tickmarks.hxx18
-rw-r--r--chart2/source/view/axes/Tickmarks_Dates.cxx7
-rw-r--r--chart2/source/view/axes/Tickmarks_Dates.hxx4
-rw-r--r--chart2/source/view/axes/Tickmarks_Equidistant.cxx11
-rw-r--r--chart2/source/view/axes/Tickmarks_Equidistant.hxx4
-rw-r--r--chart2/source/view/axes/VAxisBase.cxx27
-rw-r--r--chart2/source/view/axes/VAxisBase.hxx16
-rw-r--r--chart2/source/view/axes/VAxisProperties.cxx106
-rw-r--r--chart2/source/view/axes/VAxisProperties.hxx34
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx274
-rw-r--r--chart2/source/view/axes/VCartesianAxis.hxx7
-rw-r--r--chart2/source/view/axes/VCartesianCoordinateSystem.cxx52
-rw-r--r--chart2/source/view/axes/VCartesianCoordinateSystem.hxx10
-rw-r--r--chart2/source/view/axes/VCartesianGrid.cxx31
-rw-r--r--chart2/source/view/axes/VCartesianGrid.hxx16
-rw-r--r--chart2/source/view/axes/VCoordinateSystem.cxx138
-rw-r--r--chart2/source/view/axes/VPolarAngleAxis.cxx25
-rw-r--r--chart2/source/view/axes/VPolarAxis.cxx4
-rw-r--r--chart2/source/view/axes/VPolarAxis.hxx5
-rw-r--r--chart2/source/view/axes/VPolarCoordinateSystem.cxx27
-rw-r--r--chart2/source/view/axes/VPolarCoordinateSystem.hxx10
-rw-r--r--chart2/source/view/axes/VPolarGrid.cxx14
-rw-r--r--chart2/source/view/axes/VPolarGrid.hxx14
-rw-r--r--chart2/source/view/axes/VPolarRadiusAxis.cxx1
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx106
-rw-r--r--chart2/source/view/charttypes/AreaChart.hxx6
-rw-r--r--chart2/source/view/charttypes/BarChart.cxx142
-rw-r--r--chart2/source/view/charttypes/BarChart.hxx22
-rw-r--r--chart2/source/view/charttypes/BarPositionHelper.cxx1
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx54
-rw-r--r--chart2/source/view/charttypes/BubbleChart.hxx2
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.cxx37
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.hxx6
-rw-r--r--chart2/source/view/charttypes/ConfigAccess.cxx74
-rw-r--r--chart2/source/view/charttypes/HistogramChart.cxx140
-rw-r--r--chart2/source/view/charttypes/HistogramChart.hxx44
-rw-r--r--chart2/source/view/charttypes/NetChart.cxx30
-rw-r--r--chart2/source/view/charttypes/NetChart.hxx6
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx1225
-rw-r--r--chart2/source/view/charttypes/PieChart.hxx187
-rw-r--r--chart2/source/view/charttypes/Splines.cxx89
-rw-r--r--chart2/source/view/charttypes/Splines.hxx1
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx640
-rw-r--r--chart2/source/view/diagram/VDiagram.cxx58
-rw-r--r--chart2/source/view/inc/DataTableView.hxx88
-rw-r--r--chart2/source/view/inc/LabelPositionHelper.hxx4
-rw-r--r--chart2/source/view/inc/LegendEntryProvider.hxx13
-rw-r--r--chart2/source/view/inc/MinimumAndMaximumSupplier.hxx8
-rw-r--r--chart2/source/view/inc/PlotterBase.hxx3
-rw-r--r--chart2/source/view/inc/PlottingPositionHelper.hxx22
-rw-r--r--chart2/source/view/inc/PolarLabelPositionHelper.hxx3
-rw-r--r--chart2/source/view/inc/PropertyMapper.hxx5
-rw-r--r--chart2/source/view/inc/ShapeFactory.hxx17
-rw-r--r--chart2/source/view/inc/VCoordinateSystem.hxx40
-rw-r--r--chart2/source/view/inc/VDataSeries.hxx53
-rw-r--r--chart2/source/view/inc/VDiagram.hxx17
-rw-r--r--chart2/source/view/inc/VLegendSymbolFactory.hxx3
-rw-r--r--chart2/source/view/inc/VSeriesPlotter.hxx46
-rw-r--r--chart2/source/view/main/AxisUsage.hxx143
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx366
-rw-r--r--chart2/source/view/main/ChartItemPool.hxx11
-rw-r--r--chart2/source/view/main/ChartView.cxx1666
-rw-r--r--chart2/source/view/main/Clipping.cxx3
-rw-r--r--chart2/source/view/main/DataTableView.cxx574
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx58
-rw-r--r--chart2/source/view/main/LabelPositionHelper.cxx25
-rw-r--r--chart2/source/view/main/PlotterBase.cxx1
-rw-r--r--chart2/source/view/main/PlottingPositionHelper.cxx14
-rw-r--r--chart2/source/view/main/PolarLabelPositionHelper.cxx16
-rw-r--r--chart2/source/view/main/PropertyMapper.cxx140
-rw-r--r--chart2/source/view/main/SeriesPlotterContainer.cxx776
-rw-r--r--chart2/source/view/main/SeriesPlotterContainer.hxx160
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx641
-rw-r--r--chart2/source/view/main/VButton.cxx35
-rw-r--r--chart2/source/view/main/VButton.hxx3
-rw-r--r--chart2/source/view/main/VDataSeries.cxx260
-rw-r--r--chart2/source/view/main/VLegend.cxx134
-rw-r--r--chart2/source/view/main/VLegend.hxx14
-rw-r--r--chart2/source/view/main/VLegendSymbolFactory.cxx4
-rw-r--r--chart2/source/view/main/VLineProperties.cxx14
-rw-r--r--chart2/source/view/main/VPolarTransformation.cxx1
-rw-r--r--chart2/source/view/main/VTitle.cxx18
-rw-r--r--chart2/source/view/main/VTitle.hxx8
-rw-r--r--chart2/uiconfig/menubar/menubar.xml8
-rw-r--r--chart2/uiconfig/toolbar/basicshapes.xml2
-rw-r--r--chart2/uiconfig/toolbar/toolbar.xml1
-rw-r--r--chart2/uiconfig/ui/3dviewdialog.ui43
-rw-r--r--chart2/uiconfig/ui/chardialog.ui133
-rw-r--r--chart2/uiconfig/ui/chartcolorpalettepopup.ui130
-rw-r--r--chart2/uiconfig/ui/charttypedialog.ui14
-rw-r--r--chart2/uiconfig/ui/dlg_InsertDataTable.ui215
-rw-r--r--chart2/uiconfig/ui/insertaxisdlg.ui117
-rw-r--r--chart2/uiconfig/ui/sidebaraxis.ui178
-rw-r--r--chart2/uiconfig/ui/sidebarcolors.ui57
-rw-r--r--chart2/uiconfig/ui/sidebarelements.ui902
-rw-r--r--chart2/uiconfig/ui/sidebarerrorbar.ui357
-rw-r--r--chart2/uiconfig/ui/sidebarseries.ui473
-rw-r--r--chart2/uiconfig/ui/sidebartype.ui595
-rw-r--r--chart2/uiconfig/ui/steppedlinesdlg.ui4
-rw-r--r--chart2/uiconfig/ui/tp_3D_SceneIllumination.ui8
-rw-r--r--chart2/uiconfig/ui/tp_AxisPositions.ui1
-rw-r--r--chart2/uiconfig/ui/tp_ChartColorPalette.ui112
-rw-r--r--chart2/uiconfig/ui/tp_ChartType.ui340
-rw-r--r--chart2/uiconfig/ui/tp_DataTable.ui115
-rw-r--r--chart2/uiconfig/ui/tp_SeriesToAxis.ui208
-rw-r--r--chart2/uiconfig/ui/tp_Trendline.ui2
-rw-r--r--chart2/uiconfig/ui/tp_axisLabel.ui2
736 files changed, 40957 insertions, 31085 deletions
diff --git a/chart2/CppunitTest_chart2_dump.mk b/chart2/CppunitTest_chart2_dump.mk
index 90c12ff039a8..c4ca069c12eb 100644
--- a/chart2/CppunitTest_chart2_dump.mk
+++ b/chart2/CppunitTest_chart2_dump.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_dump, \
sd \
sfx \
sot \
+ subsequenttest \
svl \
svt \
svx \
@@ -72,8 +73,7 @@ $(eval $(call gb_CppunitTest_use_vcl,chart2_dump))
$(eval $(call gb_CppunitTest_use_components,chart2_dump,\
basic/util/sb \
animations/source/animcore/animcore \
- chart2/source/controller/chartcontroller \
- chart2/source/chartcore \
+ chart2/source/chart2 \
comphelper/util/comphelp \
configmgr/source/configmgr \
embeddedobj/util/embobj \
@@ -95,7 +95,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_dump,\
sw/util/swd \
sw/util/msword \
sd/util/sd \
- sd/util/sdfilt \
sd/util/sdd \
$(call gb_Helper_optional,SCRIPTING, \
sc/util/vbaobj) \
@@ -110,6 +109,7 @@ $(eval $(call gb_CppunitTest_use_components,chart2_dump,\
svtools/util/svt \
svx/util/svx \
svx/util/svxcore \
+ sw/util/sw_writerfilter \
toolkit/util/tk \
vcl/vcl.common \
ucb/source/core/ucb1 \
@@ -119,7 +119,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_dump,\
unotools/util/utl \
unoxml/source/rdf/unordf \
unoxml/source/service/unoxml \
- writerfilter/util/writerfilter \
xmloff/util/xo \
))
diff --git a/chart2/CppunitTest_chart2_export3.mk b/chart2/CppunitTest_chart2_export3.mk
new file mode 100644
index 000000000000..3b3e2ed0b597
--- /dev/null
+++ b/chart2/CppunitTest_chart2_export3.mk
@@ -0,0 +1,14 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# 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/.
+#
+#*************************************************************************
+
+$(eval $(call chart2_export_test,3))
+
+# vim: set noet sw=4 ts=4:
diff --git a/chart2/CppunitTest_chart2_geometry.mk b/chart2/CppunitTest_chart2_geometry.mk
index f2467594abc3..314838571790 100644
--- a/chart2/CppunitTest_chart2_geometry.mk
+++ b/chart2/CppunitTest_chart2_geometry.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_geometry, \
sd \
sfx \
sot \
+ subsequenttest \
svl \
svt \
svx \
@@ -71,8 +72,7 @@ $(eval $(call gb_CppunitTest_use_vcl,chart2_geometry))
$(eval $(call gb_CppunitTest_use_components,chart2_geometry,\
basic/util/sb \
animations/source/animcore/animcore \
- chart2/source/controller/chartcontroller \
- chart2/source/chartcore \
+ chart2/source/chart2 \
comphelper/util/comphelp \
configmgr/source/configmgr \
dbaccess/util/dba \
@@ -99,7 +99,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_geometry,\
sw/util/swd \
sw/util/msword \
sd/util/sd \
- sd/util/sdfilt \
sd/util/sdd \
$(call gb_Helper_optional,SCRIPTING, \
sc/util/vbaobj) \
@@ -114,6 +113,7 @@ $(eval $(call gb_CppunitTest_use_components,chart2_geometry,\
svtools/util/svt \
svx/util/svx \
svx/util/svxcore \
+ sw/util/sw_writerfilter \
toolkit/util/tk \
vcl/vcl.common \
ucb/source/core/ucb1 \
@@ -123,7 +123,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_geometry,\
unoxml/source/rdf/unordf \
unoxml/source/service/unoxml \
uui/util/uui \
- writerfilter/util/writerfilter \
xmloff/util/xo \
xmlscript/util/xmlscript \
))
@@ -134,6 +133,10 @@ $(eval $(call gb_CppunitTest_use_uiconfigs,chart2_geometry, \
$(eval $(call gb_CppunitTest_use_configuration,chart2_geometry))
+$(eval $(call gb_CppunitTest_add_arguments,chart2_geometry, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
$(call gb_CppunitTest_get_target,chart2_geometry): $(call gb_Package_get_target,postprocess_images)
# vim: set noet sw=4 ts=4:
diff --git a/chart2/CppunitTest_chart2_pivot_chart_test.mk b/chart2/CppunitTest_chart2_pivot_chart_test.mk
index 4dc7dca420cb..1c4beda696cb 100644
--- a/chart2/CppunitTest_chart2_pivot_chart_test.mk
+++ b/chart2/CppunitTest_chart2_pivot_chart_test.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_pivot_chart_test, \
sd \
sfx \
sot \
+ subsequenttest \
svl \
svt \
svx \
@@ -70,8 +71,7 @@ $(eval $(call gb_CppunitTest_use_vcl,chart2_pivot_chart_test))
$(eval $(call gb_CppunitTest_use_components,chart2_pivot_chart_test,\
basic/util/sb \
animations/source/animcore/animcore \
- chart2/source/controller/chartcontroller \
- chart2/source/chartcore \
+ chart2/source/chart2 \
comphelper/util/comphelp \
configmgr/source/configmgr \
dbaccess/util/dba \
@@ -97,7 +97,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_pivot_chart_test,\
sw/util/swd \
sw/util/msword \
sd/util/sd \
- sd/util/sdfilt \
sd/util/sdd \
$(call gb_Helper_optional,SCRIPTING, \
sc/util/vbaobj) \
@@ -112,6 +111,7 @@ $(eval $(call gb_CppunitTest_use_components,chart2_pivot_chart_test,\
svtools/util/svt \
svx/util/svx \
svx/util/svxcore \
+ sw/util/sw_writerfilter \
toolkit/util/tk \
vcl/vcl.common \
ucb/source/core/ucb1 \
@@ -121,7 +121,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_pivot_chart_test,\
unoxml/source/rdf/unordf \
unoxml/source/service/unoxml \
uui/util/uui \
- writerfilter/util/writerfilter \
xmloff/util/xo \
xmlscript/util/xmlscript \
))
diff --git a/chart2/CppunitTest_chart2_trendcalculators.mk b/chart2/CppunitTest_chart2_trendcalculators.mk
index 2ef23fc9bf90..354c5a73d97a 100644
--- a/chart2/CppunitTest_chart2_trendcalculators.mk
+++ b/chart2/CppunitTest_chart2_trendcalculators.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_trendcalculators, \
sd \
sfx \
sot \
+ subsequenttest \
svl \
svt \
svx \
@@ -71,8 +72,7 @@ $(eval $(call gb_CppunitTest_use_vcl,chart2_trendcalculators))
$(eval $(call gb_CppunitTest_use_components,chart2_trendcalculators,\
basic/util/sb \
animations/source/animcore/animcore \
- chart2/source/controller/chartcontroller \
- chart2/source/chartcore \
+ chart2/source/chart2 \
comphelper/util/comphelp \
configmgr/source/configmgr \
embeddedobj/util/embobj \
@@ -97,7 +97,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_trendcalculators,\
sw/util/swd \
sw/util/msword \
sd/util/sd \
- sd/util/sdfilt \
sd/util/sdd \
$(call gb_Helper_optional,SCRIPTING, \
sc/util/vbaobj) \
@@ -112,6 +111,7 @@ $(eval $(call gb_CppunitTest_use_components,chart2_trendcalculators,\
svtools/util/svt \
svx/util/svx \
svx/util/svxcore \
+ sw/util/sw_writerfilter \
toolkit/util/tk \
vcl/vcl.common \
ucb/source/core/ucb1 \
@@ -121,7 +121,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_trendcalculators,\
unoxml/source/rdf/unordf \
unoxml/source/service/unoxml \
uui/util/uui \
- writerfilter/util/writerfilter \
xmloff/util/xo \
xmlscript/util/xmlscript \
))
diff --git a/chart2/CppunitTest_chart2_uichart.mk b/chart2/CppunitTest_chart2_uichart.mk
new file mode 100644
index 000000000000..9e464e0a7c6f
--- /dev/null
+++ b/chart2/CppunitTest_chart2_uichart.mk
@@ -0,0 +1,58 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# 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/.
+#
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,chart2_uichart))
+
+$(eval $(call gb_CppunitTest_use_externals,chart2_uichart, \
+ boost_headers \
+ libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,chart2_uichart, \
+ chart2/qa/extras/uichart \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,chart2_uichart, \
+ comphelper \
+ cppu \
+ cppuhelper \
+ i18nlangtag \
+ sal \
+ sc \
+ sfx \
+ subsequenttest \
+ svl \
+ svl \
+ svx \
+ svxcore \
+ test \
+ tl \
+ unotest \
+ utl \
+ vcl \
+))
+
+$(eval $(call gb_CppunitTest_set_include,chart2_uichart,\
+ -I$(SRCDIR)/chart2/qa/extras \
+ -I$(SRCDIR)/chart2/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,chart2_uichart))
+
+$(eval $(call gb_CppunitTest_use_ure,chart2_uichart))
+$(eval $(call gb_CppunitTest_use_vcl,chart2_uichart))
+
+$(eval $(call gb_CppunitTest_use_rdb,chart2_uichart,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,chart2_uichart))
+
+# vim: set noet sw=4 ts=4:
diff --git a/chart2/CppunitTest_chart2_xshape.mk b/chart2/CppunitTest_chart2_xshape.mk
index 4ea92462848e..3cbd65d1e73b 100644
--- a/chart2/CppunitTest_chart2_xshape.mk
+++ b/chart2/CppunitTest_chart2_xshape.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_xshape, \
sd \
sfx \
sot \
+ subsequenttest \
svl \
svt \
svx \
@@ -72,8 +73,7 @@ $(eval $(call gb_CppunitTest_use_vcl,chart2_xshape))
$(eval $(call gb_CppunitTest_use_components,chart2_xshape,\
basic/util/sb \
animations/source/animcore/animcore \
- chart2/source/controller/chartcontroller \
- chart2/source/chartcore \
+ chart2/source/chart2 \
comphelper/util/comphelp \
configmgr/source/configmgr \
embeddedobj/util/embobj \
@@ -95,7 +95,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_xshape,\
sw/util/swd \
sw/util/msword \
sd/util/sd \
- sd/util/sdfilt \
sd/util/sdd \
$(call gb_Helper_optional,SCRIPTING, \
sc/util/vbaobj) \
@@ -110,6 +109,7 @@ $(eval $(call gb_CppunitTest_use_components,chart2_xshape,\
svtools/util/svt \
svx/util/svx \
svx/util/svxcore \
+ sw/util/sw_writerfilter \
toolkit/util/tk \
vcl/vcl.common \
ucb/source/core/ucb1 \
@@ -119,7 +119,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_xshape,\
unotools/util/utl \
unoxml/source/rdf/unordf \
unoxml/source/service/unoxml \
- writerfilter/util/writerfilter \
xmloff/util/xo \
))
diff --git a/chart2/IwyuFilter_chart2.yaml b/chart2/IwyuFilter_chart2.yaml
index da282c91d93b..dfb7404558c2 100644
--- a/chart2/IwyuFilter_chart2.yaml
+++ b/chart2/IwyuFilter_chart2.yaml
@@ -73,9 +73,6 @@ excludelist:
- com/sun/star/chart2/data/XDataSink.hpp
- com/sun/star/chart2/data/XDataSource.hpp
- com/sun/star/lang/XServiceInfo.hpp
- chart2/source/inc/DiagramHelper.hxx:
- # # typedef in base class needs a complete type
- - com/sun/star/chart2/XChartTypeTemplate.hpp
chart2/source/inc/ErrorBar.hxx:
# base class has to be a complete type
- com/sun/star/beans/XPropertySet.hpp
@@ -143,7 +140,6 @@ excludelist:
- com/sun/star/util/XModifiable.hpp
chart2/source/inc/WeakListenerAdapter.hxx:
# base class has to be a complete type
- - com/sun/star/util/XModifyListener.hpp
- com/sun/star/view/XSelectionChangeListener.hpp
chart2/source/inc/WrappedProperty.hxx:
# Needed for implicit dtor
@@ -154,39 +150,6 @@ excludelist:
- com/sun/star/beans/XMultiPropertyStates.hpp
- com/sun/star/beans/XPropertySet.hpp
- com/sun/star/beans/XPropertyState.hpp
- chart2/source/model/inc/BaseCoordinateSystem.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XChartTypeContainer.hpp
- - com/sun/star/chart2/XCoordinateSystem.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
- chart2/source/model/inc/ChartTypeManager.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XChartTypeManager.hpp
- - com/sun/star/lang/XMultiServiceFactory.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- chart2/source/model/inc/DataSeries.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XDataSeries.hpp
- - com/sun/star/chart2/XRegressionCurveContainer.hpp
- - com/sun/star/chart2/data/XDataSink.hpp
- - com/sun/star/chart2/data/XDataSource.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
- chart2/source/model/inc/Diagram.hxx:
- # base class has to be a complete type
- - com/sun/star/chart/X3DDefaultSetter.hpp
- - com/sun/star/chart2/XCoordinateSystemContainer.hpp
- - com/sun/star/chart2/XDiagram.hpp
- - com/sun/star/chart2/XTitled.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
chart2/source/model/inc/StockBar.hxx:
# base class has to be a complete type
- com/sun/star/util/XCloneable.hpp
@@ -197,12 +160,14 @@ excludelist:
- com/sun/star/document/XExporter.hpp
- com/sun/star/document/XFilter.hpp
- com/sun/star/document/XImporter.hpp
- - com/sun/star/io/XActiveDataSource.hpp
- com/sun/star/lang/XMultiServiceFactory.hpp
- com/sun/star/lang/XServiceInfo.hpp
chart2/source/model/filter/XMLFilter.cxx:
# Actually used
- com/sun/star/lang/XMultiComponentFactory.hpp
+ chart2/source/model/main/ChartModel_Persistence.cxx:
+ # Needed for implicit dtor
+ - BaseCoordinateSystem.hxx
chart2/source/model/main/DataPoint.hxx:
# base class has to be a complete type
- com/sun/star/container/XChild.hpp
@@ -210,14 +175,6 @@ excludelist:
- com/sun/star/util/XCloneable.hpp
- com/sun/star/util/XModifyBroadcaster.hpp
- com/sun/star/util/XModifyListener.hpp
- chart2/source/model/main/Axis.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XAxis.hpp
- - com/sun/star/chart2/XTitled.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
chart2/source/model/main/Axis.cxx:
# Needed for template
- com/sun/star/awt/Size.hpp
@@ -230,26 +187,13 @@ excludelist:
- com/sun/star/chart2/RelativeSize.hpp
# Actually used
- com/sun/star/uno/XComponentContext.hpp
- chart2/source/model/main/FormattedString.hxx:
+ chart2/source/inc/FormattedString.hxx:
# base class has to be a complete type
- com/sun/star/chart2/XDataPointCustomLabelField.hpp
- com/sun/star/lang/XServiceInfo.hpp
- com/sun/star/util/XCloneable.hpp
- com/sun/star/util/XModifyBroadcaster.hpp
- com/sun/star/util/XModifyListener.hpp
- chart2/source/model/main/GridProperties.hxx:
- # base class has to be a complete type
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
- chart2/source/model/main/Legend.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XLegend.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
chart2/source/model/main/Legend.cxx:
# Needed for template
- com/sun/star/awt/Size.hpp
@@ -261,13 +205,6 @@ excludelist:
- com/sun/star/util/XCloneable.hpp
- com/sun/star/util/XModifyBroadcaster.hpp
- com/sun/star/util/XModifyListener.hpp
- chart2/source/model/main/Title.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XTitle.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
chart2/source/model/main/Title.cxx:
# Needed for template
- com/sun/star/awt/Size.hpp
@@ -281,22 +218,6 @@ excludelist:
- com/sun/star/util/XCloneable.hpp
- com/sun/star/util/XModifyBroadcaster.hpp
- com/sun/star/util/XModifyListener.hpp
- chart2/source/model/template/ChartType.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XChartType.hpp
- - com/sun/star/chart2/XDataSeriesContainer.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
- chart2/source/model/template/ChartTypeTemplate.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XChartTypeTemplate.hpp
- - com/sun/star/lang/XServiceName.hpp
- chart2/source/model/template/DataInterpreter.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XDataInterpreter.hpp
- - com/sun/star/lang/XServiceInfo.hpp
chart2/source/model/template/AreaChartTypeTemplate.cxx:
# Actually used
- com/sun/star/uno/XComponentContext.hpp
@@ -350,20 +271,18 @@ excludelist:
- com/sun/star/drawing/LineStyle.hpp
- com/sun/star/util/Color.hpp
- com/sun/star/drawing/LineJoint.hpp
+ chart2/source/tools/ExplicitCategoriesProvider.cxx:
+ # Needed for implicit dtor
+ - ChartType.hxx
chart2/source/tools/CharacterProperties.cxx:
# Actually used
- com/sun/star/beans/XMultiPropertySet.hpp
chart2/source/tools/DataSourceHelper.cxx:
# Actually used
- com/sun/star/chart2/data/XLabeledDataSequence.hpp
- chart2/source/tools/RegressionCurveModel.hxx:
- # base class has to be a complete type
- - com/sun/star/chart2/XRegressionCurve.hpp
- - com/sun/star/lang/XServiceInfo.hpp
- - com/sun/star/lang/XServiceName.hpp
- - com/sun/star/util/XCloneable.hpp
- - com/sun/star/util/XModifyBroadcaster.hpp
- - com/sun/star/util/XModifyListener.hpp
+ chart2/source/tools/InternalDataProvider.cxx:
+ # Needed for implicit dtor
+ - BaseCoordinateSystem.hxx
chart2/source/tools/LegendHelper.cxx:
# Actually used
- com/sun/star/uno/XComponentContext.hpp
@@ -388,12 +307,11 @@ excludelist:
- com/sun/star/drawing/XShape.hpp
# Actually used
- com/sun/star/view/XSelectionSupplier.hpp
- chart2/source/tools/ReferenceSizeProvider.cxx:
- # Actually used
- - com/sun/star/chart2/XTitle.hpp
chart2/source/tools/RegressionCurveHelper.cxx:
# Actually used
- com/sun/star/chart2/XRegressionCurveCalculator.hpp
+ # Needed for implicit dtor
+ - ChartType.hxx
chart2/source/tools/RegressionEquation.hxx:
# base class has to be a complete type
- com/sun/star/chart2/XTitle.hpp
@@ -421,9 +339,6 @@ excludelist:
chart2/source/tools/StatisticsHelper.cxx:
# Actually used
- com/sun/star/chart2/data/XDataProvider.hpp
- chart2/source/tools/UncachedDataSequence.cxx:
- # Actually used
- - com/sun/star/chart2/XInternalDataProvider.hpp
chart2/source/tools/UserDefinedProperties.cxx:
# Needs a complete type
- com/sun/star/beans/Property.hpp
@@ -432,10 +347,6 @@ excludelist:
chart2/source/tools/WrappedProperty.cxx:
# Actually used
- com/sun/star/beans/XPropertyState.hpp
- chart2/source/view/inc/3DChartObjects.hxx:
- # base class has to be a complete type
- - boost/shared_array.hpp
- - map
chart2/source/view/inc/VLineProperties.hxx:
# base class has to be a complete type
- com/sun/star/uno/Reference.h
@@ -444,55 +355,26 @@ excludelist:
- com/sun/star/chart2/XScaling.hpp
- com/sun/star/lang/XServiceInfo.hpp
- com/sun/star/lang/XServiceName.hpp
- chart2/source/view/axes/VAxisBase.cxx:
- # Needed for direct member access
- - com/sun/star/drawing/XShapes.hpp
- # Needed for implicit dtor
- - com/sun/star/chart2/XAxis.hpp
chart2/source/view/axes/VAxisProperties.cxx:
- # Actually used
- - com/sun/star/chart2/XAxis.hpp
# Needed for rtl::math::round
- rtl/math.hxx
- chart2/source/view/axes/VCartesianCoordinateSystem.cxx:
- # Actually used
- - com/sun/star/chart2/XCoordinateSystem.hpp
chart2/source/view/axes/VPolarAngleAxis.cxx:
# Needed for implicit dtor
- - com/sun/star/chart2/XAxis.hpp
- chart2/source/view/axes/VPolarCoordinateSystem.cxx:
- # Actually used
- - com/sun/star/chart2/XCoordinateSystem.hpp
- chart2/source/view/axes/VCartesianAxis.cxx:
+ - Axis.hxx
+ chart2/source/view/axes/VPolarRadiusAxis.cxx:
# Needed for implicit dtor
- - com/sun/star/chart2/XAxis.hpp
+ - Axis.hxx
chart2/source/view/axes/VCartesianGrid.hxx:
# base class has to be a complete type
- com/sun/star/beans/XPropertySet.hpp
- chart2/source/view/charttypes/Splines.cxx:
- # Actually used
- - com/sun/star/drawing/PolyPolygonShape3D.hpp
- chart2/source/view/charttypes/AreaChart.cxx:
- # Actually used
- - com/sun/star/drawing/XShapes.hpp
- chart2/source/view/charttypes/NetChart.cxx:
- # Actually used
- - com/sun/star/drawing/XShapes.hpp
- chart2/source/view/charttypes/BarChart.cxx:
- # comphelper::ScopeGuard being used
- - comphelper/scopeguard.hxx
+ chart2/source/view/diagram/VDiagram.cxx:
+ # Needed for implicit dtor
+ - ChartType.hxx
chart2/source/view/main/LabelPositionHelper.cxx:
# Actually used
- com/sun/star/beans/XPropertySet.hpp
- - com/sun/star/drawing/XShape.hpp
# Actually used
- rtl/math.hxx
- chart2/source/view/main/VButton.cxx:
- # Actually used
- - com/sun/star/lang/XMultiServiceFactory.hpp
- chart2/source/view/main/PlottingPositionHelper.cxx:
- # Actually used
- - com/sun/star/drawing/XShapes.hpp
chart2/source/view/main/PropertyMapper.cxx:
# Actually used
- com/sun/star/beans/XPropertySet.hpp
@@ -501,17 +383,12 @@ excludelist:
- com/sun/star/graphic/XGraphic.hpp
# Actually used
- com/sun/star/chart2/XFormattedString.hpp
- - com/sun/star/lang/XMultiServiceFactory.hpp
- chart2/source/view/main/ChartView.cxx:
- # comphelper::ScopeGuard being used
- - comphelper/scopeguard.hxx
chart2/source/view/main/VLineProperties.cxx:
# Actually used
- com/sun/star/beans/XPropertySet.hpp
chart2/source/view/main/VTitle.cxx:
# Actually used
- com/sun/star/chart2/XTitle.hpp
- - com/sun/star/drawing/XShape.hpp
chart2/source/controller/inc/AccessibleTextHelper.hxx:
# base class has to be a complete type
- com/sun/star/accessibility/XAccessibleContext.hpp
@@ -578,9 +455,6 @@ excludelist:
chart2/source/controller/inc/RangeSelectionListener.hxx:
# base class has to be a complete type
- com/sun/star/sheet/XRangeSelectionListener.hpp
- chart2/source/controller/accessibility/AccessibleBase.cxx:
- # Needed for template
- - com/sun/star/chart2/XChartDocument.hpp
chart2/source/controller/accessibility/AccessibleChartShape.hxx:
# base class has to be a complete type
- AccessibleBase.hxx
@@ -592,9 +466,6 @@ excludelist:
chart2/source/controller/accessibility/AccessibleChartView.cxx:
# Actually used
- com/sun/star/view/XSelectionSupplier.hpp
- chart2/source/controller/chartapiwrapper/AxisWrapper.cxx:
- # Needed for implicit dtor
- - com/sun/star/frame/XModel.hpp
chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx:
# Needed for rtl::math::round
- rtl/math.hxx
@@ -609,48 +480,34 @@ excludelist:
- com/sun/star/beans/XPropertySet.hpp
- com/sun/star/beans/XPropertyState.hpp
chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx:
- # Actually used
- - vector
- chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx:
# Needed for implicit dtor
- - com/sun/star/chart2/XAxis.hpp
+ - BaseCoordinateSystem.hxx
chart2/source/controller/dialogs/ChartTypeDialogController.cxx:
- # Actually used
- - com/sun/star/chart2/XChartDocument.hpp
- chart2/source/controller/dialogs/DataBrowser.cxx:
- # Needed for complex variable type
- - com/sun/star/chart2/XChartDocument.hpp
+ # Needed for implicit dtor
+ - DataSeries.hxx
+ - BaseCoordinateSystem.hxx
chart2/source/controller/dialogs/DialogModel.cxx:
- # Actually used
- - com/sun/star/uno/XComponentContext.hpp
- - com/sun/star/chart2/XChartDocument.hpp
- chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx:
- # Needed for complex variable type
- - com/sun/star/frame/XModel.hpp
+ # Needed for implicit dtor
+ - LabeledDataSequence.hxx
+ chart2/source/controller/dialogs/dlg_CreationWizard.cxx:
+ # Needed for implicit dtor
+ - ChartTypeTemplate.hxx
chart2/source/controller/dialogs/dlg_DataEditor.cxx:
# Needed for direct member access
- com/sun/star/awt/XWindow.hpp
- chart2/source/controller/dialogs/dlg_View3D.cxx:
+ chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx:
# Needed for implicit dtor
- - com/sun/star/chart2/XDiagram.hpp
- chart2/source/controller/dialogs/RangeSelectionHelper.cxx:
- # Actually used
- - com/sun/star/chart2/XChartDocument.hpp
- chart2/source/controller/dialogs/res_ErrorBar.cxx:
- # Actually used
- - com/sun/star/chart2/XChartDocument.hpp
+ - ChartType.hxx
chart2/source/controller/dialogs/tp_AxisPositions.cxx:
# Actually used
- rtl/math.hxx
chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx:
# Actually used
- com/sun/star/beans/XPropertySet.hpp
- chart2/source/controller/dialogs/tp_ChartType.cxx:
- # Actually used
- - com/sun/star/chart2/XChartDocument.hpp
chart2/source/controller/dialogs/tp_DataSource.cxx:
# Needed for implicit dtor
- - com/sun/star/frame/XModel.hpp
+ - ChartTypeTemplate.hxx
+ - LabeledDataSequence.hxx
chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx:
# Needed for rtl::math::round
- rtl/math.hxx
@@ -663,6 +520,9 @@ excludelist:
chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx:
# Needed for rtl::math::round
- rtl/math.hxx
+ chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx:
+ # Needed for implicit dtor
+ - RegressionCurveModel.hxx
chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx:
# Actually used
- com/sun/star/beans/XPropertySet.hpp
@@ -681,6 +541,9 @@ excludelist:
chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx:
# Needed for rtl::math::round
- rtl/math.hxx
+ # Needed for implicit dtor
+ - ChartType.hxx
+ - Diagram.hxx
chart2/source/controller/main/ChartModelClone.hxx:
# Needed for implicit dtor
- com/sun/star/uno/Any.hxx
@@ -694,17 +557,11 @@ excludelist:
chart2/source/controller/main/ChartFrameloader.cxx:
# Actually used
- com/sun/star/uno/XComponentContext.hpp
- chart2/source/controller/main/ChartDropTargetHelper.cxx:
- # Actually used
- - com/sun/star/chart2/XChartDocument.hpp
chart2/source/controller/main/CommandDispatch.hxx:
# base class has to be a complete type
- com/sun/star/frame/XDispatch.hpp
- com/sun/star/util/XModifyListener.hpp
- comphelper/interfacecontainer2.hxx
- chart2/source/controller/main/CommandDispatchContainer.cxx:
- # Actually used
- - com/sun/star/frame/XModel.hpp
chart2/source/controller/main/ControllerCommandDispatch.hxx:
# base class has to be a complete type
- CommandDispatch.hxx
@@ -712,30 +569,39 @@ excludelist:
chart2/source/controller/main/ElementSelector.hxx:
# base class has to be a complete type
- com/sun/star/lang/XServiceInfo.hpp
- chart2/source/controller/main/ObjectHierarchy.cxx:
- # Actually used
- - com/sun/star/awt/KeyEvent.hpp
chart2/source/controller/main/StatusBarCommandDispatch.hxx:
# base class has to be a complete type
- CommandDispatch.hxx
- com/sun/star/view/XSelectionChangeListener.hpp
- chart2/source/controller/main/ChartController_EditData.cxx:
- # Needed for member access
- - ChartWindow.hxx
+ chart2/source/controller/main/ChartController_Insert.cxx:
+ # Needed for implicit dtor
+ - Legend.hxx
chart2/source/controller/main/ChartController_Position.cxx:
- # Needed for member access
- - ChartWindow.hxx
+ # Needed for implicit dtor
+ - ChartModel.hxx
chart2/source/controller/main/ChartController_Properties.cxx:
- # Needed for member access
- - ChartWindow.hxx
+ # Needed for implicit dtor
+ - RegressionCurveModel.hxx
+ chart2/source/controller/main/ChartController_TextEdit.cxx:
+ # Needed for implicit dtor
+ - ChartModel.hxx
chart2/source/controller/main/ChartController_Tools.cxx:
# Needed for template
- com/sun/star/graphic/XGraphic.hpp
+ chart2/source/controller/main/ControllerCommandDispatch.cxx:
+ # Needed for implicit dtor
+ - Axis.hxx
+ chart2/source/controller/main/DragMethod_RotateDiagram.cxx:
+ # Needed for implicit dtor
+ - ChartType.hxx
chart2/source/controller/main/PositionAndSizeHelper.cxx:
# Actually used
- com/sun/star/awt/Rectangle.hpp
# Needed for implicit dtor
- - com/sun/star/chart2/XDiagram.hpp
+ - Diagram.hxx
+ chart2/source/controller/main/SelectionHelper.cxx:
+ # Needed for implicit dtor
+ - Diagram.hxx
chart2/source/controller/main/StatusBarCommandDispatch.cxx:
# Actually used
- com/sun/star/view/XSelectionSupplier.hpp
@@ -749,6 +615,9 @@ excludelist:
# base class has to be a complete type
- com/sun/star/ui/XUIElementFactory.hpp
- com/sun/star/lang/XServiceInfo.hpp
+ chart2/source/controller/sidebar/ChartSeriesPanel.cxx:
+ # Needed for implicit dtor
+ - RegressionCurveModel.hxx
chart2/source/controller/sidebar/ChartSidebarModifyListener.hxx:
# base class has to be a complete type
- com/sun/star/util/XModifyListener.hpp
@@ -858,6 +727,6 @@ excludelist:
chart2/source/controller/chartapiwrapper/WrappedStockProperties.hxx:
# Needed for css namespace shortcut
- sal/types.h
- chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx:
- # Needed for compound type declaration
- - com/sun/star/chart2/XAxis.hpp
+ chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx:
+ # Needed for implicit dtor
+ - RegressionCurveModel.hxx
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chart2.mk
index b7c449cef582..ebc93b1148c8 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chart2.mk
@@ -7,36 +7,43 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-$(eval $(call gb_Library_Library,chartcontroller))
+$(eval $(call gb_Library_Library,chart2))
-$(eval $(call gb_Library_set_include,chartcontroller,\
+$(eval $(call gb_Library_set_include,chart2,\
$$(INCLUDE) \
-I$(SRCDIR)/chart2/source/controller/inc \
+ -I$(SRCDIR)/chart2/source/model/inc \
+ -I$(SRCDIR)/chart2/source/view/inc \
-I$(SRCDIR)/chart2/source/inc \
-I$(SRCDIR)/chart2/inc \
))
-$(eval $(call gb_Library_set_precompiled_header,chartcontroller,chart2/inc/pch/precompiled_chartcontroller))
+$(eval $(call gb_Library_set_precompiled_header,chart2,chart2/inc/pch/precompiled_chart2))
+
+$(eval $(call gb_Library_use_externals,chart2,\
+ boost_headers \
+ libxml2 \
+))
-$(eval $(call gb_Library_use_external,chartcontroller,boost_headers))
-$(eval $(call gb_Library_use_sdk_api,chartcontroller))
+$(eval $(call gb_Library_use_sdk_api,chart2))
-$(eval $(call gb_Library_use_custom_headers,chartcontroller,\
+$(eval $(call gb_Library_use_custom_headers,chart2,\
officecfg/registry \
))
-$(eval $(call gb_Library_use_libraries,chartcontroller,\
+$(eval $(call gb_Library_use_libraries,chart2,\
basegfx \
- chartcore \
comphelper \
cppu \
cppuhelper \
drawinglayer \
+ docmodel \
editeng \
+ fwk \
sal \
salhelper \
- i18nlangtag \
+ i18nlangtag \
sfx \
sot \
svl \
@@ -50,10 +57,10 @@ $(eval $(call gb_Library_use_libraries,chartcontroller,\
vcl \
))
-$(eval $(call gb_Library_set_componentfile,chartcontroller,chart2/source/controller/chartcontroller,services))
+$(eval $(call gb_Library_set_componentfile,chart2,chart2/source/chart2,services))
ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
-$(eval $(call gb_Library_add_exception_objects,chartcontroller,\
+$(eval $(call gb_Library_add_exception_objects,chart2,\
chart2/source/controller/accessibility/AccessibleBase \
chart2/source/controller/accessibility/AccessibleChartElement \
chart2/source/controller/accessibility/AccessibleChartShape \
@@ -64,7 +71,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
))
endif
-$(eval $(call gb_Library_add_exception_objects,chartcontroller,\
+$(eval $(call gb_Library_add_exception_objects,chart2,\
chart2/source/controller/chartapiwrapper/AreaWrapper \
chart2/source/controller/chartapiwrapper/AxisWrapper \
chart2/source/controller/chartapiwrapper/Chart2ModelContact \
@@ -99,8 +106,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/dialogs/ChartResourceGroups \
chart2/source/controller/dialogs/ChartTypeDialogController \
chart2/source/controller/dialogs/DataBrowser \
- chart2/source/controller/dialogs/DataBrowserModel \
- chart2/source/controller/dialogs/DialogModel \
chart2/source/controller/dialogs/dlg_ChartType \
chart2/source/controller/dialogs/dlg_ChartType_UNO \
chart2/source/controller/dialogs/dlg_CreationWizard \
@@ -109,6 +114,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/dialogs/dlg_DataSource \
chart2/source/controller/dialogs/dlg_InsertAxis_Grid \
chart2/source/controller/dialogs/dlg_InsertDataLabel \
+ chart2/source/controller/dialogs/dlg_InsertDataTable \
chart2/source/controller/dialogs/dlg_InsertErrorBars \
chart2/source/controller/dialogs/dlg_InsertLegend \
chart2/source/controller/dialogs/dlg_InsertTitle \
@@ -118,26 +124,26 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/dialogs/dlg_ShapeParagraph \
chart2/source/controller/dialogs/dlg_View3D \
chart2/source/controller/dialogs/ObjectNameProvider \
- chart2/source/controller/dialogs/RangeSelectionHelper \
- chart2/source/controller/dialogs/RangeSelectionListener \
chart2/source/controller/dialogs/res_BarGeometry \
chart2/source/controller/dialogs/res_DataLabel \
+ chart2/source/controller/dialogs/res_DataTableProperties \
chart2/source/controller/dialogs/res_ErrorBar \
chart2/source/controller/dialogs/res_LegendPosition \
chart2/source/controller/dialogs/res_Titles \
chart2/source/controller/dialogs/res_Trendline \
chart2/source/controller/dialogs/TextDirectionListBox \
- chart2/source/controller/dialogs/TimerTriggeredControllerLock \
chart2/source/controller/dialogs/TitleDialogData \
chart2/source/controller/dialogs/tp_3D_SceneAppearance \
chart2/source/controller/dialogs/tp_3D_SceneGeometry \
chart2/source/controller/dialogs/tp_3D_SceneIllumination \
chart2/source/controller/dialogs/tp_AxisLabel \
chart2/source/controller/dialogs/tp_AxisPositions \
+ chart2/source/controller/dialogs/tp_ChartColorPalette \
chart2/source/controller/dialogs/tp_ChartType \
chart2/source/controller/dialogs/tp_DataLabel \
chart2/source/controller/dialogs/tp_DataPointOption \
chart2/source/controller/dialogs/tp_DataSource \
+ chart2/source/controller/dialogs/tp_DataTable \
chart2/source/controller/dialogs/tp_ErrorBars \
chart2/source/controller/dialogs/tp_LegendPosition \
chart2/source/controller/dialogs/tp_PointGeometry \
@@ -153,6 +159,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/itemsetwrapper/AxisItemConverter \
chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter \
chart2/source/controller/itemsetwrapper/DataPointItemConverter \
+ chart2/source/controller/itemsetwrapper/DataTableItemConverter \
chart2/source/controller/itemsetwrapper/ErrorBarItemConverter \
chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter \
chart2/source/controller/itemsetwrapper/ItemConverter \
@@ -180,7 +187,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/main/ChartWindow \
chart2/source/controller/main/CommandDispatchContainer \
chart2/source/controller/main/CommandDispatch \
- chart2/source/controller/main/ConfigurationAccess \
chart2/source/controller/main/ControllerCommandDispatch \
chart2/source/controller/main/DragMethod_Base \
chart2/source/controller/main/DragMethod_PieSegment \
@@ -199,6 +205,8 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/main/UndoGuard \
chart2/source/controller/sidebar/Chart2PanelFactory \
chart2/source/controller/sidebar/ChartAreaPanel \
+ chart2/source/controller/sidebar/ChartColorsPanel \
+ chart2/source/controller/sidebar/ChartColorPaletteControl \
chart2/source/controller/sidebar/ChartAxisPanel \
chart2/source/controller/sidebar/ChartColorWrapper \
chart2/source/controller/sidebar/ChartElementsPanel \
@@ -211,4 +219,195 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/uitest/uiobject \
))
+# view pieces ...
+$(eval $(call gb_Library_add_exception_objects,chart2,\
+ chart2/source/controller/dialogs/DataBrowserModel \
+ chart2/source/controller/dialogs/DialogModel \
+ chart2/source/controller/dialogs/RangeSelectionHelper \
+ chart2/source/controller/dialogs/RangeSelectionListener \
+ chart2/source/controller/dialogs/TimerTriggeredControllerLock \
+ chart2/source/view/axes/DateHelper \
+ chart2/source/view/axes/DateScaling \
+ chart2/source/view/axes/MinimumAndMaximumSupplier \
+ chart2/source/view/axes/ScaleAutomatism \
+ chart2/source/view/axes/Tickmarks \
+ chart2/source/view/axes/Tickmarks_Dates \
+ chart2/source/view/axes/Tickmarks_Equidistant \
+ chart2/source/view/axes/VAxisBase \
+ chart2/source/view/axes/VAxisOrGridBase \
+ chart2/source/view/axes/VAxisProperties \
+ chart2/source/view/axes/VCartesianAxis \
+ chart2/source/view/axes/VCartesianCoordinateSystem \
+ chart2/source/view/axes/VCartesianGrid \
+ chart2/source/view/axes/VCoordinateSystem \
+ chart2/source/view/axes/VPolarAngleAxis \
+ chart2/source/view/axes/VPolarAxis \
+ chart2/source/view/axes/VPolarCoordinateSystem \
+ chart2/source/view/axes/VPolarGrid \
+ chart2/source/view/axes/VPolarRadiusAxis \
+ chart2/source/view/charttypes/AreaChart \
+ chart2/source/view/charttypes/BarChart \
+ chart2/source/view/charttypes/BarPositionHelper \
+ chart2/source/view/charttypes/BubbleChart \
+ chart2/source/view/charttypes/CandleStickChart \
+ chart2/source/view/charttypes/CategoryPositionHelper \
+ chart2/source/view/charttypes/HistogramChart \
+ chart2/source/view/charttypes/NetChart \
+ chart2/source/view/charttypes/PieChart \
+ chart2/source/view/charttypes/Splines \
+ chart2/source/view/charttypes/VSeriesPlotter \
+ chart2/source/view/diagram/VDiagram \
+ chart2/source/view/main/ChartItemPool \
+ chart2/source/view/main/ChartView \
+ chart2/source/view/main/Clipping \
+ chart2/source/view/main/DataPointSymbolSupplier \
+ chart2/source/view/main/DataTableView \
+ chart2/source/view/main/DrawModelWrapper \
+ chart2/source/view/main/LabelPositionHelper \
+ chart2/source/view/main/Linear3DTransformation \
+ chart2/source/view/main/PlotterBase \
+ chart2/source/view/main/PlottingPositionHelper \
+ chart2/source/view/main/PolarLabelPositionHelper \
+ chart2/source/view/main/PropertyMapper \
+ chart2/source/view/main/SeriesPlotterContainer \
+ chart2/source/view/main/ShapeFactory \
+ chart2/source/view/main/Stripe \
+ chart2/source/view/main/VDataSeries \
+ chart2/source/view/main/VLegend \
+ chart2/source/view/main/VLegendSymbolFactory \
+ chart2/source/view/main/VLineProperties \
+ chart2/source/view/main/VPolarTransformation \
+ chart2/source/view/main/VTitle \
+ chart2/source/view/main/VButton \
+))
+
+# model pieces ...
+$(eval $(call gb_Library_add_exception_objects,chart2,\
+ chart2/source/model/filter/XMLFilter \
+ chart2/source/model/main/Axis \
+ chart2/source/model/main/BaseCoordinateSystem \
+ chart2/source/model/main/CartesianCoordinateSystem \
+ chart2/source/model/main/ChartModel \
+ chart2/source/model/main/ChartModel_Persistence \
+ chart2/source/model/main/DataPoint \
+ chart2/source/model/main/DataPointProperties \
+ chart2/source/model/main/DataSeries \
+ chart2/source/model/main/DataSeriesProperties \
+ chart2/source/model/main/DataTable \
+ chart2/source/model/main/Diagram \
+ chart2/source/model/main/FormattedString \
+ chart2/source/model/main/GridProperties \
+ chart2/source/model/main/Legend \
+ chart2/source/model/main/PageBackground \
+ chart2/source/model/main/PolarCoordinateSystem \
+ chart2/source/model/main/StockBar \
+ chart2/source/model/main/Title \
+ chart2/source/model/main/UndoManager \
+ chart2/source/model/main/Wall \
+ chart2/source/model/template/AreaChartType \
+ chart2/source/model/template/AreaChartTypeTemplate \
+ chart2/source/model/template/BarChartType \
+ chart2/source/model/template/BarChartTypeTemplate \
+ chart2/source/model/template/BubbleChartType \
+ chart2/source/model/template/BubbleChartTypeTemplate \
+ chart2/source/model/template/BubbleDataInterpreter \
+ chart2/source/model/template/CandleStickChartType \
+ chart2/source/model/template/ChartType \
+ chart2/source/model/template/ChartTypeManager \
+ chart2/source/model/template/ChartTypeTemplate \
+ chart2/source/model/template/ColumnChartType \
+ chart2/source/model/template/ColumnLineChartTypeTemplate \
+ chart2/source/model/template/ColumnLineDataInterpreter \
+ chart2/source/model/template/DataInterpreter \
+ chart2/source/model/template/FilledNetChartType \
+ chart2/source/model/template/FunnelChartType \
+ chart2/source/model/template/FunnelChartTypeTemplate \
+ chart2/source/model/template/HistogramChartType \
+ chart2/source/model/template/HistogramChartTypeTemplate \
+ chart2/source/model/template/HistogramDataInterpreter \
+ chart2/source/model/template/HistogramCalculator \
+ chart2/source/model/template/LineChartType \
+ chart2/source/model/template/LineChartTypeTemplate \
+ chart2/source/model/template/NetChartType \
+ chart2/source/model/template/NetChartTypeTemplate \
+ chart2/source/model/template/PieChartType \
+ chart2/source/model/template/PieChartTypeTemplate \
+ chart2/source/model/template/ScatterChartType \
+ chart2/source/model/template/ScatterChartTypeTemplate \
+ chart2/source/model/template/StockChartTypeTemplate \
+ chart2/source/model/template/StockDataInterpreter \
+ chart2/source/model/template/XYDataInterpreter \
+))
+
+# tools pieces
+$(eval $(call gb_Library_add_exception_objects,chart2,\
+ chart2/source/tools/AxisHelper \
+ chart2/source/tools/BaseColorScheme \
+ chart2/source/tools/BaseGFXHelper \
+ chart2/source/tools/CachedDataSequence \
+ chart2/source/tools/CharacterProperties \
+ chart2/source/tools/ChartColorPalettes \
+ chart2/source/tools/ChartColorPaletteHelper \
+ chart2/source/tools/ChartColorScheme \
+ chart2/source/tools/ChartTypeHelper \
+ chart2/source/tools/ChartViewHelper \
+ chart2/source/tools/CommonConverters \
+ chart2/source/tools/ConfigColorScheme \
+ chart2/source/tools/ControllerLockGuard \
+ chart2/source/tools/DataSeriesHelper \
+ chart2/source/tools/DataSource \
+ chart2/source/tools/DataSourceHelper \
+ chart2/source/tools/DiagramHelper \
+ chart2/source/tools/ErrorBar \
+ chart2/source/tools/ExplicitCategoriesProvider \
+ chart2/source/tools/ExponentialRegressionCurveCalculator \
+ chart2/source/tools/FillProperties \
+ chart2/source/tools/FormattedStringHelper \
+ chart2/source/tools/HistogramDataSequence \
+ chart2/source/tools/InternalData \
+ chart2/source/tools/InternalDataProvider \
+ chart2/source/tools/LabeledDataSequence \
+ chart2/source/tools/LegendHelper \
+ chart2/source/tools/LifeTime \
+ chart2/source/tools/LinearRegressionCurveCalculator \
+ chart2/source/tools/LinePropertiesHelper \
+ chart2/source/tools/LogarithmicRegressionCurveCalculator \
+ chart2/source/tools/MeanValueRegressionCurveCalculator \
+ chart2/source/tools/MediaDescriptorHelper \
+ chart2/source/tools/ModifyListenerCallBack \
+ chart2/source/tools/ModifyListenerHelper \
+ chart2/source/tools/MovingAverageRegressionCurveCalculator \
+ chart2/source/tools/NameContainer \
+ chart2/source/tools/NumberFormatterWrapper \
+ chart2/source/tools/ObjectIdentifier \
+ chart2/source/tools/OPropertySet \
+ chart2/source/tools/PolynomialRegressionCurveCalculator \
+ chart2/source/tools/PopupRequest \
+ chart2/source/tools/PotentialRegressionCurveCalculator \
+ chart2/source/tools/PropertyHelper \
+ chart2/source/tools/RangeHighlighter \
+ chart2/source/tools/ReferenceSizeProvider \
+ chart2/source/tools/RegressionCurveCalculator \
+ chart2/source/tools/RegressionCurveHelper \
+ chart2/source/tools/RegressionCurveModel \
+ chart2/source/tools/RegressionEquation \
+ chart2/source/tools/RelativePositionHelper \
+ chart2/source/tools/RelativeSizeHelper \
+ chart2/source/tools/ResId \
+ chart2/source/tools/Scaling \
+ chart2/source/tools/SceneProperties \
+ chart2/source/tools/StatisticsHelper \
+ chart2/source/tools/ThreeDHelper \
+ chart2/source/tools/TitleHelper \
+ chart2/source/tools/UncachedDataSequence \
+ chart2/source/tools/UserDefinedProperties \
+ chart2/source/tools/WeakListenerAdapter \
+ chart2/source/tools/WrappedDefaultProperty \
+ chart2/source/tools/WrappedDirectStateProperty \
+ chart2/source/tools/WrappedIgnoreProperty \
+ chart2/source/tools/WrappedProperty \
+ chart2/source/tools/WrappedPropertySet \
+ chart2/source/tools/XMLRangeHelper \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
deleted file mode 100644
index a9a23159b436..000000000000
--- a/chart2/Library_chartcore.mk
+++ /dev/null
@@ -1,238 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# 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/.
-#
-
-$(eval $(call gb_Library_Library,chartcore))
-
-$(eval $(call gb_Library_set_include,chartcore,\
- $$(INCLUDE) \
- -I$(SRCDIR)/chart2/source/model/inc \
- -I$(SRCDIR)/chart2/source/view/inc \
- -I$(SRCDIR)/chart2/source/inc \
- -I$(SRCDIR)/chart2/inc \
-))
-
-# not ideal - we should use a single core define ideally
-$(eval $(call gb_Library_add_defs,chartcore,\
- -DOOO_DLLIMPLEMENTATION_CHARTTOOLS \
- -DOOO_DLLIMPLEMENTATION_CHARTVIEW \
-))
-
-$(eval $(call gb_Library_set_precompiled_header,chartcore,chart2/inc/pch/precompiled_chartcore))
-
-$(eval $(call gb_Library_use_externals,chartcore,\
- boost_headers \
- epoxy \
- libxml2 \
-))
-
-$(eval $(call gb_Library_use_custom_headers,chartcore,\
- officecfg/registry \
-))
-
-$(eval $(call gb_Library_use_sdk_api,chartcore))
-
-$(eval $(call gb_Library_use_libraries,chartcore,\
- basegfx \
- comphelper \
- cppu \
- cppuhelper \
- drawinglayer \
- editeng \
- fwk \
- i18nlangtag \
- sal \
- salhelper \
- sfx \
- svl \
- svt \
- svxcore \
- tl \
- ucbhelper \
- utl \
- vcl \
-))
-
-$(eval $(call gb_Library_set_componentfile,chartcore,chart2/source/chartcore,services))
-
-# view pieces ...
-$(eval $(call gb_Library_add_exception_objects,chartcore,\
- chart2/source/view/axes/DateHelper \
- chart2/source/view/axes/DateScaling \
- chart2/source/view/axes/MinimumAndMaximumSupplier \
- chart2/source/view/axes/ScaleAutomatism \
- chart2/source/view/axes/Tickmarks \
- chart2/source/view/axes/Tickmarks_Dates \
- chart2/source/view/axes/Tickmarks_Equidistant \
- chart2/source/view/axes/VAxisBase \
- chart2/source/view/axes/VAxisOrGridBase \
- chart2/source/view/axes/VAxisProperties \
- chart2/source/view/axes/VCartesianAxis \
- chart2/source/view/axes/VCartesianCoordinateSystem \
- chart2/source/view/axes/VCartesianGrid \
- chart2/source/view/axes/VCoordinateSystem \
- chart2/source/view/axes/VPolarAngleAxis \
- chart2/source/view/axes/VPolarAxis \
- chart2/source/view/axes/VPolarCoordinateSystem \
- chart2/source/view/axes/VPolarGrid \
- chart2/source/view/axes/VPolarRadiusAxis \
- chart2/source/view/charttypes/AreaChart \
- chart2/source/view/charttypes/BarChart \
- chart2/source/view/charttypes/BarPositionHelper \
- chart2/source/view/charttypes/BubbleChart \
- chart2/source/view/charttypes/CandleStickChart \
- chart2/source/view/charttypes/CategoryPositionHelper \
- chart2/source/view/charttypes/ConfigAccess \
- chart2/source/view/charttypes/NetChart \
- chart2/source/view/charttypes/PieChart \
- chart2/source/view/charttypes/Splines \
- chart2/source/view/charttypes/VSeriesPlotter \
- chart2/source/view/diagram/VDiagram \
- chart2/source/view/main/ChartItemPool \
- chart2/source/view/main/ChartView \
- chart2/source/view/main/Clipping \
- chart2/source/view/main/DataPointSymbolSupplier \
- chart2/source/view/main/DrawModelWrapper \
- chart2/source/view/main/LabelPositionHelper \
- chart2/source/view/main/Linear3DTransformation \
- chart2/source/view/main/PlotterBase \
- chart2/source/view/main/PlottingPositionHelper \
- chart2/source/view/main/PolarLabelPositionHelper \
- chart2/source/view/main/PropertyMapper \
- chart2/source/view/main/ShapeFactory \
- chart2/source/view/main/Stripe \
- chart2/source/view/main/VDataSeries \
- chart2/source/view/main/VLegend \
- chart2/source/view/main/VLegendSymbolFactory \
- chart2/source/view/main/VLineProperties \
- chart2/source/view/main/VPolarTransformation \
- chart2/source/view/main/VTitle \
- chart2/source/view/main/VButton \
-))
-
-# model pieces ...
-$(eval $(call gb_Library_add_exception_objects,chartcore,\
- chart2/source/model/filter/XMLFilter \
- chart2/source/model/main/Axis \
- chart2/source/model/main/BaseCoordinateSystem \
- chart2/source/model/main/CartesianCoordinateSystem \
- chart2/source/model/main/ChartModel \
- chart2/source/model/main/ChartModel_Persistence \
- chart2/source/model/main/DataPoint \
- chart2/source/model/main/DataPointProperties \
- chart2/source/model/main/DataSeries \
- chart2/source/model/main/DataSeriesProperties \
- chart2/source/model/main/Diagram \
- chart2/source/model/main/FormattedString \
- chart2/source/model/main/GridProperties \
- chart2/source/model/main/Legend \
- chart2/source/model/main/PageBackground \
- chart2/source/model/main/PolarCoordinateSystem \
- chart2/source/model/main/StockBar \
- chart2/source/model/main/Title \
- chart2/source/model/main/UndoManager \
- chart2/source/model/main/Wall \
- chart2/source/model/template/AreaChartType \
- chart2/source/model/template/AreaChartTypeTemplate \
- chart2/source/model/template/BarChartType \
- chart2/source/model/template/BarChartTypeTemplate \
- chart2/source/model/template/BubbleChartType \
- chart2/source/model/template/BubbleChartTypeTemplate \
- chart2/source/model/template/BubbleDataInterpreter \
- chart2/source/model/template/CandleStickChartType \
- chart2/source/model/template/ChartType \
- chart2/source/model/template/ChartTypeManager \
- chart2/source/model/template/ChartTypeTemplate \
- chart2/source/model/template/ColumnChartType \
- chart2/source/model/template/ColumnLineChartTypeTemplate \
- chart2/source/model/template/ColumnLineDataInterpreter \
- chart2/source/model/template/DataInterpreter \
- chart2/source/model/template/FilledNetChartType \
- chart2/source/model/template/LineChartType \
- chart2/source/model/template/LineChartTypeTemplate \
- chart2/source/model/template/NetChartType \
- chart2/source/model/template/NetChartTypeTemplate \
- chart2/source/model/template/PieChartType \
- chart2/source/model/template/PieChartTypeTemplate \
- chart2/source/model/template/ScatterChartType \
- chart2/source/model/template/ScatterChartTypeTemplate \
- chart2/source/model/template/StockChartTypeTemplate \
- chart2/source/model/template/StockDataInterpreter \
- chart2/source/model/template/XYDataInterpreter \
-))
-
-# tools pieces
-$(eval $(call gb_Library_add_exception_objects,chartcore,\
- chart2/source/tools/AxisHelper \
- chart2/source/tools/BaseGFXHelper \
- chart2/source/tools/CachedDataSequence \
- chart2/source/tools/CharacterProperties \
- chart2/source/tools/ChartModelHelper \
- chart2/source/tools/ChartTypeHelper \
- chart2/source/tools/ChartViewHelper \
- chart2/source/tools/ColorPerPointHelper \
- chart2/source/tools/CommonConverters \
- chart2/source/tools/ConfigColorScheme \
- chart2/source/tools/ControllerLockGuard \
- chart2/source/tools/DataSeriesHelper \
- chart2/source/tools/DataSource \
- chart2/source/tools/DataSourceHelper \
- chart2/source/tools/DiagramHelper \
- chart2/source/tools/ErrorBar \
- chart2/source/tools/ExplicitCategoriesProvider \
- chart2/source/tools/ExponentialRegressionCurveCalculator \
- chart2/source/tools/FillProperties \
- chart2/source/tools/FormattedStringHelper \
- chart2/source/tools/InternalData \
- chart2/source/tools/InternalDataProvider \
- chart2/source/tools/LabeledDataSequence \
- chart2/source/tools/LegendHelper \
- chart2/source/tools/LifeTime \
- chart2/source/tools/LinearRegressionCurveCalculator \
- chart2/source/tools/LinePropertiesHelper \
- chart2/source/tools/LogarithmicRegressionCurveCalculator \
- chart2/source/tools/MeanValueRegressionCurveCalculator \
- chart2/source/tools/MediaDescriptorHelper \
- chart2/source/tools/ModifyListenerCallBack \
- chart2/source/tools/ModifyListenerHelper \
- chart2/source/tools/MovingAverageRegressionCurveCalculator \
- chart2/source/tools/NameContainer \
- chart2/source/tools/NumberFormatterWrapper \
- chart2/source/tools/ObjectIdentifier \
- chart2/source/tools/OPropertySet \
- chart2/source/tools/PolynomialRegressionCurveCalculator \
- chart2/source/tools/PopupRequest \
- chart2/source/tools/PotentialRegressionCurveCalculator \
- chart2/source/tools/PropertyHelper \
- chart2/source/tools/RangeHighlighter \
- chart2/source/tools/ReferenceSizeProvider \
- chart2/source/tools/RegressionCurveCalculator \
- chart2/source/tools/RegressionCurveHelper \
- chart2/source/tools/RegressionCurveModel \
- chart2/source/tools/RegressionEquation \
- chart2/source/tools/RelativePositionHelper \
- chart2/source/tools/RelativeSizeHelper \
- chart2/source/tools/ResId \
- chart2/source/tools/Scaling \
- chart2/source/tools/SceneProperties \
- chart2/source/tools/StatisticsHelper \
- chart2/source/tools/ThreeDHelper \
- chart2/source/tools/TitleHelper \
- chart2/source/tools/TrueGuard \
- chart2/source/tools/UncachedDataSequence \
- chart2/source/tools/UserDefinedProperties \
- chart2/source/tools/WeakListenerAdapter \
- chart2/source/tools/WrappedDefaultProperty \
- chart2/source/tools/WrappedDirectStateProperty \
- chart2/source/tools/WrappedIgnoreProperty \
- chart2/source/tools/WrappedProperty \
- chart2/source/tools/WrappedPropertySet \
- chart2/source/tools/XMLRangeHelper \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/chart2/Module_chart2.mk b/chart2/Module_chart2.mk
index 94cba43344fa..e0aa69e3b097 100644
--- a/chart2/Module_chart2.mk
+++ b/chart2/Module_chart2.mk
@@ -13,8 +13,7 @@ include $(SRCDIR)/chart2/export_setup.mk
$(eval $(call gb_Module_Module,chart2))
$(eval $(call gb_Module_add_targets,chart2,\
- Library_chartcontroller \
- Library_chartcore \
+ Library_chart2 \
UIConfig_chart2 \
))
@@ -30,21 +29,21 @@ $(eval $(call gb_Module_add_check_targets,chart2,\
$(eval $(call gb_Module_add_slowcheck_targets,chart2,\
CppunitTest_chart2_export \
CppunitTest_chart2_export2 \
+ CppunitTest_chart2_export3 \
CppunitTest_chart2_import \
CppunitTest_chart2_import2 \
CppunitTest_chart2_trendcalculators \
CppunitTest_chart2_dump \
CppunitTest_chart2_pivot_chart_test \
CppunitTest_chart2_geometry \
+ CppunitTest_chart2_uichart \
))
-ifeq ($(ENABLE_CHART_TESTS),TRUE)
ifeq ($(WITH_FONTS), TRUE)
$(eval $(call gb_Module_add_slowcheck_targets,chart2,\
CppunitTest_chart2_xshape \
))
endif
-endif
$(eval $(call gb_Module_add_subsequentcheck_targets,chart2,\
JunitTest_chart2_unoapi \
diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk
index 67d64b18b597..722faf0d8580 100644
--- a/chart2/UIConfig_chart2.mk
+++ b/chart2/UIConfig_chart2.mk
@@ -37,6 +37,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/schart,\
$(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/3dviewdialog \
chart2/uiconfig/ui/attributedialog \
+ chart2/uiconfig/ui/chartcolorpalettepopup \
chart2/uiconfig/ui/chardialog \
chart2/uiconfig/ui/chartdatadialog \
chart2/uiconfig/ui/charttypedialog \
@@ -44,13 +45,16 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/combobox \
chart2/uiconfig/ui/datarangedialog \
chart2/uiconfig/ui/dlg_DataLabel \
+ chart2/uiconfig/ui/dlg_InsertDataTable \
chart2/uiconfig/ui/dlg_InsertErrorBars \
+ chart2/uiconfig/ui/dlg_InsertLegend \
chart2/uiconfig/ui/imagefragment \
chart2/uiconfig/ui/insertaxisdlg \
chart2/uiconfig/ui/insertgriddlg \
chart2/uiconfig/ui/inserttitledlg \
chart2/uiconfig/ui/paradialog \
chart2/uiconfig/ui/sidebaraxis \
+ chart2/uiconfig/ui/sidebarcolors \
chart2/uiconfig/ui/sidebarelements \
chart2/uiconfig/ui/sidebarerrorbar \
chart2/uiconfig/ui/sidebarseries \
@@ -58,16 +62,17 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/smoothlinesdlg \
chart2/uiconfig/ui/steppedlinesdlg \
chart2/uiconfig/ui/titlerotationtabpage \
- chart2/uiconfig/ui/dlg_InsertLegend \
chart2/uiconfig/ui/tp_3D_SceneAppearance \
chart2/uiconfig/ui/tp_3D_SceneGeometry \
chart2/uiconfig/ui/tp_3D_SceneIllumination \
chart2/uiconfig/ui/tp_axisLabel \
chart2/uiconfig/ui/tp_AxisPositions \
+ chart2/uiconfig/ui/tp_ChartColorPalette \
chart2/uiconfig/ui/tp_ChartType \
chart2/uiconfig/ui/tp_DataLabel \
chart2/uiconfig/ui/tp_DataPointOption \
chart2/uiconfig/ui/tp_DataSource \
+ chart2/uiconfig/ui/tp_DataTable \
chart2/uiconfig/ui/tp_ErrorBars \
chart2/uiconfig/ui/tp_LegendPosition \
chart2/uiconfig/ui/tp_PolarOptions \
diff --git a/chart2/export_setup.mk b/chart2/export_setup.mk
index 359973634dbd..723df9897c4a 100644
--- a/chart2/export_setup.mk
+++ b/chart2/export_setup.mk
@@ -45,6 +45,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_export$(1), \
sd \
sfx \
sot \
+ subsequenttest \
svl \
svt \
svx \
@@ -70,66 +71,7 @@ $(eval $(call gb_CppunitTest_use_sdk_api,chart2_export$(1)))
$(eval $(call gb_CppunitTest_use_ure,chart2_export$(1)))
$(eval $(call gb_CppunitTest_use_vcl,chart2_export$(1)))
-
-$(eval $(call gb_CppunitTest_use_components,chart2_export$(1),\
- basic/util/sb \
- animations/source/animcore/animcore \
- chart2/source/controller/chartcontroller \
- chart2/source/chartcore \
- comphelper/util/comphelp \
- configmgr/source/configmgr \
- dbaccess/util/dba \
- embeddedobj/util/embobj \
- emfio/emfio \
- eventattacher/source/evtatt \
- filter/source/config/cache/filterconfig1 \
- filter/source/odfflatxml/odfflatxml \
- filter/source/storagefilterdetect/storagefd \
- filter/source/xmlfilteradaptor/xmlfa \
- filter/source/xmlfilterdetect/xmlfd \
- forms/util/frm \
- framework/util/fwk \
- i18npool/util/i18npool \
- linguistic/source/lng \
- oox/util/oox \
- package/source/xstor/xstor \
- package/util/package2 \
- sax/source/expatwrap/expwrap \
- sc/util/sc \
- sc/util/scd \
- sc/util/scfilt \
- sw/util/sw \
- sw/util/swd \
- sw/util/msword \
- sd/util/sd \
- sd/util/sdfilt \
- sd/util/sdd \
- $(call gb_Helper_optional,SCRIPTING, \
- sc/util/vbaobj) \
- scaddins/source/analysis/analysis \
- scaddins/source/datefunc/date \
- scripting/source/basprov/basprov \
- scripting/util/scriptframe \
- sfx2/util/sfx \
- sot/util/sot \
- svl/source/fsstor/fsstorage \
- svl/util/svl \
- svtools/util/svt \
- svx/util/svx \
- svx/util/svxcore \
- toolkit/util/tk \
- vcl/vcl.common \
- ucb/source/core/ucb1 \
- ucb/source/ucp/file/ucpfile1 \
- ucb/source/ucp/tdoc/ucptdoc1 \
- unotools/util/utl \
- unoxml/source/rdf/unordf \
- unoxml/source/service/unoxml \
- uui/util/uui \
- writerfilter/util/writerfilter \
- xmloff/util/xo \
- xmlscript/util/xmlscript \
-))
+$(eval $(call gb_CppunitTest_use_rdb,chart2_export$(1),services))
$(eval $(call gb_CppunitTest_use_uiconfigs,chart2_export$(1), \
modules/swriter \
diff --git a/chart2/import_setup.mk b/chart2/import_setup.mk
index fb83a0462b7e..67318bca045d 100644
--- a/chart2/import_setup.mk
+++ b/chart2/import_setup.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_import$(1), \
cppu \
cppuhelper \
drawinglayer \
+ docmodel \
editeng \
for \
forui \
@@ -45,6 +46,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_import$(1), \
sd \
sfx \
sot \
+ subsequenttest \
svl \
svt \
svx \
@@ -74,8 +76,7 @@ $(eval $(call gb_CppunitTest_use_vcl,chart2_import$(1)))
$(eval $(call gb_CppunitTest_use_components,chart2_import$(1),\
basic/util/sb \
animations/source/animcore/animcore \
- chart2/source/controller/chartcontroller \
- chart2/source/chartcore \
+ chart2/source/chart2 \
comphelper/util/comphelp \
configmgr/source/configmgr \
dbaccess/util/dba \
@@ -102,7 +103,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_import$(1),\
sw/util/swd \
sw/util/msword \
sd/util/sd \
- sd/util/sdfilt \
sd/util/sdd \
$(call gb_Helper_optional,SCRIPTING, \
sc/util/vbaobj) \
@@ -117,6 +117,7 @@ $(eval $(call gb_CppunitTest_use_components,chart2_import$(1),\
svtools/util/svt \
svx/util/svx \
svx/util/svxcore \
+ sw/util/sw_writerfilter \
toolkit/util/tk \
vcl/vcl.common \
ucb/source/core/ucb1 \
@@ -126,7 +127,6 @@ $(eval $(call gb_CppunitTest_use_components,chart2_import$(1),\
unoxml/source/rdf/unordf \
unoxml/source/service/unoxml \
uui/util/uui \
- writerfilter/util/writerfilter \
xmloff/util/xo \
xmlscript/util/xmlscript \
))
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index cad6f0422a72..eb660c030593 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -52,12 +52,14 @@
#include <cppuhelper/implbase.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <vcl/GraphicObject.hxx>
-#include <sfx2/xmldump.hxx>
+#include <svl/lstner.hxx>
+#include <svx/ChartColorPaletteType.hxx>
#include <memory>
+typedef struct _xmlTextWriter* xmlTextWriterPtr;
+
namespace com::sun::star::awt { class XRequestCallback; }
-namespace com::sun::star::chart2 { class XChartTypeTemplate; }
namespace com::sun::star::chart2::data { class XDataProvider; }
namespace com::sun::star::document { class XFilter; }
namespace com::sun::star::embed { class XStorage; }
@@ -68,13 +70,22 @@ namespace com::sun::star::uno { class XAggregation; }
class SvNumberFormatter;
class SvNumberFormatsSupplierObj;
+namespace model { class Theme; }
+
namespace chart
{
class Diagram;
class ChartTypeManager;
+class ChartTypeTemplate;
class InternalDataProvider;
class NameContainer;
class PageBackground;
+class RangeHighlighter;
+class Title;
+class BaseCoordinateSystem;
+class DataSeries;
+class ChartType;
+namespace wrapper { class ChartDocumentWrapper; }
namespace impl
{
@@ -112,7 +123,8 @@ typedef cppu::WeakImplHelper<
class UndoManager;
class ChartView;
-class OOO_DLLPUBLIC_CHARTTOOLS ChartModel final : public impl::ChartModel_Base, public sfx2::XmlDump
+class SAL_LOPLUGIN_ANNOTATE("crosscast") ChartModel final :
+ public impl::ChartModel_Base, private SfxListener
{
private:
@@ -138,13 +150,13 @@ private:
sal_uInt16 m_nControllerLockCount;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
- css::uno::Reference< css::uno::XAggregation > m_xOldModelAgg;
+ rtl::Reference< wrapper::ChartDocumentWrapper > m_xOldModelAgg;
css::uno::Reference< css::embed::XStorage > m_xStorage;
//the content of this should be always synchronized with the current m_xViewWindow size. The variable is necessary to hold the information as long as no view window exists.
css::awt::Size m_aVisualAreaSize;
css::uno::Reference< css::frame::XModel > m_xParent;
- css::uno::Reference< css::chart2::data::XRangeHighlighter > m_xRangeHighlighter;
+ rtl::Reference< ::chart::RangeHighlighter > m_xRangeHighlighter;
css::uno::Reference<css::awt::XRequestCallback> m_xPopupRequest;
std::vector< GraphicObject > m_aGraphicObjectVector;
@@ -165,20 +177,22 @@ private:
// Diagram Access
rtl::Reference< ::chart::Diagram > m_xDiagram;
- css::uno::Reference< css::chart2::XTitle >
- m_xTitle;
+ rtl::Reference< ::chart::Title > m_xTitle;
rtl::Reference< ::chart::PageBackground > m_xPageBackground;
rtl::Reference< ::chart::NameContainer > m_xXMLNamespaceMap;
+ ChartColorPaletteType m_eColorPaletteType;
+ sal_uInt32 m_nColorPaletteIndex;
+
private:
//private methods
OUString impl_g_getLocation();
bool
- impl_isControllerConnected( const css::uno::Reference< com::sun::star::frame::XController >& xController );
+ impl_isControllerConnected( const css::uno::Reference< css::frame::XController >& xController );
/// @throws css::uno::RuntimeException
css::uno::Reference< css::frame::XController >
@@ -201,11 +215,11 @@ private:
const css::uno::Sequence< css::beans::PropertyValue >& rMediaDescriptor,
const css::uno::Reference< css::embed::XStorage >& xStorage );
void impl_loadGraphics(
- const css::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+ const css::uno::Reference< css::embed::XStorage >& xStorage );
css::uno::Reference< css::document::XFilter >
impl_createFilter( const css::uno::Sequence< css::beans::PropertyValue > & rMediaDescriptor );
- css::uno::Reference< css::chart2::XChartTypeTemplate > impl_createDefaultChartTypeTemplate();
+ rtl::Reference< ::chart::ChartTypeTemplate > impl_createDefaultChartTypeTemplate();
css::uno::Reference< css::chart2::data::XDataSource > impl_createDefaultData();
void impl_adjustAdditionalShapesPositionAndSize(
@@ -215,7 +229,7 @@ private:
public:
ChartModel() = delete;
- ChartModel(css::uno::Reference< css::uno::XComponentContext > const & xContext);
+ ChartModel(css::uno::Reference< css::uno::XComponentContext > xContext);
explicit ChartModel( const ChartModel & rOther );
virtual ~ChartModel() override;
@@ -451,12 +465,17 @@ public:
virtual void SAL_CALL update() override;
// XDumper
- virtual OUString SAL_CALL dump() override;
+ virtual OUString SAL_CALL dump(OUString const & kind) override;
+
+ // SfxListener
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
// normal methods
css::uno::Reference< css::util::XNumberFormatsSupplier > const &
getNumberFormatsSupplier();
+ const rtl::Reference<ChartView> & createChartView();
+
ChartView* getChartView() const;
const rtl::Reference< ::chart::Diagram > & getFirstChartDiagram() { return m_xDiagram; }
@@ -473,10 +492,37 @@ public:
const rtl::Reference< ::chart::ChartTypeManager > & getTypeManager() const { return m_xChartTypeManager; }
- /// See sfx2::XmlDump::dumpAsXml().
- void dumpAsXml(xmlTextWriterPtr pWriter) const override;
+ rtl::Reference< ::chart::Title > getTitleObject2() const;
+ void setTitleObject( const rtl::Reference< ::chart::Title >& Title );
+
+ rtl::Reference< BaseCoordinateSystem > getFirstCoordinateSystem();
+
+ std::vector< rtl::Reference< ::chart::DataSeries > > getDataSeries();
+
+ rtl::Reference< ChartType > getChartTypeOfSeries( const rtl::Reference< ::chart::DataSeries >& xGivenDataSeries );
+
+ static css::awt::Size getDefaultPageSize();
+
+ css::awt::Size getPageSize();
+
+ void triggerRangeHighlighting();
+
+ bool isIncludeHiddenCells();
+ bool setIncludeHiddenCells( bool bIncludeHiddenCells );
+
+ std::shared_ptr<model::Theme> getDocumentTheme() const;
+ ChartColorPaletteType getColorPaletteType() const { return m_eColorPaletteType; }
+ sal_uInt32 getColorPaletteIndex() const { return m_nColorPaletteIndex; }
+ void setColorPalette(ChartColorPaletteType eType, sal_uInt32 nIndex);
+ void clearColorPalette();
+ bool usesColorPalette() const;
+ std::optional<ChartColorPalette> getCurrentColorPalette() const;
+ void applyColorPaletteToDataSeries(const ChartColorPalette& rColorPalette);
+ void onDocumentThemeChanged();
private:
+ void dumpAsXml(xmlTextWriterPtr pWriter) const;
+
sal_Int32 mnStart;
sal_Int32 mnEnd;
};
diff --git a/chart2/inc/ChartTypeManager.hxx b/chart2/inc/ChartTypeManager.hxx
index 0ed5b3ef4812..2970503d3e24 100644
--- a/chart2/inc/ChartTypeManager.hxx
+++ b/chart2/inc/ChartTypeManager.hxx
@@ -18,20 +18,19 @@
*/
#pragma once
+#include <config_options.h>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/chart2/XChartTypeManager.hpp>
-#include <charttoolsdllapi.hxx>
#include <rtl/ref.hxx>
+#include <ChartTypeTemplate.hxx>
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
-class ChartTypeTemplate;
-
-class OOO_DLLPUBLIC_CHARTTOOLS ChartTypeManager final :
+class ChartTypeManager final :
public ::cppu::WeakImplHelper<
css::lang::XServiceInfo,
css::lang::XMultiServiceFactory,
@@ -39,7 +38,7 @@ class OOO_DLLPUBLIC_CHARTTOOLS ChartTypeManager final :
{
public:
explicit ChartTypeManager(
- css::uno::Reference< css::uno::XComponentContext > const & xContext );
+ css::uno::Reference< css::uno::XComponentContext > xContext );
virtual ~ChartTypeManager() override;
virtual OUString SAL_CALL
diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx
index 228d24bc19fe..ba00d741cb6a 100644
--- a/chart2/inc/ChartView.hxx
+++ b/chart2/inc/ChartView.hxx
@@ -18,18 +18,17 @@
*/
#pragma once
-#include <chartview/ExplicitValueProvider.hxx>
#include <cppuhelper/implbase.hxx>
-#include <comphelper/multicontainer2.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <svl/lstner.hxx>
#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/datatransfer/XTransferable.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/qa/XDumper.hpp>
#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
@@ -40,24 +39,30 @@
#include <vector>
#include <memory>
+#include <mutex>
#include <vcl/timer.hxx>
-#include <sfx2/xmldump.hxx>
namespace com::sun::star::drawing { class XDrawPage; }
namespace com::sun::star::drawing { class XShapes; }
namespace com::sun::star::io { class XOutputStream; }
namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::util { class XUpdatable2; }
+namespace com::sun::star::util { class XNumberFormatsSupplier; }
class SdrPage;
namespace chart {
-class VCoordinateSystem;
+class Axis;
+class BaseCoordinateSystem;
+class ChartModel;
+struct CreateShapeParam2D;
class DrawModelWrapper;
+struct ExplicitIncrementData;
+struct ExplicitScaleData;
+class VCoordinateSystem;
class VDataSeries;
-struct CreateShapeParam2D;
struct TimeBasedInfo
{
@@ -82,11 +87,10 @@ struct TimeBasedInfo
* The View is not responsible to handle single user events (that is instead
* done by the ChartWindow).
*/
-class OOO_DLLPUBLIC_CHARTVIEW ChartView final : public ::cppu::WeakImplHelper<
+class ChartView final : public ::cppu::WeakImplHelper<
css::lang::XInitialization
,css::lang::XServiceInfo
,css::datatransfer::XTransferable
- ,css::lang::XUnoTunnel
,css::util::XModifyListener
,css::util::XModeChangeBroadcaster
,css::util::XUpdatable2
@@ -94,17 +98,14 @@ class OOO_DLLPUBLIC_CHARTVIEW ChartView final : public ::cppu::WeakImplHelper<
,css::lang::XMultiServiceFactory
,css::qa::XDumper
>
- , public ExplicitValueProvider
, private SfxListener
- , public sfx2::XmlDump
{
private:
void init();
public:
ChartView() = delete;
- ChartView(css::uno::Reference< css::uno::XComponentContext > const & xContext,
- ChartModel& rModel);
+ ChartView(css::uno::Reference<css::uno::XComponentContext> xContext, ChartModel& rModel);
virtual ~ChartView() override;
@@ -116,19 +117,25 @@ public:
// ___lang::XInitialization___
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
- // ___ExplicitValueProvider___
- virtual bool getExplicitValuesForAxis(
- css::uno::Reference< css::chart2::XAxis > xAxis
+ /** Gives calculated scale and increment values for a given xAxis in the current view.
+ In contrast to the model data these explicit values are always complete as missing auto properties are calculated.
+ If the given Axis could not be found or for another reason no correct output can be given false is returned.
+ */
+ bool getExplicitValuesForAxis(
+ const rtl::Reference< Axis > & xAxis
, ExplicitScaleData& rExplicitScale
- , ExplicitIncrementData& rExplicitIncrement ) override;
- virtual css::uno::Reference< css::drawing::XShape >
- getShapeForCID( const OUString& rObjectCID ) override;
+ , ExplicitIncrementData& rExplicitIncrement );
+ rtl::Reference< SvxShape >
+ getShapeForCID( const OUString& rObjectCID );
- virtual css::awt::Rectangle getRectangleOfObject( const OUString& rObjectCID, bool bSnapRect=false ) override;
+ /** for rotated objects the shape size and position differs from the visible rectangle
+ if bSnapRect is set to true you get the resulting visible position (left-top) and size
+ */
+ css::awt::Rectangle getRectangleOfObject( const OUString& rObjectCID, bool bSnapRect=false );
- virtual css::awt::Rectangle getDiagramRectangleExcludingAxes() override;
+ css::awt::Rectangle getDiagramRectangleExcludingAxes();
- std::shared_ptr< DrawModelWrapper > getDrawModelWrapper() override;
+ std::shared_ptr< DrawModelWrapper > getDrawModelWrapper();
// ___XTransferable___
virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor ) override;
@@ -175,17 +182,29 @@ public:
const OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override;
- // for ExplicitValueProvider
- // ____ XUnoTunnel ___
- virtual ::sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< ::sal_Int8 >& aIdentifier ) override;
-
// XDumper
- virtual OUString SAL_CALL dump() override;
+ virtual OUString SAL_CALL dump(OUString const & kind) override;
void setViewDirty();
- /// See sfx2::XmlDump::dumpAsXml().
- void dumpAsXml(xmlTextWriterPtr pWriter) const override;
+ css::uno::Reference<css::uno::XComponentContext> const& getComponentContext() { return m_xCC;}
+
+ void dumpAsXml(xmlTextWriterPtr pWriter) const;
+
+ static css::awt::Rectangle
+ AddSubtractAxisTitleSizes(
+ ChartModel& rModel
+ , ChartView* pChartView
+ , const css::awt::Rectangle& rPositionAndSize, bool bSubtract );
+
+ static sal_Int32 getExplicitNumberFormatKeyForAxis(
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem > & xCorrespondingCoordinateSystem
+ , const rtl::Reference<::chart::ChartModel>& xChartDoc);
+
+ static sal_Int32 getExplicitPercentageNumberFormatKeyForDataLabel(
+ const css::uno::Reference< css::beans::XPropertySet >& xSeriesOrPointProp
+ , const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
private: //methods
void createShapes();
@@ -207,12 +226,11 @@ private: //methods
DECL_LINK( UpdateTimeBased, Timer*, void );
private: //member
- ::osl::Mutex m_aMutex;
+ std::mutex m_aMutex;
- css::uno::Reference< css::uno::XComponentContext>
- m_xCC;
+ css::uno::Reference< css::uno::XComponentContext> m_xCC;
- chart::ChartModel& mrChartModel;
+ ChartModel& mrChartModel;
css::uno::Reference< css::lang::XMultiServiceFactory>
m_xShapeFactory;
@@ -232,8 +250,8 @@ private: //member
std::vector< std::unique_ptr<VCoordinateSystem> > m_aVCooSysList;
- comphelper::OMultiTypeInterfaceContainerHelper2
- m_aListenerContainer;
+ comphelper::OInterfaceContainerHelper4<css::util::XModeChangeListener>
+ m_aModeChangeListeners;
bool m_bViewDirty; //states whether the view needs to be rebuild
bool m_bInViewUpdate;
@@ -255,7 +273,7 @@ private: //member
css::awt::Rectangle m_aResultingDiagramRectangleExcludingAxes;
TimeBasedInfo maTimeBased;
- osl::Mutex maTimeMutex;
+ std::mutex maTimeMutex;
};
}
diff --git a/chart2/inc/bitmaps.hlst b/chart2/inc/bitmaps.hlst
index 0f4512e8bc2c..f0eabe5d53eb 100644
--- a/chart2/inc/bitmaps.hlst
+++ b/chart2/inc/bitmaps.hlst
@@ -9,124 +9,129 @@
#pragma once
-inline constexpr OUStringLiteral BMP_TYPE_COLUMN = u"chart2/res/typecolumn_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_BAR = u"chart2/res/typebar_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_PIE = u"chart2/res/typepie_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_LINE = u"chart2/res/typepointline_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_XY = u"chart2/res/typexy_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_AREA = u"chart2/res/typearea_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_NET = u"chart2/res/typenet_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_STOCK = u"chart2/res/typestock_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_COLUMN_LINE = u"chart2/res/typecolumnline_16.png";
-inline constexpr OUStringLiteral BMP_TYPE_BUBBLE = u"chart2/res/typebubble_16.png";
-inline constexpr OUStringLiteral BMP_BUBBLE_1 = u"chart2/res/bubble_52x60.png";
-inline constexpr OUStringLiteral BMP_AREAS_2D = u"chart2/res/areas_52x60.png";
-inline constexpr OUStringLiteral BMP_AREAS_2D_1 = u"chart2/res/areaspiled_52x60.png";
-inline constexpr OUStringLiteral BMP_AREAS_2D_3 = u"chart2/res/areasfull_52x60.png";
-inline constexpr OUStringLiteral BMP_AREAS_3D = u"chart2/res/areaspiled3d_52x60.png";
-inline constexpr OUStringLiteral BMP_AREAS_3D_1 = u"chart2/res/areas3d_52x60.png";
-inline constexpr OUStringLiteral BMP_AREAS_3D_2 = u"chart2/res/areasfull3d_52x60.png";
-inline constexpr OUStringLiteral BMP_BARS_2D_1 = u"chart2/res/bar_52x60.png";
-inline constexpr OUStringLiteral BMP_BARS_2D_2 = u"chart2/res/barstack_52x60.png";
-inline constexpr OUStringLiteral BMP_BARS_2D_3 = u"chart2/res/barpercent_52x60.png";
-inline constexpr OUStringLiteral BMP_BARS_3D = u"chart2/res/bar3ddeep_52x60.png";
-inline constexpr OUStringLiteral BMP_BARS_3D_1 = u"chart2/res/bar3d_52x60.png";
-inline constexpr OUStringLiteral BMP_BARS_3D_2 = u"chart2/res/barstack3d_52x60.png";
-inline constexpr OUStringLiteral BMP_BARS_3D_3 = u"chart2/res/barpercent3d_52x60.png";
-inline constexpr OUStringLiteral BMP_CIRCLES_2D = u"chart2/res/pie_52x60.png";
-inline constexpr OUStringLiteral BMP_CIRCLES_2D_EXPLODED = u"chart2/res/pieexploded_52x60.png";
-inline constexpr OUStringLiteral BMP_CIRCLES_3D = u"chart2/res/pie3d_52x60.png";
-inline constexpr OUStringLiteral BMP_CIRCLES_3D_EXPLODED = u"chart2/res/pie3dexploded_52x60.png";
-inline constexpr OUStringLiteral BMP_DONUT_2D = u"chart2/res/donut_52x60.png";
-inline constexpr OUStringLiteral BMP_DONUT_2D_EXPLODED = u"chart2/res/donutexploded_52x60.png";
-inline constexpr OUStringLiteral BMP_DONUT_3D = u"chart2/res/donut3d_52x60.png";
-inline constexpr OUStringLiteral BMP_DONUT_3D_EXPLODED = u"chart2/res/donut3dexploded_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMNS_2D_1 = u"chart2/res/columns_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMNS_2D_2 = u"chart2/res/columnstack_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMNS_2D_3 = u"chart2/res/columnpercent_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMN_LINE = u"chart2/res/columnline_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMN_LINE_STACKED = u"chart2/res/columnstackline_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMNS_3D = u"chart2/res/columns3ddeep_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMNS_3D_1 = u"chart2/res/columns3d_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMNS_3D_2 = u"chart2/res/columnstack3d_52x60.png";
-inline constexpr OUStringLiteral BMP_COLUMNS_3D_3 = u"chart2/res/columnpercent3d_52x60.png";
-inline constexpr OUStringLiteral BMP_KEGELQ_3D_1 = u"chart2/res/conehori_52x60.png";
-inline constexpr OUStringLiteral BMP_KEGELQ_3D_2 = u"chart2/res/conehoristack_52x60.png";
-inline constexpr OUStringLiteral BMP_KEGELQ_3D_3 = u"chart2/res/conehoripercent_52x60.png";
-inline constexpr OUStringLiteral BMP_KEGELQ_3D_4 = u"chart2/res/conehorideep_52x60.png";
-inline constexpr OUStringLiteral BMP_KEGEL_3D_1 = u"chart2/res/cone_52x60.png";
-inline constexpr OUStringLiteral BMP_KEGEL_3D_2 = u"chart2/res/conestack_52x60.png";
-inline constexpr OUStringLiteral BMP_KEGEL_3D_3 = u"chart2/res/conepercent_52x60.png";
-inline constexpr OUStringLiteral BMP_KEGEL_3D_4 = u"chart2/res/conedeep_52x60.png";
-inline constexpr OUStringLiteral BMP_POINTS_XVALUES = u"chart2/res/valueaxisdirectpoints_52x60.png";
-inline constexpr OUStringLiteral BMP_POINTS_XCATEGORY = u"chart2/res/nostackdirectpoints_52x60.png";
-inline constexpr OUStringLiteral BMP_POINTS_STACKED = u"chart2/res/stackdirectpoints_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_XVALUES = u"chart2/res/valueaxisdirectboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_XVALUES = u"chart2/res/valueaxisdirectlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_XVALUES = u"chart2/res/valueaxisdirect3d_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_XCATEGORY = u"chart2/res/nostackdirectboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_XCATEGORY = u"chart2/res/nostackdirectlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_XCATEGORY = u"chart2/res/nostackdirect3d_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_STACKED = u"chart2/res/stackdirectboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_STACKED = u"chart2/res/stackdirectlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_STACKED = u"chart2/res/stackdirect3d_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_XVALUES_SMOOTH = u"chart2/res/valueaxissmoothboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_XVALUES_SMOOTH = u"chart2/res/valueaxissmoothlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_XVALUES_SMOOTH = u"chart2/res/valueaxissmooth3d_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_XCATEGORY_SMOOTH = u"chart2/res/nostacksmoothboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_XCATEGORY_SMOOTH = u"chart2/res/nostacksmoothlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_XCATEGORY_SMOOTH = u"chart2/res/nostacksmooth3d_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_STACKED_SMOOTH = u"chart2/res/stacksmoothboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_STACKED_SMOOTH = u"chart2/res/stacksmoothlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_STACKED_SMOOTH = u"chart2/res/stacksmooth3d_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_XVALUES_STEPPED = u"chart2/res/valueaxissteppedboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_XVALUES_STEPPED = u"chart2/res/valueaxissteppedlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_XVALUES_STEPPED = u"chart2/res/valueaxisstepped3d_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_XCATEGORY_STEPPED = u"chart2/res/nostacksteppedboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_XCATEGORY_STEPPED = u"chart2/res/nostacksteppedlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_XCATEGORY_STEPPED = u"chart2/res/nostackstepped3d_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_P_STACKED_STEPPED = u"chart2/res/stacksteppedboth_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE_O_STACKED_STEPPED = u"chart2/res/stacksteppedlines_52x60.png";
-inline constexpr OUStringLiteral BMP_LINE3D_STACKED_STEPPED = u"chart2/res/stackstepped3d_52x60.png";
-inline constexpr OUStringLiteral BMP_NET = u"chart2/res/net_52x60.png";
-inline constexpr OUStringLiteral BMP_NET_STACK = u"chart2/res/netstack_52x60.png";
-inline constexpr OUStringLiteral BMP_NET_SYMB = u"chart2/res/netpoint_52x60.png";
-inline constexpr OUStringLiteral BMP_NET_SYMB_STACK = u"chart2/res/netpointstack_52x60.png";
-inline constexpr OUStringLiteral BMP_NET_LINESYMB = u"chart2/res/netlinepoint_52x60.png";
-inline constexpr OUStringLiteral BMP_NET_LINESYMB_STACK = u"chart2/res/netlinepointstack_52x60.png";
-inline constexpr OUStringLiteral BMP_NET_FILL = u"chart2/res/netfill_52x60.png";
-inline constexpr OUStringLiteral BMP_NET_FILL_STACK = u"chart2/res/netstackfill_52x60.png";
-inline constexpr OUStringLiteral BMP_PYRAMIDQ_3D_1 = u"chart2/res/pyramindhori_52x60.png";
-inline constexpr OUStringLiteral BMP_PYRAMIDQ_3D_2 = u"chart2/res/pyramindhoristack_52x60.png";
-inline constexpr OUStringLiteral BMP_PYRAMIDQ_3D_3 = u"chart2/res/pyramindhoripercent_52x60.png";
-inline constexpr OUStringLiteral BMP_PYRAMIDQ_3D_4 = u"chart2/res/pyramindhorideep_52x60.png";
-inline constexpr OUStringLiteral BMP_PYRAMID_3D_1 = u"chart2/res/pyramind_52x60.png";
-inline constexpr OUStringLiteral BMP_PYRAMID_3D_2 = u"chart2/res/pyramindstack_52x60.png";
-inline constexpr OUStringLiteral BMP_PYRAMID_3D_3 = u"chart2/res/pyramindpercent_52x60.png";
-inline constexpr OUStringLiteral BMP_PYRAMID_3D_4 = u"chart2/res/pyraminddeep_52x60.png";
-inline constexpr OUStringLiteral BMP_ROEHRE_3D_1 = u"chart2/res/cylinderhori_52x60.png";
-inline constexpr OUStringLiteral BMP_ROEHRE_3D_2 = u"chart2/res/cylinderhoristack_52x60.png";
-inline constexpr OUStringLiteral BMP_ROEHRE_3D_3 = u"chart2/res/cylinderhoriprocent_52x60.png";
-inline constexpr OUStringLiteral BMP_ROEHRE_3D_4 = u"chart2/res/cylinderhorideep_52x60.png";
-inline constexpr OUStringLiteral BMP_SAEULE_3D_1 = u"chart2/res/cylinder_52x60.png";
-inline constexpr OUStringLiteral BMP_SAEULE_3D_2 = u"chart2/res/cylinderstack_52x60.png";
-inline constexpr OUStringLiteral BMP_SAEULE_3D_3 = u"chart2/res/cylinderpercent_52x60.png";
-inline constexpr OUStringLiteral BMP_SAEULE_3D_4 = u"chart2/res/cylinderdeep_52x60.png";
-inline constexpr OUStringLiteral BMP_STOCK_1 = u"chart2/res/stock_52x60.png";
-inline constexpr OUStringLiteral BMP_STOCK_2 = u"chart2/res/stockblock_52x60.png";
-inline constexpr OUStringLiteral BMP_STOCK_3 = u"chart2/res/stockcolumns_52x60.png";
-inline constexpr OUStringLiteral BMP_STOCK_4 = u"chart2/res/stockcolumnsattach_52x60.png";
-inline constexpr OUStringLiteral BMP_INDICATE_BOTH_VERTI = u"chart2/res/errorbothverti_30.png";
-inline constexpr OUStringLiteral BMP_INDICATE_DOWN = u"chart2/res/errordown_30.png";
-inline constexpr OUStringLiteral BMP_INDICATE_UP = u"chart2/res/errorup_30.png";
-inline constexpr OUStringLiteral BMP_INDICATE_BOTH_HORI = u"chart2/res/errorbothhori_30.png";
-inline constexpr OUStringLiteral BMP_INDICATE_RIGHT = u"chart2/res/errorright_30.png";
-inline constexpr OUStringLiteral BMP_INDICATE_LEFT = u"chart2/res/errorleft_30.png";
-inline constexpr OUStringLiteral BMP_REGRESSION_LINEAR = u"chart2/res/reglin.png";
-inline constexpr OUStringLiteral BMP_REGRESSION_LOG = u"chart2/res/reglog.png";
-inline constexpr OUStringLiteral BMP_REGRESSION_EXP = u"chart2/res/regexp.png";
-inline constexpr OUStringLiteral BMP_REGRESSION_POWER = u"chart2/res/regpow.png";
-inline constexpr OUStringLiteral BMP_REGRESSION_POLYNOMIAL = u"chart2/res/regpoly.png";
-inline constexpr OUStringLiteral BMP_REGRESSION_MOVING_AVERAGE = u"chart2/res/regavg.png";
+inline constexpr OUString BMP_TYPE_COLUMN = u"chart2/res/typecolumn_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_BAR = u"chart2/res/typebar_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_HISTOGRAM = u"chart2/res/typehistogram_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_PIE = u"chart2/res/typepie_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_OFPIE = u"chart2/res/typeofpie_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_LINE = u"chart2/res/typepointline_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_XY = u"chart2/res/typexy_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_AREA = u"chart2/res/typearea_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_NET = u"chart2/res/typenet_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_STOCK = u"chart2/res/typestock_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_COLUMN_LINE = u"chart2/res/typecolumnline_16.png"_ustr;
+inline constexpr OUString BMP_TYPE_BUBBLE = u"chart2/res/typebubble_16.png"_ustr;
+inline constexpr OUString BMP_BUBBLE_1 = u"chart2/res/bubble_52x60.png"_ustr;
+inline constexpr OUString BMP_AREAS_2D = u"chart2/res/areas_52x60.png"_ustr;
+inline constexpr OUString BMP_AREAS_2D_1 = u"chart2/res/areaspiled_52x60.png"_ustr;
+inline constexpr OUString BMP_AREAS_2D_3 = u"chart2/res/areasfull_52x60.png"_ustr;
+inline constexpr OUString BMP_AREAS_3D = u"chart2/res/areaspiled3d_52x60.png"_ustr;
+inline constexpr OUString BMP_AREAS_3D_1 = u"chart2/res/areas3d_52x60.png"_ustr;
+inline constexpr OUString BMP_AREAS_3D_2 = u"chart2/res/areasfull3d_52x60.png"_ustr;
+inline constexpr OUString BMP_BAR_OF_PIE = u"chart2/res/barofpie_52x60.png"_ustr; // TODO
+inline constexpr OUString BMP_BARS_2D_1 = u"chart2/res/bar_52x60.png"_ustr;
+inline constexpr OUString BMP_BARS_2D_2 = u"chart2/res/barstack_52x60.png"_ustr;
+inline constexpr OUString BMP_BARS_2D_3 = u"chart2/res/barpercent_52x60.png"_ustr;
+inline constexpr OUString BMP_BARS_3D = u"chart2/res/bar3ddeep_52x60.png"_ustr;
+inline constexpr OUString BMP_BARS_3D_1 = u"chart2/res/bar3d_52x60.png"_ustr;
+inline constexpr OUString BMP_BARS_3D_2 = u"chart2/res/barstack3d_52x60.png"_ustr;
+inline constexpr OUString BMP_BARS_3D_3 = u"chart2/res/barpercent3d_52x60.png"_ustr;
+inline constexpr OUString BMP_CIRCLES_2D = u"chart2/res/pie_52x60.png"_ustr;
+inline constexpr OUString BMP_CIRCLES_2D_EXPLODED = u"chart2/res/pieexploded_52x60.png"_ustr;
+inline constexpr OUString BMP_CIRCLES_3D = u"chart2/res/pie3d_52x60.png"_ustr;
+inline constexpr OUString BMP_CIRCLES_3D_EXPLODED = u"chart2/res/pie3dexploded_52x60.png"_ustr;
+inline constexpr OUString BMP_DONUT_2D = u"chart2/res/donut_52x60.png"_ustr;
+inline constexpr OUString BMP_DONUT_2D_EXPLODED = u"chart2/res/donutexploded_52x60.png"_ustr;
+inline constexpr OUString BMP_DONUT_3D = u"chart2/res/donut3d_52x60.png"_ustr;
+inline constexpr OUString BMP_DONUT_3D_EXPLODED = u"chart2/res/donut3dexploded_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMNS_2D_1 = u"chart2/res/columns_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMNS_2D_2 = u"chart2/res/columnstack_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMNS_2D_3 = u"chart2/res/columnpercent_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMN_LINE = u"chart2/res/columnline_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMN_LINE_STACKED = u"chart2/res/columnstackline_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMNS_3D = u"chart2/res/columns3ddeep_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMNS_3D_1 = u"chart2/res/columns3d_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMNS_3D_2 = u"chart2/res/columnstack3d_52x60.png"_ustr;
+inline constexpr OUString BMP_COLUMNS_3D_3 = u"chart2/res/columnpercent3d_52x60.png"_ustr;
+inline constexpr OUString BMP_HISTOGRAM = u"chart2/res/histogram_52x60.png"_ustr;
+inline constexpr OUString BMP_KEGELQ_3D_1 = u"chart2/res/conehori_52x60.png"_ustr;
+inline constexpr OUString BMP_KEGELQ_3D_2 = u"chart2/res/conehoristack_52x60.png"_ustr;
+inline constexpr OUString BMP_KEGELQ_3D_3 = u"chart2/res/conehoripercent_52x60.png"_ustr;
+inline constexpr OUString BMP_KEGELQ_3D_4 = u"chart2/res/conehorideep_52x60.png"_ustr;
+inline constexpr OUString BMP_KEGEL_3D_1 = u"chart2/res/cone_52x60.png"_ustr;
+inline constexpr OUString BMP_KEGEL_3D_2 = u"chart2/res/conestack_52x60.png"_ustr;
+inline constexpr OUString BMP_KEGEL_3D_3 = u"chart2/res/conepercent_52x60.png"_ustr;
+inline constexpr OUString BMP_KEGEL_3D_4 = u"chart2/res/conedeep_52x60.png"_ustr;
+inline constexpr OUString BMP_POINTS_XVALUES = u"chart2/res/valueaxisdirectpoints_52x60.png"_ustr;
+inline constexpr OUString BMP_POINTS_XCATEGORY = u"chart2/res/nostackdirectpoints_52x60.png"_ustr;
+inline constexpr OUString BMP_POINTS_STACKED = u"chart2/res/stackdirectpoints_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_XVALUES = u"chart2/res/valueaxisdirectboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_XVALUES = u"chart2/res/valueaxisdirectlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_XVALUES = u"chart2/res/valueaxisdirect3d_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_XCATEGORY = u"chart2/res/nostackdirectboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_XCATEGORY = u"chart2/res/nostackdirectlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_XCATEGORY = u"chart2/res/nostackdirect3d_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_STACKED = u"chart2/res/stackdirectboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_STACKED = u"chart2/res/stackdirectlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_STACKED = u"chart2/res/stackdirect3d_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_XVALUES_SMOOTH = u"chart2/res/valueaxissmoothboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_XVALUES_SMOOTH = u"chart2/res/valueaxissmoothlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_XVALUES_SMOOTH = u"chart2/res/valueaxissmooth3d_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_XCATEGORY_SMOOTH = u"chart2/res/nostacksmoothboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_XCATEGORY_SMOOTH = u"chart2/res/nostacksmoothlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_XCATEGORY_SMOOTH = u"chart2/res/nostacksmooth3d_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_STACKED_SMOOTH = u"chart2/res/stacksmoothboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_STACKED_SMOOTH = u"chart2/res/stacksmoothlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_STACKED_SMOOTH = u"chart2/res/stacksmooth3d_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_XVALUES_STEPPED = u"chart2/res/valueaxissteppedboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_XVALUES_STEPPED = u"chart2/res/valueaxissteppedlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_XVALUES_STEPPED = u"chart2/res/valueaxisstepped3d_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_XCATEGORY_STEPPED = u"chart2/res/nostacksteppedboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_XCATEGORY_STEPPED = u"chart2/res/nostacksteppedlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_XCATEGORY_STEPPED = u"chart2/res/nostackstepped3d_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_P_STACKED_STEPPED = u"chart2/res/stacksteppedboth_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE_O_STACKED_STEPPED = u"chart2/res/stacksteppedlines_52x60.png"_ustr;
+inline constexpr OUString BMP_LINE3D_STACKED_STEPPED = u"chart2/res/stackstepped3d_52x60.png"_ustr;
+inline constexpr OUString BMP_NET = u"chart2/res/net_52x60.png"_ustr;
+inline constexpr OUString BMP_NET_STACK = u"chart2/res/netstack_52x60.png"_ustr;
+inline constexpr OUString BMP_NET_SYMB = u"chart2/res/netpoint_52x60.png"_ustr;
+inline constexpr OUString BMP_NET_SYMB_STACK = u"chart2/res/netpointstack_52x60.png"_ustr;
+inline constexpr OUString BMP_NET_LINESYMB = u"chart2/res/netlinepoint_52x60.png"_ustr;
+inline constexpr OUString BMP_NET_LINESYMB_STACK = u"chart2/res/netlinepointstack_52x60.png"_ustr;
+inline constexpr OUString BMP_NET_FILL = u"chart2/res/netfill_52x60.png"_ustr;
+inline constexpr OUString BMP_NET_FILL_STACK = u"chart2/res/netstackfill_52x60.png"_ustr;
+inline constexpr OUString BMP_PIE_OF_PIE = u"chart2/res/pieofpie_52x60.png"_ustr; // TODO
+inline constexpr OUString BMP_PYRAMIDQ_3D_1 = u"chart2/res/pyramindhori_52x60.png"_ustr;
+inline constexpr OUString BMP_PYRAMIDQ_3D_2 = u"chart2/res/pyramindhoristack_52x60.png"_ustr;
+inline constexpr OUString BMP_PYRAMIDQ_3D_3 = u"chart2/res/pyramindhoripercent_52x60.png"_ustr;
+inline constexpr OUString BMP_PYRAMIDQ_3D_4 = u"chart2/res/pyramindhorideep_52x60.png"_ustr;
+inline constexpr OUString BMP_PYRAMID_3D_1 = u"chart2/res/pyramind_52x60.png"_ustr;
+inline constexpr OUString BMP_PYRAMID_3D_2 = u"chart2/res/pyramindstack_52x60.png"_ustr;
+inline constexpr OUString BMP_PYRAMID_3D_3 = u"chart2/res/pyramindpercent_52x60.png"_ustr;
+inline constexpr OUString BMP_PYRAMID_3D_4 = u"chart2/res/pyraminddeep_52x60.png"_ustr;
+inline constexpr OUString BMP_ROEHRE_3D_1 = u"chart2/res/cylinderhori_52x60.png"_ustr;
+inline constexpr OUString BMP_ROEHRE_3D_2 = u"chart2/res/cylinderhoristack_52x60.png"_ustr;
+inline constexpr OUString BMP_ROEHRE_3D_3 = u"chart2/res/cylinderhoriprocent_52x60.png"_ustr;
+inline constexpr OUString BMP_ROEHRE_3D_4 = u"chart2/res/cylinderhorideep_52x60.png"_ustr;
+inline constexpr OUString BMP_SAEULE_3D_1 = u"chart2/res/cylinder_52x60.png"_ustr;
+inline constexpr OUString BMP_SAEULE_3D_2 = u"chart2/res/cylinderstack_52x60.png"_ustr;
+inline constexpr OUString BMP_SAEULE_3D_3 = u"chart2/res/cylinderpercent_52x60.png"_ustr;
+inline constexpr OUString BMP_SAEULE_3D_4 = u"chart2/res/cylinderdeep_52x60.png"_ustr;
+inline constexpr OUString BMP_STOCK_1 = u"chart2/res/stock_52x60.png"_ustr;
+inline constexpr OUString BMP_STOCK_2 = u"chart2/res/stockblock_52x60.png"_ustr;
+inline constexpr OUString BMP_STOCK_3 = u"chart2/res/stockcolumns_52x60.png"_ustr;
+inline constexpr OUString BMP_STOCK_4 = u"chart2/res/stockcolumnsattach_52x60.png"_ustr;
+inline constexpr OUString BMP_INDICATE_BOTH_VERTI = u"chart2/res/errorbothverti_30.png"_ustr;
+inline constexpr OUString BMP_INDICATE_DOWN = u"chart2/res/errordown_30.png"_ustr;
+inline constexpr OUString BMP_INDICATE_UP = u"chart2/res/errorup_30.png"_ustr;
+inline constexpr OUString BMP_INDICATE_BOTH_HORI = u"chart2/res/errorbothhori_30.png"_ustr;
+inline constexpr OUString BMP_INDICATE_RIGHT = u"chart2/res/errorright_30.png"_ustr;
+inline constexpr OUString BMP_INDICATE_LEFT = u"chart2/res/errorleft_30.png"_ustr;
+inline constexpr OUString BMP_REGRESSION_LINEAR = u"chart2/res/reglin.png"_ustr;
+inline constexpr OUString BMP_REGRESSION_LOG = u"chart2/res/reglog.png"_ustr;
+inline constexpr OUString BMP_REGRESSION_EXP = u"chart2/res/regexp.png"_ustr;
+inline constexpr OUString BMP_REGRESSION_POWER = u"chart2/res/regpow.png"_ustr;
+inline constexpr OUString BMP_REGRESSION_POLYNOMIAL = u"chart2/res/regpoly.png"_ustr;
+inline constexpr OUString BMP_REGRESSION_MOVING_AVERAGE = u"chart2/res/regavg.png"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/inc/chart.hrc b/chart2/inc/chart.hrc
index b1e0024fb7cc..b8b6a7e8b245 100644
--- a/chart2/inc/chart.hrc
+++ b/chart2/inc/chart.hrc
@@ -11,7 +11,7 @@
#include <unotools/resmgr.hxx>
-#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
+#define NC_(Context, String) TranslateId(Context, u8##String)
const TranslateId CHART_TYPE[] =
{
diff --git a/chart2/inc/pch/precompiled_chartcore.cxx b/chart2/inc/pch/precompiled_chart2.cxx
index 10d8b365b864..545316ea4903 100644
--- a/chart2/inc/pch/precompiled_chartcore.cxx
+++ b/chart2/inc/pch/precompiled_chart2.cxx
@@ -7,6 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "precompiled_chartcore.hxx"
+#include "precompiled_chart2.hxx"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chart2.hxx
index 912cff0fdef3..26610805a1e2 100644
--- a/chart2/inc/pch/precompiled_chartcontroller.hxx
+++ b/chart2/inc/pch/precompiled_chart2.hxx
@@ -13,19 +13,22 @@
manual changes will be rewritten by the next run of update_pch.sh (which presumably
also fixes all possible problems, so it's usually better to use it).
- Generated on 2021-09-28 05:28:39 using:
- ./bin/update_pch chart2 chartcontroller --cutoff=6 --exclude:system --include:module --include:local
+ Generated on 2025-03-30 09:01:07 using:
+ ./bin/update_pch chart2 chart2 --cutoff=6 --exclude:system --include:module --include:local
If after updating build fails, use the following command to locate conflicting headers:
- ./bin/update_pch_bisect ./chart2/inc/pch/precompiled_chartcontroller.hxx "make chart2.build" --find-conflicts
+ ./bin/update_pch_bisect ./chart2/inc/pch/precompiled_chart2.hxx "make chart2.build" --find-conflicts
*/
#include <sal/config.h>
#if PCH_LEVEL >= 1
#include <algorithm>
#include <array>
+#include <atomic>
#include <cassert>
#include <cmath>
+#include <compare>
+#include <concepts>
#include <cstddef>
#include <cstdlib>
#include <cstring>
@@ -46,12 +49,15 @@
#include <optional>
#include <ostream>
#include <set>
+#include <span>
#include <stddef.h>
#include <stdexcept>
#include <string.h>
#include <string>
#include <string_view>
+#include <tuple>
#include <type_traits>
+#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
@@ -60,6 +66,7 @@
#include <boost/property_tree/ptree_fwd.hpp>
#endif // PCH_LEVEL >= 1
#if PCH_LEVEL >= 2
+#include <osl/conditn.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.hxx>
#include <osl/doublecheckedlocking.h>
@@ -69,21 +76,24 @@
#include <osl/mutex.h>
#include <osl/mutex.hxx>
#include <rtl/alloc.h>
+#include <rtl/character.hxx>
#include <rtl/instance.hxx>
#include <rtl/locale.h>
#include <rtl/math.h>
#include <rtl/math.hxx>
#include <rtl/ref.hxx>
+#include <rtl/strbuf.h>
+#include <rtl/strbuf.hxx>
#include <rtl/string.h>
#include <rtl/string.hxx>
#include <rtl/stringconcat.hxx>
#include <rtl/stringutils.hxx>
#include <rtl/textcvt.h>
#include <rtl/textenc.h>
-#include <rtl/ustrbuf.h>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
+#include <rtl/uuid.h>
#include <sal/backtrace.hxx>
#include <sal/detail/log.h>
#include <sal/log.hxx>
@@ -97,9 +107,10 @@
#include <vcl/GraphicObject.hxx>
#include <vcl/IDialogRenderable.hxx>
#include <vcl/Scanline.hxx>
+#include <vcl/WindowPosSize.hxx>
#include <vcl/alpha.hxx>
#include <vcl/animate/Animation.hxx>
-#include <vcl/animate/AnimationBitmap.hxx>
+#include <vcl/animate/AnimationFrame.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/bitmap/BitmapTypes.hxx>
#include <vcl/bitmapex.hxx>
@@ -107,10 +118,8 @@
#include <vcl/cairo.hxx>
#include <vcl/checksum.hxx>
#include <vcl/customweld.hxx>
-#include <vcl/devicecoordinate.hxx>
#include <vcl/dllapi.h>
#include <vcl/dockwin.hxx>
-#include <vcl/errcode.hxx>
#include <vcl/event.hxx>
#include <vcl/fntstyle.hxx>
#include <vcl/font.hxx>
@@ -120,6 +129,7 @@
#include <vcl/graph.hxx>
#include <vcl/idle.hxx>
#include <vcl/image.hxx>
+#include <vcl/kernarray.hxx>
#include <vcl/keycod.hxx>
#include <vcl/keycodes.hxx>
#include <vcl/mapmod.hxx>
@@ -140,15 +150,15 @@
#include <vcl/rendercontext/State.hxx>
#include <vcl/rendercontext/SystemTextColorFlags.hxx>
#include <vcl/salnativewidgets.hxx>
-#include <vcl/scopedbitmapaccess.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/syswin.hxx>
#include <vcl/task.hxx>
#include <vcl/timer.hxx>
-#include <vcl/toolbox.hxx>
+#include <vcl/toolboxid.hxx>
#include <vcl/uitest/factory.hxx>
#include <vcl/vclenum.hxx>
+#include <vcl/vclevent.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/vclreferencebase.hxx>
#include <vcl/vectorgraphicdata.hxx>
@@ -156,6 +166,7 @@
#include <vcl/weld.hxx>
#include <vcl/window.hxx>
#include <vcl/windowstate.hxx>
+#include <vcl/wintypes.hxx>
#endif // PCH_LEVEL >= 2
#if PCH_LEVEL >= 3
#include <basegfx/basegfxdllapi.h>
@@ -168,59 +179,94 @@
#include <basegfx/point/b3dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b3dpolypolygon.hxx>
+#include <basegfx/range/Range2D.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2drectangle.hxx>
+#include <basegfx/range/b2irange.hxx>
#include <basegfx/range/b3drange.hxx>
#include <basegfx/range/basicrange.hxx>
+#include <basegfx/tuple/Size2D.hxx>
#include <basegfx/tuple/Tuple2D.hxx>
#include <basegfx/tuple/Tuple3D.hxx>
#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/tuple/b2i64tuple.hxx>
#include <basegfx/tuple/b2ituple.hxx>
#include <basegfx/tuple/b3dtuple.hxx>
+#include <basegfx/utils/bgradient.hxx>
#include <basegfx/utils/common.hxx>
+#include <basegfx/utils/systemdependentdata.hxx>
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/vector/b2enums.hxx>
+#include <basegfx/vector/b2isize.hxx>
#include <basegfx/vector/b2ivector.hxx>
#include <basegfx/vector/b3dvector.hxx>
#include <chartview/ChartSfxItemIds.hxx>
#include <chartview/DrawModelWrapper.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
-#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/awt/DeviceInfo.hpp>
-#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/GradientStyle.hpp>
#include <com/sun/star/awt/Key.hpp>
#include <com/sun/star/awt/KeyGroup.hpp>
+#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/beans/Pair.hpp>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/XMultiPropertyStates.hpp>
#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/beans/XPropertySetOption.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/beans/XVetoableChangeListener.hpp>
+#include <com/sun/star/chart/ChartAxisPosition.hpp>
+#include <com/sun/star/chart/ChartDataRowSource.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
+#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/chart/MissingValueTreatment.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
+#include <com/sun/star/chart2/DataPointLabel.hpp>
+#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
+#include <com/sun/star/chart2/StackingDirection.hpp>
+#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-#include <com/sun/star/chart2/XTitle.hpp>
+#include <com/sun/star/chart2/XRegressionCurveCalculator.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/document/XActionLockable.hpp>
#include <com/sun/star/drawing/DashStyle.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/HatchStyle.hpp>
#include <com/sun/star/drawing/LineCap.hpp>
+#include <com/sun/star/drawing/LineJoint.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/PolygonKind.hpp>
#include <com/sun/star/drawing/TextFitToSizeType.hpp>
-#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/drawing/XConnectorShape.hpp>
+#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
+#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapeGroup.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XShapes2.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/frame/XFrame.hpp>
@@ -229,21 +275,14 @@
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/graphic/XPrimitive2D.hpp>
-#include <com/sun/star/i18n/Calendar2.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
-#include <com/sun/star/i18n/DirectionProperty.hpp>
#include <com/sun/star/i18n/ForbiddenCharacters.hpp>
-#include <com/sun/star/i18n/KCharacterType.hpp>
#include <com/sun/star/i18n/LanguageCountryInfo.hpp>
#include <com/sun/star/i18n/LocaleDataItem2.hpp>
#include <com/sun/star/i18n/LocaleItem.hpp>
-#include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp>
-#include <com/sun/star/i18n/ParseResult.hpp>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
-#include <com/sun/star/i18n/UnicodeScript.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/reservedWords.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/EventObject.hpp>
#include <com/sun/star/lang/Locale.hpp>
@@ -254,12 +293,21 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/NumberingType.hpp>
+#include <com/sun/star/style/TabStop.hpp>
#include <com/sun/star/style/XStyle.hpp>
+#include <com/sun/star/style/XStyleSupplier.hpp>
+#include <com/sun/star/text/XTextAppend.hpp>
+#include <com/sun/star/text/XTextContent.hpp>
+#include <com/sun/star/text/XTextCopy.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/text/XTextRangeMover.hpp>
#include <com/sun/star/text/textfield/Type.hpp>
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/RuntimeException.hpp>
@@ -269,37 +317,48 @@
#include <com/sun/star/uno/Type.hxx>
#include <com/sun/star/uno/TypeClass.hdl>
#include <com/sun/star/uno/XAggregation.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/XWeak.hpp>
#include <com/sun/star/uno/genfunc.h>
#include <com/sun/star/uno/genfunc.hxx>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
+#include <com/sun/star/util/XAccounting.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/view/XSelectionChangeListener.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/compbase.hxx>
#include <comphelper/comphelperdllapi.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <comphelper/errcode.hxx>
#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer4.hxx>
+#include <comphelper/lok.hxx>
#include <comphelper/multicontainer2.hxx>
+#include <comphelper/multiinterfacecontainer4.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/propagg.hxx>
#include <comphelper/proparrhlp.hxx>
+#include <comphelper/property.hxx>
#include <comphelper/propertycontainer.hxx>
#include <comphelper/propertycontainerhelper.hxx>
+#include <comphelper/propertysetinfo.hxx>
#include <comphelper/propstate.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/uno3.hxx>
-#include <comphelper/weak.hxx>
+#include <comphelper/unoimplbase.hxx>
#include <cppu/cppudllapi.h>
#include <cppu/unotype.hxx>
#include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/compbase.hxx>
-#include <cppuhelper/compbase_ex.hxx>
#include <cppuhelper/cppuhelperdllapi.h>
#include <cppuhelper/implbase.hxx>
+#include <cppuhelper/implbase12.hxx>
#include <cppuhelper/implbase_ex.hxx>
#include <cppuhelper/implbase_ex_post.hxx>
#include <cppuhelper/implbase_ex_pre.hxx>
@@ -309,11 +368,20 @@
#include <cppuhelper/weak.hxx>
#include <cppuhelper/weakagg.hxx>
#include <cppuhelper/weakref.hxx>
+#include <docmodel/color/ComplexColor.hxx>
+#include <docmodel/color/Transformation.hxx>
+#include <docmodel/dllapi.h>
+#include <docmodel/theme/ThemeColorType.hxx>
#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/CommonTypes.hxx>
#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <editeng/EPaM.hxx>
+#include <editeng/ESelection.hxx>
#include <editeng/editdata.hxx>
+#include <editeng/editeng.hxx>
#include <editeng/editengdllapi.h>
#include <editeng/editobj.hxx>
#include <editeng/editstat.hxx>
@@ -323,21 +391,27 @@
#include <editeng/flditem.hxx>
#include <editeng/forbiddencharacterstable.hxx>
#include <editeng/macros.hxx>
+#include <editeng/memberids.h>
#include <editeng/outliner.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/overflowingtxt.hxx>
#include <editeng/paragraphdata.hxx>
#include <editeng/svxenum.hxx>
#include <editeng/svxfont.hxx>
+#include <editeng/unoedsrc.hxx>
+#include <editeng/unoipset.hxx>
+#include <editeng/unotext.hxx>
#include <i18nlangtag/i18nlangtagdllapi.h>
#include <i18nlangtag/lang.h>
#include <i18nlangtag/languagetag.hxx>
-#include <i18nutil/transliteration.hxx>
+#include <o3tl/concepts.hxx>
#include <o3tl/cow_wrapper.hxx>
#include <o3tl/deleter.hxx>
#include <o3tl/enumarray.hxx>
+#include <o3tl/hash_combine.hxx>
#include <o3tl/safeint.hxx>
#include <o3tl/sorted_vector.hxx>
+#include <o3tl/string_view.hxx>
#include <o3tl/strong_int.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <o3tl/underlyingenumvalue.hxx>
@@ -354,13 +428,14 @@
#include <svl/SfxBroadcaster.hxx>
#include <svl/eitem.hxx>
#include <svl/hint.hxx>
+#include <svl/ilstitem.hxx>
#include <svl/intitem.hxx>
#include <svl/itempool.hxx>
+#include <svl/itemprop.hxx>
#include <svl/itemset.hxx>
#include <svl/languageoptions.hxx>
#include <svl/lstner.hxx>
-#include <svl/nfkeytab.hxx>
-#include <svl/ondemand.hxx>
+#include <svl/numformat.hxx>
#include <svl/poolitem.hxx>
#include <svl/setitem.hxx>
#include <svl/stritem.hxx>
@@ -373,7 +448,6 @@
#include <svtools/colorcfg.hxx>
#include <svtools/svtdllapi.h>
#include <svx/ActionDescriptionProvider.hxx>
-#include <svx/DiagramDataInterface.hxx>
#include <svx/XPropertyEntry.hxx>
#include <svx/chrtitem.hxx>
#include <svx/ipolypolygoneditorcontroller.hxx>
@@ -389,11 +463,11 @@
#include <svx/sdtaitm.hxx>
#include <svx/sdtakitm.hxx>
#include <svx/selectioncontroller.hxx>
-#include <svx/shapeproperty.hxx>
#include <svx/svddef.hxx>
#include <svx/svddrag.hxx>
#include <svx/svdedtv.hxx>
#include <svx/svdedxv.hxx>
+#include <svx/svdgeodata.hxx>
#include <svx/svdglev.hxx>
#include <svx/svdglue.hxx>
#include <svx/svdhdl.hxx>
@@ -407,6 +481,7 @@
#include <svx/svdobjkind.hxx>
#include <svx/svdoedge.hxx>
#include <svx/svdotext.hxx>
+#include <svx/svdpage.hxx>
#include <svx/svdpntv.hxx>
#include <svx/svdpoev.hxx>
#include <svx/svdsnpv.hxx>
@@ -416,19 +491,18 @@
#include <svx/svdtypes.hxx>
#include <svx/svdundo.hxx>
#include <svx/svxdllapi.h>
+#include <svx/unoshape.hxx>
#include <svx/xdash.hxx>
#include <svx/xdef.hxx>
-#include <svx/xgrad.hxx>
#include <svx/xhatch.hxx>
#include <svx/xit.hxx>
#include <svx/xpoly.hxx>
#include <svx/xtable.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
+#include <tools/UniqueID.hxx>
#include <tools/color.hxx>
#include <tools/date.hxx>
#include <tools/datetime.hxx>
#include <tools/degree.hxx>
-#include <tools/diagnose_ex.h>
#include <tools/fldunit.hxx>
#include <tools/fontenum.hxx>
#include <tools/fract.hxx>
@@ -441,63 +515,92 @@
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/solar.h>
+#include <tools/stream.hxx>
#include <tools/time.hxx>
#include <tools/toolsdllapi.h>
#include <tools/weakbase.h>
-#include <tools/weakbase.hxx>
-#include <tools/wintypes.hxx>
#include <typelib/typeclass.h>
#include <typelib/typedescription.h>
#include <typelib/uik.h>
#include <uno/any2.h>
#include <uno/data.h>
#include <uno/sequence2.h>
-#include <unotools/calendarwrapper.hxx>
-#include <unotools/charclass.hxx>
#include <unotools/eventlisteneradapter.hxx>
#include <unotools/fontdefs.hxx>
-#include <unotools/localedatawrapper.hxx>
-#include <unotools/nativenumberwrapper.hxx>
#include <unotools/options.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/syslocale.hxx>
-#include <unotools/transliterationwrapper.hxx>
#include <unotools/unotoolsdllapi.h>
+#include <unotools/weakref.hxx>
#endif // PCH_LEVEL >= 3
#if PCH_LEVEL >= 4
+#include <Axis.hxx>
#include <AxisHelper.hxx>
+#include <AxisIndexDefines.hxx>
+#include <BaseCoordinateSystem.hxx>
+#include <BaseGFXHelper.hxx>
+#include <CharacterProperties.hxx>
#include <CharacterPropertyItemConverter.hxx>
#include <ChartController.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
+#include <ChartTypeManager.hxx>
+#include <ChartTypeTemplate.hxx>
+#include <ChartView.hxx>
#include <ChartWindow.hxx>
+#include <Clipping.hxx>
+#include <CloneHelper.hxx>
#include <CommonConverters.hxx>
#include <ControllerLockGuard.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
+#include <DataSeriesProperties.hxx>
+#include <DataSource.hxx>
#include <DataSourceHelper.hxx>
+#include <DateHelper.hxx>
+#include <Diagram.hxx>
#include <DiagramHelper.hxx>
#include <DrawViewWrapper.hxx>
+#include <ExplicitCategoriesProvider.hxx>
#include <FastPropertyIdRanges.hxx>
#include <FillProperties.hxx>
#include <GraphicPropertyItemConverter.hxx>
+#include <GridProperties.hxx>
#include <ItemConverter.hxx>
#include <ItemPropertyMap.hxx>
+#include <LabelPositionHelper.hxx>
+#include <LabeledDataSequence.hxx>
+#include <Legend.hxx>
#include <LegendHelper.hxx>
#include <LinePropertiesHelper.hxx>
-#include <ObjectHierarchy.hxx>
+#include <ModifyListenerHelper.hxx>
+#include <NumberFormatterWrapper.hxx>
+#include <OPropertySet.hxx>
#include <ObjectIdentifier.hxx>
#include <ObjectNameProvider.hxx>
+#include <PlottingPositionHelper.hxx>
+#include <PropertyHelper.hxx>
+#include <PropertyMapper.hxx>
+#include <ReferenceSizeProvider.hxx>
+#include <RegressionCalculationHelper.hxx>
+#include <RegressionCurveCalculator.hxx>
#include <RegressionCurveHelper.hxx>
+#include <RegressionCurveModel.hxx>
+#include <RelativePositionHelper.hxx>
+#include <RelativeSizeHelper.hxx>
#include <ResId.hxx>
+#include <ShapeFactory.hxx>
#include <StatisticsHelper.hxx>
#include <ThreeDHelper.hxx>
#include <TitleHelper.hxx>
#include <UserDefinedProperties.hxx>
+#include <VLineProperties.hxx>
#include <ViewElementListProvider.hxx>
#include <WrappedProperty.hxx>
-#include <charttoolsdllapi.hxx>
+#include <defines.hxx>
#include <servicenames.hxx>
+#include <servicenames_charttypes.hxx>
#include <unonames.hxx>
#endif // PCH_LEVEL >= 4
diff --git a/chart2/inc/pch/precompiled_chartcontroller.cxx b/chart2/inc/pch/precompiled_chartcontroller.cxx
deleted file mode 100644
index 44d47c4a423d..000000000000
--- a/chart2/inc/pch/precompiled_chartcontroller.cxx
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -*- 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 "precompiled_chartcontroller.hxx"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/inc/pch/precompiled_chartcore.hxx b/chart2/inc/pch/precompiled_chartcore.hxx
deleted file mode 100644
index dd06c9bc8a90..000000000000
--- a/chart2/inc/pch/precompiled_chartcore.hxx
+++ /dev/null
@@ -1,336 +0,0 @@
-/* -*- 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 has been autogenerated by update_pch.sh. It is possible to edit it
- manually (such as when an include file has been moved/renamed/removed). All such
- manual changes will be rewritten by the next run of update_pch.sh (which presumably
- also fixes all possible problems, so it's usually better to use it).
-
- Generated on 2021-09-12 11:51:16 using:
- ./bin/update_pch chart2 chartcore --cutoff=3 --exclude:system --exclude:module --include:local
-
- If after updating build fails, use the following command to locate conflicting headers:
- ./bin/update_pch_bisect ./chart2/inc/pch/precompiled_chartcore.hxx "make chart2.build" --find-conflicts
-*/
-
-#include <sal/config.h>
-#if PCH_LEVEL >= 1
-#include <algorithm>
-#include <cassert>
-#include <cmath>
-#include <cstddef>
-#include <cstdlib>
-#include <functional>
-#include <iterator>
-#include <limits>
-#include <map>
-#include <memory>
-#include <new>
-#include <optional>
-#include <ostream>
-#include <set>
-#include <string_view>
-#include <type_traits>
-#include <unordered_map>
-#include <unordered_set>
-#include <utility>
-#include <vector>
-#include <boost/property_tree/ptree_fwd.hpp>
-#endif // PCH_LEVEL >= 1
-#if PCH_LEVEL >= 2
-#include <osl/conditn.hxx>
-#include <osl/diagnose.h>
-#include <osl/doublecheckedlocking.h>
-#include <osl/getglobalmutex.hxx>
-#include <osl/mutex.h>
-#include <osl/mutex.hxx>
-#include <rtl/alloc.h>
-#include <rtl/character.hxx>
-#include <rtl/instance.hxx>
-#include <rtl/locale.h>
-#include <rtl/math.h>
-#include <rtl/math.hxx>
-#include <rtl/ref.hxx>
-#include <rtl/string.hxx>
-#include <rtl/stringconcat.hxx>
-#include <rtl/stringutils.hxx>
-#include <rtl/textenc.h>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/ustring.h>
-#include <rtl/ustring.hxx>
-#include <rtl/uuid.h>
-#include <sal/log.hxx>
-#include <sal/macros.h>
-#include <sal/types.h>
-#include <vcl/bitmap.hxx>
-#include <vcl/cairo.hxx>
-#include <vcl/devicecoordinate.hxx>
-#include <vcl/dllapi.h>
-#include <vcl/errcode.hxx>
-#include <vcl/font.hxx>
-#include <vcl/mapmod.hxx>
-#include <vcl/metaactiontypes.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/region.hxx>
-#include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
-#include <vcl/rendercontext/AntialiasingFlags.hxx>
-#include <vcl/rendercontext/DrawGridFlags.hxx>
-#include <vcl/rendercontext/DrawImageFlags.hxx>
-#include <vcl/rendercontext/DrawModeFlags.hxx>
-#include <vcl/rendercontext/DrawTextFlags.hxx>
-#include <vcl/rendercontext/GetDefaultFontFlags.hxx>
-#include <vcl/rendercontext/ImplMapRes.hxx>
-#include <vcl/rendercontext/InvertFlags.hxx>
-#include <vcl/rendercontext/RasterOp.hxx>
-#include <vcl/rendercontext/SalLayoutFlags.hxx>
-#include <vcl/rendercontext/State.hxx>
-#include <vcl/rendercontext/SystemTextColorFlags.hxx>
-#include <vcl/salnativewidgets.hxx>
-#include <vcl/settings.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/vclreferencebase.hxx>
-#include <vcl/wall.hxx>
-#endif // PCH_LEVEL >= 2
-#if PCH_LEVEL >= 3
-#include <basegfx/basegfxdllapi.h>
-#include <basegfx/numeric/ftools.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/range/b2drange.hxx>
-#include <basegfx/tuple/b2dtuple.hxx>
-#include <basegfx/tuple/b2ituple.hxx>
-#include <basegfx/vector/b2enums.hxx>
-#include <basegfx/vector/b2ivector.hxx>
-#include <chartview/DrawModelWrapper.hxx>
-#include <com/sun/star/awt/DeviceInfo.hpp>
-#include <com/sun/star/awt/Point.hpp>
-#include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/beans/PropertyState.hpp>
-#include <com/sun/star/beans/XFastPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertyStates.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertySetOption.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/chart/ChartAxisPosition.hpp>
-#include <com/sun/star/chart/ChartDataRowSource.hpp>
-#include <com/sun/star/chart/ChartLegendExpansion.hpp>
-#include <com/sun/star/chart/DataLabelPlacement.hpp>
-#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <com/sun/star/chart/MissingValueTreatment.hpp>
-#include <com/sun/star/chart/TimeUnit.hpp>
-#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/CurveStyle.hpp>
-#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
-#include <com/sun/star/chart2/DataPointLabel.hpp>
-#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/MovingAverageType.hpp>
-#include <com/sun/star/chart2/RelativePosition.hpp>
-#include <com/sun/star/chart2/RelativeSize.hpp>
-#include <com/sun/star/chart2/StackingDirection.hpp>
-#include <com/sun/star/chart2/Symbol.hpp>
-#include <com/sun/star/chart2/SymbolStyle.hpp>
-#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystem.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XDataSeries.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/XRegressionCurveCalculator.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-#include <com/sun/star/chart2/data/XDataSequence.hpp>
-#include <com/sun/star/chart2/data/XDataSink.hpp>
-#include <com/sun/star/chart2/data/XDataSource.hpp>
-#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
-#include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp>
-#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/drawing/BitmapMode.hpp>
-#include <com/sun/star/drawing/Direction3D.hpp>
-#include <com/sun/star/drawing/DoubleSequence.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/drawing/HomogenMatrix.hpp>
-#include <com/sun/star/drawing/LineCap.hpp>
-#include <com/sun/star/drawing/LineJoint.hpp>
-#include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
-#include <com/sun/star/drawing/Position3D.hpp>
-#include <com/sun/star/drawing/RectanglePoint.hpp>
-#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
-#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
-#include <com/sun/star/drawing/XDrawPage.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/embed/Aspects.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XServiceName.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/style/ParagraphAdjust.hpp>
-#include <com/sun/star/style/XStyleSupplier.hpp>
-#include <com/sun/star/text/WritingMode2.hpp>
-#include <com/sun/star/uno/Any.h>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Type.h>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/util/CloseVetoException.hpp>
-#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
-#include <com/sun/star/util/XModifyListener.hpp>
-#include <com/sun/star/view/XSelectionChangeListener.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <comphelper/comphelperdllapi.h>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/property.hxx>
-#include <comphelper/sequence.hxx>
-#include <comphelper/servicehelper.hxx>
-#include <comphelper/uno3.hxx>
-#include <cppu/cppudllapi.h>
-#include <cppuhelper/compbase.hxx>
-#include <cppuhelper/compbase_ex.hxx>
-#include <cppuhelper/cppuhelperdllapi.h>
-#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/implbase_ex.hxx>
-#include <cppuhelper/interfacecontainer.h>
-#include <cppuhelper/propshlp.hxx>
-#include <cppuhelper/supportsservice.hxx>
-#include <cppuhelper/weak.hxx>
-#include <cppuhelper/weakref.hxx>
-#include <editeng/editengdllapi.h>
-#include <editeng/unoprnms.hxx>
-#include <i18nlangtag/i18nlangtagdllapi.h>
-#include <i18nlangtag/lang.h>
-#include <libxml/xmlwriter.h>
-#include <o3tl/cow_wrapper.hxx>
-#include <o3tl/typed_flags_set.hxx>
-#include <officecfg/Office/Compatibility.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include <svl/cenumitm.hxx>
-#include <svl/cintitem.hxx>
-#include <svl/eitem.hxx>
-#include <svl/intitem.hxx>
-#include <svl/itemset.hxx>
-#include <svl/lstner.hxx>
-#include <svl/numformat.hxx>
-#include <svl/poolitem.hxx>
-#include <svl/svldllapi.h>
-#include <svl/typedwhich.hxx>
-#include <svl/zforlist.hxx>
-#include <svx/DiagramDataInterface.hxx>
-#include <svx/shapeproperty.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdobjkind.hxx>
-#include <svx/svdtypes.hxx>
-#include <svx/svxdllapi.h>
-#include <svx/unoshape.hxx>
-#include <tools/UnitConversion.hxx>
-#include <tools/color.hxx>
-#include <tools/date.hxx>
-#include <tools/degree.hxx>
-#include <tools/diagnose_ex.h>
-#include <tools/gen.hxx>
-#include <tools/helpers.hxx>
-#include <tools/lineend.hxx>
-#include <tools/link.hxx>
-#include <tools/long.hxx>
-#include <tools/poly.hxx>
-#include <tools/ref.hxx>
-#include <tools/solar.h>
-#include <tools/toolsdllapi.h>
-#include <tools/weakbase.h>
-#include <unotools/fontdefs.hxx>
-#include <unotools/options.hxx>
-#include <unotools/resmgr.hxx>
-#include <unotools/saveopt.hxx>
-#include <unotools/unotoolsdllapi.h>
-#endif // PCH_LEVEL >= 3
-#if PCH_LEVEL >= 4
-#include <AxisHelper.hxx>
-#include <AxisIndexDefines.hxx>
-#include <BaseGFXHelper.hxx>
-#include <CartesianCoordinateSystem.hxx>
-#include <CharacterProperties.hxx>
-#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
-#include <ChartTypeHelper.hxx>
-#include <ChartViewHelper.hxx>
-#include <Clipping.hxx>
-#include <CloneHelper.hxx>
-#include <CommonConverters.hxx>
-#include <CommonFunctors.hxx>
-#include <ControllerLockGuard.hxx>
-#include <DataSeries.hxx>
-#include <DataSeriesHelper.hxx>
-#include <DataSource.hxx>
-#include <DataSourceHelper.hxx>
-#include <DateHelper.hxx>
-#include <DiagramHelper.hxx>
-#include <EventListenerHelper.hxx>
-#include <ExplicitCategoriesProvider.hxx>
-#include <FillProperties.hxx>
-#include <LabelPositionHelper.hxx>
-#include <LabeledDataSequence.hxx>
-#include <LegendEntryProvider.hxx>
-#include <LinePropertiesHelper.hxx>
-#include <MediaDescriptorHelper.hxx>
-#include <MinimumAndMaximumSupplier.hxx>
-#include <ModifyListenerHelper.hxx>
-#include <NumberFormatterWrapper.hxx>
-#include <OPropertySet.hxx>
-#include <ObjectIdentifier.hxx>
-#include <PlottingPositionHelper.hxx>
-#include <PolarCoordinateSystem.hxx>
-#include <PolarLabelPositionHelper.hxx>
-#include <PropertyHelper.hxx>
-#include <PropertyMapper.hxx>
-#include <ReferenceSizeProvider.hxx>
-#include <RegressionCalculationHelper.hxx>
-#include <RegressionCurveCalculator.hxx>
-#include <RegressionCurveHelper.hxx>
-#include <RelativePositionHelper.hxx>
-#include <RelativeSizeHelper.hxx>
-#include <ResId.hxx>
-#include <ScaleAutomatism.hxx>
-#include <ShapeFactory.hxx>
-#include <SpecialCharacters.hxx>
-#include <Stripe.hxx>
-#include <ThreeDHelper.hxx>
-#include <TitleHelper.hxx>
-#include <UserDefinedProperties.hxx>
-#include <VLineProperties.hxx>
-#include <ViewDefines.hxx>
-#include <WeakListenerAdapter.hxx>
-#include <WrappedProperty.hxx>
-#include <charttoolsdllapi.hxx>
-#include <defines.hxx>
-#include <servicenames.hxx>
-#include <servicenames_charttypes.hxx>
-#include <servicenames_coosystems.hxx>
-#include <unonames.hxx>
-#endif // PCH_LEVEL >= 4
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc
index ab6ca48c8376..522dd8cdedfa 100644
--- a/chart2/inc/strings.hrc
+++ b/chart2/inc/strings.hrc
@@ -19,7 +19,7 @@
#ifndef CHART_STRINGS_HRC
#define CHART_STRINGS_HRC
-#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
+#define NC_(Context, String) TranslateId(Context, u8##String)
#define STR_DLG_CHART_WIZARD NC_("STR_DLG_CHART_WIZARD", "Chart Wizard")
#define STR_DLG_SMOOTH_LINE_PROPERTIES NC_("STR_DLG_SMOOTH_LINE_PROPERTIES", "Smooth Lines")
@@ -48,6 +48,7 @@
#define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance")
#define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination")
#define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography")
+#define STR_PAGE_COLOR_PALETTE NC_("STR_PAGE_COLOR_PALETTE", "Color Palette")
#define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION")
#define STR_OBJECT_AXIS NC_("STR_OBJECT_AXIS", "Axis")
#define STR_OBJECT_AXIS_X NC_("STR_OBJECT_AXIS_X", "X Axis")
@@ -145,6 +146,7 @@
#define STR_TEXT_DIRECTION_SUPER NC_("STR_TEXT_DIRECTION_SUPER", "Use superordinate object settings")
#define STR_PROPERTY_ROLE_FILLCOLOR NC_("STR_PROPERTY_ROLE_FILLCOLOR", "Fill Color")
#define STR_PROPERTY_ROLE_BORDERCOLOR NC_("STR_PROPERTY_ROLE_BORDERCOLOR", "Border Color")
+#define STR_DATA_TABLE NC_("STR_DATA_TABLE", "Data Table")
#define STR_CONTROLTEXT_ERROR_BARS_FROM_DATA NC_("STR_CONTROLTEXT_ERROR_BARS_FROM_DATA", "From Data Table")
#define STR_REGRESSION_LINEAR NC_("STR_REGRESSION_LINEAR", "Linear")
@@ -157,9 +159,14 @@
#define STR_TYPE_COLUMN NC_("STR_TYPE_COLUMN", "Column")
#define STR_TYPE_BAR NC_("STR_TYPE_BAR", "Bar")
+#define STR_TYPE_HISTOGRAM NC_("STR_TYPE_HISTOGRAM", "Histogram")
+#define STR_HISTOGRAM NC_("STR_HISTOGRAM", "Histogram Chart")
#define STR_TYPE_AREA NC_("STR_TYPE_AREA", "Area")
#define STR_TYPE_PIE NC_("STR_TYPE_PIE", "Pie")
+#define STR_TYPE_OFPIE NC_("STR_TYPE_PIE", "Of-Pie")
#define STR_PIE_EXPLODED NC_("STR_PIE_EXPLODED", "Exploded Pie Chart")
+#define STR_BAR_OF_PIE NC_("STR_BAR_OF_PIE", "Bar-of-pie Chart")
+#define STR_PIE_OF_PIE NC_("STR_PIE_OF_PIE", "Pie-of-pie Chart")
#define STR_DONUT_EXPLODED NC_("STR_DONUT_EXPLODED", "Exploded Donut Chart")
#define STR_DONUT NC_("STR_DONUT", "Donut")
#define STR_TYPE_LINE NC_("STR_TYPE_LINE", "Line")
diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
index 12b35914a6f5..abe190844962 100644
--- a/chart2/inc/unonames.hxx
+++ b/chart2/inc/unonames.hxx
@@ -11,28 +11,28 @@
#include <rtl/ustring.hxx>
-inline constexpr OUStringLiteral CHART_UNONAME_SORT_BY_XVALUES = u"SortByXValues";
-inline constexpr OUStringLiteral CHART_UNONAME_SPLINE_TYPE = u"SplineType";
-inline constexpr OUStringLiteral CHART_UNONAME_SPLINE_ORDER = u"SplineOrder";
-inline constexpr OUStringLiteral CHART_UNONAME_SPLINE_RESOLUTION = u"SplineResolution";
-inline constexpr OUStringLiteral CHART_UNONAME_CURVE_STYLE = u"CurveStyle";
-inline constexpr OUStringLiteral CHART_UNONAME_CURVE_RESOLUTION = u"CurveResolution";
-inline constexpr OUStringLiteral CHART_UNONAME_NUMFMT = u"NumberFormat";
-inline constexpr OUStringLiteral CHART_UNONAME_LINK_TO_SRC_NUMFMT = u"LinkNumberFormatToSource";
-inline constexpr OUStringLiteral CHART_UNONAME_ERRORBAR_X = u"ErrorBarX";
-inline constexpr OUStringLiteral CHART_UNONAME_ERRORBAR_Y = u"ErrorBarY";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL = u"Label";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_SEP = u"LabelSeparator";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_BORDER_STYLE = u"LabelBorderStyle";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_BORDER_WIDTH = u"LabelBorderWidth";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_BORDER_COLOR = u"LabelBorderColor";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_BORDER_DASH = u"LabelBorderDash";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_BORDER_DASHNAME = u"LabelBorderDashName";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_BORDER_TRANS = u"LabelBorderTransparency";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_FILL_STYLE = u"LabelFillStyle";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_FILL_BACKGROUND = u"LabelFillBackground";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_FILL_HATCH_NAME = u"LabelFillHatchName";
-inline constexpr OUStringLiteral CHART_UNONAME_LABEL_FILL_COLOR = u"LabelFillColor";
-inline constexpr OUStringLiteral CHART_UNONAME_CUSTOM_LABEL_FIELDS = u"CustomLabelFields";
+inline constexpr OUString CHART_UNONAME_SORT_BY_XVALUES = u"SortByXValues"_ustr;
+inline constexpr OUString CHART_UNONAME_SPLINE_TYPE = u"SplineType"_ustr;
+inline constexpr OUString CHART_UNONAME_SPLINE_ORDER = u"SplineOrder"_ustr;
+inline constexpr OUString CHART_UNONAME_SPLINE_RESOLUTION = u"SplineResolution"_ustr;
+inline constexpr OUString CHART_UNONAME_CURVE_STYLE = u"CurveStyle"_ustr;
+inline constexpr OUString CHART_UNONAME_CURVE_RESOLUTION = u"CurveResolution"_ustr;
+inline constexpr OUString CHART_UNONAME_NUMFMT = u"NumberFormat"_ustr;
+inline constexpr OUString CHART_UNONAME_LINK_TO_SRC_NUMFMT = u"LinkNumberFormatToSource"_ustr;
+inline constexpr OUString CHART_UNONAME_ERRORBAR_X = u"ErrorBarX"_ustr;
+inline constexpr OUString CHART_UNONAME_ERRORBAR_Y = u"ErrorBarY"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL = u"Label"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_SEP = u"LabelSeparator"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_BORDER_STYLE = u"LabelBorderStyle"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_BORDER_WIDTH = u"LabelBorderWidth"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_BORDER_COLOR = u"LabelBorderColor"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_BORDER_DASH = u"LabelBorderDash"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_BORDER_DASHNAME = u"LabelBorderDashName"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_BORDER_TRANS = u"LabelBorderTransparency"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_FILL_STYLE = u"LabelFillStyle"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_FILL_BACKGROUND = u"LabelFillBackground"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_FILL_HATCH_NAME = u"LabelFillHatchName"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_FILL_COLOR = u"LabelFillColor"_ustr;
+inline constexpr OUString CHART_UNONAME_CUSTOM_LABEL_FIELDS = u"CustomLabelFields"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/qa/TestCaseOldAPI.java b/chart2/qa/TestCaseOldAPI.java
index 613ba480e7be..f5bc4f571c4c 100644
--- a/chart2/qa/TestCaseOldAPI.java
+++ b/chart2/qa/TestCaseOldAPI.java
@@ -162,7 +162,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
float fHeight = (float)17.0;
xTitleProp.setPropertyValue( "String", aTitle );
- xTitleProp.setPropertyValue( "CharHeight", new Float( fHeight ) );
+ xTitleProp.setPropertyValue( "CharHeight", Float.valueOf( fHeight ) );
float fNewHeight = AnyConverter.toFloat( xTitleProp.getPropertyValue( "CharHeight" ) );
assure( "Changing CharHeight via old API failed", fNewHeight == fHeight );
@@ -213,8 +213,8 @@ public class TestCaseOldAPI extends ComplexTestCase {
float fHeight = (float)14.0;
xTitleProp.setPropertyValue( "CharColor", Integer.valueOf( nColor ) );
- xTitleProp.setPropertyValue( "CharWeight", new Float( fWeight ));
- xTitleProp.setPropertyValue( "CharHeight", new Float( fHeight ) );
+ 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 );
@@ -356,7 +356,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
double nNewMax = 12.3;
double nNewOrigin = 2.7;
- xProp.setPropertyValue( "Max", new Double( nNewMax ));
+ xProp.setPropertyValue( "Max", Double.valueOf( nNewMax ));
assure( "AutoMax is on", ! AnyConverter.toBoolean( xProp.getPropertyValue( "AutoMax" )) );
assure( "Maximum value invalid",
@@ -367,7 +367,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
xProp.setPropertyValue( "AutoMin", Boolean.TRUE);
assure( "AutoMin is off", AnyConverter.toBoolean( xProp.getPropertyValue( "AutoMin" )) );
- xProp.setPropertyValue( "Origin", new Double( nNewOrigin ));
+ xProp.setPropertyValue( "Origin", Double.valueOf( nNewOrigin ));
assure( "Origin invalid",
utils.approxEqual(
AnyConverter.toDouble( xProp.getPropertyValue( "Origin" )),
@@ -390,7 +390,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
assure( "Property LineColor",
AnyConverter.toInt( xProp.getPropertyValue( "LineColor" )) == nNewColor );
float fNewCharHeight = (float)(16.0);
- xProp.setPropertyValue( "CharHeight", new Float( fNewCharHeight ));
+ xProp.setPropertyValue( "CharHeight", Float.valueOf( fNewCharHeight ));
assure( "Property CharHeight",
AnyConverter.toFloat( xProp.getPropertyValue( "CharHeight" )) == fNewCharHeight );
@@ -400,7 +400,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
AnyConverter.toInt( xProp.getPropertyValue( "TextRotation" )) == nNewTextRotation );
double fStepMain = 10.0;
- xProp.setPropertyValue( "StepMain", new Double( fStepMain ));
+ xProp.setPropertyValue( "StepMain", Double.valueOf( fStepMain ));
assure( "Property StepMain",
AnyConverter.toDouble( xProp.getPropertyValue( "StepMain" )) == fStepMain );
@@ -408,7 +408,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
// internally, the help-step is stored as an integer number of
// substeps
double fStepHelp = 5.0;
- xProp.setPropertyValue( "StepHelp", new Double( fStepHelp ));
+ xProp.setPropertyValue( "StepHelp", Double.valueOf( fStepHelp ));
assure( "Property StepHelp",
AnyConverter.toDouble( xProp.getPropertyValue( "StepHelp" )) == fStepHelp );
@@ -444,7 +444,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
xLegendProp.getPropertyValue( "Alignment" )) == eNewPos );
float fNewCharHeight = (float)(11.0);
- xLegendProp.setPropertyValue( "CharHeight", new Float( fNewCharHeight ));
+ xLegendProp.setPropertyValue( "CharHeight", Float.valueOf( fNewCharHeight ));
assure( "Property CharHeight",
AnyConverter.toFloat( xLegendProp.getPropertyValue( "CharHeight" )) == fNewCharHeight );
diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx
index ee024531e88b..30cd8c656526 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -34,7 +34,8 @@ namespace com::sun::star::util { class XNumberFormats; }
class PivotChartTest : public ChartTest
{
public:
- PivotChartTest() : ChartTest()
+ PivotChartTest()
+ : ChartTest(u"/chart2/qa/extras/data/"_ustr)
{}
void testRoundtrip();
@@ -54,6 +55,9 @@ public:
CPPUNIT_TEST(testPivotChartRowFieldInOutlineMode);
CPPUNIT_TEST(testPivotChartWithDateRowField);
CPPUNIT_TEST_SUITE_END();
+
+private:
+ uno::Reference<sheet::XDataPilotTable> getPivotTableByName(sal_Int32 nIndex, OUString const & sPivotTableName);
};
namespace
@@ -71,7 +75,7 @@ void lclModifyOrientation(uno::Reference<sheet::XDataPilotDescriptor> const & xD
OUString aName = xNamed->getName();
uno::Reference<beans::XPropertySet> xPropSet(xNamed, UNO_QUERY_THROW);
if (aName == sFieldName)
- xPropSet->setPropertyValue("Orientation", uno::makeAny(eOrientation));
+ xPropSet->setPropertyValue(u"Orientation"_ustr, uno::Any(eOrientation));
}
}
@@ -87,7 +91,7 @@ void lclModifyFunction(uno::Reference<sheet::XDataPilotDescriptor> const & xDesc
OUString aName = xNamed->getName();
uno::Reference<beans::XPropertySet> xPropSet(xNamed, UNO_QUERY_THROW);
if (aName == sFieldName)
- xPropSet->setPropertyValue("Function", uno::makeAny(eFunction));
+ xPropSet->setPropertyValue(u"Function"_ustr, uno::Any(eFunction));
}
}
@@ -106,7 +110,7 @@ void lclModifyLayoutInfo(uno::Reference<sheet::XDataPilotDescriptor> const & xDe
{
uno::Any aValue;
aValue <<= aLayoutInfo;
- xPropSet->setPropertyValue("LayoutInfo", aValue);
+ xPropSet->setPropertyValue(u"LayoutInfo"_ustr, aValue);
}
}
}
@@ -126,7 +130,7 @@ void lclModifySubtotals(uno::Reference<sheet::XDataPilotDescriptor> const & xDes
{
uno::Any aValue;
aValue <<= rSubtotalFunctions;
- xPropSet->setPropertyValue("Subtotals", aValue);
+ xPropSet->setPropertyValue(u"Subtotals"_ustr, aValue);
}
}
}
@@ -134,13 +138,13 @@ void lclModifySubtotals(uno::Reference<sheet::XDataPilotDescriptor> const & xDes
void lclModifyColumnGrandTotal(uno::Reference<sheet::XDataPilotDescriptor> const & xDataPilotDescriptor, bool bTotal)
{
uno::Reference<beans::XPropertySet> xProperties(xDataPilotDescriptor, uno::UNO_QUERY_THROW);
- xProperties->setPropertyValue("ColumnGrand", uno::makeAny(bTotal));
+ xProperties->setPropertyValue(u"ColumnGrand"_ustr, uno::Any(bTotal));
}
void lclModifyRowGrandTotal(uno::Reference<sheet::XDataPilotDescriptor> const & xDataPilotDescriptor, bool bTotal)
{
uno::Reference<beans::XPropertySet> xProperties(xDataPilotDescriptor, uno::UNO_QUERY_THROW);
- xProperties->setPropertyValue("RowGrand", uno::makeAny(bTotal));
+ xProperties->setPropertyValue(u"RowGrand"_ustr, uno::Any(bTotal));
}
void lclCheckSequence(std::vector<double> const & reference,
@@ -168,30 +172,11 @@ void lclCheckCategories(std::vector<OUString> const & reference,
}
}
-OUString lclGetLabel(Reference<chart2::XChartDocument> const & xChartDoc, sal_Int32 nSeriesIndex)
-{
- Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, nSeriesIndex);
- return xLabelDataSequence->getData()[0].get<OUString>();
-}
-
-uno::Reference<sheet::XDataPilotTable> lclGetPivotTableByName(sal_Int32 nIndex, OUString const & sPivotTableName,
- uno::Reference<lang::XComponent> const & xComponent)
-{
- uno::Reference<sheet::XSpreadsheetDocument> xDoc(xComponent, UNO_QUERY_THROW);
- uno::Reference<container::XIndexAccess> xSheetIndexAccess(xDoc->getSheets(), UNO_QUERY_THROW);
- uno::Any aAny = xSheetIndexAccess->getByIndex(nIndex);
- uno::Reference<sheet::XSpreadsheet> xSheet;
- CPPUNIT_ASSERT(aAny >>= xSheet);
- uno::Reference<sheet::XDataPilotTablesSupplier> xDataPilotTablesSupplier(xSheet, uno::UNO_QUERY_THROW);
- uno::Reference<sheet::XDataPilotTables> xDataPilotTables = xDataPilotTablesSupplier->getDataPilotTables();
- return uno::Reference<sheet::XDataPilotTable>(xDataPilotTables->getByName(sPivotTableName), UNO_QUERY_THROW);
-}
-
uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence>>
lclGetCategories(Reference<chart2::XChartDocument> const & xChartDoc)
{
uno::Sequence<beans::PropertyValue> aArguments( comphelper::InitPropertySequence(
- {{"CellRangeRepresentation", uno::Any(OUString("PT@categories"))}} ));
+ {{"CellRangeRepresentation", uno::Any(u"PT@categories"_ustr)}} ));
uno::Reference<chart2::data::XDataProvider> xDataProvider(xChartDoc->getDataProvider(), uno::UNO_SET_THROW);
return xDataProvider->createDataSource(aArguments)->getDataSequences();
@@ -233,22 +218,22 @@ table::CellRangeAddress lclCreateTestData(uno::Reference<sheet::XSpreadsheetDocu
CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is());
std::vector<OUString> aHeaders {
- "Country", "City", "Type", "Sales T1", "Sales T2", "Sales T3", "Sales T4", "Date"
+ u"Country"_ustr, u"City"_ustr, u"Type"_ustr, u"Sales T1"_ustr, u"Sales T2"_ustr, u"Sales T3"_ustr, u"Sales T4"_ustr, u"Date"_ustr
};
std::vector<std::vector<Value>> 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"} }
+ { {u"FR"_ustr}, {u"Paris"_ustr}, {u"A"_ustr}, {123.0}, {223.0}, {323.0}, {423.0}, {u"12/14/15"_ustr} },
+ { {u"EN"_ustr}, {u"London"_ustr}, {u"A"_ustr}, {456.0}, {556.0}, {656.0}, {756.0}, {u"12/11/15"_ustr} },
+ { {u"DE"_ustr}, {u"Berlin"_ustr}, {u"A"_ustr}, {468.0}, {568.0}, {668.0}, {768.0}, {u"12/11/15"_ustr} },
+ { {u"FR"_ustr}, {u"Nantes"_ustr}, {u"A"_ustr}, {694.0}, {794.0}, {894.0}, {994.0}, {u"12/11/15"_ustr} },
+ { {u"EN"_ustr}, {u"Glasgow"_ustr}, {u"A"_ustr}, {298.0}, {398.0}, {498.0}, {598.0}, {u"12/11/15"_ustr} },
+ { {u"DE"_ustr}, {u"Munich"_ustr}, {u"A"_ustr}, {369.0}, {469.0}, {569.0}, {669.0}, {u"12/11/15"_ustr} },
+ { {u"FR"_ustr}, {u"Paris"_ustr}, {u"B"_ustr}, {645.0}, {745.0}, {845.0}, {945.0}, {u"12/11/15"_ustr} },
+ { {u"EN"_ustr}, {u"London"_ustr}, {u"B"_ustr}, {687.0}, {787.0}, {887.0}, {987.0}, {u"03/21/17"_ustr} },
+ { {u"DE"_ustr}, {u"Munich"_ustr}, {u"B"_ustr}, {253.0}, {353.0}, {453.0}, {553.0}, {u"12/17/15"_ustr} },
+ { {u"FR"_ustr}, {u"Nantes"_ustr}, {u"B"_ustr}, {474.0}, {574.0}, {674.0}, {774.0}, {u"01/20/16"_ustr} },
+ { {u"EN"_ustr}, {u"Liverpool"_ustr}, {u"B"_ustr}, {562.0}, {662.0}, {762.0}, {862.0}, {u"01/20/16"_ustr} },
+ { {u"DE"_ustr}, {u"Berlin"_ustr}, {u"B"_ustr}, {648.0}, {748.0}, {848.0}, {948.0}, {u"01/20/16"_ustr} }
};
// Getting spreadsheet
@@ -258,7 +243,7 @@ table::CellRangeAddress lclCreateTestData(uno::Reference<sheet::XSpreadsheetDocu
CPPUNIT_ASSERT(oIndexAccess->getByIndex(0) >>= xSheet);
uno::Reference<sheet::XSpreadsheet> oPivotTableSheet;
- xSpreadsheets->insertNewByName("Pivot Table", 1);
+ xSpreadsheets->insertNewByName(u"Pivot Table"_ustr, 1);
CPPUNIT_ASSERT(oIndexAccess->getByIndex(1) >>= oPivotTableSheet);
sal_Int32 currentRow = 0;
@@ -293,7 +278,7 @@ table::CellRangeAddress lclCreateTestData(uno::Reference<sheet::XSpreadsheetDocu
sal_Int32 nDateKey = xNumberFormatTypes->getStandardFormat(util::NumberFormat::DATE, aLocale);
uno::Reference<table::XCellRange> xCellRange = xSheet->getCellRangeByPosition(nEndCol, 1, nEndCol, nEndRow);
uno::Reference<beans::XPropertySet> xCellProp(xCellRange, UNO_QUERY_THROW);
- xCellProp->setPropertyValue("NumberFormat", uno::makeAny(nDateKey));
+ xCellProp->setPropertyValue(u"NumberFormat"_ustr, uno::Any(nDateKey));
table::CellRangeAddress sCellRangeAddress;
sCellRangeAddress.Sheet = 0;
@@ -307,6 +292,18 @@ table::CellRangeAddress lclCreateTestData(uno::Reference<sheet::XSpreadsheetDocu
} // end anonymous namespace
+uno::Reference<sheet::XDataPilotTable> PivotChartTest::getPivotTableByName(sal_Int32 nIndex, OUString const & sPivotTableName)
+{
+ uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
+ uno::Reference<container::XIndexAccess> xSheetIndexAccess(xDoc->getSheets(), UNO_QUERY_THROW);
+ uno::Any aAny = xSheetIndexAccess->getByIndex(nIndex);
+ uno::Reference<sheet::XSpreadsheet> xSheet;
+ CPPUNIT_ASSERT(aAny >>= xSheet);
+ uno::Reference<sheet::XDataPilotTablesSupplier> xDataPilotTablesSupplier(xSheet, uno::UNO_QUERY_THROW);
+ uno::Reference<sheet::XDataPilotTables> xDataPilotTables = xDataPilotTablesSupplier->getDataPilotTables();
+ return uno::Reference<sheet::XDataPilotTable>(xDataPilotTables->getByName(sPivotTableName), UNO_QUERY_THROW);
+}
+
void PivotChartTest::testRoundtrip()
{
uno::Sequence<uno::Any> xSequence;
@@ -316,9 +313,9 @@ void PivotChartTest::testRoundtrip()
std::vector<double> aReference2 { 101879.458079, 178636.929704, 314626.484864 };
- load(u"/chart2/qa/extras/data/ods/", "PivotChartRoundTrip.ods");
+ loadFromFile(u"ods/PivotChartRoundTrip.ods");
- xChartDoc = getPivotChartDocFromSheet(1, mxComponent);
+ xChartDoc = getPivotChartDocFromSheet(1);
CPPUNIT_ASSERT(xChartDoc.is());
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getNumberOfDataSeries(xChartDoc));
@@ -327,17 +324,19 @@ void PivotChartTest::testRoundtrip()
{
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference1, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Exp."), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Exp."_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
{
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData();
lclCheckSequence(aReference2, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Rev."), lclGetLabel(xChartDoc, 1));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 1);
+ CPPUNIT_ASSERT_EQUAL(u"Rev."_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Modify the pivot table
{
- uno::Reference<sheet::XDataPilotTable> xDataPilotTable = lclGetPivotTableByName(1, "DataPilot1", mxComponent);
+ uno::Reference<sheet::XDataPilotTable> xDataPilotTable = getPivotTableByName(1, u"DataPilot1"_ustr );
uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor(xDataPilotTable, UNO_QUERY_THROW);
lclModifyOrientation(xDataPilotDescriptor, u"Exp.", sheet::DataPilotFieldOrientation_HIDDEN);
}
@@ -348,12 +347,13 @@ void PivotChartTest::testRoundtrip()
{
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference2, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
- reload("calc8");
+ saveAndReload(u"calc8"_ustr);
- xChartDoc = getPivotChartDocFromSheet(1, mxComponent);
+ xChartDoc = getPivotChartDocFromSheet(1 );
CPPUNIT_ASSERT(xChartDoc.is());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc));
@@ -362,7 +362,8 @@ void PivotChartTest::testRoundtrip()
{
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference2, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
}
@@ -371,20 +372,20 @@ void PivotChartTest::testChangePivotTable()
uno::Sequence<uno::Any> xSequence;
Reference<chart2::XChartDocument> xChartDoc;
- load(u"/chart2/qa/extras/data/ods/", "PivotTableExample.ods");
+ loadFromFile(u"ods/PivotTableExample.ods");
// Check we have the Pivot Table
- OUString sPivotTableName("DataPilot1");
- uno::Reference<sheet::XDataPilotTable> xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent);
+ OUString sPivotTableName(u"DataPilot1"_ustr);
+ uno::Reference<sheet::XDataPilotTable> xDataPilotTable = getPivotTableByName(1, sPivotTableName );
CPPUNIT_ASSERT(xDataPilotTable.is());
// Check that we don't have any pivot chart in the document
- uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent);
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1 );
uno::Reference<container::XIndexAccess> 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);
+ xTablePivotCharts->addNewByName(u"Chart"_ustr, 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
@@ -401,7 +402,8 @@ void PivotChartTest::testChangePivotTable()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Exp."), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Exp."_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check second data series
@@ -411,7 +413,8 @@ void PivotChartTest::testChangePivotTable()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Rev."), lclGetLabel(xChartDoc, 1));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 1);
+ CPPUNIT_ASSERT_EQUAL(u"Rev."_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Modify the pivot table, move "Group Segment" to Column fields,
@@ -435,7 +438,8 @@ void PivotChartTest::testChangePivotTable()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Big"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Big"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check the second data series
@@ -445,7 +449,8 @@ void PivotChartTest::testChangePivotTable()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Medium"), lclGetLabel(xChartDoc, 1));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 1);
+ CPPUNIT_ASSERT_EQUAL(u"Medium"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check the third data series
@@ -455,7 +460,8 @@ void PivotChartTest::testChangePivotTable()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 2)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Small"), lclGetLabel(xChartDoc, 2));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 2);
+ CPPUNIT_ASSERT_EQUAL(u"Small"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Remove "Service Month" so row fields are empty - check we handle empty rows
@@ -473,27 +479,30 @@ void PivotChartTest::testChangePivotTable()
std::vector<double> aReference { 10162.033139 };
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Big"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Big"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check the second data series
{
std::vector<double> aReference { 16614.523063 };
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Medium"), lclGetLabel(xChartDoc, 1));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 1);
+ CPPUNIT_ASSERT_EQUAL(u"Medium"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check the third data series
{
std::vector<double> aReference { 27944.146101 };
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 2)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Small"), lclGetLabel(xChartDoc, 2));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 2);
+ CPPUNIT_ASSERT_EQUAL(u"Small"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Enable column totals and check the data is still unchanged
{
uno::Reference<beans::XPropertySet> xProperties(xDataPilotTable, uno::UNO_QUERY_THROW);
- xProperties->setPropertyValue("ColumnGrand", uno::makeAny(true));
+ xProperties->setPropertyValue(u"ColumnGrand"_ustr, uno::Any(true));
}
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getNumberOfDataSeries(xChartDoc));
@@ -503,21 +512,24 @@ void PivotChartTest::testChangePivotTable()
std::vector<double> aReference { 10162.033139 };
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Big"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Big"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check the second data series
{
std::vector<double> aReference { 16614.523063 };
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Medium"), lclGetLabel(xChartDoc, 1));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 1);
+ CPPUNIT_ASSERT_EQUAL(u"Medium"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check the third data series
{
std::vector<double> aReference { 27944.146101 };
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 2)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
- CPPUNIT_ASSERT_EQUAL(OUString("Small"), lclGetLabel(xChartDoc, 2));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 2);
+ CPPUNIT_ASSERT_EQUAL(u"Small"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
}
@@ -528,12 +540,11 @@ void PivotChartTest::testPivotChartWithOneColumnField()
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ loadFromURL(u"private:factory/scalc"_ustr);
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- OUString sPivotTableName("DataPilotTable");
+ OUString sPivotTableName(u"DataPilotTable"_ustr);
table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc);
@@ -555,16 +566,16 @@ void PivotChartTest::testPivotChartWithOneColumnField()
// Check we have the Pivot Table
- uno::Reference<sheet::XDataPilotTable> xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent);
+ uno::Reference<sheet::XDataPilotTable> xDataPilotTable = getPivotTableByName(1, sPivotTableName );
CPPUNIT_ASSERT(xDataPilotTable.is());
// Check that we don't have any pivot chart in the document
- uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent);
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1 );
uno::Reference<container::XIndexAccess> 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);
+ xTablePivotCharts->addNewByName(u"PivotChart"_ustr, 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
@@ -580,7 +591,8 @@ void PivotChartTest::testPivotChartWithOneColumnField()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("DE"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"DE"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check data series 2
@@ -590,7 +602,8 @@ void PivotChartTest::testPivotChartWithOneColumnField()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("EN"), lclGetLabel(xChartDoc, 1));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 1);
+ CPPUNIT_ASSERT_EQUAL(u"EN"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check data series 3
{
@@ -599,7 +612,8 @@ void PivotChartTest::testPivotChartWithOneColumnField()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 2)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("FR"), lclGetLabel(xChartDoc, 2));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 2);
+ CPPUNIT_ASSERT_EQUAL(u"FR"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
}
@@ -610,12 +624,11 @@ void PivotChartTest::testPivotChartWithOneRowField()
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ loadFromURL(u"private:factory/scalc"_ustr);
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- OUString sPivotTableName("DataPilotTable");
+ OUString sPivotTableName(u"DataPilotTable"_ustr);
table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc);
@@ -637,16 +650,16 @@ void PivotChartTest::testPivotChartWithOneRowField()
// Check we have the Pivot Table
- uno::Reference<sheet::XDataPilotTable> xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent);
+ uno::Reference<sheet::XDataPilotTable> xDataPilotTable = getPivotTableByName(1, sPivotTableName );
CPPUNIT_ASSERT(xDataPilotTable.is());
// Check that we don't have any pivot chart in the document
- uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent);
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1 );
uno::Reference<container::XIndexAccess> 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);
+ xTablePivotCharts->addNewByName(u"PivotChart"_ustr, 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
@@ -662,7 +675,8 @@ void PivotChartTest::testPivotChartWithOneRowField()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
}
@@ -670,12 +684,11 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields()
{
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ loadFromURL(u"private:factory/scalc"_ustr);
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- OUString sPivotTableName("DataPilotTable");
+ OUString sPivotTableName(u"DataPilotTable"_ustr);
table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc);
@@ -701,19 +714,19 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields()
Reference<chart2::XChartDocument> xChartDoc;
// Check we have the Pivot Table
- uno::Reference<sheet::XDataPilotTable> xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent);
+ uno::Reference<sheet::XDataPilotTable> xDataPilotTable = getPivotTableByName(1, sPivotTableName );
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<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent);
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1 );
uno::Reference<container::XIndexAccess> 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);
+ xTablePivotCharts->addNewByName(u"PivotChart"_ustr, 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
@@ -727,20 +740,20 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields()
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);
+ CPPUNIT_ASSERT_EQUAL(u"Country"_ustr, aFieldEntries[0].Name);
+ CPPUNIT_ASSERT_EQUAL(u"Type"_ustr, 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);
+ CPPUNIT_ASSERT_EQUAL(u"City"_ustr, aFieldEntries[0].Name);
+ CPPUNIT_ASSERT_EQUAL(u"Data"_ustr, 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);
+ CPPUNIT_ASSERT_EQUAL(u"Sum - Sales T1"_ustr, aFieldEntries[0].Name);
+ CPPUNIT_ASSERT_EQUAL(u"Sum - Sales T2"_ustr, aFieldEntries[1].Name);
// Data to column fields
lclModifyOrientation(xDataPilotDescriptor, u"Data", sheet::DataPilotFieldOrientation_COLUMN);
@@ -758,32 +771,31 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields()
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);
+ CPPUNIT_ASSERT_EQUAL(u"Data"_ustr, aFieldEntries[0].Name);
+ CPPUNIT_ASSERT_EQUAL(u"Type"_ustr, aFieldEntries[1].Name);
+ CPPUNIT_ASSERT_EQUAL(u"Country"_ustr, aFieldEntries[2].Name);
aFieldEntries = xPivotTableDataProvider->getRowFields();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aFieldEntries.getLength());
- CPPUNIT_ASSERT_EQUAL(OUString("City"), aFieldEntries[0].Name);
+ CPPUNIT_ASSERT_EQUAL(u"City"_ustr, 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);
+ CPPUNIT_ASSERT_EQUAL(u"Sum - Sales T1"_ustr, aFieldEntries[0].Name);
+ CPPUNIT_ASSERT_EQUAL(u"Sum - Sales T2"_ustr, aFieldEntries[1].Name);
}
void PivotChartTest::testPivotChartRowFieldInOutlineMode()
{
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ loadFromURL(u"private:factory/scalc"_ustr);
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- OUString sPivotTableName("DataPilotTable");
+ OUString sPivotTableName(u"DataPilotTable"_ustr);
table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc);
@@ -803,19 +815,19 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
Reference<chart2::XChartDocument> xChartDoc;
// Check we have the Pivot Table
- uno::Reference<sheet::XDataPilotTable> xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent);
+ uno::Reference<sheet::XDataPilotTable> xDataPilotTable = getPivotTableByName(1, sPivotTableName );
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<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent);
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1 );
uno::Reference<container::XIndexAccess> 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);
+ xTablePivotCharts->addNewByName(u"PivotChart"_ustr, 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
@@ -833,13 +845,14 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check the categories
{
- lclCheckCategories({ "DE", "", "EN", "", "", "FR", ""},
+ lclCheckCategories({ u"DE"_ustr, u""_ustr, u"EN"_ustr, u""_ustr, u""_ustr, u"FR"_ustr, u""_ustr},
lclGetCategories(xChartDoc)[0]->getValues());
- lclCheckCategories({ "Berlin", "Munich", "Glasgow", "Liverpool", "London", "Nantes", "Paris"},
+ lclCheckCategories({ u"Berlin"_ustr, u"Munich"_ustr, u"Glasgow"_ustr, u"Liverpool"_ustr, u"London"_ustr, u"Nantes"_ustr, u"Paris"_ustr},
lclGetCategories(xChartDoc)[1]->getValues());
}
@@ -864,13 +877,14 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check categories
{
- lclCheckCategories({ "DE", "", "EN", "", "", "FR", ""},
+ lclCheckCategories({ u"DE"_ustr, u""_ustr, u"EN"_ustr, u""_ustr, u""_ustr, u"FR"_ustr, u""_ustr},
lclGetCategories(xChartDoc)[0]->getValues());
- lclCheckCategories({ "Berlin", "Munich", "Glasgow", "Liverpool", "London", "Nantes", "Paris"},
+ lclCheckCategories({ u"Berlin"_ustr, u"Munich"_ustr, u"Glasgow"_ustr, u"Liverpool"_ustr, u"London"_ustr, u"Nantes"_ustr, u"Paris"_ustr},
lclGetCategories(xChartDoc)[1]->getValues());
}
@@ -893,13 +907,14 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
xSequence = getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
- CPPUNIT_ASSERT_EQUAL(OUString("Total"), lclGetLabel(xChartDoc, 0));
+ Reference<chart2::data::XDataSequence> xLabelDataSequence = getLabelDataSequenceFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, xLabelDataSequence->getData()[0].get<OUString>());
}
// Check categories
{
- lclCheckCategories({ "DE", "", "EN", "", "", "FR", ""},
+ lclCheckCategories({ u"DE"_ustr, u""_ustr, u"EN"_ustr, u""_ustr, u""_ustr, u"FR"_ustr, u""_ustr},
lclGetCategories(xChartDoc)[0]->getValues());
- lclCheckCategories({ "Berlin", "Munich", "Glasgow", "Liverpool", "London", "Nantes", "Paris"},
+ lclCheckCategories({ u"Berlin"_ustr, u"Munich"_ustr, u"Glasgow"_ustr, u"Liverpool"_ustr, u"London"_ustr, u"Nantes"_ustr, u"Paris"_ustr},
lclGetCategories(xChartDoc)[1]->getValues());
}
}
@@ -908,12 +923,11 @@ void PivotChartTest::testPivotChartWithDateRowField()
{
// SETUP DATA and PIVOT TABLE
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
+ loadFromURL(u"private:factory/scalc"_ustr);
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- OUString sPivotTableName("DataPilotTable");
+ OUString sPivotTableName(u"DataPilotTable"_ustr);
table::CellRangeAddress sCellRangeAddress = lclCreateTestData(xSheetDoc);
@@ -938,19 +952,19 @@ void PivotChartTest::testPivotChartWithDateRowField()
Reference<chart2::XChartDocument> xChartDoc;
// Check we have the Pivot Table
- uno::Reference<sheet::XDataPilotTable> xDataPilotTable = lclGetPivotTableByName(1, sPivotTableName, mxComponent);
+ uno::Reference<sheet::XDataPilotTable> xDataPilotTable = getPivotTableByName(1, sPivotTableName );
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<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1, mxComponent);
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(1 );
uno::Reference<container::XIndexAccess> 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);
+ xTablePivotCharts->addNewByName(u"PivotChart"_ustr, 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
@@ -959,7 +973,7 @@ void PivotChartTest::testPivotChartWithDateRowField()
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" },
+ lclCheckCategories( { u"12/11/15"_ustr, u""_ustr, u""_ustr, u""_ustr, u""_ustr, u""_ustr, u"12/14/15"_ustr, u"12/17/15"_ustr, u"01/20/16"_ustr, u""_ustr, u""_ustr, u"03/21/17"_ustr },
lclGetCategories( xChartDoc )[0]->getValues() );
}
diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx b/chart2/qa/extras/chart2_trendcalculators.cxx
index c13c1666725e..b4f362c0c3c2 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -14,22 +14,20 @@
// Define the index of sheets in the test document
-#define SHEET_POTENTIAL1 0
-#define SHEET_POTENTIAL2 ( SHEET_POTENTIAL1 + 1)
-#define SHEET_POTENTIAL_LAST ( SHEET_POTENTIAL2 )
-
-#define SHEET_LINEAR1 ( SHEET_POTENTIAL_LAST + 1 )
-#define SHEET_LINEAR_LAST ( SHEET_LINEAR1 )
-
-#define SHEET_POLYNOMIAL1 ( SHEET_LINEAR_LAST + 1 )
-#define SHEET_POLYNOMIAL_LAST ( SHEET_POLYNOMIAL1 )
-
-#define SHEET_EXPONENTIAL1 ( SHEET_POLYNOMIAL_LAST + 1 )
-#define SHEET_EXPONENTIAL2 ( SHEET_EXPONENTIAL1 + 1 )
+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(u"/chart2/qa/extras/data/"_ustr)
+ {}
+
void setUp() override;
void tearDown() override;
@@ -50,7 +48,6 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
-
Reference<chart2::XRegressionCurve> m_xCurve;
Reference< chart2::XRegressionCurveCalculator > m_xRegressionCurveCalculator;
@@ -58,13 +55,12 @@ private:
void checkCalculator(
const Sequence< double >& xValues, const Sequence< double >& yValues,
const OUString& sExpectedFormula );
-
};
void Chart2TrendCalculators::setUp()
{
ChartTest::setUp();
- load(u"/chart2/qa/extras/data/ods/", "trend_calculators.ods");
+ loadFromFile(u"ods/trend_calculators.ods");
}
void Chart2TrendCalculators::tearDown()
@@ -76,7 +72,7 @@ void Chart2TrendCalculators::tearDown()
void Chart2TrendCalculators::loadCalculatorFromSheet(sal_Int32 nSheet)
{
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(nSheet, mxComponent);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(nSheet);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
@@ -121,7 +117,7 @@ void Chart2TrendCalculators::testPotentialRegression1()
pxValues[i] = d;
pyValues[i] = 2.0 * pow ( d, 3 );
}
- checkCalculator( xValues, yValues, "f(x) = 2 x^3");
+ checkCalculator( xValues, yValues, u"f(x) = 2 x^3"_ustr);
}
// test y = A x ^ B
@@ -193,7 +189,7 @@ void Chart2TrendCalculators::testExponentialRegression1()
pxValues[i] = d;
pyValues[i] = 2.0 * exp ( 0.3 * d );
}
- checkCalculator( xValues, yValues, "f(x) = 2 exp( 0.3 x )");
+ checkCalculator( xValues, yValues, u"f(x) = 2 exp( 0.3 x )"_ustr);
}
void Chart2TrendCalculators::testExponentialRegression2()
diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx b/chart2/qa/extras/chart2dump/chart2dump.cxx
index bae904d4faf3..b9fb4e455b74 100644
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -32,7 +32,7 @@
#define DECLARE_DUMP_TEST(TestName, BaseClass, DumpMode) \
class TestName : public BaseClass { \
protected:\
- virtual OUString getTestName() override { return #TestName; } \
+ virtual OUString getTestName() override { return u"" #TestName ""_ustr; } \
public:\
TestName() : BaseClass(DumpMode) {}; \
CPPUNIT_TEST_SUITE(TestName); \
@@ -46,7 +46,7 @@
#define CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aActual) \
if(isInDumpMode()) \
- writeActual(OUString::number(aActual), #aActual); \
+ writeActual(OUString::number(aActual), u"" #aActual ""_ustr); \
else \
{ \
OString sTestFileName = OUStringToOString(getTestFileName(), RTL_TEXTENCODING_UTF8); \
@@ -55,7 +55,7 @@
#define CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aActual, EPS_) \
if(isInDumpMode()) \
- writeActual(OUString::number(aActual), #aActual); \
+ writeActual(OUString::number(aActual), u"" #aActual ""_ustr); \
else \
{ \
OString sTestFileName = OUStringToOString(getTestFileName(), RTL_TEXTENCODING_UTF8); \
@@ -64,7 +64,7 @@
#define CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(aActual) \
if(isInDumpMode()) \
- writeActual(aActual, #aActual); \
+ writeActual(aActual, u"" #aActual ""_ustr); \
else \
{ \
OString sTestFileName = OUStringToOString(getTestFileName(), RTL_TEXTENCODING_UTF8); \
@@ -73,7 +73,7 @@
#define CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aActual, EPS_) \
if(isInDumpMode()) \
- writeActualTransformation(aActual, #aActual); \
+ writeActualTransformation(aActual, u"" #aActual ""_ustr); \
else \
{ \
OUString expectedTransform; \
@@ -88,6 +88,7 @@ class Chart2DumpTest : public ChartTest
{
protected:
Chart2DumpTest(bool bDumpMode)
+ : ChartTest(u"/chart2/qa/extras/chart2dump/data/"_ustr)
{
m_bDumpMode = bDumpMode;
}
@@ -107,7 +108,6 @@ protected:
virtual OUString getTestName() { return OUString(); }
OUString const & getTestFileName() const { return m_sTestFileName; }
- OUString getTestFileDirName() const { return "/chart2/qa/extras/chart2dump/data/"; }
OUString getReferenceDirName()
{
return "/chart2/qa/extras/chart2dump/reference/" + getTestName().toAsciiLowerCase() + "/";
@@ -124,7 +124,7 @@ protected:
{
if (m_aReferenceFile.is_open())
m_aReferenceFile.close();
- OString sReferenceFile = OUStringToOString(OUStringConcatenation(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8);
+ 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());
}
@@ -132,7 +132,7 @@ protected:
{
if (m_aDumpFile.is_open())
m_aDumpFile.close();
- OString sDumpFile = OUStringToOString(OUStringConcatenation(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8);
+ 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());
}
@@ -157,12 +157,12 @@ protected:
return OUString(sTemp.data(), sTemp.length(), RTL_TEXTENCODING_UTF8);
}
- void writeActual(const OUString& sActualValue, const OUString& sCheck)
+ 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 << sActualValue.trim() << "\n"; // Write out the checked value, will be used as reference later
+ m_aDumpFile << OUString(sActualValue) << "\n"; // Write out the checked value, will be used as reference later
}
void readNote(std::u16string_view sNote)
@@ -202,15 +202,15 @@ protected:
// Convert string back to a transformation;
drawing::HomogenMatrix3 aExpectedTransform;
sal_Int32 nIdx {0};
- aExpectedTransform.Line1.Column1 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
- aExpectedTransform.Line1.Column2 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
- aExpectedTransform.Line1.Column3 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
- aExpectedTransform.Line2.Column1 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
- aExpectedTransform.Line2.Column2 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
- aExpectedTransform.Line2.Column3 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
- aExpectedTransform.Line3.Column1 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
- aExpectedTransform.Line3.Column2 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
- aExpectedTransform.Line3.Column3 = rExpectedTransform.getToken(0, ';', nIdx).toDouble();
+ 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 &&
@@ -262,15 +262,15 @@ DECLARE_DUMP_TEST(ChartDataTest, Chart2DumpTest, false)
{
const std::vector<OUString> aTestFiles =
{
- "simple_chart.ods",
- "multiple_categories.ods"
+ u"simple_chart.ods"_ustr,
+ u"multiple_categories.ods"_ustr
};
for (const OUString& aTestFile : aTestFiles)
{
setTestFileName(aTestFile);
- load(getTestFileDirName(), getTestFileName());
- uno::Reference< chart::XChartDocument > xChartDoc (getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW);
+ loadFromFile(getTestFileName());
+ uno::Reference< chart::XChartDocument > xChartDoc (getChartDocFromSheet(0), UNO_QUERY_THROW);
// Check title
uno::Reference< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW);
@@ -369,20 +369,20 @@ DECLARE_DUMP_TEST(LegendTest, Chart2DumpTest, false)
{
const std::vector<OUString> 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"
+ u"legend_on_right_side.odp"_ustr,
+ u"legend_on_bottom.odp"_ustr,
+ u"legend_on_left_side.odp"_ustr,
+ u"legend_on_top.odp"_ustr,
+ u"many_legend_entries.odp"_ustr,
+ u"custom_legend_position.odp"_ustr,
+ u"multiple_categories.odp"_ustr,
+ u"minimal_legend_test.odp"_ustr
};
for (const OUString& aTestFile : aTestFiles)
{
setTestFileName(aTestFile);
- load(getTestFileDirName(), getTestFileName());
+ loadFromFile(getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_SET_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
@@ -390,7 +390,7 @@ DECLARE_DUMP_TEST(LegendTest, Chart2DumpTest, false)
CPPUNIT_ASSERT(xShapes.is());
// Get legend shape
- uno::Reference<drawing::XShape> xLegend = getShapeByName(xShapes, "CID/D=0:Legend=");
+ uno::Reference<drawing::XShape> xLegend = getShapeByName(xShapes, u"CID/D=0:Legend="_ustr);
CPPUNIT_ASSERT(xLegend.is());
/* Check legend position and size
@@ -467,17 +467,17 @@ DECLARE_DUMP_TEST(GridTest, Chart2DumpTest, false)
{
const std::vector<OUString> aTestFiles =
{
- "vertical_grid.ods",
- "horizontal_grid.ods",
- "minor_grid.ods",
- "formated_grid_line.ods"
+ u"vertical_grid.ods"_ustr,
+ u"horizontal_grid.ods"_ustr,
+ u"minor_grid.ods"_ustr,
+ u"formated_grid_line.ods"_ustr
};
for (const OUString& sTestFile : aTestFiles)
{
setTestFileName(sTestFile);
- load(getTestFileDirName(), getTestFileName());
- uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW);
+ loadFromFile(getTestFileName());
+ uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -485,10 +485,10 @@ DECLARE_DUMP_TEST(GridTest, Chart2DumpTest, false)
const std::vector<OUString> 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
+ u"CID/D=0:CS=0:Axis=1,0:Grid=0"_ustr, // Major vertical grid
+ u"CID/D=0:CS=0:Axis=0,0:Grid=0"_ustr, // Major horizontal grid
+ u"CID/D=0:CS=0:Axis=1,0:Grid=0:SubGrid=0"_ustr, // Minor vertical grid
+ u"CID/D=0:CS=0:Axis=0,0:Grid=0:SubGrid=0"_ustr // Minor horizontal grid
};
for (const OUString& sGridShapeName : aGridShapeNames)
@@ -508,7 +508,7 @@ DECLARE_DUMP_TEST(GridTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xGrid, UNO_QUERY_THROW);
drawing::HomogenMatrix3 aGridTransformation;
- xPropSet->getPropertyValue("Transformation") >>= aGridTransformation;
+ xPropSet->getPropertyValue(u"Transformation"_ustr) >>= aGridTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aGridTransformation, INT_EPS);
// Check line properties
@@ -517,18 +517,18 @@ DECLARE_DUMP_TEST(GridTest, Chart2DumpTest, false)
Reference< beans::XPropertySet > xGridLinePropSet(xGridLine, UNO_QUERY_THROW);
// Line type
drawing::LineDash aLineDash;
- xGridLinePropSet->getPropertyValue("LineDash") >>= aLineDash;
+ xGridLinePropSet->getPropertyValue(u"LineDash"_ustr) >>= aLineDash;
OUString sGridLineDash =
OUString::number(static_cast<sal_Int32>(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;
+ xGridLinePropSet->getPropertyValue(u"LineColor"_ustr) >>= aLineColor;
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aLineColor));
// Line width
sal_Int32 nLineWidth = 0;
- xGridLinePropSet->getPropertyValue("LineWidth") >>= nLineWidth;
+ xGridLinePropSet->getPropertyValue(u"LineWidth"_ustr) >>= nLineWidth;
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nLineWidth);
}
}
@@ -539,16 +539,16 @@ DECLARE_DUMP_TEST(AxisGeometryTest, Chart2DumpTest, false)
{
const std::vector<OUString> aTestFiles =
{
- "default_formated_axis.odp",
- "axis_special_positioning.odp",
- "formated_axis_lines.odp",
- "rotated_axis_labels.odp"
+ u"default_formated_axis.odp"_ustr,
+ u"axis_special_positioning.odp"_ustr,
+ u"formated_axis_lines.odp"_ustr,
+ u"rotated_axis_labels.odp"_ustr
};
for (const OUString& sTestFile : aTestFiles)
{
setTestFileName(sTestFile);
- load(getTestFileDirName(), getTestFileName());
+ loadFromFile(getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_SET_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
@@ -557,8 +557,8 @@ DECLARE_DUMP_TEST(AxisGeometryTest, Chart2DumpTest, false)
const std::vector<OUString> aAxisShapeNames =
{
- "CID/D=0:CS=0:Axis=0,0", // X Axis
- "CID/D=0:CS=0:Axis=1,0", // Y Axis
+ u"CID/D=0:CS=0:Axis=0,0"_ustr, // X Axis
+ u"CID/D=0:CS=0:Axis=1,0"_ustr, // Y Axis
};
for (const OUString& sAxisShapeName : aAxisShapeNames)
@@ -578,7 +578,7 @@ DECLARE_DUMP_TEST(AxisGeometryTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xXAxis, UNO_QUERY_THROW);
drawing::HomogenMatrix3 aAxisTransformation;
- xPropSet->getPropertyValue("Transformation") >>= aAxisTransformation;
+ xPropSet->getPropertyValue(u"Transformation"_ustr) >>= aAxisTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aAxisTransformation, INT_EPS);
// Check line properties
@@ -589,18 +589,18 @@ DECLARE_DUMP_TEST(AxisGeometryTest, Chart2DumpTest, false)
Reference< beans::XPropertySet > xAxisLinePropSet(xAxisLine, UNO_QUERY_THROW);
// Line type
drawing::LineDash aLineDash;
- xAxisLinePropSet->getPropertyValue("LineDash") >>= aLineDash;
+ xAxisLinePropSet->getPropertyValue(u"LineDash"_ustr) >>= aLineDash;
OUString sAxisLineDash =
OUString::number(static_cast<sal_Int32>(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;
+ xAxisLinePropSet->getPropertyValue(u"LineColor"_ustr) >>= aAxisLineColor;
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aAxisLineColor));
// Line width
sal_Int32 nAxisLineWidth = 0;
- xAxisLinePropSet->getPropertyValue("LineWidth") >>= nAxisLineWidth;
+ xAxisLinePropSet->getPropertyValue(u"LineWidth"_ustr) >>= nAxisLineWidth;
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nAxisLineWidth);
}
}
@@ -610,18 +610,18 @@ DECLARE_DUMP_TEST(AxisLabelTest, Chart2DumpTest, false)
{
const std::vector<OUString> aTestFiles =
{
- "default_formated_axis.odp",
- "rotated_axis_labels.odp",
- "formated_axis_labels.odp",
- "percent_stacked_column_chart.odp",
- "tdf118150.xlsx",
- "date-categories.pptx",
+ u"default_formated_axis.odp"_ustr,
+ u"rotated_axis_labels.odp"_ustr,
+ u"formated_axis_labels.odp"_ustr,
+ u"percent_stacked_column_chart.odp"_ustr,
+ u"tdf118150.xlsx"_ustr,
+ u"date-categories.pptx"_ustr,
};
for (const OUString& sTestFile : aTestFiles)
{
setTestFileName(sTestFile);
- load(getTestFileDirName(), getTestFileName());
+ loadFromFile(getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_SET_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
@@ -630,8 +630,8 @@ DECLARE_DUMP_TEST(AxisLabelTest, Chart2DumpTest, false)
const std::vector<OUString> aAxisShapeNames =
{
- "CID/D=0:CS=0:Axis=0,0", // X Axis
- "CID/D=0:CS=0:Axis=1,0", // Y Axis
+ u"CID/D=0:CS=0:Axis=0,0"_ustr, // X Axis
+ u"CID/D=0:CS=0:Axis=1,0"_ustr, // Y Axis
};
for (const OUString& sAxisShapeName : aAxisShapeNames)
@@ -678,10 +678,10 @@ DECLARE_DUMP_TEST(AxisLabelTest, Chart2DumpTest, false)
// Check font color and height
util::Color aLabelFontColor = 0;
- xPropSet->getPropertyValue("CharColor") >>= aLabelFontColor;
+ xPropSet->getPropertyValue(u"CharColor"_ustr) >>= aLabelFontColor;
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aLabelFontColor));
float fLabelFontHeight = 0.0f;
- xPropSet->getPropertyValue("CharHeight") >>= fLabelFontHeight;
+ xPropSet->getPropertyValue(u"CharHeight"_ustr) >>= fLabelFontHeight;
CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(fLabelFontHeight, 1E-12);
}
}
@@ -692,20 +692,20 @@ DECLARE_DUMP_TEST(ColumnBarChartTest, Chart2DumpTest, false)
{
const std::vector<OUString> 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",
+ u"normal_column_chart.ods"_ustr,
+ u"stacked_column_chart.ods"_ustr,
+ u"percent_stacked_column_chart.ods"_ustr,
+ u"column_chart_small_spacing.ods"_ustr,
+ u"normal_bar_chart.ods"_ustr,
+ u"stacked_bar_chart.ods"_ustr,
+ u"percent_stacked_bar_chart.ods"_ustr,
};
for (const OUString& sTestFile : aTestFiles)
{
setTestFileName(sTestFile);
- load(getTestFileDirName(), getTestFileName());
- uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW);
+ loadFromFile(getTestFileName());
+ uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -755,7 +755,7 @@ DECLARE_DUMP_TEST(ColumnBarChartTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xColumnOrBar, UNO_QUERY_THROW);
drawing::HomogenMatrix3 aColumnOrBarTransformation;
- xPropSet->getPropertyValue("Transformation") >>= aColumnOrBarTransformation;
+ xPropSet->getPropertyValue(u"Transformation"_ustr) >>= aColumnOrBarTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aColumnOrBarTransformation, INT_EPS);
}
}
@@ -766,22 +766,22 @@ DECLARE_DUMP_TEST(ChartWallTest, Chart2DumpTest, false)
{
const std::vector<OUString> aTestFiles =
{
- "chartwall_auto_adjust_with_titles.ods",
- "chartwall_auto_adjust_without_titles.ods",
- "chartwall_custom_positioning.ods"
+ u"chartwall_auto_adjust_with_titles.ods"_ustr,
+ u"chartwall_auto_adjust_without_titles.ods"_ustr,
+ u"chartwall_custom_positioning.ods"_ustr
};
for (const OUString& sTestFile : aTestFiles)
{
setTestFileName(sTestFile);
- load(getTestFileDirName(), getTestFileName());
+ loadFromFile(getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_SET_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xShapes.is());
- uno::Reference<drawing::XShape> xChartWall = getShapeByName(xShapes, "CID/DiagramWall=");
+ uno::Reference<drawing::XShape> xChartWall = getShapeByName(xShapes, u"CID/DiagramWall="_ustr);
CPPUNIT_ASSERT(xChartWall.is());
// Check position and size
@@ -809,20 +809,19 @@ DECLARE_DUMP_TEST(ChartWallTest, Chart2DumpTest, false)
// Check line properties
// Line type
drawing::LineDash aLineDash;
- xPropSet->getPropertyValue("LineDash") >>= aLineDash;
+ xPropSet->getPropertyValue(u"LineDash"_ustr) >>= aLineDash;
OUString sChartWallLineDash =
OUString::number(static_cast<sal_Int32>(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;
+ xPropSet->getPropertyValue(u"LineColor"_ustr) >>= aChartWallLineColor;
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aChartWallLineColor));
// Line width
sal_Int32 nChartWallLineWidth = 0;
- xPropSet->getPropertyValue("LineWidth") >>= nChartWallLineWidth;
+ xPropSet->getPropertyValue(u"LineWidth"_ustr) >>= nChartWallLineWidth;
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nChartWallLineWidth);
-
}
}
@@ -830,18 +829,18 @@ DECLARE_DUMP_TEST(PieChartTest, Chart2DumpTest, false)
{
const std::vector<OUString> aTestFiles =
{
- "normal_pie_chart.ods",
- "rotated_pie_chart.ods",
- "exploded_pie_chart.ods",
- "donut_chart.ods",
- "pie_chart_many_slices.ods",
+ u"normal_pie_chart.ods"_ustr,
+ u"rotated_pie_chart.ods"_ustr,
+ u"exploded_pie_chart.ods"_ustr,
+ u"donut_chart.ods"_ustr,
+ u"pie_chart_many_slices.ods"_ustr,
};
for (const OUString& sTestFile : aTestFiles)
{
setTestFileName(sTestFile);
- load(getTestFileDirName(), getTestFileName());
- uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW);
+ loadFromFile(getTestFileName());
+ uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -886,7 +885,7 @@ DECLARE_DUMP_TEST(PieChartTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xSlice, UNO_QUERY_THROW);
drawing::HomogenMatrix3 aSliceTransformation;
- xPropSet->getPropertyValue("Transformation") >>= aSliceTransformation;
+ xPropSet->getPropertyValue(u"Transformation"_ustr) >>= aSliceTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aSliceTransformation, INT_EPS);
// Check slice fill style and color
@@ -905,16 +904,16 @@ DECLARE_DUMP_TEST(AreaChartTest, Chart2DumpTest, false)
{
const std::vector<OUString> aTestFiles =
{
- "normal_area_chart.ods",
- "stacked_area_chart.ods",
- "percent_stacked_area_chart.ods"
+ u"normal_area_chart.ods"_ustr,
+ u"stacked_area_chart.ods"_ustr,
+ u"percent_stacked_area_chart.ods"_ustr
};
for (const OUString& sTestFile : aTestFiles)
{
setTestFileName(sTestFile);
- load(getTestFileDirName(), getTestFileName());
- uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW);
+ loadFromFile(getTestFileName());
+ uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -950,7 +949,7 @@ DECLARE_DUMP_TEST(AreaChartTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xArea, UNO_QUERY_THROW);
drawing::HomogenMatrix3 aAreaTransformation;
- xPropSet->getPropertyValue("Transformation") >>= aAreaTransformation;
+ xPropSet->getPropertyValue(u"Transformation"_ustr) >>= aAreaTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aAreaTransformation, INT_EPS);
// Check area fill style and color
@@ -969,25 +968,25 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false)
{
const std::vector<OUString> 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",
+ u"normal_line_chart_lines_only.ods"_ustr,
+ u"normal_line_chart_points_only.ods"_ustr,
+ u"normal_line_chart_lines_and_points.ods"_ustr,
+ u"stacked_line_chart_lines_only.ods"_ustr,
+ u"stacked_line_chart_points_only.ods"_ustr,
+ u"stacked_line_chart_lines_and_points.ods"_ustr,
+ u"percent_stacked_line_chart_lines_only.ods"_ustr,
+ u"percent_stacked_line_chart_points_only.ods"_ustr,
+ u"percent_stacked_line_chart_lines_and_points.ods"_ustr,
+ u"scatter_chart_points_only.ods"_ustr,
+ u"scatter_chart_lines_only.ods"_ustr,
+ u"scatter_chart_lines_and_points.ods"_ustr,
};
for (const OUString& sTestFile : aTestFiles)
{
setTestFileName(sTestFile);
- load(getTestFileDirName(), getTestFileName());
- uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW);
+ loadFromFile(getTestFileName());
+ uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -1017,7 +1016,7 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false)
xPropSet->getPropertyValue(UNO_NAME_LINESTYLE) >>= aSeriesLineStyle;
if (aSeriesLineStyle != drawing::LineStyle_NONE)
{
- CPPUNIT_DUMP_ASSERT_NOTE("Lines are displayed");
+ CPPUNIT_DUMP_ASSERT_NOTE(u"Lines are displayed"_ustr);
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aSeriesLineStyle));
// Check line shape geometry
@@ -1029,14 +1028,14 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false)
CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aLineSize.Width, INT_EPS);
CPPUNIT_ASSERT(xPropSet.is());
drawing::HomogenMatrix3 aLineTransformation;
- xPropSet->getPropertyValue("Transformation") >>= aLineTransformation;
+ xPropSet->getPropertyValue(u"Transformation"_ustr) >>= aLineTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aLineTransformation, INT_EPS);
}
// Check points of series
if (xIndexAccess->getCount() >= 2)
{
- CPPUNIT_DUMP_ASSERT_NOTE("Points are displayed");
+ CPPUNIT_DUMP_ASSERT_NOTE(u"Points are displayed"_ustr);
uno::Reference<container::XIndexAccess> xPointsOfSeries(xIndexAccess->getByIndex(1), UNO_QUERY_THROW);
sal_Int32 nPointCountInSeries = xPointsOfSeries->getCount();
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nPointCountInSeries);
@@ -1059,7 +1058,7 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPointPropSet(XPoint, UNO_QUERY_THROW);
drawing::HomogenMatrix3 aPointTransformation;
- xPointPropSet->getPropertyValue("Transformation") >>= aPointTransformation;
+ xPointPropSet->getPropertyValue(u"Transformation"_ustr) >>= aPointTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aPointTransformation, INT_EPS);
// Check fill style and color
@@ -1077,11 +1076,11 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false)
DECLARE_DUMP_TEST( PivotChartDataButtonTest, Chart2DumpTest, false )
{
- setTestFileName( "pivotchart_data_button.ods" );
- load( getTestFileDirName(), getTestFileName() );
+ setTestFileName( u"pivotchart_data_button.ods"_ustr );
+ loadFromFile(getTestFileName());
// Check that we have pivot chart in the document
- uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet( 1, mxComponent );
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet( 1);
uno::Reference<container::XIndexAccess> xIndexAccess( xTablePivotCharts, UNO_QUERY_THROW );
CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xIndexAccess->getCount() );
@@ -1096,20 +1095,20 @@ DECLARE_DUMP_TEST( PivotChartDataButtonTest, Chart2DumpTest, false )
CPPUNIT_ASSERT( xShapes.is() );
// Get the shape that represents the "Data" button.
- uno::Reference<drawing::XShape> xButton = getShapeByName( xShapes, "FieldButton.Row.8",
+ uno::Reference<drawing::XShape> xButton = getShapeByName( xShapes, u"FieldButton.Row.8"_ustr,
[]( const uno::Reference<drawing::XShape>& xShapeNode )
{
return xShapeNode->getShapeType() == "com.sun.star.drawing.TextShape";
} );
- CPPUNIT_ASSERT_MESSAGE( OString( "Cannot find Data button shape" ).getStr(), xButton.is() );
+ CPPUNIT_ASSERT_MESSAGE( "Cannot find Data button shape", xButton.is() );
// Make sure that there is no arrow shape with the Data button
- uno::Reference<drawing::XShape> xArrow = getShapeByName( xShapes, "FieldButton.Row.8",
+ uno::Reference<drawing::XShape> xArrow = getShapeByName( xShapes, u"FieldButton.Row.8"_ustr,
[]( const uno::Reference<drawing::XShape>& xShapeNode )
{
return xShapeNode->getShapeType() == "com.sun.star.drawing.PolyPolygonShape";
} );
- CPPUNIT_ASSERT_MESSAGE( OString( "Arrow shape should not be present for the Data button" ).getStr(), !xArrow.is() );
+ 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;
diff --git a/chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt b/chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt
index 28a125d7a5ed..ec3bfa72e397 100644
--- a/chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt
+++ b/chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt
@@ -11,7 +11,7 @@ Quarter
// sYAxisTitle
Income (Ft)
// nYAxisNumberFormat
-151
+159
// nYAxisNumberType
17
// aColumnLabels.getLength()
diff --git a/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt b/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt
index b2dfd33295a2..c1af41103de5 100644
--- a/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt
+++ b/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt
@@ -35,15 +35,15 @@
16728590
/// /D=0:CS=0:CT=0:Series=0:Point=2
// aSlicePosition.X
-8909
+9033
// aSlicePosition.Y
-4532
+4635
// aSliceSize.Height
-4689
+4659
// aSliceSize.Width
-2544
+2458
// aSliceTransformation
-2544;0;8909;0;4689;4532;0;0;1
+2458;0;9033;0;4659;4635;0;0;1
// static_cast<sal_Int32>(aSliceFillStyle)
1
// static_cast<sal_Int32>(aSliceFillColor)
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index a5c2e20cc58c..3f37794e1d10 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -16,232 +16,35 @@
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
using uno::Reference;
using beans::XPropertySet;
class Chart2ExportTest : public ChartTest
{
-protected:
-
- virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override;
public:
- Chart2ExportTest() : ChartTest() {}
-
- void testErrorBarXLSX();
- void testErrorBarPropXLSX();
- void testTrendline();
- void testTrendlineOOXML();
- void testTrendlineXLS();
- void testMovingAverage();
- void testStockChart();
- void testBarChart();
- void testCrosses();
- void testScatterChartTextXValues();
- void testScatterXAxisValues();
- void testScatterXAxisCategories();
- void testChartDataTable();
- void testChartExternalData();
- void testEmbeddingsGrabBag();
- void testAreaChartLoad();
- void testUpDownBars();
- void testDoughnutChart();
- void testDisplayUnits();
- // void testFdo74115WallGradientFill();
- void testFdo74115WallBitmapFill();
- void testPieChartWallLineStyle();
- void testBarChartRotation();
- void testShapeFollowedByChart();
- void testPieChartDataLabels();
- void testSeriesIdxOrder();
- void testScatterPlotLabels();
- void testErrorBarDataRangeODS();
- void testChartCrash();
- void testPieChartRotation();
- void testEmbeddingsOleObjectGrabBag();
- void testGapWidthXLSX();
- void testSmoothedLines();
- void testLabelStringODS();
- void testFdo78290LineChartMarkerX();
- void testFdo78290ScatterChartMarkerX();
- void testFdo78290CombinationChartMarkerX();
- void testTdf126115IndividualMarker();
- void testAxisNumberFormatODS();
- void testAxisNumberFormatXLS();
- void testDataLabelBordersDOCX();
- void testDataLabel3DChartDOCX();
- void testDataLabelBarChartDOCX();
- void testDataLabelClusteredBarChartDOCX();
- void testDataLabelRadarChartDOCX();
- void testDataLabelDoughnutChartDOCX();
- void testDataLabelAreaChartDOCX();
- void testDataLabelDefaultLineChartDOCX();
- void testIndividualDataLabelProps();
- void testTdf108107();
- void testTdf114139();
- void testTdf64224();
- void testChartTitlePropertiesColorFillDOCX();
- void testChartTitlePropertiesGradientFillDOCX();
- void testChartTitlePropertiesBitmapFillDOCX();
- void testColorGradientWithTransparencyDOCX();
- void testColorGradientWithTransparencyODS();
- void testColorGradientStopXLSX();
- void testRadialColorGradientDOCX();
- void testBarChartDataPointPropDOCX();
- void testFdo83058dlblPos();
- void testAutoTitleDelXLSX();
- void testDispBlanksAsXLSX();
- void testMarkerColorXLSX();
- void testRoundedCornersXLSX();
- void testAxisNumberFormatXLSX();
- void testDataPointLabelNumberFormatXLSX();
- void testDataLabelDefaultValuesXLSX();
- void testDataLabelFillColor();
- void testTitleOverlayXLSX();
- void testInvertIfNegativeXLSX();
- void testBubble3DXLSX();
- void testNoMarkerXLSX();
- void testTitleManualLayoutXLSX();
- void testPlotAreaManualLayoutXLSX();
- void testLegendManualLayoutXLSX();
- void testChartSubTitle();
- void testChartMainWithSubTitle();
- void testAutoTitleDeleted();
- void testChartTitlePropertiesColorFillXLSX();
- void testChartTitlePropertiesGradientFillXLSX();
- void testChartTitlePropertiesBitmapFillXLSX();
- void testBarChartDataPointPropXLSX();
- void testDataseriesOverlapStackedChartXLSX();
- void testAxisCharacterPropertiesXLSX();
- void testTitleCharacterPropertiesXLSX();
- void testPlotVisOnlyXLSX();
- void testBarChartVaryColorsXLSX();
- void testTdf96161();
- void testMultipleAxisXLSX();
- void testSecondaryAxisXLSX();
- void testBarChartSecondaryAxisXLSX();
-
- CPPUNIT_TEST_SUITE(Chart2ExportTest);
- CPPUNIT_TEST(testErrorBarXLSX);
- CPPUNIT_TEST(testErrorBarPropXLSX);
- CPPUNIT_TEST(testTrendline);
- CPPUNIT_TEST(testTrendlineOOXML);
- CPPUNIT_TEST(testTrendlineXLS);
- CPPUNIT_TEST(testMovingAverage);
- CPPUNIT_TEST(testStockChart);
- CPPUNIT_TEST(testBarChart);
- CPPUNIT_TEST(testCrosses);
- CPPUNIT_TEST(testScatterChartTextXValues);
- CPPUNIT_TEST(testScatterXAxisValues);
- CPPUNIT_TEST(testScatterXAxisCategories);
- CPPUNIT_TEST(testChartDataTable);
- CPPUNIT_TEST(testChartExternalData);
- CPPUNIT_TEST(testEmbeddingsGrabBag);
- CPPUNIT_TEST(testAreaChartLoad);
- CPPUNIT_TEST(testUpDownBars);
- CPPUNIT_TEST(testDoughnutChart);
- CPPUNIT_TEST(testDisplayUnits);
- // CPPUNIT_TEST(testFdo74115WallGradientFill);
- CPPUNIT_TEST(testFdo74115WallBitmapFill);
- CPPUNIT_TEST(testPieChartWallLineStyle);
- CPPUNIT_TEST(testBarChartRotation);
- CPPUNIT_TEST(testShapeFollowedByChart);
- CPPUNIT_TEST(testPieChartDataLabels);
- CPPUNIT_TEST(testSeriesIdxOrder);
- CPPUNIT_TEST(testScatterPlotLabels);
- CPPUNIT_TEST(testErrorBarDataRangeODS);
- CPPUNIT_TEST(testChartCrash);
- CPPUNIT_TEST(testPieChartRotation);
- CPPUNIT_TEST(testEmbeddingsOleObjectGrabBag);
- CPPUNIT_TEST(testGapWidthXLSX);
- CPPUNIT_TEST(testSmoothedLines);
- CPPUNIT_TEST(testLabelStringODS);
- CPPUNIT_TEST(testFdo78290LineChartMarkerX);
- CPPUNIT_TEST(testFdo78290ScatterChartMarkerX);
- CPPUNIT_TEST(testFdo78290CombinationChartMarkerX);
- CPPUNIT_TEST(testTdf126115IndividualMarker);
- CPPUNIT_TEST(testAxisNumberFormatODS);
- CPPUNIT_TEST(testAxisNumberFormatXLS);
- CPPUNIT_TEST(testDataLabelBordersDOCX);
- CPPUNIT_TEST(testDataLabel3DChartDOCX);
- CPPUNIT_TEST(testDataLabelBarChartDOCX);
- CPPUNIT_TEST(testDataLabelClusteredBarChartDOCX);
- CPPUNIT_TEST(testDataLabelRadarChartDOCX);
- CPPUNIT_TEST(testDataLabelDoughnutChartDOCX);
- CPPUNIT_TEST(testDataLabelAreaChartDOCX);
- CPPUNIT_TEST(testDataLabelDefaultLineChartDOCX);
- CPPUNIT_TEST(testIndividualDataLabelProps);
- CPPUNIT_TEST(testTdf108107);
- CPPUNIT_TEST(testTdf114139);
- CPPUNIT_TEST(testTdf64224);
- CPPUNIT_TEST(testChartTitlePropertiesColorFillDOCX);
- CPPUNIT_TEST(testChartTitlePropertiesGradientFillDOCX);
- CPPUNIT_TEST(testChartTitlePropertiesBitmapFillDOCX);
- CPPUNIT_TEST(testColorGradientWithTransparencyDOCX);
- CPPUNIT_TEST(testColorGradientWithTransparencyODS);
- CPPUNIT_TEST(testColorGradientStopXLSX);
- CPPUNIT_TEST(testRadialColorGradientDOCX);
- CPPUNIT_TEST(testBarChartDataPointPropDOCX);
- CPPUNIT_TEST(testFdo83058dlblPos);
- CPPUNIT_TEST(testAutoTitleDelXLSX);
- CPPUNIT_TEST(testDispBlanksAsXLSX);
- CPPUNIT_TEST(testMarkerColorXLSX);
- CPPUNIT_TEST(testRoundedCornersXLSX);
- CPPUNIT_TEST(testAxisNumberFormatXLSX);
- CPPUNIT_TEST(testDataPointLabelNumberFormatXLSX);
- CPPUNIT_TEST(testDataLabelDefaultValuesXLSX);
- CPPUNIT_TEST(testDataLabelFillColor);
- CPPUNIT_TEST(testTitleOverlayXLSX);
- CPPUNIT_TEST(testInvertIfNegativeXLSX);
- CPPUNIT_TEST(testBubble3DXLSX);
- CPPUNIT_TEST(testNoMarkerXLSX);
- CPPUNIT_TEST(testTitleManualLayoutXLSX);
- CPPUNIT_TEST(testPlotAreaManualLayoutXLSX);
- CPPUNIT_TEST(testLegendManualLayoutXLSX);
- CPPUNIT_TEST(testChartSubTitle);
- CPPUNIT_TEST(testChartMainWithSubTitle);
- CPPUNIT_TEST(testAutoTitleDeleted);
- CPPUNIT_TEST(testChartTitlePropertiesColorFillXLSX);
- CPPUNIT_TEST(testChartTitlePropertiesGradientFillXLSX);
- CPPUNIT_TEST(testChartTitlePropertiesBitmapFillXLSX);
- CPPUNIT_TEST(testBarChartDataPointPropXLSX);
- CPPUNIT_TEST(testDataseriesOverlapStackedChartXLSX);
- CPPUNIT_TEST(testAxisCharacterPropertiesXLSX);
- CPPUNIT_TEST(testTitleCharacterPropertiesXLSX);
- CPPUNIT_TEST(testPlotVisOnlyXLSX);
- CPPUNIT_TEST(testBarChartVaryColorsXLSX);
- CPPUNIT_TEST(testTdf96161);
- CPPUNIT_TEST(testMultipleAxisXLSX);
- CPPUNIT_TEST(testSecondaryAxisXLSX);
- CPPUNIT_TEST(testBarChartSecondaryAxisXLSX);
-
- CPPUNIT_TEST_SUITE_END();
+ Chart2ExportTest() : ChartTest(u"/chart2/qa/extras/data/"_ustr) {}
};
-void Chart2ExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
-{
- XmlTestTools::registerOOXMLNamespaces(pXmlXPathCtx);
-}
-
namespace {
void testErrorBar( Reference< XPropertySet > const & xErrorBar )
{
sal_Int32 nErrorBarStyle;
CPPUNIT_ASSERT(
- xErrorBar->getPropertyValue("ErrorBarStyle") >>= nErrorBarStyle);
+ xErrorBar->getPropertyValue(u"ErrorBarStyle"_ustr) >>= nErrorBarStyle);
CPPUNIT_ASSERT_EQUAL(chart::ErrorBarStyle::RELATIVE, nErrorBarStyle);
bool bShowPositive = bool(), bShowNegative = bool();
CPPUNIT_ASSERT(
- xErrorBar->getPropertyValue("ShowPositiveError") >>= bShowPositive);
+ xErrorBar->getPropertyValue(u"ShowPositiveError"_ustr) >>= bShowPositive);
CPPUNIT_ASSERT(bShowPositive);
CPPUNIT_ASSERT(
- xErrorBar->getPropertyValue("ShowNegativeError") >>= bShowNegative);
+ xErrorBar->getPropertyValue(u"ShowNegativeError"_ustr) >>= bShowNegative);
CPPUNIT_ASSERT(bShowNegative);
double nVal = 0.0;
- CPPUNIT_ASSERT(xErrorBar->getPropertyValue("PositiveError") >>= nVal);
+ CPPUNIT_ASSERT(xErrorBar->getPropertyValue(u"PositiveError"_ustr) >>= nVal);
CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, nVal, 1e-10);
}
@@ -249,27 +52,27 @@ void checkCommonTrendline(
Reference<chart2::XRegressionCurve> const & xCurve,
double aExpectedExtrapolateForward, double aExpectedExtrapolateBackward,
bool aExpectedForceIntercept, double aExpectedInterceptValue,
- bool aExpectedShowEquation, bool aExpectedR2)
+ bool aExpectedShowEquation, bool aExpectedR2, bool aExpectedMayHaveR2)
{
Reference<XPropertySet> xProperties( xCurve , uno::UNO_QUERY );
CPPUNIT_ASSERT(xProperties.is());
double aExtrapolateForward = 0.0;
- CPPUNIT_ASSERT(xProperties->getPropertyValue("ExtrapolateForward") >>= aExtrapolateForward);
+ CPPUNIT_ASSERT(xProperties->getPropertyValue(u"ExtrapolateForward"_ustr) >>= aExtrapolateForward);
CPPUNIT_ASSERT_EQUAL(aExpectedExtrapolateForward, aExtrapolateForward);
double aExtrapolateBackward = 0.0;
- CPPUNIT_ASSERT(xProperties->getPropertyValue("ExtrapolateBackward") >>= aExtrapolateBackward);
+ CPPUNIT_ASSERT(xProperties->getPropertyValue(u"ExtrapolateBackward"_ustr) >>= aExtrapolateBackward);
CPPUNIT_ASSERT_EQUAL(aExpectedExtrapolateBackward, aExtrapolateBackward);
bool bForceIntercept = false;
- CPPUNIT_ASSERT(xProperties->getPropertyValue("ForceIntercept") >>= bForceIntercept);
+ CPPUNIT_ASSERT(xProperties->getPropertyValue(u"ForceIntercept"_ustr) >>= bForceIntercept);
CPPUNIT_ASSERT_EQUAL(aExpectedForceIntercept, bForceIntercept);
if (bForceIntercept)
{
double aInterceptValue = 0.0;
- CPPUNIT_ASSERT(xProperties->getPropertyValue("InterceptValue") >>= aInterceptValue);
+ CPPUNIT_ASSERT(xProperties->getPropertyValue(u"InterceptValue"_ustr) >>= aInterceptValue);
CPPUNIT_ASSERT_EQUAL(aExpectedInterceptValue, aInterceptValue);
}
@@ -277,12 +80,16 @@ void checkCommonTrendline(
CPPUNIT_ASSERT(xEquationProperties.is());
bool bShowEquation = false;
- CPPUNIT_ASSERT(xEquationProperties->getPropertyValue("ShowEquation") >>= bShowEquation);
+ CPPUNIT_ASSERT(xEquationProperties->getPropertyValue(u"ShowEquation"_ustr) >>= bShowEquation);
CPPUNIT_ASSERT_EQUAL(aExpectedShowEquation, bShowEquation);
bool bShowCorrelationCoefficient = false;
- CPPUNIT_ASSERT(xEquationProperties->getPropertyValue("ShowCorrelationCoefficient") >>= bShowCorrelationCoefficient);
+ CPPUNIT_ASSERT(xEquationProperties->getPropertyValue(u"ShowCorrelationCoefficient"_ustr) >>= bShowCorrelationCoefficient);
CPPUNIT_ASSERT_EQUAL(aExpectedR2, bShowCorrelationCoefficient);
+
+ bool bMayHaveR2 = false;
+ CPPUNIT_ASSERT(xEquationProperties->getPropertyValue(u"MayHaveCorrelationCoefficient"_ustr) >>= bMayHaveR2);
+ CPPUNIT_ASSERT_EQUAL(aExpectedMayHaveR2, bMayHaveR2);
}
void checkNameAndType(Reference<XPropertySet> const & xProperties, const OUString& aExpectedName, const OUString& aExpectedServiceName)
@@ -294,7 +101,7 @@ void checkNameAndType(Reference<XPropertySet> const & xProperties, const OUStrin
CPPUNIT_ASSERT_EQUAL(aExpectedServiceName, aServiceName);
OUString aCurveName;
- CPPUNIT_ASSERT(xProperties->getPropertyValue("CurveName") >>= aCurveName);
+ CPPUNIT_ASSERT(xProperties->getPropertyValue(u"CurveName"_ustr) >>= aCurveName);
CPPUNIT_ASSERT_EQUAL(aExpectedName, aCurveName);
}
@@ -306,13 +113,13 @@ void checkLinearTrendline(
Reference<XPropertySet> xProperties( xCurve , uno::UNO_QUERY );
CPPUNIT_ASSERT(xProperties.is());
- checkNameAndType(xProperties, aExpectedName, "com.sun.star.chart2.LinearRegressionCurve");
+ checkNameAndType(xProperties, aExpectedName, u"com.sun.star.chart2.LinearRegressionCurve"_ustr);
checkCommonTrendline(
xCurve,
aExpectedExtrapolateForward, aExpectedExtrapolateBackward,
/*aExpectedForceIntercept*/false, aExpectedInterceptValue,
- /*aExpectedShowEquation*/true, /*aExpectedR2*/false);
+ /*aExpectedShowEquation*/true, /*aExpectedR2*/false, /*aExpectedMayHaveR2*/true);
}
void checkPolynomialTrendline(
@@ -324,17 +131,17 @@ void checkPolynomialTrendline(
Reference<XPropertySet> xProperties( xCurve , uno::UNO_QUERY );
CPPUNIT_ASSERT(xProperties.is());
- checkNameAndType(xProperties, aExpectedName, "com.sun.star.chart2.PolynomialRegressionCurve");
+ checkNameAndType(xProperties, aExpectedName, u"com.sun.star.chart2.PolynomialRegressionCurve"_ustr);
sal_Int32 aDegree = 2;
- CPPUNIT_ASSERT(xProperties->getPropertyValue("PolynomialDegree") >>= aDegree);
+ CPPUNIT_ASSERT(xProperties->getPropertyValue(u"PolynomialDegree"_ustr) >>= aDegree);
CPPUNIT_ASSERT_EQUAL(aExpectedDegree, aDegree);
checkCommonTrendline(
xCurve,
aExpectedExtrapolateForward, aExpectedExtrapolateBackward,
/*aExpectedForceIntercept*/true, aExpectedInterceptValue,
- /*aExpectedShowEquation*/true, /*aExpectedR2*/true);
+ /*aExpectedShowEquation*/true, /*aExpectedR2*/true, /*aExpectedMayHaveR2*/true);
}
void checkMovingAverageTrendline(
@@ -343,20 +150,21 @@ void checkMovingAverageTrendline(
Reference<XPropertySet> xProperties( xCurve , uno::UNO_QUERY );
CPPUNIT_ASSERT(xProperties.is());
- checkNameAndType(xProperties, aExpectedName, "com.sun.star.chart2.MovingAverageRegressionCurve");
+ checkNameAndType(xProperties, aExpectedName, u"com.sun.star.chart2.MovingAverageRegressionCurve"_ustr);
sal_Int32 aPeriod = 2;
- CPPUNIT_ASSERT(xProperties->getPropertyValue("MovingAveragePeriod") >>= aPeriod);
+ CPPUNIT_ASSERT(xProperties->getPropertyValue(u"MovingAveragePeriod"_ustr) >>= 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)
+void checkTrendlinesInChart(uno::Reference< chart2::XDataSeries > const & xDataSeries )
{
- 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() );
@@ -367,26 +175,26 @@ void checkTrendlinesInChart(uno::Reference< chart2::XChartDocument > const & xCh
xCurve = xRegressionCurveSequence[0];
CPPUNIT_ASSERT(xCurve.is());
- checkPolynomialTrendline(xCurve, "col2_poly", 3, 0.1, -0.1, -1.0);
+ checkPolynomialTrendline(xCurve, u"col2_poly"_ustr, 3, 0.1, -0.1, -1.0);
xCurve = xRegressionCurveSequence[1];
CPPUNIT_ASSERT(xCurve.is());
- checkLinearTrendline(xCurve, "col2_linear", -0.5, -0.5, 0.0);
+ checkLinearTrendline(xCurve, u"col2_linear"_ustr, -0.5, -0.5, 0.0);
xCurve = xRegressionCurveSequence[2];
CPPUNIT_ASSERT(xCurve.is());
- checkMovingAverageTrendline(xCurve, "col2_moving_avg", 3);
+ checkMovingAverageTrendline(xCurve, u"col2_moving_avg"_ustr, 3);
}
}
// improve the test
-void Chart2ExportTest::testErrorBarXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarXLSX)
{
- load(u"/chart2/qa/extras/data/ods/", "error_bar.ods");
+ loadFromFile(u"ods/error_bar.ods");
{
// make sure the ODS import was successful
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
CPPUNIT_ASSERT(xChartDoc.is());
Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
@@ -400,9 +208,9 @@ void Chart2ExportTest::testErrorBarXLSX()
testErrorBar(xErrorBarYProps);
}
- reload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
{
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
CPPUNIT_ASSERT(xChartDoc.is());
Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
@@ -417,58 +225,59 @@ void Chart2ExportTest::testErrorBarXLSX()
}
}
-void Chart2ExportTest::testErrorBarPropXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarPropXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "testErrorBarProp.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML");
+ loadFromFile(u"xlsx/testErrorBarProp.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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", "val", "y");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:spPr/a:ln", "w", "12600");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:errDir", "val", u"y");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:spPr/a:ln", "w", u"12600");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", u"ff0000");
// test x error bars property
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:errDir", "val", "x");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:spPr/a:ln", "w", "9360");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "595959");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:errDir", "val", u"x");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:spPr/a:ln", "w", u"9360");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", u"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.
-void Chart2ExportTest::testTrendline()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendline)
{
- mbSkipValidation = true;
- load(u"/chart2/qa/extras/data/ods/", "trendline.ods");
- checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
- reload("calc8");
- checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
+ // Validation fails with
+ // Error: tag name "chart:symbol-image" is not allowed. Possible tag names are: <label-separator>
+ skipValidation();
+ loadFromFile(u"ods/trendline.ods");
+ checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 ));
+ saveAndReload(u"calc8"_ustr);
+ checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 ));
}
-void Chart2ExportTest::testTrendlineOOXML()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendlineOOXML)
{
- load(u"/chart2/qa/extras/data/ods/", "trendline.ods");
- checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
- reload("Calc Office Open XML");
- checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
+ loadFromFile(u"ods/trendline.ods");
+ checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 ));
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 ));
}
-void Chart2ExportTest::testTrendlineXLS()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendlineXLS)
{
- mbSkipValidation = true;
- load(u"/chart2/qa/extras/data/ods/", "trendline.ods");
- checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
- reload("MS Excel 97");
- checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
+ loadFromFile(u"ods/trendline.ods");
+ checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 ));
+ saveAndReload(u"MS Excel 97"_ustr);
+ checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 ));
}
-void Chart2ExportTest::testMovingAverage()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testMovingAverage)
{
- mbSkipValidation = true;
- load(u"/chart2/qa/extras/data/ods/", "moving-type.ods");
- reload("calc8");
+ loadFromFile(u"ods/moving-type.ods");
+ saveAndReload(u"calc8"_ustr);
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent);
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
@@ -487,11 +296,11 @@ void Chart2ExportTest::testMovingAverage()
CPPUNIT_ASSERT(xProperties.is());
sal_Int32 nMovingAverageType = 0;
- xProperties->getPropertyValue("MovingAverageType") >>= nMovingAverageType;
+ xProperties->getPropertyValue(u"MovingAverageType"_ustr) >>= nMovingAverageType;
CPPUNIT_ASSERT_EQUAL(chart2::MovingAverageType::Central, nMovingAverageType);
}
-void Chart2ExportTest::testStockChart()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testStockChart)
{
/* For attached file Stock_Chart.docx, in chart1.xml,
* <c:stockChart>, there are four types of series as
@@ -500,50 +309,54 @@ void Chart2ExportTest::testStockChart()
* an attribute val of index should start from 1 and not from 0.
* Which was problem area.
*/
- load(u"/chart2/qa/extras/data/docx/", "testStockChart.docx");
+ loadFromFile(u"docx/testStockChart.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx", "val", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:order", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx", "val", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:order", "val", u"1");
assertXPathContent(
pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v",
- "Open");
+ u"Open");
}
-void Chart2ExportTest::testBarChart()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChart)
{
- load(u"/chart2/qa/extras/data/docx/", "testBarChart.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/testBarChart.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:barDir", "val", "col");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:barDir", "val", u"col");
}
-void Chart2ExportTest::testCrosses()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testCrosses)
{
// test crosses val="autoZero" with DOCX
{
- load(u"/chart2/qa/extras/data/docx/", "Bar_horizontal_cone.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/Bar_horizontal_cone.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", u"autoZero");
}
// tdf#142351: test crossesAt val="-50" with XLSX
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf142351.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf142351.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crossesAt", "val", "-50");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crossesAt", "val", u"-50");
}
}
-void Chart2ExportTest::testScatterChartTextXValues()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterChartTextXValues)
{
- load(u"/chart2/qa/extras/data/docx/", "scatter-chart-text-x-values.docx");
+ loadFromFile(u"docx/scatter-chart-text-x-values.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -554,9 +367,9 @@ void Chart2ExportTest::testScatterChartTextXValues()
// Make sure we have exactly 3 data series.
std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT);
CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size());
- CPPUNIT_ASSERT_EQUAL(OUString("Series 1"), aLabels[0][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("Series 2"), aLabels[1][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), aLabels[2][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Series 1"_ustr, aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Series 2"_ustr, aLabels[1][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Series 3"_ustr, aLabels[2][0].get<OUString>());
std::vector<std::vector<double> > aYValues = getDataSeriesYValuesFromChartType(xCT);
CPPUNIT_ASSERT_EQUAL(size_t(3), aYValues.size());
@@ -583,76 +396,79 @@ void Chart2ExportTest::testScatterChartTextXValues()
CPPUNIT_ASSERT_EQUAL(5.0, aYValues[2][3]);
// Test the export.
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
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]", "1");
+ assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal[1]/c:numRef[1]/c:numCache[1]/c:pt[1]/c:v[1]", u"1");
}
-void Chart2ExportTest::testScatterXAxisValues()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisValues)
{
- load(u"/chart2/qa/extras/data/odt/", "tdf114657.odt");
+ loadFromFile(u"odt/tdf114657.odt");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:ptCount", "val", "5");
- assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[1]/c:v", "15");
- assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[2]/c:v", "11");
- assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[3]/c:v", "20");
- assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[4]/c:v", "16");
+ assertXPath(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:ptCount", "val", u"5");
+ assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[1]/c:v", u"15");
+ assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[2]/c:v", u"11");
+ assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[3]/c:v", u"20");
+ assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[4]/c:v", u"16");
}
-void Chart2ExportTest::testScatterXAxisCategories()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisCategories)
{
- load(u"/chart2/qa/extras/data/odt/", "tdf131143.odt");
+ loadFromFile(u"odt/tdf131143.odt");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:ptCount", "val", "4");
- assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[1]/c:v", "Row 1");
- assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[2]/c:v", "Row 2");
+ assertXPath(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:ptCount", "val", u"4");
+ assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[1]/c:v", u"Row 1");
+ assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[2]/c:v", u"Row 2");
}
-void Chart2ExportTest::testChartDataTable()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartDataTable)
{
- load(u"/chart2/qa/extras/data/docx/", "testChartDataTable.docx");
+ loadFromFile(u"docx/testChartDataTable.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showHorzBorder", "val", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showVertBorder", "val", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showOutline", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showHorzBorder", "val", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showVertBorder", "val", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showOutline", "val", u"1");
}
-void Chart2ExportTest::testChartExternalData()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartExternalData)
{
- load(u"/chart2/qa/extras/data/docx/", "testMultipleChart.docx");
+ loadFromFile(u"docx/testMultipleChart.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- xmlXPathObjectPtr pXmlPathObj = getXPathNode(pXmlDoc, "/c:chartSpace/c:externalData");
- xmlNodeSetPtr pXmlNodes = pXmlPathObj->nodesetval;
- CPPUNIT_ASSERT(pXmlNodes);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:externalData");
}
-void Chart2ExportTest::testEmbeddingsGrabBag()
+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.
- load(u"/chart2/qa/extras/data/docx/", "testMultiplechartembeddings.docx" );
+ loadFromFile(u"docx/testMultiplechartembeddings.docx" );
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aGrabBag(0);
- xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
+ xTextDocumentPropertySet->getPropertyValue(u"InteropGrabBag"_ustr) >>= 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))
+ for (beans::PropertyValue const& prop : aGrabBag)
{
if (prop.Name == "OOXEmbeddings")
{
@@ -675,224 +491,273 @@ void Chart2ExportTest::testEmbeddingsGrabBag()
CPPUNIT_ASSERT(bEmbeddings); // Grab Bag has all the expected elements
}
-void Chart2ExportTest::testAreaChartLoad()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAreaChartLoad)
{
- load (u"/chart2/qa/extras/data/docx/", "testAreaChartLoad.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
+ loadFromFile(u"docx/testAreaChartLoad.docx");
+
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:showVal", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:showVal", "val", u"1");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:dLbl", 0);
}
-void Chart2ExportTest::testUpDownBars()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testUpDownBars)
{
- /*
- load("/chart2/qa/extras/data/docx/", "UpDownBars.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/UpDownBars.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:upDownBars");
- */
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:upDownBars", 0);
}
-void Chart2ExportTest::testDoughnutChart()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDoughnutChart)
{
- load(u"/chart2/qa/extras/data/docx/", "doughnutChart.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/doughnutChart.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart");
}
-void Chart2ExportTest::testDisplayUnits()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieOfPieChart)
{
- load(u"/chart2/qa/extras/data/docx/", "DisplayUnits.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"xlsx/pieOfPieChart.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:dispUnits/c:builtInUnit", "val", "billions");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:ofPieType[1]", "val", u"pie");
}
-// void Chart2ExportTest::testFdo74115WallGradientFill()
-// {
-// load("/chart2/qa/extras/data/docx/", "fdo74115_WallGradientFill.docx");
-// xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
-// CPPUNIT_ASSERT(pXmlDoc);
-//
-// assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill");
-// }
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieChart)
+{
+ loadFromFile(u"xlsx/barOfPieChart.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:ofPieType[1]", "val", u"bar");
+}
-void Chart2ExportTest::testFdo74115WallBitmapFill()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieOfPieSplitPos)
{
- load(u"/chart2/qa/extras/data/docx/", "fdo74115_WallBitmapFill.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"xlsx/pieOfPieChart2.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:splitPos[1]", "val", u"4");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieSplitPos)
+{
+ loadFromFile(u"xlsx/barOfPieChart2.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:splitPos[1]", "val", u"5");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits)
+{
+ loadFromFile(u"docx/DisplayUnits.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:dispUnits/c:builtInUnit", "val", u"billions");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallGradientFill)
+{
+ loadFromFile(u"docx/fdo74115_WallGradientFill.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallBitmapFill)
+{
+ loadFromFile(u"docx/fdo74115_WallBitmapFill.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill");
}
-void Chart2ExportTest::testPieChartWallLineStyle()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartWallLineStyle)
{
- load(u"/chart2/qa/extras/data/odt/", "testPieChartWallLineStyle.odt");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"odt/testPieChartWallLineStyle.odt");
+
+ // FIXME: validation error in OOXML export: Errors: 9
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:noFill");
}
//The below test case tests the built in marker 'x' for Office 2010 in Line charts
-void Chart2ExportTest::testFdo78290LineChartMarkerX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290LineChartMarkerX)
{
- load(u"/chart2/qa/extras/data/docx/", "fdo78290_Line_Chart_Marker_x.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/fdo78290_Line_Chart_Marker_x.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x");
- assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7");
+ assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val",u"x");
+ assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val",u"7");
}
// We can also use the built in marker 'x' in scatter chart, hence writing the test case for the same.
-void Chart2ExportTest::testFdo78290ScatterChartMarkerX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290ScatterChartMarkerX)
{
- load(u"/chart2/qa/extras/data/docx/", "fdo78290_Scatter_Chart_Marker_x.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/fdo78290_Scatter_Chart_Marker_x.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x");
- assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7");
+ assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val",u"x");
+ assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val",u"7");
}
// Also in a combination of charts like a column chart and line chart, we can use the built in marker 'x'
// for the line chart too. hence put a test case for the combination chart also.
-void Chart2ExportTest::testFdo78290CombinationChartMarkerX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290CombinationChartMarkerX)
{
- load(u"/chart2/qa/extras/data/docx/", "fdo78290_Combination_Chart_Marker_x.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/fdo78290_Combination_Chart_Marker_x.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x");
- assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7");
+ assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val",u"x");
+ assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val",u"7");
}
-void Chart2ExportTest::testTdf126115IndividualMarker()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTdf126115IndividualMarker)
{
// Check individual marker properties.
- load(u"/chart2/qa/extras/data/xlsx/", "tdf126115.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf126115.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// 1. series
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:symbol", "val", "square");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:size", "val", "8");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:symbol", "val", u"square");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:size", "val", u"8");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:spPr/a:solidFill/a:srgbClr", "val", u"ff0000");
// 2. series
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:symbol", "val", "x");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:size", "val", "15");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:spPr/a:solidFill/a:srgbClr", "val", "7030a0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:symbol", "val", u"x");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:size", "val", u"15");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[2]/c:dPt/c:marker/c:spPr/a:solidFill/a:srgbClr", "val", u"7030a0");
}
-void Chart2ExportTest::testAxisNumberFormatODS()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAxisNumberFormatODS)
{
- struct
+ auto verify = [this]( const Reference<chart2::XChartDocument>& xChartDoc )
{
- void check( const Reference<chart2::XChartDocument>& xChartDoc )
- {
- Reference<chart2::XAxis> xAxisX = getAxisFromDoc(xChartDoc, 0, 0, 0);
- Reference<chart2::XTitled> 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<beans::XPropertySet> 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<chart2::XAxis> 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;
+ Reference<chart2::XAxis> xAxisX = getAxisFromDoc(xChartDoc, 0, 0, 0);
+ Reference<chart2::XTitled> xTitle(xAxisX, UNO_QUERY_THROW);
+ OUString aTitleText = getTitleString(xTitle);
+ CPPUNIT_ASSERT_EQUAL(u"Linked To Source"_ustr, 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<beans::XPropertySet> xPS(xAxisX, uno::UNO_QUERY_THROW);
+ xPS->getPropertyValue(u"LinkNumberFormatToSource"_ustr) >>= bNumFmtLinked;
+ CPPUNIT_ASSERT_MESSAGE("X axis should have its number format linked to source.", bNumFmtLinked);
+
+ Reference<chart2::XAxis> xAxisY = getAxisFromDoc(xChartDoc, 0, 1, 0);
+ xTitle.set(xAxisY, UNO_QUERY_THROW);
+ aTitleText = getTitleString(xTitle);
+ CPPUNIT_ASSERT_EQUAL(u"Not Linked"_ustr, 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(u"LinkNumberFormatToSource"_ustr) >>= bNumFmtLinked;
+ CPPUNIT_ASSERT_MESSAGE("Y axis should not have its number format linked to source.", !bNumFmtLinked);
+ };
- load(u"/chart2/qa/extras/data/ods/", "axis-numformats-linked.ods");
+ loadFromFile(u"ods/axis-numformats-linked.ods");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
- aTest.check(xChartDoc);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
+ verify(xChartDoc);
// Reload the document and make sure everything remains intact.
- reload("calc8");
- xChartDoc = getChartDocFromSheet(0, mxComponent);
- aTest.check(xChartDoc);
+ saveAndReload(u"calc8"_ustr);
+ xChartDoc = getChartDocFromSheet(0);
+ verify(xChartDoc);
}
-void Chart2ExportTest::testAxisNumberFormatXLS()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAxisNumberFormatXLS)
{
- struct
+ auto verify = [this]( const Reference<chart2::XChartDocument>& xChartDoc, bool bNumFmtLinkedActual, sal_Int16 nNumFmtTypeFlag )
{
- void check( const Reference<chart2::XChartDocument>& xChartDoc, bool bNumFmtLinkedActual, sal_Int16 nNumFmtTypeFlag ) const
+ Reference<chart2::XAxis> xAxisY = getAxisFromDoc( xChartDoc, 0, 1, 0 );
+ bool bNumFmtLinked = false;
+ Reference<beans::XPropertySet> xPS( xAxisY, uno::UNO_QUERY_THROW );
+ xPS->getPropertyValue( u"LinkNumberFormatToSource"_ustr ) >>= bNumFmtLinked;
+
+ if ( bNumFmtLinkedActual )
+ CPPUNIT_ASSERT_MESSAGE( "Y axis should have its number format linked to source.", bNumFmtLinked );
+ else
{
- Reference<chart2::XAxis> xAxisY = getAxisFromDoc( xChartDoc, 0, 1, 0 );
- bool bNumFmtLinked = false;
- Reference<beans::XPropertySet> xPS( xAxisY, uno::UNO_QUERY_THROW );
- xPS->getPropertyValue( "LinkNumberFormatToSource" ) >>= bNumFmtLinked;
+ CPPUNIT_ASSERT_MESSAGE( "Y axis should not have its number format linked to source.", !bNumFmtLinked );
- if ( bNumFmtLinkedActual )
- CPPUNIT_ASSERT_MESSAGE( "Y axis should 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 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 ) );
- }
+ CPPUNIT_ASSERT_MESSAGE( "Y axis should be number format.", ( nType & util::NumberFormat::NUMBER ) );
}
+ };
- void change( const Reference<chart2::XChartDocument>& xChartDoc, sal_Int16 nNumFmtTypeFlag )
- {
- Reference<chart2::XAxis> xAxisY = getAxisFromDoc( xChartDoc, 0, 1, 0 );
- Reference<beans::XPropertySet> xPS( xAxisY, uno::UNO_QUERY_THROW );
- Any aAny( false );
- xPS->setPropertyValue( "LinkNumberFormatToSource", aAny );
-
- Reference<util::XNumberFormatsSupplier> xNFS( xChartDoc, uno::UNO_QUERY_THROW );
- Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats();
- CPPUNIT_ASSERT( xNumberFormats.is() );
- lang::Locale aLocale{ "en", "US", "" };
- Sequence<sal_Int32> aNumFmts = xNumberFormats->queryKeys( nNumFmtTypeFlag, aLocale, false );
- CPPUNIT_ASSERT( aNumFmts.hasElements() );
- aAny <<= aNumFmts[0];
- xPS->setPropertyValue( CHART_UNONAME_NUMFMT, aAny );
- }
+ loadFromFile(u"xls/axis_sourceformatting.xls" );
- } aTest;
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet( 0 );
+ verify( xChartDoc, true, util::NumberFormat::PERCENT );
- load( u"/chart2/qa/extras/data/xls/", "axis_sourceformatting.xls" );
+ Reference<chart2::XAxis> xAxisY = getAxisFromDoc( xChartDoc, 0, 1, 0 );
+ Reference<beans::XPropertySet> xPS( xAxisY, uno::UNO_QUERY_THROW );
+ Any aAny( false );
+ xPS->setPropertyValue( u"LinkNumberFormatToSource"_ustr, aAny );
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet( 0, mxComponent );
- aTest.check( xChartDoc, true, util::NumberFormat::PERCENT );
+ Reference<util::XNumberFormatsSupplier> xNFS( xChartDoc, uno::UNO_QUERY_THROW );
+ Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats();
+ CPPUNIT_ASSERT( xNumberFormats.is() );
+ lang::Locale aLocale{ u"en"_ustr, u"US"_ustr, u""_ustr };
+ Sequence<sal_Int32> aNumFmts = xNumberFormats->queryKeys( util::NumberFormat::NUMBER, aLocale, false );
+ CPPUNIT_ASSERT( aNumFmts.hasElements() );
+ aAny <<= aNumFmts[0];
+ xPS->setPropertyValue( CHART_UNONAME_NUMFMT, aAny );
- aTest.change( xChartDoc, util::NumberFormat::NUMBER );
// Write the document(xls) with changes made close it, load it and check if changes are intact
- reload( "MS Excel 97" );
- xChartDoc = getChartDocFromSheet( 0, mxComponent );
- aTest.check( xChartDoc, false, util::NumberFormat::NUMBER );
+ saveAndReload( u"MS Excel 97"_ustr );
+ xChartDoc = getChartDocFromSheet( 0 );
+ verify( xChartDoc, false, util::NumberFormat::NUMBER );
}
-void Chart2ExportTest::testDataLabelBordersDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelBordersDOCX)
{
struct Check
{
@@ -901,72 +766,39 @@ void Chart2ExportTest::testDataLabelBordersDOCX()
Color mnColor;
};
- struct
+ auto verify = [this]( const Reference<chart2::XChartDocument>& xChartDoc, sal_Int32 nShape )
{
- /**
- * Chart 1 has 4 bars of which 1st and 3rd have labels with borders
- * around them.
- */
- void checkObject1( const Reference<chart2::XChartDocument>& xChartDoc )
- {
- CPPUNIT_ASSERT(xChartDoc.is());
+ CPPUNIT_ASSERT(xChartDoc.is());
- Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
- CPPUNIT_ASSERT(xDataSeries.is());
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xDataSeries.is());
- // Check to make sure that data points 0 and 2 have local properties.
- Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY);
- CPPUNIT_ASSERT(xPropSet.is());
+ // Check to make sure that data points 0 and 2 have local properties.
+ Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPropSet.is());
- Sequence<sal_Int32> 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 < SAL_N_ELEMENTS(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);
- }
- }
+ Sequence<sal_Int32> aIndices;
+ xPropSet->getPropertyValue(u"AttributedDataPoints"_ustr) >>= 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]);
+ */
- /**
- * Chart 2 has all its data labels with identical borders.
- */
- void checkObject2( const Reference<chart2::XChartDocument>& xChartDoc )
+ static const Check aDataPoints[] =
{
- CPPUNIT_ASSERT(xChartDoc.is());
+ { 0, css::drawing::LineStyle_SOLID, 0x00FFFF00 }, // solid yellow
+ { 2, css::drawing::LineStyle_SOLID, 0x00FF0000 } // solid red
+ };
- Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
- CPPUNIT_ASSERT(xDataSeries.is());
-
- Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY);
+ 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(css::drawing::LineStyle_SOLID, eLineStyle);
+ CPPUNIT_ASSERT_EQUAL(aDataPoints[i].meStyle, eLineStyle);
sal_Int32 nWidth = -1;
xPropSet->getPropertyValue(CHART_UNONAME_LABEL_BORDER_WIDTH) >>= nWidth;
@@ -974,45 +806,57 @@ void Chart2ExportTest::testDataLabelBordersDOCX()
Color nColor;
xPropSet->getPropertyValue(CHART_UNONAME_LABEL_BORDER_COLOR) >>= nColor;
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Border color should be green.", COL_LIGHTGREEN, nColor);
+ if (nShape == 0)
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Border color is wrong.", aDataPoints[i].mnColor, nColor);
+ else
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Border color should be green.", COL_LIGHTGREEN, nColor);
}
+ };
- } aTest;
-
- load(u"/chart2/qa/extras/data/docx/", "data-label-borders.docx");
+ loadFromFile(u"docx/data-label-borders.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
// "Automatic" chart background fill in docx should be loaded as solid white.
Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
CPPUNIT_ASSERT(xPropSet.is());
- drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>();
- sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get<sal_Int32>();
+ drawing::FillStyle eStyle = xPropSet->getPropertyValue(u"FillStyle"_ustr).get<drawing::FillStyle>();
+ sal_Int32 nColor = xPropSet->getPropertyValue(u"FillColor"_ustr).get<sal_Int32>();
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);
+ // Chart 1 has 4 bars of which 1st and 3rd have labels with borders around them.
+ verify(xChartDoc, 0);
xChartDoc.set(getChartDocFromWriter(1), uno::UNO_QUERY);
- aTest.checkObject2(xChartDoc);
- reload("Office Open XML Text");
+ // Chart 2 has all its data labels with identical borders.
+ verify(xChartDoc, 1);
+
+ // FIXME: validation error in OOXML export: Errors: 3
+ skipValidation();
+
+ saveAndReload(u"Office Open XML Text"_ustr);
xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY);
- aTest.checkObject1(xChartDoc);
+ verify(xChartDoc , 0);
xChartDoc.set(getChartDocFromWriter(1), uno::UNO_QUERY);
- aTest.checkObject2(xChartDoc);
+ verify(xChartDoc, 1);
}
-void Chart2ExportTest::testDataLabel3DChartDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabel3DChartDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "3d-bar-label.docx");
+ loadFromFile(u"docx/3d-bar-label.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// We must not export label position attributes for 3D bar charts. The
@@ -1021,43 +865,49 @@ void Chart2ExportTest::testDataLabel3DChartDOCX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0);
}
-void Chart2ExportTest::testDataLabelBarChartDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelBarChartDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "bar-chart-labels.docx");
+ loadFromFile(u"docx/bar-chart-labels.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLblPos", "val", "ctr");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:dLblPos", "val", "inEnd");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:dLblPos", "val", "inBase");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLblPos", "val", u"ctr");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:dLblPos", "val", u"inEnd");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:dLblPos", "val", u"inBase");
}
-void Chart2ExportTest::testDataLabelClusteredBarChartDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelClusteredBarChartDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "clustered-bar-chart-labels.docx");
+ loadFromFile(u"docx/clustered-bar-chart-labels.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
+ // FIXME: validation error in OOXML export: Errors: 9
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// This was "t", should be one of the allowed values.
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLbl[2]/c:dLblPos", "val", "outEnd");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLbl[2]/c:dLblPos", "val", u"outEnd");
}
-void Chart2ExportTest::testDataLabelRadarChartDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelRadarChartDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "radar-chart-labels.docx");
+ loadFromFile(u"docx/radar-chart-labels.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// We must not export label position attributes for radar charts.
@@ -1065,14 +915,18 @@ void Chart2ExportTest::testDataLabelRadarChartDOCX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:radarChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0);
}
-void Chart2ExportTest::testDataLabelDoughnutChartDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelDoughnutChartDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "doughnut-chart-labels.docx");
+ loadFromFile(u"docx/doughnut-chart-labels.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// We must not export label position attributes for doughnut charts.
@@ -1080,14 +934,18 @@ void Chart2ExportTest::testDataLabelDoughnutChartDOCX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0);
}
-void Chart2ExportTest::testDataLabelAreaChartDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelAreaChartDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "area-chart-labels.docx");
+ loadFromFile(u"docx/area-chart-labels.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// We must not export label position attributes for area charts.
@@ -1095,185 +953,70 @@ void Chart2ExportTest::testDataLabelAreaChartDOCX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:dLbl/c:dLblPos", 0);
}
-void Chart2ExportTest::testDataLabelDefaultLineChartDOCX()
+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.
- load(u"/chart2/qa/extras/data/docx/", "line-chart-label-default-placement.docx");
+ loadFromFile(u"docx/line-chart-label-default-placement.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- reload("Office Open XML Text");
+ saveAndReload(u"Office Open XML Text"_ustr);
xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY);
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY);
CPPUNIT_ASSERT(xPropSet.is());
sal_Int32 nLabelPlacement = -1;
- if (xPropSet->getPropertyValue("LabelPlacement") >>= nLabelPlacement)
+ if (xPropSet->getPropertyValue(u"LabelPlacement"_ustr) >>= 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 );
}
-void Chart2ExportTest::testIndividualDataLabelProps()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf122915.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open 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", "b", "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", "sz", "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", "val", "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", "typeface", "Times New Roman");
-}
-
-void Chart2ExportTest::testTdf108107()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf108107.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:idx", "val", "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", "b", "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", "sz", "2000");
-}
-
-void Chart2ExportTest::testTdf114139()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf114139.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart", 1);
- //no fill
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr", 0);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:solidFill", 0);
-}
-
-void Chart2ExportTest::testTdf64224()
-{
- load(u"/chart2/qa/extras/data/ods/", "tdf64224.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- //no fill
- assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:noFill", 1);
- assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:solidFill", 0);
-}
-
-void Chart2ExportTest::testChartTitlePropertiesColorFillDOCX()
-{
- load(u"/chart2/qa/extras/data/docx/", "testChartTitlePropertiesColorFill.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
-}
-
-void Chart2ExportTest::testChartTitlePropertiesGradientFillDOCX()
-{
- load(u"/chart2/qa/extras/data/docx/", "testChartTitlePropertiesGradientFill.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "cccccc");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", "666666");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
-}
-
-void Chart2ExportTest::testChartTitlePropertiesBitmapFillDOCX()
-{
- load(u"/chart2/qa/extras/data/docx/", "testChartTitlePropertiesBitmapFill.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", "rId1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
-}
-
-void Chart2ExportTest::testColorGradientWithTransparencyDOCX()
-{
- // Test color gradient (two color) with gradient transparency
- load(u"/chart2/qa/extras/data/docx/", "testColorGradientWithTransparency.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
- 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", "val", "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", "val", "90196");
-}
-
-void Chart2ExportTest::testColorGradientWithTransparencyODS()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testIndividualDataLabelProps)
{
- // Test color gradient (two color) with simple transparency
- load(u"/chart2/qa/extras/data/ods/", "testColorGradientWithTransparency.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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", "val", "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", "val", "60000");
-}
+ loadFromFile(u"xlsx/tdf122915.xlsx");
-void Chart2ExportTest::testColorGradientStopXLSX()
-{
- // Test color gradient (two color) stop of the first color
- load(u"/chart2/qa/extras/data/xlsx/", "tdf128619.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- // Test the position of the first color
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[1]", "pos", "45000");
- // Test the position of the second color
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[2]", "pos", "100000");
-}
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
-void Chart2ExportTest::testRadialColorGradientDOCX()
-{
- load(u"/chart2/qa/extras/data/docx/", "tdf128794.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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", 0);
- // Test the linear gradient angle
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:lin", "ang", "13500000");
+ 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", "b", u"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", "sz", u"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", "val", u"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", "typeface", u"Times New Roman");
}
-void Chart2ExportTest::testBarChartDataPointPropDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChartRotation)
{
- load(u"/chart2/qa/extras/data/docx/", "testBarChartDataPointPropDOCX.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/barChartRotation.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0");
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:idx", "val", "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", "val", "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", "val", "c7d5ed");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "70ad47");
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx", "val", "2");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "000000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", u"30");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotY", "val", u"50");
}
-void Chart2ExportTest::testBarChartRotation()
-{
- load (u"/chart2/qa/extras/data/docx/", "barChartRotation.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", "30");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotY", "val", "50");
-}
-
-void Chart2ExportTest::testShapeFollowedByChart()
+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.
*/
- load(u"/chart2/qa/extras/data/docx/", "FDO74430.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/document", "Office Open XML Text" );
+ loadFromFile(u"docx/FDO74430.docx");
+
+ // FIXME: validation error in OOXML export: Errors: 5
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr );
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
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]", "id");
@@ -1282,26 +1025,32 @@ void Chart2ExportTest::testShapeFollowedByChart()
CPPUNIT_ASSERT( aValueOfFirstDocPR != aValueOfSecondDocPR );
}
-void Chart2ExportTest::testPieChartDataLabels()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartDataLabels)
{
- load(u"/chart2/qa/extras/data/docx/", "PieChartDataLabels.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/PieChartDataLabels.docx");
+
+ // FIXME: validation error in OOXML export: Errors: 19
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser[1]/c:dLbls/c:dLbl[1]/c:dLblPos", "val", "outEnd");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser[1]/c:dLbls/c:dLbl[1]/c:dLblPos", "val", u"outEnd");
}
-void Chart2ExportTest::testSeriesIdxOrder()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSeriesIdxOrder)
{
- load(u"/chart2/qa/extras/data/docx/", "testSeriesIdxOrder.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/testSeriesIdxOrder.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:idx[1]", "val", "1");
- assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:order[1]", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:idx[1]", "val", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:order[1]", "val", u"1");
}
-void Chart2ExportTest::testScatterPlotLabels()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterPlotLabels)
{
- load(u"/chart2/qa/extras/data/odt/", "scatter-plot-labels.odt");
+ loadFromFile(u"odt/scatter-plot-labels.odt");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1311,12 +1060,12 @@ void Chart2ExportTest::testScatterPlotLabels()
// Make sure the original chart has 'a', 'b', 'c' as its data labels.
std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT);
CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size());
- CPPUNIT_ASSERT_EQUAL(OUString("a"), aLabels[0][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("b"), aLabels[1][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("c"), aLabels[2][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, aLabels[1][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, aLabels[2][0].get<OUString>());
// Reload the doc and check again. The labels should not change.
- reload("writer8");
+ saveAndReload(u"writer8"_ustr);
xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1326,17 +1075,17 @@ void Chart2ExportTest::testScatterPlotLabels()
aLabels = getDataSeriesLabelsFromChartType(xCT);
CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size());
- CPPUNIT_ASSERT_EQUAL(OUString("a"), aLabels[0][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("b"), aLabels[1][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("c"), aLabels[2][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"a"_ustr, aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"b"_ustr, aLabels[1][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"c"_ustr, aLabels[2][0].get<OUString>());
}
-void Chart2ExportTest::testErrorBarDataRangeODS()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarDataRangeODS)
{
- load(u"/chart2/qa/extras/data/ods/", "ErrorBarRange.ods");
- reload("calc8");
+ loadFromFile(u"ods/ErrorBarRange.ods");
+ saveAndReload(u"calc8"_ustr);
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
CPPUNIT_ASSERT(xChartDoc.is());
Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
@@ -1347,50 +1096,141 @@ void Chart2ExportTest::testErrorBarDataRangeODS()
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
- uno::Any aAny = xErrorBarYProps->getPropertyValue("ErrorBarRangePositive");
+ uno::Any aAny = xErrorBarYProps->getPropertyValue(u"ErrorBarRangePositive"_ustr);
CPPUNIT_ASSERT(aAny.hasValue());
OUString aPosRange;
aAny >>= aPosRange;
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$B$1:$B$3"), aPosRange);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet1.$B$1:$B$3"_ustr, aPosRange);
- aAny = xErrorBarYProps->getPropertyValue("ErrorBarRangeNegative");
+ aAny = xErrorBarYProps->getPropertyValue(u"ErrorBarRangeNegative"_ustr);
CPPUNIT_ASSERT(aAny.hasValue());
OUString aNegRange;
aAny >>= aNegRange;
- CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$C$1:$C$3"), aNegRange);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet1.$C$1:$C$3"_ustr, aNegRange);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_barOfPie)
+{
+ loadFromFile(u"ods/tdf50934_barOfPie.ods");
+ saveAndReload(u"calc8"_ustr);
+
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 );
+ CPPUNIT_ASSERT(xChartType.is());
+
+ CPPUNIT_ASSERT_EQUAL(u"com.sun.star.chart2.PieChartType"_ustr,
+ xChartType->getChartType());
+
+ // Verify that it saves and loads as bar-of-pie
+ Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW );
+ uno::Any aAny = xPropSet->getPropertyValue(u"SubPieType"_ustr);
+ CPPUNIT_ASSERT(aAny.hasValue());
+ chart2::PieChartSubType subPieType;
+ aAny >>= subPieType;
+ CPPUNIT_ASSERT_EQUAL(chart2::PieChartSubType_BAR, subPieType);
}
-void Chart2ExportTest::testChartCrash()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_pieOfPie)
{
- load(u"/chart2/qa/extras/data/docx/", "FDO75975.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"ods/tdf50934_pieOfPie.ods");
+ saveAndReload(u"calc8"_ustr);
+
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 );
+ CPPUNIT_ASSERT(xChartType.is());
+
+ CPPUNIT_ASSERT_EQUAL(u"com.sun.star.chart2.PieChartType"_ustr,
+ xChartType->getChartType());
+
+ // Verify that it saves and loads as pie-of-pie
+ Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW );
+ uno::Any aAny = xPropSet->getPropertyValue(u"SubPieType"_ustr);
+ CPPUNIT_ASSERT(aAny.hasValue());
+ chart2::PieChartSubType subPieType;
+ aAny >>= subPieType;
+ CPPUNIT_ASSERT_EQUAL(chart2::PieChartSubType_PIE, subPieType);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf161800_barOfPie_split_pos)
+{
+ loadFromFile(u"ods/tdf161800_barOfPie_split_pos.ods");
+ saveAndReload(u"calc8"_ustr);
+
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 );
+ CPPUNIT_ASSERT(xChartType.is());
+
+ // Verify that it saves and loads with the correct split position
+ Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW );
+ uno::Any aAny = xPropSet->getPropertyValue(u"SplitPos"_ustr);
+ CPPUNIT_ASSERT(aAny.hasValue());
+ double nSplitPos;
+ aAny >>= nSplitPos;
+ CPPUNIT_ASSERT_EQUAL(4.0, nSplitPos);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf161800_pieOfPie_split_pos)
+{
+ loadFromFile(u"ods/tdf161800_pieOfPie_split_pos.ods");
+ saveAndReload(u"calc8"_ustr);
+
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 );
+ CPPUNIT_ASSERT(xChartType.is());
+
+ CPPUNIT_ASSERT_EQUAL(u"com.sun.star.chart2.PieChartType"_ustr,
+ xChartType->getChartType());
+
+ // Verify that it saves and loads with the correct split position
+ Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW );
+ uno::Any aAny = xPropSet->getPropertyValue(u"SplitPos"_ustr);
+ CPPUNIT_ASSERT(aAny.hasValue());
+ double nSplitPos;
+ aAny >>= nSplitPos;
+ CPPUNIT_ASSERT_EQUAL(3.0, nSplitPos);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartCrash)
+{
+ loadFromFile(u"docx/FDO75975.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
}
-void Chart2ExportTest::testPieChartRotation()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartRotation)
{
- load (u"/chart2/qa/extras/data/docx/", "pieChartRotation.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
+ loadFromFile(u"docx/pieChartRotation.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", "40");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotY", "val", "30");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", u"40");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotY", "val", u"30");
}
-void Chart2ExportTest::testEmbeddingsOleObjectGrabBag()
+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.
- load(u"/chart2/qa/extras/data/docx/", "testchartoleobjectembeddings.docx" );
+ loadFromFile(u"docx/testchartoleobjectembeddings.docx" );
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aGrabBag(0);
- xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
+ xTextDocumentPropertySet->getPropertyValue(u"InteropGrabBag"_ustr) >>= 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))
+ for (beans::PropertyValue const& prop : aGrabBag)
{
if (prop.Name == "OOXEmbeddings")
{
@@ -1417,7 +1257,7 @@ namespace {
void checkGapWidth(Reference<beans::XPropertySet> const & xPropSet, sal_Int32 nValue)
{
- uno::Any aAny = xPropSet->getPropertyValue("GapwidthSequence");
+ uno::Any aAny = xPropSet->getPropertyValue(u"GapwidthSequence"_ustr);
CPPUNIT_ASSERT(aAny.hasValue());
uno::Sequence< sal_Int32 > aSequence;
aAny >>= aSequence;
@@ -1427,7 +1267,7 @@ void checkGapWidth(Reference<beans::XPropertySet> const & xPropSet, sal_Int32 nV
void checkOverlap(Reference<beans::XPropertySet> const & xPropSet, sal_Int32 nValue)
{
- uno::Any aAny = xPropSet->getPropertyValue("OverlapSequence");
+ uno::Any aAny = xPropSet->getPropertyValue(u"OverlapSequence"_ustr);
CPPUNIT_ASSERT(aAny.hasValue());
uno::Sequence< sal_Int32 > aSequence;
aAny >>= aSequence;
@@ -1435,521 +1275,127 @@ void checkOverlap(Reference<beans::XPropertySet> const & xPropSet, sal_Int32 nVa
CPPUNIT_ASSERT_EQUAL(nValue, aSequence[0]);
}
-void checkSheetForGapWidthAndOverlap(uno::Reference< chart2::XChartDocument > const & xChartDoc,
+void checkSheetForGapWidthAndOverlap(uno::Reference< chart2::XChartType > const & xChartType,
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 );
+ checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 120, -60);
+
+ xChartDoc = getChartDocFromSheet( 1 );
+ checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 50, 30);
+
+ saveAndReload(u"Calc Office Open XML"_ustr);
+
+ xChartDoc = getChartDocFromSheet( 0 );
+ checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 120, -60);
+
+ xChartDoc = getChartDocFromSheet( 1 );
+ checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 50, 30);
}
-void Chart2ExportTest::testGapWidthXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataseriesOverlapStackedChartXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "gapWidth.xlsx");
+ loadFromFile(u"xlsx/testDataseriesOverlapStackedChart.xlsx");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
- checkSheetForGapWidthAndOverlap(xChartDoc, 120, -60);
+ // test the overlap value of a simple Stacked Column Chart
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0);
+ checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 100, 0);
- xChartDoc = getChartDocFromSheet( 1, mxComponent );
- checkSheetForGapWidthAndOverlap(xChartDoc, 50, 30);
+ // test the overlap value of a Percent Stacked Bar Chart
+ xChartDoc = getChartDocFromSheet( 1);
+ checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 100, 35);
- reload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
- xChartDoc = getChartDocFromSheet( 0, mxComponent );
- checkSheetForGapWidthAndOverlap(xChartDoc, 120, -60);
+ xChartDoc = getChartDocFromSheet( 0);
+ checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 100, 100);
- xChartDoc = getChartDocFromSheet( 1, mxComponent );
- checkSheetForGapWidthAndOverlap(xChartDoc, 50, 30);
+ xChartDoc = getChartDocFromSheet( 1);
+ checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 100, 100);
}
-void Chart2ExportTest::testSmoothedLines()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSmoothedLines)
{
- load(u"/chart2/qa/extras/data/ods/", "smoothedLines.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"ods/smoothedLines.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:smooth", "val", "0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:smooth", "val", u"0");
}
-void Chart2ExportTest::testLabelStringODS()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testLabelStringODS)
{
- load(u"/chart2/qa/extras/data/ods/", "labelString.ods");
+ loadFromFile(u"ods/labelString.ods");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
Reference< chart2::data::XDataSequence > xLabelSeq =
getLabelDataSequenceFromDoc(xChartDoc);
CPPUNIT_ASSERT(xLabelSeq.is());
OUString aLabelString = xLabelSeq->getSourceRangeRepresentation();
- CPPUNIT_ASSERT_EQUAL(OUString("\"LabelName\""), aLabelString);
+ CPPUNIT_ASSERT_EQUAL(u"\"LabelName\""_ustr, aLabelString);
- reload("calc8");
+ saveAndReload(u"calc8"_ustr);
- xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ xChartDoc = getChartDocFromSheet( 0 );
xLabelSeq = getLabelDataSequenceFromDoc(xChartDoc);
CPPUNIT_ASSERT(xLabelSeq.is());
aLabelString = xLabelSeq->getSourceRangeRepresentation();
- CPPUNIT_ASSERT_EQUAL(OUString("\"LabelName\""), aLabelString);
-}
-
-void Chart2ExportTest::testFdo83058dlblPos()
-{
- load (u"/chart2/qa/extras/data/docx/", "fdo83058_dlblPos.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[2]/c:dLblPos", "val", "outEnd");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[3]/c:dLblPos", "val", "outEnd");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[4]/c:dLblPos", "val", "outEnd");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[5]/c:dLblPos", "val", "outEnd");
-}
-
-void Chart2ExportTest::testAutoTitleDelXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "autotitledel_2007.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "0");
+ CPPUNIT_ASSERT_EQUAL(u"\"LabelName\""_ustr, aLabelString);
}
-void Chart2ExportTest::testDispBlanksAsXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "dispBlanksAs_2007.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "gap");
-}
-void Chart2ExportTest::testMarkerColorXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testInvertNegative)
{
- load(u"/chart2/qa/extras/data/xlsx/", "markerColor.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:marker/c:spPr/a:solidFill/a:srgbClr", "val", "92d050");
-}
-
-void Chart2ExportTest::testRoundedCornersXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "markerColor.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:roundedCorners", "val", "0");
-}
-
-void Chart2ExportTest::testAxisNumberFormatXLSX()
-{
- load(u"/chart2/qa/extras/data/ods/", "axis_number_format.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx", 2);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:numFmt", "formatCode", "0.00E+000");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:numFmt", "sourceLinked", "0");
+ // Bar chart
+ {
+ loadFromFile(u"xlsx/invertIfNeg_bar.xlsx");
+ // make sure the import was successful
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
+ CPPUNIT_ASSERT(xChartDoc.is());
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:numFmt", "formatCode", "[$$-409]#,##0;\\-[$$-409]#,##0");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:numFmt", "sourceLinked", "1");
-}
+ Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
+ CPPUNIT_ASSERT( xDataSeries.is() );
-void Chart2ExportTest::testDataPointLabelNumberFormatXLSX()
-{
- load(u"/chart2/qa/extras/data/ods/", "tdf123774.ods");
- {
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", "formatCode", "[$-40E]0.00%");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", "sourceLinked", "0");
+ Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt", "formatCode", "[$-40E]0.00%");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt", "sourceLinked", "0");
+ bool bInvertNeg;
+ CPPUNIT_ASSERT(
+ xPropSet->getPropertyValue(u"InvertNegative"_ustr) >>= bInvertNeg);
+ CPPUNIT_ASSERT_EQUAL(true, bInvertNeg);
}
- load(u"/chart2/qa/extras/data/xlsx/", "tdf130986.xlsx");
+ // Bubble chart
{
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:idx", "val", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:numFmt", "formatCode", "0.00E+00");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:numFmt", "sourceLinked", "0");
- }
-}
-
-void Chart2ExportTest::testDataLabelDefaultValuesXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "data_label.xlsx");
- Reference< chart2::XChartDocument> xDoc = getChartDocFromSheet(0, mxComponent);
- Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xDoc, 0);
- Reference<beans::XPropertySet> xPropSet(xSeries, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("Label");
- chart2::DataPointLabel aLabel;
- CPPUNIT_ASSERT(aAny >>= aLabel);
- CPPUNIT_ASSERT(aLabel.ShowNumber);
-
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:showVal", "val", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLblPos", "val", "outEnd");
-}
-
-void Chart2ExportTest::testDataLabelFillColor()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "data_labels_fill_color.xlsx");
- Reference< chart2::XChartDocument> xDoc = getChartDocFromSheet(0, mxComponent);
- Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xDoc, 0);
- Reference<beans::XPropertySet> xPropSet(xSeries, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("LabelFillColor");
- sal_Int32 nLabelFillColor;
- CPPUNIT_ASSERT(aAny >>= nLabelFillColor);
-
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:spPr/a:solidFill/a:srgbClr", "val", "F79646");
-}
-
-void Chart2ExportTest::testTitleOverlayXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "chart_title.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:overlay", "val", "0");
-}
-
-void Chart2ExportTest::testInvertIfNegativeXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "bar_chart_simple.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative", "val", "0");
-}
-
-void Chart2ExportTest::testBubble3DXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "bubble_chart_simple.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[1]/c:bubble3D", "val", "0");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[2]/c:bubble3D", "val", "0");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[3]/c:bubble3D", "val", "0");
-}
-
-void Chart2ExportTest::testNoMarkerXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "no_marker.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:marker/c:symbol", "val", "none");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:marker/c:symbol", "val", "none");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:marker", "val", "0");
-}
-
-void Chart2ExportTest::testTitleManualLayoutXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "title_manual_layout.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:layoutTarget", 0);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:xMode", "val", "edge");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:yMode", "val", "edge");
-
- OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:x", "val");
- 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", "val");
- 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", "rot", "1200000");
-}
-
-void Chart2ExportTest::testPlotAreaManualLayoutXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "plot_area_manual_layout.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", "val", "inner");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:xMode", "val", "edge");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:yMode", "val", "edge");
-
- OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:x", "val");
- 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", "val");
- 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", "val");
- 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", "val");
- double nH = aHVal.toDouble();
- CPPUNIT_ASSERT(nH > 0);
- CPPUNIT_ASSERT(nH < 1);
- CPPUNIT_ASSERT(nH != nW);
-}
-
-void Chart2ExportTest::testLegendManualLayoutXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "legend_manual_layout.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", 0);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:xMode", "val", "edge");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:yMode", "val", "edge");
-
- OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:x", "val");
- 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", "val");
- 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", "val");
- 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", "val");
- 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", "sz", "900");
-}
-
-void Chart2ExportTest::testChartSubTitle()
-{
- load(u"/chart2/qa/extras/data/ods/", "testChartSubTitle.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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", "sz", "1100");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "b", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "00a933");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:latin", "typeface", "Times New Roman");
- assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:t", "It is a Subtitle");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "b2b2b2");
-}
-
-void Chart2ExportTest::testChartMainWithSubTitle()
-{
- load(u"/chart2/qa/extras/data/ods/", "testChartMainWithSubTitle.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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", "sz", "1300");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "b", "0");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "i", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "f10d0c");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:latin", "typeface", "Arial");
- assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:t", "It is a Maintitle\nIt is a Subtitle");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "81d41a");
-}
-
-void Chart2ExportTest::testAutoTitleDeleted()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "testAutoTitleDeleted.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "1");
-}
-
-void Chart2ExportTest::testChartTitlePropertiesColorFillXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "testChartTitlePropertiesColorFill.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
-}
-
-void Chart2ExportTest::testChartTitlePropertiesGradientFillXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "testChartTitlePropertiesGradientFill.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "cccccc");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", "666666");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
-}
-
-void Chart2ExportTest::testChartTitlePropertiesBitmapFillXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "testChartTitlePropertiesBitmapFill.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", "rId1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
-}
-
-void Chart2ExportTest::testBarChartDataPointPropXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "testBarChartDataPointPropXLSX.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0");
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:idx", "val", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "000000");
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx", "val", "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", "val", "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", "val", "c7d5ed");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "70ad47");
-}
-
-void Chart2ExportTest::testDataseriesOverlapStackedChartXLSX()
-{
- load(u"/chart2/qa/extras/data/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);
-
- reload("Calc Office Open XML");
-
- xChartDoc = getChartDocFromSheet( 0, mxComponent );
- checkSheetForGapWidthAndOverlap(xChartDoc, 100, 100);
-
- xChartDoc = getChartDocFromSheet( 1, mxComponent );
- checkSheetForGapWidthAndOverlap(xChartDoc, 100, 100);
-}
-
-void Chart2ExportTest::testAxisCharacterPropertiesXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "axis_character_properties.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "sz", "1000");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "b", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "i", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "u", "sng");
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr", "sz", "900");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr", "b", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr", "strike", "sngStrike");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "ff0000");
-}
-
-void Chart2ExportTest::testTitleCharacterPropertiesXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "title_character_properties.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "sz", "2400");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "b", "1");
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr", "sz", "2400");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr", "b", "1");
-}
-
-void Chart2ExportTest::testPlotVisOnlyXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "hidden_cells.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotVisOnly", "val", "0");
-}
-
-void Chart2ExportTest::testBarChartVaryColorsXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf90876.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0");
-}
-
-void Chart2ExportTest::testTdf96161()
-{
- load(u"/chart2/qa/extras/data/ods/", "tdf96161.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
-
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:varyColors", "val", "0");
-}
-
-void Chart2ExportTest::testMultipleAxisXLSX()
-{
- load(u"/chart2/qa/extras/data/ods/", "multiple_axis.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
+ loadFromFile(u"xlsx/invertIfNeg_bubble.xlsx");
+ // make sure the import was successful
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 );
+ CPPUNIT_ASSERT(xChartDoc.is());
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart", 2);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart[1]/c:ser", 1);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart[2]/c:ser", 1);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx", 4);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:delete[@val='1']", 1);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:axPos[@val='l']", 1);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:axPos[@val='r']", 1);
-}
+ Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
+ CPPUNIT_ASSERT( xDataSeries.is() );
-void Chart2ExportTest::testSecondaryAxisXLSX()
-{
- load(u"/chart2/qa/extras/data/ods/", "secondary_axis.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
+ Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart", 2);
- // test there is just those series in the first <lineChart> tag which are attached to the primary axis
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[1]/c:ser", 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", "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", "c");
- // test there is just those series in the second <lineChart> tag which are attached to the secondary axis
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[2]/c:ser", 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", "a");
+ bool bInvertNeg;
+ CPPUNIT_ASSERT(
+ xPropSet->getPropertyValue(u"InvertNegative"_ustr) >>= bInvertNeg);
+ CPPUNIT_ASSERT_EQUAL(true, bInvertNeg);
+ }
}
-void Chart2ExportTest::testBarChartSecondaryAxisXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "testSecondaryAxis.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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]", "val");
- OUString YValueIdOf1Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[1]/c:axId[2]", "val");
- // Collect barchart axID on secondary Axis
- OUString XValueIdOf2Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[2]/c:axId[1]", "val");
- OUString YValueIdOf2Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[2]/c:axId[2]", "val");
- // 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", "val", XValueIdOf1Barchart);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:axId", "val", YValueIdOf1Barchart);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[2]/c:axId", "val", XValueIdOf2Barchart);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:axId", "val", YValueIdOf2Barchart);
-}
-
-CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx
index 1fa862291459..f369661c5441 100644
--- a/chart2/qa/extras/chart2export2.cxx
+++ b/chart2/qa/extras/chart2export2.cxx
@@ -22,154 +22,17 @@ using beans::XPropertySet;
class Chart2ExportTest2 : public ChartTest
{
-protected:
- virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override;
-
public:
Chart2ExportTest2()
- : ChartTest()
+ : ChartTest(u"/chart2/qa/extras/data/"_ustr)
{
}
- void testSetSeriesToSecondaryAxisXLSX();
- void testCombinedChartSecondaryAxisXLSX();
- void testCombinedChartSecondaryAxisODS();
- void testCrossBetweenXLSX();
- void testCrossBetweenWithDeletedAxis();
- void testCrossBetweenODS();
- void testAxisTitleRotationXLSX();
- void testAxisTitlePositionDOCX();
- void testAxisCrossBetweenDOCX();
- void testPieChartDataPointExplosionXLSX();
- void testCustomDataLabel();
- void testDataSeriesName();
- void testCustomPositionofDataLabel();
- void testCustomDataLabelMultipleSeries();
- void testLeaderLines();
- void testNumberFormatExportPPTX();
- void testLabelSeparatorExportDOCX();
- void testChartTitlePropertiesColorFillPPTX();
- void testChartTitlePropertiesGradientFillPPTX();
- void testChartTitlePropertiesBitmapFillPPTX();
- void testxAxisLabelsRotation();
- void testMultipleCategoryAxisLablesXLSX();
- void testMultipleCategoryAxisLablesDOCX();
- void testTdf116163();
- void testTdf111824();
- void test3DAreaChartZAxis();
- void testTdf119029();
- void testTdf108022();
- void testTdf121744();
- void testTdf121189();
- void testTdf122031();
- void testTdf115012();
- void testTdf134118();
- void testTdf123206_customLabelText();
- void testCustomLabelText();
- void testDeletedLegendEntries();
- void testTdf60316();
- void testTdf130225();
- void testTdf59857();
- void testTdf126076();
- void testTdf75330();
- void testTdf127792();
- void testTdf131979();
- void testTdf132076();
- void testTdf125812();
- void testTdf133190();
- void testTdf133191();
- void testTdf132594();
- void testTdf134255();
- void testTdf134977();
- void testTdf123647();
- void testTdf136267();
- void testDataLabelPlacementPieChart();
- void testTdf137917();
- void testTdf138204();
- void testTdf138181();
- void testCustomShapeText();
- void testuserShapesXLSX();
- void testuserShapesDOCX();
- void testGraphicBlipXLSX();
- void testNameRangeXLSX();
- void testTdf143942();
- void testDateCategoriesPPTX();
-
- CPPUNIT_TEST_SUITE(Chart2ExportTest2);
- CPPUNIT_TEST(testSetSeriesToSecondaryAxisXLSX);
- CPPUNIT_TEST(testCombinedChartSecondaryAxisXLSX);
- CPPUNIT_TEST(testCombinedChartSecondaryAxisODS);
- CPPUNIT_TEST(testCrossBetweenXLSX);
- CPPUNIT_TEST(testCrossBetweenWithDeletedAxis);
- CPPUNIT_TEST(testCrossBetweenODS);
- CPPUNIT_TEST(testAxisTitleRotationXLSX);
- CPPUNIT_TEST(testAxisTitlePositionDOCX);
- CPPUNIT_TEST(testAxisCrossBetweenDOCX);
- CPPUNIT_TEST(testPieChartDataPointExplosionXLSX);
- CPPUNIT_TEST(testCustomDataLabel);
- CPPUNIT_TEST(testDataSeriesName);
- CPPUNIT_TEST(testCustomPositionofDataLabel);
- CPPUNIT_TEST(testCustomDataLabelMultipleSeries);
- CPPUNIT_TEST(testLeaderLines);
- CPPUNIT_TEST(testNumberFormatExportPPTX);
- CPPUNIT_TEST(testLabelSeparatorExportDOCX);
- CPPUNIT_TEST(testChartTitlePropertiesColorFillPPTX);
- CPPUNIT_TEST(testChartTitlePropertiesGradientFillPPTX);
- CPPUNIT_TEST(testChartTitlePropertiesBitmapFillPPTX);
- CPPUNIT_TEST(testxAxisLabelsRotation);
- CPPUNIT_TEST(testMultipleCategoryAxisLablesXLSX);
- CPPUNIT_TEST(testMultipleCategoryAxisLablesDOCX);
- CPPUNIT_TEST(testTdf116163);
- CPPUNIT_TEST(testTdf111824);
- CPPUNIT_TEST(test3DAreaChartZAxis);
- CPPUNIT_TEST(testTdf119029);
- CPPUNIT_TEST(testTdf108022);
- CPPUNIT_TEST(testTdf121744);
- CPPUNIT_TEST(testTdf121189);
- CPPUNIT_TEST(testTdf122031);
- CPPUNIT_TEST(testTdf115012);
- CPPUNIT_TEST(testTdf134118);
- CPPUNIT_TEST(testTdf123206_customLabelText);
- CPPUNIT_TEST(testCustomLabelText);
- CPPUNIT_TEST(testDeletedLegendEntries);
- CPPUNIT_TEST(testTdf60316);
- CPPUNIT_TEST(testTdf130225);
- CPPUNIT_TEST(testTdf59857);
- CPPUNIT_TEST(testTdf126076);
- CPPUNIT_TEST(testTdf75330);
- CPPUNIT_TEST(testTdf127792);
- CPPUNIT_TEST(testTdf131979);
- CPPUNIT_TEST(testTdf132076);
- CPPUNIT_TEST(testTdf125812);
- CPPUNIT_TEST(testTdf133190);
- CPPUNIT_TEST(testTdf133191);
- CPPUNIT_TEST(testTdf132594);
- CPPUNIT_TEST(testTdf134255);
- CPPUNIT_TEST(testTdf134977);
- CPPUNIT_TEST(testTdf123647);
- CPPUNIT_TEST(testTdf136267);
- CPPUNIT_TEST(testDataLabelPlacementPieChart);
- CPPUNIT_TEST(testTdf137917);
- CPPUNIT_TEST(testTdf138204);
- CPPUNIT_TEST(testTdf138181);
- CPPUNIT_TEST(testCustomShapeText);
- CPPUNIT_TEST(testuserShapesXLSX);
- CPPUNIT_TEST(testuserShapesDOCX);
- CPPUNIT_TEST(testGraphicBlipXLSX);
- CPPUNIT_TEST(testNameRangeXLSX);
- CPPUNIT_TEST(testTdf143942);
- CPPUNIT_TEST(testDateCategoriesPPTX);
- CPPUNIT_TEST_SUITE_END();
};
-void Chart2ExportTest2::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testSetSeriesToSecondaryAxisXLSX)
{
- XmlTestTools::registerOOXMLNamespaces(pXmlXPathCtx);
-}
-
-void Chart2ExportTest2::testSetSeriesToSecondaryAxisXLSX()
-{
- load(u"/chart2/qa/extras/data/xlsx/", "add_series_secondary_axis.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/add_series_secondary_axis.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
// Second series
Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xChartDoc, 1);
CPPUNIT_ASSERT(xSeries.is());
@@ -177,19 +40,21 @@ void Chart2ExportTest2::testSetSeriesToSecondaryAxisXLSX()
Reference<beans::XPropertySet> 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));
+ xPropSet->setPropertyValue(u"AttachedAxisIndex"_ustr, uno::Any(AxisIndex));
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Check there are only two <lineChart> tag in the XML, one for the primary and one for the secondary axis.
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart", 2);
}
-void Chart2ExportTest2::testCombinedChartSecondaryAxisXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCombinedChartSecondaryAxisXLSX)
{
// Original file was created with MS Office
- load(u"/chart2/qa/extras/data/xlsx/", "combined_chart_secondary_axis.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/combined_chart_secondary_axis.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Collect barchart axID on secondary Axis
OUString XValueIdOfBarchart
@@ -212,11 +77,12 @@ void Chart2ExportTest2::testCombinedChartSecondaryAxisXLSX()
YValueIdOfBarchart);
}
-void Chart2ExportTest2::testCombinedChartSecondaryAxisODS()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCombinedChartSecondaryAxisODS)
{
// Original file was created with LibreOffice
- load(u"/chart2/qa/extras/data/ods/", "combined_chart_secondary_axis.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"ods/combined_chart_secondary_axis.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Collect barchart axID on secondary Axis
OUString XValueIdOfBarchart
@@ -241,59 +107,85 @@ void Chart2ExportTest2::testCombinedChartSecondaryAxisODS()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[2]/c:crosses", 0);
}
-void Chart2ExportTest2::testCrossBetweenXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenXLSX)
{
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
// Original files were created with MS Office
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf127777.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf127777.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val",
- "between");
+ u"between");
}
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf132076.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf132076.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val",
- "between");
+ u"between");
}
}
-void Chart2ExportTest2::testCrossBetweenWithDeletedAxis()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenWithDeletedAxis)
{
// Original file was created with MS Office (the category axis is deleted in the file)
- load(u"/chart2/qa/extras/data/xlsx/", "tdf128633.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf128633.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val",
- "between");
+ u"between");
}
-void Chart2ExportTest2::testCrossBetweenODS()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenODS)
{
// Original file was created with LibreOffice
- load(u"/chart2/qa/extras/data/ods/", "test_CrossBetween.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"ods/test_CrossBetween.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val",
- "between");
+ u"between");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexTitleXLSX)
+{
+ loadFromFile(u"xlsx/funnel1.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series",
+ "layoutId", u"funnel");
+ assertXPath(pXmlDoc,
+ "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series/cx:spPr/"
+ "a:solidFill/a:srgbClr",
+ "val", u"c55a11");
+ assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v",
+ u"Funnel chart!");
}
-void Chart2ExportTest2::testAxisTitleRotationXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitleRotationXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "axis_title_rotation.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/axis_title_rotation.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:tx/c:rich/a:bodyPr",
- "rot", "0");
+ "rot", u"0");
}
-void Chart2ExportTest2::testAxisTitlePositionDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitlePositionDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "testAxisTitlePosition.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/testAxisTitlePosition.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// test X Axis title position
@@ -322,33 +214,32 @@ void Chart2ExportTest2::testAxisTitlePositionDOCX()
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.384070199122511, nY, 1e-2);
}
-void Chart2ExportTest2::testAxisCrossBetweenDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisCrossBetweenDOCX)
{
- load(u"/chart2/qa/extras/data/odt/", "axis-position.odt");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
- assertXPath(pXmlDoc, "(//c:crossBetween)[1]", "val", "midCat");
+ loadFromFile(u"odt/axis-position.odt");
+
+ // FIXME: validation error in OOXML export: Errors: 3
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ assertXPath(pXmlDoc, "(//c:crossBetween)[1]", "val", u"midCat");
}
-void Chart2ExportTest2::testPieChartDataPointExplosionXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testPieChartDataPointExplosionXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "pie_chart_datapoint_explosion.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/pie_chart_datapoint_explosion.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dPt/c:explosion",
- "val", "28");
+ "val", u"28");
}
-void Chart2ExportTest2::testCustomDataLabel()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabel)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf115107.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1", "Impress MS PowerPoint 2007 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",
- "val", "404040");
+ loadFromFile(u"pptx/tdf115107.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -363,42 +254,42 @@ void Chart2ExportTest2::testCustomDataLabel()
// 1
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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(u"90.0 = "_ustr, aFields[0]->getString());
+ aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(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());
+ CPPUNIT_ASSERT_EQUAL(u"90"_ustr, aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"{0C576297-5A9F-4B4E-A675-B6BA406B7D87}"_ustr, aFields[1]->getGuid());
// 2
xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8), aFields.getLength());
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[0]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("Text"), aFields[0]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Text"_ustr, aFields[0]->getString());
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString(" : "), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u" : "_ustr, 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(u"B"_ustr, aFields[2]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"{0CCAAACD-B393-42CE-8DBD-82F9F9ADC852}"_ustr, aFields[2]->getGuid());
+ aFields[2]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[2]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(16), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xed7d31), nFontColor);
@@ -408,13 +299,13 @@ void Chart2ExportTest2::testCustomDataLabel()
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[4]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("Multi"), aFields[4]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Multi"_ustr, 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(u"line"_ustr, aFields[5]->getString());
+ aFields[5]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[5]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(11.97), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xbf9000), nFontColor);
@@ -424,28 +315,28 @@ void Chart2ExportTest2::testCustomDataLabel()
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(u"Abc"_ustr, aFields[7]->getString());
+ aFields[7]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[7]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
+ aFields[7]->getPropertyValue(u"CharUnderline"_ustr) >>= nCharUnderline;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(12), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xa9d18e), nFontColor);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nCharUnderline);
// 3
xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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());
+ CPPUNIT_ASSERT_EQUAL(u"DATA"_ustr, aFields[0]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"{C8F3EB90-8960-4F9A-A3AD-B4FAC4FE4566}"_ustr, aFields[0]->getGuid());
// 4
xPropertySet.set(xDataSeries->getDataPointByIndex(3), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), aFields.getLength());
CPPUNIT_ASSERT_EQUAL(
@@ -455,52 +346,65 @@ void Chart2ExportTest2::testCustomDataLabel()
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString(" <CELLREF"), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u" <CELLREF"_ustr, aFields[1]->getString());
+
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
+ 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",
+ "val", u"404040");
}
/// Test for tdf#94235
-void Chart2ExportTest2::testDataSeriesName()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataSeriesName)
{
// ODF
{
- load(u"/chart2/qa/extras/data/ods/", "ser_labels.ods");
- reload("calc8");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"ods/ser_labels.ods");
+ saveAndReload(u"calc8"_ustr);
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
uno::Reference<beans::XPropertySet> xPropertySet;
chart2::DataPointLabel aDataPointLabel;
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("Label") >>= aDataPointLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= aDataPointLabel;
CPPUNIT_ASSERT_EQUAL(sal_True, aDataPointLabel.ShowSeriesName);
}
// OOXML
{
- load(u"/chart2/qa/extras/data/xlsx/", "ser_labels.xlsx");
- reload("Calc Office Open XML");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/ser_labels.xlsx");
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
uno::Reference<beans::XPropertySet> xPropertySet;
chart2::DataPointLabel aDataPointLabel;
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("Label") >>= aDataPointLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= aDataPointLabel;
CPPUNIT_ASSERT_EQUAL(sal_True, aDataPointLabel.ShowSeriesName);
}
}
-void Chart2ExportTest2::testCustomPositionofDataLabel()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomPositionofDataLabel)
{
- load(u"/chart2/qa/extras/data/xlsx/", "testCustomPosDataLabels.xlsx");
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ loadFromFile(u"xlsx/testCustomPosDataLabels.xlsx");
{
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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",
- "val", "2");
+ "val", u"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",
@@ -516,15 +420,16 @@ void Chart2ExportTest2::testCustomPositionofDataLabel()
CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.0742140311063737, nY, 1e-7);
}
- load(u"/chart2/qa/extras/data/docx/", "testTdf108110.docx");
+ loadFromFile(u"docx/testTdf108110.docx");
{
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
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",
- "val", "2");
+ "val", u"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",
@@ -540,11 +445,11 @@ void Chart2ExportTest2::testCustomPositionofDataLabel()
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.172648731408574, nY, 1e-7);
}
- load(u"/chart2/qa/extras/data/ods/", "tdf136024.ods");
+ loadFromFile(u"ods/tdf136024.ods");
{
- reload("calc8");
+ saveAndReload(u"calc8"_ustr);
// tdf#136024: test custom position of pie chart data label after an ods export
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
@@ -553,19 +458,46 @@ void Chart2ExportTest2::testCustomPositionofDataLabel()
uno::UNO_SET_THROW);
chart2::RelativePosition aCustomLabelPosition;
- CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CustomLabelPosition")
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"CustomLabelPosition"_ustr)
>>= aCustomLabelPosition);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Primary, -0.0961935120945059, 1e-5);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Secondary, 0.209578842093566, 1e-5);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.0961935120945059, aCustomLabelPosition.Primary, 1e-5);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.209578842093566, aCustomLabelPosition.Secondary, 1e-5);
}
}
-void Chart2ExportTest2::testCustomDataLabelMultipleSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf161571PiechartCustomPosDataLabels)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf115107-2.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart2", "Impress MS PowerPoint 2007 XML");
+ // FIXME: validation error in OOXML export
+ skipValidation();
+
+ loadFromFile(u"xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
+ // test custom position of data label (xlsx)
+ assertXPath(pXmlDoc,
+ "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:dLbl[2]/c:idx",
+ "val", u"1");
+ OUString aXVal = getXPath(pXmlDoc,
+ "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/"
+ "c:dLbl[2]/c:layout/c:manualLayout/c:x",
+ "val");
+ double nX = aXVal.toDouble();
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.13500189609404625, nX, 1e-7);
+
+ OUString aYVal = getXPath(pXmlDoc,
+ "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/"
+ "c:dLbl[2]/c:layout/c:manualLayout/c:y",
+ "val");
+ double nY = aYVal.toDouble();
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.15994818221025045, nY, 1e-7);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabelMultipleSeries)
+{
+ loadFromFile(u"pptx/tdf115107-2.pptx");
+
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -578,234 +510,277 @@ void Chart2ExportTest2::testCustomDataLabelMultipleSeries()
// First series
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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(u"4.3"_ustr, aFields[0]->getString());
+ aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xc00000), nFontColor);
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString(" "), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u" "_ustr, aFields[1]->getString());
CPPUNIT_ASSERT_EQUAL(
chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME,
aFields[2]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("Bars"), aFields[2]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Bars"_ustr, 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;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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(u"2"_ustr, aFields[0]->getString());
+ aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xffd966), nFontColor);
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString(" "), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u" "_ustr, aFields[1]->getString());
CPPUNIT_ASSERT_EQUAL(
chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME,
aFields[2]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("Line"), aFields[2]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Line"_ustr, aFields[2]->getString());
}
-void Chart2ExportTest2::testLeaderLines()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLeaderLines)
{
- load(u"/chart2/qa/extras/data/xlsx/", "testTdf90749.xlsx");
+ // FIXME: validation error in OOXML export: Errors: 2
+ skipValidation();
+
+ loadFromFile(u"xlsx/testTdf90749.xlsx");
{
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/"
"c15:showLeaderLines",
- "val", "1");
+ "val", u"1");
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/"
"c15:showLeaderLines",
- "val", "0");
+ "val", u"0");
}
- load(u"/chart2/qa/extras/data/docx/", "MSO_Custom_Leader_Line.docx");
+ loadFromFile(u"docx/MSO_Custom_Leader_Line.docx");
{
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
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",
- "val", "0");
+ "val", u"0");
}
}
-void Chart2ExportTest2::testNumberFormatExportPPTX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf161607PieChartLeaderLinesColorWidth)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf115859.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ // FIXME: validation error in OOXML export
+ skipValidation();
+
+ loadFromFile(u"xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // test LeaderLines width
+ OUString aWidth = getXPath(
+ pXmlDoc,
+ "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:leaderLines/c:spPr/"
+ "a:ln",
+ "w");
+ sal_Int32 nWidth = aWidth.toInt32();
+ CPPUNIT_ASSERT_LESSEQUAL(static_cast<sal_Int32>(100), std::abs(nWidth - 88900));
+
+ // test LeaderLines Color
+ assertXPath(
+ pXmlDoc,
+ "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:leaderLines/c:spPr/"
+ "a:ln/a:solidFill/a:srgbClr",
+ "val", u"7030a0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNumberFormatExportPPTX)
+{
+ loadFromFile(u"pptx/tdf115859.pptx");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt",
- "formatCode", "#,##0.00,\\K");
+ "formatCode", u"#,##0.00,\\K");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt",
- "sourceLinked", "0");
+ "sourceLinked", u"0");
}
-void Chart2ExportTest2::testLabelSeparatorExportDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLabelSeparatorExportDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "testLabelSeparator.docx");
+ loadFromFile(u"docx/testLabelSeparator.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
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", "\n");
+ pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:separator", u"\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", ", ");
+ pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:separator", u", ");
// The text separator should be a semicolon
assertXPathContent(
- pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:separator", "; ");
+ pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:dLbls/c:separator", u"; ");
}
-void Chart2ExportTest2::testChartTitlePropertiesColorFillPPTX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesColorFillPPTX)
{
- load(u"/chart2/qa/extras/data/pptx/", "testChartTitlePropertiesColorFill.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ loadFromFile(u"pptx/testChartTitlePropertiesColorFill.pptx");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val",
- "ff0000");
+ u"ff0000");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
}
-void Chart2ExportTest2::testChartTitlePropertiesGradientFillPPTX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesGradientFillPPTX)
{
- load(u"/chart2/qa/extras/data/pptx/", "testChartTitlePropertiesGradientFill.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ loadFromFile(u"pptx/testChartTitlePropertiesGradientFill.pptx");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val",
- "f6f8fc");
+ u"f6f8fc");
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val",
- "c7d5ed");
+ u"c7d5ed");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
}
-void Chart2ExportTest2::testChartTitlePropertiesBitmapFillPPTX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesBitmapFillPPTX)
{
- load(u"/chart2/qa/extras/data/pptx/", "testChartTitlePropertiesBitmapFill.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ loadFromFile(u"pptx/testChartTitlePropertiesBitmapFill.pptx");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", "rId1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed",
+ u"rId1");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
}
-void Chart2ExportTest2::testxAxisLabelsRotation()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testxAxisLabelsRotation)
{
- load(u"/chart2/qa/extras/data/xlsx/", "xAxisLabelsRotation.xlsx");
- xmlDocUniquePtr pXmlDoc1 = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/xAxisLabelsRotation.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc1 = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc1);
// Chart1 xAxis labels should be 45 degree
assertXPath(pXmlDoc1, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot",
- "2700000");
+ u"2700000");
}
-void Chart2ExportTest2::testMultipleCategoryAxisLablesXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesXLSX)
{
- load(u"/chart2/qa/extras/data/ods/", "multilevelcat.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"ods/multilevelcat.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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",
- "val", "6");
+ "val", u"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",
- "Categoria 1");
+ u"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",
- "Categoria 6");
+ u"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",
- "2011");
+ u"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",
- "2013");
+ u"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", "val", "0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:noMultiLvlLbl", "val", u"0");
}
-void Chart2ExportTest2::testMultipleCategoryAxisLablesDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesDOCX)
{
- load(u"/chart2/qa/extras/data/odt/", "multilevelcat.odt");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"odt/multilevelcat.odt");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
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",
- "val", "4");
+ "val", u"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",
- "Categoria 1");
+ u"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",
- "Categoria 4");
+ u"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",
- "2011");
+ u"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",
- "2012");
+ u"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", "val", "0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:noMultiLvlLbl", "val", u"0");
}
-void Chart2ExportTest2::testTdf116163()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf116163)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf116163.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ loadFromFile(u"pptx/tdf116163.pptx");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot",
- "-5400000");
+ u"-5400000");
}
-void Chart2ExportTest2::testTdf111824()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf111824)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf111824.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf111824.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Collect 3D barchart Z axID
@@ -816,10 +791,11 @@ void Chart2ExportTest2::testTdf111824()
zAxisIdOf3DBarchart);
}
-void Chart2ExportTest2::test3DAreaChartZAxis()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, test3DAreaChartZAxis)
{
- load(u"/chart2/qa/extras/data/xlsx/", "test3DAreaChartZAxis.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/test3DAreaChartZAxis.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Collect 3D area chart Z axID
@@ -830,22 +806,23 @@ void Chart2ExportTest2::test3DAreaChartZAxis()
zAxisIdOf3DAreachart);
}
-void Chart2ExportTest2::testTdf119029()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf119029)
{
- load(u"/chart2/qa/extras/data/odp/", "tdf119029.odp");
+ loadFromFile(u"odp/tdf119029.odp");
// Only use "chart", without number, because the number depends on the previous tests
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:bodyPr", "rot",
- "-5400000");
+ u"-5400000");
}
-void Chart2ExportTest2::testTdf108022()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf108022)
{
- load(u"/chart2/qa/extras/data/odt/", "tdf108022.odt");
- reload("Office Open XML Text");
+ loadFromFile(u"odt/tdf108022.odt");
+ saveAndReload(u"Office Open XML Text"_ustr);
// assert we really have two charts
Reference<chart2::XChartDocument> xChartDoc1(getChartDocFromWriter(0), uno::UNO_QUERY);
@@ -854,10 +831,11 @@ void Chart2ExportTest2::testTdf108022()
CPPUNIT_ASSERT(xChartDoc2.is());
}
-void Chart2ExportTest2::testTdf121744()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf121744)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf121744.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ loadFromFile(u"docx/tdf121744.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
OUString XValueId
@@ -869,152 +847,173 @@ void Chart2ExportTest2::testTdf121744()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[2]", "val", YValueId);
}
-void Chart2ExportTest2::testTdf121189()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf121189)
{
- load(u"/chart2/qa/extras/data/odp/", "tdf121189.odp");
- reload("Impress Office Open XML");
+ loadFromFile(u"odp/tdf121189.odp");
+ saveAndReload(u"Impress Office Open XML"_ustr);
uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0),
uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xPage->getCount());
uno::Reference<drawing::XShape> xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.OLE2Shape"), xShape->getShapeType());
+ CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.OLE2Shape"_ustr, xShape->getShapeType());
}
-void Chart2ExportTest2::testTdf122031()
+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();
- load(u"/chart2/qa/extras/data/xlsx/", "tdf122031.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt",
- "formatCode", "0.000%");
+ "formatCode", u"0.000%");
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt",
- "formatCode", "0.000%");
+ "formatCode", u"0.000%");
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[2]/c:numFmt",
- "formatCode", "0.000%");
+ "formatCode", u"0.000%");
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[3]/c:numFmt",
- "formatCode", "0.000%");
+ "formatCode", u"0.000%");
}
-void Chart2ExportTest2::testTdf115012()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf115012)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf115012.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf115012.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// workaround: use-zero instead of leave-gap to show the original line chart
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "zero");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", u"zero");
}
-void Chart2ExportTest2::testTdf134118()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134118)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf134118.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf134118.xlsx");
+
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// workaround: use leave-gap instead of zero to show the original line chart
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "gap");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", u"gap");
}
-void Chart2ExportTest2::testTdf123206_customLabelText()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123206_customLabelText)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf123206.docx");
+ loadFromFile(u"docx/tdf123206.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ // FIXME: validation error in OOXML export: Errors: 2
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
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",
- "kiscica");
+ u"kiscica");
}
-void Chart2ExportTest2::testCustomLabelText()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomLabelText)
{
- load(u"/chart2/qa/extras/data/docx/", "testCustomlabeltext.docx");
+ loadFromFile(u"docx/testCustomlabeltext.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ // FIXME: validation error in OOXML export: Errors: 3
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[1]/c:idx", "val",
- "2");
+ u"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",
- "3.5");
+ u"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",
- "CustomLabel 1");
+ u"CustomLabel 1");
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[2]/c:idx", "val",
- "3");
+ u"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",
- "4.5");
+ u"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",
- "CustomLabel 2");
+ u"CustomLabel 2");
}
-void Chart2ExportTest2::testDeletedLegendEntries()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDeletedLegendEntries)
{
- load(u"/chart2/qa/extras/data/xlsx/", "deleted_legend_entry.xlsx");
+ loadFromFile(u"xlsx/deleted_legend_entry.xlsx");
{
- reload("Calc Office Open XML");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 1));
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xPropertySet(xDataSeries, uno::UNO_QUERY_THROW);
bool bShowLegendEntry = true;
- CPPUNIT_ASSERT(xPropertySet->getPropertyValue("ShowLegendEntry") >>= bShowLegendEntry);
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"ShowLegendEntry"_ustr)
+ >>= bShowLegendEntry);
CPPUNIT_ASSERT(!bShowLegendEntry);
}
- load(u"/chart2/qa/extras/data/xlsx/", "deleted_legend_entry2.xlsx");
+ loadFromFile(u"xlsx/deleted_legend_entry2.xlsx");
{
- reload("Calc Office Open XML");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ saveAndReload(u"Calc Office Open XML"_ustr);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xPropertySet(xDataSeries, uno::UNO_QUERY_THROW);
bool bShowLegendEntry = true;
- CPPUNIT_ASSERT(xPropertySet->getPropertyValue("ShowLegendEntry") >>= bShowLegendEntry);
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"ShowLegendEntry"_ustr)
+ >>= bShowLegendEntry);
CPPUNIT_ASSERT(!bShowLegendEntry);
- Reference<chart2::XChartDocument> xChartDoc2 = getChartDocFromSheet(1, mxComponent);
+ Reference<chart2::XChartDocument> xChartDoc2 = getChartDocFromSheet(1);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries2(getDataSeriesFromDoc(xChartDoc2, 0));
CPPUNIT_ASSERT(xDataSeries2.is());
Reference<beans::XPropertySet> xPropertySet2(xDataSeries2, uno::UNO_QUERY_THROW);
Sequence<sal_Int32> deletedLegendEntriesSeq;
- CPPUNIT_ASSERT(xPropertySet2->getPropertyValue("DeletedLegendEntries")
+ CPPUNIT_ASSERT(xPropertySet2->getPropertyValue(u"DeletedLegendEntries"_ustr)
>>= deletedLegendEntriesSeq);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), deletedLegendEntriesSeq[0]);
}
}
-void Chart2ExportTest2::testTdf60316()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf60316)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf60316.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ loadFromFile(u"pptx/tdf60316.pptx");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Without the fix in place, the shape would have had a solidFill background
@@ -1022,39 +1021,41 @@ void Chart2ExportTest2::testTdf60316()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:solidFill", 0);
}
-void Chart2ExportTest2::testTdf130225()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf130225)
{
- load(u"/chart2/qa/extras/data/docx/", "piechart_deleted_legend_entry.docx");
- reload("Office Open XML Text");
+ loadFromFile(u"docx/piechart_deleted_legend_entry.docx");
+ saveAndReload(u"Office Open XML Text"_ustr);
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xPropertySet(xDataSeries, uno::UNO_QUERY_THROW);
Sequence<sal_Int32> deletedLegendEntriesSeq;
- CPPUNIT_ASSERT(xPropertySet->getPropertyValue("DeletedLegendEntries")
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"DeletedLegendEntries"_ustr)
>>= deletedLegendEntriesSeq);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), deletedLegendEntriesSeq[0]);
}
-void Chart2ExportTest2::testTdf59857()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf59857)
{
- load(u"/chart2/qa/extras/data/ods/", "tdf59857.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"ods/tdf59857.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:floor/c:spPr/a:ln/a:noFill", 1);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:floor/c:spPr/a:solidFill/a:srgbClr", "val",
- "cccccc");
+ u"cccccc");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:backWall/c:spPr/a:ln/a:noFill", 0);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:backWall/c:spPr/a:ln/a:solidFill/a:srgbClr",
- "val", "b3b3b3");
+ "val", u"b3b3b3");
}
-void Chart2ExportTest2::testTdf126076()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf126076)
{
- load(u"/chart2/qa/extras/data/xlsx/", "auto_marker_excel10.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/auto_marker_excel10.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// This was 12: all series exported with square markers
@@ -1065,54 +1066,52 @@ void Chart2ExportTest2::testTdf126076()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker", 0);
}
-void Chart2ExportTest2::testTdf75330()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf75330)
{
- load(u"/chart2/qa/extras/data/ods/", "legend_overlay.ods");
- reload("calc8");
+ loadFromFile(u"ods/legend_overlay.ods");
+ saveAndReload(u"calc8"_ustr);
{
- uno::Reference<chart2::XChartDocument> xChart2Doc = getChartDocFromSheet(0, mxComponent);
+ uno::Reference<chart2::XChartDocument> xChart2Doc = getChartDocFromSheet(0);
uno::Reference<chart::XChartDocument> xChartDoc(xChart2Doc, uno::UNO_QUERY);
uno::Reference<drawing::XShape> xLegend = xChartDoc->getLegend();
Reference<beans::XPropertySet> xPropertySet(xLegend, uno::UNO_QUERY_THROW);
bool bOverlay = false;
- CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Overlay") >>= bOverlay);
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Overlay"_ustr) >>= bOverlay);
CPPUNIT_ASSERT(bOverlay);
}
- reload("Calc Office Open XML");
+ saveAndReload(u"Calc Office Open XML"_ustr);
{
- uno::Reference<chart2::XChartDocument> xChart2Doc = getChartDocFromSheet(0, mxComponent);
+ uno::Reference<chart2::XChartDocument> xChart2Doc = getChartDocFromSheet(0);
uno::Reference<chart::XChartDocument> xChartDoc(xChart2Doc, uno::UNO_QUERY);
uno::Reference<drawing::XShape> xLegend = xChartDoc->getLegend();
Reference<beans::XPropertySet> xPropertySet(xLegend, uno::UNO_QUERY_THROW);
bool bOverlay = false;
- CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Overlay") >>= bOverlay);
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Overlay"_ustr) >>= bOverlay);
CPPUNIT_ASSERT(bOverlay);
}
}
-void Chart2ExportTest2::testTdf127792()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf127792)
{
- load(u"/chart2/qa/extras/data/docx/", "MSO_axis_position.docx");
- {
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1", "Office Open XML Text");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val",
- "between");
- }
- {
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart2", "Office Open XML Text");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val",
- "midCat");
- }
+ loadFromFile(u"docx/MSO_axis_position.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val",
+ u"between");
+
+ pXmlDoc = parseExport(u"word/charts/chart2.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val",
+ u"midCat");
}
-void Chart2ExportTest2::testTdf131979()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf131979)
{
- load(u"/chart2/qa/extras/data/ods/", "tdf131115.ods");
+ loadFromFile(u"ods/tdf131115.ods");
{
- reload("calc8");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ saveAndReload(u"calc8"_ustr);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
@@ -1125,10 +1124,10 @@ void Chart2ExportTest2::testTdf131979()
!blinknumberformattosource);
}
- load(u"/chart2/qa/extras/data/ods/", "tdf131979.ods");
+ loadFromFile(u"ods/tdf131979.ods");
{
- reload("calc8");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ saveAndReload(u"calc8"_ustr);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
@@ -1142,87 +1141,104 @@ void Chart2ExportTest2::testTdf131979()
}
}
-void Chart2ExportTest2::testTdf132076()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132076)
{
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
{
- load(u"/chart2/qa/extras/data/ods/", "tdf132076.ods");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"ods/tdf132076.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "formatCode",
- "dd");
+ u"dd");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "sourceLinked",
- "0");
+ u"0");
}
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf132076.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf132076.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "formatCode",
- "dd");
+ u"dd");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "sourceLinked",
- "0");
+ u"0");
}
}
-void Chart2ExportTest2::testTdf125812()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf125812)
{
- load(u"/chart2/qa/extras/data/odp/", "ellipticalGradientFill.odp");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ loadFromFile(u"odp/ellipticalGradientFill.odp");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path", "path",
- "circle");
+ u"circle");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect",
- "l", "50000");
+ "l", u"50000");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect",
- "t", "49000");
+ "t", u"49000");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect",
- "r", "50000");
+ "r", u"50000");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect",
- "b", "51000");
+ "b", u"51000");
}
-void Chart2ExportTest2::testTdf133190()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133190)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf133190_tdf133191.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf133190_tdf133191.xlsx");
+
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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",
- "wrap", "none");
+ "wrap", u"none");
assertXPath(
pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[2]/c:txPr/a:bodyPr",
- "wrap", "square");
+ "wrap", u"square");
}
-void Chart2ExportTest2::testTdf133191()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133191)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf133190_tdf133191.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf133190_tdf133191.xlsx");
+
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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",
- "rot", "-4500000");
+ "rot", u"-4500000");
}
-void Chart2ExportTest2::testTdf132594()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132594)
{
- load(u"/chart2/qa/extras/data/xlsx/", "chart_pie2007.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/chart_pie2007.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:cat", 1);
}
-void Chart2ExportTest2::testTdf134255()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134255)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf134255.docx");
+ loadFromFile(u"docx/tdf134255.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1231,24 +1247,28 @@ void Chart2ExportTest2::testTdf134255()
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xPropSet(xDataSeries, UNO_QUERY_THROW);
bool bWrap = false;
- CPPUNIT_ASSERT((xPropSet->getPropertyValue("TextWordWrap") >>= bWrap));
+ CPPUNIT_ASSERT((xPropSet->getPropertyValue(u"TextWordWrap"_ustr) >>= bWrap));
CPPUNIT_ASSERT(bWrap);
+ // FIXME: validation error in OOXML export: Errors: 11
+ skipValidation();
+
// export test
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:txPr/a:bodyPr", "wrap",
- "square");
+ u"square");
}
-void Chart2ExportTest2::testTdf134977()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134977)
{
- load(u"/chart2/qa/extras/data/xlsx/", "custom_data_label.xlsx");
+ loadFromFile(u"xlsx/custom_data_label.xlsx");
//import test
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xDataSeries.is());
@@ -1256,89 +1276,91 @@ void Chart2ExportTest2::testTdf134977()
uno::UNO_SET_THROW);
uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aFields;
float nFontSize;
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
- aFields[0]->getPropertyValue("CharHeight") >>= nFontSize;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
+ aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(9), nFontSize);
+ // FIXME: validation error in OOXML export: Errors: 2
+ skipValidation();
+
//export test
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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",
- "sz", "900");
+ "sz", u"900");
}
-void Chart2ExportTest2::testTdf123647()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123647)
{
- load(u"/chart2/qa/extras/data/xlsx/", "empty_chart.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/empty_chart.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart", 1);
}
-void Chart2ExportTest2::testTdf136267()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf136267)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf136267.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf136267.xlsx");
+
+ // FIXME: validation error in OOXML export: Errors: 2
+ skipValidation();
+
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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",
- "John");
+ u"John");
}
-void Chart2ExportTest2::testDataLabelPlacementPieChart()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataLabelPlacementPieChart)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf134978.xlsx");
- reload("calc8");
- uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/tdf134978.xlsx");
+ saveAndReload(u"calc8"_ustr);
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0), UNO_QUERY_THROW);
// test the placement of the manually positioned label
Reference<beans::XPropertySet> xDataPointPropSet(
xChartDoc->getDiagram()->getDataPointProperties(2, 0), uno::UNO_SET_THROW);
- uno::Any aAny = xDataPointPropSet->getPropertyValue("LabelPlacement");
+ uno::Any aAny = xDataPointPropSet->getPropertyValue(u"LabelPlacement"_ustr);
CPPUNIT_ASSERT(aAny.hasValue());
sal_Int32 nLabelPlacement = 0;
CPPUNIT_ASSERT(aAny >>= nLabelPlacement);
CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::OUTSIDE, nLabelPlacement);
}
-void Chart2ExportTest2::testTdf137917()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf137917)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf137917.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf137917.xlsx");
+
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:baseTimeUnit", "val", "days");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:majorUnit", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:baseTimeUnit", "val",
+ u"days");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:majorUnit", "val", u"1");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:majorTimeUnit", "val",
- "months");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:minorUnit", "val", "7");
+ u"months");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:minorUnit", "val", u"7");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:minorTimeUnit", "val",
- "days");
+ u"days");
}
-void Chart2ExportTest2::testTdf138204()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf138204)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf138204.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
+ loadFromFile(u"xlsx/tdf138204.xlsx");
- // 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",
- "type", "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",
- "type", "CELLRANGE");
-
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
struct CustomLabelsTestData
@@ -1357,8 +1379,8 @@ void Chart2ExportTest2::testTdf138204()
0, // nSeriesIdx
1, // nNumFields
chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE,
- "Munka1!$F$9", // aCellRange
- "67,5%", // aString
+ u"Munka1!$F$9"_ustr, // aCellRange
+ u"67,5%"_ustr, // aString
},
{
@@ -1366,8 +1388,8 @@ void Chart2ExportTest2::testTdf138204()
1, // nSeriesIdx
1, // nNumFields
chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE,
- "Munka1!$G$9", // aCellRange
- "32,3%", // aString
+ u"Munka1!$G$9"_ustr, // aCellRange
+ u"32,3%"_ustr, // aString
},
};
@@ -1380,47 +1402,63 @@ void Chart2ExportTest2::testTdf138204()
uno::Reference<beans::XPropertySet> xPropertySet;
uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aFields;
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= 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(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ 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",
+ "type", u"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",
+ "type", u"CELLRANGE");
}
-void Chart2ExportTest2::testTdf138181()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf138181)
{
- load(u"/chart2/qa/extras/data/xlsx/", "piechart_deleted_legendentry.xlsx");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/piechart_deleted_legendentry.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
Reference<drawing::XShape> 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");
+ xLegendEntry1 = getShapeByName(
+ xShapes, u"CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0:LegendEntry=0"_ustr);
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");
+ xLegendEntry2 = getShapeByName(
+ xShapes, u"CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1:LegendEntry=0"_ustr);
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");
+ xLegendEntry3 = getShapeByName(
+ xShapes, u"CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2:LegendEntry=0"_ustr);
CPPUNIT_ASSERT(xLegendEntry3.is());
}
-void Chart2ExportTest2::testCustomShapeText()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomShapeText)
{
- load(u"/chart2/qa/extras/data/ods/", "tdf72776.ods");
- reload("calc8");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"ods/tdf72776.ods");
+ saveAndReload(u"calc8"_ustr);
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
// test that the text of custom shape exists inside the chart
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
@@ -1431,12 +1469,12 @@ void Chart2ExportTest2::testCustomShapeText()
CPPUNIT_ASSERT(!xRange->getString().isEmpty());
}
-void Chart2ExportTest2::testuserShapesXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testuserShapesXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf128621.xlsx");
- reload("Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf128621.xlsx");
+ saveAndReload(u"Calc Office Open XML"_ustr);
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
// test that the custom shape exists
@@ -1459,10 +1497,10 @@ void Chart2ExportTest2::testuserShapesXLSX()
CPPUNIT_ASSERT(!xRange->getString().isEmpty());
}
-void Chart2ExportTest2::testuserShapesDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testuserShapesDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf143130.docx");
- reload("Office Open XML Text");
+ loadFromFile(u"docx/tdf143130.docx");
+ saveAndReload(u"Office Open XML Text"_ustr);
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1487,12 +1525,12 @@ void Chart2ExportTest2::testuserShapesDOCX()
CPPUNIT_ASSERT(!xRange->getString().isEmpty());
}
-void Chart2ExportTest2::testGraphicBlipXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testGraphicBlipXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf143127.xlsx");
- reload("Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf143127.xlsx");
+ saveAndReload(u"Calc Office Open XML"_ustr);
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
// test that the Graphic shape exists
@@ -1505,7 +1543,7 @@ void Chart2ExportTest2::testGraphicBlipXLSX()
Reference<XPropertySet> xShapeProps(xCustomShape, UNO_QUERY);
uno::Reference<graphic::XGraphic> xGraphic;
- CPPUNIT_ASSERT(xShapeProps->getPropertyValue("Graphic") >>= xGraphic);
+ CPPUNIT_ASSERT(xShapeProps->getPropertyValue(u"Graphic"_ustr) >>= xGraphic);
Graphic aGraphic(xGraphic);
GfxLink aLink = aGraphic.GetGfxLink();
@@ -1515,42 +1553,68 @@ void Chart2ExportTest2::testGraphicBlipXLSX()
CPPUNIT_ASSERT_GREATER(size_t(0), nDataSize);
}
-void Chart2ExportTest2::testNameRangeXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNameRangeXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "chart_with_name_range.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/chart_with_name_range.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
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",
- "Sheet1!local_name_range");
+ u"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",
- "[0]!series1");
+ u"[0]!series1");
}
-void Chart2ExportTest2::testTdf143942()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf143942)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf143942.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
+ loadFromFile(u"xlsx/tdf143942.xlsx");
+
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+ CPPUNIT_ASSERT(xDataSeries.is());
constexpr size_t nLabels = 4;
- OUString aCellRange = "Sheet1!$A$2:$A$5";
+ OUString aCellRange = u"Sheet1!$A$2:$A$5"_ustr;
OUString aLabels[nLabels] = {
- "Test1",
- "Test2",
- "Tes3",
- "Test4",
+ u"Test1"_ustr,
+ u"Test2"_ustr,
+ u"Tes3"_ustr,
+ u"Test4"_ustr,
};
+ uno::Reference<beans::XPropertySet> xPropertySet;
+ uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aFields;
+ for (size_t i = 0; i < nLabels; ++i)
+ {
+ xPropertySet.set(xDataSeries->getDataPointByIndex(i), uno::UNO_SET_THROW);
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:extLst/c:ext",
- "uri", "{02D57815-91ED-43cb-92C2-25804820EDAC}");
+ "uri", u"{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",
- "val", "4");
+ "val", u"4");
assertXPathContent(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:extLst/c:ext/"
"c15:datalabelsRange/c15:f",
@@ -1560,11 +1624,11 @@ void Chart2ExportTest2::testTdf143942()
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", "CELLRANGE");
+ "type", u"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", "1");
+ "val", u"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/"
@@ -1572,31 +1636,17 @@ void Chart2ExportTest2::testTdf143942()
+ OString::number(i + 1) + "]/c:v",
aLabels[i]);
}
-
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
- CPPUNIT_ASSERT(xChartDoc.is());
- uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
- CPPUNIT_ASSERT(xDataSeries.is());
-
- uno::Reference<beans::XPropertySet> xPropertySet;
- uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> 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<sal_Int32>(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());
- }
}
-void Chart2ExportTest2::testDateCategoriesPPTX()
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDateCategoriesPPTX)
{
- load(u"/chart2/qa/extras/data/pptx/", "bnc889755.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress Office Open XML");
+ loadFromFile(u"pptx/bnc889755.pptx");
+
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Impress Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
constexpr size_t nCats = 16;
@@ -1609,7 +1659,7 @@ void Chart2ExportTest2::testDateCategoriesPPTX()
assertXPathContent(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:numRef/"
"c:numCache/c:formatCode",
- "mmm\\-yy");
+ u"mmm\\-yy");
assertXPath(
pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:numRef/c:numCache/c:ptCount",
@@ -1630,7 +1680,76 @@ void Chart2ExportTest2::testDateCategoriesPPTX()
}
}
-CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest2);
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataTableImportExport)
+{
+ loadFromFile(u"xlsx/ChartDataTable.xlsx");
+ {
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc.is());
+ auto xDiagram = xChartDoc->getFirstDiagram();
+ CPPUNIT_ASSERT(xDiagram.is());
+ auto xDataTable = xDiagram->getDataTable();
+ CPPUNIT_ASSERT(xDataTable.is());
+ uno::Reference<beans::XPropertySet> xPropertySet(xDataTable, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPropertySet.is());
+ bool bHBorder;
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"HBorder"_ustr) >>= bHBorder);
+ CPPUNIT_ASSERT_EQUAL(true, bHBorder);
+ bool bVBorder;
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"VBorder"_ustr) >>= bVBorder);
+ CPPUNIT_ASSERT_EQUAL(true, bVBorder);
+ bool bOutline;
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Outline"_ustr) >>= bOutline);
+ CPPUNIT_ASSERT_EQUAL(false, bOutline);
+ bool bKeys;
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Keys"_ustr) >>= bKeys);
+ CPPUNIT_ASSERT_EQUAL(false, bKeys);
+ }
+ saveAndReload(u"calc8"_ustr);
+ {
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc.is());
+ auto xDiagram = xChartDoc->getFirstDiagram();
+ CPPUNIT_ASSERT(xDiagram.is());
+ auto xDataTable = xDiagram->getDataTable();
+ CPPUNIT_ASSERT(xDataTable.is());
+ uno::Reference<beans::XPropertySet> xPropertySet(xDataTable, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPropertySet.is());
+ bool bHBorder;
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"HBorder"_ustr) >>= bHBorder);
+ CPPUNIT_ASSERT_EQUAL(true, bHBorder);
+ bool bVBorder;
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"VBorder"_ustr) >>= bVBorder);
+ CPPUNIT_ASSERT_EQUAL(true, bVBorder);
+ bool bOutline;
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Outline"_ustr) >>= bOutline);
+ CPPUNIT_ASSERT_EQUAL(false, bOutline);
+ bool bKeys;
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Keys"_ustr) >>= bKeys);
+ CPPUNIT_ASSERT_EQUAL(false, bKeys);
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf166249)
+{
+ loadFromFile(u"xlsx/tdf166249.xlsx");
+ // FIXME: validation error in OOXML export
+ skipValidation();
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // test color and alpha value of data label borders
+ assertXPath(pXmlDoc,
+ "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:spPr/a:ln/"
+ "a:solidFill/a:srgbClr",
+ "val", u"156082");
+
+ assertXPath(pXmlDoc,
+ "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:spPr/a:ln/"
+ "a:solidFill/a:srgbClr/a:alpha",
+ "val", u"128");
+}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/chart2export3.cxx b/chart2/qa/extras/chart2export3.cxx
new file mode 100644
index 000000000000..dddce1ada490
--- /dev/null
+++ b/chart2/qa/extras/chart2export3.cxx
@@ -0,0 +1,890 @@
+/* -*- 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 <com/sun/star/chart2/DataPointLabel.hpp>
+#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <com/sun/star/awt/FontUnderline.hpp>
+
+using uno::Reference;
+using beans::XPropertySet;
+
+class Chart2ExportTest3 : public ChartTest
+{
+public:
+ Chart2ExportTest3() : ChartTest(u"/chart2/qa/extras/data/"_ustr) {}
+};
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf108107)
+{
+ loadFromFile(u"xlsx/tdf108107.xlsx");
+
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:idx", "val", u"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", "b", u"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", "sz", u"2000");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf114139)
+{
+ loadFromFile(u"xlsx/tdf114139.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart", 1);
+ //no fill
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr", 0);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:solidFill", 0);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf64224)
+{
+ loadFromFile(u"ods/tdf64224.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ //no fill
+ assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:noFill", 1);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:solidFill", 0);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillDOCX)
+{
+ loadFromFile(u"docx/testChartTitlePropertiesColorFill.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", u"ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillDOCX)
+{
+ loadFromFile(u"docx/testChartTitlePropertiesGradientFill.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", u"cccccc");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", u"666666");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillDOCX)
+{
+ loadFromFile(u"docx/testChartTitlePropertiesBitmapFill.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", u"rId1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
+}
+
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyDOCX)
+{
+ // Test color gradient (two color) with gradient transparency
+ loadFromFile(u"docx/testColorGradientWithTransparency.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ 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", "val", u"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", "val", u"90000");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyODS)
+{
+ // Test color gradient (two color) with simple transparency
+ loadFromFile(u"ods/testColorGradientWithTransparency.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ 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", "val", u"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", "val", u"60000");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientStopXLSX)
+{
+ // Test color gradient (two color) stop of the first color
+ loadFromFile(u"xlsx/tdf128619.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ // Test the position of the first color
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[1]", "pos", u"45000");
+ // Test the position of the second color
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[2]", "pos", u"100000");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRadialColorGradientDOCX)
+{
+ loadFromFile(u"docx/tdf128794.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ 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", "path", u"circle");
+ // Test the linear gradient angle
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:gsLst/a:gs[1]", "pos", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", u"ffffff");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:gsLst/a:gs[2]", "pos", u"100000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", u"5b9bd5");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropDOCX)
+{
+ loadFromFile(u"docx/testBarChartDataPointPropDOCX.docx");
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", u"0");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:idx", "val", u"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", "val", u"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", "val", u"c7d5ed");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", u"70ad47");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx", "val", u"2");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:solidFill/a:srgbClr", "val", u"ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", u"000000");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFdo83058dlblPos)
+{
+ loadFromFile(u"docx/fdo83058_dlblPos.docx");
+
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ save(u"Office Open XML Text"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[2]/c:dLblPos", "val", u"outEnd");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[3]/c:dLblPos", "val", u"outEnd");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[4]/c:dLblPos", "val", u"outEnd");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[5]/c:dLblPos", "val", u"outEnd");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDelXLSX)
+{
+ loadFromFile(u"xlsx/autotitledel_2007.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDispBlanksAsXLSX)
+{
+ loadFromFile(u"xlsx/dispBlanksAs_2007.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", u"gap");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMarkerColorXLSX)
+{
+ loadFromFile(u"xlsx/markerColor.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:marker/c:spPr/a:solidFill/a:srgbClr", "val", u"92d050");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRoundedCornersXLSX)
+{
+ loadFromFile(u"xlsx/markerColor.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:roundedCorners", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisNumberFormatXLSX)
+{
+ loadFromFile(u"ods/axis_number_format.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx", 2);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:numFmt", "formatCode", u"0.00E+000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:numFmt", "sourceLinked", u"0");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:numFmt", "formatCode", u"[$$-409]#,##0;\\-[$$-409]#,##0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:numFmt", "sourceLinked", u"1");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataPointLabelNumberFormatXLSX)
+{
+ // FIXME: validation error in OOXML export: Errors: 1
+ skipValidation();
+
+ loadFromFile(u"ods/tdf123774.ods");
+ {
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", "formatCode", u"[$-40E]0.00%");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", "sourceLinked", u"0");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt", "formatCode", u"[$-40E]0.00%");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt", "sourceLinked", u"0");
+ }
+
+ loadFromFile(u"xlsx/tdf130986.xlsx");
+ {
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:idx", "val", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:numFmt", "formatCode", u"0.00E+00");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:numFmt", "sourceLinked", u"0");
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelDefaultValuesXLSX)
+{
+ loadFromFile(u"xlsx/data_label.xlsx");
+ Reference< chart2::XChartDocument> xDoc = getChartDocFromSheet(0);
+ Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xDoc, 0);
+ Reference<beans::XPropertySet> xPropSet(xSeries, uno::UNO_QUERY_THROW);
+ uno::Any aAny = xPropSet->getPropertyValue(u"Label"_ustr);
+ chart2::DataPointLabel aLabel;
+ CPPUNIT_ASSERT(aAny >>= aLabel);
+ CPPUNIT_ASSERT(aLabel.ShowNumber);
+
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:showVal", "val", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLblPos", "val", u"outEnd");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelFillColor)
+{
+ loadFromFile(u"xlsx/data_labels_fill_color.xlsx");
+ Reference< chart2::XChartDocument> xDoc = getChartDocFromSheet(0);
+ Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xDoc, 0);
+ Reference<beans::XPropertySet> xPropSet(xSeries, uno::UNO_QUERY_THROW);
+ uno::Any aAny = xPropSet->getPropertyValue(u"LabelFillColor"_ustr);
+ sal_Int32 nLabelFillColor;
+ CPPUNIT_ASSERT(aAny >>= nLabelFillColor);
+
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:spPr/a:solidFill/a:srgbClr", "val", u"f79646");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleOverlayXLSX)
+{
+ loadFromFile(u"xlsx/chart_title.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:overlay", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testInvertIfNegativeXLSX)
+{
+ loadFromFile(u"xlsx/bar_chart_simple.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBubble3DXLSX)
+{
+ loadFromFile(u"xlsx/bubble_chart_simple.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[1]/c:bubble3D", "val", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[2]/c:bubble3D", "val", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[3]/c:bubble3D", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testNoMarkerXLSX)
+{
+ loadFromFile(u"xlsx/no_marker.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:marker/c:symbol", "val", u"none");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:marker/c:symbol", "val", u"none");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:marker", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleManualLayoutXLSX)
+{
+ loadFromFile(u"xlsx/title_manual_layout.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:layoutTarget", 0);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:xMode", "val", u"edge");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:yMode", "val", u"edge");
+
+ OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:x", "val");
+ 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", "val");
+ 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", "rot", u"1200000");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotAreaManualLayoutXLSX)
+{
+ loadFromFile(u"xlsx/plot_area_manual_layout.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", "val", u"inner");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:xMode", "val", u"edge");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:yMode", "val", u"edge");
+
+ OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:x", "val");
+ 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", "val");
+ 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", "val");
+ 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", "val");
+ 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(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", 0);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:xMode", "val", u"edge");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:yMode", "val", u"edge");
+
+ OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:legend/c:layout/c:manualLayout/c:x", "val");
+ 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", "val");
+ 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", "val");
+ 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", "val");
+ 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", "sz", u"900");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartSubTitle)
+{
+ loadFromFile(u"ods/testChartSubTitle.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ // test properties of subtitle
+ // paragraph props
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "sz", u"1100");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "b", u"1");
+ // run props
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr", "sz", u"1100");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr", "b", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:solidFill/a:srgbClr", "val", u"00a933");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:latin", "typeface", u"Times New Roman");
+ // text
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:t", u"It is a Subtitle");
+ // shape props
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", u"b2b2b2");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartMainWithSubTitle)
+{
+ loadFromFile(u"ods/testChartMainWithSubTitle.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ // test properties of title
+ // paragraph props
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr", "sz", u"1300");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr", "b", u"0");
+ // run props
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r/a:rPr", "sz", u"1300");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r/a:rPr", "b", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r/a:rPr", "i", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r/a:rPr/a:solidFill/a:srgbClr", "val", u"f10d0c");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r/a:rPr/a:latin", "typeface", u"Arial");
+ // text
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r/a:t", u"It is a Maintitle");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r/a:t", u"It is a Subtitle");
+ // shape props
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", u"81d41a");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDeleted)
+{
+ loadFromFile(u"xlsx/testAutoTitleDeleted.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", u"1");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillXLSX)
+{
+ loadFromFile(u"xlsx/testChartTitlePropertiesColorFill.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", u"ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillXLSX)
+{
+ loadFromFile(u"xlsx/testChartTitlePropertiesGradientFill.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", u"cccccc");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", u"666666");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillXLSX)
+{
+ loadFromFile(u"xlsx/testChartTitlePropertiesBitmapFill.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", u"rId1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropXLSX)
+{
+ loadFromFile(u"xlsx/testBarChartDataPointPropXLSX.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", u"0");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:idx", "val", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:solidFill/a:srgbClr", "val", u"ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", u"000000");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx", "val", u"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", "val", u"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", "val", u"c7d5ed");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", u"70ad47");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX)
+{
+ loadFromFile(u"xlsx/axis_character_properties.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "sz", u"1000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "b", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "i", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "u", u"sng");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr", "sz", u"900");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr", "b", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr", "strike", u"sngStrike");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", u"ff0000");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleCharacterPropertiesXLSX)
+{
+ loadFromFile(u"xlsx/title_character_properties.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "sz", u"1300");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "b", u"0");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr", "sz", u"2400");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr", "b", u"1");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotVisOnlyXLSX)
+{
+ loadFromFile(u"xlsx/hidden_cells.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotVisOnly", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartVaryColorsXLSX)
+{
+ loadFromFile(u"xlsx/tdf90876.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf96161)
+{
+ loadFromFile(u"ods/tdf96161.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:varyColors", "val", u"0");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTableOnPage3)
+{
+ loadFromFile(u"docx/TableOnPage3.docx");
+
+ // FIXME: validation error in OOXML export: Errors: 2
+ skipValidation();
+
+ saveAndReload(u"Office Open XML Text"_ustr);
+
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference< chart::XChartDataArray > xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW);
+ Sequence<OUString> aColumnDesc = xDataArray->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", static_cast<sal_Int32>(4), aColumnDesc.getLength());
+ CPPUNIT_ASSERT_EQUAL(u"If oversubscription relative to allowance increases at the same average rate B15-B17"_ustr, aColumnDesc[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Known requirements"_ustr, aColumnDesc[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Allowance"_ustr, aColumnDesc[2]);
+ CPPUNIT_ASSERT_EQUAL(u"If oversubscription relative to allowance holds steady at average oversubscription level B15-B17"_ustr, 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(u"Impress MS PowerPoint 2007 XML"_ustr);
+
+ Reference<chart2::XChartDocument> 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(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart", 2);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart[1]/c:ser", 1);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart[2]/c:ser", 1);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx", 4);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:delete[@val='1']", 1);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:axPos[@val='l']", 1);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:axPos[@val='r']", 1);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testSecondaryAxisXLSX)
+{
+ loadFromFile(u"ods/secondary_axis.ods");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart", 2);
+ // test there is just those series in the first <lineChart> tag which are attached to the primary axis
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[1]/c:ser", 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", u"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", u"c");
+ // test there is just those series in the second <lineChart> tag which are attached to the secondary axis
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[2]/c:ser", 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", u"a");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartSecondaryAxisXLSX)
+{
+ loadFromFile(u"xlsx/testSecondaryAxis.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ 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]", "val");
+ OUString YValueIdOf1Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[1]/c:axId[2]", "val");
+ // Collect barchart axID on secondary Axis
+ OUString XValueIdOf2Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[2]/c:axId[1]", "val");
+ OUString YValueIdOf2Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[2]/c:axId[2]", "val");
+ // 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", "val", XValueIdOf1Barchart);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:axId", "val", YValueIdOf1Barchart);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx[2]/c:axId", "val", XValueIdOf2Barchart);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:axId", "val", 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<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc.is());
+ Reference<chart2::XAxis> 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(u"calc8"_ustr);
+ Reference<chart2::XChartDocument> xChartDoc2 = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc2.is());
+ Reference<chart2::XAxis> xAxis2 = getAxisFromDoc(xChartDoc2, 0, 0, 0);
+ CPPUNIT_ASSERT(xAxis2.is());
+ chart2::ScaleData aScaleData2 = xAxis2->getScaleData();
+ CPPUNIT_ASSERT(!aScaleData2.ShiftedCategoryPosition);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFormattedChartTitles)
+{
+ loadFromFile(u"xlsx/tdf39052.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // Check run level properties [1] - first paragraph
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:rPr", "b", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:rPr", "sz", u"1400");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:rPr/a:solidFill/a:srgbClr", "val", u"ff0000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:rPr/a:latin", "typeface", u"Aptos Narrow");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:t", u"This");
+ // Check run level properties [2]
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[2]/a:rPr", "b", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[2]/a:rPr", "sz", u"1400");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[2]/a:rPr/a:solidFill/a:srgbClr", "val", u"595959");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[2]/a:t", u" is");
+ // Check run level properties [3]
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[3]/a:rPr", "b", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[3]/a:rPr", "sz", u"1400");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[3]/a:rPr", "baseline", u"30000");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[3]/a:t", u"3");
+ // Check run level properties [4]
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[4]/a:rPr", "b", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[4]/a:rPr", "sz", u"1400");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[4]/a:t", u" a ");
+ // Check run level properties [5]
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[5]/a:rPr", "b", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[5]/a:rPr", "i", u"1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[5]/a:rPr", "sz", u"2000");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[5]/a:rPr", "u", u"sng");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[5]/a:rPr/a:solidFill/a:srgbClr", "val", u"4ea72e");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[5]/a:rPr/a:uFillTx", 1);
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[5]/a:t", u"custom");
+ // Check run level properties [6]
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[6]/a:rPr", "b", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[6]/a:rPr", "sz", u"1400");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[6]/a:t", u" erte1");
+ // Check run level properties [1] - second paragraph
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[1]/a:rPr", "b", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[1]/a:rPr", "sz", u"1400");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[1]/a:rPr/a:solidFill/a:srgbClr", "val", u"595959");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[1]/a:rPr/a:latin", "typeface", u"Aptos Narrow");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[1]/a:t", u"2dfgd ch");
+ // Check run level properties [2]
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[2]/a:rPr", "b", u"1");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[2]/a:t", u"ar");
+ // Check run level properties [3]
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[3]/a:rPr", "b", u"0");;
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[3]/a:t", u"t ");
+ // Check run level properties [4]
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[4]/a:rPr", "b", u"0");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[4]/a:rPr", "strike", u"sngStrike");
+ assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r[4]/a:t", u"title");
+}
+
+namespace {
+
+void checkCharacterProps(Reference<beans::XPropertySet> const & xTitleProp)
+{
+ Sequence< uno::Reference< chart2::XFormattedString > > xFormattedSubTitle;
+ CPPUNIT_ASSERT(xTitleProp->getPropertyValue(u"FormattedStrings"_ustr) >>= xFormattedSubTitle);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10), xFormattedSubTitle.getLength());
+ // check texts
+ std::vector<OUString> aValues = { u"This"_ustr, u" is"_ustr, u"3"_ustr, u" a "_ustr, u"custom"_ustr, u" erte1\n"_ustr, u"2dfgd ch"_ustr, u"ar"_ustr, u"t "_ustr, u"title"_ustr };
+ for (sal_Int32 i = 0; i < xFormattedSubTitle.getLength(); i++)
+ {
+ const OUString aText = xFormattedSubTitle[i]->getString();
+ CPPUNIT_ASSERT_EQUAL(aValues[i], aText);
+ Reference< beans::XPropertySet > xRunPropSet(xFormattedSubTitle[i], uno::UNO_QUERY);
+ // common props
+ uno::Any aAny = xRunPropSet->getPropertyValue(u"CharFontName"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(u"Aptos Narrow"_ustr), aAny);
+ // unique props
+ if (aText == aValues[0])
+ {
+ aAny = xRunPropSet->getPropertyValue(u"CharWeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontWeight::BOLD), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharHeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(14.0f), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharColor"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(Color(0xff0000)), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharEscapement"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(short(0)), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharEscapementHeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(short(100)), aAny);
+ }
+ else if (aText == aValues[1] || aText == aValues[3] || aText == aValues[5] ||
+ aText == aValues[6] || aText == aValues[8])
+ {
+ aAny = xRunPropSet->getPropertyValue(u"CharWeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontWeight::NORMAL), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharHeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(14.0f), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharColor"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(Color(0x595959)), aAny);
+ }
+ else if (aText == aValues[2])
+ {
+ aAny = xRunPropSet->getPropertyValue(u"CharWeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontWeight::NORMAL), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharHeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(14.0f), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharColor"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(Color(0x595959)), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharEscapement"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(short(30)), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharEscapementHeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(short(58)), aAny);
+ }
+ else if (aText == aValues[4])
+ {
+ aAny = xRunPropSet->getPropertyValue(u"CharWeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontWeight::NORMAL), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharHeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(20.0f), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharColor"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(Color(0x4ea72e)), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharPosture"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontSlant_ITALIC), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharUnderline"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontUnderline::SINGLE), aAny);
+ }
+ else if (aText == aValues[7])
+ {
+ aAny = xRunPropSet->getPropertyValue(u"CharWeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontWeight::BOLD), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharHeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(14.0f), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharColor"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(Color(0x595959)), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharPosture"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontSlant_NONE), aAny);
+ }
+ else // aText == aValues[9]
+ {
+ aAny = xRunPropSet->getPropertyValue(u"CharWeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontWeight::NORMAL), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharHeight"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(14.0f), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharColor"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(Color(0x595959)), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharPosture"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontSlant_ITALIC), aAny);
+ aAny = xRunPropSet->getPropertyValue(u"CharOverline"_ustr);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(awt::FontUnderline::NONE), aAny);
+ }
+ }
+}
+
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testODSFormattedChartTitles)
+{
+ // The document contains a line chart with "Between tick marks" X axis position.
+ loadFromFile(u"ods/tdf39052.ods");
+ // Check formatted strings after export.
+ saveAndReload(u"calc8"_ustr);
+
+ Reference<chart2::XChartDocument> xChart2Doc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChart2Doc.is());
+ Reference< chart::XChartDocument > xChartDoc(xChart2Doc, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference< beans::XPropertySet > xTitleProp(xChartDoc->getTitle(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xTitleProp.is());
+
+ checkCharacterProps(xTitleProp);
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/qa/extras/chart2geometry.cxx b/chart2/qa/extras/chart2geometry.cxx
index f460ac467621..da871c776e6f 100644
--- a/chart2/qa/extras/chart2geometry.cxx
+++ b/chart2/qa/extras/chart2geometry.cxx
@@ -9,8 +9,6 @@
#include "charttest.hxx"
-#include <test/xmltesttools.hxx>
-
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
@@ -25,12 +23,9 @@ using beans::XPropertySet;
class Chart2GeometryTest : public ChartTest
{
-protected:
- virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override;
-
public:
Chart2GeometryTest()
- : ChartTest()
+ : ChartTest(u"/chart2/qa/extras/data/"_ustr)
{
}
// Mostly tests for line and fill properties
@@ -68,12 +63,6 @@ public:
CPPUNIT_TEST_SUITE_END();
};
-void Chart2GeometryTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
-{
- XmlTestTools::registerOOXMLNamespaces(pXmlXPathCtx);
- XmlTestTools::registerODFNamespaces(pXmlXPathCtx);
-}
-
static OString OU2O(std::u16string_view sOUSource)
{
return rtl::OUStringToOString(sOUSource, RTL_TEXTENCODING_UTF8);
@@ -84,13 +73,15 @@ static OString OU2O(std::u16string_view sOUSource)
void Chart2GeometryTest::testTdf135184RoundLineCap()
{
// It tests chart area, data series line and regression-curve line.
- load(u"/chart2/qa/extras/data/xlsx/", "tdf135184RoundLineCap.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "calc8");
+ loadFromFile(u"xlsx/tdf135184RoundLineCap.xlsx");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- const OString sStyleStart("/office:document-content/office:automatic-styles");
- const OString sCap("/style:graphic-properties[@svg:stroke-linecap='round']");
- const OString sChartStart("/office:document-content/office:body/office:chart/chart:chart");
+ 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");
@@ -111,13 +102,15 @@ void Chart2GeometryTest::testTdf135184RoundLineCap()
void Chart2GeometryTest::testTdf135184RoundLineCap2()
{
// It tests legend, data series sector and title.
- load(u"/chart2/qa/extras/data/xlsx/", "tdf135184RoundLineCap2.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "calc8");
+ loadFromFile(u"xlsx/tdf135184RoundLineCap2.xlsx");
+ save(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- const OString sStyleStart("/office:document-content/office:automatic-styles");
- const OString sCap("/style:graphic-properties[@svg:stroke-linecap='round']");
- const OString sChartStart("/office:document-content/office:body/office:chart/chart:chart");
+ 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");
@@ -140,49 +133,58 @@ void Chart2GeometryTest::testTdf135184RoundLineCap2()
void Chart2GeometryTest::testTdf135184RoundLineCap3()
{
// It tests chart area, data series line and regression-curve line.
- load(u"/chart2/qa/extras/data/xlsx/", "tdf135184RoundLineCap.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf135184RoundLineCap.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- const OString sDash("/c:spPr/a:ln/a:prstDash");
+ static constexpr OString sDash("/c:spPr/a:ln/a:prstDash"_ostr);
// chart area
- assertXPath(pXmlDoc, "/c:chartSpace" + sDash, "val", "dashDot");
+ assertXPath(pXmlDoc, "/c:chartSpace" + sDash, "val", u"dashDot");
// data series line
- const OString sStart("/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser");
- assertXPath(pXmlDoc, sStart + sDash, "val", "dash");
+ static constexpr OString sStart("/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser"_ostr);
+ assertXPath(pXmlDoc, sStart + sDash, "val", u"dash");
// regression-curve (trendline)
- assertXPath(pXmlDoc, sStart + "/c:trendline" + sDash, "val", "sysDot");
+ assertXPath(pXmlDoc, sStart + "/c:trendline" + sDash, "val", u"sysDot");
}
void Chart2GeometryTest::testTdf135184RoundLineCap4()
{
// It tests legend, data series sector and title.
- load(u"/chart2/qa/extras/data/xlsx/", "tdf135184RoundLineCap2.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ loadFromFile(u"xlsx/tdf135184RoundLineCap2.xlsx");
+ save(u"Calc Office Open XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- const OString sChartStart("/c:chartSpace/c:chart");
- const OString sDash("/c:spPr/a:ln/a:prstDash");
- assertXPath(pXmlDoc, sChartStart + "/c:legend" + sDash, "val", "sysDot");
+ 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", u"sysDot");
const OString sSeries(sChartStart + "/c:plotArea/c:pieChart/c:ser/c:dPt[3]");
- assertXPath(pXmlDoc, sSeries + sDash, "val", "dash");
- assertXPath(pXmlDoc, sChartStart + "/c:title" + sDash, "val", "dashDot");
+ assertXPath(pXmlDoc, sSeries + sDash, "val", u"dash");
+ assertXPath(pXmlDoc, sChartStart + "/c:title" + sDash, "val", u"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.
- load(u"/chart2/qa/extras/data/odp/", "tdf128345_ChartArea_CG_TS.odp");
+ 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.
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- OString sPathStart("//c:chartSpace/c:spPr/a:gradFill");
+ 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", "30000");
- assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "30000");
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", u"30000");
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", u"30000");
}
void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import()
@@ -192,10 +194,17 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import()
// 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.
- load(u"/chart2/qa/extras/data/pptx/", "tdf128345_ChartArea_CG_TS.pptx");
+
+ // 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
- xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "impress8");
+ save(u"impress8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
const OUString sOUChartStyleName = getXPathContent(
pXmlDoc,
@@ -209,7 +218,8 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import()
= getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name");
// Verify the content of the opacity definition
- xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml", "impress8");
+ save(u"impress8"_ustr);
+ xmlDocUniquePtr pXmlDoc2 = parseExport(u"Object 1/styles.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc2);
const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'");
const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute);
@@ -218,23 +228,24 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import()
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='20%']");
+ 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.
- load(u"/chart2/qa/extras/data/odp/", "tdf128345_ChartWall_CS_TG.odp");
+ loadFromFile(u"odp/tdf128345_ChartWall_CS_TG.odp");
// Make sure the chart has a gradient with transparency in gradient stops in saved pptx file.
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- OString sPathStart("//c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill");
+ 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", "0");
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", u"0");
// no element for 0% transparent
assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", 0);
}
@@ -243,10 +254,11 @@ 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.
- load(u"/chart2/qa/extras/data/pptx/", "tdf128345_ChartWall_CS_TG.pptx");
+ loadFromFile(u"pptx/tdf128345_ChartWall_CS_TG.pptx");
// Find transparency gradient name
- xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "impress8");
+ save(u"impress8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
const OUString sOUChartStyleName
= getXPathContent(pXmlDoc, "//office:document-content/office:body/office:chart/chart:chart/"
@@ -260,7 +272,8 @@ void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_import()
= getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name");
// Verify content of the opacity definition
- xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml", "impress8");
+ save(u"impress8"_ustr);
+ xmlDocUniquePtr pXmlDoc2 = parseExport(u"Object 1/styles.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc2);
const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'");
const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute);
@@ -274,30 +287,40 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_export()
{
// legend with solid color and transparency gradient
// Without the patch the transparency was lost.
- load(u"/chart2/qa/extras/data/odp/", "tdf128345_Legend_CS_TG_axial.odp");
+ 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.
- xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML");
+ save(u"Impress MS PowerPoint 2007 XML"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
- OString sPathStart("//c:chartSpace/c:chart/c:legend/c:spPr/a:gradFill");
- assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 3); // axial
- // no element for 0% transparent
+ 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);
- // 100% transparent = opacity 0. It comes from "axial", therefore it is in the middle.
- assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", "0");
- assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]", "pos", "50000");
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]", "pos", u"0");
+
+ // MCGR: middle entry, 100% transparence, pos 0.5
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]/a:srgbClr/a:alpha", "val", u"0");
+ assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[2]", "pos", u"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", u"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.
- load(u"/chart2/qa/extras/data/pptx/", "tdf128345_Legend_CS_TG_axial.pptx");
+ loadFromFile(u"pptx/tdf128345_Legend_CS_TG_axial.pptx");
// Find transparency gradient name
- xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "impress8");
+ save(u"impress8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
const OUString sOUChartStyleName
= getXPathContent(pXmlDoc, "//office:document-content/office:body/office:chart/chart:chart/"
@@ -311,7 +334,8 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import()
= getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name");
// Verify content of the opacity definition
- xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml", "impress8");
+ save(u"impress8"_ustr);
+ xmlDocUniquePtr pXmlDoc2 = parseExport(u"Object 1/styles.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc2);
const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'");
const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute);
@@ -325,37 +349,37 @@ void Chart2GeometryTest::testTdf135366LabelOnSeries()
{
// Error was, that the fill and line properties of a <chart:data-label> were not
// imported at all. Here they should be at the series.
- load(u"/chart2/qa/extras/data/ods/", "tdf135366_data_label_series.ods");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"ods/tdf135366_data_label_series.ods");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xPropSet(xDataSeries, UNO_QUERY_THROW);
uno::Any aAny;
- aAny = xPropSet->getPropertyValue("LabelBorderStyle");
+ aAny = xPropSet->getPropertyValue(u"LabelBorderStyle"_ustr);
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;
+ xPropSet->getPropertyValue(u"LabelBorderWidth"_ustr) >>= nBorderWidth;
CPPUNIT_ASSERT_EQUAL_MESSAGE("LabelBorderWidth", nExpectedWidth, nBorderWidth);
sal_Int32 nLineColor;
sal_Int32 nExpectedLineColor = 255;
- xPropSet->getPropertyValue("LabelBorderColor") >>= nLineColor;
+ xPropSet->getPropertyValue(u"LabelBorderColor"_ustr) >>= nLineColor;
CPPUNIT_ASSERT_EQUAL_MESSAGE("line color blue, 255=#0000FF", nExpectedLineColor, nLineColor);
- aAny = xPropSet->getPropertyValue("LabelFillStyle");
+ aAny = xPropSet->getPropertyValue(u"LabelFillStyle"_ustr);
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;
+ xPropSet->getPropertyValue(u"LabelFillColor"_ustr) >>= nFillColor;
CPPUNIT_ASSERT_EQUAL_MESSAGE("fill color green, 65280=#00FF00", nExpectedFillColor, nFillColor);
}
@@ -363,7 +387,7 @@ void Chart2GeometryTest::testTdf135366LabelOnPoint()
{
// Error was, that the fill and line properties of a <chart:data-label> were not
// imported at all. Here they should be at point 2.
- load(u"/chart2/qa/extras/data/odt/", "tdf135366_data_label_point.odt");
+ loadFromFile(u"odt/tdf135366_data_label_point.odt");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
@@ -372,35 +396,35 @@ void Chart2GeometryTest::testTdf135366LabelOnPoint()
uno::UNO_SET_THROW);
uno::Any aAny;
- aAny = xPropSet->getPropertyValue("LabelBorderStyle");
+ aAny = xPropSet->getPropertyValue(u"LabelBorderStyle"_ustr);
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;
+ xPropSet->getPropertyValue(u"LabelBorderWidth"_ustr) >>= nBorderWidth;
CPPUNIT_ASSERT_EQUAL_MESSAGE("LabelBorderWidth", nExpectedWidth, nBorderWidth);
sal_Int32 nLineTransparency;
sal_Int32 nExpectedTransparency = 30;
- xPropSet->getPropertyValue("LabelBorderTransparency") >>= nLineTransparency;
+ xPropSet->getPropertyValue(u"LabelBorderTransparency"_ustr) >>= nLineTransparency;
CPPUNIT_ASSERT_EQUAL_MESSAGE("line transparency", nExpectedTransparency, nLineTransparency);
sal_Int32 nLineColor;
sal_Int32 nExpectedLineColor = 10206041;
- xPropSet->getPropertyValue("LabelBorderColor") >>= nLineColor;
+ xPropSet->getPropertyValue(u"LabelBorderColor"_ustr) >>= nLineColor;
CPPUNIT_ASSERT_EQUAL_MESSAGE("line color greenish, 10206041=#9BBB59", nExpectedLineColor,
nLineColor);
- aAny = xPropSet->getPropertyValue("LabelFillStyle");
+ aAny = xPropSet->getPropertyValue(u"LabelFillStyle"_ustr);
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;
+ xPropSet->getPropertyValue(u"LabelFillColor"_ustr) >>= nFillColor;
CPPUNIT_ASSERT_EQUAL_MESSAGE("fill color gray, 14277081=#d9d9d9", nExpectedFillColor,
nFillColor);
}
@@ -410,8 +434,13 @@ void Chart2GeometryTest::testTdf135366LabelExport()
// Error was, that line and fill properties were not exported as
// graphic-properties of a <chart:data-label> element, but only
// as loext chart-properties of the <chart:data-point> element.
- load(u"/chart2/qa/extras/data/odt/", "tdf135366_data_label_export.odt");
- xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "writer8");
+ loadFromFile(u"odt/tdf135366_data_label_export.odt");
+
+ // FIXME: Error: unexpected attribute "loext:label-stroke-color"
+ skipValidation();
+
+ save(u"writer8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Find label style
@@ -433,25 +462,25 @@ void Chart2GeometryTest::testTdf135366LabelExport()
void Chart2GeometryTest::testTdf135366_CustomLabelText()
{
+ Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); });
+
// Error was, that custom text in a data label was only exported in ODF extended,
// although the used <chart:data-label> element exists since ODF 1.2.
- const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion(GetODFDefaultVersion());
SetODFDefaultVersion(SvtSaveOptions::ODFVER_012);
- load(u"/chart2/qa/extras/data/pptx/", "tdf135366_CustomLabelText.pptx");
- xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "impress8");
+ loadFromFile(u"pptx/tdf135366_CustomLabelText.pptx");
+ save(u"impress8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
// Find custom text. As of version 7.0 it is in a <text:span> element.
- const OString sCustomTextPath(
+ static constexpr const char* 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");
assertXPath(pXmlDoc, sCustomTextPath, 1);
// Verify text content
const OUString sOUTextContent = getXPathContent(pXmlDoc, sCustomTextPath);
- CPPUNIT_ASSERT_EQUAL(OUString("Custom"), sOUTextContent);
-
- SetODFDefaultVersion(nCurrentODFVersion);
+ CPPUNIT_ASSERT_EQUAL(u"Custom"_ustr, sOUTextContent);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2GeometryTest);
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 0b4f6d89303e..0eb9b9375b6f 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -29,211 +29,45 @@
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/qa/XDumper.hpp>
#include <iterator>
#include <com/sun/star/util/Color.hpp>
-#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/awt/Gradient2.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <docmodel/uno/UnoGradientTools.hxx>
+namespace
+{
class Chart2ImportTest : public ChartTest
{
public:
- void Fdo60083();
- void testSteppedLines();
- void testErrorBarRange();
- void testErrorBarFormatting();
- void testODSChartSeries();
- void testXLSXChartSeries();
- void testXLSChartSeries();
- void testODTChartSeries();
- void testDOCChartSeries();
- void testDOCXChartSeries();
- void testDOCXChartEmptySeries();
- void testTdf81396();
- void testDOCXChartValuesSize();
- void testPPTXChartSeries();
- void testPPTXSparseChartSeries();
- /**
- * 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).
- */
- void testPPTXHiddenDataSeries();
- void testPPTXPercentageNumberFormats();
- void testPieChartLabelsNumFormat();
- void testPPTXStackedNonStackedYAxis();
- void testPPTChartSeries();
- void testODPChartSeries();
- void testBnc864396();
- void testBnc882383();
- void testTransparencyGradientValue();
- void testBnc889755();
- void testSimpleStrictXLSX();
- void testDelayedCellImport(); // chart range referencing content on later sheets
- void testFlatODSStackedColumnChart();
- void testFdo78080();
- void testFdo54361();
- void testFdo54361_1();
- void testTdf127811();
- void testTdf86624(); // manually placed legends
- void testTdf105517();
- void testTdf106217();
- void testTdf108021();
- void testTdf100084();
- void testTdf124817();
- void testTdf126033();
- void testAutoBackgroundXLSX();
- void testAutoChartAreaBorderPropXLSX();
- void testChartAreaStyleBackgroundXLSX();
- void testChartHatchFillXLSX();
- void testAxisTextRotationXLSX();
- // void testTextCanOverlapXLSX(); // TODO : temporarily disabled.
- void testTextBreakXLSX();
- void testNumberFormatsXLSX();
- void testNumberFormatsDOCX();
- void testPercentageNumberFormatsDOCX();
-
- void testTransparentBackground(OUString const & filename);
+ Chart2ImportTest() : ChartTest(u"/chart2/qa/extras/data/"_ustr) {}
- // below are OOXML default value tests for cases
- // where we fixed the handling of MSO 2007 vs OOXML
- void testAutoTitleDelDefaultValue2007XLSX();
- void testAutoTitleDelDefaultValue2013XLSX();
- void testDispBlanksAsDefaultValue2007XLSX();
- void testDispBlanksAsDefaultValue2013XLSX();
-
- void testSmoothDefaultValue2007XLSX();
- void testSmoothDefaultValue2013XLSX();
- void testTrendlineDefaultValue2007XLSX();
- void testTrendlineDefaultValue2013XLSX();
- void testVaryColorDefaultValues2007XLSX();
- void testVaryColorDefaultValues2013XLSX();
- void testPlotVisOnlyDefaultValue2013XLSX();
- void testRAngAxDefaultValue2013XLSX();
- void testMajorTickMarksDefaultValue2013XLSX();
- void testMinorTickMarksDefaultValue2013XLSX();
-
- void testAxisTitleDefaultRotationXLSX();
- void testSecondaryAxisTitleDefaultRotationXLSX();
- void testAxisTitleRotationXLSX();
- void testAxisTitlePositionDOCX();
- void testCombinedChartAttachedAxisXLSX();
- void testTdf140489MultiSeriesChartAxisXLSX();
-
- void testTdf90510(); // Pie chart label placement settings(XLS)
- void testTdf109858(); // Pie chart label placement settings(XLSX)
- void testTdf130105();
-
- void testTdf111173();
- void testTdf122226();
-
- void testInternalDataProvider();
-
- void testTdf115107(); // import complex data point labels
- void testTdf115107_2(); // import complex data point labels in cobo charts with multiple data series
-
- void testTdf116163();
-
- void testTdf48041();
-
- void testTdf121205();
-
- CPPUNIT_TEST_SUITE(Chart2ImportTest);
- CPPUNIT_TEST(Fdo60083);
- CPPUNIT_TEST(testSteppedLines);
- CPPUNIT_TEST(testErrorBarRange);
- CPPUNIT_TEST(testErrorBarFormatting);
- CPPUNIT_TEST(testODSChartSeries);
- CPPUNIT_TEST(testXLSXChartSeries);
- CPPUNIT_TEST(testXLSChartSeries);
- CPPUNIT_TEST(testODTChartSeries);
- CPPUNIT_TEST(testDOCChartSeries);
- CPPUNIT_TEST(testDOCXChartSeries);
- CPPUNIT_TEST(testDOCXChartEmptySeries);
- CPPUNIT_TEST(testTdf81396);
- CPPUNIT_TEST(testDOCXChartValuesSize);
- CPPUNIT_TEST(testPPTChartSeries);
- CPPUNIT_TEST(testPPTXChartSeries);
- CPPUNIT_TEST(testPPTXSparseChartSeries);
- CPPUNIT_TEST(testPPTXHiddenDataSeries);
- CPPUNIT_TEST(testPPTXPercentageNumberFormats);
- CPPUNIT_TEST(testPieChartLabelsNumFormat);
- CPPUNIT_TEST(testPPTXStackedNonStackedYAxis);
- CPPUNIT_TEST(testODPChartSeries);
- CPPUNIT_TEST(testBnc864396);
- CPPUNIT_TEST(testBnc882383);
- CPPUNIT_TEST(testTransparencyGradientValue);
- CPPUNIT_TEST(testBnc889755);
- CPPUNIT_TEST(testSimpleStrictXLSX);
- CPPUNIT_TEST(testDelayedCellImport);
- CPPUNIT_TEST(testFlatODSStackedColumnChart);
- CPPUNIT_TEST(testFdo78080);
- CPPUNIT_TEST(testFdo54361);
- CPPUNIT_TEST(testFdo54361_1);
- CPPUNIT_TEST(testTdf127811);
- CPPUNIT_TEST(testTdf86624);
- CPPUNIT_TEST(testTdf105517);
- CPPUNIT_TEST(testTdf106217);
- CPPUNIT_TEST(testTdf108021);
- CPPUNIT_TEST(testTdf100084);
- CPPUNIT_TEST(testTdf124817);
- CPPUNIT_TEST(testTdf126033);
- CPPUNIT_TEST(testAutoBackgroundXLSX);
- CPPUNIT_TEST(testAutoChartAreaBorderPropXLSX);
- CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX);
- CPPUNIT_TEST(testChartHatchFillXLSX);
- CPPUNIT_TEST(testAxisTextRotationXLSX);
- // CPPUNIT_TEST(testTextCanOverlapXLSX); // TODO : temporarily disabled.
- CPPUNIT_TEST(testTextBreakXLSX);
- CPPUNIT_TEST(testNumberFormatsXLSX);
- CPPUNIT_TEST(testNumberFormatsDOCX);
- CPPUNIT_TEST(testPercentageNumberFormatsDOCX);
- CPPUNIT_TEST(testAutoTitleDelDefaultValue2007XLSX);
- CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX);
- CPPUNIT_TEST(testDispBlanksAsDefaultValue2007XLSX);
- CPPUNIT_TEST(testDispBlanksAsDefaultValue2013XLSX);
- CPPUNIT_TEST(testSmoothDefaultValue2007XLSX);
- CPPUNIT_TEST(testSmoothDefaultValue2013XLSX);
- CPPUNIT_TEST(testTrendlineDefaultValue2007XLSX);
- CPPUNIT_TEST(testTrendlineDefaultValue2013XLSX);
- CPPUNIT_TEST(testVaryColorDefaultValues2007XLSX);
- CPPUNIT_TEST(testVaryColorDefaultValues2013XLSX);
- CPPUNIT_TEST(testPlotVisOnlyDefaultValue2013XLSX);
- CPPUNIT_TEST(testRAngAxDefaultValue2013XLSX);
- CPPUNIT_TEST(testMajorTickMarksDefaultValue2013XLSX);
- CPPUNIT_TEST(testMinorTickMarksDefaultValue2013XLSX);
- CPPUNIT_TEST(testAxisTitleDefaultRotationXLSX);
- CPPUNIT_TEST(testSecondaryAxisTitleDefaultRotationXLSX);
- CPPUNIT_TEST(testAxisTitleRotationXLSX);
- CPPUNIT_TEST(testAxisTitlePositionDOCX);
- CPPUNIT_TEST(testCombinedChartAttachedAxisXLSX);
- CPPUNIT_TEST(testTdf140489MultiSeriesChartAxisXLSX);
- CPPUNIT_TEST(testTdf90510);
- CPPUNIT_TEST(testTdf109858);
- CPPUNIT_TEST(testTdf130105);
- CPPUNIT_TEST(testTdf111173);
- CPPUNIT_TEST(testTdf122226);
-
- CPPUNIT_TEST(testInternalDataProvider);
-
- CPPUNIT_TEST(testTdf115107);
- CPPUNIT_TEST(testTdf115107_2);
-
- CPPUNIT_TEST(testTdf116163);
-
- CPPUNIT_TEST(testTdf48041);
-
- CPPUNIT_TEST(testTdf121205);
-
- CPPUNIT_TEST_SUITE_END();
+protected:
+ void testTransparentBackground(std::u16string_view filename);
};
+OUString getShapeDump(css::uno::Reference<css::chart::XChartDocument> const& doc)
+{
+ return css::uno::Reference<css::qa::XDumper>(doc, css::uno::UNO_QUERY_THROW)->dump(u"shapes"_ustr);
+}
+
+sal_Int32 getNumberFormat( const Reference<chart2::XChartDocument>& xChartDoc, const OUString& sFormat )
+{
+ Reference<util::XNumberFormatsSupplier> xNFS(xChartDoc, uno::UNO_QUERY_THROW);
+ Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats();
+ CPPUNIT_ASSERT(xNumberFormats.is());
+
+ return xNumberFormats->queryKey(sFormat, css::lang::Locale(), false);
+}
+
// error bar import
// split method up into smaller chunks for more detailed tests
-void Chart2ImportTest::Fdo60083()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo60083)
{
- load(u"/chart2/qa/extras/data/ods/", "fdo60083.ods");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ loadFromFile(u"ods/fdo60083.ods");
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
@@ -248,7 +82,7 @@ void Chart2ImportTest::Fdo60083()
{
sal_Int32 nErrorBarStyle;
CPPUNIT_ASSERT(
- xErrorBarYProps->getPropertyValue("ErrorBarStyle")
+ xErrorBarYProps->getPropertyValue(u"ErrorBarStyle"_ustr)
>>= nErrorBarStyle);
CPPUNIT_ASSERT_EQUAL(
chart::ErrorBarStyle::RELATIVE,
@@ -256,20 +90,20 @@ void Chart2ImportTest::Fdo60083()
double nVal = 0.0;
CPPUNIT_ASSERT(
- xErrorBarYProps->getPropertyValue("PositiveError") >>= nVal);
+ xErrorBarYProps->getPropertyValue(u"PositiveError"_ustr) >>= nVal);
CPPUNIT_ASSERT_DOUBLES_EQUAL(5.0, nVal, 1e-8);
CPPUNIT_ASSERT(
- xErrorBarYProps->getPropertyValue("NegativeError") >>= nVal);
+ xErrorBarYProps->getPropertyValue(u"NegativeError"_ustr) >>= nVal);
CPPUNIT_ASSERT_DOUBLES_EQUAL(5.0, nVal, 1e-8);
bool bVal;
CPPUNIT_ASSERT(
- xErrorBarYProps->getPropertyValue("ShowPositiveError") >>= bVal);
+ xErrorBarYProps->getPropertyValue(u"ShowPositiveError"_ustr) >>= bVal);
CPPUNIT_ASSERT_EQUAL(true, bVal);
CPPUNIT_ASSERT(
- xErrorBarYProps->getPropertyValue("ShowNegativeError") >>= bVal);
+ xErrorBarYProps->getPropertyValue(u"ShowNegativeError"_ustr) >>= bVal);
CPPUNIT_ASSERT_EQUAL(true, bVal);
}
@@ -279,10 +113,10 @@ void Chart2ImportTest::Fdo60083()
CPPUNIT_ASSERT(!xErrorBarXProps.is());
}
-void Chart2ImportTest::testErrorBarRange()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testErrorBarRange)
{
- load(u"/chart2/qa/extras/data/ods/", "error_bar_range.ods");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ loadFromFile(u"ods/error_bar_range.ods");
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
@@ -297,21 +131,21 @@ void Chart2ImportTest::testErrorBarRange()
sal_Int32 nErrorBarStyle;
CPPUNIT_ASSERT(
- xErrorBarYProps->getPropertyValue("ErrorBarStyle")
+ xErrorBarYProps->getPropertyValue(u"ErrorBarStyle"_ustr)
>>= 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_ASSERT(xErrorBarYProps->getPropertyValue(u"ErrorBarRangePositive"_ustr) >>= aRangePos);
+ CPPUNIT_ASSERT_EQUAL(u"$Sheet1.$C$2:$C$4"_ustr, aRangePos);
}
-void Chart2ImportTest::testErrorBarFormatting()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testErrorBarFormatting)
{
- load(u"/chart2/qa/extras/data/ods/", "error_bar_properties.ods");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ loadFromFile(u"ods/error_bar_properties.ods");
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
@@ -325,13 +159,13 @@ void Chart2ImportTest::testErrorBarFormatting()
CPPUNIT_ASSERT(xErrorBarYProps.is());
util::Color aColor(0);
- xErrorBarYProps->getPropertyValue("LineColor") >>= aColor;
+ xErrorBarYProps->getPropertyValue(u"LineColor"_ustr) >>= aColor;
sal_uInt32 nColorValue = aColor;
CPPUNIT_ASSERT_EQUAL(sal_uInt32(0xff3333), nColorValue);
}
// stepped line interpolation
-void Chart2ImportTest::testSteppedLines()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSteppedLines)
{
const sal_Int32 MAXSHEET = 14;
chart2::CurveStyle const curveStyle[] = {
@@ -351,10 +185,10 @@ void Chart2ImportTest::testSteppedLines()
chart2::CurveStyle_STEP_CENTER_Y
};
- load(u"/chart2/qa/extras/data/ods/", "stepped_lines.ods");
+ loadFromFile(u"ods/stepped_lines.ods");
for(sal_Int32 nSheet = 0; nSheet < MAXSHEET; ++nSheet)
{
- uno::Reference< chart2::XChartDocument > xChart2Doc = getChartDocFromSheet( nSheet, mxComponent );
+ uno::Reference< chart2::XChartDocument > xChart2Doc = getChartDocFromSheet( nSheet);
CPPUNIT_ASSERT(xChart2Doc.is());
Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChart2Doc, 0 );
@@ -364,12 +198,12 @@ void Chart2ImportTest::testSteppedLines()
CPPUNIT_ASSERT(xPropSet.is());
chart2::CurveStyle eCurveStyle;
- xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle;
+ xPropSet->getPropertyValue(u"CurveStyle"_ustr) >>= eCurveStyle;
CPPUNIT_ASSERT_EQUAL(eCurveStyle, curveStyle[nSheet]);
}
}
-static uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< chart::XChartDocument > const & xChart1Doc)
+uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< chart::XChartDocument > const & xChart1Doc)
{
CPPUNIT_ASSERT(xChart1Doc.is());
uno::Reference< chart::XChartDataArray > xChartData ( xChart1Doc->getData(), UNO_QUERY_THROW);
@@ -377,61 +211,61 @@ static uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< ch
return seriesList;
}
-void Chart2ImportTest::testODSChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testODSChartSeries)
{
- load(u"/chart2/qa/extras/data/ods/", "chart.ods");
- uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
+ loadFromFile(u"ods/chart.ods");
+ uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0), 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_ASSERT_EQUAL(u"Col 1"_ustr, seriesList[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Col2"_ustr, seriesList[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Col 33"_ustr, seriesList[2]);
}
-void Chart2ImportTest::testXLSXChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testXLSXChartSeries)
{
- load(u"/chart2/qa/extras/data/xlsx/", "chart.xlsx");
- uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/chart.xlsx");
+ uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0), 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_ASSERT_EQUAL(u"Col 1"_ustr, seriesList[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Col2"_ustr, seriesList[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Col 33"_ustr, seriesList[2]);
}
-void Chart2ImportTest::testXLSChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testXLSChartSeries)
{
- load(u"/chart2/qa/extras/data/xls/", "chart.xls");
- uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
+ loadFromFile(u"xls/chart.xls");
+ uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0), 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_ASSERT_EQUAL(u"Col 1"_ustr, seriesList[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Col 2"_ustr, seriesList[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Col 3"_ustr, seriesList[2]);
}
-void Chart2ImportTest::testODTChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testODTChartSeries)
{
- load(u"/chart2/qa/extras/data/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]);
+ loadFromFile(u"odt/chart.odt");
+ uno::Sequence< OUString > seriesList = getWriterChartColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL(u"Column 1"_ustr, seriesList[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Column 2"_ustr, seriesList[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Column 3"_ustr, seriesList[2]);
}
-void Chart2ImportTest::testDOCChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDOCChartSeries)
{
- load(u"/chart2/qa/extras/data/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]);
+ loadFromFile(u"doc/chart.doc");
+ uno::Sequence< OUString > seriesList = getWriterChartColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL(u"Column 1"_ustr, seriesList[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Column 2"_ustr, seriesList[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Column 3"_ustr, seriesList[2]);
}
-void Chart2ImportTest::testDOCXChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDOCXChartSeries)
{
- load(u"/chart2/qa/extras/data/docx/", "chart.docx");
+ loadFromFile(u"docx/chart.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -440,14 +274,14 @@ void Chart2ImportTest::testDOCXChartSeries()
std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT);
CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size());
- CPPUNIT_ASSERT_EQUAL(OUString("Series 1"), aLabels[0][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("Series 2"), aLabels[1][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), aLabels[2][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Series 1"_ustr, aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Series 2"_ustr, aLabels[1][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Series 3"_ustr, aLabels[2][0].get<OUString>());
}
-void Chart2ImportTest::testDOCXChartEmptySeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDOCXChartEmptySeries)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf125337.docx");
+ loadFromFile(u"docx/tdf125337.docx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -456,9 +290,9 @@ void Chart2ImportTest::testDOCXChartEmptySeries()
std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT);
CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size());
- CPPUNIT_ASSERT_EQUAL(OUString("1. dataseries"), aLabels[0][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("2. dataseries"), aLabels[1][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), aLabels[2][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"1. dataseries"_ustr, aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"2. dataseries"_ustr, aLabels[1][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Column 3"_ustr, aLabels[2][0].get<OUString>());
//test chart series sparse data for docx
std::vector<std::vector<double> > aValues = getDataSeriesYValuesFromChartType(xCT);
@@ -471,10 +305,10 @@ void Chart2ImportTest::testDOCXChartEmptySeries()
CPPUNIT_ASSERT(std::isnan(aValues[2][1]));
}
-void Chart2ImportTest::testTdf81396()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf81396)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf81396.xlsx");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
+ loadFromFile(u"xlsx/tdf81396.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0),
UNO_QUERY_THROW);
Reference<chart2::XChartDocument> xChartDoc2(xChartDoc, UNO_QUERY_THROW);
@@ -488,9 +322,22 @@ void Chart2ImportTest::testTdf81396()
CPPUNIT_ASSERT_EQUAL(105.210801910481, aDataSeriesYValues[0][0]);
}
-void Chart2ImportTest::testDOCXChartValuesSize()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXChartErrorBars)
+{
+ loadFromFile(u"pptx/tdf127720.pptx");
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ uno::Reference< chart::XChartDataArray > xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW);
+ Sequence<OUString> 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<sal_Int32>(4), aColumnDesc.getLength());
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDOCXChartValuesSize)
{
- load( u"/chart2/qa/extras/data/docx/", "bubblechart.docx" );
+ loadFromFile(u"docx/bubblechart.docx" );
Reference<chart2::XChartDocument> xChartDoc( getChartDocFromWriter(0), uno::UNO_QUERY );
CPPUNIT_ASSERT( xChartDoc.is() );
@@ -509,21 +356,24 @@ void Chart2ImportTest::testDOCXChartValuesSize()
CPPUNIT_ASSERT_DOUBLES_EQUAL( aExpected[nRowIdx][nColIdx], aData[nRowIdx][nColIdx], 1e-1 );
}
-void Chart2ImportTest::testPPTChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTChartSeries)
{
//test chart series names for ppt
- uno::Sequence < OUString > seriesList = getImpressChartColumnDescriptions(u"/chart2/qa/extras/data/ppt/", "chart.ppt");
+ loadFromFile(u"ppt/chart.ppt");
+ uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromDrawImpress( 0, 0 );
+ uno::Reference< chart::XChartDataArray > xChartData ( xChartDoc->getData(), uno::UNO_QUERY_THROW);
+ uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions();
- 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_ASSERT_EQUAL(u"Column 1"_ustr, seriesList[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Column 2"_ustr, seriesList[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Column 3"_ustr, seriesList[2]);
}
-void Chart2ImportTest::testPPTXChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXChartSeries)
{
//test chart series names for pptx
- load(u"/chart2/qa/extras/data/pptx/", "chart.pptx");
+ loadFromFile(u"pptx/chart.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -532,15 +382,15 @@ void Chart2ImportTest::testPPTXChartSeries()
std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT);
CPPUNIT_ASSERT_EQUAL(size_t(3), aLabels.size());
- CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), aLabels[0][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), aLabels[1][0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), aLabels[2][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Column 1"_ustr, aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Column 2"_ustr, aLabels[1][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Column 3"_ustr, aLabels[2][0].get<OUString>());
}
-void Chart2ImportTest::testPPTXSparseChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXSparseChartSeries)
{
//test chart series sparse data for pptx
- load(u"/chart2/qa/extras/data/pptx/", "sparse-chart.pptx");
+ loadFromFile(u"pptx/sparse-chart.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -559,16 +409,21 @@ void Chart2ImportTest::testPPTXSparseChartSeries()
CPPUNIT_ASSERT_EQUAL(-2.8, aValues[1][3]);
}
-void Chart2ImportTest::testPPTXHiddenDataSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXHiddenDataSeries)
{
- load(u"/chart2/qa/extras/data/pptx/", "stacked-bar-chart-hidden-series.pptx");
+ /**
+ * 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<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
// "Automatic" chart background fill in pptx should be loaded as no fill.
Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
CPPUNIT_ASSERT(xPropSet.is());
- drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>();
+ drawing::FillStyle eStyle = xPropSet->getPropertyValue(u"FillStyle"_ustr).get<drawing::FillStyle>();
CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in pptx should be loaded as no fill (transparent).",
drawing::FillStyle_NONE, eStyle);
@@ -578,7 +433,7 @@ void Chart2ImportTest::testPPTXHiddenDataSeries()
// There should be only one data series present.
std::vector<uno::Sequence<uno::Any> > aLabels = getDataSeriesLabelsFromChartType(xCT);
CPPUNIT_ASSERT_EQUAL(size_t(1), aLabels.size());
- CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"Series 3"_ustr, aLabels[0][0].get<OUString>());
// Test the internal data.
CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider());
@@ -592,15 +447,15 @@ void Chart2ImportTest::testPPTXHiddenDataSeries()
// Get the category labels.
Sequence<Sequence<OUString> > 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_ASSERT_EQUAL(u"Category 1"_ustr, aCategories[0][0]);
+ CPPUNIT_ASSERT_EQUAL(u"Category 2"_ustr, aCategories[1][0]);
+ CPPUNIT_ASSERT_EQUAL(u"Category 3"_ustr, aCategories[2][0]);
+ CPPUNIT_ASSERT_EQUAL(u"Category 4"_ustr, aCategories[3][0]);
}
-void Chart2ImportTest::testPPTXPercentageNumberFormats()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXPercentageNumberFormats)
{
- load(u"/chart2/qa/extras/data/pptx/", "percentage-number-formats.pptx");
+ loadFromFile(u"pptx/percentage-number-formats.pptx");
// 1st chart
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
@@ -611,35 +466,35 @@ void Chart2ImportTest::testPPTXPercentageNumberFormats()
uno::Reference<beans::XPropertySet> xPropertySet;
chart2::DataPointLabel aLabel;
sal_Int32 nNumberFormat;
- const sal_Int32 nPercentFormatSimple = getNumberFormat(xChartDoc, "0%");
- const sal_Int32 nPercentFormatDecimal = getNumberFormat(xChartDoc, "0.00%");
+ const sal_Int32 nPercentFormatSimple = getNumberFormat(xChartDoc, u"0%"_ustr);
+ const sal_Int32 nPercentFormatDecimal = getNumberFormat(xChartDoc, u"0.00%"_ustr);
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("Label") >>= aLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= aLabel;
CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber);
CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent);
- xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat;
+ xPropertySet->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= nNumberFormat;
CPPUNIT_ASSERT_EQUAL(nPercentFormatSimple, nNumberFormat);
xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("Label") >>= aLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= aLabel;
CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber);
CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent);
- xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat;
+ xPropertySet->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= nNumberFormat;
CPPUNIT_ASSERT_EQUAL(nPercentFormatDecimal, nNumberFormat);
xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("Label") >>= aLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= aLabel;
CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber);
CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent);
- xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat;
+ xPropertySet->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= nNumberFormat;
CPPUNIT_ASSERT_EQUAL(nPercentFormatSimple, nNumberFormat);
xPropertySet.set(xDataSeries->getDataPointByIndex(3), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("Label") >>= aLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= aLabel;
CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber);
CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent);
- xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat;
+ xPropertySet->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= nNumberFormat;
CPPUNIT_ASSERT_EQUAL(nPercentFormatDecimal, nNumberFormat);
// 2nd chart
@@ -657,28 +512,28 @@ void Chart2ImportTest::testPPTXPercentageNumberFormats()
// 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%");
+ const sal_Int32 nPercentFormatDecimalShort = getNumberFormat(xChartDoc, u"0.0%"_ustr);
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));
}
-void Chart2ImportTest::testPieChartLabelsNumFormat()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPieChartLabelsNumFormat)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdfPieNumFormat.xlsx");
- uno::Reference< chart::XChartDocument > xChartDoc(getChartCompFromSheet(0, mxComponent), UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/tdfPieNumFormat.xlsx");
+ uno::Reference< chart::XChartDocument > xChartDoc(getChartCompFromSheet(0, 0), UNO_QUERY_THROW);
CPPUNIT_ASSERT(xChartDoc.is());
// test data point labels format
Reference<beans::XPropertySet> xDataPointPropSet(xChartDoc->getDiagram()->getDataPointProperties(0, 0), uno::UNO_SET_THROW);
chart2::DataPointLabel aLabel;
- xDataPointPropSet->getPropertyValue("Label") >>= aLabel;
+ xDataPointPropSet->getPropertyValue(u"Label"_ustr) >>= aLabel;
CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber);
}
-void Chart2ImportTest::testPPTXStackedNonStackedYAxis()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPPTXStackedNonStackedYAxis)
{
- load(u"/chart2/qa/extras/data/pptx/", "stacked-non-stacked-mix-y-axis.pptx");
+ loadFromFile(u"pptx/stacked-non-stacked-mix-y-axis.pptx");
// 1st chart is a normal stacked column.
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
@@ -686,7 +541,7 @@ void Chart2ImportTest::testPPTXStackedNonStackedYAxis()
Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
OUString aTitle = getTitleString(xTitled);
- CPPUNIT_ASSERT_EQUAL(OUString("Stacked"), aTitle);
+ CPPUNIT_ASSERT_EQUAL(u"Stacked"_ustr, aTitle);
// Get the Y-axis.
Reference<chart2::XAxis> xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0);
@@ -703,7 +558,7 @@ void Chart2ImportTest::testPPTXStackedNonStackedYAxis()
xTitled.set(xChartDoc, uno::UNO_QUERY_THROW);
aTitle = getTitleString(xTitled);
- CPPUNIT_ASSERT_EQUAL(OUString("100% Stacked"), aTitle);
+ CPPUNIT_ASSERT_EQUAL(u"100% Stacked"_ustr, aTitle);
// Get the Y-axis.
xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0);
@@ -722,7 +577,7 @@ void Chart2ImportTest::testPPTXStackedNonStackedYAxis()
xTitled.set(xChartDoc, uno::UNO_QUERY_THROW);
aTitle = getTitleString(xTitled);
- CPPUNIT_ASSERT_EQUAL(OUString("Stacked column mixed with 100% stacked area"), aTitle);
+ CPPUNIT_ASSERT_EQUAL(u"Stacked column mixed with 100% stacked area"_ustr, aTitle);
// Get the Y-axis.
xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0);
@@ -735,19 +590,23 @@ void Chart2ImportTest::testPPTXStackedNonStackedYAxis()
CPPUNIT_ASSERT_MESSAGE("Y axis should NOT be a percent format.", !(nType & util::NumberFormat::PERCENT));
}
-void Chart2ImportTest::testODPChartSeries()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testODPChartSeries)
{
//test chart series names for odp
- uno::Sequence < OUString > seriesList = getImpressChartColumnDescriptions(u"/chart2/qa/extras/data/odp/", "chart.odp");
- CPPUNIT_ASSERT_EQUAL(OUString("Column 1"), seriesList[0]);
- CPPUNIT_ASSERT_EQUAL(OUString("Column 2"), seriesList[1]);
- CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), seriesList[2]);
+ loadFromFile(u"odp/chart.odp");
+ uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromDrawImpress( 0, 0 );
+ uno::Reference< chart::XChartDataArray > xChartData ( xChartDoc->getData(), uno::UNO_QUERY_THROW);
+ uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL(u"Column 1"_ustr, seriesList[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Column 2"_ustr, seriesList[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Column 3"_ustr, seriesList[2]);
}
-void Chart2ImportTest::testBnc864396()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc864396)
{
- uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromImpress(u"/chart2/qa/extras/data/pptx/", "bnc864396.pptx"), uno::UNO_QUERY_THROW);
+ 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 );
@@ -760,78 +619,114 @@ void Chart2ImportTest::testBnc864396()
}
}
-void Chart2ImportTest::testBnc889755()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc889755)
{
- load(u"/chart2/qa/extras/data/pptx/", "bnc889755.pptx");
+ loadFromFile(u"pptx/bnc889755.pptx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 5), uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider());
constexpr sal_Int32 nNumCategories = 16;
- Sequence<OUString> aDateSeq = getFormattedDateCategories(xChartDoc);
+
+ Reference<util::XNumberFormatsSupplier> 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<chart2::XAxis> xAxisX = getAxisFromDoc(xChartDoc, 0, 0, 0);
+ chart2::ScaleData aScaleData = xAxisX->getScaleData();
+ CPPUNIT_ASSERT_EQUAL(chart2::AxisType::DATE, aScaleData.AxisType);
+
+ sal_Int32 nNumFmt = getNumberFormatFromAxis(xAxisX);
+
+ 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());
+ Sequence<double> aDateSeq = xDateCategories->getDateCategories();
+ Sequence<OUString> aFormattedDates(nNumCategories);
+ auto aFormattedDatesRange = asNonConstRange(aFormattedDates);
+
+ for (sal_Int32 nIdx = 0; nIdx < nNumCategories; ++nIdx)
+ aFormattedDatesRange[nIdx] = xNumFormatter->convertNumberToString(nNumFmt, aDateSeq[nIdx]);
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",
+ u"Oct-12"_ustr, u"Nov-12"_ustr, u"Dec-12"_ustr, u"Jan-13"_ustr,
+ u"Feb-13"_ustr, u"Mar-13"_ustr, u"Apr-13"_ustr, u"May-13"_ustr,
+ u"Jun-13"_ustr, u"Jul-13"_ustr, u"Aug-13"_ustr, u"Sep-13"_ustr,
+ u"Oct-13"_ustr, u"Nov-13"_ustr, u"Dec-13"_ustr, u"Jan-14"_ustr,
};
for (size_t nIdx = 0; nIdx < nNumCategories; ++nIdx)
- CPPUNIT_ASSERT_EQUAL(aExpectedDateCategories[nIdx], aDateSeq[nIdx]);
+ CPPUNIT_ASSERT_EQUAL(aExpectedDateCategories[nIdx], aFormattedDates[nIdx]);
//tdf#139940 - the title's gradient was lost and was filled with solid blue, instead of a "blue underline".
uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY_THROW);
uno::Reference<drawing::XDrawPage> 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<beans::XPropertySet> xShapeProps(xPage->getByIndex(4), uno::UNO_QUERY_THROW);
- awt::Gradient aTransparence;
- xShapeProps->getPropertyValue("FillTransparenceGradient") >>= aTransparence;
- CPPUNIT_ASSERT(aTransparence.StartColor != aTransparence.EndColor);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), aTransparence.StartColor);
+ awt::Gradient2 aTransparence;
+ xShapeProps->getPropertyValue(u"FillTransparenceGradient"_ustr) >>= aTransparence;
+ const basegfx::BColorStops aColorStops = model::gradient::getColorStopsFromUno(aTransparence.ColorStops);
+
+ CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size());
+ CPPUNIT_ASSERT_EQUAL(0.0, aColorStops[0].getStopOffset());
+ 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(COL_WHITE, Color(aColorStops[2].getStopColor()));
}
-void Chart2ImportTest::testBnc882383()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc882383)
{
- load(u"/chart2/qa/extras/data/pptx/", "bnc882383.pptx");
+ loadFromFile(u"pptx/bnc882383.pptx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY_THROW);
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
OUString sGradientName;
- xPropertySet->getPropertyValue("GradientName") >>= sGradientName;
+ xPropertySet->getPropertyValue(u"GradientName"_ustr) >>= sGradientName;
CPPUNIT_ASSERT(!sGradientName.isEmpty());
}
-void Chart2ImportTest::testTransparencyGradientValue()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTransparencyGradientValue)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf128732.xlsx");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/tdf128732.xlsx");
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
OUString sTranspGradientName;
- xPropertySet->getPropertyValue("FillTransparenceGradientName") >>= sTranspGradientName;
+ xPropertySet->getPropertyValue(u"FillTransparenceGradientName"_ustr) >>= sTranspGradientName;
CPPUNIT_ASSERT(!sTranspGradientName.isEmpty());
- awt::Gradient aTransparenceGradient;
+ 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::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance(u"com.sun.star.drawing.TransparencyGradientTable"_ustr), uno::UNO_QUERY);
uno::Any rTransparenceValue = xTransparenceGradient->getByName(sTranspGradientName);
CPPUNIT_ASSERT(rTransparenceValue >>= aTransparenceGradient);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(3355443), aTransparenceGradient.EndColor);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(5000268), aTransparenceGradient.StartColor);
+ 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_EQUAL(0.0, aColorStops[0].getStopOffset());
+ 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()));
}
-void Chart2ImportTest::testSimpleStrictXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSimpleStrictXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "strict_chart.xlsx");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ loadFromFile(u"xlsx/strict_chart.xlsx");
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
@@ -839,21 +734,22 @@ void Chart2ImportTest::testSimpleStrictXLSX()
}
-void Chart2ImportTest::testDelayedCellImport()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDelayedCellImport)
{
- load(u"/chart2/qa/extras/data/xlsx/", "fdo70609.xlsx");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ // chart range referencing content on later sheets
+ loadFromFile(u"xlsx/fdo70609.xlsx");
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0);
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_ASSERT_EQUAL(u"$Sheet2.$C$5:$C$9"_ustr, aRange);
}
-void Chart2ImportTest::testFlatODSStackedColumnChart()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFlatODSStackedColumnChart)
{
- load(u"/chart2/qa/extras/data/fods/", "stacked-column-chart.fods");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"fods/stacked-column-chart.fods");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XChartType> xChartType = getChartTypeFromDoc(xChartDoc, 0);
@@ -867,10 +763,10 @@ void Chart2ImportTest::testFlatODSStackedColumnChart()
CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aSeriesSeq.getLength());
}
-void Chart2ImportTest::testFdo78080()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo78080)
{
- load(u"/chart2/qa/extras/data/xlsx/", "fdo78080.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/fdo78080.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
@@ -878,9 +774,9 @@ void Chart2ImportTest::testFdo78080()
CPPUNIT_ASSERT(!xTitle.is());
}
-void Chart2ImportTest::testTdf127811()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf127811)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf127811.pptx");
+ loadFromFile(u"pptx/tdf127811.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -893,14 +789,15 @@ void Chart2ImportTest::testTdf127811()
// 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<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("2. second"), aLabels[1][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"1. first"_ustr, aLabels[0][0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"2. second"_ustr, aLabels[1][0].get<OUString>());
}
-void Chart2ImportTest::testTdf86624()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf86624)
{
- load(u"/chart2/qa/extras/data/ods/", "tdf86624.ods");
- uno::Reference< chart2::XChartDocument > xChart2Doc = getChartDocFromSheet(0, mxComponent);
+ // manually placed legends
+ loadFromFile(u"ods/tdf86624.ods");
+ uno::Reference< chart2::XChartDocument > xChart2Doc = getChartDocFromSheet(0);
uno::Reference< chart::XChartDocument > xChartDoc (xChart2Doc, uno::UNO_QUERY);
uno::Reference<drawing::XShape> xLegend = xChartDoc->getLegend();
awt::Point aPos = xLegend->getPosition();
@@ -908,9 +805,9 @@ void Chart2ImportTest::testTdf86624()
CPPUNIT_ASSERT(aPos.Y > 4000); // real value for ms is above 7000
}
-void Chart2ImportTest::testTdf105517()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf105517)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf105517.pptx");
+ loadFromFile(u"pptx/tdf105517.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -924,21 +821,21 @@ void Chart2ImportTest::testTdf105517()
CPPUNIT_ASSERT(xPropSet1.is());
tools::Long lineColor;
- xPropSet1->getPropertyValue("Color") >>= lineColor;
+ xPropSet1->getPropertyValue(u"Color"_ustr) >>= lineColor;
// incorrect line color was 0x4a7ebb due to not handling themeOverride
CPPUNIT_ASSERT_EQUAL(tools::Long(0xeaa700), lineColor);
Reference<beans::XPropertySet> xPropSet2(xDSContainer->getDataSeries()[1], uno::UNO_QUERY);
CPPUNIT_ASSERT(xPropSet2.is());
- xPropSet2->getPropertyValue("Color") >>= lineColor;
+ xPropSet2->getPropertyValue(u"Color"_ustr) >>= lineColor;
// incorrect line color was 0x98b855
CPPUNIT_ASSERT_EQUAL(tools::Long(0x1e69a8), lineColor);
}
-void Chart2ImportTest::testTdf106217()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf106217)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf106217.pptx");
+ loadFromFile(u"pptx/tdf106217.pptx");
uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromDrawImpress(0, 0);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -948,7 +845,7 @@ void Chart2ImportTest::testTdf106217()
CPPUNIT_ASSERT(xCircle.is());
uno::Reference<container::XNamed> xNamedShape(xCircle, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("Oval 1"), xNamedShape->getName());
+ CPPUNIT_ASSERT_EQUAL(u"Oval 1"_ustr, xNamedShape->getName());
awt::Point aPosition = xCircle->getPosition();
CPPUNIT_ASSERT_EQUAL(sal_Int32(6870), aPosition.X);
@@ -958,38 +855,38 @@ void Chart2ImportTest::testTdf106217()
CPPUNIT_ASSERT_EQUAL(sal_Int32(2700), aSize.Height);
}
-void Chart2ImportTest::testTdf108021()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf108021)
{
// Tdf108021 : To check TextBreak value is true.
- load(u"/chart2/qa/extras/data/ods/", "tdf108021.ods");
+ 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, mxComponent ), UNO_QUERY_THROW);
+ uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0), 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;
+ xAxisProp->getPropertyValue(u"TextBreak"_ustr) >>= bTextBreak;
// Expected value of 'TextBreak' is true
CPPUNIT_ASSERT(bTextBreak);
}
-void Chart2ImportTest::testTdf100084()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf100084)
{
// The test file was created with IBM Cognos, make sure there is a diagram.
- load(u"/chart2/qa/extras/data/xlsx/", "tdf100084.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/tdf100084.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<beans::XPropertySet> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY);
CPPUNIT_ASSERT_MESSAGE("There should be a Diagram.", xDiagram.is());
}
-void Chart2ImportTest::testTdf124817()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf124817)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf124817.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/tdf124817.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
uno::Reference<chart2::XDataSeries> xDataSeries;
@@ -999,28 +896,28 @@ void Chart2ImportTest::testTdf124817()
xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xDataSeries.is());
uno::Reference<beans::XPropertySet> xPropSet_0(xDataSeries, uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT((xPropSet_0->getPropertyValue("Symbol") >>= aSymblProp));
+ CPPUNIT_ASSERT((xPropSet_0->getPropertyValue(u"Symbol"_ustr) >>= 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<beans::XPropertySet> xPropSet_1(xDataSeries, uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT((xPropSet_1->getPropertyValue("Symbol") >>= aSymblProp));
+ CPPUNIT_ASSERT((xPropSet_1->getPropertyValue(u"Symbol"_ustr) >>= aSymblProp));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xED7D31), aSymblProp.FillColor);
// Check the symbol of data series 3 (marker style diagonal cross)
xDataSeries = getDataSeriesFromDoc(xChartDoc, 2);
CPPUNIT_ASSERT(xDataSeries.is());
uno::Reference<beans::XPropertySet> xPropSet_2(xDataSeries, uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT((xPropSet_2->getPropertyValue("Symbol") >>= aSymblProp));
+ CPPUNIT_ASSERT((xPropSet_2->getPropertyValue(u"Symbol"_ustr) >>= aSymblProp));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xFF0000), aSymblProp.BorderColor);
}
-void Chart2ImportTest::testTdf126033()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf126033)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf126033.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/tdf126033.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
// Check symbol style and size of data points
@@ -1028,16 +925,16 @@ void Chart2ImportTest::testTdf126033()
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Symbol") >>= aSymblProp);
+ CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymblProp);
CPPUNIT_ASSERT_EQUAL(chart2::SymbolStyle_NONE, aSymblProp.Style);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(176), aSymblProp.Size.Width);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(176), aSymblProp.Size.Height);
}
-void Chart2ImportTest::testTransparentBackground(OUString const & filename)
+void Chart2ImportTest::testTransparentBackground(std::u16string_view filename)
{
- load(u"/chart2/qa/extras/data/xlsx/", filename);
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(filename);
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
uno::Reference< chart::XChartDocument > xChart2Doc (xChartDoc, uno::UNO_QUERY);
@@ -1047,49 +944,50 @@ void Chart2ImportTest::testTransparentBackground(OUString const & filename)
CPPUNIT_ASSERT_MESSAGE("failed to get Area", xPropSet.is());
css::drawing::FillStyle aStyle;
- xPropSet -> getPropertyValue("FillStyle") >>= aStyle;
+ xPropSet -> getPropertyValue(u"FillStyle"_ustr) >>= 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
-void Chart2ImportTest::testFdo54361()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo54361)
{
- testTransparentBackground("fdo54361.xlsx");
+ testTransparentBackground(u"xlsx/fdo54361.xlsx");
}
-void Chart2ImportTest::testFdo54361_1()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo54361_1)
{
- testTransparentBackground("fdo54361-1.xlsx");
+ testTransparentBackground(u"xlsx/fdo54361-1.xlsx");
}
-void Chart2ImportTest::testAutoBackgroundXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoBackgroundXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "chart-auto-background.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/chart-auto-background.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
// "Automatic" chart background fill in xlsx should be loaded as solid white.
Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
CPPUNIT_ASSERT(xPropSet.is());
- drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>();
- sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get<sal_Int32>();
+ drawing::FillStyle eStyle = xPropSet->getPropertyValue(u"FillStyle"_ustr).get<drawing::FillStyle>();
+ sal_Int32 nColor = xPropSet->getPropertyValue(u"FillColor"_ustr).get<sal_Int32>();
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.
}
-void Chart2ImportTest::testAutoChartAreaBorderPropXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoChartAreaBorderPropXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "chart-area-style-border.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/chart-area-style-border.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
// Test "Automatic" chartarea border style/color/width.
Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
CPPUNIT_ASSERT(xPropSet.is());
- drawing::LineStyle eStyle = xPropSet->getPropertyValue("LineStyle").get<drawing::LineStyle>();
- sal_Int32 nColor = xPropSet->getPropertyValue("LineColor").get<sal_Int32>();
- sal_Int32 nWidth = xPropSet->getPropertyValue("LineWidth").get<sal_Int32>();
+ drawing::LineStyle eStyle = xPropSet->getPropertyValue(u"LineStyle"_ustr).get<drawing::LineStyle>();
+ sal_Int32 nColor = xPropSet->getPropertyValue(u"LineColor"_ustr).get<sal_Int32>();
+ sal_Int32 nWidth = xPropSet->getPropertyValue(u"LineWidth"_ustr).get<sal_Int32>();
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.",
@@ -1098,44 +996,58 @@ void Chart2ImportTest::testAutoChartAreaBorderPropXLSX()
sal_Int32(26), nWidth);
}
-void Chart2ImportTest::testChartAreaStyleBackgroundXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoChartAreaBorderPropPPTX)
+{
+ loadFromFile(u"pptx/tdf150176.pptx");
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+ // Test "Automatic" chartarea border style/color/width.
+ Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
+ CPPUNIT_ASSERT(xPropSet.is());
+ drawing::LineStyle eStyle = xPropSet->getPropertyValue(u"LineStyle"_ustr).get<drawing::LineStyle>();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chartarea border should be loaded as none style for pptx.",
+ drawing::LineStyle_NONE, eStyle);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testChartAreaStyleBackgroundXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "chart-area-style-background.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/chart-area-style-background.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
// "Automatic" chart background fill in xlsx should be loaded as solid white.
Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
CPPUNIT_ASSERT(xPropSet.is());
- drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>();
- sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get<sal_Int32>();
+ drawing::FillStyle eStyle = xPropSet->getPropertyValue(u"FillStyle"_ustr).get<drawing::FillStyle>();
+ sal_Int32 nColor = xPropSet->getPropertyValue(u"FillColor"_ustr).get<sal_Int32>();
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);
}
-void Chart2ImportTest::testChartHatchFillXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testChartHatchFillXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "chart-hatch-fill.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/chart-hatch-fill.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
// Check the chart background FillStyle is HATCH
Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
CPPUNIT_ASSERT(xPropSet.is());
- drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>();
+ drawing::FillStyle eStyle = xPropSet->getPropertyValue(u"FillStyle"_ustr).get<drawing::FillStyle>();
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;
+ xPropSet->getPropertyValue(u"FillBackground"_ustr) >>= bBackgroundFill;
CPPUNIT_ASSERT(bBackgroundFill);
Color nBackgroundColor;
- xPropSet->getPropertyValue("FillColor") >>= nBackgroundColor;
+ xPropSet->getPropertyValue(u"FillColor"_ustr) >>= nBackgroundColor;
CPPUNIT_ASSERT_EQUAL(COL_WHITE, nBackgroundColor);
// Check the datapoint has HatchName value
@@ -1144,23 +1056,23 @@ void Chart2ImportTest::testChartHatchFillXLSX()
uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW);
OUString sHatchName;
- xPropertySet->getPropertyValue("HatchName") >>= sHatchName;
+ xPropertySet->getPropertyValue(u"HatchName"_ustr) >>= sHatchName;
CPPUNIT_ASSERT(!sHatchName.isEmpty());
// Check the FillBackground of datapoint
bool bBackgroundFillofDatapoint = false;
- xPropertySet->getPropertyValue("FillBackground") >>= bBackgroundFillofDatapoint;
+ xPropertySet->getPropertyValue(u"FillBackground"_ustr) >>= bBackgroundFillofDatapoint;
CPPUNIT_ASSERT(bBackgroundFillofDatapoint);
sal_Int32 nBackgroundColorofDatapoint;
- xPropertySet->getPropertyValue("FillColor") >>= nBackgroundColorofDatapoint;
+ xPropertySet->getPropertyValue(u"FillColor"_ustr) >>= nBackgroundColorofDatapoint;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00B050), nBackgroundColorofDatapoint);
}
-void Chart2ImportTest::testAxisTextRotationXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAxisTextRotationXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "axis-label-rotation.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/axis-label-rotation.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XAxis> xYAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
@@ -1168,55 +1080,52 @@ void Chart2ImportTest::testAxisTextRotationXLSX()
Reference<beans::XPropertySet> xPS(xYAxis, uno::UNO_QUERY_THROW);
double nRotation = 0;
- bool bSuccess = xPS->getPropertyValue("TextRotation") >>= nRotation;
+ bool bSuccess = xPS->getPropertyValue(u"TextRotation"_ustr) >>= nRotation;
CPPUNIT_ASSERT(bSuccess);
CPPUNIT_ASSERT_DOUBLES_EQUAL(90, nRotation, 1e-10);
}
-/* TODO : temporarily disabled.
-void Chart2ImportTest::testTextCanOverlapXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTextCanOverlapXLSX)
{
// fdo#84647 : To check textoverlap value is imported correctly.
- load("/chart2/qa/extras/data/xlsx/", "chart-text-can-overlap.xlsx");
+ 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, mxComponent ), UNO_QUERY_THROW);
+ uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0), 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;
- // Expected value of 'TextCanOverlap' is true
- CPPUNIT_ASSERT(bTextCanOverlap);
+ xAxisProp->getPropertyValue(u"TextCanOverlap"_ustr) >>= bTextCanOverlap;
+ CPPUNIT_ASSERT(!bTextCanOverlap);
}
-*/
-void Chart2ImportTest::testTextBreakXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTextBreakXLSX)
{
// tdf#122091: To check textbreak value is true in case of 0° degree of Axis label rotation.
- load(u"/chart2/qa/extras/data/xlsx/", "chart_label_text_break.xlsx");
+ 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, mxComponent ), UNO_QUERY_THROW);
+ uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0), 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;
+ xAxisProp->getPropertyValue(u"TextBreak"_ustr) >>= textBreak;
// Expected value of 'TextBreak' is true
CPPUNIT_ASSERT(textBreak);
}
-void Chart2ImportTest::testNumberFormatsXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testNumberFormatsXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "number-formats.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/number-formats.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
@@ -1226,48 +1135,48 @@ void Chart2ImportTest::testNumberFormatsXLSX()
sal_Int32 nNumberFormat;
bool bLinkNumberFormatToSource = false;
const sal_Int32 nChartDataNumberFormat = getNumberFormat(
- xChartDoc, "_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"??_);_(@_)");
+ xChartDoc, u"_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"??_);_(@_)"_ustr);
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("Label") >>= aLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= 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;
+ bool bSuccess = xPropertySet->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= 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;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= 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;
+ bSuccess = xPropertySet->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= 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;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= 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;
+ bSuccess = xPropertySet->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= 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);
}
-void Chart2ImportTest::testNumberFormatsDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testNumberFormatsDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf132174.docx");
+ loadFromFile(u"docx/tdf132174.docx");
{
uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1279,7 +1188,7 @@ void Chart2ImportTest::testNumberFormatsDOCX()
sal_Int32 nNumberFormat;
bool bLinkNumberFormatToSource = true;
- const sal_Int32 nChartDataNumberFormat = getNumberFormat(xChartDoc, "0%");
+ const sal_Int32 nChartDataNumberFormat = getNumberFormat(xChartDoc, u"0%"_ustr);
xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat;
CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat);
xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource;
@@ -1288,7 +1197,7 @@ void Chart2ImportTest::testNumberFormatsDOCX()
CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", !bLinkNumberFormatToSource);
}
- load(u"/chart2/qa/extras/data/docx/", "tdf136650.docx");
+ loadFromFile(u"docx/tdf136650.docx");
{
uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1300,7 +1209,7 @@ void Chart2ImportTest::testNumberFormatsDOCX()
sal_Int32 nNumberFormat;
bool bLinkNumberFormatToSource = true;
- const sal_Int32 nChartDataNumberFormat = getNumberFormat(xChartDoc, "0%");
+ const sal_Int32 nChartDataNumberFormat = getNumberFormat(xChartDoc, u"0%"_ustr);
xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat;
CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat);
xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource;
@@ -1310,9 +1219,40 @@ void Chart2ImportTest::testNumberFormatsDOCX()
}
}
-void Chart2ImportTest::testPercentageNumberFormatsDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testShapePropsDefaultStrokeWidthXLSX)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf133632.docx");
+ // Bar chart, for which rendering code is implemented
+ loadFromFile(u"xlsx/bartest-stroke.xlsx");
+ {
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ css::uno::Reference<chart2::XDiagram> xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW);
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xPropertySet.is());
+ sal_Int32 nWidth = xPropertySet->getPropertyValue(u"BorderWidth"_ustr).get<sal_Int32>();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Default bar stroke width should be 12700 emu (0.35mm)", sal_Int32(35), nWidth);
+ }
+
+ // Funnel chart, for which rendering code is not yet implemented
+ loadFromFile(u"xlsx/color_funnel.xlsx");
+ {
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ css::uno::Reference<chart2::XDiagram> xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW);
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xPropertySet.is());
+ sal_Int32 nWidth = xPropertySet->getPropertyValue(u"BorderWidth"_ustr).get<sal_Int32>();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Default bar stroke width should be 12700 emu (0.35mm)", sal_Int32(35), nWidth);
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPercentageNumberFormatsDOCX)
+{
+ loadFromFile(u"docx/tdf133632.docx");
uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1323,7 +1263,7 @@ void Chart2ImportTest::testPercentageNumberFormatsDOCX()
bool bLinkNumberFormatToSource = false;
chart2::DataPointLabel aLabel;
- xPropertySet->getPropertyValue("Label") >>= aLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= 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;
@@ -1331,10 +1271,12 @@ void Chart2ImportTest::testPercentageNumberFormatsDOCX()
CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bLinkNumberFormatToSource);
}
-void Chart2ImportTest::testAutoTitleDelDefaultValue2007XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoTitleDelDefaultValue2007XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "autotitledel_2007.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ // 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<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
@@ -1343,10 +1285,10 @@ void Chart2ImportTest::testAutoTitleDelDefaultValue2007XLSX()
!aTitle.isEmpty());
}
-void Chart2ImportTest::testAutoTitleDelDefaultValue2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAutoTitleDelDefaultValue2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "autotitledel_2013.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/autotitledel_2013.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
@@ -1355,38 +1297,38 @@ void Chart2ImportTest::testAutoTitleDelDefaultValue2013XLSX()
!xTitle.is());
}
-void Chart2ImportTest::testDispBlanksAsDefaultValue2007XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDispBlanksAsDefaultValue2007XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "dispBlanksAs_2007.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/dispBlanksAs_2007.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<beans::XPropertySet> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY);
CPPUNIT_ASSERT(xDiagram.is());
- uno::Any aAny = xDiagram->getPropertyValue("MissingValueTreatment");
+ uno::Any aAny = xDiagram->getPropertyValue(u"MissingValueTreatment"_ustr);
sal_Int32 nMissingValueTreatment = -2;
CPPUNIT_ASSERT(aAny >>= nMissingValueTreatment);
CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::LEAVE_GAP, nMissingValueTreatment);
}
-void Chart2ImportTest::testDispBlanksAsDefaultValue2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testDispBlanksAsDefaultValue2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "dispBlanksAs_2013.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/dispBlanksAs_2013.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<beans::XPropertySet> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY);
CPPUNIT_ASSERT(xDiagram.is());
- uno::Any aAny = xDiagram->getPropertyValue("MissingValueTreatment");
+ uno::Any aAny = xDiagram->getPropertyValue(u"MissingValueTreatment"_ustr);
sal_Int32 nMissingValueTreatment = -2;
CPPUNIT_ASSERT(aAny >>= nMissingValueTreatment);
CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::USE_ZERO, nMissingValueTreatment);
}
-void Chart2ImportTest::testSmoothDefaultValue2007XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSmoothDefaultValue2007XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "smoothed_series2007.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/smoothed_series2007.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1397,14 +1339,14 @@ void Chart2ImportTest::testSmoothDefaultValue2007XLSX()
CPPUNIT_ASSERT(xPropSet.is());
chart2::CurveStyle eCurveStyle;
- xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle;
+ xPropSet->getPropertyValue(u"CurveStyle"_ustr) >>= eCurveStyle;
CPPUNIT_ASSERT_EQUAL(chart2::CurveStyle_LINES, eCurveStyle);
}
-void Chart2ImportTest::testSmoothDefaultValue2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSmoothDefaultValue2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "smoothed_series.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/smoothed_series.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1415,14 +1357,14 @@ void Chart2ImportTest::testSmoothDefaultValue2013XLSX()
CPPUNIT_ASSERT(xPropSet.is());
chart2::CurveStyle eCurveStyle;
- xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle;
+ xPropSet->getPropertyValue(u"CurveStyle"_ustr) >>= eCurveStyle;
CPPUNIT_ASSERT(eCurveStyle != chart2::CurveStyle_LINES);
}
-void Chart2ImportTest::testTrendlineDefaultValue2007XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTrendlineDefaultValue2007XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "trendline2007.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/trendline2007.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
@@ -1434,21 +1376,21 @@ void Chart2ImportTest::testTrendlineDefaultValue2007XLSX()
Reference<chart2::XRegressionCurve> xCurve = xRegressionCurveSequence[0];
Reference<beans::XPropertySet> xPropSet(xCurve->getEquationProperties(), uno::UNO_SET_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("ShowEquation");
+ uno::Any aAny = xPropSet->getPropertyValue(u"ShowEquation"_ustr);
bool bShowEquation = true;
CPPUNIT_ASSERT(aAny >>= bShowEquation);
CPPUNIT_ASSERT(!bShowEquation);
- aAny = xPropSet->getPropertyValue("ShowCorrelationCoefficient");
+ aAny = xPropSet->getPropertyValue(u"ShowCorrelationCoefficient"_ustr);
bool bShowCorrelation = true;
CPPUNIT_ASSERT(aAny >>= bShowCorrelation);
CPPUNIT_ASSERT(!bShowCorrelation);
}
-void Chart2ImportTest::testTrendlineDefaultValue2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTrendlineDefaultValue2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "trendline.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/trendline.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
@@ -1460,105 +1402,105 @@ void Chart2ImportTest::testTrendlineDefaultValue2013XLSX()
Reference<chart2::XRegressionCurve> xCurve = xRegressionCurveSequence[0];
Reference<beans::XPropertySet> xPropSet(xCurve->getEquationProperties(), uno::UNO_SET_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("ShowEquation");
+ uno::Any aAny = xPropSet->getPropertyValue(u"ShowEquation"_ustr);
bool bShowEquation = false;
CPPUNIT_ASSERT(aAny >>= bShowEquation);
CPPUNIT_ASSERT(bShowEquation);
- aAny = xPropSet->getPropertyValue("ShowCorrelationCoefficient");
+ aAny = xPropSet->getPropertyValue(u"ShowCorrelationCoefficient"_ustr);
bool bShowCorrelation = false;
CPPUNIT_ASSERT(aAny >>= bShowCorrelation);
CPPUNIT_ASSERT(bShowCorrelation);
}
-void Chart2ImportTest::testVaryColorDefaultValues2007XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testVaryColorDefaultValues2007XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "vary_color2007.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/vary_color2007.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint");
+ uno::Any aAny = xPropSet->getPropertyValue(u"VaryColorsByPoint"_ustr);
bool bVaryColor = true;
CPPUNIT_ASSERT(aAny >>= bVaryColor);
CPPUNIT_ASSERT(!bVaryColor);
}
-void Chart2ImportTest::testVaryColorDefaultValues2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testVaryColorDefaultValues2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "vary_color.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/vary_color.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint");
+ uno::Any aAny = xPropSet->getPropertyValue(u"VaryColorsByPoint"_ustr);
bool bVaryColor = false;
CPPUNIT_ASSERT(aAny >>= bVaryColor);
CPPUNIT_ASSERT(!bVaryColor);
}
-void Chart2ImportTest::testPlotVisOnlyDefaultValue2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPlotVisOnlyDefaultValue2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "plotVisOnly.xlsx");
- uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/plotVisOnly.xlsx");
+ uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0), UNO_QUERY_THROW);
Reference<beans::XPropertySet> xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("IncludeHiddenCells");
+ uno::Any aAny = xPropSet->getPropertyValue(u"IncludeHiddenCells"_ustr);
CPPUNIT_ASSERT(aAny.hasValue());
bool bShowHiddenValues = true;
CPPUNIT_ASSERT(aAny >>= bShowHiddenValues);
CPPUNIT_ASSERT(!bShowHiddenValues);
}
-void Chart2ImportTest::testRAngAxDefaultValue2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testRAngAxDefaultValue2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "rAngAx.xlsx");
- uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/rAngAx.xlsx");
+ uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0), UNO_QUERY_THROW);
Reference<beans::XPropertySet> xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("RightAngledAxes");
+ uno::Any aAny = xPropSet->getPropertyValue(u"RightAngledAxes"_ustr);
CPPUNIT_ASSERT(aAny.hasValue());
bool bRightAngleAxes = false;
CPPUNIT_ASSERT(aAny >>= bRightAngleAxes);
CPPUNIT_ASSERT(bRightAngleAxes);
}
-void Chart2ImportTest::testMajorTickMarksDefaultValue2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testMajorTickMarksDefaultValue2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "majorTickMark.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/majorTickMark.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XAxis> xXAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
CPPUNIT_ASSERT(xXAxis.is());
Reference<beans::XPropertySet> xPropSet(xXAxis, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("MajorTickmarks");
+ uno::Any aAny = xPropSet->getPropertyValue(u"MajorTickmarks"_ustr);
sal_Int32 nMajorTickmarks = chart2::TickmarkStyle::NONE;
CPPUNIT_ASSERT(aAny.hasValue());
CPPUNIT_ASSERT(aAny >>= nMajorTickmarks);
CPPUNIT_ASSERT_EQUAL(chart2::TickmarkStyle::INNER | chart2::TickmarkStyle::OUTER, nMajorTickmarks);
}
-void Chart2ImportTest::testMinorTickMarksDefaultValue2013XLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testMinorTickMarksDefaultValue2013XLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "minorTickMark.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/minorTickMark.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XAxis> xXAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
CPPUNIT_ASSERT(xXAxis.is());
Reference<beans::XPropertySet> xPropSet(xXAxis, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("MinorTickmarks");
+ uno::Any aAny = xPropSet->getPropertyValue(u"MinorTickmarks"_ustr);
sal_Int32 nMajorTickmarks = chart2::TickmarkStyle::NONE;
CPPUNIT_ASSERT(aAny.hasValue());
CPPUNIT_ASSERT(aAny >>= nMajorTickmarks);
CPPUNIT_ASSERT_EQUAL(chart2::TickmarkStyle::INNER | chart2::TickmarkStyle::OUTER, nMajorTickmarks);
}
-void Chart2ImportTest::testAxisTitleDefaultRotationXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAxisTitleDefaultRotationXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "axis_title_default_rotation.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/axis_title_default_rotation.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XAxis> xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0);
CPPUNIT_ASSERT(xYAxis.is());
@@ -1566,16 +1508,16 @@ void Chart2ImportTest::testAxisTitleDefaultRotationXLSX()
Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
CPPUNIT_ASSERT(xTitle.is());
Reference<beans::XPropertySet> xPropSet(xTitle, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("TextRotation");
+ uno::Any aAny = xPropSet->getPropertyValue(u"TextRotation"_ustr);
double nRotation = 0;
CPPUNIT_ASSERT(aAny >>= nRotation);
CPPUNIT_ASSERT_EQUAL(90.0, nRotation);
}
-void Chart2ImportTest::testSecondaryAxisTitleDefaultRotationXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSecondaryAxisTitleDefaultRotationXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "secondary_axis_title_default_rotation.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/secondary_axis_title_default_rotation.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XAxis> xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 1);
CPPUNIT_ASSERT(xYAxis.is());
@@ -1583,16 +1525,16 @@ void Chart2ImportTest::testSecondaryAxisTitleDefaultRotationXLSX()
Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
CPPUNIT_ASSERT(xTitle.is());
Reference<beans::XPropertySet> xPropSet(xTitle, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("TextRotation");
+ uno::Any aAny = xPropSet->getPropertyValue(u"TextRotation"_ustr);
double nRotation = 0;
CPPUNIT_ASSERT(aAny >>= nRotation);
CPPUNIT_ASSERT_EQUAL(90.0, nRotation);
}
-void Chart2ImportTest::testAxisTitleRotationXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAxisTitleRotationXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "axis_title_rotated.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/axis_title_rotated.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
{
Reference<chart2::XAxis> xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0);
@@ -1601,7 +1543,7 @@ void Chart2ImportTest::testAxisTitleRotationXLSX()
Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
CPPUNIT_ASSERT(xTitle.is());
Reference<beans::XPropertySet> xPropSet(xTitle, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("TextRotation");
+ uno::Any aAny = xPropSet->getPropertyValue(u"TextRotation"_ustr);
double nRotation = 0;
CPPUNIT_ASSERT(aAny >>= nRotation);
CPPUNIT_ASSERT_EQUAL(340.0, nRotation);
@@ -1613,7 +1555,7 @@ void Chart2ImportTest::testAxisTitleRotationXLSX()
Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
CPPUNIT_ASSERT(xTitle.is());
Reference<beans::XPropertySet> xPropSet(xTitle, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("TextRotation");
+ uno::Any aAny = xPropSet->getPropertyValue(u"TextRotation"_ustr);
double nRotation = 0;
CPPUNIT_ASSERT(aAny >>= nRotation);
CPPUNIT_ASSERT_EQUAL(270.0, nRotation);
@@ -1621,9 +1563,9 @@ void Chart2ImportTest::testAxisTitleRotationXLSX()
}
-void Chart2ImportTest::testAxisTitlePositionDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testAxisTitlePositionDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "testAxisTitlePosition.docx");
+ loadFromFile(u"docx/testAxisTitlePosition.docx");
uno::Reference< chart::XDiagram > mxDiagram;
uno::Reference< drawing::XShape > xAxisTitle;
uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromWriter(0);
@@ -1653,10 +1595,10 @@ void Chart2ImportTest::testAxisTitlePositionDOCX()
CPPUNIT_ASSERT_DOUBLES_EQUAL(6378, aPos.Y, 300);
}
-void Chart2ImportTest::testCombinedChartAttachedAxisXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testCombinedChartAttachedAxisXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "testCombinedChartAxis.xlsx");
- Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/testCombinedChartAxis.xlsx");
+ Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
// First series
Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xSeries.is());
@@ -1664,7 +1606,7 @@ void Chart2ImportTest::testCombinedChartAttachedAxisXLSX()
Reference<beans::XPropertySet> 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");
+ uno::Any aAny = xPropSet->getPropertyValue(u"AttachedAxisIndex"_ustr);
CPPUNIT_ASSERT(aAny >>= nAxisIndex);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nAxisIndex);
@@ -1674,22 +1616,22 @@ void Chart2ImportTest::testCombinedChartAttachedAxisXLSX()
xPropSet.set(xSeries, uno::UNO_QUERY_THROW);
// Second series (line chart) should be attached to primary axis!
- aAny = xPropSet->getPropertyValue("AttachedAxisIndex");
+ aAny = xPropSet->getPropertyValue(u"AttachedAxisIndex"_ustr);
CPPUNIT_ASSERT(aAny >>= nAxisIndex);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex);
}
-void Chart2ImportTest::testTdf140489MultiSeriesChartAxisXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf140489MultiSeriesChartAxisXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf140489.xlsx");
- Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/tdf140489.xlsx");
+ Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
// First series
Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xSeries.is());
Reference<beans::XPropertySet> xPropSet(xSeries, uno::UNO_QUERY_THROW);
sal_Int32 nAxisIndex = -1;
- uno::Any aAny = xPropSet->getPropertyValue("AttachedAxisIndex");
+ uno::Any aAny = xPropSet->getPropertyValue(u"AttachedAxisIndex"_ustr);
CPPUNIT_ASSERT(aAny >>= nAxisIndex);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex);
@@ -1698,7 +1640,7 @@ void Chart2ImportTest::testTdf140489MultiSeriesChartAxisXLSX()
CPPUNIT_ASSERT(xSeries.is());
xPropSet.set(xSeries, uno::UNO_QUERY_THROW);
- aAny = xPropSet->getPropertyValue("AttachedAxisIndex");
+ aAny = xPropSet->getPropertyValue(u"AttachedAxisIndex"_ustr);
CPPUNIT_ASSERT(aAny >>= nAxisIndex);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex);
@@ -1707,17 +1649,19 @@ void Chart2ImportTest::testTdf140489MultiSeriesChartAxisXLSX()
CPPUNIT_ASSERT(xSeries.is());
xPropSet.set(xSeries, uno::UNO_QUERY_THROW);
- aAny = xPropSet->getPropertyValue("AttachedAxisIndex");
+ aAny = xPropSet->getPropertyValue(u"AttachedAxisIndex"_ustr);
CPPUNIT_ASSERT(aAny >>= nAxisIndex);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nAxisIndex);
}
-void Chart2ImportTest::testInternalDataProvider() {
- uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromImpress(u"/chart2/qa/extras/data/odp/", "chart.odp"), uno::UNO_QUERY_THROW);
- const uno::Reference< chart2::data::XDataProvider >& rxDataProvider = xChartDoc->getDataProvider();
+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 > xDataProvider = xChartDoc->getDataProvider();
// Parse 42 array
- Reference<chart2::data::XDataSequence> xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{42;42;42;42}", "");
+ Reference<chart2::data::XDataSequence> xDataSeq = xDataProvider->createDataSequenceByValueArray(u"values-y"_ustr, u"{42;42;42;42}"_ustr, u""_ustr);
Sequence<Any> xSequence = xDataSeq->getData();
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[0]);
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[1]);
@@ -1725,7 +1669,7 @@ void Chart2ImportTest::testInternalDataProvider() {
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[3]);
// Parse empty first and last
- xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{\"\";42;42;\"\"}", "");
+ xDataSeq = xDataProvider->createDataSequenceByValueArray(u"values-y"_ustr, u"{\"\";42;42;\"\"}"_ustr, u""_ustr);
xSequence = xDataSeq->getData();
CPPUNIT_ASSERT( std::isnan( *static_cast<const double*>(xSequence[0].getValue())));
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[1]);
@@ -1733,7 +1677,7 @@ void Chart2ImportTest::testInternalDataProvider() {
CPPUNIT_ASSERT( std::isnan( *static_cast<const double*>(xSequence[3].getValue())));
// Parse empty middle
- xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", "{42;\"\";\"\";42}", "");
+ xDataSeq = xDataProvider->createDataSequenceByValueArray(u"values-y"_ustr, u"{42;\"\";\"\";42}"_ustr, u""_ustr);
xSequence = xDataSeq->getData();
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[0]);
CPPUNIT_ASSERT( std::isnan( *static_cast<const double*>(xSequence[1].getValue())) );
@@ -1741,7 +1685,7 @@ void Chart2ImportTest::testInternalDataProvider() {
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\"}", "");
+ xDataSeq = xDataProvider->createDataSequenceByValueArray(u"values-y"_ustr, u"{42;\"hello\";0;\"world\"}"_ustr, u""_ustr);
xSequence = xDataSeq->getData();
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[0]);
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)), xSequence[1]);
@@ -1749,34 +1693,36 @@ void Chart2ImportTest::testInternalDataProvider() {
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)), xSequence[3]);
// Parse mixed types, mixed role
- xDataSeq = rxDataProvider->createDataSequenceByValueArray("categories", "{42;\"hello\";0;\"world\"}", "");
+ xDataSeq = xDataProvider->createDataSequenceByValueArray(u"categories"_ustr, u"{42;\"hello\";0;\"world\"}"_ustr, u""_ustr);
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_ASSERT_EQUAL(uno::Any(u"Row 1 42"_ustr), xSequence[0]);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(u"Row 2 hello"_ustr), xSequence[1]);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(u"Row 3 0"_ustr), xSequence[2]);
+ CPPUNIT_ASSERT_EQUAL(uno::Any(u"Row 4 world"_ustr), xSequence[3]);
}
-void Chart2ImportTest::testTdf90510()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf90510)
{
- load(u"/chart2/qa/extras/data/xls/", "piechart_outside.xls");
- uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW );
+ // Pie chart label placement settings(XLS)
+ loadFromFile(u"xls/piechart_outside.xls");
+ uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0), UNO_QUERY_THROW );
Reference<beans::XPropertySet> xPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_SET_THROW );
- uno::Any aAny = xPropSet->getPropertyValue( "LabelPlacement" );
+ uno::Any aAny = xPropSet->getPropertyValue( u"LabelPlacement"_ustr );
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 );
}
-void Chart2ImportTest::testTdf109858()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf109858)
{
- load(u"/chart2/qa/extras/data/xlsx/", "piechart_outside.xlsx");
- uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW );
+ // Pie chart label placement settings(XLSX)
+ loadFromFile(u"xlsx/piechart_outside.xlsx");
+ uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0), UNO_QUERY_THROW );
// test data point labels position
Reference<beans::XPropertySet> xDataPointPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_SET_THROW );
- uno::Any aAny = xDataPointPropSet->getPropertyValue( "LabelPlacement" );
+ uno::Any aAny = xDataPointPropSet->getPropertyValue( u"LabelPlacement"_ustr );
CPPUNIT_ASSERT( aAny.hasValue() );
sal_Int32 nLabelPlacement = 0;
CPPUNIT_ASSERT( aAny >>= nLabelPlacement );
@@ -1784,36 +1730,36 @@ void Chart2ImportTest::testTdf109858()
// test data series label position
Reference<beans::XPropertySet> xSeriesPropSet(xChart1Doc->getDiagram()->getDataRowProperties(0), uno::UNO_SET_THROW);
- aAny = xSeriesPropSet->getPropertyValue( "LabelPlacement" );
+ aAny = xSeriesPropSet->getPropertyValue( u"LabelPlacement"_ustr );
CPPUNIT_ASSERT( aAny >>= nLabelPlacement );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data series labels should be placed outside", chart::DataLabelPlacement::OUTSIDE, nLabelPlacement );
}
-void Chart2ImportTest::testTdf130105()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf130105)
{
- load(u"/chart2/qa/extras/data/xlsx/", "barchart_outend.xlsx");
- uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/barchart_outend.xlsx");
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- uno::Any aAny = xPropertySet->getPropertyValue("LabelPlacement");
+ uno::Any aAny = xPropertySet->getPropertyValue(u"LabelPlacement"_ustr);
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);
}
-void Chart2ImportTest::testTdf111173()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf111173)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf111173.xlsx");
- uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW );
+ loadFromFile(u"xlsx/tdf111173.xlsx");
+ uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0), UNO_QUERY_THROW );
}
-void Chart2ImportTest::testTdf122226()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf122226)
{
- load( u"/chart2/qa/extras/data/docx/", "testTdf122226.docx" );
+ loadFromFile(u"docx/testTdf122226.docx" );
uno::Reference< chart2::XChartDocument > xChartDoc ( getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT( xChartDoc.is() );
@@ -1822,16 +1768,17 @@ void Chart2ImportTest::testTdf122226()
uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
CPPUNIT_ASSERT(xPropertySet.is());
- uno::Any aAny = xPropertySet->getPropertyValue( "LabelSeparator" );
+ uno::Any aAny = xPropertySet->getPropertyValue( u"LabelSeparator"_ustr );
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_ASSERT_EQUAL_MESSAGE( "Data labels should be separated into new lines", u"\n"_ustr, nLabelSeparator );
}
-void Chart2ImportTest::testTdf115107()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf115107)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf115107.pptx");
+ // import complex data point labels
+ loadFromFile(u"pptx/tdf115107.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1846,83 +1793,84 @@ void Chart2ImportTest::testTdf115107()
// 1
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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(u"90.0 = "_ustr, aFields[0]->getString());
+ aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xed7d31), nFontColor);
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("90"), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"90"_ustr, aFields[1]->getString());
// 2
xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8), aFields.getLength());
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[0]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("Text"), aFields[0]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Text"_ustr, aFields[0]->getString());
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString(" : "), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u" : "_ustr, 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(u"B"_ustr, aFields[2]->getString());
+ aFields[2]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[2]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(16), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(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(u"Multi"_ustr, 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(u"line"_ustr, aFields[5]->getString());
+ aFields[5]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[5]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(11.97), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(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(u"Abc"_ustr, aFields[7]->getString());
+ aFields[7]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[7]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
+ aFields[7]->getPropertyValue(u"CharUnderline"_ustr) >>= nCharUnderline;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(12), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xa9d18e), nFontColor);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nCharUnderline);
// 3
xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aFields.getLength());
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[0]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("DATA"), aFields[0]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"DATA"_ustr, aFields[0]->getString());
// 4
xPropertySet.set(xDataSeries->getDataPointByIndex(3), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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(" <CELLREF"), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u" <CELLREF"_ustr, aFields[1]->getString());
}
-void Chart2ImportTest::testTdf115107_2()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf115107_2)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf115107-2.pptx");
+ // import complex data point labels in cobo charts with multiple data series
+ loadFromFile(u"pptx/tdf115107-2.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -1936,48 +1884,48 @@ void Chart2ImportTest::testTdf115107_2()
// First series
xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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(u"4.3"_ustr, aFields[0]->getString());
+ aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xc00000), nFontColor);
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString(" "), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u" "_ustr, aFields[1]->getString());
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[2]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("Bars"), aFields[2]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Bars"_ustr, 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;
+ xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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(u"2"_ustr, aFields[0]->getString());
+ aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
+ aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xffd966), nFontColor);
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString(" "), aFields[1]->getString());
+ CPPUNIT_ASSERT_EQUAL(u" "_ustr, aFields[1]->getString());
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[2]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(OUString("Line"), aFields[2]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Line"_ustr, aFields[2]->getString());
}
-void Chart2ImportTest::testTdf116163()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf116163)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf116163.pptx");
+ loadFromFile(u"pptx/tdf116163.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -2002,10 +1950,10 @@ void Chart2ImportTest::testTdf116163()
::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]);
+ CPPUNIT_ASSERT_EQUAL(u"Aaaa"_ustr, aCategories[0]);
+ CPPUNIT_ASSERT_EQUAL(u"Bbbbbbb"_ustr, aCategories[1]);
+ CPPUNIT_ASSERT_EQUAL(u"Ccc"_ustr, aCategories[2]);
+ CPPUNIT_ASSERT_EQUAL(u"Ddddddddddddd"_ustr, aCategories[3]);
// Check visible text
@@ -2014,7 +1962,7 @@ void Chart2ImportTest::testTdf116163()
uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xShapes.is());
- uno::Reference<drawing::XShape> xXAxis = getShapeByName(xShapes, "CID/D=0:CS=0:Axis=0,0",
+ uno::Reference<drawing::XShape> xXAxis = getShapeByName(xShapes, u"CID/D=0:CS=0:Axis=0,0"_ustr,
// Axis occurs twice in chart xshape representation so need to get the one related to labels
[](const uno::Reference<drawing::XShape>& rXShape) -> bool
{
@@ -2030,19 +1978,19 @@ void Chart2ImportTest::testTdf116163()
// Check text
uno::Reference<text::XTextRange> xLabel0(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("Aaaa"), xLabel0->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Aaaa"_ustr, xLabel0->getString());
uno::Reference<text::XTextRange> 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());
+ CPPUNIT_ASSERT_EQUAL(u"Bbb"_ustr, xLabel1->getString());
uno::Reference<text::XTextRange> xLabel2(xIndexAccess->getByIndex(2), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("Ccc"), xLabel2->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Ccc"_ustr, xLabel2->getString());
uno::Reference<text::XTextRange> xLabel3(xIndexAccess->getByIndex(3), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("Dddd..."), xLabel3->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Dddd..."_ustr, xLabel3->getString());
}
-void Chart2ImportTest::testTdf48041()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf48041)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf48041.pptx");
+ loadFromFile(u"pptx/tdf48041.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -2059,7 +2007,7 @@ void Chart2ImportTest::testTdf48041()
uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xShapes.is());
- uno::Reference<drawing::XShape> xYAxisShape = getShapeByName(xShapes, "CID/D=0:CS=0:Axis=1,0", // Y Axis
+ uno::Reference<drawing::XShape> xYAxisShape = getShapeByName(xShapes, u"CID/D=0:CS=0:Axis=1,0"_ustr, // Y Axis
// Axis occurs twice in chart xshape representation so need to get the one related to labels
[](const uno::Reference<drawing::XShape>& rXShape) -> bool
{
@@ -2077,22 +2025,22 @@ void Chart2ImportTest::testTdf48041()
// Check text
uno::Reference<text::XTextRange> xLabel0(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("0"), xLabel0->getString());
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, xLabel0->getString());
uno::Reference<text::XTextRange> xLabel1(xIndexAccess->getByIndex(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("1"), xLabel1->getString());
+ CPPUNIT_ASSERT_EQUAL(u"1"_ustr, xLabel1->getString());
uno::Reference<text::XTextRange> xLabel2(xIndexAccess->getByIndex(2), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("2"), xLabel2->getString());
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, xLabel2->getString());
uno::Reference<text::XTextRange> xLabel3(xIndexAccess->getByIndex(3), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("3"), xLabel3->getString());
+ CPPUNIT_ASSERT_EQUAL(u"3"_ustr, xLabel3->getString());
uno::Reference<text::XTextRange> xLabel4(xIndexAccess->getByIndex(4), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("4"), xLabel4->getString());
+ CPPUNIT_ASSERT_EQUAL(u"4"_ustr, xLabel4->getString());
uno::Reference<text::XTextRange> xLabel5(xIndexAccess->getByIndex(5), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("5"), xLabel5->getString());
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, xLabel5->getString());
}
-void Chart2ImportTest::testTdf121205()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf121205)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf121205.pptx");
+ loadFromFile(u"pptx/tdf121205.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
uno::Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
@@ -2100,11 +2048,295 @@ void Chart2ImportTest::testTdf121205()
OUString aTitle = getTitleString(xTitled);
// We expect title split in 3 lines
- CPPUNIT_ASSERT_EQUAL(OUString("Firstline\nSecondline\nThirdline"), aTitle);
+ CPPUNIT_ASSERT_EQUAL(u"Firstline\nSecondline\nThirdline"_ustr, aTitle);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf146487)
+{
+ loadFromFile(u"pptx/tdf146487.pptx");
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+ Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
+ uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
+ CPPUNIT_ASSERT_MESSAGE("chart doc should not have a title", !xTitle.is());
+
+ // tdf#146756 use manualLayout Width that was provided (so Green; $7,654,321 is not wrapped
+ if (!IsDefaultDPI())
+ return;
+ uno::Reference<chart::XChartDocument> xDoc = getChartDocFromDrawImpress(0, 0);
+ OString aXmlDump = OUStringToOString(getShapeDump(xDoc), RTL_TEXTENCODING_UTF8);
+ xmlDocUniquePtr pXmlDoc(xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr())));
+ OString aPath("//XShape[@text='Green; $7,654,321 ']"_ostr);
+ assertXPath(pXmlDoc, aPath, 1);
+ // Expected - 1 line tall(371), not 4 lines(1481).
+ assertXPath(pXmlDoc, aPath, "sizeY", u"371");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf146756)
+{
+ // 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;
+
+ // given a chart on page 2
+ loadFromFile(u"pptx/tdf146756_bestFit.pptx");
+ Reference<chart::XChartDocument> xChartDoc = getChartDocFromDrawImpress(1, 0);
+ OString aXmlDump = OUStringToOString(getShapeDump(xChartDoc), RTL_TEXTENCODING_UTF8);
+ xmlDocUniquePtr pXmlDoc(xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr())));
+ OString aPath("//XShape[@text='New service request and approval; 18%']"_ostr);
+ assertXPath(pXmlDoc, aPath, 1);
+ // Expected something like 4 lines tall(1697), not 11 lines(3817).
+ assertXPath(pXmlDoc, aPath, "sizeY", u"1697");
+ // Expected some reasonable maximum text length for the label like 2350, not 881.
+ sal_Int32 nTextLength = getXPath(pXmlDoc, aPath, "textMaximumFrameWidth").toInt32();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2350), nTextLength);
+ // MSO doesn't allow much more than 1/5 of the total chart width, so never go higher than that
+ CPPUNIT_ASSERT_LESS(sal_Int32(2370.6), nTextLength);
+}
+
+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<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference<chart2::XAxis> xHAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
+ CPPUNIT_ASSERT(xHAxis.is());
+
+ chart2::ScaleData aScaleData = xHAxis->getScaleData();
+ CPPUNIT_ASSERT(aScaleData.Categories.is());
+
+ Reference<chart2::data::XLabeledDataSequence> xLabeledDataSequence = aScaleData.Categories;
+ CPPUNIT_ASSERT(xLabeledDataSequence.is());
+
+ Reference<chart2::data::XDataSequence> xDataSequence = xLabeledDataSequence->getValues();
+ CPPUNIT_ASSERT(xDataSequence.is());
+
+ Reference<chart2::data::XTextualDataSequence> xTextualDataSequence(xDataSequence, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xTextualDataSequence.is());
+
+ std::vector<OUString> aCategories;
+ const Sequence<OUString> 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(u"Very very very very very very very very very very very loooooooooooong label"_ustr, aCategories[0]);
+
+ // Check visible text
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xShapes.is());
+
+ uno::Reference<drawing::XShape> xXAxis = getShapeByName(xShapes, u"CID/D=0:CS=0:Axis=0,0"_ustr,
+ // Axis occurs twice in chart xshape representation so need to get the one related to labels
+ [](const uno::Reference<drawing::XShape>& rXShape) -> bool
+ {
+ uno::Reference<drawing::XShapes> xAxisShapes(rXShape, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xAxisShapes.is());
+ uno::Reference<drawing::XShape> 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<container::XIndexAccess> 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<text::XTextRange> 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<drawing::XShape> xChartWall = getShapeByName(xShapes, u"CID/DiagramWall="_ustr);
+ 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_SUITE_REGISTRATION(Chart2ImportTest);
+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<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference<chart2::XAxis> xHAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
+ CPPUNIT_ASSERT(xHAxis.is());
+
+ chart2::ScaleData aScaleData = xHAxis->getScaleData();
+ CPPUNIT_ASSERT(aScaleData.Categories.is());
+
+ Reference<chart2::data::XLabeledDataSequence> xLabeledDataSequence = aScaleData.Categories;
+ CPPUNIT_ASSERT(xLabeledDataSequence.is());
+
+ Reference<chart2::data::XDataSequence> xDataSequence = xLabeledDataSequence->getValues();
+ CPPUNIT_ASSERT(xDataSequence.is());
+
+ Reference<chart2::data::XTextualDataSequence> xTextualDataSequence(xDataSequence, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xTextualDataSequence.is());
+
+ std::vector<OUString> aCategories;
+ const Sequence<OUString> 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(u"Very very very very very very very very very very very loooooooooooong label"_ustr, aCategories[0]);
+
+ // Check visible text
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xShapes.is());
+
+ uno::Reference<drawing::XShape> xXAxis = getShapeByName(xShapes, u"CID/D=0:CS=0:Axis=0,0"_ustr,
+ // Axis occurs twice in chart xshape representation so need to get the one related to labels
+ [](const uno::Reference<drawing::XShape>& rXShape) -> bool
+ {
+ uno::Reference<drawing::XShapes> xAxisShapes(rXShape, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xAxisShapes.is());
+ uno::Reference<drawing::XShape> 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<container::XIndexAccess> xIndexAccess(xXAxis, UNO_QUERY_THROW);
+
+ // Check text is unmodified
+ uno::Reference<text::XTextRange> xLabel(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"Very very very very very very very very very very very loooooooooooong label"_ustr, xLabel->getString());
+
+ uno::Reference<drawing::XShape> xChartWall = getShapeByName(xShapes, u"CID/DiagramWall="_ustr);
+ 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<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference<chart2::data::XDataSequence> 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<sal_uInt32>(7u), xDataSeq->getData().size());
+ }
+ {
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(1);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference<chart2::data::XDataSequence> 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<sal_uInt32>(9u), xDataSeq->getData().size());
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPieChartPlotAreaMarginWithAutomaticLayout)
+{
+ auto verify = [this](std::u16string_view rName, const Size& rSize, const Point& rPoint)
+ {
+ uno::Reference<drawing::XDrawPagesSupplier> xPages(mxComponent, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPages);
+
+ uno::Reference<drawing::XDrawPage> xPage(xPages->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPage);
+
+ uno::Reference<chart::XChartDocument> xChart;
+ for (sal_Int32 i=0; i < xPage->getCount(); ++i)
+ {
+ uno::Reference<container::XNamed> xNamedShape(xPage->getByIndex(i), uno::UNO_QUERY);
+ if (!xNamedShape.is())
+ continue;
+
+ if (xNamedShape->getName() != rName)
+ continue;
+
+ uno::Reference<beans::XPropertySet> xShapeProps(xNamedShape, uno::UNO_QUERY);
+ if (!xShapeProps.is())
+ continue;
+
+ uno::Reference<frame::XModel> xDocModel;
+ xShapeProps->getPropertyValue(u"Model"_ustr) >>= xDocModel;
+ if (!xDocModel.is())
+ continue;
+
+ xChart.set(xDocModel, uno::UNO_QUERY);
+ }
+ CPPUNIT_ASSERT(xChart);
+
+ uno::Reference<chart2::XChartDocument>xChartDocument(xChart, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDocument.is());
+
+ // Get the shape of the diagram / chart
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xDrawPageSupplier.is());
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xShapes.is());
+
+ uno::Reference<drawing::XShape> xChartDiagramShape = getShapeByName(xShapes, u"CID/D=0:CS=0:CT=0:Series=0"_ustr);
+ CPPUNIT_ASSERT(xChartDiagramShape.is());
+
+ // Size
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(rSize.Width(), xChartDiagramShape->getSize().Width, 5); // calculated chart area size - 2 * margin
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(rSize.Height(), xChartDiagramShape->getSize().Height, 5); // calculated chart area size - 2 * margin
+ // Position
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(rPoint.X(), xChartDiagramShape->getPosition().X, 5); // margin
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(rPoint.Y(), xChartDiagramShape->getPosition().Y, 5); // margin
+ };
+
+ // 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");
+
+ // Chart Wuse case Width == Height
+ // Load chart Chart_2_2 - 2cm x 2cm -
+ verify(u"Chart_2_2", Size(1300, 1300), Point(350, 350));
+
+ // Chart use case - Width < Height
+ // Load chart Chart_3_4 - 3cm x 4cm
+ verify(u"Chart_3_4", Size(2300, 2300), Point(350, 850));
+
+ // Chart use case - Width > Height
+ // Load chart Chart_3_2 - 3cm x 2cm
+ verify(u"Chart_3_2", Size(1300, 1300), Point(850, 350));
+}
+} // end of anonymous namespace
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/qa/extras/chart2import2.cxx b/chart2/qa/extras/chart2import2.cxx
index f84254c30c2a..c7d349758846 100644
--- a/chart2/qa/extras/chart2import2.cxx
+++ b/chart2/qa/extras/chart2import2.cxx
@@ -22,102 +22,36 @@
class Chart2ImportTest2 : public ChartTest
{
public:
- void testTdf114179();
- void testTdf124243();
- void testTdf127393();
- void testTdf128733();
- void testTdf128432();
- void testTdf128627();
- void testTdf128634();
- void testTdf130657();
- void testDeletedDataLabel();
- void testDataPointInheritedColorDOCX();
- void testExternalStrRefsXLSX();
- void testSourceNumberFormatComplexCategoriesXLS();
- void testSimpleCategoryAxis();
- void testMultilevelCategoryAxis();
- void testXaxisValues();
- void testTdf123504();
- void testTdf122765();
- void testTdf123206CustomLabelField();
- void testTdf125444PercentageCustomLabel();
- void testDataPointLabelCustomPos();
- void testTdf130032();
- void testTdf134978();
- void testTdf119138MissingAutoTitleDeleted();
- void testStockChartShiftedCategoryPosition();
- void testTdf133376();
- void testTdf134225();
- void testTdf136105();
- void testTdf91250();
- void testTdf134111();
- void testTdf136752();
- void testTdf137505();
- void testTdf137734();
- void testTdf137874();
- void testTdfCustomShapePos();
- void testTdf121281();
- void testTdf139658();
-
- CPPUNIT_TEST_SUITE(Chart2ImportTest2);
-
- CPPUNIT_TEST(testTdf114179);
- CPPUNIT_TEST(testTdf124243);
- CPPUNIT_TEST(testTdf127393);
- CPPUNIT_TEST(testTdf128733);
- CPPUNIT_TEST(testTdf128432);
- CPPUNIT_TEST(testTdf128627);
- CPPUNIT_TEST(testTdf128634);
- CPPUNIT_TEST(testTdf130657);
- CPPUNIT_TEST(testDeletedDataLabel);
- CPPUNIT_TEST(testDataPointInheritedColorDOCX);
- CPPUNIT_TEST(testExternalStrRefsXLSX);
- CPPUNIT_TEST(testSourceNumberFormatComplexCategoriesXLS);
- CPPUNIT_TEST(testSimpleCategoryAxis);
- CPPUNIT_TEST(testMultilevelCategoryAxis);
- CPPUNIT_TEST(testXaxisValues);
- CPPUNIT_TEST(testTdf123504);
- CPPUNIT_TEST(testTdf122765);
- CPPUNIT_TEST(testTdf123206CustomLabelField);
- CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
- CPPUNIT_TEST(testDataPointLabelCustomPos);
- CPPUNIT_TEST(testTdf130032);
- CPPUNIT_TEST(testTdf134978);
- CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted);
- CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
- CPPUNIT_TEST(testTdf133376);
- CPPUNIT_TEST(testTdf134225);
- CPPUNIT_TEST(testTdf136105);
- CPPUNIT_TEST(testTdf91250);
- CPPUNIT_TEST(testTdf134111);
- CPPUNIT_TEST(testTdf136752);
- CPPUNIT_TEST(testTdf137505);
- CPPUNIT_TEST(testTdf137734);
- CPPUNIT_TEST(testTdf137874);
- CPPUNIT_TEST(testTdfCustomShapePos);
- CPPUNIT_TEST(testTdf121281);
- CPPUNIT_TEST(testTdf139658);
-
- CPPUNIT_TEST_SUITE_END();
+ Chart2ImportTest2()
+ : ChartTest(u"/chart2/qa/extras/data/"_ustr)
+ {
+ }
};
-void Chart2ImportTest2::testTdf114179()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf114179)
{
- load(u"/chart2/qa/extras/data/docx/", "testTdf114179.docx");
+ loadFromFile(u"docx/testTdf114179.docx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
css::uno::Reference<chart2::XDiagram> 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);
-}
-
-void Chart2ImportTest2::testTdf124243()
-{
- load(u"/chart2/qa/extras/data/docx/", "tdf124243.docx");
+ awt::Size aPage(0, 0);
+ uno::Reference<css::embed::XVisualObject> xVisualObject(xChartDoc, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xVisualObject.is());
+ aPage = xVisualObject->getVisualAreaSize(css::embed::Aspects::MSOLE_CONTENT);
+ Reference<beans::XPropertySet> xProp(xDiagram, uno::UNO_QUERY);
+ chart2::RelativeSize aRelativeSize;
+ xProp->getPropertyValue(u"RelativeSize"_ustr) >>= aRelativeSize;
+ double fX = aRelativeSize.Primary * aPage.Width;
+ double fY = aRelativeSize.Secondary * aPage.Height;
+ CPPUNIT_ASSERT(static_cast<sal_Int32>(::rtl::math::round(fX)) > 0);
+ CPPUNIT_ASSERT(static_cast<sal_Int32>(::rtl::math::round(fY)) > 0);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf124243)
+{
+ loadFromFile(u"docx/tdf124243.docx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
@@ -127,14 +61,14 @@ void Chart2ImportTest2::testTdf124243()
Reference<beans::XPropertySet> xPS(xAxis, uno::UNO_QUERY_THROW);
bool bShow = true;
// test X Axis is not visible.
- bool bSuccess = xPS->getPropertyValue("Show") >>= bShow;
+ bool bSuccess = xPS->getPropertyValue(u"Show"_ustr) >>= bShow;
CPPUNIT_ASSERT(bSuccess);
CPPUNIT_ASSERT(!bShow);
}
-void Chart2ImportTest2::testTdf127393()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf127393)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf127393.pptx");
+ loadFromFile(u"pptx/tdf127393.pptx");
// 1st chart
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
@@ -159,9 +93,9 @@ void Chart2ImportTest2::testTdf127393()
CPPUNIT_ASSERT(!aScaleData2.ShiftedCategoryPosition);
}
-void Chart2ImportTest2::testTdf128733()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf128733)
{
- load(u"/chart2/qa/extras/data/odt/", "tdf128733.odt");
+ loadFromFile(u"odt/tdf128733.odt");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -174,11 +108,11 @@ void Chart2ImportTest2::testTdf128733()
CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
}
-void Chart2ImportTest2::testTdf128432()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf128432)
{
- load(u"/chart2/qa/extras/data/ods/", "tdf128432.ods");
+ loadFromFile(u"ods/tdf128432.ods");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
@@ -189,11 +123,11 @@ void Chart2ImportTest2::testTdf128432()
CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
}
-void Chart2ImportTest2::testTdf128627()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf128627)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf128627.xlsx");
+ loadFromFile(u"xlsx/tdf128627.xlsx");
// Test ShiftedCategoryPosition for Radar Chart
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
@@ -204,11 +138,11 @@ void Chart2ImportTest2::testTdf128627()
CPPUNIT_ASSERT(!aScaleData.ShiftedCategoryPosition);
}
-void Chart2ImportTest2::testTdf128634()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf128634)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf128634.xlsx");
+ loadFromFile(u"xlsx/tdf128634.xlsx");
// Test ShiftedCategoryPosition for 3D Charts
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
@@ -219,11 +153,11 @@ void Chart2ImportTest2::testTdf128634()
CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
}
-void Chart2ImportTest2::testTdf130657()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf130657)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf130657.xlsx");
+ loadFromFile(u"xlsx/tdf130657.xlsx");
// Test ShiftedCategoryPosition for charts which is not contain a "crossbetween" OOXML tag.
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
@@ -242,17 +176,16 @@ void checkDataLabelProperties(const Reference<chart2::XDataSeries>& xDataSeries,
uno::Reference<beans::XPropertySet> xPropertySet(
xDataSeries->getDataPointByIndex(nDataPointIndex), uno::UNO_SET_THROW);
chart2::DataPointLabel aLabel;
- xPropertySet->getPropertyValue("Label") >>= aLabel;
+ xPropertySet->getPropertyValue(u"Label"_ustr) >>= aLabel;
CPPUNIT_ASSERT_EQUAL(bValueVisible, static_cast<bool>(aLabel.ShowNumber));
CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(aLabel.ShowNumberInPercent));
}
}
-void Chart2ImportTest2::testDeletedDataLabel()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testDeletedDataLabel)
{
- load(u"/chart2/qa/extras/data/xlsx/", "deleted_data_labels.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/deleted_data_labels.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0), UNO_QUERY_THROW);
Reference<chart2::XDataSeries> xDataSeries0 = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xDataSeries0.is());
checkDataLabelProperties(xDataSeries0, 0, true);
@@ -265,9 +198,9 @@ void Chart2ImportTest2::testDeletedDataLabel()
checkDataLabelProperties(xDataSeries1, 2, false);
}
-void Chart2ImportTest2::testDataPointInheritedColorDOCX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testDataPointInheritedColorDOCX)
{
- load(u"/chart2/qa/extras/data/docx/", "data_point_inherited_color.docx");
+ loadFromFile(u"docx/data_point_inherited_color.docx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
css::uno::Reference<chart2::XDiagram> xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW);
@@ -276,29 +209,27 @@ void Chart2ImportTest2::testDataPointInheritedColorDOCX()
uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0),
uno::UNO_SET_THROW);
CPPUNIT_ASSERT(xPropertySet.is());
- sal_Int32 nColor = xPropertySet->getPropertyValue("FillColor").get<sal_Int32>();
+ sal_Int32 nColor = xPropertySet->getPropertyValue(u"FillColor"_ustr).get<sal_Int32>();
CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), nColor);
}
-void Chart2ImportTest2::testExternalStrRefsXLSX()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testExternalStrRefsXLSX)
{
- load(u"/chart2/qa/extras/data/xlsx/", "external_str_ref.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/external_str_ref.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0), UNO_QUERY_THROW);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
chart2::ScaleData aScaleData = xAxis->getScaleData();
css::uno::Sequence<css::uno::Any> aValues = aScaleData.Categories->getValues()->getData();
- CPPUNIT_ASSERT_EQUAL(OUString("test1"), aValues[0].get<OUString>());
- CPPUNIT_ASSERT_EQUAL(OUString("test2"), aValues[1].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"test1"_ustr, aValues[0].get<OUString>());
+ CPPUNIT_ASSERT_EQUAL(u"test2"_ustr, aValues[1].get<OUString>());
}
-void Chart2ImportTest2::testSourceNumberFormatComplexCategoriesXLS()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testSourceNumberFormatComplexCategoriesXLS)
{
- load(u"/chart2/qa/extras/data/xls/", "source_number_format_axis.xls");
- uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xls/source_number_format_axis.xls");
+ uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0), UNO_QUERY_THROW);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
@@ -307,9 +238,9 @@ void Chart2ImportTest2::testSourceNumberFormatComplexCategoriesXLS()
CPPUNIT_ASSERT(nNumberFormat != 0);
}
-void Chart2ImportTest2::testSimpleCategoryAxis()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testSimpleCategoryAxis)
{
- load(u"/chart2/qa/extras/data/docx/", "testSimpleCategoryAxis.docx");
+ loadFromFile(u"docx/testSimpleCategoryAxis.docx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -335,9 +266,9 @@ void Chart2ImportTest2::testSimpleCategoryAxis()
CPPUNIT_ASSERT(aCategories[3][0].endsWith("ria 4"));
}
-void Chart2ImportTest2::testMultilevelCategoryAxis()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testMultilevelCategoryAxis)
{
- load(u"/chart2/qa/extras/data/docx/", "testMultilevelCategoryAxis.docx");
+ loadFromFile(u"docx/testMultilevelCategoryAxis.docx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -354,19 +285,19 @@ void Chart2ImportTest2::testMultilevelCategoryAxis()
// Get the complex category labels.
Sequence<Sequence<OUString>> 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_ASSERT_EQUAL(u"2011"_ustr, aCategories[0][0]);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aCategories[1][0]);
+ CPPUNIT_ASSERT_EQUAL(u"2012"_ustr, aCategories[2][0]);
+ CPPUNIT_ASSERT_EQUAL(u""_ustr, aCategories[3][0]);
+ CPPUNIT_ASSERT_EQUAL(u"Categoria 1"_ustr, aCategories[0][1]);
+ CPPUNIT_ASSERT_EQUAL(u"Categoria 2"_ustr, aCategories[1][1]);
+ CPPUNIT_ASSERT_EQUAL(u"Categoria 3"_ustr, aCategories[2][1]);
+ CPPUNIT_ASSERT_EQUAL(u"Categoria 4"_ustr, aCategories[3][1]);
}
-void Chart2ImportTest2::testXaxisValues()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testXaxisValues)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf124083.docx");
+ loadFromFile(u"docx/tdf124083.docx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -381,11 +312,10 @@ void Chart2ImportTest2::testXaxisValues()
CPPUNIT_ASSERT(std::isnan(*static_cast<const double*>(xSequence[4].getValue())));
}
-void Chart2ImportTest2::testTdf123504()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf123504)
{
- load(u"/chart2/qa/extras/data/ods/", "pie_chart_100_and_0.ods");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"ods/pie_chart_100_and_0.ods");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<chart2::XChartDocument> xChartDoc2(xChartDoc, UNO_QUERY_THROW);
Reference<chart2::XChartType> xChartType(getChartTypeFromDoc(xChartDoc2, 0), UNO_SET_THROW);
@@ -395,8 +325,8 @@ void Chart2ImportTest2::testTdf123504()
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
- Reference<drawing::XShape> xSeriesSlices(getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=0"),
- UNO_SET_THROW);
+ Reference<drawing::XShape> xSeriesSlices(
+ getShapeByName(xShapes, u"CID/D=0:CS=0:CT=0:Series=0"_ustr), UNO_SET_THROW);
Reference<container::XIndexAccess> xIndexAccess(xSeriesSlices, UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
@@ -408,20 +338,20 @@ void Chart2ImportTest2::testTdf123504()
CPPUNIT_ASSERT_GREATER(sal_Int32(3000), aSlicePosition.X);
CPPUNIT_ASSERT_GREATER(sal_Int32(150), aSlicePosition.Y);
awt::Size aSliceSize = xSlice->getSize();
- CPPUNIT_ASSERT_GREATER(sal_Int32(8500), aSliceSize.Height);
- CPPUNIT_ASSERT_GREATER(sal_Int32(8500), aSliceSize.Width);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(8300.0, aSliceSize.Height, 10);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(8300.0, aSliceSize.Width, 10);
}
-void Chart2ImportTest2::testTdf122765()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf122765)
{
// The horizontal position of the slices was wrong.
- load(u"/chart2/qa/extras/data/pptx/", "tdf122765.pptx");
+ loadFromFile(u"pptx/tdf122765.pptx");
Reference<chart::XChartDocument> xChartDoc = getChartDocFromDrawImpress(0, 0);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
- Reference<drawing::XShape> xSeriesSlices(getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=0"),
- UNO_SET_THROW);
+ Reference<drawing::XShape> xSeriesSlices(
+ getShapeByName(xShapes, u"CID/D=0:CS=0:CT=0:Series=0"_ustr), UNO_SET_THROW);
Reference<container::XIndexAccess> xIndexAccess(xSeriesSlices, UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(sal_Int32(9), xIndexAccess->getCount());
@@ -433,28 +363,28 @@ void Chart2ImportTest2::testTdf122765()
CPPUNIT_ASSERT_GREATER(sal_Int32(7000), aSlicePosition.X);
}
-void Chart2ImportTest2::testTdf123206CustomLabelField()
+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.
- uno::Reference<chart2::XChartDocument> xChartDoc(
- getChartDocFromImpress(u"/chart2/qa/extras/data/odp/", "tdf123206.odp"),
- uno::UNO_QUERY_THROW);
+ loadFromFile(u"odp/tdf123206.odp");
+ uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0),
+ uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xDp = xDataSeries->getDataPointByIndex(1);
Sequence<Reference<chart2::XDataPointCustomLabelField>> aLabelFields;
- CPPUNIT_ASSERT(xDp->getPropertyValue("CustomLabelFields") >>= aLabelFields);
+ CPPUNIT_ASSERT(xDp->getPropertyValue(u"CustomLabelFields"_ustr) >>= aLabelFields);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aLabelFields.getLength());
- CPPUNIT_ASSERT_EQUAL(OUString("Kiskacsa"), aLabelFields[0]->getString());
+ CPPUNIT_ASSERT_EQUAL(u"Kiskacsa"_ustr, aLabelFields[0]->getString());
}
-void Chart2ImportTest2::testTdf125444PercentageCustomLabel()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf125444PercentageCustomLabel)
{
- load(u"/chart2/qa/extras/data/pptx/", "tdf125444.pptx");
+ loadFromFile(u"pptx/tdf125444.pptx");
// 1st chart
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
@@ -464,7 +394,7 @@ void Chart2ImportTest2::testTdf125444PercentageCustomLabel()
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xDp = xDataSeries->getDataPointByIndex(1);
Sequence<Reference<chart2::XDataPointCustomLabelField>> aLabelFields;
- CPPUNIT_ASSERT(xDp->getPropertyValue("CustomLabelFields") >>= aLabelFields);
+ CPPUNIT_ASSERT(xDp->getPropertyValue(u"CustomLabelFields"_ustr) >>= 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<sal_Int32>(3), aLabelFields.getLength());
@@ -472,11 +402,11 @@ void Chart2ImportTest2::testTdf125444PercentageCustomLabel()
aLabelFields[2]->getFieldType());
}
-void Chart2ImportTest2::testDataPointLabelCustomPos()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testDataPointLabelCustomPos)
{
// test CustomLabelPosition on Bar chart
- load(u"/chart2/qa/extras/data/xlsx/", "testDataPointLabelCustomPos.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/testDataPointLabelCustomPos.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
@@ -486,20 +416,20 @@ void Chart2ImportTest2::testDataPointLabelCustomPos()
CPPUNIT_ASSERT(xPropertySet.is());
chart2::RelativePosition aCustomLabelPosition;
- xPropertySet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition;
- CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Primary, -0.14621409921671025, 1e-7);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Secondary, -5.2887961029923464E-2, 1e-7);
+ xPropertySet->getPropertyValue(u"CustomLabelPosition"_ustr) >>= 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;
+ xPropertySet->getPropertyValue(u"LabelPlacement"_ustr) >>= aPlacement;
CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::OUTSIDE, aPlacement);
}
-void Chart2ImportTest2::testTdf130032()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf130032)
{
// test CustomLabelPosition on Line chart
- load(u"/chart2/qa/extras/data/xlsx/", "testTdf130032.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/testTdf130032.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
@@ -509,20 +439,20 @@ void Chart2ImportTest2::testTdf130032()
CPPUNIT_ASSERT(xPropertySet.is());
chart2::RelativePosition aCustomLabelPosition;
- xPropertySet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition;
- CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Primary, -0.0438333333333334, 1e-7);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Secondary, 0.086794050743657, 1e-7);
+ xPropertySet->getPropertyValue(u"CustomLabelPosition"_ustr) >>= 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;
+ xPropertySet->getPropertyValue(u"LabelPlacement"_ustr) >>= aPlacement;
CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::RIGHT, aPlacement);
}
-void Chart2ImportTest2::testTdf134978()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf134978)
{
// test CustomLabelPosition on Pie chart
- load(u"/chart2/qa/extras/data/xlsx/", "tdf134978.xlsx");
- uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/tdf134978.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT(xChartDoc.is());
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
@@ -532,15 +462,15 @@ void Chart2ImportTest2::testTdf134978()
CPPUNIT_ASSERT(xPropertySet.is());
chart2::RelativePosition aCustomLabelPosition;
- xPropertySet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition;
+ xPropertySet->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition;
CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.040273622047244093, aCustomLabelPosition.Primary, 1e-7);
CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.25635352872557599, aCustomLabelPosition.Secondary, 1e-7);
}
-void Chart2ImportTest2::testTdf119138MissingAutoTitleDeleted()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf119138MissingAutoTitleDeleted)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf119138-missing-autotitledeleted.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/tdf119138-missing-autotitledeleted.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
@@ -549,9 +479,9 @@ void Chart2ImportTest2::testTdf119138MissingAutoTitleDeleted()
"Missing autoTitleDeleted is implied to be True if title text is present", xTitle.is());
}
-void Chart2ImportTest2::testStockChartShiftedCategoryPosition()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testStockChartShiftedCategoryPosition)
{
- load(u"/chart2/qa/extras/data/odt/", "stock_chart_LO_6_2.odt");
+ loadFromFile(u"odt/stock_chart_LO_6_2.odt");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -564,50 +494,48 @@ void Chart2ImportTest2::testStockChartShiftedCategoryPosition()
CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
}
-void Chart2ImportTest2::testTdf133376()
+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;
- load(u"/chart2/qa/extras/data/xlsx/", "tdf133376.xlsx");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/tdf133376.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
Reference<drawing::XShape> xDataPointLabel(
getShapeByName(xShapes,
- "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2"),
+ u"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2"_ustr),
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(1082, aLabelPosition.X, 30);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(5462, aLabelPosition.Y, 30);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1624, aLabelPosition.X, 30);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(5635, aLabelPosition.Y, 30);
}
-void Chart2ImportTest2::testTdf134225()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf134225)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf134225.xlsx");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/tdf134225.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
Reference<drawing::XShape> xDataPointLabel1(
getShapeByName(xShapes,
- "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"),
+ u"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"_ustr),
UNO_SET_THROW);
CPPUNIT_ASSERT(xDataPointLabel1.is());
Reference<drawing::XShape> xDataPointLabel2(
getShapeByName(xShapes,
- "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1"),
+ u"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1"_ustr),
UNO_SET_THROW);
CPPUNIT_ASSERT(xDataPointLabel2.is());
@@ -617,30 +545,29 @@ void Chart2ImportTest2::testTdf134225()
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(1669, sal_Int32(aLabelPosition2.X - aLabelPosition1.X), 30);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(2166, sal_Int32(aLabelPosition2.Y - aLabelPosition1.Y), 30);
+ 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
}
-void Chart2ImportTest2::testTdf136105()
+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;
- load(u"/chart2/qa/extras/data/xlsx/", "tdf136105.xlsx");
+ loadFromFile(u"xlsx/tdf136105.xlsx");
// 1st chart with fix inner position and size
{
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
Reference<drawing::XShape> xDataPointLabel(
- getShapeByName(xShapes,
- "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"),
+ getShapeByName(
+ xShapes, u"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"_ustr),
UNO_SET_THROW);
CPPUNIT_ASSERT(xDataPointLabel.is());
@@ -651,28 +578,27 @@ void Chart2ImportTest2::testTdf136105()
}
// 2nd chart with auto inner position and size
{
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(1, mxComponent),
- UNO_QUERY_THROW);
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(1), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
Reference<drawing::XShape> xDataPointLabel(
- getShapeByName(xShapes,
- "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"),
+ getShapeByName(
+ xShapes, u"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"_ustr),
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(1048, aLabelPosition.Y, 500);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1550, aLabelPosition.Y, 500);
}
}
-void Chart2ImportTest2::testTdf91250()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf91250)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf91250.docx");
+ loadFromFile(u"docx/tdf91250.docx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XInternalDataProvider> xInternalProvider(xChartDoc->getDataProvider(),
@@ -685,16 +611,16 @@ void Chart2ImportTest2::testTdf91250()
// Get the category labels.
Sequence<OUString> 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_ASSERT_EQUAL(u"12.3254"_ustr, aCategories[0]);
+ CPPUNIT_ASSERT_EQUAL(u"11.62315"_ustr, aCategories[1]);
+ CPPUNIT_ASSERT_EQUAL(u"9.26"_ustr, aCategories[2]);
+ CPPUNIT_ASSERT_EQUAL(u"8.657"_ustr, aCategories[3]);
}
-void Chart2ImportTest2::testTdf134111()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf134111)
{
// tdf134111 : To check TextBreak value is true
- load(u"/chart2/qa/extras/data/docx/", "tdf134111.docx");
+ loadFromFile(u"docx/tdf134111.docx");
uno::Reference<chart::XChartDocument> xChartDoc = getChartDocFromWriter(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
uno::Reference<chart::XDiagram> mxDiagram(xChartDoc->getDiagram());
@@ -703,23 +629,22 @@ void Chart2ImportTest2::testTdf134111()
CPPUNIT_ASSERT(xAxisXSupp.is());
uno::Reference<beans::XPropertySet> xAxisProp(xAxisXSupp->getXAxis());
bool bTextBreak = false;
- xAxisProp->getPropertyValue("TextBreak") >>= bTextBreak;
+ xAxisProp->getPropertyValue(u"TextBreak"_ustr) >>= bTextBreak;
// Expected value of 'TextBreak' is true
CPPUNIT_ASSERT(bTextBreak);
}
-void Chart2ImportTest2::testTdf136752()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf136752)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf136752.xlsx");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/tdf136752.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
Reference<drawing::XShape> xDataPointLabel(
getShapeByName(xShapes,
- "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"),
+ u"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"_ustr),
UNO_SET_THROW);
CPPUNIT_ASSERT(xDataPointLabel.is());
@@ -729,11 +654,10 @@ void Chart2ImportTest2::testTdf136752()
CPPUNIT_ASSERT_DOUBLES_EQUAL(1458, aLabelPosition.Y, 500);
}
-void Chart2ImportTest2::testTdf137505()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf137505)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf137505.xlsx");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/tdf137505.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
@@ -745,20 +669,20 @@ void Chart2ImportTest2::testTdf137505()
Reference<text::XTextCursor> xAt = xRange->createTextCursor();
Reference<beans::XPropertySet> xProps(xAt, UNO_QUERY);
// check the text size of custom shape, inside the chart.
- CPPUNIT_ASSERT(xProps->getPropertyValue("CharHeight") >>= nFontSize);
+ CPPUNIT_ASSERT(xProps->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize);
CPPUNIT_ASSERT_EQUAL(float(12), nFontSize);
}
-void Chart2ImportTest2::testTdf137734()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf137734)
{
- load(u"/chart2/qa/extras/data/xlsx/", "tdf137734.xlsx");
- Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ loadFromFile(u"xlsx/tdf137734.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
CPPUNIT_ASSERT(xDataSeries.is());
Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY_THROW);
- uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint");
+ uno::Any aAny = xPropSet->getPropertyValue(u"VaryColorsByPoint"_ustr);
bool bVaryColor = true;
CPPUNIT_ASSERT(aAny >>= bVaryColor);
CPPUNIT_ASSERT(!bVaryColor);
@@ -770,29 +694,55 @@ void Chart2ImportTest2::testTdf137734()
Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
CPPUNIT_ASSERT(xTitle.is());
Reference<beans::XPropertySet> xTitlePropSet(xTitle, uno::UNO_QUERY_THROW);
- uno::Any aAny2 = xTitlePropSet->getPropertyValue("TextRotation");
+ uno::Any aAny2 = xTitlePropSet->getPropertyValue(u"TextRotation"_ustr);
double nRotation = -1;
CPPUNIT_ASSERT(aAny2 >>= nRotation);
CPPUNIT_ASSERT_EQUAL(0.0, nRotation);
}
-void Chart2ImportTest2::testTdf137874()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf137874)
{
- load(u"/chart2/qa/extras/data/xlsx/", "piechart_legend.xlsx");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/piechart_legend.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
Reference<drawing::XShape> xLegendEntry;
- xLegendEntry
- = getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0:LegendEntry=0");
+ xLegendEntry = getShapeByName(
+ xShapes, u"CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0:LegendEntry=0"_ustr);
CPPUNIT_ASSERT(xLegendEntry.is());
}
-void Chart2ImportTest2::testTdfCustomShapePos()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf146463)
{
- load(u"/chart2/qa/extras/data/docx/", "testcustomshapepos.docx");
+ loadFromFile(u"ods/tdf146463.ods");
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromSheet(0));
+ Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
+ Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
+ Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
+ Reference<chart2::XChartType> xChartType = getChartTypeFromDoc(xChartDoc, 0);
+ std::vector<std::vector<double>> 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<drawing::XShape> 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<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
@@ -818,17 +768,16 @@ void Chart2ImportTest2::testTdfCustomShapePos()
}
}
-void Chart2ImportTest2::testTdf121281()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf121281)
{
- load(u"/chart2/qa/extras/data/xlsx/", "incorrect_label_position.xlsx");
- Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ loadFromFile(u"xlsx/incorrect_label_position.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
Reference<drawing::XShape> xDataPointLabel(
getShapeByName(xShapes,
- "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"),
+ u"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"_ustr),
UNO_SET_THROW);
CPPUNIT_ASSERT(xDataPointLabel.is());
@@ -837,9 +786,9 @@ void Chart2ImportTest2::testTdf121281()
CPPUNIT_ASSERT_GREATEREQUAL(static_cast<sal_Int32>(0), aLabelPosition.Y);
}
-void Chart2ImportTest2::testTdf139658()
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf139658)
{
- load(u"/chart2/qa/extras/data/docx/", "tdf139658.docx");
+ loadFromFile(u"docx/tdf139658.docx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
Reference<chart2::XInternalDataProvider> xInternalProvider(xChartDoc->getDataProvider(),
@@ -852,12 +801,162 @@ void Chart2ImportTest2::testTdf139658()
// Get the category labels.
Sequence<OUString> 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_ASSERT_EQUAL(u"category1"_ustr, aCategories[0]);
+ CPPUNIT_ASSERT_EQUAL(u"\"category2\""_ustr, aCategories[1]);
+ CPPUNIT_ASSERT_EQUAL(u"category\"3"_ustr, aCategories[2]);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf146066)
+{
+ loadFromFile(u"ods/tdf146066.ods");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xShapes.is());
+
+ uno::Reference<drawing::XShape> xYAxisShape = getShapeByName(
+ xShapes, u"CID/D=0:CS=0:Axis=1,0"_ustr, // Y Axis
+ // Axis occurs twice in chart xshape representation so need to get the one related to labels
+ [](const uno::Reference<drawing::XShape>& rXShape) -> bool {
+ uno::Reference<drawing::XShapes> xAxisShapes(rXShape, uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xAxisShapes.is());
+ uno::Reference<drawing::XShape> 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<container::XIndexAccess> xIndexAccess(xYAxisShape, UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8), xIndexAccess->getCount());
+
+ // Check text
+ uno::Reference<text::XTextRange> xLabel0(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"0"_ustr, xLabel0->getString());
+ uno::Reference<text::XTextRange> xLabel1(xIndexAccess->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"5"_ustr, xLabel1->getString());
+ uno::Reference<text::XTextRange> xLabel2(xIndexAccess->getByIndex(2), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"10"_ustr, xLabel2->getString());
+ uno::Reference<text::XTextRange> xLabel3(xIndexAccess->getByIndex(3), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"15"_ustr, xLabel3->getString());
+ uno::Reference<text::XTextRange> xLabel4(xIndexAccess->getByIndex(4), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"20"_ustr, xLabel4->getString());
+ uno::Reference<text::XTextRange> xLabel5(xIndexAccess->getByIndex(5), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"25"_ustr, xLabel5->getString());
+ uno::Reference<text::XTextRange> xLabel6(xIndexAccess->getByIndex(6), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"30"_ustr, xLabel6->getString());
+ uno::Reference<text::XTextRange> xLabel7(xIndexAccess->getByIndex(7), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(u"35"_ustr, xLabel7->getString());
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf150434)
+{
+ loadFromFile(u"xlsx/tdf150434.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
+ Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
+ Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
+ Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
+ Reference<drawing::XShape> xLegend = getShapeByName(xShapes, u"CID/D=0:Legend="_ustr);
+ 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<sal_Int32>(0), aPosition.Y);
}
-CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest2);
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testChartDataTableWithMultipleLegendEntriesForOneDataSeries)
+{
+ loadFromFile(u"xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx");
+ // Loading this file caused a crash in the data table code
+
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW);
+ Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
+ Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
+ Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
+ Reference<drawing::XShape> xDataTableShape
+ = getShapeByName(xShapes, u"CID/D=0:DataTable="_ustr);
+ CPPUNIT_ASSERT(xDataTableShape.is());
+}
+
+namespace
+{
+void lcl_assertAngles(const Reference<chart2::XAxis>& rAxis, const double& rExpectedLabelAngle,
+ const double& rExpectedTitleAngle)
+{
+ Reference<beans::XPropertySet> xPS(rAxis, uno::UNO_QUERY_THROW);
+ double fAxisLabelAngle = 0.0;
+ xPS->getPropertyValue(u"TextRotation"_ustr) >>= fAxisLabelAngle;
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(rExpectedLabelAngle, fAxisLabelAngle, 1e-10);
+
+ Reference<chart2::XTitled> xAxisTitled(rAxis, uno::UNO_QUERY_THROW);
+ Reference<chart2::XTitle> xAxisTitle = xAxisTitled->getTitleObject();
+ CPPUNIT_ASSERT(xAxisTitle.is());
+ Reference<beans::XPropertySet> xPropSet(xAxisTitle, uno::UNO_QUERY_THROW);
+ double fAxisTitleAngle = 0.0;
+ xPropSet->getPropertyValue(u"TextRotation"_ustr) >>= fAxisTitleAngle;
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(rExpectedTitleAngle, fAxisTitleAngle, 1e-10);
+}
+} // end namespace
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testAngleUnits)
+{
+ loadFromFile(u"fods/tdf161483_AngleUnits.fods");
+ double fExpXAxisLabelAngle = 344.61; // = 382.9grad = 6.01457913529766rad
+ double fExpXAxisTitleAngle = 342.63; // = 380.7grad = 5.98002161610817rad
+ double fExpYAxisLabelAngle = 15.12; // = 16.8grad = 0.263893782901543rad
+ double fExpYAxisTitleAngle = 14.94; // = 16.6grad = 0.260752190247953rad
+ double fExpZAxisLabelAngle = 344.16; // = 382.4grad = 6.00672515366369rad
+ double fExpZAxisTitleAngle = 60.39; // = 67.1grad = 1.05400433527938rad
+
+ // sheet 0: no unit; sheet 1: unit deg; sheet 2: unit rad; sheet 3: unit grad
+ // Without fix, the values with unit grad and rad were read as if they are in degrees.
+ for (size_t i = 0; i < 4; i++)
+ {
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(i);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+ // x-axis
+ Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
+ CPPUNIT_ASSERT(xAxis.is());
+ lcl_assertAngles(xAxis, fExpXAxisLabelAngle, fExpXAxisTitleAngle);
+
+ // y-axis
+ xAxis = getAxisFromDoc(xChartDoc, 0, 1, 0);
+ CPPUNIT_ASSERT(xAxis.is());
+ lcl_assertAngles(xAxis, fExpYAxisLabelAngle, fExpYAxisTitleAngle);
+
+ //z-axis
+ xAxis = getAxisFromDoc(xChartDoc, 0, 2, 0);
+ CPPUNIT_ASSERT(xAxis.is());
+ lcl_assertAngles(xAxis, fExpZAxisLabelAngle, fExpZAxisTitleAngle);
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf166428)
+{
+ // The file was generated in ODF 1.3 by LO 24.8
+ loadFromFile(u"ods/tdf166428_Low_High_StockChart_LO248.ods");
+
+ // The attribute table:cell-range-address does not exist in ODF 1.4. and therefore may not be
+ // be written.
+ saveAndReload(u"calc8"_ustr);
+ xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr);
+ assertXPathNoAttribute(pXmlDoc,
+ "/office:document-content/office:body/office:chart/chart:chart/"
+ "chart:plot-area",
+ "table:cell-range-address");
+
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ // Without applied fix, the series were not merged to one stock chart series and therefore
+ // only role "values-y" existed.
+ Reference<chart2::data::XDataSequence> xDataSeq
+ = getDataSequenceFromDocByRole(xChartDoc, u"values-min");
+ CPPUNIT_ASSERT(xDataSeq.is());
+}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index 02ad9675d930..696e3c7ab164 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -9,15 +9,10 @@
#pragma once
-#include <test/bootstrapfixture.hxx>
-#include <test/xmltesttools.hxx>
-#include <unotest/macros_test.hxx>
+#include <test/unoapixml_test.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/frame/Desktop.hpp>
-
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNamed.hpp>
@@ -28,10 +23,8 @@
#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
#include <o3tl/string_view.hxx>
-#include <unotools/tempfile.hxx>
#include <rtl/math.hxx>
#include <svx/charthelper.hxx>
@@ -59,182 +52,70 @@
#include <unonames.hxx>
-#include <iostream>
-#include <memory>
-#include <string_view>
-
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
-#include <unotools/ucbstreamhelper.hxx>
-
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; }
-
-namespace {
-
-struct CheckForChartName
+class ChartTest : public UnoApiXmlTest
{
-private:
- OUString aDir;
-
public:
- explicit CheckForChartName( const OUString& rDir ):
- aDir(rDir) {}
-
- bool operator()(std::u16string_view rName)
+ ChartTest(const OUString& path)
+ : UnoApiXmlTest(path)
{
- if(!o3tl::starts_with(rName, aDir))
- return false;
-
- if(!o3tl::ends_with(rName, u".xml"))
- return false;
-
- return true;
}
-};
-OUString findChartFile(const OUString& rDir, uno::Reference< container::XNameAccess > const & xNames )
-{
- const uno::Sequence<OUString> aNames = xNames->getElementNames();
- const OUString* pElement = std::find_if(aNames.begin(), aNames.end(), CheckForChartName(rDir));
-
- CPPUNIT_ASSERT(pElement != aNames.end());
- return *pElement;
-}
-}
-
-class ChartTest : public test::BootstrapFixture, public unotest::MacrosTest, public XmlTestTools
-{
-public:
- ChartTest():mbSkipValidation(false) {}
- void load( std::u16string_view rDir, const OUString& rFileName );
- std::shared_ptr<utl::TempFile> save( const OUString& rFileName );
- std::shared_ptr<utl::TempFile> reload( const OUString& rFileName );
- uno::Sequence < OUString > getImpressChartColumnDescriptions( std::u16string_view pDir, const char* pName );
- OUString getFileExtension( const OUString& rFileName );
-
- uno::Reference< chart::XChartDocument > getChartDocFromImpress( std::u16string_view pDir, const char* pName );
-
- uno::Reference<chart::XChartDocument> getChartDocFromDrawImpress( sal_Int32 nPage, sal_Int32 nShape );
-
- uno::Reference<chart::XChartDocument> getChartDocFromWriter( sal_Int32 nShape );
- Sequence< OUString > getFormattedDateCategories( const Reference<chart2::XChartDocument>& xChartDoc );
- awt::Size getPageSize( const Reference< chart2::XChartDocument > & xChartDoc );
- awt::Size getSize(css::uno::Reference<chart2::XDiagram> xDiagram, const awt::Size& rPageSize);
-
- virtual void setUp() override;
- virtual void tearDown() override;
-
-protected:
- Reference< lang::XComponent > mxComponent;
- OUString maServiceName;
- bool mbSkipValidation; // if you set this flag for a new test I'm going to haunt you!
-
- /**
- * Given that some problem doesn't affect the result in the importer, we
- * test the resulting file directly, by opening the zip file, parsing an
- * xml stream, and asserting an XPath expression. This method returns the
- * xml stream, so that you can do the asserting.
- */
- xmlDocUniquePtr parseExport(const OUString& rDir, const OUString& rFilterFormat);
+ Reference<lang::XComponent> getChartCompFromSheet(sal_Int32 nSheet, sal_Int32 nChart);
+ Reference<chart2::XChartDocument> getChartDocFromSheet(sal_Int32 nSheet);
+ uno::Reference<table::XTablePivotCharts> getTablePivotChartsFromSheet(sal_Int32 nSheet);
+ Reference<chart2::XChartDocument> getPivotChartDocFromSheet(sal_Int32 nSheet);
+ uno::Reference<chart2::XChartDocument>
+ getPivotChartDocFromSheet(uno::Reference<table::XTablePivotCharts> const& xTablePivotCharts,
+ sal_Int32 nIndex);
+ Reference<chart2::XChartType>
+ getChartTypeFromDoc(Reference<chart2::XChartDocument> const& xChartDoc, sal_Int32 nChartType,
+ sal_Int32 nCooSys = 0);
+ Reference<chart2::XAxis> getAxisFromDoc(const Reference<chart2::XChartDocument>& xChartDoc,
+ sal_Int32 nCooSys, sal_Int32 nAxisDim,
+ sal_Int32 nAxisIndex);
+ sal_Int32 getNumberOfDataSeries(uno::Reference<chart2::XChartDocument> const& xChartDoc,
+ sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0);
+ Reference<chart2::XDataSeries>
+ getDataSeriesFromDoc(uno::Reference<chart2::XChartDocument> const& xChartDoc,
+ sal_Int32 nDataSeries, sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0);
+ Reference<chart2::data::XDataSequence>
+ getLabelDataSequenceFromDoc(Reference<chart2::XChartDocument> const& xChartDoc,
+ sal_Int32 nDataSeries = 0, sal_Int32 nChartType = 0);
+ Reference<chart2::data::XDataSequence>
+ getDataSequenceFromDocByRole(Reference<chart2::XChartDocument> const& xChartDoc,
+ std::u16string_view rRole, sal_Int32 nDataSeries = 0,
+ sal_Int32 nChartType = 0);
+ uno::Sequence<OUString> getWriterChartColumnDescriptions();
+ std::vector<std::vector<double>>
+ getDataSeriesYValuesFromChartType(const Reference<chart2::XChartType>& xCT);
+ std::vector<uno::Sequence<uno::Any>>
+ getDataSeriesLabelsFromChartType(const Reference<chart2::XChartType>& xCT);
+ uno::Reference<chart::XChartDocument> getChartDocFromDrawImpress(sal_Int32 nPage,
+ sal_Int32 nShape);
+ uno::Reference<chart::XChartDocument> getChartDocFromWriter(sal_Int32 nShape);
+ OUString getTitleString(const Reference<chart2::XTitled>& xTitled);
+ sal_Int32 getNumberFormatFromAxis(const Reference<chart2::XAxis>& xAxis);
+ sal_Int16 getNumberFormatType(const Reference<chart2::XChartDocument>& xChartDoc,
+ sal_Int32 nNumberFormat);
+ uno::Reference<drawing::XShape>
+ getShapeByName(const uno::Reference<drawing::XShapes>& rShapes, const OUString& rName,
+ const std::function<bool(const uno::Reference<drawing::XShape>&)>& pCondition
+ = nullptr);
};
-OUString ChartTest::getFileExtension( const OUString& aFileName )
-{
- sal_Int32 nDotLocation = aFileName.lastIndexOf('.');
- CPPUNIT_ASSERT(nDotLocation != -1);
- return aFileName.copy(nDotLocation+1); // Skip the dot.
-}
-
-void ChartTest::load( std::u16string_view aDir, const OUString& aName )
-{
- OUString extension = getFileExtension(aName);
- if (extension == "ods" || extension == "xlsx" || extension == "fods")
- {
- maServiceName = "com.sun.star.sheet.SpreadsheetDocument";
- }
- else if (extension == "docx")
- {
- maServiceName = "com.sun.star.text.TextDocument";
- }
- else if (extension == "odg")
- {
- maServiceName = "com.sun.star.drawing.DrawingDocument";
- }
- if (mxComponent.is())
- mxComponent->dispose();
- mxComponent = loadFromDesktop(m_directories.getURLFromSrc(aDir) + aName, maServiceName);
-}
-
-std::shared_ptr<utl::TempFile> ChartTest::save(const OUString& rFilterName)
-{
- uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
- auto aArgs(::comphelper::InitPropertySequence({
- { "FilterName", Any(rFilterName) }
- }));
- std::shared_ptr<utl::TempFile> pTempFile = std::make_shared<utl::TempFile>();
- pTempFile->EnableKillingFile();
- xStorable->storeToURL(pTempFile->GetURL(), aArgs);
-
- return pTempFile;
-}
-
-std::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
-{
- std::shared_ptr<utl::TempFile> pTempFile = save(rFilterName);
- mxComponent->dispose();
- mxComponent = loadFromDesktop(pTempFile->GetURL(), maServiceName);
- std::cout << pTempFile->GetURL();
- if(rFilterName == "Calc Office Open XML")
- {
- validate(pTempFile->GetFileName(), test::OOXML);
- }
- else if(rFilterName == "Office Open XML Text")
- {
- // validate(pTempFile->GetFileName(), test::OOXML);
- }
- else if(rFilterName == "calc8")
- {
- if(!mbSkipValidation)
- validate(pTempFile->GetFileName(), test::ODF);
- }
- else if(rFilterName == "MS Excel 97")
- {
- if(!mbSkipValidation)
- validate(pTempFile->GetFileName(), test::MSBINARY);
- }
- return pTempFile;
-}
-
-void ChartTest::setUp()
-{
- test::BootstrapFixture::setUp();
-
- mxDesktop.set( css::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) ) );
-}
-
-void ChartTest::tearDown()
-{
- if(mxComponent.is())
- mxComponent->dispose();
-
- test::BootstrapFixture::tearDown();
-
-}
-
-Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > const & xComponent )
+Reference< lang::XComponent > ChartTest::getChartCompFromSheet( sal_Int32 nSheet, sal_Int32 nChart )
{
// let us assume that we only have one chart per sheet
- uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComponent, UNO_QUERY_THROW);
+ uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
uno::Reference< container::XIndexAccess > xIA(xDoc->getSheets(), UNO_QUERY_THROW);
@@ -244,7 +125,7 @@ Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Refe
CPPUNIT_ASSERT(xCharts.is());
uno::Reference< container::XIndexAccess > xIACharts(xCharts, UNO_QUERY_THROW);
- uno::Reference< table::XTableChart > xChart( xIACharts->getByIndex(0), UNO_QUERY_THROW);
+ uno::Reference< table::XTableChart > xChart( xIACharts->getByIndex(nChart), UNO_QUERY_THROW);
uno::Reference< document::XEmbeddedObjectSupplier > xEmbObjectSupplier(xChart, UNO_QUERY_THROW);
@@ -254,9 +135,9 @@ Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Refe
}
-Reference< chart2::XChartDocument > getChartDocFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > const & xComponent )
+Reference< chart2::XChartDocument > ChartTest::getChartDocFromSheet( sal_Int32 nSheet )
{
- uno::Reference< chart2::XChartDocument > xChartDoc ( getChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW );
+ uno::Reference< chart2::XChartDocument > xChartDoc ( getChartCompFromSheet(nSheet, 0), UNO_QUERY_THROW );
// Update the chart view, so that its draw page is updated and ready for the test
css::uno::Reference<css::frame::XModel> xModel(xChartDoc, css::uno::UNO_QUERY_THROW);
@@ -265,9 +146,9 @@ Reference< chart2::XChartDocument > getChartDocFromSheet( sal_Int32 nSheet, uno:
return xChartDoc;
}
-uno::Reference<table::XTablePivotCharts> getTablePivotChartsFromSheet(sal_Int32 nSheet, uno::Reference<lang::XComponent> const & xComponent)
+uno::Reference<table::XTablePivotCharts> ChartTest::getTablePivotChartsFromSheet(sal_Int32 nSheet)
{
- uno::Reference<sheet::XSpreadsheetDocument> xDoc(xComponent, UNO_QUERY_THROW);
+ uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), UNO_QUERY_THROW);
@@ -279,9 +160,9 @@ uno::Reference<table::XTablePivotCharts> getTablePivotChartsFromSheet(sal_Int32
return xTablePivotCharts;
}
-Reference<lang::XComponent> getPivotChartCompFromSheet(sal_Int32 nSheet, uno::Reference<lang::XComponent> const & xComponent)
+Reference<chart2::XChartDocument> ChartTest::getPivotChartDocFromSheet(sal_Int32 nSheet)
{
- uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(nSheet, xComponent);
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet(nSheet);
uno::Reference<container::XIndexAccess> xIACharts(xTablePivotCharts, UNO_QUERY_THROW);
uno::Reference<table::XTablePivotChart> xTablePivotChart(xIACharts->getByIndex(0), UNO_QUERY_THROW);
@@ -289,17 +170,11 @@ Reference<lang::XComponent> getPivotChartCompFromSheet(sal_Int32 nSheet, uno::Re
uno::Reference<document::XEmbeddedObjectSupplier> xEmbObjectSupplier(xTablePivotChart, UNO_QUERY_THROW);
uno::Reference<lang::XComponent> xChartComp(xEmbObjectSupplier->getEmbeddedObject(), UNO_SET_THROW);
-
- return xChartComp;
-}
-
-Reference<chart2::XChartDocument> getPivotChartDocFromSheet(sal_Int32 nSheet, uno::Reference<lang::XComponent> const & xComponent)
-{
- uno::Reference<chart2::XChartDocument> xChartDoc(getPivotChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW);
+ uno::Reference<chart2::XChartDocument> xChartDoc(xChartComp, UNO_QUERY_THROW);
return xChartDoc;
}
-Reference<chart2::XChartDocument> getPivotChartDocFromSheet(uno::Reference<table::XTablePivotCharts> const & xTablePivotCharts, sal_Int32 nIndex)
+Reference<chart2::XChartDocument> ChartTest::getPivotChartDocFromSheet(uno::Reference<table::XTablePivotCharts> const & xTablePivotCharts, sal_Int32 nIndex)
{
uno::Reference<container::XIndexAccess> xIACharts(xTablePivotCharts, UNO_QUERY_THROW);
uno::Reference<table::XTablePivotChart> xTablePivotChart(xIACharts->getByIndex(nIndex), UNO_QUERY_THROW);
@@ -312,8 +187,8 @@ Reference<chart2::XChartDocument> getPivotChartDocFromSheet(uno::Reference<table
return xChartDoc;
}
-Reference< chart2::XChartType > getChartTypeFromDoc( Reference< chart2::XChartDocument > const & xChartDoc,
- sal_Int32 nChartType, sal_Int32 nCooSys = 0 )
+Reference< chart2::XChartType > ChartTest::getChartTypeFromDoc( Reference< chart2::XChartDocument > const & xChartDoc,
+ sal_Int32 nChartType, sal_Int32 nCooSys )
{
CPPUNIT_ASSERT( xChartDoc.is() );
@@ -333,7 +208,7 @@ Reference< chart2::XChartType > getChartTypeFromDoc( Reference< chart2::XChartDo
return xChartTypeSequence[nChartType];
}
-Reference<chart2::XAxis> getAxisFromDoc(
+Reference<chart2::XAxis> ChartTest::getAxisFromDoc(
const Reference<chart2::XChartDocument>& xChartDoc, sal_Int32 nCooSys, sal_Int32 nAxisDim, sal_Int32 nAxisIndex )
{
Reference<chart2::XDiagram> xDiagram = xChartDoc->getFirstDiagram();
@@ -353,8 +228,8 @@ Reference<chart2::XAxis> getAxisFromDoc(
return xAxis;
}
-sal_Int32 getNumberOfDataSeries(uno::Reference<chart2::XChartDocument> const & xChartDoc,
- sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0)
+sal_Int32 ChartTest::getNumberOfDataSeries(uno::Reference<chart2::XChartDocument> const & xChartDoc,
+ sal_Int32 nChartType, sal_Int32 nCooSys)
{
Reference<chart2::XChartType> xChartType = getChartTypeFromDoc(xChartDoc, nChartType, nCooSys);
Reference<chart2::XDataSeriesContainer> xDataSeriesContainer(xChartType, UNO_QUERY_THROW);
@@ -363,9 +238,9 @@ sal_Int32 getNumberOfDataSeries(uno::Reference<chart2::XChartDocument> const & x
return xSeriesSequence.getLength();
}
-Reference< chart2::XDataSeries > getDataSeriesFromDoc(uno::Reference<chart2::XChartDocument> const & xChartDoc,
- sal_Int32 nDataSeries, sal_Int32 nChartType = 0,
- sal_Int32 nCooSys = 0)
+Reference< chart2::XDataSeries > ChartTest::getDataSeriesFromDoc(uno::Reference<chart2::XChartDocument> const & xChartDoc,
+ sal_Int32 nDataSeries, sal_Int32 nChartType,
+ sal_Int32 nCooSys)
{
Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, nChartType, nCooSys );
Reference< chart2::XDataSeriesContainer > xDataSeriesContainer( xChartType, UNO_QUERY_THROW );
@@ -378,9 +253,9 @@ Reference< chart2::XDataSeries > getDataSeriesFromDoc(uno::Reference<chart2::XCh
return xSeries;
}
-Reference< chart2::data::XDataSequence > getLabelDataSequenceFromDoc(
+Reference< chart2::data::XDataSequence > ChartTest::getLabelDataSequenceFromDoc(
Reference< chart2::XChartDocument > const & xChartDoc,
- sal_Int32 nDataSeries = 0, sal_Int32 nChartType = 0 )
+ sal_Int32 nDataSeries, sal_Int32 nChartType )
{
Reference< chart2::XDataSeries > xDataSeries =
getDataSeriesFromDoc( xChartDoc, nDataSeries, nChartType );
@@ -400,9 +275,9 @@ Reference< chart2::data::XDataSequence > getLabelDataSequenceFromDoc(
CPPUNIT_FAIL("no Label sequence found");
}
-Reference< chart2::data::XDataSequence > getDataSequenceFromDocByRole(
+Reference< chart2::data::XDataSequence > ChartTest::getDataSequenceFromDocByRole(
Reference< chart2::XChartDocument > const & xChartDoc, std::u16string_view rRole,
- sal_Int32 nDataSeries = 0, sal_Int32 nChartType = 0 )
+ sal_Int32 nDataSeries, sal_Int32 nChartType )
{
Reference< chart2::XDataSeries > xDataSeries =
getDataSeriesFromDoc( xChartDoc, nDataSeries, nChartType );
@@ -417,7 +292,7 @@ Reference< chart2::data::XDataSequence > getDataSequenceFromDocByRole(
if(!xProps.is())
continue;
- OUString aRoleName = xProps->getPropertyValue("Role").get<OUString>();
+ OUString aRoleName = xProps->getPropertyValue(u"Role"_ustr).get<OUString>();
if(aRoleName == rRole)
return xLabelSeq;
@@ -426,7 +301,7 @@ Reference< chart2::data::XDataSequence > getDataSequenceFromDocByRole(
return Reference< chart2::data::XDataSequence > ();
}
-uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XComponent > const & mxComponent )
+uno::Sequence < OUString > ChartTest::getWriterChartColumnDescriptions()
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
@@ -434,7 +309,7 @@ uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XC
CPPUNIT_ASSERT( xShape.is() );
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
uno::Reference< chart2::XChartDocument > xChartDoc;
- xChartDoc.set( xPropertySet->getPropertyValue( "Model" ), uno::UNO_QUERY );
+ xChartDoc.set( xPropertySet->getPropertyValue( u"Model"_ustr ), uno::UNO_QUERY );
CPPUNIT_ASSERT( xChartDoc.is() );
CPPUNIT_ASSERT( xChartDoc->getDataProvider().is() );
uno::Reference< chart2::XAnyDescriptionAccess > xAnyDescriptionAccess ( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
@@ -442,7 +317,7 @@ uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XC
return seriesList;
}
-std::vector<std::vector<double> > getDataSeriesYValuesFromChartType( const Reference<chart2::XChartType>& xCT )
+std::vector<std::vector<double> > ChartTest::getDataSeriesYValuesFromChartType( const Reference<chart2::XChartType>& xCT )
{
Reference<chart2::XDataSeriesContainer> xDSCont(xCT, uno::UNO_QUERY);
CPPUNIT_ASSERT(xDSCont.is());
@@ -463,7 +338,7 @@ std::vector<std::vector<double> > getDataSeriesYValuesFromChartType( const Refer
continue;
OUString aRoleName;
- xPropSet->getPropertyValue("Role") >>= aRoleName;
+ xPropSet->getPropertyValue(u"Role"_ustr) >>= aRoleName;
if (aRoleName == "values-y")
{
const uno::Sequence<uno::Any> aData = xValues->getData();
@@ -485,7 +360,7 @@ std::vector<std::vector<double> > getDataSeriesYValuesFromChartType( const Refer
return aRet;
}
-std::vector<uno::Sequence<uno::Any> > getDataSeriesLabelsFromChartType( const Reference<chart2::XChartType>& xCT )
+std::vector<uno::Sequence<uno::Any> > ChartTest::getDataSeriesLabelsFromChartType( const Reference<chart2::XChartType>& xCT )
{
OUString aLabelRole = xCT->getRoleOfSequenceForSeriesLabel();
@@ -508,7 +383,7 @@ std::vector<uno::Sequence<uno::Any> > getDataSeriesLabelsFromChartType( const Re
continue;
OUString aRoleName;
- xPropSet->getPropertyValue("Role") >>= aRoleName;
+ xPropSet->getPropertyValue(u"Role"_ustr) >>= aRoleName;
if (aRoleName == aLabelRole)
{
Reference<chart2::data::XLabeledDataSequence> xLabel = lds;
@@ -524,23 +399,6 @@ std::vector<uno::Sequence<uno::Any> > getDataSeriesLabelsFromChartType( const Re
return aRet;
}
-uno::Reference< chart::XChartDocument > ChartTest::getChartDocFromImpress( std::u16string_view pDir, const char* pName )
-{
- mxComponent = loadFromDesktop(m_directories.getURLFromSrc(pDir) + OUString::createFromAscii(pName), "com.sun.star.comp.Draw.PresentationDocument");
- uno::Reference< drawing::XDrawPagesSupplier > xDoc(mxComponent, uno::UNO_QUERY_THROW );
- uno::Reference< drawing::XDrawPage > xPage(
- xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xShapeProps(
- xPage->getByIndex(0), uno::UNO_QUERY );
- CPPUNIT_ASSERT(xShapeProps.is());
- uno::Reference< frame::XModel > xDocModel;
- xShapeProps->getPropertyValue("Model") >>= xDocModel;
- CPPUNIT_ASSERT(xDocModel.is());
- uno::Reference< chart::XChartDocument > xChartDoc( xDocModel, uno::UNO_QUERY_THROW );
-
- return xChartDoc;
-}
-
uno::Reference<chart::XChartDocument> ChartTest::getChartDocFromDrawImpress(
sal_Int32 nPage, sal_Int32 nShape )
{
@@ -558,7 +416,7 @@ uno::Reference<chart::XChartDocument> ChartTest::getChartDocFromDrawImpress(
return xEmpty;
uno::Reference<frame::XModel> xDocModel;
- xShapeProps->getPropertyValue("Model") >>= xDocModel;
+ xShapeProps->getPropertyValue(u"Model"_ustr) >>= xDocModel;
if (!xDocModel.is())
return xEmpty;
@@ -566,6 +424,7 @@ uno::Reference<chart::XChartDocument> ChartTest::getChartDocFromDrawImpress(
return xChartDoc;
}
+
uno::Reference<chart::XChartDocument> ChartTest::getChartDocFromWriter( sal_Int32 nShape )
{
// DO NOT use XDrawPageSupplier since SwVirtFlyDrawObj are not created
@@ -579,22 +438,14 @@ uno::Reference<chart::XChartDocument> ChartTest::getChartDocFromWriter( sal_Int3
CPPUNIT_ASSERT(xShapeProps.is());
Reference<frame::XModel> xDocModel;
- xShapeProps->getPropertyValue("Model") >>= xDocModel;
+ xShapeProps->getPropertyValue(u"Model"_ustr) >>= xDocModel;
CPPUNIT_ASSERT(xDocModel.is());
uno::Reference<chart::XChartDocument> xChartDoc(xDocModel, uno::UNO_QUERY);
return xChartDoc;
}
-uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions( std::u16string_view pDir, const char* pName )
-{
- uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromImpress( pDir, pName );
- uno::Reference< chart::XChartDataArray > xChartData ( xChartDoc->getData(), uno::UNO_QUERY_THROW);
- uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions();
- return seriesList;
-}
-
-OUString getTitleString( const Reference<chart2::XTitled>& xTitled )
+OUString ChartTest::getTitleString( const Reference<chart2::XTitled>& xTitled )
{
uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
CPPUNIT_ASSERT(xTitle.is());
@@ -606,16 +457,7 @@ OUString getTitleString( const Reference<chart2::XTitled>& xTitled )
return aText;
}
-sal_Int32 getNumberFormat( const Reference<chart2::XChartDocument>& xChartDoc, const OUString& sFormat )
-{
- Reference<util::XNumberFormatsSupplier> xNFS(xChartDoc, uno::UNO_QUERY_THROW);
- Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats();
- CPPUNIT_ASSERT(xNumberFormats.is());
-
- return xNumberFormats->queryKey(sFormat, css::lang::Locale(), false);
-}
-
-sal_Int32 getNumberFormatFromAxis( const Reference<chart2::XAxis>& xAxis )
+sal_Int32 ChartTest::getNumberFormatFromAxis( const Reference<chart2::XAxis>& xAxis )
{
Reference<beans::XPropertySet> xPS(xAxis, uno::UNO_QUERY);
CPPUNIT_ASSERT(xPS.is());
@@ -626,7 +468,7 @@ sal_Int32 getNumberFormatFromAxis( const Reference<chart2::XAxis>& xAxis )
return nNumberFormat;
}
-sal_Int16 getNumberFormatType( const Reference<chart2::XChartDocument>& xChartDoc, sal_Int32 nNumberFormat )
+sal_Int16 ChartTest::getNumberFormatType( const Reference<chart2::XChartDocument>& xChartDoc, sal_Int32 nNumberFormat )
{
Reference<util::XNumberFormatsSupplier> xNFS(xChartDoc, uno::UNO_QUERY_THROW);
Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats();
@@ -636,70 +478,14 @@ sal_Int16 getNumberFormatType( const Reference<chart2::XChartDocument>& xChartDo
CPPUNIT_ASSERT(xNumPS.is());
sal_Int16 nType = util::NumberFormat::UNDEFINED;
- xNumPS->getPropertyValue("Type") >>= nType;
+ xNumPS->getPropertyValue(u"Type"_ustr) >>= nType;
return nType;
}
-Sequence< double > getDateCategories(const Reference<chart2::XChartDocument>& 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<chart2::XChartDocument>& xChartDoc )
-{
- Reference<util::XNumberFormatsSupplier> 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<chart2::XAxis> 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<double> aDateSeq = getDateCategories(xChartDoc);
- const sal_Int32 nNumCategories = aDateSeq.getLength();
- Sequence<OUString> 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<chart2::XDiagram> 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<drawing::XShape>
-getShapeByName(const uno::Reference<drawing::XShapes>& rShapes, const OUString& rName,
- const std::function<bool(const uno::Reference<drawing::XShape>&)>& pCondition
- = nullptr)
+ChartTest::getShapeByName(const uno::Reference<drawing::XShapes>& rShapes, const OUString& rName,
+ const std::function<bool(const uno::Reference<drawing::XShape>&)>& pCondition)
{
for (sal_Int32 i = 0; i < rShapes->getCount(); ++i)
{
@@ -721,17 +507,4 @@ getShapeByName(const uno::Reference<drawing::XShapes>& rShapes, const OUString&
return uno::Reference<drawing::XShape>();
}
-xmlDocUniquePtr ChartTest::parseExport(const OUString& rDir, const OUString& rFilterFormat)
-{
- std::shared_ptr<utl::TempFile> pTempFile = save(rFilterFormat);
-
- // Read the XML stream we're interested in.
- uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), pTempFile->GetURL());
- uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(findChartFile(rDir, xNameAccess)), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xInputStream.is());
- std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
-
- return parseXmlStream(pStream.get());
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/qa/extras/data/docx/TableOnPage3.docx b/chart2/qa/extras/data/docx/TableOnPage3.docx
new file mode 100644
index 000000000000..79763bd35290
--- /dev/null
+++ b/chart2/qa/extras/data/docx/TableOnPage3.docx
Binary files differ
diff --git a/chart2/qa/extras/data/fods/tdf161483_AngleUnits.fods b/chart2/qa/extras/data/fods/tdf161483_AngleUnits.fods
new file mode 100644
index 000000000000..a71fb533165a
--- /dev/null
+++ b/chart2/qa/extras/data/fods/tdf161483_AngleUnits.fods
@@ -0,0 +1,1851 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.spreadsheet">
+ <office:meta>
+ <meta:generator>LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244
+ </meta:generator>
+ <dc:title>Metric</dc:title>
+ <meta:initial-creator>Regina Henschel</meta:initial-creator>
+ <meta:creation-date>2024-07-04T20:11:31</meta:creation-date>
+ <dc:creator>Regina Henschel</dc:creator>
+ <dc:date>2024-07-06T19:10:11</dc:date>
+ <meta:document-statistic meta:table-count="4" meta:object-count="4" meta:cell-count="100"/>
+ </office:meta>
+ <office:settings>
+ <config:config-item-set config:name="ooo:view-settings">
+ <config:config-item config:name="VisibleAreaTop" config:type="int">0</config:config-item>
+ <config:config-item config:name="VisibleAreaLeft" config:type="int">0</config:config-item>
+ <config:config-item config:name="VisibleAreaWidth" config:type="int">27494</config:config-item>
+ <config:config-item config:name="VisibleAreaHeight" config:type="int">13002</config:config-item>
+ <config:config-item-map-indexed config:name="Views">
+ <config:config-item-map-entry>
+ <config:config-item config:name="ViewId" config:type="string">view1</config:config-item>
+ <config:config-item-map-named config:name="Tables">
+ <config:config-item-map-entry config:name="deg">
+ <config:config-item config:name="CursorPositionX" config:type="int">1</config:config-item>
+ <config:config-item config:name="CursorPositionY" config:type="int">0</config:config-item>
+ <config:config-item config:name="ActiveSplitRange" config:type="short">2</config:config-item>
+ <config:config-item config:name="PositionLeft" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionRight" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionTop" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionBottom" config:type="int">0</config:config-item>
+ <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
+ <config:config-item config:name="ZoomValue" config:type="int">80</config:config-item>
+ <config:config-item config:name="PageViewZoomValue" config:type="int">60</config:config-item>
+ <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="LegacySingleLineFontwork" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ConnectorUseSnapRect" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IgnoreBreakAfterMultilineField" config:type="boolean">false</config:config-item>
+ </config:config-item-map-entry>
+ <config:config-item-map-entry config:name="grad">
+ <config:config-item config:name="CursorPositionX" config:type="int">1</config:config-item>
+ <config:config-item config:name="CursorPositionY" config:type="int">0</config:config-item>
+ <config:config-item config:name="ActiveSplitRange" config:type="short">2</config:config-item>
+ <config:config-item config:name="PositionLeft" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionRight" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionTop" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionBottom" config:type="int">0</config:config-item>
+ <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
+ <config:config-item config:name="ZoomValue" config:type="int">80</config:config-item>
+ <config:config-item config:name="PageViewZoomValue" config:type="int">60</config:config-item>
+ <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="LegacySingleLineFontwork" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ConnectorUseSnapRect" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IgnoreBreakAfterMultilineField" config:type="boolean">false</config:config-item>
+ </config:config-item-map-entry>
+ <config:config-item-map-entry config:name="noUnit">
+ <config:config-item config:name="CursorPositionX" config:type="int">0</config:config-item>
+ <config:config-item config:name="CursorPositionY" config:type="int">5</config:config-item>
+ <config:config-item config:name="ActiveSplitRange" config:type="short">2</config:config-item>
+ <config:config-item config:name="PositionLeft" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionRight" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionTop" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionBottom" config:type="int">0</config:config-item>
+ <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
+ <config:config-item config:name="ZoomValue" config:type="int">80</config:config-item>
+ <config:config-item config:name="PageViewZoomValue" config:type="int">60</config:config-item>
+ <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="LegacySingleLineFontwork" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ConnectorUseSnapRect" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IgnoreBreakAfterMultilineField" config:type="boolean">false</config:config-item>
+ </config:config-item-map-entry>
+ <config:config-item-map-entry config:name="rad">
+ <config:config-item config:name="CursorPositionX" config:type="int">1</config:config-item>
+ <config:config-item config:name="CursorPositionY" config:type="int">0</config:config-item>
+ <config:config-item config:name="ActiveSplitRange" config:type="short">2</config:config-item>
+ <config:config-item config:name="PositionLeft" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionRight" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionTop" config:type="int">0</config:config-item>
+ <config:config-item config:name="PositionBottom" config:type="int">0</config:config-item>
+ <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
+ <config:config-item config:name="ZoomValue" config:type="int">80</config:config-item>
+ <config:config-item config:name="PageViewZoomValue" config:type="int">60</config:config-item>
+ <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="LegacySingleLineFontwork" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ConnectorUseSnapRect" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IgnoreBreakAfterMultilineField" config:type="boolean">false</config:config-item>
+ </config:config-item-map-entry>
+ </config:config-item-map-named>
+ <config:config-item config:name="ActiveTable" config:type="string">noUnit</config:config-item>
+ <config:config-item config:name="HorizontalScrollbarWidth" config:type="int">1065</config:config-item>
+ <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
+ <config:config-item config:name="ZoomValue" config:type="int">80</config:config-item>
+ <config:config-item config:name="PageViewZoomValue" config:type="int">60</config:config-item>
+ <config:config-item config:name="ShowPageBreakPreview" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowZeroValues" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ShowNotes" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ShowNoteAuthor" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ShowFormulasMarks" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="GridColor" config:type="int">12632256</config:config-item>
+ <config:config-item config:name="FormulaBarHeight" config:type="short">1</config:config-item>
+ <config:config-item config:name="HasColumnRowHeaders" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="HasSheetTabs" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="IsOutlineSymbolsSet" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="IsValueHighlightingEnabled" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsSnapToRaster" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="RasterIsVisible" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="RasterResolutionX" config:type="int">500</config:config-item>
+ <config:config-item config:name="RasterResolutionY" config:type="int">500</config:config-item>
+ <config:config-item config:name="RasterSubdivisionX" config:type="int">4</config:config-item>
+ <config:config-item config:name="RasterSubdivisionY" config:type="int">4</config:config-item>
+ <config:config-item config:name="IsRasterAxisSynchronized" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="LegacySingleLineFontwork" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ConnectorUseSnapRect" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IgnoreBreakAfterMultilineField" config:type="boolean">false</config:config-item>
+ </config:config-item-map-entry>
+ </config:config-item-map-indexed>
+ </config:config-item-set>
+ <config:config-item-set config:name="ooo:configuration-settings">
+ <config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ApplyUserData" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="AutoCalculate" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item>
+ <config:config-item config:name="EmbedAsianScriptFonts" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="EmbedComplexScriptFonts" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="EmbedLatinScriptFonts" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="EmbedOnlyUsedFonts" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="GridColor" config:type="int">12632256</config:config-item>
+ <config:config-item config:name="HasColumnRowHeaders" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="HasSheetTabs" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ImagePreferredDPI" config:type="int">0</config:config-item>
+ <config:config-item config:name="IsDocumentShared" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsOutlineSymbolsSet" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="IsRasterAxisSynchronized" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="IsSnapToRaster" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="LinkUpdateMode" config:type="short">3</config:config-item>
+ <config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="PrinterPaperFromSetup" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="RasterIsVisible" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="RasterResolutionX" config:type="int">500</config:config-item>
+ <config:config-item config:name="RasterResolutionY" config:type="int">500</config:config-item>
+ <config:config-item config:name="RasterSubdivisionX" config:type="int">4</config:config-item>
+ <config:config-item config:name="RasterSubdivisionY" config:type="int">4</config:config-item>
+ <config:config-item config:name="SaveThumbnail" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowFormulasMarks" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ShowNoteAuthor" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ShowNotes" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ShowPageBreaks" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ShowZeroValues" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="SyntaxStringRef" config:type="short">7</config:config-item>
+ <config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>
+ <config:config-item-map-named config:name="ScriptConfiguration">
+ <config:config-item-map-entry config:name="noUnit">
+ <config:config-item config:name="CodeName" config:type="string">Sheet1</config:config-item>
+ </config:config-item-map-entry>
+ <config:config-item-map-entry config:name="deg">
+ <config:config-item config:name="CodeName" config:type="string">noUnit_2</config:config-item>
+ </config:config-item-map-entry>
+ <config:config-item-map-entry config:name="rad">
+ <config:config-item config:name="CodeName" config:type="string">deg_2</config:config-item>
+ </config:config-item-map-entry>
+ <config:config-item-map-entry config:name="grad">
+ <config:config-item config:name="CodeName" config:type="string">rad_2</config:config-item>
+ </config:config-item-map-entry>
+ </config:config-item-map-named>
+ </config:config-item-set>
+ </office:settings>
+ <office:scripts>
+ <office:script script:language="ooo:Basic">
+ <ooo:libraries xmlns:ooo="http://openoffice.org/2004/office" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <ooo:library-embedded ooo:name="Standard"/>
+ </ooo:libraries>
+ </office:script>
+ </office:scripts>
+ <office:font-face-decls>
+ <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ <style:font-face style:name="Lucida Sans" svg:font-family="&apos;Lucida Sans&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Microsoft YaHei" svg:font-family="&apos;Microsoft YaHei&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="table-cell">
+ <style:paragraph-properties style:tab-stop-distance="12.5mm"/>
+ <style:text-properties style:font-name="Liberation Sans" fo:font-size="10pt" fo:language="en" fo:country="US" style:font-name-asian="Microsoft YaHei" style:font-size-asian="10pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans" style:font-size-complex="10pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="3mm" draw:shadow-offset-y="3mm" style:writing-mode="page"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:punctuation-wrap="simple" style:line-break="strict" loext:tab-stop-distance="0mm" style:writing-mode="page" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" fo:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-family-asian="&apos;Segoe UI&apos;" style:font-family-generic-asian="system" style:font-pitch-asian="variable" style:font-size-asian="12pt" style:language-asian="zh" style:country-asian="CN" style:font-family-complex="Tahoma" style:font-family-generic-complex="system" style:font-pitch-complex="variable" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <style:style style:name="Default" style:family="graphic"/>
+ <style:style style:name="Note" style:family="graphic" style:parent-style-name="Default">
+ <style:graphic-properties draw:stroke="solid" draw:marker-start="Arrowheads_20_1" draw:marker-start-width="2mm" draw:marker-start-center="false" draw:fill="solid" draw:fill-color="#ffffc0" draw:auto-grow-height="true" draw:auto-grow-width="false" fo:padding-top="1mm" fo:padding-bottom="1mm" fo:padding-left="1mm" fo:padding-right="1mm" draw:shadow="visible" draw:shadow-offset-x="1mm" draw:shadow-offset-y="1mm"/>
+ <style:text-properties style:font-name="Liberation Sans" fo:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable" fo:font-size="10pt" style:font-name-asian="Microsoft YaHei" style:font-family-asian="&apos;Microsoft YaHei&apos;" style:font-family-generic-asian="system" style:font-pitch-asian="variable" style:font-size-asian="10pt" style:font-name-complex="Lucida Sans" style:font-family-complex="&apos;Lucida Sans&apos;" style:font-family-generic-complex="system" style:font-pitch-complex="variable" style:font-size-complex="10pt"/>
+ </style:style>
+ <number:number-style style:name="N0">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:currency-style style:name="N114P0" style:volatile="true">
+ <number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
+ <number:text> </number:text>
+ <number:currency-symbol number:language="de" number:country="DE">€</number:currency-symbol>
+ </number:currency-style>
+ <number:currency-style style:name="N114">
+ <style:text-properties fo:color="#ff0000"/>
+ <number:text>-</number:text>
+ <number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
+ <number:text> </number:text>
+ <number:currency-symbol number:language="de" number:country="DE">€</number:currency-symbol>
+ <style:map style:condition="value()&gt;=0" style:apply-style-name="N114P0"/>
+ </number:currency-style>
+ <style:style style:name="Default" style:family="table-cell"/>
+ <style:style style:name="Heading" style:family="table-cell" style:parent-style-name="Default">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:font-size="24pt" fo:font-style="normal" fo:font-weight="bold" style:font-size-asian="24pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:font-size-complex="24pt" style:font-style-complex="normal" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="table-cell" style:parent-style-name="Heading">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:font-size="18pt" style:font-size-asian="18pt" style:font-size-complex="18pt"/>
+ </style:style>
+ <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="table-cell" style:parent-style-name="Heading">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:font-size="12pt" style:font-size-asian="12pt" style:font-size-complex="12pt"/>
+ </style:style>
+ <style:style style:name="Text" style:family="table-cell" style:parent-style-name="Default">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ </style:style>
+ <style:style style:name="Note" style:family="table-cell" style:parent-style-name="Text">
+ <style:table-cell-properties fo:background-color="#ffffcc" style:diagonal-bl-tr="none" style:diagonal-tl-br="none" fo:wrap-option="no-wrap" fo:border="0.74pt solid #808080" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#333333"/>
+ </style:style>
+ <style:style style:name="Footnote" style:family="table-cell" style:parent-style-name="Text">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#808080" fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="Hyperlink" style:family="table-cell" style:parent-style-name="Text">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#0000ee" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="#0000ee"/>
+ </style:style>
+ <style:style style:name="Status" style:family="table-cell" style:parent-style-name="Default">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ </style:style>
+ <style:style style:name="Good" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ccffcc" fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#006600"/>
+ </style:style>
+ <style:style style:name="Neutral" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ffffcc" fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#996600"/>
+ </style:style>
+ <style:style style:name="Bad" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ffcccc" fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#cc0000"/>
+ </style:style>
+ <style:style style:name="Warning" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#cc0000"/>
+ </style:style>
+ <style:style style:name="Error" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#cc0000" fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#ffffff" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Accent" style:family="table-cell" style:parent-style-name="Default">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Accent_20_1" style:display-name="Accent 1" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#000000" fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#ffffff"/>
+ </style:style>
+ <style:style style:name="Accent_20_2" style:display-name="Accent 2" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#808080" fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:color="#ffffff"/>
+ </style:style>
+ <style:style style:name="Accent_20_3" style:display-name="Accent 3" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#dddddd" fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ </style:style>
+ <style:style style:name="Result" style:family="table-cell" style:parent-style-name="Default">
+ <style:table-cell-properties fo:wrap-option="no-wrap" style:shrink-to-fit="false"/>
+ <style:text-properties fo:font-style="italic" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+ </style:style>
+ <draw:marker draw:name="Arrowheads_20_1" draw:display-name="Arrowheads 1" svg:viewBox="0 0 20 30" svg:d="M10 0l-10 30h20z"/>
+ <loext:theme loext:name="Office">
+ <loext:theme-colors loext:name="LibreOffice">
+ <loext:color loext:name="dark1" loext:color="#000000"/>
+ <loext:color loext:name="light1" loext:color="#ffffff"/>
+ <loext:color loext:name="dark2" loext:color="#000000"/>
+ <loext:color loext:name="light2" loext:color="#ffffff"/>
+ <loext:color loext:name="accent1" loext:color="#18a303"/>
+ <loext:color loext:name="accent2" loext:color="#0369a3"/>
+ <loext:color loext:name="accent3" loext:color="#a33e03"/>
+ <loext:color loext:name="accent4" loext:color="#8e03a3"/>
+ <loext:color loext:name="accent5" loext:color="#c99c00"/>
+ <loext:color loext:name="accent6" loext:color="#c9211e"/>
+ <loext:color loext:name="hyperlink" loext:color="#0000ee"/>
+ <loext:color loext:name="followed-hyperlink" loext:color="#551a8b"/>
+ </loext:theme-colors>
+ </loext:theme>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="co1" style:family="table-column">
+ <style:table-column-properties fo:break-before="auto" style:column-width="24.99mm"/>
+ </style:style>
+ <style:style style:name="ro1" style:family="table-row">
+ <style:table-row-properties style:row-height="10mm" fo:break-before="auto" style:use-optimal-row-height="false"/>
+ </style:style>
+ <style:style style:name="ta1" style:family="table" style:master-page-name="Default">
+ <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
+ </style:style>
+ <number:number-style style:name="N2">
+ <number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1"/>
+ </number:number-style>
+ <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default">
+ <style:table-cell-properties style:text-align-source="fix" style:repeat-content="false" style:vertical-align="middle"/>
+ <style:paragraph-properties fo:text-align="center" fo:margin-left="0mm"/>
+ </style:style>
+ <style:style style:name="ce2" style:family="table-cell" style:parent-style-name="Default">
+ <style:table-cell-properties style:text-align-source="fix" style:repeat-content="false" style:vertical-align="middle"/>
+ <style:paragraph-properties fo:text-align="center" fo:margin-left="0mm"/>
+ <style:text-properties fo:font-size="14pt" style:font-size-asian="14pt" style:font-size-complex="14pt"/>
+ </style:style>
+ <style:style style:name="gr1" style:family="graphic" style:parent-style-name="Default">
+ <style:graphic-properties draw:stroke="none" draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" draw:ole-draw-aspect="1" loext:decorative="false"/>
+ <style:paragraph-properties fo:text-align="center"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties style:writing-mode="lr-tb"/>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="7.5mm" fo:margin-left="0mm" fo:margin-right="0mm" fo:margin-bottom="2.5mm"/>
+ </style:header-style>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="7.5mm" fo:margin-left="0mm" fo:margin-right="0mm" fo:margin-top="2.5mm"/>
+ </style:footer-style>
+ </style:page-layout>
+ <style:page-layout style:name="pm2">
+ <style:page-layout-properties style:writing-mode="lr-tb"/>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="7.5mm" fo:margin-left="0mm" fo:margin-right="0mm" fo:margin-bottom="2.5mm" fo:border="1.5pt solid #000000" fo:padding="0.18mm" fo:background-color="#c0c0c0">
+ <style:background-image/>
+ </style:header-footer-properties>
+ </style:header-style>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="7.5mm" fo:margin-left="0mm" fo:margin-right="0mm" fo:margin-top="2.5mm" fo:border="1.5pt solid #000000" fo:padding="0.18mm" fo:background-color="#c0c0c0">
+ <style:background-image/>
+ </style:header-footer-properties>
+ </style:footer-style>
+ </style:page-layout>
+ <style:style style:name="P1" style:family="paragraph">
+ <loext:graphic-properties draw:fill="none"/>
+ <style:paragraph-properties fo:text-align="center"/>
+ </style:style>
+ <style:style style:name="T1" style:family="text">
+ <style:text-properties style:text-position="super 58%"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Default" style:page-layout-name="pm1">
+ <style:header>
+ <text:p><text:sheet-name>???</text:sheet-name></text:p>
+ </style:header>
+ <style:header-left style:display="false"/>
+ <style:header-first style:display="false"/>
+ <style:footer>
+ <text:p>Page <text:page-number>1</text:page-number></text:p>
+ </style:footer>
+ <style:footer-left style:display="false"/>
+ <style:footer-first style:display="false"/>
+ </style:master-page>
+ <style:master-page style:name="Report" style:page-layout-name="pm2">
+ <style:header>
+ <style:region-left>
+ <text:p><text:sheet-name>???</text:sheet-name><text:s/>(<text:title>???</text:title>)</text:p>
+ </style:region-left>
+ <style:region-right>
+ <text:p><text:date style:data-style-name="N2" text:date-value="2024-07-06">00.00.0000</text:date>, <text:time style:data-style-name="N2" text:time-value="19:05:19.058000000">00:00:00</text:time></text:p>
+ </style:region-right>
+ </style:header>
+ <style:header-left style:display="false"/>
+ <style:header-first style:display="false"/>
+ <style:footer>
+ <text:p>Page <text:page-number>1</text:page-number><text:s/>/ <text:page-count>99</text:page-count></text:p>
+ </style:footer>
+ <style:footer-left style:display="false"/>
+ <style:footer-first style:display="false"/>
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:spreadsheet>
+ <table:calculation-settings table:automatic-find-labels="false" table:use-regular-expressions="false" table:use-wildcards="true"/>
+ <table:table table:name="noUnit" table:style-name="ta1">
+ <table:shapes>
+ <draw:frame draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="131.81mm" svg:height="114.48mm" svg:x="138.64mm" svg:y="8.51mm">
+ <draw:object draw:notify-on-update-of-ranges="noUnit.B1:noUnit.E1 noUnit.A2:noUnit.A2 noUnit.B2:noUnit.E2 noUnit.A3:noUnit.A3 noUnit.B3:noUnit.E3 noUnit.A4:noUnit.A4 noUnit.B4:noUnit.E4 noUnit.A5:noUnit.A5 noUnit.B5:noUnit.E5">
+ <loext:p/>
+ <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:chartooo="http://openoffice.org/2010/chart" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.chart">
+ <office:meta>
+ <meta:generator>LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244
+ </meta:generator>
+ </office:meta>
+ <office:styles/>
+ <office:automatic-styles>
+ <number:number-style style:name="N0">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:number-style style:name="N10000" number:language="en" number:country="US">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:text-style style:name="N10100" number:language="en" number:country="US">
+ <number:text-content/>
+ </number:text-style>
+ <style:style style:name="ch1" style:family="chart">
+ <style:graphic-properties draw:stroke="none"/>
+ </style:style>
+ <style:style style:name="ch2" style:family="chart">
+ <style:chart-properties chart:auto-position="true" style:rotation-angle="0"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch3" style:family="chart">
+ <style:chart-properties chart:three-dimensional="true" chart:deep="true" chart:include-hidden-cells="false" chart:treat-empty-cells="leave-gap" chart:series-source="rows"/>
+ </style:style>
+ <style:style style:name="ch4" style:family="chart" style:data-style-name="N10100">
+ <style:chart-properties chart:display-label="true" chart:tick-marks-major-inner="true" chart:tick-marks-major-outer="true" chart:logarithmic="false" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="false" loext:major-origin="0.5" chart:axis-position="0" style:rotation-angle="344.61"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch5" style:family="chart">
+ <style:chart-properties style:rotation-angle="342.63"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch6" style:family="chart">
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ </style:style>
+ <style:style style:name="ch7" style:family="chart" style:data-style-name="N10000">
+ <style:chart-properties chart:display-label="true" chart:logarithmic="false" chart:origin="0" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="false" chart:axis-position="start" style:rotation-angle="15.12"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch8" style:family="chart">
+ <style:chart-properties style:rotation-angle="14.94"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch9" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:display-label="true" chart:logarithmic="false" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="true" chart:axis-position="0" style:rotation-angle="344.16"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch10" style:family="chart">
+ <style:chart-properties style:rotation-angle="60.39"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch11" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#004586" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch12" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#ff420e" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch13" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#ffd320" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch14" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#579d1c" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch15" style:family="chart">
+ <style:graphic-properties draw:stroke="solid" svg:stroke-color="#b3b3b3" draw:fill="none" draw:fill-color="#e6e6e6"/>
+ </style:style>
+ <style:style style:name="ch16" style:family="chart">
+ <style:graphic-properties svg:stroke-color="#b3b3b3" draw:fill-color="#cccccc"/>
+ </style:style>
+ <style:style style:name="T1" style:family="text">
+ <style:text-properties style:text-position="0% 100%" fo:font-size="14pt" style:letter-kerning="false" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ <style:style style:name="T2" style:family="text">
+ <style:text-properties style:text-position="0% 100%" fo:font-size="12pt" style:letter-kerning="false" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:body>
+ <office:chart>
+ <chart:chart svg:width="13.182cm" svg:height="11.449cm" xlink:href=".." xlink:type="simple" chart:class="chart:bar" chart:style-name="ch1">
+ <chart:title svg:x="5.343cm" svg:y="0.364cm" chart:style-name="ch2">
+ <text:p>Sales 2023</text:p>
+ </chart:title>
+ <chart:plot-area chart:style-name="ch3" table:cell-range-address="noUnit.A1:noUnit.E5" chart:data-source-has-labels="both" svg:x="1.538cm" svg:y="2.274cm" svg:width="9.651cm" svg:height="8.235cm" dr3d:transform="matrix (0.99826182973735 -0.0588167250409028 -0.00372989877902358 0.058817028267118 0.990268191440696 0.126132732494774 -0.0037251141276423 -0.126132873891924 0.992006361697595 0cm 0cm 0cm)" dr3d:vrp="(17634.6218373783 10271.4823817647 24594.8639082739)" dr3d:vpn="(0.416199821709347 0.173649045905254 0.892537795986984)" dr3d:vup="(-0.0733876362771618 0.984807599917971 -0.157379306090273)" dr3d:projection="perspective" dr3d:distance="4.2cm" dr3d:focal-length="8cm" dr3d:shadow-slant="0" dr3d:shade-mode="gouraud" dr3d:ambient-color="#999999" dr3d:lighting-mode="true">
+ <chart:coordinate-region svg:x="2.275cm" svg:y="2.274cm" svg:width="8.328cm" svg:height="7.646cm"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="true"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(-0.422618261740699 -0.280064508328675 0.861949926630247)" dr3d:enabled="true" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <chart:axis chart:dimension="x" chart:name="primary-x" chart:style-name="ch4" chartooo:axis-type="text">
+ <chart:title svg:x="3.149cm" svg:y="9.217cm" chart:style-name="ch5">
+ <text:p>
+ <text:span text:style-name="T1">Quarter</text:span></text:p>
+ </chart:title>
+ <chart:categories table:cell-range-address="noUnit.B1:noUnit.E1"/>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:axis chart:dimension="y" chart:name="primary-y" chart:style-name="ch7">
+ <chart:title svg:x="2.032cm" svg:y="2.302cm" chart:style-name="ch8">
+ <text:p>
+ <text:span text:style-name="T2">in 1000 EUR</text:span></text:p>
+ </chart:title>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:axis chart:dimension="z" chart:name="primary-z" chart:style-name="ch9">
+ <chart:title svg:x="10.235cm" svg:y="9.648cm" chart:style-name="ch10">
+ <text:p>
+ <text:span text:style-name="T1">Seller</text:span></text:p>
+ </chart:title>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:series chart:style-name="ch11" chart:values-cell-range-address="noUnit.B2:noUnit.E2" chart:label-cell-address="noUnit.A2:noUnit.A2" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch12" chart:values-cell-range-address="noUnit.B3:noUnit.E3" chart:label-cell-address="noUnit.A3:noUnit.A3" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch13" chart:values-cell-range-address="noUnit.B4:noUnit.E4" chart:label-cell-address="noUnit.A4:noUnit.A4" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch14" chart:values-cell-range-address="noUnit.B5:noUnit.E5" chart:label-cell-address="noUnit.A5:noUnit.A5" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:wall chart:style-name="ch15"/>
+ <chart:floor chart:style-name="ch16"/>
+ </chart:plot-area>
+ <table:table table:name="local-table">
+ <table:table-header-columns>
+ <table:table-column/>
+ </table:table-header-columns>
+ <table:table-columns>
+ <table:table-column table:number-columns-repeated="4"/>
+ </table:table-columns>
+ <table:table-header-rows>
+ <table:table-row>
+ <table:table-cell>
+ <text:p/>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>1st</text:p>
+ <draw:g>
+ <svg:desc>noUnit.B1:noUnit.E1</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>2nd</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>3rd</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>4th</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table-header-rows>
+ <table:table-rows>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>John</text:p>
+ <draw:g>
+ <svg:desc>noUnit.A2:noUnit.A2</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="72">
+ <text:p>72</text:p>
+ <draw:g>
+ <svg:desc>noUnit.B2:noUnit.E2</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="42">
+ <text:p>42</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="45">
+ <text:p>45</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12">
+ <text:p>12</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Mary</text:p>
+ <draw:g>
+ <svg:desc>noUnit.A3:noUnit.A3</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56">
+ <text:p>56</text:p>
+ <draw:g>
+ <svg:desc>noUnit.B3:noUnit.E3</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="13">
+ <text:p>13</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="84">
+ <text:p>84</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Tim</text:p>
+ <draw:g>
+ <svg:desc>noUnit.A4:noUnit.A4</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="44">
+ <text:p>44</text:p>
+ <draw:g>
+ <svg:desc>noUnit.B4:noUnit.E4</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="30">
+ <text:p>30</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="23">
+ <text:p>23</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="27">
+ <text:p>27</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Doris</text:p>
+ <draw:g>
+ <svg:desc>noUnit.A5:noUnit.A5</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="89">
+ <text:p>89</text:p>
+ <draw:g>
+ <svg:desc>noUnit.B5:noUnit.E5</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="48">
+ <text:p>48</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="54">
+ <text:p>54</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="37">
+ <text:p>37</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table-rows>
+ </table:table>
+ </chart:chart>
+ </office:chart>
+ </office:body>
+ </office:document>
+ </draw:object>
+ </draw:frame></table:shapes>
+ <table:table-column table:style-name="co1" table:number-columns-repeated="16384" table:default-cell-style-name="Default"/>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:style-name="ce1" office:value-type="float" office:value="2023" calcext:value-type="float">
+ <text:p>2023</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>1<text:span text:style-name="T1">st</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>2<text:span text:style-name="T1">nd</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>3<text:span text:style-name="T1">rd</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>4<text:span text:style-name="T1">th</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>John</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="72" calcext:value-type="float">
+ <text:p>72</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="42" calcext:value-type="float">
+ <text:p>42</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="45" calcext:value-type="float">
+ <text:p>45</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12" calcext:value-type="float">
+ <text:p>12</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Mary</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56" calcext:value-type="float">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="13" calcext:value-type="float">
+ <text:p>13</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56" calcext:value-type="float">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="84" calcext:value-type="float">
+ <text:p>84</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Tim</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="44" calcext:value-type="float">
+ <text:p>44</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="30" calcext:value-type="float">
+ <text:p>30</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="23" calcext:value-type="float">
+ <text:p>23</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="27" calcext:value-type="float">
+ <text:p>27</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Doris</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="89" calcext:value-type="float">
+ <text:p>89</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="48" calcext:value-type="float">
+ <text:p>48</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="54" calcext:value-type="float">
+ <text:p>54</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="37" calcext:value-type="float">
+ <text:p>37</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1" table:number-rows-repeated="1048570">
+ <table:table-cell table:number-columns-repeated="16384"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:number-columns-repeated="16384"/>
+ </table:table-row>
+ </table:table>
+ <table:table table:name="deg" table:style-name="ta1">
+ <table:shapes>
+ <draw:frame draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="131.81mm" svg:height="114.48mm" svg:x="138.64mm" svg:y="8.51mm">
+ <draw:object draw:notify-on-update-of-ranges="deg.B1:deg.E1 deg.A2:deg.A2 deg.B2:deg.E2 deg.A3:deg.A3 deg.B3:deg.E3 deg.A4:deg.A4 deg.B4:deg.E4 deg.A5:deg.A5 deg.B5:deg.E5">
+ <loext:p/>
+ <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:chartooo="http://openoffice.org/2010/chart" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.chart">
+ <office:meta>
+ <meta:generator>LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244
+ </meta:generator>
+ </office:meta>
+ <office:styles/>
+ <office:automatic-styles>
+ <number:number-style style:name="N0">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:number-style style:name="N10000" number:language="en" number:country="US">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:text-style style:name="N10100" number:language="en" number:country="US">
+ <number:text-content/>
+ </number:text-style>
+ <style:style style:name="ch1" style:family="chart">
+ <style:graphic-properties draw:stroke="none"/>
+ </style:style>
+ <style:style style:name="ch2" style:family="chart">
+ <style:chart-properties chart:auto-position="true" style:rotation-angle="0"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch3" style:family="chart">
+ <style:chart-properties chart:three-dimensional="true" chart:deep="true" chart:include-hidden-cells="false" chart:treat-empty-cells="leave-gap" chart:series-source="rows"/>
+ </style:style>
+ <style:style style:name="ch4" style:family="chart" style:data-style-name="N10100">
+ <style:chart-properties chart:display-label="true" chart:tick-marks-major-inner="true" chart:tick-marks-major-outer="true" chart:logarithmic="false" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="false" loext:major-origin="0.5" chart:axis-position="0" style:rotation-angle="344.61deg"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch5" style:family="chart">
+ <style:chart-properties style:rotation-angle="342.63deg"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch6" style:family="chart">
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ </style:style>
+ <style:style style:name="ch7" style:family="chart" style:data-style-name="N10000">
+ <style:chart-properties chart:display-label="true" chart:logarithmic="false" chart:origin="0" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="false" chart:axis-position="start" style:rotation-angle="15.12deg"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch8" style:family="chart">
+ <style:chart-properties style:rotation-angle="14.94deg"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch9" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:display-label="true" chart:logarithmic="false" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="true" chart:axis-position="0" style:rotation-angle="344.16deg"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch10" style:family="chart">
+ <style:chart-properties style:rotation-angle="60.39deg"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch11" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#004586" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch12" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#ff420e" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch13" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#ffd320" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch14" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#579d1c" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch15" style:family="chart">
+ <style:graphic-properties draw:stroke="solid" svg:stroke-color="#b3b3b3" draw:fill="none" draw:fill-color="#e6e6e6"/>
+ </style:style>
+ <style:style style:name="ch16" style:family="chart">
+ <style:graphic-properties svg:stroke-color="#b3b3b3" draw:fill-color="#cccccc"/>
+ </style:style>
+ <style:style style:name="T1" style:family="text">
+ <style:text-properties style:text-position="0% 100%" fo:font-size="14pt" style:letter-kerning="false" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ <style:style style:name="T2" style:family="text">
+ <style:text-properties style:text-position="0% 100%" fo:font-size="12pt" style:letter-kerning="false" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:body>
+ <office:chart>
+ <chart:chart svg:width="13.182cm" svg:height="11.449cm" xlink:href=".." xlink:type="simple" chart:class="chart:bar" chart:style-name="ch1">
+ <chart:title svg:x="5.343cm" svg:y="0.364cm" chart:style-name="ch2">
+ <text:p>Sales 2023</text:p>
+ </chart:title>
+ <chart:plot-area chart:style-name="ch3" table:cell-range-address="deg.A1:deg.E5" chart:data-source-has-labels="both" svg:x="1.538cm" svg:y="2.274cm" svg:width="9.651cm" svg:height="8.235cm" dr3d:transform="matrix (0.99826182973735 -0.0588167250409028 -0.00372989877902358 0.058817028267118 0.990268191440696 0.126132732494774 -0.0037251141276423 -0.126132873891924 0.992006361697595 0cm 0cm 0cm)" dr3d:vrp="(17634.6218373783 10271.4823817647 24594.8639082739)" dr3d:vpn="(0.416199821709347 0.173649045905254 0.892537795986984)" dr3d:vup="(-0.0733876362771618 0.984807599917971 -0.157379306090273)" dr3d:projection="perspective" dr3d:distance="4.2cm" dr3d:focal-length="8cm" dr3d:shadow-slant="0" dr3d:shade-mode="gouraud" dr3d:ambient-color="#999999" dr3d:lighting-mode="true">
+ <chart:coordinate-region svg:x="2.275cm" svg:y="2.274cm" svg:width="8.328cm" svg:height="7.646cm"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="true"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(-0.422618261740699 -0.280064508328675 0.861949926630247)" dr3d:enabled="true" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <chart:axis chart:dimension="x" chart:name="primary-x" chart:style-name="ch4" chartooo:axis-type="text">
+ <chart:title svg:x="3.15cm" svg:y="9.218cm" chart:style-name="ch5">
+ <text:p>
+ <text:span text:style-name="T1">Quarter</text:span></text:p>
+ </chart:title>
+ <chart:categories table:cell-range-address="deg.B1:deg.E1"/>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:axis chart:dimension="y" chart:name="primary-y" chart:style-name="ch7">
+ <chart:title svg:x="2.032cm" svg:y="2.302cm" chart:style-name="ch8">
+ <text:p>
+ <text:span text:style-name="T2">in 1000 EUR</text:span></text:p>
+ </chart:title>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:axis chart:dimension="z" chart:name="primary-z" chart:style-name="ch9">
+ <chart:title svg:x="10.236cm" svg:y="9.648cm" chart:style-name="ch10">
+ <text:p>
+ <text:span text:style-name="T1">Seller</text:span></text:p>
+ </chart:title>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:series chart:style-name="ch11" chart:values-cell-range-address="deg.B2:deg.E2" chart:label-cell-address="deg.A2:deg.A2" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch12" chart:values-cell-range-address="deg.B3:deg.E3" chart:label-cell-address="deg.A3:deg.A3" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch13" chart:values-cell-range-address="deg.B4:deg.E4" chart:label-cell-address="deg.A4:deg.A4" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch14" chart:values-cell-range-address="deg.B5:deg.E5" chart:label-cell-address="deg.A5:deg.A5" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:wall chart:style-name="ch15"/>
+ <chart:floor chart:style-name="ch16"/>
+ </chart:plot-area>
+ <table:table table:name="local-table">
+ <table:table-header-columns>
+ <table:table-column/>
+ </table:table-header-columns>
+ <table:table-columns>
+ <table:table-column table:number-columns-repeated="4"/>
+ </table:table-columns>
+ <table:table-header-rows>
+ <table:table-row>
+ <table:table-cell>
+ <text:p/>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>1st</text:p>
+ <draw:g>
+ <svg:desc>deg.B1:deg.E1</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>2nd</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>3rd</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>4th</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table-header-rows>
+ <table:table-rows>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>John</text:p>
+ <draw:g>
+ <svg:desc>deg.A2:deg.A2</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="72">
+ <text:p>72</text:p>
+ <draw:g>
+ <svg:desc>deg.B2:deg.E2</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="42">
+ <text:p>42</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="45">
+ <text:p>45</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12">
+ <text:p>12</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Mary</text:p>
+ <draw:g>
+ <svg:desc>deg.A3:deg.A3</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56">
+ <text:p>56</text:p>
+ <draw:g>
+ <svg:desc>deg.B3:deg.E3</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="13">
+ <text:p>13</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="84">
+ <text:p>84</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Tim</text:p>
+ <draw:g>
+ <svg:desc>deg.A4:deg.A4</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="44">
+ <text:p>44</text:p>
+ <draw:g>
+ <svg:desc>deg.B4:deg.E4</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="30">
+ <text:p>30</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="23">
+ <text:p>23</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="27">
+ <text:p>27</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Doris</text:p>
+ <draw:g>
+ <svg:desc>deg.A5:deg.A5</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="89">
+ <text:p>89</text:p>
+ <draw:g>
+ <svg:desc>deg.B5:deg.E5</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="48">
+ <text:p>48</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="54">
+ <text:p>54</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="37">
+ <text:p>37</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table-rows>
+ </table:table>
+ </chart:chart>
+ </office:chart>
+ </office:body>
+ </office:document>
+ </draw:object>
+ </draw:frame></table:shapes>
+ <table:table-column table:style-name="co1" table:number-columns-repeated="16384" table:default-cell-style-name="Default"/>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:style-name="ce1" office:value-type="float" office:value="2023" calcext:value-type="float">
+ <text:p>2023</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>1<text:span text:style-name="T1">st</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>2<text:span text:style-name="T1">nd</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>3<text:span text:style-name="T1">rd</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>4<text:span text:style-name="T1">th</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>John</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="72" calcext:value-type="float">
+ <text:p>72</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="42" calcext:value-type="float">
+ <text:p>42</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="45" calcext:value-type="float">
+ <text:p>45</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12" calcext:value-type="float">
+ <text:p>12</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Mary</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56" calcext:value-type="float">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="13" calcext:value-type="float">
+ <text:p>13</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56" calcext:value-type="float">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="84" calcext:value-type="float">
+ <text:p>84</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Tim</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="44" calcext:value-type="float">
+ <text:p>44</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="30" calcext:value-type="float">
+ <text:p>30</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="23" calcext:value-type="float">
+ <text:p>23</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="27" calcext:value-type="float">
+ <text:p>27</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Doris</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="89" calcext:value-type="float">
+ <text:p>89</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="48" calcext:value-type="float">
+ <text:p>48</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="54" calcext:value-type="float">
+ <text:p>54</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="37" calcext:value-type="float">
+ <text:p>37</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1" table:number-rows-repeated="1048570">
+ <table:table-cell table:number-columns-repeated="16384"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:number-columns-repeated="16384"/>
+ </table:table-row>
+ </table:table>
+ <table:table table:name="rad" table:style-name="ta1">
+ <table:shapes>
+ <draw:frame draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="131.81mm" svg:height="114.48mm" svg:x="138.64mm" svg:y="8.51mm">
+ <draw:object draw:notify-on-update-of-ranges="rad.B1:rad.E1 rad.A2:rad.A2 rad.B2:rad.E2 rad.A3:rad.A3 rad.B3:rad.E3 rad.A4:rad.A4 rad.B4:rad.E4 rad.A5:rad.A5 rad.B5:rad.E5">
+ <loext:p/>
+ <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:chartooo="http://openoffice.org/2010/chart" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.chart">
+ <office:meta>
+ <meta:generator>LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244
+ </meta:generator>
+ </office:meta>
+ <office:styles/>
+ <office:automatic-styles>
+ <number:number-style style:name="N0">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:number-style style:name="N10000" number:language="en" number:country="US">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:text-style style:name="N10100" number:language="en" number:country="US">
+ <number:text-content/>
+ </number:text-style>
+ <style:style style:name="ch1" style:family="chart">
+ <style:graphic-properties draw:stroke="none"/>
+ </style:style>
+ <style:style style:name="ch2" style:family="chart">
+ <style:chart-properties chart:auto-position="true" style:rotation-angle="0"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch3" style:family="chart">
+ <style:chart-properties chart:three-dimensional="true" chart:deep="true" chart:include-hidden-cells="false" chart:treat-empty-cells="leave-gap" chart:series-source="rows"/>
+ </style:style>
+ <style:style style:name="ch4" style:family="chart" style:data-style-name="N10100">
+ <style:chart-properties chart:display-label="true" chart:tick-marks-major-inner="true" chart:tick-marks-major-outer="true" chart:logarithmic="false" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="false" loext:major-origin="0.5" chart:axis-position="0" style:rotation-angle="6.01457913529766rad"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch5" style:family="chart">
+ <style:chart-properties style:rotation-angle="5.98002161610817rad"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch6" style:family="chart">
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ </style:style>
+ <style:style style:name="ch7" style:family="chart" style:data-style-name="N10000">
+ <style:chart-properties chart:display-label="true" chart:logarithmic="false" chart:origin="0" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="false" chart:axis-position="start" style:rotation-angle="0.263893782901543rad"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch8" style:family="chart">
+ <style:chart-properties style:rotation-angle="0.260752190247953rad"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch9" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:display-label="true" chart:logarithmic="false" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="true" chart:axis-position="0" style:rotation-angle="6.00672515366369rad"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch10" style:family="chart">
+ <style:chart-properties style:rotation-angle="1.05400433527938rad"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch11" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#004586" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch12" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#ff420e" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch13" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#ffd320" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch14" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#579d1c" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch15" style:family="chart">
+ <style:graphic-properties draw:stroke="solid" svg:stroke-color="#b3b3b3" draw:fill="none" draw:fill-color="#e6e6e6"/>
+ </style:style>
+ <style:style style:name="ch16" style:family="chart">
+ <style:graphic-properties svg:stroke-color="#b3b3b3" draw:fill-color="#cccccc"/>
+ </style:style>
+ <style:style style:name="T1" style:family="text">
+ <style:text-properties style:text-position="0% 100%" fo:font-size="14pt" style:letter-kerning="false" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ <style:style style:name="T2" style:family="text">
+ <style:text-properties style:text-position="0% 100%" fo:font-size="12pt" style:letter-kerning="false" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:body>
+ <office:chart>
+ <chart:chart svg:width="13.182cm" svg:height="11.449cm" xlink:href=".." xlink:type="simple" chart:class="chart:bar" chart:style-name="ch1">
+ <chart:title svg:x="5.343cm" svg:y="0.364cm" chart:style-name="ch2">
+ <text:p>Sales 2023</text:p>
+ </chart:title>
+ <chart:plot-area chart:style-name="ch3" table:cell-range-address="rad.A1:rad.E5" chart:data-source-has-labels="both" svg:x="1.538cm" svg:y="2.274cm" svg:width="9.651cm" svg:height="8.235cm" dr3d:transform="matrix (0.99826182973735 -0.0588167250409028 -0.00372989877902358 0.058817028267118 0.990268191440696 0.126132732494774 -0.0037251141276423 -0.126132873891924 0.992006361697595 0cm 0cm 0cm)" dr3d:vrp="(17634.6218373783 10271.4823817647 24594.8639082739)" dr3d:vpn="(0.416199821709347 0.173649045905254 0.892537795986984)" dr3d:vup="(-0.0733876362771618 0.984807599917971 -0.157379306090273)" dr3d:projection="perspective" dr3d:distance="4.2cm" dr3d:focal-length="8cm" dr3d:shadow-slant="0" dr3d:shade-mode="gouraud" dr3d:ambient-color="#999999" dr3d:lighting-mode="true">
+ <chart:coordinate-region svg:x="2.275cm" svg:y="2.274cm" svg:width="8.328cm" svg:height="7.646cm"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="true"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(-0.422618261740699 -0.280064508328675 0.861949926630247)" dr3d:enabled="true" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <chart:axis chart:dimension="x" chart:name="primary-x" chart:style-name="ch4" chartooo:axis-type="text">
+ <chart:title svg:x="3.15cm" svg:y="9.218cm" chart:style-name="ch5">
+ <text:p>
+ <text:span text:style-name="T1">Quarter</text:span></text:p>
+ </chart:title>
+ <chart:categories table:cell-range-address="rad.B1:rad.E1"/>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:axis chart:dimension="y" chart:name="primary-y" chart:style-name="ch7">
+ <chart:title svg:x="2.032cm" svg:y="2.301cm" chart:style-name="ch8">
+ <text:p>
+ <text:span text:style-name="T2">in 1000 EUR</text:span></text:p>
+ </chart:title>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:axis chart:dimension="z" chart:name="primary-z" chart:style-name="ch9">
+ <chart:title svg:x="10.236cm" svg:y="9.648cm" chart:style-name="ch10">
+ <text:p>
+ <text:span text:style-name="T1">Seller</text:span></text:p>
+ </chart:title>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:series chart:style-name="ch11" chart:values-cell-range-address="rad.B2:rad.E2" chart:label-cell-address="rad.A2:rad.A2" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch12" chart:values-cell-range-address="rad.B3:rad.E3" chart:label-cell-address="rad.A3:rad.A3" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch13" chart:values-cell-range-address="rad.B4:rad.E4" chart:label-cell-address="rad.A4:rad.A4" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch14" chart:values-cell-range-address="rad.B5:rad.E5" chart:label-cell-address="rad.A5:rad.A5" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:wall chart:style-name="ch15"/>
+ <chart:floor chart:style-name="ch16"/>
+ </chart:plot-area>
+ <table:table table:name="local-table">
+ <table:table-header-columns>
+ <table:table-column/>
+ </table:table-header-columns>
+ <table:table-columns>
+ <table:table-column table:number-columns-repeated="4"/>
+ </table:table-columns>
+ <table:table-header-rows>
+ <table:table-row>
+ <table:table-cell>
+ <text:p/>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>1st</text:p>
+ <draw:g>
+ <svg:desc>rad.B1:rad.E1</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>2nd</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>3rd</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>4th</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table-header-rows>
+ <table:table-rows>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>John</text:p>
+ <draw:g>
+ <svg:desc>rad.A2:rad.A2</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="72">
+ <text:p>72</text:p>
+ <draw:g>
+ <svg:desc>rad.B2:rad.E2</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="42">
+ <text:p>42</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="45">
+ <text:p>45</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12">
+ <text:p>12</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Mary</text:p>
+ <draw:g>
+ <svg:desc>rad.A3:rad.A3</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56">
+ <text:p>56</text:p>
+ <draw:g>
+ <svg:desc>rad.B3:rad.E3</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="13">
+ <text:p>13</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="84">
+ <text:p>84</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Tim</text:p>
+ <draw:g>
+ <svg:desc>rad.A4:rad.A4</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="44">
+ <text:p>44</text:p>
+ <draw:g>
+ <svg:desc>rad.B4:rad.E4</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="30">
+ <text:p>30</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="23">
+ <text:p>23</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="27">
+ <text:p>27</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Doris</text:p>
+ <draw:g>
+ <svg:desc>rad.A5:rad.A5</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="89">
+ <text:p>89</text:p>
+ <draw:g>
+ <svg:desc>rad.B5:rad.E5</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="48">
+ <text:p>48</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="54">
+ <text:p>54</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="37">
+ <text:p>37</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table-rows>
+ </table:table>
+ </chart:chart>
+ </office:chart>
+ </office:body>
+ </office:document>
+ </draw:object>
+ </draw:frame></table:shapes>
+ <table:table-column table:style-name="co1" table:number-columns-repeated="16384" table:default-cell-style-name="Default"/>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:style-name="ce1" office:value-type="float" office:value="2023" calcext:value-type="float">
+ <text:p>2023</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>1<text:span text:style-name="T1">st</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>2<text:span text:style-name="T1">nd</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>3<text:span text:style-name="T1">rd</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>4<text:span text:style-name="T1">th</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>John</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="72" calcext:value-type="float">
+ <text:p>72</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="42" calcext:value-type="float">
+ <text:p>42</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="45" calcext:value-type="float">
+ <text:p>45</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12" calcext:value-type="float">
+ <text:p>12</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Mary</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56" calcext:value-type="float">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="13" calcext:value-type="float">
+ <text:p>13</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56" calcext:value-type="float">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="84" calcext:value-type="float">
+ <text:p>84</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Tim</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="44" calcext:value-type="float">
+ <text:p>44</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="30" calcext:value-type="float">
+ <text:p>30</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="23" calcext:value-type="float">
+ <text:p>23</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="27" calcext:value-type="float">
+ <text:p>27</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Doris</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="89" calcext:value-type="float">
+ <text:p>89</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="48" calcext:value-type="float">
+ <text:p>48</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="54" calcext:value-type="float">
+ <text:p>54</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="37" calcext:value-type="float">
+ <text:p>37</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1" table:number-rows-repeated="1048570">
+ <table:table-cell table:number-columns-repeated="16384"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:number-columns-repeated="16384"/>
+ </table:table-row>
+ </table:table>
+ <table:table table:name="grad" table:style-name="ta1">
+ <table:shapes>
+ <draw:frame draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="131.81mm" svg:height="114.48mm" svg:x="138.64mm" svg:y="8.51mm">
+ <draw:object draw:notify-on-update-of-ranges="grad.B1:grad.E1 grad.A2:grad.A2 grad.B2:grad.E2 grad.A3:grad.A3 grad.B3:grad.E3 grad.A4:grad.A4 grad.B4:grad.E4 grad.A5:grad.A5 grad.B5:grad.E5">
+ <loext:p/>
+ <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:chartooo="http://openoffice.org/2010/chart" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.chart">
+ <office:meta>
+ <meta:generator>LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244
+ </meta:generator>
+ </office:meta>
+ <office:styles/>
+ <office:automatic-styles>
+ <number:number-style style:name="N0">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:number-style style:name="N10000" number:language="en" number:country="US">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:text-style style:name="N10100" number:language="en" number:country="US">
+ <number:text-content/>
+ </number:text-style>
+ <style:style style:name="ch1" style:family="chart">
+ <style:graphic-properties draw:stroke="none"/>
+ </style:style>
+ <style:style style:name="ch2" style:family="chart">
+ <style:chart-properties chart:auto-position="true" style:rotation-angle="0"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch3" style:family="chart">
+ <style:chart-properties chart:three-dimensional="true" chart:deep="true" chart:include-hidden-cells="false" chart:treat-empty-cells="leave-gap" chart:series-source="rows"/>
+ </style:style>
+ <style:style style:name="ch4" style:family="chart" style:data-style-name="N10100">
+ <style:chart-properties chart:display-label="true" chart:tick-marks-major-inner="true" chart:tick-marks-major-outer="true" chart:logarithmic="false" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="false" loext:major-origin="0.5" chart:axis-position="0" style:rotation-angle="382.9grad"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch5" style:family="chart">
+ <style:chart-properties style:rotation-angle="380.7grad"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch6" style:family="chart">
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ </style:style>
+ <style:style style:name="ch7" style:family="chart" style:data-style-name="N10000">
+ <style:chart-properties chart:display-label="true" chart:logarithmic="false" chart:origin="0" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="false" chart:axis-position="start" style:rotation-angle="16.8grad"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch8" style:family="chart">
+ <style:chart-properties style:rotation-angle="16.6grad"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch9" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:display-label="true" chart:logarithmic="false" chart:reverse-direction="false" text:line-break="false" loext:try-staggering-first="false" chart:link-data-style-to-source="true" chart:axis-position="0" style:rotation-angle="382.4grad"/>
+ <style:graphic-properties svg:stroke-color="#b3b3b3"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch10" style:family="chart">
+ <style:chart-properties style:rotation-angle="67.1grad"/>
+ <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>
+ </style:style>
+ <style:style style:name="ch11" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#004586" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch12" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#ff420e" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch13" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#ffd320" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch14" style:family="chart" style:data-style-name="N0">
+ <style:chart-properties chart:link-data-style-to-source="true"/>
+ <style:graphic-properties draw:stroke="none" draw:fill-color="#579d1c" dr3d:edge-rounding="5%"/>
+ <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="ch15" style:family="chart">
+ <style:graphic-properties draw:stroke="solid" svg:stroke-color="#b3b3b3" draw:fill="none" draw:fill-color="#e6e6e6"/>
+ </style:style>
+ <style:style style:name="ch16" style:family="chart">
+ <style:graphic-properties svg:stroke-color="#b3b3b3" draw:fill-color="#cccccc"/>
+ </style:style>
+ <style:style style:name="T1" style:family="text">
+ <style:text-properties style:text-position="0% 100%" fo:font-size="14pt" style:letter-kerning="false" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ <style:style style:name="T2" style:family="text">
+ <style:text-properties style:text-position="0% 100%" fo:font-size="12pt" style:letter-kerning="false" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:body>
+ <office:chart>
+ <chart:chart svg:width="13.182cm" svg:height="11.449cm" xlink:href=".." xlink:type="simple" chart:class="chart:bar" chart:style-name="ch1">
+ <chart:title svg:x="5.343cm" svg:y="0.364cm" chart:style-name="ch2">
+ <text:p>Sales 2023</text:p>
+ </chart:title>
+ <chart:plot-area chart:style-name="ch3" table:cell-range-address="grad.A1:grad.E5" chart:data-source-has-labels="both" svg:x="1.538cm" svg:y="2.274cm" svg:width="9.651cm" svg:height="8.235cm" dr3d:transform="matrix (0.99826182973735 -0.0588167250409028 -0.00372989877902358 0.058817028267118 0.990268191440696 0.126132732494774 -0.0037251141276423 -0.126132873891924 0.992006361697595 0cm 0cm 0cm)" dr3d:vrp="(17634.6218373783 10271.4823817647 24594.8639082739)" dr3d:vpn="(0.416199821709347 0.173649045905254 0.892537795986984)" dr3d:vup="(-0.0733876362771618 0.984807599917971 -0.157379306090273)" dr3d:projection="perspective" dr3d:distance="4.2cm" dr3d:focal-length="8cm" dr3d:shadow-slant="0" dr3d:shade-mode="gouraud" dr3d:ambient-color="#999999" dr3d:lighting-mode="true">
+ <chart:coordinate-region svg:x="2.275cm" svg:y="2.274cm" svg:width="8.328cm" svg:height="7.646cm"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="true"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(-0.422618261740699 -0.280064508328675 0.861949926630247)" dr3d:enabled="true" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <dr3d:light dr3d:diffuse-color="#808080" dr3d:direction="(0 0 1)" dr3d:enabled="false" dr3d:specular="false"/>
+ <chart:axis chart:dimension="x" chart:name="primary-x" chart:style-name="ch4" chartooo:axis-type="text">
+ <chart:title svg:x="3.149cm" svg:y="9.219cm" chart:style-name="ch5">
+ <text:p>
+ <text:span text:style-name="T1">Quarter</text:span></text:p>
+ </chart:title>
+ <chart:categories table:cell-range-address="grad.B1:grad.E1"/>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:axis chart:dimension="y" chart:name="primary-y" chart:style-name="ch7">
+ <chart:title svg:x="2.032cm" svg:y="2.302cm" chart:style-name="ch8">
+ <text:p>
+ <text:span text:style-name="T2">in 1000 EUR</text:span></text:p>
+ </chart:title>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:axis chart:dimension="z" chart:name="primary-z" chart:style-name="ch9">
+ <chart:title svg:x="10.238cm" svg:y="9.648cm" chart:style-name="ch10">
+ <text:p>
+ <text:span text:style-name="T1">Seller</text:span></text:p>
+ </chart:title>
+ <chart:grid chart:style-name="ch6" chart:class="major"/>
+ </chart:axis>
+ <chart:series chart:style-name="ch11" chart:values-cell-range-address="grad.B2:grad.E2" chart:label-cell-address="grad.A2:grad.A2" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch12" chart:values-cell-range-address="grad.B3:grad.E3" chart:label-cell-address="grad.A3:grad.A3" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch13" chart:values-cell-range-address="grad.B4:grad.E4" chart:label-cell-address="grad.A4:grad.A4" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:series chart:style-name="ch14" chart:values-cell-range-address="grad.B5:grad.E5" chart:label-cell-address="grad.A5:grad.A5" chart:class="chart:bar">
+ <chart:data-point chart:repeated="4"/>
+ </chart:series>
+ <chart:wall chart:style-name="ch15"/>
+ <chart:floor chart:style-name="ch16"/>
+ </chart:plot-area>
+ <table:table table:name="local-table">
+ <table:table-header-columns>
+ <table:table-column/>
+ </table:table-header-columns>
+ <table:table-columns>
+ <table:table-column table:number-columns-repeated="4"/>
+ </table:table-columns>
+ <table:table-header-rows>
+ <table:table-row>
+ <table:table-cell>
+ <text:p/>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>1st</text:p>
+ <draw:g>
+ <svg:desc>grad.B1:grad.E1</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>2nd</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>3rd</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string">
+ <text:p>4th</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table-header-rows>
+ <table:table-rows>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>John</text:p>
+ <draw:g>
+ <svg:desc>grad.A2:grad.A2</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="72">
+ <text:p>72</text:p>
+ <draw:g>
+ <svg:desc>grad.B2:grad.E2</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="42">
+ <text:p>42</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="45">
+ <text:p>45</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12">
+ <text:p>12</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Mary</text:p>
+ <draw:g>
+ <svg:desc>grad.A3:grad.A3</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56">
+ <text:p>56</text:p>
+ <draw:g>
+ <svg:desc>grad.B3:grad.E3</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="13">
+ <text:p>13</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="84">
+ <text:p>84</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Tim</text:p>
+ <draw:g>
+ <svg:desc>grad.A4:grad.A4</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="44">
+ <text:p>44</text:p>
+ <draw:g>
+ <svg:desc>grad.B4:grad.E4</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="30">
+ <text:p>30</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="23">
+ <text:p>23</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="27">
+ <text:p>27</text:p>
+ </table:table-cell>
+ </table:table-row>
+ <table:table-row>
+ <table:table-cell office:value-type="string">
+ <text:p>Doris</text:p>
+ <draw:g>
+ <svg:desc>grad.A5:grad.A5</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="89">
+ <text:p>89</text:p>
+ <draw:g>
+ <svg:desc>grad.B5:grad.E5</svg:desc></draw:g>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="48">
+ <text:p>48</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="54">
+ <text:p>54</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="37">
+ <text:p>37</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table-rows>
+ </table:table>
+ </chart:chart>
+ </office:chart>
+ </office:body>
+ </office:document>
+ </draw:object>
+ </draw:frame></table:shapes>
+ <table:table-column table:style-name="co1" table:number-columns-repeated="16384" table:default-cell-style-name="Default"/>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:style-name="ce1" office:value-type="float" office:value="2023" calcext:value-type="float">
+ <text:p>2023</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>1<text:span text:style-name="T1">st</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>2<text:span text:style-name="T1">nd</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>3<text:span text:style-name="T1">rd</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce2" office:value-type="string" calcext:value-type="string"><text:p>4<text:span text:style-name="T1">th</text:span></text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>John</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="72" calcext:value-type="float">
+ <text:p>72</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="42" calcext:value-type="float">
+ <text:p>42</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="45" calcext:value-type="float">
+ <text:p>45</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12" calcext:value-type="float">
+ <text:p>12</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Mary</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56" calcext:value-type="float">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="13" calcext:value-type="float">
+ <text:p>13</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="56" calcext:value-type="float">
+ <text:p>56</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="84" calcext:value-type="float">
+ <text:p>84</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Tim</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="44" calcext:value-type="float">
+ <text:p>44</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="30" calcext:value-type="float">
+ <text:p>30</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="23" calcext:value-type="float">
+ <text:p>23</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="27" calcext:value-type="float">
+ <text:p>27</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>Doris</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="89" calcext:value-type="float">
+ <text:p>89</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="48" calcext:value-type="float">
+ <text:p>48</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="54" calcext:value-type="float">
+ <text:p>54</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="37" calcext:value-type="float">
+ <text:p>37</text:p>
+ </table:table-cell>
+ <table:table-cell table:number-columns-repeated="16379"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1" table:number-rows-repeated="1048570">
+ <table:table-cell table:number-columns-repeated="16384"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:number-columns-repeated="16384"/>
+ </table:table-row>
+ </table:table>
+ <table:named-expressions/>
+ </office:spreadsheet>
+ </office:body>
+</office:document> \ 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 000000000000..c627af79e4d5
--- /dev/null
+++ b/chart2/qa/extras/data/odp/BarChartVeryLongLabel.odp
Binary files differ
diff --git a/chart2/qa/extras/data/ods/chartWithDotInSheetName.ods b/chart2/qa/extras/data/ods/chartWithDotInSheetName.ods
new file mode 100644
index 000000000000..873d45f4be8c
--- /dev/null
+++ b/chart2/qa/extras/data/ods/chartWithDotInSheetName.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf101894.ods b/chart2/qa/extras/data/ods/tdf101894.ods
new file mode 100644
index 000000000000..70d8b3a0dd55
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf101894.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf107097.ods b/chart2/qa/extras/data/ods/tdf107097.ods
new file mode 100644
index 000000000000..efa9f1c013f3
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf107097.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf120348.ods b/chart2/qa/extras/data/ods/tdf120348.ods
new file mode 100644
index 000000000000..7a593c1bff7b
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf120348.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf136011.ods b/chart2/qa/extras/data/ods/tdf136011.ods
new file mode 100644
index 000000000000..03a0a7dd6324
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf136011.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf146066.ods b/chart2/qa/extras/data/ods/tdf146066.ods
new file mode 100644
index 000000000000..03abe9ae68ca
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf146066.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf146463.ods b/chart2/qa/extras/data/ods/tdf146463.ods
new file mode 100644
index 000000000000..6214f4a50075
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf146463.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf148142.ods b/chart2/qa/extras/data/ods/tdf148142.ods
new file mode 100644
index 000000000000..9b736a06d19a
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf148142.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf151091.ods b/chart2/qa/extras/data/ods/tdf151091.ods
new file mode 100644
index 000000000000..b3a43b3ceac8
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf151091.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf153706_XY_scatter_chart.ods b/chart2/qa/extras/data/ods/tdf153706_XY_scatter_chart.ods
new file mode 100644
index 000000000000..2c6153ed6ab2
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf153706_XY_scatter_chart.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf158223.ods b/chart2/qa/extras/data/ods/tdf158223.ods
new file mode 100644
index 000000000000..33a71697444f
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf158223.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf161800_barOfPie_split_pos.ods b/chart2/qa/extras/data/ods/tdf161800_barOfPie_split_pos.ods
new file mode 100644
index 000000000000..a87941bfa22d
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf161800_barOfPie_split_pos.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf161800_pieOfPie_split_pos.ods b/chart2/qa/extras/data/ods/tdf161800_pieOfPie_split_pos.ods
new file mode 100644
index 000000000000..9a08628a91e7
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf161800_pieOfPie_split_pos.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf166428_Low_High_StockChart_LO248.ods b/chart2/qa/extras/data/ods/tdf166428_Low_High_StockChart_LO248.ods
new file mode 100644
index 000000000000..12c5993d422f
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf166428_Low_High_StockChart_LO248.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf39052.ods b/chart2/qa/extras/data/ods/tdf39052.ods
new file mode 100644
index 000000000000..68089195507e
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf39052.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf50934_barOfPie.ods b/chart2/qa/extras/data/ods/tdf50934_barOfPie.ods
new file mode 100644
index 000000000000..d9b577a38a36
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf50934_barOfPie.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf50934_pieOfPie.ods b/chart2/qa/extras/data/ods/tdf50934_pieOfPie.ods
new file mode 100644
index 000000000000..74a9f85f6981
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf50934_pieOfPie.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf62057.ods b/chart2/qa/extras/data/ods/tdf62057.ods
new file mode 100644
index 000000000000..3945c41d0318
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf62057.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/tdf99969.ods b/chart2/qa/extras/data/ods/tdf99969.ods
new file mode 100644
index 000000000000..f30212ec73b4
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf99969.ods
Binary files 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 000000000000..3f95e932b1c5
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx
Binary files differ
diff --git a/chart2/qa/extras/data/pptx/tdf127720.pptx b/chart2/qa/extras/data/pptx/tdf127720.pptx
new file mode 100644
index 000000000000..b10a4c5ab4ed
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/tdf127720.pptx
Binary files 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 000000000000..edb465d729af
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx
Binary files differ
diff --git a/chart2/qa/extras/data/pptx/tdf146487.pptx b/chart2/qa/extras/data/pptx/tdf146487.pptx
new file mode 100644
index 000000000000..2a78ae5d859b
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/tdf146487.pptx
Binary files differ
diff --git a/chart2/qa/extras/data/pptx/tdf146756_bestFit.pptx b/chart2/qa/extras/data/pptx/tdf146756_bestFit.pptx
new file mode 100644
index 000000000000..a643d95a53a8
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/tdf146756_bestFit.pptx
Binary files differ
diff --git a/chart2/qa/extras/data/pptx/tdf150176.pptx b/chart2/qa/extras/data/pptx/tdf150176.pptx
new file mode 100644
index 000000000000..fa217f92c822
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/tdf150176.pptx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/ChartDataTable.xlsx b/chart2/qa/extras/data/xlsx/ChartDataTable.xlsx
new file mode 100644
index 000000000000..fff4f00aeafa
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/ChartDataTable.xlsx
Binary files 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 000000000000..b077fd2e0315
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/barOfPieChart.xlsx b/chart2/qa/extras/data/xlsx/barOfPieChart.xlsx
new file mode 100644
index 000000000000..227ab832a4ac
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/barOfPieChart.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/barOfPieChart2.xlsx b/chart2/qa/extras/data/xlsx/barOfPieChart2.xlsx
new file mode 100644
index 000000000000..be24cd293915
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/barOfPieChart2.xlsx
Binary files 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 000000000000..c87b2b3186ac
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/barchart_totalsrow.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/bartest-stroke.xlsx b/chart2/qa/extras/data/xlsx/bartest-stroke.xlsx
new file mode 100644
index 000000000000..de8f59afe830
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/bartest-stroke.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx
index b122680257c0..583c6720a4da 100644
--- a/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx
+++ b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/color_funnel.xlsx b/chart2/qa/extras/data/xlsx/color_funnel.xlsx
new file mode 100644
index 000000000000..80d16d5d1b84
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/color_funnel.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/funnel1.xlsx b/chart2/qa/extras/data/xlsx/funnel1.xlsx
new file mode 100644
index 000000000000..7ae3e6c32a59
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/funnel1.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/invertIfNeg_bar.xlsx b/chart2/qa/extras/data/xlsx/invertIfNeg_bar.xlsx
new file mode 100644
index 000000000000..97a83b43dc2f
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/invertIfNeg_bar.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/invertIfNeg_bubble.xlsx b/chart2/qa/extras/data/xlsx/invertIfNeg_bubble.xlsx
new file mode 100644
index 000000000000..27ae097e2eba
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/invertIfNeg_bubble.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/pieOfPieChart.xlsx b/chart2/qa/extras/data/xlsx/pieOfPieChart.xlsx
new file mode 100644
index 000000000000..b3a1c3588427
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/pieOfPieChart.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/pieOfPieChart2.xlsx b/chart2/qa/extras/data/xlsx/pieOfPieChart2.xlsx
new file mode 100644
index 000000000000..c80f0169cc89
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/pieOfPieChart2.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/tdf150434.xlsx b/chart2/qa/extras/data/xlsx/tdf150434.xlsx
new file mode 100644
index 000000000000..309a0c4c25f7
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf150434.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx b/chart2/qa/extras/data/xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx
new file mode 100644
index 000000000000..c8c4e06a44c3
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/tdf166249.xlsx b/chart2/qa/extras/data/xlsx/tdf166249.xlsx
new file mode 100644
index 000000000000..8c7b5d2ad884
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf166249.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/tdf39052.xlsx b/chart2/qa/extras/data/xlsx/tdf39052.xlsx
new file mode 100644
index 000000000000..5b0285bab292
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf39052.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/tdf98690.xlsx b/chart2/qa/extras/data/xlsx/tdf98690.xlsx
new file mode 100644
index 000000000000..4269afa9eadd
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf98690.xlsx
Binary files differ
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
new file mode 100644
index 000000000000..e17d0e6daa20
--- /dev/null
+++ b/chart2/qa/extras/uichart.cxx
@@ -0,0 +1,567 @@
+/* -*- 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 <comphelper/propertyvalue.hxx>
+
+using namespace ::com::sun::star;
+
+class Chart2UiChartTest : public ChartTest
+{
+public:
+ Chart2UiChartTest()
+ : ChartTest(u"/chart2/qa/extras/data/"_ustr)
+ {
+ }
+
+ void testCopyPasteToNewSheet(const uno::Reference<chart::XChartDocument>& xChartDoc,
+ OUString aObjectName, sal_Int32 nColumns, sal_Int32 nRows);
+};
+
+void Chart2UiChartTest::testCopyPasteToNewSheet(
+ const uno::Reference<chart::XChartDocument>& xChartDoc, OUString aObjectName,
+ sal_Int32 nColumns, sal_Int32 nRows)
+{
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference<chart::XChartDataArray> xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW);
+
+ uno::Sequence<OUString> aExpectedColumnDescriptions = xChartData->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file", nColumns,
+ aExpectedColumnDescriptions.getLength());
+
+ uno::Sequence<OUString> aExpectedRowDescriptions = xChartData->getRowDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file", nRows,
+ aExpectedRowDescriptions.getLength());
+
+ Sequence<Sequence<double>> aExpectedData = xChartData->getData();
+
+ uno::Sequence<beans::PropertyValue> aPropertyValues = {
+ comphelper::makePropertyValue(u"ToObject"_ustr, aObjectName),
+ };
+ dispatchCommand(mxComponent, u".uno:GoToObject"_ustr, aPropertyValues);
+
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+
+ // create a new document
+ loadFromURL(u"private:factory/scalc"_ustr);
+
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
+
+ uno::Reference<chart2::XChartDocument> xChartDoc2 = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc2.is());
+
+ uno::Reference<chart::XChartDataArray> xDataArray(xChartDoc2->getDataProvider(),
+ UNO_QUERY_THROW);
+
+ Sequence<OUString> 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<OUString> 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<Sequence<double>> 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, testTdf99969)
+{
+ loadFromFile(u"ods/tdf99969.ods");
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0),
+ uno::UNO_QUERY_THROW);
+ sal_Int32 nColumns = 2;
+ sal_Int32 nRows = 6;
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference<chart::XChartDataArray> xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW);
+
+ uno::Sequence<OUString> aExpectedColumnDescriptions = xChartData->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file", nColumns,
+ aExpectedColumnDescriptions.getLength());
+
+ uno::Sequence<OUString> aExpectedRowDescriptions = xChartData->getRowDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file", nRows,
+ aExpectedRowDescriptions.getLength());
+
+ Sequence<Sequence<double>> aExpectedData = xChartData->getData();
+
+ dispatchCommand(mxComponent, u".uno:GoToCell"_ustr,
+ { comphelper::makePropertyValue(u"ToPoint"_ustr, uno::Any(u"C2:L25"_ustr)) });
+
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+
+ // create a new document
+ loadFromURL(u"private:factory/scalc"_ustr);
+
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
+
+ uno::Reference<chart2::XChartDocument> xChartDoc2 = getChartDocFromSheet(0);
+ CPPUNIT_ASSERT(xChartDoc2.is());
+
+ uno::Reference<chart::XChartDataArray> xDataArray(xChartDoc2->getDataProvider(),
+ UNO_QUERY_THROW);
+
+ Sequence<OUString> 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)
+ {
+ // Without the fix in place, this test would have failed with
+ // - Expected: ABC
+ // - Actual :
+ // - Incorrect description in column: 0
+ OString sMessage("Incorrect description in column: " + OString::number(i));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedColumnDescriptions[i],
+ aColumnDesc[i]);
+ }
+
+ Sequence<OUString> 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<Sequence<double>> 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));
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), nExpected, nValue);
+ }
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf120348)
+{
+ loadFromFile(u"ods/tdf120348.ods");
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0),
+ 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, u"Object 2"_ustr, 4, 158);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf151091)
+{
+ std::vector<OUString> aExpected
+ = { u"Ωφέλιμο"_ustr, u"Επικίνδυνο"_ustr, u"Απόσταση"_ustr, u"Μάσκα"_ustr, u"Εμβόλιο"_ustr };
+
+ loadFromFile(u"ods/tdf151091.ods");
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference<chart::XChartDataArray> xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW);
+ uno::Sequence<OUString> aSeriesList = xChartData->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5), aSeriesList.getLength());
+
+ for (size_t i = 0; i < 5; ++i)
+ CPPUNIT_ASSERT_EQUAL(aExpected[i], aSeriesList[i]);
+
+ uno::Sequence<beans::PropertyValue> aPropertyValues = {
+ comphelper::makePropertyValue(u"ToObject"_ustr, u"Object 1"_ustr),
+ };
+ dispatchCommand(mxComponent, u".uno:GoToObject"_ustr, aPropertyValues);
+
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+
+ // create a new writer document
+ loadFromURL(u"private:factory/swriter"_ustr);
+
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
+
+ aSeriesList = getWriterChartColumnDescriptions();
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 5
+ // - Actual : 1
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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<chart::XChartDocument> xChartDoc(getPivotChartDocFromSheet(1),
+ uno::UNO_QUERY_THROW);
+ testCopyPasteToNewSheet(xChartDoc, u"Object 1"_ustr, 4, 12);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf136011)
+{
+ loadFromFile(u"ods/tdf136011.ods");
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0),
+ uno::UNO_QUERY_THROW);
+ testCopyPasteToNewSheet(xChartDoc, u"Object 1"_ustr, 3, 9);
+
+ loadFromFile(u"ods/tdf136011.ods");
+ uno::Reference<chart::XChartDocument> xChartDoc2(getChartCompFromSheet(0, 1),
+ 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, u"Object 2"_ustr, 3, 9);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf62057)
+{
+ loadFromFile(u"ods/tdf62057.ods");
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0),
+ 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, u"Object 1"_ustr, 2, 6);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf98690)
+{
+ loadFromFile(u"xlsx/tdf98690.xlsx");
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0),
+ uno::UNO_QUERY_THROW);
+
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference<chart::XChartDataArray> xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW);
+ uno::Sequence<OUString> aSeriesList = xChartData->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6), aSeriesList.getLength());
+
+ uno::Sequence<beans::PropertyValue> aPropertyValues = {
+ comphelper::makePropertyValue(u"ToObject"_ustr, u"Chart 2"_ustr),
+ };
+ dispatchCommand(mxComponent, u".uno:GoToObject"_ustr, aPropertyValues);
+
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+
+ // create a new document
+ loadFromURL(u"private:factory/scalc"_ustr);
+
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
+
+ uno::Reference<chart::XChartDocument> xChartDoc2(getChartCompFromSheet(0, 0),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xChartDoc2.is());
+ uno::Reference<chart::XChartDataArray> xChartData2(xChartDoc2->getData(), uno::UNO_QUERY_THROW);
+ uno::Sequence<OUString> aSeriesList2 = xChartData2->getColumnDescriptions();
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 12
+ // - Actual : 0
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(12), aSeriesList2.getLength());
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf101894)
+{
+ loadFromFile(u"ods/tdf101894.ods");
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0),
+ uno::UNO_QUERY_THROW);
+
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference<chart::XChartDataArray> xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW);
+
+ uno::Sequence<OUString> aExpectedColumnDescriptions = xChartData->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file",
+ static_cast<sal_Int32>(12),
+ aExpectedColumnDescriptions.getLength());
+
+ uno::Sequence<OUString> aExpectedRowDescriptions = xChartData->getRowDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file",
+ static_cast<sal_Int32>(8), aExpectedRowDescriptions.getLength());
+
+ Sequence<Sequence<double>> aExpectedData = xChartData->getData();
+
+ // Create a copy of the sheet and move to the end
+ uno::Sequence<beans::PropertyValue> aArgs(
+ comphelper::InitPropertySequence({ { "DocName", uno::Any(u"tdf101894"_ustr) },
+ { "Index", uno::Any(sal_uInt16(32767)) },
+ { "Copy", uno::Any(true) } }));
+ dispatchCommand(mxComponent, u".uno:Move"_ustr, aArgs);
+
+ uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
+ uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xIA->getCount());
+
+ for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex)
+ {
+ uno::Reference<chart::XChartDocument> xChartDoc2(getChartCompFromSheet(sheetIndex, 0),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xChartDoc2.is());
+ uno::Reference<chart::XChartDataArray> xChartData2(xChartDoc2->getData(),
+ uno::UNO_QUERY_THROW);
+
+ uno::Sequence<OUString> aColumnDescriptions = xChartData2->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file",
+ static_cast<sal_Int32>(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<OUString> aRowDescriptions = xChartData2->getRowDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file",
+ static_cast<sal_Int32>(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<Sequence<double>> 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<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0),
+ uno::UNO_QUERY_THROW);
+
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference<chart::XChartDataArray> xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW);
+
+ uno::Sequence<OUString> aExpectedColumnDescriptions = xChartData->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file",
+ static_cast<sal_Int32>(4),
+ aExpectedColumnDescriptions.getLength());
+
+ uno::Sequence<OUString> aExpectedRowDescriptions = xChartData->getRowDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file",
+ static_cast<sal_Int32>(7), aExpectedRowDescriptions.getLength());
+
+ Sequence<Sequence<double>> aExpectedData = xChartData->getData();
+
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+
+ uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
+ { { "Name", uno::Any(u"NewTab"_ustr) }, { "Index", uno::Any(sal_uInt16(2)) } }));
+ dispatchCommand(mxComponent, u".uno:Insert"_ustr, aArgs);
+
+ uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
+ uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xIA->getCount());
+
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
+
+ for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex)
+ {
+ uno::Reference<chart::XChartDocument> xChartDoc2(getChartCompFromSheet(sheetIndex, 0),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xChartDoc2.is());
+ uno::Reference<chart::XChartDataArray> xChartData2(xChartDoc2->getData(),
+ uno::UNO_QUERY_THROW);
+
+ uno::Sequence<OUString> aColumnDescriptions = xChartData2->getColumnDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file",
+ static_cast<sal_Int32>(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<OUString> aRowDescriptions = xChartData2->getRowDescriptions();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file",
+ static_cast<sal_Int32>(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<Sequence<double>> 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<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
+ uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(sheetIndex);
+ Reference<chart2::data::XDataSequence> xValuesX
+ = getDataSequenceFromDocByRole(xChartDoc, u"values-x");
+ CPPUNIT_ASSERT_EQUAL(sExpectedValuesX, xValuesX->getSourceRangeRepresentation());
+ Reference<chart2::data::XDataSequence> xValuesY
+ = getDataSequenceFromDocByRole(xChartDoc, u"values-y");
+ CPPUNIT_ASSERT_EQUAL(sExpectedValuesY, xValuesY->getSourceRangeRepresentation());
+ }
+
+ // Remove last sheet
+ uno::Sequence<beans::PropertyValue> aArgs(
+ comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(3)) } }));
+ dispatchCommand(mxComponent, u".uno:Remove"_ustr, aArgs);
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(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<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(sheetIndex);
+ Reference<chart2::data::XDataSequence> 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<chart2::data::XDataSequence> xValuesY
+ = getDataSequenceFromDocByRole(xChartDoc, u"values-y");
+ CPPUNIT_ASSERT_EQUAL(sExpectedValuesY, xValuesY->getSourceRangeRepresentation());
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf153706)
+{
+ // Load a spreadsheet with a to-page XY scatter chart with the sheet as data source
+ loadFromFile(u"ods/tdf153706_XY_scatter_chart.ods");
+
+ // Select the cell range around the chart, and copy the range to clipboard, including the chart
+ dispatchCommand(mxComponent, u".uno:GoToCell"_ustr,
+ { comphelper::makePropertyValue(u"ToPoint"_ustr, u"D1:K23"_ustr) });
+ dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+
+ // create a new document
+ loadFromURL(u"private:factory/scalc"_ustr);
+
+ // Paste; this must create a chart with own data source having a proper copy of the data
+ dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
+
+ css::uno::Reference xChartDoc(getChartDocFromSheet(0), css::uno::UNO_SET_THROW);
+ auto xDataArray(xChartDoc->getDataProvider().queryThrow<chart::XChartDataArray>());
+
+ css::uno::Sequence<Sequence<double>> aData = xDataArray->getData();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aData.getLength());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aData[0].getLength());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aData[1].getLength());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aData[2].getLength());
+ CPPUNIT_ASSERT_EQUAL(2.0, aData[0][0]);
+ CPPUNIT_ASSERT_EQUAL(3.0, aData[0][1]);
+ CPPUNIT_ASSERT_EQUAL(3.0, aData[1][0]);
+ CPPUNIT_ASSERT_EQUAL(2.0, aData[1][1]);
+ CPPUNIT_ASSERT_EQUAL(4.0, aData[2][0]);
+ CPPUNIT_ASSERT_EQUAL(1.0, aData[2][1]);
+
+ // Without the fix, this would fail with
+ // - Expected: 1
+ // - Actual : 2
+ // i.e., the X values were treated as another Y series
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc));
+
+ auto xSeries(getDataSeriesFromDoc(xChartDoc, 0).queryThrow<chart2::data::XDataSource>());
+ auto sequences = xSeries->getDataSequences();
+ // Without the fix, this would fail with
+ // - Expected: 2
+ // - Actual : 1
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), sequences.getLength());
+
+ auto propX(sequences[0]->getValues().queryThrow<beans::XPropertySet>());
+ // Without the fix, this would fail with
+ // - Expected: values-x
+ // - Actual : values-y
+ CPPUNIT_ASSERT_EQUAL(u"values-x"_ustr, propX->getPropertyValue(u"Role"_ustr).get<OUString>());
+
+ auto propY(sequences[1]->getValues().queryThrow<beans::XPropertySet>());
+ CPPUNIT_ASSERT_EQUAL(u"values-y"_ustr, propY->getPropertyValue(u"Role"_ustr).get<OUString>());
+}
+
+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
index 18141a9ede88..ca945c8baa29 100644
--- a/chart2/qa/extras/xshape/chart2xshape.cxx
+++ b/chart2/qa/extras/xshape/chart2xshape.cxx
@@ -21,54 +21,71 @@
class Chart2XShapeTest : public ChartTest
{
public:
+ Chart2XShapeTest()
+ : ChartTest(u"/chart2/qa/extras/xshape/data/"_ustr)
+ {
+ }
+
+ 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 rReferenceFile);
+ void compareAgainstReference(std::u16string_view rDump, std::u16string_view rReferenceFile);
OUString getXShapeDumpString();
xmlDocUniquePtr getXShapeDumpXmlDoc();
};
namespace
{
-bool checkDumpAgainstFile(const OUString& rDump, std::u16string_view aFilePath,
+OUString getShapeDump(css::uno::Reference<css::chart::XChartDocument> const& doc)
+{
+ return css::uno::Reference<css::qa::XDumper>(doc, css::uno::UNO_QUERY_THROW)
+ ->dump(u"shapes"_ustr);
+}
+
+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.isEmpty());
+ CPPUNIT_ASSERT_MESSAGE("dump is empty", !rDump.empty());
OString aDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8);
- return doXMLDiff(aOFile.getStr(), aDump.getStr(), static_cast<int>(rDump.getLength()),
+ return doXMLDiff(aOFile.getStr(), aDump.getStr(), static_cast<int>(rDump.size()),
toleranceFile);
}
}
OUString Chart2XShapeTest::getXShapeDumpString()
{
- uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
- uno::Reference<qa::XDumper> xDumper(xChartDoc, UNO_QUERY_THROW);
- return xDumper->dump();
+ uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0), UNO_QUERY_THROW);
+ return getShapeDump(xChartDoc);
}
xmlDocUniquePtr Chart2XShapeTest::getXShapeDumpXmlDoc()
@@ -78,33 +95,86 @@ xmlDocUniquePtr Chart2XShapeTest::getXShapeDumpXmlDoc()
return xmlDocUniquePtr(xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr())));
}
-void Chart2XShapeTest::compareAgainstReference(std::u16string_view rReferenceFile)
+void Chart2XShapeTest::compareAgainstReference(std::u16string_view rDump,
+ std::u16string_view rReferenceFile)
{
checkDumpAgainstFile(
- getXShapeDumpString(),
- OUStringConcatenation(
- m_directories.getPathFromSrc(u"/chart2/qa/extras/xshape/data/reference/")
- + rReferenceFile),
+ 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<chart::XChartDocument> 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()
{
-#if 0
- load("chart2/qa/extras/xshape/data/ods/", "fdo75075.ods");
- compareAgainstReference("fdo75075.xml");
-#endif
+ // 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()
{
-#if 0
- load("chart2/qa/extras/xshape/data/ods/", "property-mapping-bar.ods");
- compareAgainstReference("property-mapping-bar.xml");
-#endif
+ // 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()
@@ -115,8 +185,8 @@ void Chart2XShapeTest::testPieChartLabels1()
return;
// inside placement for the best fit case
- load(u"chart2/qa/extras/xshape/data/xlsx/", "tdf90839-1.xlsx");
- compareAgainstReference(u"tdf90839-1.xml");
+ loadFromFile(u"xlsx/tdf90839-1.xlsx");
+ compareAgainstReference(getXShapeDumpString(), u"tdf90839-1.xml");
}
void Chart2XShapeTest::testPieChartLabels2()
@@ -126,9 +196,9 @@ void Chart2XShapeTest::testPieChartLabels2()
if (!IsDefaultDPI())
return;
- // text wrap: wrap all text labels except one
- load(u"chart2/qa/extras/xshape/data/xlsx/", "tdf90839-2.xlsx");
- compareAgainstReference(u"tdf90839-2.xml");
+ // text wrap: wrap all text labels except Yellow one
+ loadFromFile(u"xlsx/tdf90839-2.xlsx");
+ compareAgainstReference(getXShapeDumpString(), u"tdf90839-2.xml");
}
void Chart2XShapeTest::testPieChartLabels3()
@@ -138,9 +208,9 @@ void Chart2XShapeTest::testPieChartLabels3()
if (!IsDefaultDPI())
return;
- // text wrap: wrap no text label except one
- load(u"chart2/qa/extras/xshape/data/xlsx/", "tdf90839-3.xlsx");
- compareAgainstReference(u"tdf90839-3.xml");
+ // text wrap: wrap no text label except Yellow one
+ loadFromFile(u"xlsx/tdf90839-3.xlsx");
+ compareAgainstReference(getXShapeDumpString(), u"tdf90839-3.xml");
}
void Chart2XShapeTest::testPieChartLabels4()
@@ -151,8 +221,19 @@ void Chart2XShapeTest::testPieChartLabels4()
return;
// data value and percent value are centered horizontally
- load(u"chart2/qa/extras/xshape/data/ods/", "tdf90839-4.ods");
- compareAgainstReference(u"tdf90839-4.xml");
+ 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()
@@ -160,7 +241,7 @@ void Chart2XShapeTest::testTdf76649TrendLineBug()
// This bug prevents that the trendline (regression curve) is drawn
// if the first cell is empty. See tdf#76649 for details.
- load(u"chart2/qa/extras/xshape/data/ods/", "tdf76649_TrendLineBug.ods");
+ loadFromFile(u"ods/tdf76649_TrendLineBug.ods");
xmlDocUniquePtr pXmlDoc = getXShapeDumpXmlDoc();
@@ -171,15 +252,14 @@ void Chart2XShapeTest::testTdf76649TrendLineBug()
void Chart2XShapeTest::testTdf88154LabelRotatedLayout()
{
- load(u"chart2/qa/extras/xshape/data/pptx/", "tdf88154_LabelRotatedLayout.pptx");
+ loadFromFile(u"pptx/tdf88154_LabelRotatedLayout.pptx");
uno::Reference<chart::XChartDocument> xChartDoc = getChartDocFromDrawImpress(0, 5);
- uno::Reference<qa::XDumper> xDumper(xChartDoc, UNO_QUERY_THROW);
- OUString rDump = xDumper->dump();
+ OUString rDump = getShapeDump(xChartDoc);
OString aXmlDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8);
xmlDocUniquePtr pXmlDoc(xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr())));
{
- OString aPath("//XShape[@text='Oct-12']/Transformation");
+ OString aPath("//XShape[@text='Oct-12']/Transformation"_ostr);
assertXPath(pXmlDoc, aPath, 1);
double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
@@ -190,7 +270,7 @@ void Chart2XShapeTest::testTdf88154LabelRotatedLayout()
CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
}
{
- OString aPath("//XShape[@text='Nov-12']/Transformation");
+ OString aPath("//XShape[@text='Nov-12']/Transformation"_ostr);
assertXPath(pXmlDoc, aPath, 1);
double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
@@ -201,7 +281,7 @@ void Chart2XShapeTest::testTdf88154LabelRotatedLayout()
CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
}
{
- OString aPath("//XShape[@text='Dec-12']/Transformation");
+ OString aPath("//XShape[@text='Dec-12']/Transformation"_ostr);
assertXPath(pXmlDoc, aPath, 1);
double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
@@ -212,7 +292,7 @@ void Chart2XShapeTest::testTdf88154LabelRotatedLayout()
CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
}
{
- OString aPath("//XShape[@text='May-13']/Transformation");
+ OString aPath("//XShape[@text='May-13']/Transformation"_ostr);
assertXPath(pXmlDoc, aPath, 1);
double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
@@ -223,7 +303,7 @@ void Chart2XShapeTest::testTdf88154LabelRotatedLayout()
CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
}
{
- OString aPath("//XShape[@text='Jan-14']/Transformation");
+ OString aPath("//XShape[@text='Jan-14']/Transformation"_ostr);
assertXPath(pXmlDoc, aPath, 1);
double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
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 000000000000..d1f6adcc24b1
--- /dev/null
+++ b/chart2/qa/extras/xshape/data/ods/tdf151424.ods
Binary files differ
diff --git a/chart2/qa/extras/xshape/data/ods/tdf90839-4.ods b/chart2/qa/extras/xshape/data/ods/tdf90839-4.ods
index fe9950f2797f..3126ac1759e3 100644
--- a/chart2/qa/extras/xshape/data/ods/tdf90839-4.ods
+++ b/chart2/qa/extras/xshape/data/ods/tdf90839-4.ods
Binary files differ
diff --git a/chart2/qa/unit/data/ods/testChart.ods b/chart2/qa/extras/xshape/data/ods/testChart.ods
index 956f57d525f0..956f57d525f0 100644
--- a/chart2/qa/unit/data/ods/testChart.ods
+++ b/chart2/qa/extras/xshape/data/ods/testChart.ods
Binary files 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 000000000000..60d006547a2a
--- /dev/null
+++ b/chart2/qa/extras/xshape/data/pptx/tdf149204.pptx
Binary files differ
diff --git a/chart2/qa/extras/xshape/data/reference/fdo75075.xml b/chart2/qa/extras/xshape/data/reference/fdo75075.xml
index 93becacffaa8..6f401aa41edd 100644
--- a/chart2/qa/extras/xshape/data/reference/fdo75075.xml
+++ b/chart2/qa/extras/xshape/data/reference/fdo75075.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="0" positionY="0" sizeX="16000" sizeY="9000" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="0" positionY="0" sizeX="16000" sizeY="9000" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -14,10 +14,10 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="12878" sizeY="8640" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShape positionX="320" positionY="180" sizeX="12850" sizeY="8640" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
<XShapes>
- <XShape positionX="1497" positionY="354" sizeX="10417" sizeY="7872" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="1527" positionY="379" sizeX="10339" sizeY="7794" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -25,13 +25,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="10418.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="354.000000"/>
+ <Line1 column1="10340.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="379.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="12878" sizeY="8640" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="180" sizeX="12850" sizeY="8640" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -39,19 +39,19 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="12879.000000" column2="0.000000" column3="320.000000"/>
+ <Line1 column1="12851.000000" column2="0.000000" column3="320.000000"/>
<Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="12878" sizeY="8640" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="320" positionY="180" sizeX="12850" sizeY="8640" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1347" positionY="352" sizeX="10717" sizeY="8023" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="1377" positionY="378" sizeX="10639" sizeY="7944" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1497" positionY="354" sizeX="10417" sizeY="7872" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+ <XShape positionX="1527" positionY="379" sizeX="10339" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
<XShapes>
- <XShape positionX="1497" positionY="354" sizeX="10417" sizeY="7872" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall=" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="1527" positionY="379" sizeX="10339" sizeY="7794" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -59,216 +59,216 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="10418.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="354.000000"/>
+ <Line1 column1="10340.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="379.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10418.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="354.000000"/>
+ <Line1 column1="10340.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="379.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1347" positionY="352" sizeX="10717" sizeY="8023" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+ <XShape positionX="1377" positionY="378" sizeX="10639" sizeY="7944" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
<XShapes>
- <XShape positionX="1497" positionY="353" sizeX="10417" sizeY="7872" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="1527" positionY="378" sizeX="10339" sizeY="7794" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1497" positionY="353" sizeX="10417" sizeY="7872" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
+ <XShape positionX="1527" positionY="378" sizeX="10339" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
<XShapes>
- <XShape positionX="1497" positionY="353" sizeX="10417" sizeY="7872" type="com.sun.star.drawing.PolyLineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="1527" positionY="378" sizeX="10339" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="11914" positionY="8225"/>
- <point positionX="1497" positionY="8225"/>
+ <point positionX="11866" positionY="8172"/>
+ <point positionX="1527" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="7241"/>
- <point positionX="1497" positionY="7241"/>
+ <point positionX="11866" positionY="7197"/>
+ <point positionX="1527" positionY="7197"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="6257"/>
- <point positionX="1497" positionY="6257"/>
+ <point positionX="11866" positionY="6223"/>
+ <point positionX="1527" positionY="6223"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="5273"/>
- <point positionX="1497" positionY="5273"/>
+ <point positionX="11866" positionY="5249"/>
+ <point positionX="1527" positionY="5249"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="4289"/>
- <point positionX="1497" positionY="4289"/>
+ <point positionX="11866" positionY="4275"/>
+ <point positionX="1527" positionY="4275"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="3305"/>
- <point positionX="1497" positionY="3305"/>
+ <point positionX="11866" positionY="3300"/>
+ <point positionX="1527" positionY="3300"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="2321"/>
- <point positionX="1497" positionY="2321"/>
+ <point positionX="11866" positionY="2326"/>
+ <point positionX="1527" positionY="2326"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="1337"/>
- <point positionX="1497" positionY="1337"/>
+ <point positionX="11866" positionY="1352"/>
+ <point positionX="1527" positionY="1352"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="353"/>
- <point positionX="1497" positionY="353"/>
+ <point positionX="11866" positionY="378"/>
+ <point positionX="1527" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="10417" positionY="7872"/>
- <point positionX="0" positionY="7872"/>
+ <point positionX="10339" positionY="7794"/>
+ <point positionX="0" positionY="7794"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="6888"/>
- <point positionX="0" positionY="6888"/>
+ <point positionX="10339" positionY="6819"/>
+ <point positionX="0" positionY="6819"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="5904"/>
- <point positionX="0" positionY="5904"/>
+ <point positionX="10339" positionY="5845"/>
+ <point positionX="0" positionY="5845"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="4920"/>
- <point positionX="0" positionY="4920"/>
+ <point positionX="10339" positionY="4871"/>
+ <point positionX="0" positionY="4871"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="3936"/>
- <point positionX="0" positionY="3936"/>
+ <point positionX="10339" positionY="3897"/>
+ <point positionX="0" positionY="3897"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="2952"/>
- <point positionX="0" positionY="2952"/>
+ <point positionX="10339" positionY="2922"/>
+ <point positionX="0" positionY="2922"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="1968"/>
- <point positionX="0" positionY="1968"/>
+ <point positionX="10339" positionY="1948"/>
+ <point positionX="0" positionY="1948"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="984"/>
- <point positionX="0" positionY="984"/>
+ <point positionX="10339" positionY="974"/>
+ <point positionX="0" positionY="974"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="0"/>
+ <point positionX="10339" positionY="0"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="10417.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="7872.000000" column3="353.000000"/>
+ <Line1 column1="10339.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1497" positionY="353" sizeX="0" sizeY="7872" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="NONE">
+ <XShape positionX="1527" positionY="378" sizeX="0" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="NONE">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="1497" positionY="8225"/>
- <point positionX="1497" positionY="7241"/>
- <point positionX="1497" positionY="6257"/>
- <point positionX="1497" positionY="5273"/>
- <point positionX="1497" positionY="4289"/>
- <point positionX="1497" positionY="3305"/>
- <point positionX="1497" positionY="2321"/>
- <point positionX="1497" positionY="1337"/>
- <point positionX="1497" positionY="353"/>
+ <point positionX="1527" positionY="8172"/>
+ <point positionX="1527" positionY="7197"/>
+ <point positionX="1527" positionY="6223"/>
+ <point positionX="1527" positionY="5249"/>
+ <point positionX="1527" positionY="4275"/>
+ <point positionX="1527" positionY="3300"/>
+ <point positionX="1527" positionY="2326"/>
+ <point positionX="1527" positionY="1352"/>
+ <point positionX="1527" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="7872"/>
- <point positionX="0" positionY="6888"/>
- <point positionX="0" positionY="5904"/>
- <point positionX="0" positionY="4920"/>
- <point positionX="0" positionY="3936"/>
- <point positionX="0" positionY="2952"/>
- <point positionX="0" positionY="1968"/>
- <point positionX="0" positionY="984"/>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="0" positionY="6819"/>
+ <point positionX="0" positionY="5845"/>
+ <point positionX="0" positionY="4871"/>
+ <point positionX="0" positionY="3897"/>
+ <point positionX="0" positionY="2922"/>
+ <point positionX="0" positionY="1948"/>
+ <point positionX="0" positionY="974"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="7872.000000" column3="353.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10418.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="353.000000"/>
+ <Line1 column1="10340.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10418.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="353.000000"/>
+ <Line1 column1="10340.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1347" positionY="352" sizeX="10717" sizeY="8023" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="1377" positionY="378" sizeX="10639" sizeY="7944" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1497" positionY="8225" sizeX="10417" sizeY="150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShape positionX="1527" positionY="8172" sizeX="10339" sizeY="150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
<XShapes>
- <XShape positionX="1497" positionY="8225" sizeX="10417" sizeY="150" type="com.sun.star.drawing.PolyLineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="1527" positionY="8172" sizeX="10339" sizeY="150" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="1497" positionY="8375"/>
- <point positionX="1497" positionY="8225"/>
+ <point positionX="1527" positionY="8322"/>
+ <point positionX="1527" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="1497" positionY="8375"/>
- <point positionX="1497" positionY="8225"/>
+ <point positionX="1527" positionY="8322"/>
+ <point positionX="1527" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="3580" positionY="8375"/>
- <point positionX="3580" positionY="8225"/>
+ <point positionX="3594" positionY="8322"/>
+ <point positionX="3594" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="3580" positionY="8375"/>
- <point positionX="3580" positionY="8225"/>
+ <point positionX="3594" positionY="8322"/>
+ <point positionX="3594" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="5663" positionY="8375"/>
- <point positionX="5663" positionY="8225"/>
+ <point positionX="5662" positionY="8322"/>
+ <point positionX="5662" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="5663" positionY="8375"/>
- <point positionX="5663" positionY="8225"/>
+ <point positionX="5662" positionY="8322"/>
+ <point positionX="5662" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="7747" positionY="8375"/>
- <point positionX="7747" positionY="8225"/>
+ <point positionX="7730" positionY="8322"/>
+ <point positionX="7730" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="7747" positionY="8375"/>
- <point positionX="7747" positionY="8225"/>
+ <point positionX="7730" positionY="8322"/>
+ <point positionX="7730" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="9830" positionY="8375"/>
- <point positionX="9830" positionY="8225"/>
+ <point positionX="9798" positionY="8322"/>
+ <point positionX="9798" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="9830" positionY="8375"/>
- <point positionX="9830" positionY="8225"/>
+ <point positionX="9798" positionY="8322"/>
+ <point positionX="9798" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="8375"/>
- <point positionX="11914" positionY="8225"/>
+ <point positionX="11866" positionY="8322"/>
+ <point positionX="11866" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="11914" positionY="8375"/>
- <point positionX="11914" positionY="8225"/>
+ <point positionX="11866" positionY="8322"/>
+ <point positionX="11866" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
@@ -281,225 +281,225 @@
<point positionX="0" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="2083" positionY="150"/>
- <point positionX="2083" positionY="0"/>
+ <point positionX="2067" positionY="150"/>
+ <point positionX="2067" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="2083" positionY="150"/>
- <point positionX="2083" positionY="0"/>
+ <point positionX="2067" positionY="150"/>
+ <point positionX="2067" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="4166" positionY="150"/>
- <point positionX="4166" positionY="0"/>
+ <point positionX="4135" positionY="150"/>
+ <point positionX="4135" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="4166" positionY="150"/>
- <point positionX="4166" positionY="0"/>
+ <point positionX="4135" positionY="150"/>
+ <point positionX="4135" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="6250" positionY="150"/>
- <point positionX="6250" positionY="0"/>
+ <point positionX="6203" positionY="150"/>
+ <point positionX="6203" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="6250" positionY="150"/>
- <point positionX="6250" positionY="0"/>
+ <point positionX="6203" positionY="150"/>
+ <point positionX="6203" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="8333" positionY="150"/>
- <point positionX="8333" positionY="0"/>
+ <point positionX="8271" positionY="150"/>
+ <point positionX="8271" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="8333" positionY="150"/>
- <point positionX="8333" positionY="0"/>
+ <point positionX="8271" positionY="150"/>
+ <point positionX="8271" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="150"/>
- <point positionX="10417" positionY="0"/>
+ <point positionX="10339" positionY="150"/>
+ <point positionX="10339" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="10417" positionY="150"/>
- <point positionX="10417" positionY="0"/>
+ <point positionX="10339" positionY="150"/>
+ <point positionX="10339" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="10417.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="150.000000" column3="8225.000000"/>
+ <Line1 column1="10339.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="150.000000" column3="8172.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1497" positionY="8225" sizeX="10417" sizeY="0" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="1527" positionY="8172" sizeX="10339" sizeY="0" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="1497" positionY="8225"/>
- <point positionX="11914" positionY="8225"/>
+ <point positionX="1527" positionY="8172"/>
+ <point positionX="11866" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
<point positionX="0" positionY="0"/>
- <point positionX="10417" positionY="0"/>
+ <point positionX="10339" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="10417.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="0.000000" column3="8225.000000"/>
+ <Line1 column1="10339.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="0.000000" column3="8172.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10418.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="151.000000" column3="8225.000000"/>
+ <Line1 column1="10340.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="151.000000" column3="8172.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1347" positionY="353" sizeX="150" sizeY="7872" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShape positionX="1377" positionY="378" sizeX="150" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
<XShapes>
- <XShape positionX="1347" positionY="353" sizeX="150" sizeY="7872" type="com.sun.star.drawing.PolyLineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="1377" positionY="378" sizeX="150" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="1347" positionY="8225"/>
- <point positionX="1497" positionY="8225"/>
+ <point positionX="1377" positionY="8172"/>
+ <point positionX="1527" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="8225"/>
- <point positionX="1497" positionY="8225"/>
+ <point positionX="1377" positionY="8172"/>
+ <point positionX="1527" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="7241"/>
- <point positionX="1497" positionY="7241"/>
+ <point positionX="1377" positionY="7197"/>
+ <point positionX="1527" positionY="7197"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="7241"/>
- <point positionX="1497" positionY="7241"/>
+ <point positionX="1377" positionY="7197"/>
+ <point positionX="1527" positionY="7197"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="6257"/>
- <point positionX="1497" positionY="6257"/>
+ <point positionX="1377" positionY="6223"/>
+ <point positionX="1527" positionY="6223"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="6257"/>
- <point positionX="1497" positionY="6257"/>
+ <point positionX="1377" positionY="6223"/>
+ <point positionX="1527" positionY="6223"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="5273"/>
- <point positionX="1497" positionY="5273"/>
+ <point positionX="1377" positionY="5249"/>
+ <point positionX="1527" positionY="5249"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="5273"/>
- <point positionX="1497" positionY="5273"/>
+ <point positionX="1377" positionY="5249"/>
+ <point positionX="1527" positionY="5249"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="4289"/>
- <point positionX="1497" positionY="4289"/>
+ <point positionX="1377" positionY="4275"/>
+ <point positionX="1527" positionY="4275"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="4289"/>
- <point positionX="1497" positionY="4289"/>
+ <point positionX="1377" positionY="4275"/>
+ <point positionX="1527" positionY="4275"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="3305"/>
- <point positionX="1497" positionY="3305"/>
+ <point positionX="1377" positionY="3300"/>
+ <point positionX="1527" positionY="3300"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="3305"/>
- <point positionX="1497" positionY="3305"/>
+ <point positionX="1377" positionY="3300"/>
+ <point positionX="1527" positionY="3300"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="2321"/>
- <point positionX="1497" positionY="2321"/>
+ <point positionX="1377" positionY="2326"/>
+ <point positionX="1527" positionY="2326"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="2321"/>
- <point positionX="1497" positionY="2321"/>
+ <point positionX="1377" positionY="2326"/>
+ <point positionX="1527" positionY="2326"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="1337"/>
- <point positionX="1497" positionY="1337"/>
+ <point positionX="1377" positionY="1352"/>
+ <point positionX="1527" positionY="1352"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="1337"/>
- <point positionX="1497" positionY="1337"/>
+ <point positionX="1377" positionY="1352"/>
+ <point positionX="1527" positionY="1352"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="353"/>
- <point positionX="1497" positionY="353"/>
+ <point positionX="1377" positionY="378"/>
+ <point positionX="1527" positionY="378"/>
</pointSequence>
<pointSequence>
- <point positionX="1347" positionY="353"/>
- <point positionX="1497" positionY="353"/>
+ <point positionX="1377" positionY="378"/>
+ <point positionX="1527" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="7872"/>
- <point positionX="150" positionY="7872"/>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="150" positionY="7794"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="7872"/>
- <point positionX="150" positionY="7872"/>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="150" positionY="7794"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="6888"/>
- <point positionX="150" positionY="6888"/>
+ <point positionX="0" positionY="6819"/>
+ <point positionX="150" positionY="6819"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="6888"/>
- <point positionX="150" positionY="6888"/>
+ <point positionX="0" positionY="6819"/>
+ <point positionX="150" positionY="6819"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="5904"/>
- <point positionX="150" positionY="5904"/>
+ <point positionX="0" positionY="5845"/>
+ <point positionX="150" positionY="5845"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="5904"/>
- <point positionX="150" positionY="5904"/>
+ <point positionX="0" positionY="5845"/>
+ <point positionX="150" positionY="5845"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="4920"/>
- <point positionX="150" positionY="4920"/>
+ <point positionX="0" positionY="4871"/>
+ <point positionX="150" positionY="4871"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="4920"/>
- <point positionX="150" positionY="4920"/>
+ <point positionX="0" positionY="4871"/>
+ <point positionX="150" positionY="4871"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="3936"/>
- <point positionX="150" positionY="3936"/>
+ <point positionX="0" positionY="3897"/>
+ <point positionX="150" positionY="3897"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="3936"/>
- <point positionX="150" positionY="3936"/>
+ <point positionX="0" positionY="3897"/>
+ <point positionX="150" positionY="3897"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="2952"/>
- <point positionX="150" positionY="2952"/>
+ <point positionX="0" positionY="2922"/>
+ <point positionX="150" positionY="2922"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="2952"/>
- <point positionX="150" positionY="2952"/>
+ <point positionX="0" positionY="2922"/>
+ <point positionX="150" positionY="2922"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="1968"/>
- <point positionX="150" positionY="1968"/>
+ <point positionX="0" positionY="1948"/>
+ <point positionX="150" positionY="1948"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="1968"/>
- <point positionX="150" positionY="1968"/>
+ <point positionX="0" positionY="1948"/>
+ <point positionX="150" positionY="1948"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="984"/>
- <point positionX="150" positionY="984"/>
+ <point positionX="0" positionY="974"/>
+ <point positionX="150" positionY="974"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="984"/>
- <point positionX="150" positionY="984"/>
+ <point positionX="0" positionY="974"/>
+ <point positionX="150" positionY="974"/>
</pointSequence>
<pointSequence>
<point positionX="0" positionY="0"/>
@@ -511,168 +511,168 @@
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="150.000000" column2="0.000000" column3="1347.000000"/>
- <Line2 column1="0.000000" column2="7872.000000" column3="353.000000"/>
+ <Line1 column1="150.000000" column2="0.000000" column3="1377.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1497" positionY="353" sizeX="0" sizeY="7872" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="1527" positionY="378" sizeX="0" sizeY="7794" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="1497" positionY="8225"/>
- <point positionX="1497" positionY="353"/>
+ <point positionX="1527" positionY="8172"/>
+ <point positionX="1527" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="7872"/>
+ <point positionX="0" positionY="7794"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="1497.000000"/>
- <Line2 column1="0.000000" column2="7872.000000" column3="353.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="1527.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="151.000000" column2="0.000000" column3="1347.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="353.000000"/>
+ <Line1 column1="151.000000" column2="0.000000" column3="1377.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="11914" positionY="352" sizeX="150" sizeY="7873" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,1">
+ <XShape positionX="11866" positionY="378" sizeX="150" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,1">
<XShapes>
- <XShape positionX="11914" positionY="352" sizeX="150" sizeY="7873" type="com.sun.star.drawing.PolyLineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="11866" positionY="378" sizeX="150" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="12064" positionY="8225"/>
- <point positionX="11914" positionY="8225"/>
+ <point positionX="12016" positionY="8172"/>
+ <point positionX="11866" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="8225"/>
- <point positionX="11914" positionY="8225"/>
+ <point positionX="12016" positionY="8172"/>
+ <point positionX="11866" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="7100"/>
- <point positionX="11914" positionY="7100"/>
+ <point positionX="12016" positionY="7058"/>
+ <point positionX="11866" positionY="7058"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="7100"/>
- <point positionX="11914" positionY="7100"/>
+ <point positionX="12016" positionY="7058"/>
+ <point positionX="11866" positionY="7058"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="5975"/>
- <point positionX="11914" positionY="5975"/>
+ <point positionX="12016" positionY="5945"/>
+ <point positionX="11866" positionY="5945"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="5975"/>
- <point positionX="11914" positionY="5975"/>
+ <point positionX="12016" positionY="5945"/>
+ <point positionX="11866" positionY="5945"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="4851"/>
- <point positionX="11914" positionY="4851"/>
+ <point positionX="12016" positionY="4831"/>
+ <point positionX="11866" positionY="4831"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="4851"/>
- <point positionX="11914" positionY="4851"/>
+ <point positionX="12016" positionY="4831"/>
+ <point positionX="11866" positionY="4831"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="3726"/>
- <point positionX="11914" positionY="3726"/>
+ <point positionX="12016" positionY="3718"/>
+ <point positionX="11866" positionY="3718"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="3726"/>
- <point positionX="11914" positionY="3726"/>
+ <point positionX="12016" positionY="3718"/>
+ <point positionX="11866" positionY="3718"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="2602"/>
- <point positionX="11914" positionY="2602"/>
+ <point positionX="12016" positionY="2604"/>
+ <point positionX="11866" positionY="2604"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="2602"/>
- <point positionX="11914" positionY="2602"/>
+ <point positionX="12016" positionY="2604"/>
+ <point positionX="11866" positionY="2604"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="1477"/>
- <point positionX="11914" positionY="1477"/>
+ <point positionX="12016" positionY="1491"/>
+ <point positionX="11866" positionY="1491"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="1477"/>
- <point positionX="11914" positionY="1477"/>
+ <point positionX="12016" positionY="1491"/>
+ <point positionX="11866" positionY="1491"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="352"/>
- <point positionX="11914" positionY="352"/>
+ <point positionX="12016" positionY="378"/>
+ <point positionX="11866" positionY="378"/>
</pointSequence>
<pointSequence>
- <point positionX="12064" positionY="352"/>
- <point positionX="11914" positionY="352"/>
+ <point positionX="12016" positionY="378"/>
+ <point positionX="11866" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="150" positionY="7873"/>
- <point positionX="0" positionY="7873"/>
+ <point positionX="150" positionY="7794"/>
+ <point positionX="0" positionY="7794"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="7873"/>
- <point positionX="0" positionY="7873"/>
+ <point positionX="150" positionY="7794"/>
+ <point positionX="0" positionY="7794"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="6748"/>
- <point positionX="0" positionY="6748"/>
+ <point positionX="150" positionY="6680"/>
+ <point positionX="0" positionY="6680"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="6748"/>
- <point positionX="0" positionY="6748"/>
+ <point positionX="150" positionY="6680"/>
+ <point positionX="0" positionY="6680"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="5623"/>
- <point positionX="0" positionY="5623"/>
+ <point positionX="150" positionY="5567"/>
+ <point positionX="0" positionY="5567"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="5623"/>
- <point positionX="0" positionY="5623"/>
+ <point positionX="150" positionY="5567"/>
+ <point positionX="0" positionY="5567"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="4499"/>
- <point positionX="0" positionY="4499"/>
+ <point positionX="150" positionY="4453"/>
+ <point positionX="0" positionY="4453"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="4499"/>
- <point positionX="0" positionY="4499"/>
+ <point positionX="150" positionY="4453"/>
+ <point positionX="0" positionY="4453"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="3374"/>
- <point positionX="0" positionY="3374"/>
+ <point positionX="150" positionY="3340"/>
+ <point positionX="0" positionY="3340"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="3374"/>
- <point positionX="0" positionY="3374"/>
+ <point positionX="150" positionY="3340"/>
+ <point positionX="0" positionY="3340"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="2250"/>
- <point positionX="0" positionY="2250"/>
+ <point positionX="150" positionY="2226"/>
+ <point positionX="0" positionY="2226"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="2250"/>
- <point positionX="0" positionY="2250"/>
+ <point positionX="150" positionY="2226"/>
+ <point positionX="0" positionY="2226"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="1125"/>
- <point positionX="0" positionY="1125"/>
+ <point positionX="150" positionY="1113"/>
+ <point positionX="0" positionY="1113"/>
</pointSequence>
<pointSequence>
- <point positionX="150" positionY="1125"/>
- <point positionX="0" positionY="1125"/>
+ <point positionX="150" positionY="1113"/>
+ <point positionX="0" positionY="1113"/>
</pointSequence>
<pointSequence>
<point positionX="150" positionY="0"/>
@@ -684,53 +684,53 @@
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="150.000000" column2="0.000000" column3="11914.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="352.000000"/>
+ <Line1 column1="150.000000" column2="0.000000" column3="11866.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="11914" positionY="353" sizeX="0" sizeY="7872" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="11866" positionY="378" sizeX="0" sizeY="7794" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="11914" positionY="8225"/>
- <point positionX="11914" positionY="353"/>
+ <point positionX="11866" positionY="8172"/>
+ <point positionX="11866" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="7872"/>
+ <point positionX="0" positionY="7794"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="11914.000000"/>
- <Line2 column1="0.000000" column2="7872.000000" column3="353.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="11866.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="151.000000" column2="0.000000" column3="11914.000000"/>
- <Line2 column1="0.000000" column2="7874.000000" column3="352.000000"/>
+ <Line1 column1="151.000000" column2="0.000000" column3="11866.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10718.000000" column2="0.000000" column3="1347.000000"/>
- <Line2 column1="0.000000" column2="8024.000000" column3="352.000000"/>
+ <Line1 column1="10640.000000" column2="0.000000" column3="1377.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="2017" positionY="1234" sizeX="9376" sizeY="6991" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="2043" positionY="1250" sizeX="9306" sizeY="6922" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="2017" positionY="1234" sizeX="9376" sizeY="6991" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+ <XShape positionX="2043" positionY="1250" sizeX="9306" sizeY="6922" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
<XShapes>
- <XShape positionX="10351" positionY="2600" sizeX="1042" sizeY="5625" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="2043" positionY="3765" sizeX="1034" sizeY="4407" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -739,30 +739,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="10351" positionY="8225"/>
- <point positionX="11393" positionY="8225"/>
- <point positionX="11393" positionY="2600"/>
- <point positionX="10351" positionY="2600"/>
- <point positionX="10351" positionY="8225"/>
+ <point positionX="2043" positionY="8172"/>
+ <point positionX="3077" positionY="8172"/>
+ <point positionX="3077" positionY="3765"/>
+ <point positionX="2043" positionY="3765"/>
+ <point positionX="2043" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="5625"/>
- <point positionX="1042" positionY="5625"/>
- <point positionX="1042" positionY="0"/>
+ <point positionX="0" positionY="4407"/>
+ <point positionX="1034" positionY="4407"/>
+ <point positionX="1034" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="5625"/>
+ <point positionX="0" positionY="4407"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="10351.000000"/>
- <Line2 column1="0.000000" column2="5625.000000" column3="2600.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="2043.000000"/>
+ <Line2 column1="0.000000" column2="4407.000000" column3="3765.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8268" positionY="1510" sizeX="1041" sizeY="6715" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="4111" positionY="1993" sizeX="1034" sizeY="6179" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -771,30 +771,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="8268" positionY="8225"/>
- <point positionX="9309" positionY="8225"/>
- <point positionX="9309" positionY="1510"/>
- <point positionX="8268" positionY="1510"/>
- <point positionX="8268" positionY="8225"/>
+ <point positionX="4111" positionY="8172"/>
+ <point positionX="5145" positionY="8172"/>
+ <point positionX="5145" positionY="1993"/>
+ <point positionX="4111" positionY="1993"/>
+ <point positionX="4111" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="6715"/>
- <point positionX="1041" positionY="6715"/>
- <point positionX="1041" positionY="0"/>
+ <point positionX="0" positionY="6179"/>
+ <point positionX="1034" positionY="6179"/>
+ <point positionX="1034" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="6715"/>
+ <point positionX="0" positionY="6179"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1041.000000" column2="0.000000" column3="8268.000000"/>
- <Line2 column1="0.000000" column2="6715.000000" column3="1510.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="4111.000000"/>
+ <Line2 column1="0.000000" column2="6179.000000" column3="1993.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="6184" positionY="1234" sizeX="1042" sizeY="6991" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="6179" positionY="1250" sizeX="1034" sizeY="6922" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -803,30 +803,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="6184" positionY="8225"/>
- <point positionX="7226" positionY="8225"/>
- <point positionX="7226" positionY="1234"/>
- <point positionX="6184" positionY="1234"/>
- <point positionX="6184" positionY="8225"/>
+ <point positionX="6179" positionY="8172"/>
+ <point positionX="7213" positionY="8172"/>
+ <point positionX="7213" positionY="1250"/>
+ <point positionX="6179" positionY="1250"/>
+ <point positionX="6179" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="6991"/>
- <point positionX="1042" positionY="6991"/>
- <point positionX="1042" positionY="0"/>
+ <point positionX="0" positionY="6922"/>
+ <point positionX="1034" positionY="6922"/>
+ <point positionX="1034" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="6991"/>
+ <point positionX="0" positionY="6922"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="6184.000000"/>
- <Line2 column1="0.000000" column2="6991.000000" column3="1234.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="6179.000000"/>
+ <Line2 column1="0.000000" column2="6922.000000" column3="1250.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="4101" positionY="1984" sizeX="1041" sizeY="6241" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="8247" positionY="1524" sizeX="1034" sizeY="6648" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -835,30 +835,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="4101" positionY="8225"/>
- <point positionX="5142" positionY="8225"/>
- <point positionX="5142" positionY="1984"/>
- <point positionX="4101" positionY="1984"/>
- <point positionX="4101" positionY="8225"/>
+ <point positionX="8247" positionY="8172"/>
+ <point positionX="9281" positionY="8172"/>
+ <point positionX="9281" positionY="1524"/>
+ <point positionX="8247" positionY="1524"/>
+ <point positionX="8247" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="6241"/>
- <point positionX="1041" positionY="6241"/>
- <point positionX="1041" positionY="0"/>
+ <point positionX="0" positionY="6648"/>
+ <point positionX="1034" positionY="6648"/>
+ <point positionX="1034" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="6241"/>
+ <point positionX="0" positionY="6648"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1041.000000" column2="0.000000" column3="4101.000000"/>
- <Line2 column1="0.000000" column2="6241.000000" column3="1984.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="8247.000000"/>
+ <Line2 column1="0.000000" column2="6648.000000" column3="1524.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="2017" positionY="3774" sizeX="1042" sizeY="4451" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="10315" positionY="2603" sizeX="1034" sizeY="5569" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -867,219 +867,219 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="2017" positionY="8225"/>
- <point positionX="3059" positionY="8225"/>
- <point positionX="3059" positionY="3774"/>
- <point positionX="2017" positionY="3774"/>
- <point positionX="2017" positionY="8225"/>
+ <point positionX="10315" positionY="8172"/>
+ <point positionX="11349" positionY="8172"/>
+ <point positionX="11349" positionY="2603"/>
+ <point positionX="10315" positionY="2603"/>
+ <point positionX="10315" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="4451"/>
- <point positionX="1042" positionY="4451"/>
- <point positionX="1042" positionY="0"/>
+ <point positionX="0" positionY="5569"/>
+ <point positionX="1034" positionY="5569"/>
+ <point positionX="1034" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="4451"/>
+ <point positionX="0" positionY="5569"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="2017.000000"/>
- <Line2 column1="0.000000" column2="4451.000000" column3="3774.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="10315.000000"/>
+ <Line2 column1="0.000000" column2="5569.000000" column3="2603.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9377.000000" column2="0.000000" column3="2017.000000"/>
- <Line2 column1="0.000000" column2="6992.000000" column3="1234.000000"/>
+ <Line1 column1="9307.000000" column2="0.000000" column3="2043.000000"/>
+ <Line2 column1="0.000000" column2="6923.000000" column3="1250.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9377.000000" column2="0.000000" column3="2017.000000"/>
- <Line2 column1="0.000000" column2="6992.000000" column3="1234.000000"/>
+ <Line1 column1="9307.000000" column2="0.000000" column3="2043.000000"/>
+ <Line2 column1="0.000000" column2="6923.000000" column3="1250.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="2538" positionY="860" sizeX="8334" sizeY="4193" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="2560" positionY="880" sizeX="8272" sizeY="4152" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="2538" positionY="860" sizeX="8334" sizeY="4193" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=1:Series=0">
+ <XShape positionX="2560" positionY="880" sizeX="8272" sizeY="4152" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=1:Series=0">
<XShapes>
- <XShape positionX="2538" positionY="4557" sizeX="0" sizeY="496" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=0">
+ <XShape positionX="2560" positionY="4541" sizeX="0" sizeY="491" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=0">
<XShapes>
- <XShape positionX="2538" positionY="4557" sizeX="0" sizeY="496" type="com.sun.star.drawing.LineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="2560" positionY="4541" sizeX="0" sizeY="491" type="com.sun.star.drawing.LineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="2538" positionY="5053"/>
- <point positionX="2538" positionY="4557"/>
+ <point positionX="2560" positionY="5032"/>
+ <point positionX="2560" positionY="4541"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="496"/>
+ <point positionX="0" positionY="491"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="2538.000000"/>
- <Line2 column1="0.000000" column2="496.000000" column3="4557.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="2560.000000"/>
+ <Line2 column1="0.000000" column2="491.000000" column3="4541.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1.000000" column2="0.000000" column3="2538.000000"/>
- <Line2 column1="0.000000" column2="497.000000" column3="4557.000000"/>
+ <Line1 column1="1.000000" column2="0.000000" column3="2560.000000"/>
+ <Line2 column1="0.000000" column2="492.000000" column3="4541.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="4622" positionY="3881" sizeX="0" sizeY="1071" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=1">
+ <XShape positionX="4628" positionY="3871" sizeX="0" sizeY="1060" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=1">
<XShapes>
- <XShape positionX="4622" positionY="3881" sizeX="0" sizeY="1071" type="com.sun.star.drawing.LineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="4628" positionY="3871" sizeX="0" sizeY="1060" type="com.sun.star.drawing.LineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="4622" positionY="4952"/>
- <point positionX="4622" positionY="3881"/>
+ <point positionX="4628" positionY="4931"/>
+ <point positionX="4628" positionY="3871"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="1071"/>
+ <point positionX="0" positionY="1060"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="4622.000000"/>
- <Line2 column1="0.000000" column2="1071.000000" column3="3881.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="4628.000000"/>
+ <Line2 column1="0.000000" column2="1060.000000" column3="3871.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1.000000" column2="0.000000" column3="4622.000000"/>
- <Line2 column1="0.000000" column2="1072.000000" column3="3881.000000"/>
+ <Line1 column1="1.000000" column2="0.000000" column3="4628.000000"/>
+ <Line2 column1="0.000000" column2="1061.000000" column3="3871.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="6705" positionY="2617" sizeX="0" sizeY="1958" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=2">
+ <XShape positionX="6696" positionY="2620" sizeX="0" sizeY="1938" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=2">
<XShapes>
- <XShape positionX="6705" positionY="2617" sizeX="0" sizeY="1958" type="com.sun.star.drawing.LineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="6696" positionY="2620" sizeX="0" sizeY="1938" type="com.sun.star.drawing.LineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="6705" positionY="4575"/>
- <point positionX="6705" positionY="2617"/>
+ <point positionX="6696" positionY="4558"/>
+ <point positionX="6696" positionY="2620"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="1958"/>
+ <point positionX="0" positionY="1938"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="6705.000000"/>
- <Line2 column1="0.000000" column2="1958.000000" column3="2617.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="6696.000000"/>
+ <Line2 column1="0.000000" column2="1938.000000" column3="2620.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1.000000" column2="0.000000" column3="6705.000000"/>
- <Line2 column1="0.000000" column2="1959.000000" column3="2617.000000"/>
+ <Line1 column1="1.000000" column2="0.000000" column3="6696.000000"/>
+ <Line2 column1="0.000000" column2="1939.000000" column3="2620.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8788" positionY="1789" sizeX="0" sizeY="907" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=3">
+ <XShape positionX="8764" positionY="1799" sizeX="0" sizeY="899" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=3">
<XShapes>
- <XShape positionX="8788" positionY="1789" sizeX="0" sizeY="907" type="com.sun.star.drawing.LineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="8764" positionY="1799" sizeX="0" sizeY="899" type="com.sun.star.drawing.LineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="8788" positionY="2696"/>
- <point positionX="8788" positionY="1789"/>
+ <point positionX="8764" positionY="2698"/>
+ <point positionX="8764" positionY="1799"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="907"/>
+ <point positionX="0" positionY="899"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="8788.000000"/>
- <Line2 column1="0.000000" column2="907.000000" column3="1789.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="8764.000000"/>
+ <Line2 column1="0.000000" column2="899.000000" column3="1799.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1.000000" column2="0.000000" column3="8788.000000"/>
- <Line2 column1="0.000000" column2="908.000000" column3="1789.000000"/>
+ <Line1 column1="1.000000" column2="0.000000" column3="8764.000000"/>
+ <Line2 column1="0.000000" column2="900.000000" column3="1799.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="10872" positionY="860" sizeX="0" sizeY="1254" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=4">
+ <XShape positionX="10832" positionY="880" sizeX="0" sizeY="1241" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:Point=4">
<XShapes>
- <XShape positionX="10872" positionY="860" sizeX="0" sizeY="1254" type="com.sun.star.drawing.LineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="10832" positionY="880" sizeX="0" sizeY="1241" type="com.sun.star.drawing.LineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="10872" positionY="2114"/>
- <point positionX="10872" positionY="860"/>
+ <point positionX="10832" positionY="2121"/>
+ <point positionX="10832" positionY="880"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="1254"/>
+ <point positionX="0" positionY="1241"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="10872.000000"/>
- <Line2 column1="0.000000" column2="1254.000000" column3="860.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="10832.000000"/>
+ <Line2 column1="0.000000" column2="1241.000000" column3="880.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1.000000" column2="0.000000" column3="10872.000000"/>
- <Line2 column1="0.000000" column2="1255.000000" column3="860.000000"/>
+ <Line1 column1="1.000000" column2="0.000000" column3="10832.000000"/>
+ <Line2 column1="0.000000" column2="1242.000000" column3="880.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="8335.000000" column2="0.000000" column3="2538.000000"/>
- <Line2 column1="0.000000" column2="4194.000000" column3="860.000000"/>
+ <Line1 column1="8273.000000" column2="0.000000" column3="2560.000000"/>
+ <Line2 column1="0.000000" column2="4153.000000" column3="880.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="8335.000000" column2="0.000000" column3="2538.000000"/>
- <Line2 column1="0.000000" column2="4194.000000" column3="860.000000"/>
+ <Line1 column1="8273.000000" column2="0.000000" column3="2560.000000"/>
+ <Line2 column1="0.000000" column2="4153.000000" column3="880.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="2017" positionY="4747" sizeX="1041" sizeY="95" type="com.sun.star.drawing.GroupShape" name="CID/StockLoss=">
+ <XShape positionX="2043" positionY="4728" sizeX="1033" sizeY="94" type="com.sun.star.drawing.GroupShape" name="CID/StockLoss=">
<XShapes>
- <XShape positionX="2017" positionY="4747" sizeX="1041" sizeY="95" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="000000" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="2043" positionY="4728" sizeX="1033" sizeY="94" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="000000" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1087,22 +1087,22 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="2017.000000"/>
- <Line2 column1="0.000000" column2="96.000000" column3="4747.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="2043.000000"/>
+ <Line2 column1="0.000000" column2="95.000000" column3="4728.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="2017.000000"/>
- <Line2 column1="0.000000" column2="96.000000" column3="4747.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="2043.000000"/>
+ <Line2 column1="0.000000" column2="95.000000" column3="4728.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="4101" positionY="954" sizeX="7291" sizeY="3888" type="com.sun.star.drawing.GroupShape" name="CID/StockGain=">
+ <XShape positionX="4111" positionY="972" sizeX="7237" sizeY="3850" type="com.sun.star.drawing.GroupShape" name="CID/StockGain=">
<XShapes>
- <XShape positionX="4101" positionY="4303" sizeX="1041" sizeY="539" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="4111" positionY="4288" sizeX="1033" sizeY="534" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1110,13 +1110,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="4101.000000"/>
- <Line2 column1="0.000000" column2="540.000000" column3="4303.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="4111.000000"/>
+ <Line2 column1="0.000000" column2="535.000000" column3="4288.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="6184" positionY="2668" sizeX="1041" sizeY="1634" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="6179" positionY="2671" sizeX="1033" sizeY="1617" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1124,13 +1124,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="6184.000000"/>
- <Line2 column1="0.000000" column2="1635.000000" column3="2668.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="6179.000000"/>
+ <Line2 column1="0.000000" column2="1618.000000" column3="2671.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8268" positionY="1969" sizeX="1041" sizeY="699" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="8247" positionY="1978" sizeX="1033" sizeY="692" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1138,13 +1138,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="8268.000000"/>
- <Line2 column1="0.000000" column2="700.000000" column3="1969.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="8247.000000"/>
+ <Line2 column1="0.000000" column2="693.000000" column3="1978.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="10351" positionY="954" sizeX="1041" sizeY="1015" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="10315" positionY="972" sizeX="1033" sizeY="1005" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1152,38 +1152,38 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1042.000000" column2="0.000000" column3="10351.000000"/>
- <Line2 column1="0.000000" column2="1016.000000" column3="954.000000"/>
+ <Line1 column1="1034.000000" column2="0.000000" column3="10315.000000"/>
+ <Line2 column1="0.000000" column2="1006.000000" column3="972.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="7292.000000" column2="0.000000" column3="4101.000000"/>
- <Line2 column1="0.000000" column2="3889.000000" column3="954.000000"/>
+ <Line1 column1="7238.000000" column2="0.000000" column3="4111.000000"/>
+ <Line2 column1="0.000000" column2="3851.000000" column3="972.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10718.000000" column2="0.000000" column3="1347.000000"/>
- <Line2 column1="0.000000" column2="8024.000000" column3="352.000000"/>
+ <Line1 column1="10640.000000" column2="0.000000" column3="1377.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10718.000000" column2="0.000000" column3="1347.000000"/>
- <Line2 column1="0.000000" column2="8024.000000" column3="352.000000"/>
+ <Line1 column1="10640.000000" column2="0.000000" column3="1377.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="12878" sizeY="8640" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="320" positionY="180" sizeX="12850" sizeY="8640" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1691" positionY="8475" sizeX="10029" sizeY="345" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShape positionX="1699" positionY="8422" sizeX="9995" sizeY="398" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
<XShapes>
- <XShape positionX="1691" positionY="8475" sizeX="1695" sizeY="345" type="com.sun.star.drawing.TextShape" text="2014.02.10" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="1699" positionY="8422" sizeX="1723" sizeY="398" type="com.sun.star.drawing.TextShape" text="2014.02.10" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1191,13 +1191,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1696.000000" column2="0.000000" column3="1691.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="1724.000000" column2="0.000000" column3="1699.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="3788" positionY="8475" sizeX="1669" sizeY="345" type="com.sun.star.drawing.TextShape" text="2014.02.11" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="3767" positionY="8422" sizeX="1723" sizeY="398" type="com.sun.star.drawing.TextShape" text="2014.02.11" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1205,13 +1205,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1670.000000" column2="0.000000" column3="3788.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="1724.000000" column2="0.000000" column3="3767.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="5858" positionY="8475" sizeX="1695" sizeY="345" type="com.sun.star.drawing.TextShape" text="2014.02.12" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="5835" positionY="8422" sizeX="1723" sizeY="398" type="com.sun.star.drawing.TextShape" text="2014.02.12" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1219,13 +1219,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1696.000000" column2="0.000000" column3="5858.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="1724.000000" column2="0.000000" column3="5835.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="7941" positionY="8475" sizeX="1695" sizeY="345" type="com.sun.star.drawing.TextShape" text="2014.02.13" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="7903" positionY="8422" sizeX="1723" sizeY="398" type="com.sun.star.drawing.TextShape" text="2014.02.13" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1233,13 +1233,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1696.000000" column2="0.000000" column3="7941.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="1724.000000" column2="0.000000" column3="7903.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="10025" positionY="8475" sizeX="1695" sizeY="345" type="com.sun.star.drawing.TextShape" text="2014.02.14" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="9971" positionY="8422" sizeX="1723" sizeY="398" type="com.sun.star.drawing.TextShape" text="2014.02.14" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1247,22 +1247,22 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1696.000000" column2="0.000000" column3="10025.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="1724.000000" column2="0.000000" column3="9971.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10030.000000" column2="0.000000" column3="1691.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="9996.000000" column2="0.000000" column3="1699.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="181" sizeX="928" sizeY="8217" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShape positionX="320" positionY="180" sizeX="958" sizeY="8192" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
<XShapes>
- <XShape positionX="1061" positionY="8053" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="0" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="1085" positionY="7974" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="0" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1270,13 +1270,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="1061.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8053.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="1085.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="7974.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="7069" sizeX="928" sizeY="345" type="com.sun.star.drawing.TextShape" text="10000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="6999" sizeX="958" sizeY="398" type="com.sun.star.drawing.TextShape" text="10000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1284,13 +1284,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="7069.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="6999.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="6085" sizeX="928" sizeY="345" type="com.sun.star.drawing.TextShape" text="20000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="6025" sizeX="958" sizeY="398" type="com.sun.star.drawing.TextShape" text="20000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1298,13 +1298,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="6085.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="6025.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="5101" sizeX="928" sizeY="345" type="com.sun.star.drawing.TextShape" text="30000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="5051" sizeX="958" sizeY="398" type="com.sun.star.drawing.TextShape" text="30000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1312,13 +1312,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="5101.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="5051.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="4117" sizeX="928" sizeY="345" type="com.sun.star.drawing.TextShape" text="40000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="4077" sizeX="958" sizeY="398" type="com.sun.star.drawing.TextShape" text="40000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1326,13 +1326,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="4117.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4077.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="3133" sizeX="928" sizeY="345" type="com.sun.star.drawing.TextShape" text="50000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="3102" sizeX="958" sizeY="398" type="com.sun.star.drawing.TextShape" text="50000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1340,13 +1340,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="3133.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="3102.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="2149" sizeX="928" sizeY="345" type="com.sun.star.drawing.TextShape" text="60000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="2128" sizeX="958" sizeY="398" type="com.sun.star.drawing.TextShape" text="60000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1354,13 +1354,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="2149.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="2128.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="1165" sizeX="928" sizeY="345" type="com.sun.star.drawing.TextShape" text="70000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="1154" sizeX="958" sizeY="398" type="com.sun.star.drawing.TextShape" text="70000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1368,13 +1368,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="1165.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="1154.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="181" sizeX="928" sizeY="345" type="com.sun.star.drawing.TextShape" text="80000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="180" sizeX="958" sizeY="398" type="com.sun.star.drawing.TextShape" text="80000" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1382,22 +1382,22 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="181.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="8218.000000" column3="181.000000"/>
+ <Line1 column1="959.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8193.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12164" positionY="180" sizeX="1034" sizeY="8218" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,1">
+ <XShape positionX="12116" positionY="180" sizeX="1054" sizeY="8192" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,1">
<XShapes>
- <XShape positionX="12164" positionY="8053" sizeX="1034" sizeY="345" type="com.sun.star.drawing.TextShape" text="1.6100" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12116" positionY="7974" sizeX="1054" sizeY="398" type="com.sun.star.drawing.TextShape" text="1.6100" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1405,13 +1405,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8053.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="7974.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12164" positionY="6928" sizeX="1034" sizeY="345" type="com.sun.star.drawing.TextShape" text="1.6200" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12116" positionY="6860" sizeX="1054" sizeY="398" type="com.sun.star.drawing.TextShape" text="1.6200" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1419,13 +1419,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="6928.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="6860.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12164" positionY="5803" sizeX="1034" sizeY="345" type="com.sun.star.drawing.TextShape" text="1.6300" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12116" positionY="5747" sizeX="1054" sizeY="398" type="com.sun.star.drawing.TextShape" text="1.6300" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1433,13 +1433,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="5803.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="5747.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12164" positionY="4679" sizeX="1034" sizeY="345" type="com.sun.star.drawing.TextShape" text="1.6400" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12116" positionY="4633" sizeX="1054" sizeY="398" type="com.sun.star.drawing.TextShape" text="1.6400" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1447,13 +1447,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="4679.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4633.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12164" positionY="3554" sizeX="1034" sizeY="345" type="com.sun.star.drawing.TextShape" text="1.6500" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12116" positionY="3520" sizeX="1054" sizeY="398" type="com.sun.star.drawing.TextShape" text="1.6500" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1461,13 +1461,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="3554.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="3520.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12164" positionY="2430" sizeX="1034" sizeY="345" type="com.sun.star.drawing.TextShape" text="1.6600" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12116" positionY="2406" sizeX="1054" sizeY="398" type="com.sun.star.drawing.TextShape" text="1.6600" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1475,13 +1475,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="2430.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="2406.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12164" positionY="1305" sizeX="1034" sizeY="345" type="com.sun.star.drawing.TextShape" text="1.6700" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12116" positionY="1293" sizeX="1054" sizeY="398" type="com.sun.star.drawing.TextShape" text="1.6700" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1489,13 +1489,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="1305.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="1293.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12164" positionY="180" sizeX="1034" sizeY="345" type="com.sun.star.drawing.TextShape" text="1.6800" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12116" positionY="180" sizeX="1054" sizeY="398" type="com.sun.star.drawing.TextShape" text="1.6800" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1503,43 +1503,43 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="180.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="12164.000000"/>
- <Line2 column1="0.000000" column2="8219.000000" column3="180.000000"/>
+ <Line1 column1="1055.000000" column2="0.000000" column3="12116.000000"/>
+ <Line2 column1="0.000000" column2="8193.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="12879.000000" column2="0.000000" column3="320.000000"/>
+ <Line1 column1="12851.000000" column2="0.000000" column3="320.000000"/>
<Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="12879.000000" column2="0.000000" column3="320.000000"/>
+ <Line1 column1="12851.000000" column2="0.000000" column3="320.000000"/>
<Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="12879.000000" column2="0.000000" column3="320.000000"/>
+ <Line1 column1="12851.000000" column2="0.000000" column3="320.000000"/>
<Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="13518" positionY="4005" sizeX="2272" sizeY="990" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
+ <XShape positionX="13490" positionY="3952" sizeX="2300" sizeY="1096" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
<XShapes>
- <XShape positionX="13518" positionY="4005" sizeX="2272" sizeY="990" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="13490" positionY="3952" sizeX="2300" sizeY="1096" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1547,17 +1547,17 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="2273.000000" column2="0.000000" column3="13518.000000"/>
- <Line2 column1="0.000000" column2="991.000000" column3="4005.000000"/>
+ <Line1 column1="2301.000000" column2="0.000000" column3="13490.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3952.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="13634" positionY="4172" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="13606" positionY="4145" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="13634" positionY="4172" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
+ <XShape positionX="13606" positionY="4145" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
<XShapes>
- <XShape positionX="13634" positionY="4172" sizeX="800" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="13606" positionY="4145" sizeX="800" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1565,13 +1565,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="801.000000" column2="0.000000" column3="13634.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4172.000000"/>
+ <Line1 column1="801.000000" column2="0.000000" column3="13606.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="13634" positionY="4172" sizeX="800" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="13606" positionY="4145" sizeX="800" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1579,31 +1579,31 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="801.000000" column2="0.000000" column3="13634.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4172.000000"/>
+ <Line1 column1="801.000000" column2="0.000000" column3="13606.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="801.000000" column2="0.000000" column3="13634.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4172.000000"/>
+ <Line1 column1="801.000000" column2="0.000000" column3="13606.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="801.000000" column2="0.000000" column3="13634.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4172.000000"/>
+ <Line1 column1="801.000000" column2="0.000000" column3="13606.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="13634" positionY="4617" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="13606" positionY="4643" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="13634" positionY="4617" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:LegendEntry=0">
+ <XShape positionX="13606" positionY="4643" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=1:Series=0:LegendEntry=0">
<XShapes>
- <XShape positionX="13634" positionY="4617" sizeX="800" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="13606" positionY="4643" sizeX="800" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1611,19 +1611,19 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="801.000000" column2="0.000000" column3="13634.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4617.000000"/>
+ <Line1 column1="801.000000" column2="0.000000" column3="13606.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="13634" positionY="4722" sizeX="800" sizeY="0" type="com.sun.star.drawing.LineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="13606" positionY="4748" sizeX="800" sizeY="0" type="com.sun.star.drawing.LineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="13634" positionY="4722"/>
- <point positionX="14434" positionY="4722"/>
+ <point positionX="13606" positionY="4748"/>
+ <point positionX="14406" positionY="4748"/>
</pointSequence>
</PolyPolygon>
<Geometry>
@@ -1633,27 +1633,27 @@
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="800.000000" column2="0.000000" column3="13634.000000"/>
- <Line2 column1="0.000000" column2="0.000000" column3="4722.000000"/>
+ <Line1 column1="800.000000" column2="0.000000" column3="13606.000000"/>
+ <Line2 column1="0.000000" column2="0.000000" column3="4748.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="801.000000" column2="0.000000" column3="13634.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4617.000000"/>
+ <Line1 column1="801.000000" column2="0.000000" column3="13606.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="801.000000" column2="0.000000" column3="13634.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4617.000000"/>
+ <Line1 column1="801.000000" column2="0.000000" column3="13606.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14534" positionY="4105" sizeX="1140" sizeY="345" type="com.sun.star.drawing.TextShape" text="Volume" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="14506" positionY="4052" sizeX="1168" sizeY="398" type="com.sun.star.drawing.TextShape" text="Volume" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1661,13 +1661,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1141.000000" column2="0.000000" column3="14534.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="4105.000000"/>
+ <Line1 column1="1169.000000" column2="0.000000" column3="14506.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4052.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14534" positionY="4550" sizeX="875" sizeY="345" type="com.sun.star.drawing.TextShape" text="Close" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="14506" positionY="4550" sizeX="881" sizeY="398" type="com.sun.star.drawing.TextShape" text="Close" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1675,15 +1675,15 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="876.000000" column2="0.000000" column3="14534.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="4550.000000"/>
+ <Line1 column1="882.000000" column2="0.000000" column3="14506.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4550.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="2273.000000" column2="0.000000" column3="13518.000000"/>
- <Line2 column1="0.000000" column2="991.000000" column3="4005.000000"/>
+ <Line1 column1="2301.000000" column2="0.000000" column3="13490.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3952.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
diff --git a/chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml b/chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml
index cc172969f01f..a64c984797bf 100644
--- a/chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml
+++ b/chart2/qa/extras/xshape/data/reference/property-mapping-bar.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="0" positionY="0" sizeX="16000" sizeY="9000" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="0" positionY="0" sizeX="16000" sizeY="9000" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -14,10 +14,10 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="13970" sizeY="8640" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShape positionX="320" positionY="180" sizeX="13974" sizeY="8640" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
<XShapes>
- <XShape positionX="756" positionY="354" sizeX="13534" sizeY="7872" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="762" positionY="380" sizeX="13532" sizeY="7793" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -25,13 +25,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="13535.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="354.000000"/>
+ <Line1 column1="13533.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="380.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="13970" sizeY="8640" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="180" sizeX="13974" sizeY="8640" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -39,19 +39,19 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="13971.000000" column2="0.000000" column3="320.000000"/>
+ <Line1 column1="13975.000000" column2="0.000000" column3="320.000000"/>
<Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="13970" sizeY="8640" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="320" positionY="180" sizeX="13974" sizeY="8640" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="606" positionY="352" sizeX="13684" sizeY="8023" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="612" positionY="378" sizeX="13682" sizeY="7944" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="756" positionY="354" sizeX="13534" sizeY="7872" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+ <XShape positionX="762" positionY="380" sizeX="13532" sizeY="7793" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
<XShapes>
- <XShape positionX="756" positionY="354" sizeX="13534" sizeY="7872" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall=" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="762" positionY="380" sizeX="13532" sizeY="7793" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -59,198 +59,198 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="13535.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="354.000000"/>
+ <Line1 column1="13533.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="380.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13535.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="354.000000"/>
+ <Line1 column1="13533.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="380.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="606" positionY="352" sizeX="13684" sizeY="8023" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+ <XShape positionX="612" positionY="378" sizeX="13682" sizeY="7944" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
<XShapes>
- <XShape positionX="756" positionY="352" sizeX="13534" sizeY="7873" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="762" positionY="378" sizeX="13532" sizeY="7794" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="756" positionY="352" sizeX="13534" sizeY="7873" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
+ <XShape positionX="762" positionY="378" sizeX="13532" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
<XShapes>
- <XShape positionX="756" positionY="352" sizeX="13534" sizeY="7873" type="com.sun.star.drawing.PolyLineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="762" positionY="378" sizeX="13532" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="14290" positionY="8225"/>
- <point positionX="756" positionY="8225"/>
+ <point positionX="14294" positionY="8172"/>
+ <point positionX="762" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="7100"/>
- <point positionX="756" positionY="7100"/>
+ <point positionX="14294" positionY="7058"/>
+ <point positionX="762" positionY="7058"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="5975"/>
- <point positionX="756" positionY="5975"/>
+ <point positionX="14294" positionY="5945"/>
+ <point positionX="762" positionY="5945"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="4851"/>
- <point positionX="756" positionY="4851"/>
+ <point positionX="14294" positionY="4832"/>
+ <point positionX="762" positionY="4832"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="3726"/>
- <point positionX="756" positionY="3726"/>
+ <point positionX="14294" positionY="3718"/>
+ <point positionX="762" positionY="3718"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="2602"/>
- <point positionX="756" positionY="2602"/>
+ <point positionX="14294" positionY="2605"/>
+ <point positionX="762" positionY="2605"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="1477"/>
- <point positionX="756" positionY="1477"/>
+ <point positionX="14294" positionY="1492"/>
+ <point positionX="762" positionY="1492"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="352"/>
- <point positionX="756" positionY="352"/>
+ <point positionX="14294" positionY="378"/>
+ <point positionX="762" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="13534" positionY="7873"/>
- <point positionX="0" positionY="7873"/>
+ <point positionX="13532" positionY="7794"/>
+ <point positionX="0" positionY="7794"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="6748"/>
- <point positionX="0" positionY="6748"/>
+ <point positionX="13532" positionY="6680"/>
+ <point positionX="0" positionY="6680"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="5623"/>
- <point positionX="0" positionY="5623"/>
+ <point positionX="13532" positionY="5567"/>
+ <point positionX="0" positionY="5567"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="4499"/>
- <point positionX="0" positionY="4499"/>
+ <point positionX="13532" positionY="4454"/>
+ <point positionX="0" positionY="4454"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="3374"/>
- <point positionX="0" positionY="3374"/>
+ <point positionX="13532" positionY="3340"/>
+ <point positionX="0" positionY="3340"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="2250"/>
- <point positionX="0" positionY="2250"/>
+ <point positionX="13532" positionY="2227"/>
+ <point positionX="0" positionY="2227"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="1125"/>
- <point positionX="0" positionY="1125"/>
+ <point positionX="13532" positionY="1114"/>
+ <point positionX="0" positionY="1114"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="0"/>
+ <point positionX="13532" positionY="0"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="13534.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="352.000000"/>
+ <Line1 column1="13532.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="756" positionY="352" sizeX="0" sizeY="7873" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="NONE">
+ <XShape positionX="762" positionY="378" sizeX="0" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="NONE">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="756" positionY="8225"/>
- <point positionX="756" positionY="7100"/>
- <point positionX="756" positionY="5975"/>
- <point positionX="756" positionY="4851"/>
- <point positionX="756" positionY="3726"/>
- <point positionX="756" positionY="2602"/>
- <point positionX="756" positionY="1477"/>
- <point positionX="756" positionY="352"/>
+ <point positionX="762" positionY="8172"/>
+ <point positionX="762" positionY="7058"/>
+ <point positionX="762" positionY="5945"/>
+ <point positionX="762" positionY="4832"/>
+ <point positionX="762" positionY="3718"/>
+ <point positionX="762" positionY="2605"/>
+ <point positionX="762" positionY="1492"/>
+ <point positionX="762" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="7873"/>
- <point positionX="0" positionY="6748"/>
- <point positionX="0" positionY="5623"/>
- <point positionX="0" positionY="4499"/>
- <point positionX="0" positionY="3374"/>
- <point positionX="0" positionY="2250"/>
- <point positionX="0" positionY="1125"/>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="0" positionY="6680"/>
+ <point positionX="0" positionY="5567"/>
+ <point positionX="0" positionY="4454"/>
+ <point positionX="0" positionY="3340"/>
+ <point positionX="0" positionY="2227"/>
+ <point positionX="0" positionY="1114"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="352.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13535.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="7874.000000" column3="352.000000"/>
+ <Line1 column1="13533.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13535.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="7874.000000" column3="352.000000"/>
+ <Line1 column1="13533.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="606" positionY="352" sizeX="13684" sizeY="8023" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="612" positionY="378" sizeX="13682" sizeY="7944" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="756" positionY="8225" sizeX="13534" sizeY="150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShape positionX="762" positionY="8172" sizeX="13532" sizeY="150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
<XShapes>
- <XShape positionX="756" positionY="8225" sizeX="13534" sizeY="150" type="com.sun.star.drawing.PolyLineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="762" positionY="8172" sizeX="13532" sizeY="150" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="756" positionY="8375"/>
- <point positionX="756" positionY="8225"/>
+ <point positionX="762" positionY="8322"/>
+ <point positionX="762" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="756" positionY="8375"/>
- <point positionX="756" positionY="8225"/>
+ <point positionX="762" positionY="8322"/>
+ <point positionX="762" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="4139" positionY="8375"/>
- <point positionX="4139" positionY="8225"/>
+ <point positionX="4145" positionY="8322"/>
+ <point positionX="4145" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="4139" positionY="8375"/>
- <point positionX="4139" positionY="8225"/>
+ <point positionX="4145" positionY="8322"/>
+ <point positionX="4145" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="7523" positionY="8375"/>
- <point positionX="7523" positionY="8225"/>
+ <point positionX="7528" positionY="8322"/>
+ <point positionX="7528" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="7523" positionY="8375"/>
- <point positionX="7523" positionY="8225"/>
+ <point positionX="7528" positionY="8322"/>
+ <point positionX="7528" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="10906" positionY="8375"/>
- <point positionX="10906" positionY="8225"/>
+ <point positionX="10911" positionY="8322"/>
+ <point positionX="10911" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="10906" positionY="8375"/>
- <point positionX="10906" positionY="8225"/>
+ <point positionX="10911" positionY="8322"/>
+ <point positionX="10911" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="8375"/>
- <point positionX="14290" positionY="8225"/>
+ <point positionX="14294" positionY="8322"/>
+ <point positionX="14294" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="14290" positionY="8375"/>
- <point positionX="14290" positionY="8225"/>
+ <point positionX="14294" positionY="8322"/>
+ <point positionX="14294" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
@@ -271,193 +271,193 @@
<point positionX="3383" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="6767" positionY="150"/>
- <point positionX="6767" positionY="0"/>
+ <point positionX="6766" positionY="150"/>
+ <point positionX="6766" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="6767" positionY="150"/>
- <point positionX="6767" positionY="0"/>
+ <point positionX="6766" positionY="150"/>
+ <point positionX="6766" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="10150" positionY="150"/>
- <point positionX="10150" positionY="0"/>
+ <point positionX="10149" positionY="150"/>
+ <point positionX="10149" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="10150" positionY="150"/>
- <point positionX="10150" positionY="0"/>
+ <point positionX="10149" positionY="150"/>
+ <point positionX="10149" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="150"/>
- <point positionX="13534" positionY="0"/>
+ <point positionX="13532" positionY="150"/>
+ <point positionX="13532" positionY="0"/>
</pointSequence>
<pointSequence>
- <point positionX="13534" positionY="150"/>
- <point positionX="13534" positionY="0"/>
+ <point positionX="13532" positionY="150"/>
+ <point positionX="13532" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="13534.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="150.000000" column3="8225.000000"/>
+ <Line1 column1="13532.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="150.000000" column3="8172.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="756" positionY="8225" sizeX="13534" sizeY="0" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="762" positionY="8172" sizeX="13532" sizeY="0" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="756" positionY="8225"/>
- <point positionX="14290" positionY="8225"/>
+ <point positionX="762" positionY="8172"/>
+ <point positionX="14294" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
<point positionX="0" positionY="0"/>
- <point positionX="13534" positionY="0"/>
+ <point positionX="13532" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="13534.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="0.000000" column3="8225.000000"/>
+ <Line1 column1="13532.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="0.000000" column3="8172.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13535.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="151.000000" column3="8225.000000"/>
+ <Line1 column1="13533.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="151.000000" column3="8172.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="606" positionY="352" sizeX="150" sizeY="7873" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShape positionX="612" positionY="378" sizeX="150" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
<XShapes>
- <XShape positionX="606" positionY="352" sizeX="150" sizeY="7873" type="com.sun.star.drawing.PolyLineShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="612" positionY="378" sizeX="150" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="606" positionY="8225"/>
- <point positionX="756" positionY="8225"/>
+ <point positionX="612" positionY="8172"/>
+ <point positionX="762" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="8225"/>
- <point positionX="756" positionY="8225"/>
+ <point positionX="612" positionY="8172"/>
+ <point positionX="762" positionY="8172"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="7100"/>
- <point positionX="756" positionY="7100"/>
+ <point positionX="612" positionY="7058"/>
+ <point positionX="762" positionY="7058"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="7100"/>
- <point positionX="756" positionY="7100"/>
+ <point positionX="612" positionY="7058"/>
+ <point positionX="762" positionY="7058"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="5975"/>
- <point positionX="756" positionY="5975"/>
+ <point positionX="612" positionY="5945"/>
+ <point positionX="762" positionY="5945"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="5975"/>
- <point positionX="756" positionY="5975"/>
+ <point positionX="612" positionY="5945"/>
+ <point positionX="762" positionY="5945"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="4851"/>
- <point positionX="756" positionY="4851"/>
+ <point positionX="612" positionY="4832"/>
+ <point positionX="762" positionY="4832"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="4851"/>
- <point positionX="756" positionY="4851"/>
+ <point positionX="612" positionY="4832"/>
+ <point positionX="762" positionY="4832"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="3726"/>
- <point positionX="756" positionY="3726"/>
+ <point positionX="612" positionY="3718"/>
+ <point positionX="762" positionY="3718"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="3726"/>
- <point positionX="756" positionY="3726"/>
+ <point positionX="612" positionY="3718"/>
+ <point positionX="762" positionY="3718"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="2602"/>
- <point positionX="756" positionY="2602"/>
+ <point positionX="612" positionY="2605"/>
+ <point positionX="762" positionY="2605"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="2602"/>
- <point positionX="756" positionY="2602"/>
+ <point positionX="612" positionY="2605"/>
+ <point positionX="762" positionY="2605"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="1477"/>
- <point positionX="756" positionY="1477"/>
+ <point positionX="612" positionY="1492"/>
+ <point positionX="762" positionY="1492"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="1477"/>
- <point positionX="756" positionY="1477"/>
+ <point positionX="612" positionY="1492"/>
+ <point positionX="762" positionY="1492"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="352"/>
- <point positionX="756" positionY="352"/>
+ <point positionX="612" positionY="378"/>
+ <point positionX="762" positionY="378"/>
</pointSequence>
<pointSequence>
- <point positionX="606" positionY="352"/>
- <point positionX="756" positionY="352"/>
+ <point positionX="612" positionY="378"/>
+ <point positionX="762" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="7873"/>
- <point positionX="150" positionY="7873"/>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="150" positionY="7794"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="7873"/>
- <point positionX="150" positionY="7873"/>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="150" positionY="7794"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="6748"/>
- <point positionX="150" positionY="6748"/>
+ <point positionX="0" positionY="6680"/>
+ <point positionX="150" positionY="6680"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="6748"/>
- <point positionX="150" positionY="6748"/>
+ <point positionX="0" positionY="6680"/>
+ <point positionX="150" positionY="6680"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="5623"/>
- <point positionX="150" positionY="5623"/>
+ <point positionX="0" positionY="5567"/>
+ <point positionX="150" positionY="5567"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="5623"/>
- <point positionX="150" positionY="5623"/>
+ <point positionX="0" positionY="5567"/>
+ <point positionX="150" positionY="5567"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="4499"/>
- <point positionX="150" positionY="4499"/>
+ <point positionX="0" positionY="4454"/>
+ <point positionX="150" positionY="4454"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="4499"/>
- <point positionX="150" positionY="4499"/>
+ <point positionX="0" positionY="4454"/>
+ <point positionX="150" positionY="4454"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="3374"/>
- <point positionX="150" positionY="3374"/>
+ <point positionX="0" positionY="3340"/>
+ <point positionX="150" positionY="3340"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="3374"/>
- <point positionX="150" positionY="3374"/>
+ <point positionX="0" positionY="3340"/>
+ <point positionX="150" positionY="3340"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="2250"/>
- <point positionX="150" positionY="2250"/>
+ <point positionX="0" positionY="2227"/>
+ <point positionX="150" positionY="2227"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="2250"/>
- <point positionX="150" positionY="2250"/>
+ <point positionX="0" positionY="2227"/>
+ <point positionX="150" positionY="2227"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="1125"/>
- <point positionX="150" positionY="1125"/>
+ <point positionX="0" positionY="1114"/>
+ <point positionX="150" positionY="1114"/>
</pointSequence>
<pointSequence>
- <point positionX="0" positionY="1125"/>
- <point positionX="150" positionY="1125"/>
+ <point positionX="0" positionY="1114"/>
+ <point positionX="150" positionY="1114"/>
</pointSequence>
<pointSequence>
<point positionX="0" positionY="0"/>
@@ -469,53 +469,53 @@
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="150.000000" column2="0.000000" column3="606.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="352.000000"/>
+ <Line1 column1="150.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="756" positionY="352" sizeX="0" sizeY="7873" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <XShape positionX="762" positionY="378" sizeX="0" sizeY="7794" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="756" positionY="8225"/>
- <point positionX="756" positionY="352"/>
+ <point positionX="762" positionY="8172"/>
+ <point positionX="762" positionY="378"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="7873"/>
+ <point positionX="0" positionY="7794"/>
<point positionX="0" positionY="0"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="756.000000"/>
- <Line2 column1="0.000000" column2="7873.000000" column3="352.000000"/>
+ <Line1 column1="0.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="151.000000" column2="0.000000" column3="606.000000"/>
- <Line2 column1="0.000000" column2="7874.000000" column3="352.000000"/>
+ <Line1 column1="151.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13685.000000" column2="0.000000" column3="606.000000"/>
- <Line2 column1="0.000000" column2="8024.000000" column3="352.000000"/>
+ <Line1 column1="13683.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1319" positionY="1477" sizeX="12407" sizeY="6748" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="1325" positionY="1492" sizeX="12405" sizeY="6680" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1319" positionY="3726" sizeX="11279" sizeY="4499" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+ <XShape positionX="1325" positionY="3718" sizeX="11277" sizeY="4454" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
<XShapes>
- <XShape positionX="11470" positionY="3726" sizeX="1128" sizeY="4499" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="1325" positionY="7058" sizeX="1128" sizeY="1114" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff0000" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -524,30 +524,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="11470" positionY="8225"/>
- <point positionX="12598" positionY="8225"/>
- <point positionX="12598" positionY="3726"/>
- <point positionX="11470" positionY="3726"/>
- <point positionX="11470" positionY="8225"/>
+ <point positionX="1325" positionY="8172"/>
+ <point positionX="2453" positionY="8172"/>
+ <point positionX="2453" positionY="7058"/>
+ <point positionX="1325" positionY="7058"/>
+ <point positionX="1325" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="4499"/>
- <point positionX="1128" positionY="4499"/>
+ <point positionX="0" positionY="1114"/>
+ <point positionX="1128" positionY="1114"/>
<point positionX="1128" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="4499"/>
+ <point positionX="0" positionY="1114"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1128.000000" column2="0.000000" column3="11470.000000"/>
- <Line2 column1="0.000000" column2="4499.000000" column3="3726.000000"/>
+ <Line1 column1="1128.000000" column2="0.000000" column3="1325.000000"/>
+ <Line2 column1="0.000000" column2="1114.000000" column3="7058.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8086" positionY="4851" sizeX="1128" sizeY="3374" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="0000ff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="4708" positionY="5945" sizeX="1128" sizeY="2227" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="00ff00" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -556,30 +556,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="8086" positionY="8225"/>
- <point positionX="9214" positionY="8225"/>
- <point positionX="9214" positionY="4851"/>
- <point positionX="8086" positionY="4851"/>
- <point positionX="8086" positionY="8225"/>
+ <point positionX="4708" positionY="8172"/>
+ <point positionX="5836" positionY="8172"/>
+ <point positionX="5836" positionY="5945"/>
+ <point positionX="4708" positionY="5945"/>
+ <point positionX="4708" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="3374"/>
- <point positionX="1128" positionY="3374"/>
+ <point positionX="0" positionY="2227"/>
+ <point positionX="1128" positionY="2227"/>
<point positionX="1128" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="3374"/>
+ <point positionX="0" positionY="2227"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1128.000000" column2="0.000000" column3="8086.000000"/>
- <Line2 column1="0.000000" column2="3374.000000" column3="4851.000000"/>
+ <Line1 column1="1128.000000" column2="0.000000" column3="4708.000000"/>
+ <Line2 column1="0.000000" column2="2227.000000" column3="5945.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="4703" positionY="5975" sizeX="1128" sizeY="2250" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="00ff00" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="8091" positionY="4832" sizeX="1128" sizeY="3340" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="0000ff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -588,30 +588,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="4703" positionY="8225"/>
- <point positionX="5831" positionY="8225"/>
- <point positionX="5831" positionY="5975"/>
- <point positionX="4703" positionY="5975"/>
- <point positionX="4703" positionY="8225"/>
+ <point positionX="8091" positionY="8172"/>
+ <point positionX="9219" positionY="8172"/>
+ <point positionX="9219" positionY="4832"/>
+ <point positionX="8091" positionY="4832"/>
+ <point positionX="8091" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="2250"/>
- <point positionX="1128" positionY="2250"/>
+ <point positionX="0" positionY="3340"/>
+ <point positionX="1128" positionY="3340"/>
<point positionX="1128" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="2250"/>
+ <point positionX="0" positionY="3340"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1128.000000" column2="0.000000" column3="4703.000000"/>
- <Line2 column1="0.000000" column2="2250.000000" column3="5975.000000"/>
+ <Line1 column1="1128.000000" column2="0.000000" column3="8091.000000"/>
+ <Line2 column1="0.000000" column2="3340.000000" column3="4832.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1319" positionY="7100" sizeX="1128" sizeY="1125" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff0000" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="11474" positionY="3718" sizeX="1128" sizeY="4454" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -620,39 +620,39 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="1319" positionY="8225"/>
- <point positionX="2447" positionY="8225"/>
- <point positionX="2447" positionY="7100"/>
- <point positionX="1319" positionY="7100"/>
- <point positionX="1319" positionY="8225"/>
+ <point positionX="11474" positionY="8172"/>
+ <point positionX="12602" positionY="8172"/>
+ <point positionX="12602" positionY="3718"/>
+ <point positionX="11474" positionY="3718"/>
+ <point positionX="11474" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="1125"/>
- <point positionX="1128" positionY="1125"/>
+ <point positionX="0" positionY="4454"/>
+ <point positionX="1128" positionY="4454"/>
<point positionX="1128" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="1125"/>
+ <point positionX="0" positionY="4454"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1128.000000" column2="0.000000" column3="1319.000000"/>
- <Line2 column1="0.000000" column2="1125.000000" column3="7100.000000"/>
+ <Line1 column1="1128.000000" column2="0.000000" column3="11474.000000"/>
+ <Line2 column1="0.000000" column2="4454.000000" column3="3718.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="11280.000000" column2="0.000000" column3="1319.000000"/>
- <Line2 column1="0.000000" column2="4500.000000" column3="3726.000000"/>
+ <Line1 column1="11278.000000" column2="0.000000" column3="1325.000000"/>
+ <Line2 column1="0.000000" column2="4455.000000" column3="3718.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="2447" positionY="1477" sizeX="11279" sizeY="6748" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1">
+ <XShape positionX="2453" positionY="1492" sizeX="11277" sizeY="6680" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1">
<XShapes>
- <XShape positionX="12598" positionY="1477" sizeX="1128" sizeY="6748" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="2453" positionY="4832" sizeX="1128" sizeY="3340" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -661,30 +661,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="12598" positionY="8225"/>
- <point positionX="13726" positionY="8225"/>
- <point positionX="13726" positionY="1477"/>
- <point positionX="12598" positionY="1477"/>
- <point positionX="12598" positionY="8225"/>
+ <point positionX="2453" positionY="8172"/>
+ <point positionX="3581" positionY="8172"/>
+ <point positionX="3581" positionY="4832"/>
+ <point positionX="2453" positionY="4832"/>
+ <point positionX="2453" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="6748"/>
- <point positionX="1128" positionY="6748"/>
+ <point positionX="0" positionY="3340"/>
+ <point positionX="1128" positionY="3340"/>
<point positionX="1128" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="6748"/>
+ <point positionX="0" positionY="3340"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1128.000000" column2="0.000000" column3="12598.000000"/>
- <Line2 column1="0.000000" column2="6748.000000" column3="1477.000000"/>
+ <Line1 column1="1128.000000" column2="0.000000" column3="2453.000000"/>
+ <Line2 column1="0.000000" column2="3340.000000" column3="4832.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="9214" positionY="2602" sizeX="1128" sizeY="5623" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="5836" positionY="3718" sizeX="1128" sizeY="4454" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -693,30 +693,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="9214" positionY="8225"/>
- <point positionX="10342" positionY="8225"/>
- <point positionX="10342" positionY="2602"/>
- <point positionX="9214" positionY="2602"/>
- <point positionX="9214" positionY="8225"/>
+ <point positionX="5836" positionY="8172"/>
+ <point positionX="6964" positionY="8172"/>
+ <point positionX="6964" positionY="3718"/>
+ <point positionX="5836" positionY="3718"/>
+ <point positionX="5836" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="5623"/>
- <point positionX="1128" positionY="5623"/>
+ <point positionX="0" positionY="4454"/>
+ <point positionX="1128" positionY="4454"/>
<point positionX="1128" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="5623"/>
+ <point positionX="0" positionY="4454"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1128.000000" column2="0.000000" column3="9214.000000"/>
- <Line2 column1="0.000000" column2="5623.000000" column3="2602.000000"/>
+ <Line1 column1="1128.000000" column2="0.000000" column3="5836.000000"/>
+ <Line2 column1="0.000000" column2="4454.000000" column3="3718.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="5831" positionY="3726" sizeX="1128" sizeY="4499" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="9219" positionY="2605" sizeX="1128" sizeY="5567" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -725,30 +725,30 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="5831" positionY="8225"/>
- <point positionX="6959" positionY="8225"/>
- <point positionX="6959" positionY="3726"/>
- <point positionX="5831" positionY="3726"/>
- <point positionX="5831" positionY="8225"/>
+ <point positionX="9219" positionY="8172"/>
+ <point positionX="10347" positionY="8172"/>
+ <point positionX="10347" positionY="2605"/>
+ <point positionX="9219" positionY="2605"/>
+ <point positionX="9219" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="4499"/>
- <point positionX="1128" positionY="4499"/>
+ <point positionX="0" positionY="5567"/>
+ <point positionX="1128" positionY="5567"/>
<point positionX="1128" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="4499"/>
+ <point positionX="0" positionY="5567"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1128.000000" column2="0.000000" column3="5831.000000"/>
- <Line2 column1="0.000000" column2="4499.000000" column3="3726.000000"/>
+ <Line1 column1="1128.000000" column2="0.000000" column3="9219.000000"/>
+ <Line2 column1="0.000000" column2="5567.000000" column3="2605.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="2447" positionY="4851" sizeX="1128" sizeY="3374" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12602" positionY="1492" sizeX="1128" sizeY="6680" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -757,62 +757,62 @@
<LineEnd/>
<PolyPolygon>
<pointSequence>
- <point positionX="2447" positionY="8225"/>
- <point positionX="3575" positionY="8225"/>
- <point positionX="3575" positionY="4851"/>
- <point positionX="2447" positionY="4851"/>
- <point positionX="2447" positionY="8225"/>
+ <point positionX="12602" positionY="8172"/>
+ <point positionX="13730" positionY="8172"/>
+ <point positionX="13730" positionY="1492"/>
+ <point positionX="12602" positionY="1492"/>
+ <point positionX="12602" positionY="8172"/>
</pointSequence>
</PolyPolygon>
<Geometry>
<pointSequence>
- <point positionX="0" positionY="3374"/>
- <point positionX="1128" positionY="3374"/>
+ <point positionX="0" positionY="6680"/>
+ <point positionX="1128" positionY="6680"/>
<point positionX="1128" positionY="0"/>
<point positionX="0" positionY="0"/>
- <point positionX="0" positionY="3374"/>
+ <point positionX="0" positionY="6680"/>
</pointSequence>
</Geometry>
<Transformation>
- <Line1 column1="1128.000000" column2="0.000000" column3="2447.000000"/>
- <Line2 column1="0.000000" column2="3374.000000" column3="4851.000000"/>
+ <Line1 column1="1128.000000" column2="0.000000" column3="12602.000000"/>
+ <Line2 column1="0.000000" column2="6680.000000" column3="1492.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="11280.000000" column2="0.000000" column3="2447.000000"/>
- <Line2 column1="0.000000" column2="6749.000000" column3="1477.000000"/>
+ <Line1 column1="11278.000000" column2="0.000000" column3="2453.000000"/>
+ <Line2 column1="0.000000" column2="6681.000000" column3="1492.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="12408.000000" column2="0.000000" column3="1319.000000"/>
- <Line2 column1="0.000000" column2="6749.000000" column3="1477.000000"/>
+ <Line1 column1="12406.000000" column2="0.000000" column3="1325.000000"/>
+ <Line2 column1="0.000000" column2="6681.000000" column3="1492.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13685.000000" column2="0.000000" column3="606.000000"/>
- <Line2 column1="0.000000" column2="8024.000000" column3="352.000000"/>
+ <Line1 column1="13683.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13685.000000" column2="0.000000" column3="606.000000"/>
- <Line2 column1="0.000000" column2="8024.000000" column3="352.000000"/>
+ <Line1 column1="13683.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="12372" sizeY="8640" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="320" positionY="180" sizeX="12379" sizeY="8640" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="2354" positionY="8475" sizeX="10338" sizeY="345" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShape positionX="2357" positionY="8422" sizeX="10342" sizeY="398" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
<XShapes>
- <XShape positionX="2354" positionY="8475" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="2357" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -820,13 +820,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="2354.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="2357.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="5738" positionY="8475" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="5740" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -834,13 +834,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="5738.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="5740.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="9121" positionY="8475" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="3" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="9123" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="3" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -848,13 +848,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="9121.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="9123.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12505" positionY="8475" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="4" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="12506" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="4" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -862,22 +862,22 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="12505.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="12506.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="10339.000000" column2="0.000000" column3="2354.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8475.000000"/>
+ <Line1 column1="10343.000000" column2="0.000000" column3="2357.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="187" sizeY="8218" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShape positionX="320" positionY="180" sizeX="193" sizeY="8192" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
<XShapes>
- <XShape positionX="320" positionY="8053" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="0" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="7974" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="0" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -885,13 +885,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="8053.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="7974.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="6928" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="6860" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -899,13 +899,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="6928.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="6860.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="5803" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="5747" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -913,13 +913,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="5803.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="5747.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="4679" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="3" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="4634" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="3" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -927,13 +927,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="4679.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4634.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="3554" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="4" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="3520" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="4" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -941,13 +941,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="3554.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="3520.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="2430" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="5" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="2407" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="5" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -955,13 +955,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="2430.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="2407.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="1305" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="6" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="1294" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="6" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -969,13 +969,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="1305.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="1294.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="320" positionY="180" sizeX="187" sizeY="345" type="com.sun.star.drawing.TextShape" text="7" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="320" positionY="180" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="7" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -983,43 +983,43 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="180.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="320.000000"/>
- <Line2 column1="0.000000" column2="8219.000000" column3="180.000000"/>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8193.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="12373.000000" column2="0.000000" column3="320.000000"/>
+ <Line1 column1="12380.000000" column2="0.000000" column3="320.000000"/>
<Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13971.000000" column2="0.000000" column3="320.000000"/>
+ <Line1 column1="13975.000000" column2="0.000000" column3="320.000000"/>
<Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="13971.000000" column2="0.000000" column3="320.000000"/>
+ <Line1 column1="13975.000000" column2="0.000000" column3="320.000000"/>
<Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14610" positionY="4005" sizeX="1180" sizeY="990" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
+ <XShape positionX="14614" positionY="3952" sizeX="1176" sizeY="1096" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
<XShapes>
- <XShape positionX="14610" positionY="4005" sizeX="1180" sizeY="990" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="14614" positionY="3952" sizeX="1176" sizeY="1096" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1027,17 +1027,17 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1181.000000" column2="0.000000" column3="14610.000000"/>
- <Line2 column1="0.000000" column2="991.000000" column3="4005.000000"/>
+ <Line1 column1="1177.000000" column2="0.000000" column3="14614.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3952.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14726" positionY="4172" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="14730" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="14726" positionY="4172" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
+ <XShape positionX="14730" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
<XShapes>
- <XShape positionX="14726" positionY="4172" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="14730" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1045,13 +1045,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14726.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4172.000000"/>
+ <Line1 column1="212.000000" column2="0.000000" column3="14730.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14726" positionY="4172" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="14730" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1059,31 +1059,31 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14726.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4172.000000"/>
+ <Line1 column1="212.000000" column2="0.000000" column3="14730.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14726.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4172.000000"/>
+ <Line1 column1="212.000000" column2="0.000000" column3="14730.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14726.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4172.000000"/>
+ <Line1 column1="212.000000" column2="0.000000" column3="14730.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14726" positionY="4617" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="14730" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="14726" positionY="4617" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
+ <XShape positionX="14730" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
<XShapes>
- <XShape positionX="14726" positionY="4617" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="14730" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1091,13 +1091,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14726.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4617.000000"/>
+ <Line1 column1="212.000000" column2="0.000000" column3="14730.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14726" positionY="4617" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="14730" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1105,27 +1105,27 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14726.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4617.000000"/>
+ <Line1 column1="212.000000" column2="0.000000" column3="14730.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14726.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4617.000000"/>
+ <Line1 column1="212.000000" column2="0.000000" column3="14730.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14726.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4617.000000"/>
+ <Line1 column1="212.000000" column2="0.000000" column3="14730.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="15037" positionY="4105" sizeX="637" sizeY="345" type="com.sun.star.drawing.TextShape" text="col1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="15041" positionY="4052" sizeX="633" sizeY="398" type="com.sun.star.drawing.TextShape" text="col1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1133,13 +1133,13 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="638.000000" column2="0.000000" column3="15037.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="4105.000000"/>
+ <Line1 column1="634.000000" column2="0.000000" column3="15041.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4052.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="15037" positionY="4550" sizeX="637" sizeY="345" type="com.sun.star.drawing.TextShape" text="col2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <XShape positionX="15041" positionY="4550" sizeX="633" sizeY="398" type="com.sun.star.drawing.TextShape" text="col2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
<FillBitmap/>
@@ -1147,15 +1147,15 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="638.000000" column2="0.000000" column3="15037.000000"/>
- <Line2 column1="0.000000" column2="346.000000" column3="4550.000000"/>
+ <Line1 column1="634.000000" column2="0.000000" column3="15041.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4550.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1181.000000" column2="0.000000" column3="14610.000000"/>
- <Line2 column1="0.000000" column2="991.000000" column3="4005.000000"/>
+ <Line1 column1="1177.000000" column2="0.000000" column3="14614.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3952.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
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 000000000000..b14a27418d0a
--- /dev/null
+++ b/chart2/qa/extras/xshape/data/reference/tdf149204.xml
@@ -0,0 +1,397 @@
+<?xml version="1.0"?>
+<XShapes>
+ <XShape positionX="0" positionY="0" sizeX="14277" sizeY="10471" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="14278.000000" column2="0.000000" column3="0.000000"/>
+ <Line2 column1="0.000000" column2="10472.000000" column3="0.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="1741" positionY="1996" sizeX="12230" sizeY="7836" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShapes>
+ <XShape positionX="1741" positionY="1996" sizeX="12230" sizeY="7836" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="12231.000000" column2="0.000000" column3="1741.000000"/>
+ <Line2 column1="0.000000" column2="7837.000000" column3="1996.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="1741" positionY="2023" sizeX="12230" sizeY="7782" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="12231.000000" column2="0.000000" column3="1741.000000"/>
+ <Line2 column1="0.000000" column2="7783.000000" column3="2023.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="1741" positionY="2023" sizeX="12230" sizeY="7782" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="1741" positionY="2023" sizeX="12230" sizeY="7782" type="com.sun.star.drawing.Shape3DSceneObject" name="PlotAreaExcludingAxes"/>
+ <XShape positionX="3838" positionY="3445" sizeX="9345" sizeY="5248" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="3838" positionY="3445" sizeX="9345" sizeY="5248" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="12788" positionY="8216" sizeX="395" sizeY="477" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
+ <XShapes>
+ <XShape positionX="12788" positionY="8216" sizeX="395" sizeY="477" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
+ <XShapes>
+ <XShape positionX="12788" positionY="8216" sizeX="395" sizeY="477" type="com.sun.star.drawing.TextShape" text="13" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3490" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="396.000000" column2="0.000000" column3="12788.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="8216.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="396.000000" column2="0.000000" column3="12788.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="8216.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="396.000000" column2="0.000000" column3="12788.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="8216.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7092" positionY="5831" sizeX="199" sizeY="477" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1:DataLabels=">
+ <XShapes>
+ <XShape positionX="7092" positionY="5831" sizeX="199" sizeY="477" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=1:DataLabels=:DataLabel=0">
+ <XShapes>
+ <XShape positionX="7092" positionY="5831" sizeX="199" sizeY="477" type="com.sun.star.drawing.TextShape" text="6" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3490" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="200.000000" column2="0.000000" column3="7092.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="5831.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="200.000000" column2="0.000000" column3="7092.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="5831.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="200.000000" column2="0.000000" column3="7092.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="5831.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="3838" positionY="3445" sizeX="199" sizeY="477" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=2:DataLabels=">
+ <XShapes>
+ <XShape positionX="3838" positionY="3445" sizeX="199" sizeY="477" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=2:DataLabels=:DataLabel=0">
+ <XShapes>
+ <XShape positionX="3838" positionY="3445" sizeX="199" sizeY="477" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3490" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="200.000000" column2="0.000000" column3="3838.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="3445.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="200.000000" column2="0.000000" column3="3838.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="3445.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="200.000000" column2="0.000000" column3="3838.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="3445.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="9346.000000" column2="0.000000" column3="3838.000000"/>
+ <Line2 column1="0.000000" column2="5249.000000" column3="3445.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="9346.000000" column2="0.000000" column3="3838.000000"/>
+ <Line2 column1="0.000000" column2="5249.000000" column3="3445.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12231.000000" column2="0.000000" column3="1741.000000"/>
+ <Line2 column1="0.000000" column2="7783.000000" column3="2023.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12231.000000" column2="0.000000" column3="1741.000000"/>
+ <Line2 column1="0.000000" column2="7837.000000" column3="1996.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4074" positionY="985" sizeX="9286" sizeY="1295" type="com.sun.star.drawing.TextShape" name="CID/Title=" text="Gr&#xE1;fico de Colunas ou Barras" fontHeight="18.600000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="118" textRightDistance="118" textUpperDistance="197" textLowerDistance="197" textMaximumFrameHeight="0" textMaximumFrameWidth="11421" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="d9d9d9" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="9287.000000" column2="0.000000" column3="4074.000000"/>
+ <Line2 column1="0.000000" column2="1296.000000" column3="985.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4928" positionY="9793" sizeX="4420" sizeY="677" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
+ <XShapes>
+ <XShape positionX="4928" positionY="9793" sizeX="4420" sizeY="677" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="d9d9d9" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="4421.000000" column2="0.000000" column3="4928.000000"/>
+ <Line2 column1="0.000000" column2="678.000000" column3="9793.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7919" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="7919" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="7919" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="7919.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7919" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="5b9bd5" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="7919.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="7919.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="7919.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6424" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="6424" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="6424" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="6424.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6424" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ed7d31" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="6424.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="6424.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="6424.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="5044" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="5044" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=2:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="5044" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="5044.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="5044" positionY="10026" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="a5a5a5" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="5044.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="5044.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="5044.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="10026.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="5355" positionY="9893" sizeX="837" sizeY="477" type="com.sun.star.drawing.TextShape" text="Cupe" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="13966" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="838.000000" column2="0.000000" column3="5355.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="9893.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6735" positionY="9893" sizeX="952" sizeY="477" type="com.sun.star.drawing.TextShape" text="Hatch" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="13966" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="953.000000" column2="0.000000" column3="6735.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="9893.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="8230" positionY="9893" sizeX="1002" sizeY="477" type="com.sun.star.drawing.TextShape" text="Sedan" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="13966" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="1003.000000" column2="0.000000" column3="8230.000000"/>
+ <Line2 column1="0.000000" column2="478.000000" column3="9893.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="4421.000000" column2="0.000000" column3="4928.000000"/>
+ <Line2 column1="0.000000" column2="678.000000" column3="9793.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+</XShapes>
+
+
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 000000000000..83750aea2054
--- /dev/null
+++ b/chart2/qa/extras/xshape/data/reference/tdf150832.xml
@@ -0,0 +1,974 @@
+<?xml version="1.0"?>
+<XShapes>
+ <XShape positionX="0" positionY="0" sizeX="15990" sizeY="8998" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="15991.000000" column2="0.000000" column3="0.000000"/>
+ <Line2 column1="0.000000" column2="8999.000000" column3="0.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="179" sizeX="13087" sizeY="8640" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShapes>
+ <XShape positionX="761" positionY="379" sizeX="12645" sizeY="7793" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="12646.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="379.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="179" sizeX="13087" sizeY="8640" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="13088.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="8641.000000" column3="179.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="179" sizeX="13087" sizeY="8640" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="611" positionY="377" sizeX="12795" sizeY="7944" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="761" positionY="379" sizeX="12645" sizeY="7793" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+ <XShapes>
+ <XShape positionX="761" positionY="379" sizeX="12645" sizeY="7793" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="000000" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="12646.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="379.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12646.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="379.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="611" positionY="377" sizeX="12795" sizeY="7944" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+ <XShapes>
+ <XShape positionX="761" positionY="377" sizeX="12645" sizeY="7794" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="761" positionY="377" sizeX="12645" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
+ <XShapes>
+ <XShape positionX="761" positionY="377" sizeX="12645" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="13406" positionY="8171"/>
+ <point positionX="761" positionY="8171"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13406" positionY="7057"/>
+ <point positionX="761" positionY="7057"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13406" positionY="5944"/>
+ <point positionX="761" positionY="5944"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13406" positionY="4831"/>
+ <point positionX="761" positionY="4831"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13406" positionY="3717"/>
+ <point positionX="761" positionY="3717"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13406" positionY="2604"/>
+ <point positionX="761" positionY="2604"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13406" positionY="1491"/>
+ <point positionX="761" positionY="1491"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13406" positionY="377"/>
+ <point positionX="761" positionY="377"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="12645" positionY="7794"/>
+ <point positionX="0" positionY="7794"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="12645" positionY="6680"/>
+ <point positionX="0" positionY="6680"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="12645" positionY="5567"/>
+ <point positionX="0" positionY="5567"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="12645" positionY="4454"/>
+ <point positionX="0" positionY="4454"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="12645" positionY="3340"/>
+ <point positionX="0" positionY="3340"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="12645" positionY="2227"/>
+ <point positionX="0" positionY="2227"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="12645" positionY="1114"/>
+ <point positionX="0" positionY="1114"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="12645" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="12645.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="761" positionY="377" sizeX="0" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="NONE">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="761" positionY="8171"/>
+ <point positionX="761" positionY="7057"/>
+ <point positionX="761" positionY="5944"/>
+ <point positionX="761" positionY="4831"/>
+ <point positionX="761" positionY="3717"/>
+ <point positionX="761" positionY="2604"/>
+ <point positionX="761" positionY="1491"/>
+ <point positionX="761" positionY="377"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="0" positionY="6680"/>
+ <point positionX="0" positionY="5567"/>
+ <point positionX="0" positionY="4454"/>
+ <point positionX="0" positionY="3340"/>
+ <point positionX="0" positionY="2227"/>
+ <point positionX="0" positionY="1114"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="0.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12646.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12646.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="611" positionY="377" sizeX="12795" sizeY="7944" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="761" positionY="8171" sizeX="12645" sizeY="150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShapes>
+ <XShape positionX="761" positionY="8171" sizeX="12645" sizeY="150" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="761" positionY="8321"/>
+ <point positionX="761" positionY="8171"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="4976" positionY="8321"/>
+ <point positionX="4976" positionY="8171"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="9191" positionY="8321"/>
+ <point positionX="9191" positionY="8171"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13406" positionY="8321"/>
+ <point positionX="13406" positionY="8171"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="150"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="4215" positionY="150"/>
+ <point positionX="4215" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="8430" positionY="150"/>
+ <point positionX="8430" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="12645" positionY="150"/>
+ <point positionX="12645" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="12645.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="150.000000" column3="8171.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="761" positionY="8171" sizeX="12645" sizeY="0" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="761" positionY="8171"/>
+ <point positionX="13406" positionY="8171"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="12645" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="12645.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="0.000000" column3="8171.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12646.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="151.000000" column3="8171.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="611" positionY="377" sizeX="150" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="611" positionY="377" sizeX="150" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="611" positionY="8171"/>
+ <point positionX="761" positionY="8171"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="611" positionY="7057"/>
+ <point positionX="761" positionY="7057"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="611" positionY="5944"/>
+ <point positionX="761" positionY="5944"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="611" positionY="4831"/>
+ <point positionX="761" positionY="4831"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="611" positionY="3717"/>
+ <point positionX="761" positionY="3717"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="611" positionY="2604"/>
+ <point positionX="761" positionY="2604"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="611" positionY="1491"/>
+ <point positionX="761" positionY="1491"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="611" positionY="377"/>
+ <point positionX="761" positionY="377"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="150" positionY="7794"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="6680"/>
+ <point positionX="150" positionY="6680"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="5567"/>
+ <point positionX="150" positionY="5567"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="4454"/>
+ <point positionX="150" positionY="4454"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="3340"/>
+ <point positionX="150" positionY="3340"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="2227"/>
+ <point positionX="150" positionY="2227"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="1114"/>
+ <point positionX="150" positionY="1114"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="150" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="150.000000" column2="0.000000" column3="611.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="761" positionY="377" sizeX="0" sizeY="7794" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="761" positionY="8171"/>
+ <point positionX="761" positionY="377"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="0.000000" column2="0.000000" column3="761.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="151.000000" column2="0.000000" column3="611.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12796.000000" column2="0.000000" column3="611.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="1463" positionY="1491" sizeX="11240" sizeY="6680" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="1463" positionY="2604" sizeX="9835" sizeY="5567" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+ <XShapes>
+ <XShape positionX="1463" positionY="7057" sizeX="1405" sizeY="1114" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="1463" positionY="8171"/>
+ <point positionX="2868" positionY="8171"/>
+ <point positionX="2868" positionY="7057"/>
+ <point positionX="1463" positionY="7057"/>
+ <point positionX="1463" positionY="8171"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="1114"/>
+ <point positionX="1405" positionY="1114"/>
+ <point positionX="1405" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="1114"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="1405.000000" column2="0.000000" column3="1463.000000"/>
+ <Line2 column1="0.000000" column2="1114.000000" column3="7057.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="5678" positionY="4831" sizeX="1405" sizeY="3340" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="5678" positionY="8171"/>
+ <point positionX="7083" positionY="8171"/>
+ <point positionX="7083" positionY="4831"/>
+ <point positionX="5678" positionY="4831"/>
+ <point positionX="5678" positionY="8171"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="3340"/>
+ <point positionX="1405" positionY="3340"/>
+ <point positionX="1405" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="3340"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="1405.000000" column2="0.000000" column3="5678.000000"/>
+ <Line2 column1="0.000000" column2="3340.000000" column3="4831.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="9893" positionY="2604" sizeX="1405" sizeY="5567" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="9893" positionY="8171"/>
+ <point positionX="11298" positionY="8171"/>
+ <point positionX="11298" positionY="2604"/>
+ <point positionX="9893" positionY="2604"/>
+ <point positionX="9893" positionY="8171"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="5567"/>
+ <point positionX="1405" positionY="5567"/>
+ <point positionX="1405" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="5567"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="1405.000000" column2="0.000000" column3="9893.000000"/>
+ <Line2 column1="0.000000" column2="5567.000000" column3="2604.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="9836.000000" column2="0.000000" column3="1463.000000"/>
+ <Line2 column1="0.000000" column2="5568.000000" column3="2604.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="2868" positionY="1491" sizeX="9835" sizeY="6680" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1">
+ <XShapes>
+ <XShape positionX="2868" positionY="5944" sizeX="1405" sizeY="2227" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="2868" positionY="8171"/>
+ <point positionX="4273" positionY="8171"/>
+ <point positionX="4273" positionY="5944"/>
+ <point positionX="2868" positionY="5944"/>
+ <point positionX="2868" positionY="8171"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="2227"/>
+ <point positionX="1405" positionY="2227"/>
+ <point positionX="1405" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="2227"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="1405.000000" column2="0.000000" column3="2868.000000"/>
+ <Line2 column1="0.000000" column2="2227.000000" column3="5944.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7083" positionY="3717" sizeX="1405" sizeY="4454" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7083" positionY="8171"/>
+ <point positionX="8488" positionY="8171"/>
+ <point positionX="8488" positionY="3717"/>
+ <point positionX="7083" positionY="3717"/>
+ <point positionX="7083" positionY="8171"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="4454"/>
+ <point positionX="1405" positionY="4454"/>
+ <point positionX="1405" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="4454"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="1405.000000" column2="0.000000" column3="7083.000000"/>
+ <Line2 column1="0.000000" column2="4454.000000" column3="3717.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="11298" positionY="1491" sizeX="1405" sizeY="6680" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="11298" positionY="8171"/>
+ <point positionX="12703" positionY="8171"/>
+ <point positionX="12703" positionY="1491"/>
+ <point positionX="11298" positionY="1491"/>
+ <point positionX="11298" positionY="8171"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="6680"/>
+ <point positionX="1405" positionY="6680"/>
+ <point positionX="1405" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="6680"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="1405.000000" column2="0.000000" column3="11298.000000"/>
+ <Line2 column1="0.000000" column2="6680.000000" column3="1491.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="9836.000000" column2="0.000000" column3="2868.000000"/>
+ <Line2 column1="0.000000" column2="6681.000000" column3="1491.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="11241.000000" column2="0.000000" column3="1463.000000"/>
+ <Line2 column1="0.000000" column2="6681.000000" column3="1491.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12796.000000" column2="0.000000" column3="611.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12796.000000" column2="0.000000" column3="611.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="377.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="179" sizeX="11076" sizeY="8640" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="2772" positionY="8421" sizeX="8623" sizeY="398" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShapes>
+ <XShape positionX="2772" positionY="8421" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="1" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="2772.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8421.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6987" positionY="8421" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="6987.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8421.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="11202" positionY="8421" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="3" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="11202.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8421.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="8624.000000" column2="0.000000" column3="2772.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8421.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="179" sizeX="193" sizeY="8192" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="319" positionY="7973" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="0" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="7973.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="6859" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="1" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="6859.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="5746" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="5746.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="4633" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="3" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4633.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="3519" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="4" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="3519.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="2406" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="5" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="2406.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="1293" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="6" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="1293.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="319" positionY="179" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="7" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="179.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="8193.000000" column3="179.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="11077.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="8641.000000" column3="179.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13088.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="8641.000000" column3="179.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13088.000000" column2="0.000000" column3="319.000000"/>
+ <Line2 column1="0.000000" column2="8641.000000" column3="179.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="13725" positionY="3951" sizeX="2055" sizeY="1096" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
+ <XShapes>
+ <XShape positionX="13725" positionY="3951" sizeX="2055" sizeY="1096" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="000000" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="2056.000000" column2="0.000000" column3="13725.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3951.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="13841" positionY="4144" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="13841" positionY="4144" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="13841" positionY="4144" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="13841.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4144.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="13841" positionY="4144" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="13841.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4144.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="13841.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4144.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="13841.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4144.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="13841" positionY="4642" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="13841" positionY="4642" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="13841" positionY="4642" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="13841.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4642.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="13841" positionY="4642" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="13841.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4642.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="13841.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4642.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="13841.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4642.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14152" positionY="4051" sizeX="1512" sizeY="398" type="com.sun.star.drawing.TextShape" text="Column A" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4797" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="1513.000000" column2="0.000000" column3="14152.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4051.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14152" positionY="4549" sizeX="1512" sizeY="398" type="com.sun.star.drawing.TextShape" text="Column B" fontHeight="10.000000" fontColor="000000" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4797" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="1513.000000" column2="0.000000" column3="14152.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4549.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="2056.000000" column2="0.000000" column3="13725.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3951.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+</XShapes>
+
+
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 000000000000..eb37ef78c090
--- /dev/null
+++ b/chart2/qa/extras/xshape/data/reference/tdf151424.xml
@@ -0,0 +1,1160 @@
+<?xml version="1.0"?>
+<XShapes>
+ <XShape positionX="0" positionY="0" sizeX="16011" sizeY="9010" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="16012.000000" column2="0.000000" column3="0.000000"/>
+ <Line2 column1="0.000000" column2="9011.000000" column3="0.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="180" sizeX="13511" sizeY="8650" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShapes>
+ <XShape positionX="3724" positionY="1154" sizeX="6703" sizeY="6703" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="6704.000000" column2="0.000000" column3="3724.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1154.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="180" sizeX="13511" sizeY="8650" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="13512.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8651.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="2985" positionY="180" sizeX="8181" sizeY="8650" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="3724" positionY="1153" sizeX="6703" sizeY="6704" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="3724" positionY="1154" sizeX="6703" sizeY="6703" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+ <XShapes>
+ <XShape positionX="3724" positionY="1154" sizeX="6703" sizeY="6703" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="6704.000000" column2="0.000000" column3="3724.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1154.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="6704.000000" column2="0.000000" column3="3724.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1154.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4098" positionY="1153" sizeX="5954" sizeY="6703" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+ <XShapes>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
+ <XShapes>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.PolyLineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="4504"/>
+ <point positionX="7075" positionY="4504"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7075" positionY="1153"/>
+ <point positionX="4173" positionY="2828"/>
+ <point positionX="4173" positionY="6180"/>
+ <point positionX="7075" positionY="7856"/>
+ <point positionX="9977" positionY="6180"/>
+ <point positionX="9977" positionY="2828"/>
+ <point positionX="7075" positionY="1153"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="2902" positionY="3351"/>
+ <point positionX="2902" positionY="3351"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="2902" positionY="0"/>
+ <point positionX="0" positionY="1675"/>
+ <point positionX="0" positionY="5027"/>
+ <point positionX="2902" positionY="6703"/>
+ <point positionX="5804" positionY="5027"/>
+ <point positionX="5804" positionY="1675"/>
+ <point positionX="2902" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="5804.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6703.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="5805.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="5805.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4098" positionY="1153" sizeX="5954" sizeY="6703" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShapes>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.PolyLineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="1153"/>
+ <point positionX="4173" positionY="2828"/>
+ <point positionX="4173" positionY="6180"/>
+ <point positionX="7075" positionY="7856"/>
+ <point positionX="9977" positionY="6180"/>
+ <point positionX="9977" positionY="2828"/>
+ <point positionX="7075" positionY="1153"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="2902" positionY="0"/>
+ <point positionX="0" positionY="1675"/>
+ <point positionX="0" positionY="5027"/>
+ <point positionX="2902" positionY="6703"/>
+ <point positionX="5804" positionY="5027"/>
+ <point positionX="5804" positionY="1675"/>
+ <point positionX="2902" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="5804.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6703.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="5805.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6925" positionY="1153" sizeX="300" sizeY="3351" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="6925" positionY="1153" sizeX="300" sizeY="3351" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7225" positionY="4504"/>
+ <point positionX="6925" positionY="4504"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7225" positionY="4504"/>
+ <point positionX="6925" positionY="4504"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7225" positionY="1153"/>
+ <point positionX="6925" positionY="1153"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7225" positionY="1153"/>
+ <point positionX="6925" positionY="1153"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="300" positionY="3351"/>
+ <point positionX="0" positionY="3351"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="300" positionY="3351"/>
+ <point positionX="0" positionY="3351"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="300" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="300" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="300.000000" column2="0.000000" column3="6925.000000"/>
+ <Line2 column1="0.000000" column2="3351.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7075" positionY="1153" sizeX="0" sizeY="3351" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="4504"/>
+ <point positionX="7075" positionY="1153"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="3351"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="0.000000" column2="0.000000" column3="7075.000000"/>
+ <Line2 column1="0.000000" column2="3351.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="301.000000" column2="0.000000" column3="6925.000000"/>
+ <Line2 column1="0.000000" column2="3352.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4098" positionY="2698" sizeX="3052" sizeY="1936" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="4098" positionY="2698" sizeX="3052" sizeY="1936" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7150" positionY="4374"/>
+ <point positionX="7000" positionY="4634"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7150" positionY="4374"/>
+ <point positionX="7000" positionY="4634"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="4248" positionY="2698"/>
+ <point positionX="4098" positionY="2958"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="4248" positionY="2698"/>
+ <point positionX="4098" positionY="2958"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="3052" positionY="1676"/>
+ <point positionX="2902" positionY="1936"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="3052" positionY="1676"/>
+ <point positionX="2902" positionY="1936"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="150" positionY="0"/>
+ <point positionX="0" positionY="260"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="150" positionY="0"/>
+ <point positionX="0" positionY="260"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="3052.000000" column2="0.000000" column3="4098.000000"/>
+ <Line2 column1="0.000000" column2="1936.000000" column3="2698.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4173" positionY="2828" sizeX="2902" sizeY="1676" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="4504"/>
+ <point positionX="4173" positionY="2828"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="2902" positionY="1676"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="2902.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="1676.000000" column3="2828.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="3053.000000" column2="0.000000" column3="4098.000000"/>
+ <Line2 column1="0.000000" column2="1937.000000" column3="2698.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4098" positionY="4374" sizeX="3052" sizeY="1936" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="4098" positionY="4374" sizeX="3052" sizeY="1936" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7000" positionY="4374"/>
+ <point positionX="7150" positionY="4634"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7000" positionY="4374"/>
+ <point positionX="7150" positionY="4634"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="4098" positionY="6050"/>
+ <point positionX="4248" positionY="6310"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="4098" positionY="6050"/>
+ <point positionX="4248" positionY="6310"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="2902" positionY="0"/>
+ <point positionX="3052" positionY="260"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="2902" positionY="0"/>
+ <point positionX="3052" positionY="260"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="1676"/>
+ <point positionX="150" positionY="1936"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="1676"/>
+ <point positionX="150" positionY="1936"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="3052.000000" column2="0.000000" column3="4098.000000"/>
+ <Line2 column1="0.000000" column2="1936.000000" column3="4374.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4173" positionY="4504" sizeX="2902" sizeY="1676" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="4504"/>
+ <point positionX="4173" positionY="6180"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="2902" positionY="0"/>
+ <point positionX="0" positionY="1676"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="2902.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="1676.000000" column3="4504.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="3053.000000" column2="0.000000" column3="4098.000000"/>
+ <Line2 column1="0.000000" column2="1937.000000" column3="4374.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6925" positionY="4504" sizeX="300" sizeY="3352" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="6925" positionY="4504" sizeX="300" sizeY="3352" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="6925" positionY="4504"/>
+ <point positionX="7225" positionY="4504"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="6925" positionY="4504"/>
+ <point positionX="7225" positionY="4504"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="6925" positionY="7856"/>
+ <point positionX="7225" positionY="7856"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="6925" positionY="7856"/>
+ <point positionX="7225" positionY="7856"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="300" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="300" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="3352"/>
+ <point positionX="300" positionY="3352"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="3352"/>
+ <point positionX="300" positionY="3352"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="300.000000" column2="0.000000" column3="6925.000000"/>
+ <Line2 column1="0.000000" column2="3352.000000" column3="4504.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7075" positionY="4504" sizeX="0" sizeY="3352" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="4504"/>
+ <point positionX="7075" positionY="7856"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="3352"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="0.000000" column2="0.000000" column3="7075.000000"/>
+ <Line2 column1="0.000000" column2="3352.000000" column3="4504.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="301.000000" column2="0.000000" column3="6925.000000"/>
+ <Line2 column1="0.000000" column2="3353.000000" column3="4504.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7000" positionY="4374" sizeX="3052" sizeY="1936" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="7000" positionY="4374" sizeX="3052" sizeY="1936" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7000" positionY="4634"/>
+ <point positionX="7150" positionY="4374"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7000" positionY="4634"/>
+ <point positionX="7150" positionY="4374"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="9902" positionY="6310"/>
+ <point positionX="10052" positionY="6050"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="9902" positionY="6310"/>
+ <point positionX="10052" positionY="6050"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="260"/>
+ <point positionX="150" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="260"/>
+ <point positionX="150" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="2902" positionY="1936"/>
+ <point positionX="3052" positionY="1676"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="2902" positionY="1936"/>
+ <point positionX="3052" positionY="1676"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="3052.000000" column2="0.000000" column3="7000.000000"/>
+ <Line2 column1="0.000000" column2="1936.000000" column3="4374.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7075" positionY="4504" sizeX="2902" sizeY="1676" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="4504"/>
+ <point positionX="9977" positionY="6180"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="2902" positionY="1676"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="2902.000000" column2="0.000000" column3="7075.000000"/>
+ <Line2 column1="0.000000" column2="1676.000000" column3="4504.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="3053.000000" column2="0.000000" column3="7000.000000"/>
+ <Line2 column1="0.000000" column2="1937.000000" column3="4374.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7000" positionY="2698" sizeX="3052" sizeY="1936" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="7000" positionY="2698" sizeX="3052" sizeY="1936" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7150" positionY="4634"/>
+ <point positionX="7000" positionY="4374"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7150" positionY="4634"/>
+ <point positionX="7000" positionY="4374"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="10052" positionY="2958"/>
+ <point positionX="9902" positionY="2698"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="10052" positionY="2958"/>
+ <point positionX="9902" positionY="2698"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="150" positionY="1936"/>
+ <point positionX="0" positionY="1676"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="150" positionY="1936"/>
+ <point positionX="0" positionY="1676"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="3052" positionY="260"/>
+ <point positionX="2902" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="3052" positionY="260"/>
+ <point positionX="2902" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="3052.000000" column2="0.000000" column3="7000.000000"/>
+ <Line2 column1="0.000000" column2="1936.000000" column3="2698.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7075" positionY="2828" sizeX="2902" sizeY="1676" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="4504"/>
+ <point positionX="9977" positionY="2828"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="1676"/>
+ <point positionX="2902" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="2902.000000" column2="0.000000" column3="7075.000000"/>
+ <Line2 column1="0.000000" column2="1676.000000" column3="2828.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="3053.000000" column2="0.000000" column3="7000.000000"/>
+ <Line2 column1="0.000000" column2="1937.000000" column3="2698.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6925" positionY="1153" sizeX="300" sizeY="3351" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="6925" positionY="1153" sizeX="300" sizeY="3351" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7225" positionY="4504"/>
+ <point positionX="6925" positionY="4504"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7225" positionY="4504"/>
+ <point positionX="6925" positionY="4504"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7225" positionY="1153"/>
+ <point positionX="6925" positionY="1153"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="7225" positionY="1153"/>
+ <point positionX="6925" positionY="1153"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="300" positionY="3351"/>
+ <point positionX="0" positionY="3351"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="300" positionY="3351"/>
+ <point positionX="0" positionY="3351"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="300" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="300" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="300.000000" column2="0.000000" column3="6925.000000"/>
+ <Line2 column1="0.000000" column2="3351.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7075" positionY="1153" sizeX="0" sizeY="3351" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="4504"/>
+ <point positionX="7075" positionY="1153"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="3351"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="0.000000" column2="0.000000" column3="7075.000000"/>
+ <Line2 column1="0.000000" column2="3351.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="301.000000" column2="0.000000" column3="6925.000000"/>
+ <Line2 column1="0.000000" column2="3352.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="5955.000000" column2="0.000000" column3="4098.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="5334" positionY="3163" sizeX="3482" sizeY="4022" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+ <XShapes>
+ <XShape positionX="5334" positionY="3163" sizeX="3482" sizeY="4022" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="5334" positionY="3163" sizeX="3482" sizeY="4022" type="com.sun.star.drawing.PolyLineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="40" textRightDistance="40" textUpperDistance="40" textLowerDistance="40" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="3163"/>
+ <point positionX="5334" positionY="3499"/>
+ <point positionX="6495" positionY="4839"/>
+ <point positionX="7075" positionY="7185"/>
+ <point positionX="8816" positionY="5509"/>
+ <point positionX="7655" positionY="4169"/>
+ <point positionX="7075" positionY="3163"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="1741" positionY="0"/>
+ <point positionX="0" positionY="336"/>
+ <point positionX="1161" positionY="1676"/>
+ <point positionX="1741" positionY="4022"/>
+ <point positionX="3482" positionY="2346"/>
+ <point positionX="2321" positionY="1006"/>
+ <point positionX="1741" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="3482.000000" column2="0.000000" column3="5334.000000"/>
+ <Line2 column1="0.000000" column2="4022.000000" column3="3163.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="3483.000000" column2="0.000000" column3="5334.000000"/>
+ <Line2 column1="0.000000" column2="4023.000000" column3="3163.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="3483.000000" column2="0.000000" column3="5334.000000"/>
+ <Line2 column1="0.000000" column2="4023.000000" column3="3163.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1">
+ <XShapes>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="4173" positionY="1153" sizeX="5804" sizeY="6703" type="com.sun.star.drawing.PolyLineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="40" textRightDistance="40" textUpperDistance="40" textLowerDistance="40" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7075" positionY="1153"/>
+ <point positionX="4173" positionY="2828"/>
+ <point positionX="4173" positionY="6180"/>
+ <point positionX="7075" positionY="7856"/>
+ <point positionX="9977" positionY="6180"/>
+ <point positionX="9977" positionY="2828"/>
+ <point positionX="7075" positionY="1153"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="2902" positionY="0"/>
+ <point positionX="0" positionY="1675"/>
+ <point positionX="0" positionY="5027"/>
+ <point positionX="2902" positionY="6703"/>
+ <point positionX="5804" positionY="5027"/>
+ <point positionX="5804" positionY="1675"/>
+ <point positionX="2902" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="5804.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6703.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="5805.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="5805.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="5805.000000" column2="0.000000" column3="4173.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="5955.000000" column2="0.000000" column3="4098.000000"/>
+ <Line2 column1="0.000000" column2="6704.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="6704.000000" column2="0.000000" column3="3724.000000"/>
+ <Line2 column1="0.000000" column2="6705.000000" column3="1153.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="2985" positionY="180" sizeX="8181" sizeY="8650" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="2985" positionY="180" sizeX="8181" sizeY="8650" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShapes>
+ <XShape positionX="6731" positionY="180" sizeX="690" sizeY="398" type="com.sun.star.drawing.TextShape" text="Bla1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="691.000000" column2="0.000000" column3="6731.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="2985" positionY="2143" sizeX="690" sizeY="398" type="com.sun.star.drawing.TextShape" text="Bla2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="691.000000" column2="0.000000" column3="2985.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="2143.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="2985" positionY="6468" sizeX="690" sizeY="398" type="com.sun.star.drawing.TextShape" text="Bla3" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="691.000000" column2="0.000000" column3="2985.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="6468.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6731" positionY="8432" sizeX="690" sizeY="398" type="com.sun.star.drawing.TextShape" text="Bla4" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="691.000000" column2="0.000000" column3="6731.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8432.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="10476" positionY="6468" sizeX="690" sizeY="398" type="com.sun.star.drawing.TextShape" text="Bla5" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="691.000000" column2="0.000000" column3="10476.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="6468.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="10476" positionY="2143" sizeX="690" sizeY="398" type="com.sun.star.drawing.TextShape" text="Bla6" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="691.000000" column2="0.000000" column3="10476.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="2143.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="8182.000000" column2="0.000000" column3="2985.000000"/>
+ <Line2 column1="0.000000" column2="8651.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7325" positionY="955" sizeX="193" sizeY="3749" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="7325" positionY="4306" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="0" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="7325.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4306.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7325" positionY="955" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="5" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="7325.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="955.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="7325.000000"/>
+ <Line2 column1="0.000000" column2="3750.000000" column3="955.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="8182.000000" column2="0.000000" column3="2985.000000"/>
+ <Line2 column1="0.000000" column2="8651.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="8182.000000" column2="0.000000" column3="2985.000000"/>
+ <Line2 column1="0.000000" column2="8651.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13512.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8651.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14151" positionY="3957" sizeX="1650" sizeY="1096" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
+ <XShapes>
+ <XShape positionX="14151" positionY="3957" sizeX="1650" sizeY="1096" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="1651.000000" column2="0.000000" column3="14151.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3957.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14267" positionY="4150" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="14267" positionY="4150" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="14267" positionY="4150" sizeX="800" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="801.000000" column2="0.000000" column3="14267.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4150.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14267" positionY="4255" sizeX="800" sizeY="0" type="com.sun.star.drawing.LineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="40" textRightDistance="40" textUpperDistance="40" textLowerDistance="40" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="14267" positionY="4255"/>
+ <point positionX="15067" positionY="4255"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="800" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="800.000000" column2="0.000000" column3="14267.000000"/>
+ <Line2 column1="0.000000" column2="0.000000" column3="4255.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="801.000000" column2="0.000000" column3="14267.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4150.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="801.000000" column2="0.000000" column3="14267.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4150.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14267" positionY="4648" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="14267" positionY="4648" sizeX="800" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="14267" positionY="4648" sizeX="800" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="801.000000" column2="0.000000" column3="14267.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4648.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14267" positionY="4753" sizeX="800" sizeY="0" type="com.sun.star.drawing.LineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="40" textRightDistance="40" textUpperDistance="40" textLowerDistance="40" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="14267" positionY="4753"/>
+ <point positionX="15067" positionY="4753"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="800" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="800.000000" column2="0.000000" column3="14267.000000"/>
+ <Line2 column1="0.000000" column2="0.000000" column3="4753.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="801.000000" column2="0.000000" column3="14267.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4648.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="801.000000" column2="0.000000" column3="14267.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4648.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="15167" positionY="4057" sizeX="346" sizeY="398" type="com.sun.star.drawing.TextShape" text="ist" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4803" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="347.000000" column2="0.000000" column3="15167.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4057.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="15167" positionY="4555" sizeX="518" sizeY="398" type="com.sun.star.drawing.TextShape" text="soll" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4803" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="519.000000" column2="0.000000" column3="15167.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4555.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="1651.000000" column2="0.000000" column3="14151.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3957.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+</XShapes>
+
+
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
index eb48c3f7293d..46d075a06020 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="0" positionY="0" sizeX="26494" sizeY="18368" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="0" positionY="0" sizeX="29642" sizeY="18368" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -9,14 +9,14 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="26495.000000" column2="0.000000" column3="0.000000"/>
+ <Line1 column1="29643.000000" column2="0.000000" column3="0.000000"/>
<Line2 column1="0.000000" column2="18369.000000" column3="0.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShape positionX="8407" positionY="3819" sizeX="11075" sizeY="9723" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9761" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -25,12 +25,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="8407" positionY="3819" sizeX="11075" sizeY="9723" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -39,18 +39,18 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="11076.000000" column2="0.000000" column3="8407.000000"/>
<Line2 column1="0.000000" column2="9724.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="8407" positionY="3819" sizeX="11075" sizeY="9723" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="9761" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+ <XShape positionX="9761" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="d9d9d9" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9761" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="d9d9d9" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -59,25 +59,25 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+ <XShape positionX="9761" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="9761" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+ <XShape positionX="9761" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
<XShapes>
- <XShape positionX="13067" positionY="5243" sizeX="4861" sizeY="8132" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,17762,9938,22457,11196/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4f81bd" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="14621" positionY="5243" sizeX="4861" sizeY="8132" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,19316,9938,24011,11196/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4f81bd" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -86,12 +86,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4861.000000" column2="0.000000" column3="13067.000000"/>
+ <Line1 column1="4861.000000" column2="0.000000" column3="14621.000000"/>
<Line2 column1="0.000000" column2="8132.000000" column3="5243.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8225" positionY="8680" sizeX="6100" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,10279,12661,7491,16643/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="c0504d" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9779" positionY="8680" sizeX="6100" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,11833,12661,9045,16643/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="c0504d" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -100,12 +100,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6100.000000" column2="0.000000" column3="8225.000000"/>
+ <Line1 column1="6100.000000" column2="0.000000" column3="9779.000000"/>
<Line2 column1="0.000000" column2="4861.000000" column3="8680.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="7422" sizeX="4860" sizeY="1682" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,8225,8256,3383,7833/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9761" positionY="7422" sizeX="4860" sizeY="1682" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,9779,8256,4937,7833/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -114,12 +114,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4860.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="4860.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="1682.000000" column3="7422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8372" positionY="3838" sizeX="4695" sizeY="4842" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,9943,4957,6818,1233/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="8064a2" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9926" positionY="3838" sizeX="4695" sizeY="4842" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,11497,4957,8372,1233/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="8064a2" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -128,12 +128,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4695.000000" column2="0.000000" column3="8372.000000"/>
+ <Line1 column1="4695.000000" column2="0.000000" column3="9926.000000"/>
<Line2 column1="0.000000" column2="4842.000000" column3="3838.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12643" positionY="3819" sizeX="3861" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,14729,4113,16392,-454/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4bacc6" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="14197" positionY="3819" sizeX="3861" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,16283,4113,17946,-454/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4bacc6" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -142,48 +142,48 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="3861.000000" column2="0.000000" column3="12643.000000"/>
+ <Line1 column1="3861.000000" column2="0.000000" column3="14197.000000"/>
<Line2 column1="0.000000" column2="4861.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9724.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8394" positionY="4386" sizeX="9180" sizeY="8065" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="8407" positionY="4376" sizeX="10666" sizeY="8129" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8394" positionY="4386" sizeX="9180" sizeY="8065" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="8407" positionY="4376" sizeX="10666" sizeY="8129" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8394" positionY="4386" sizeX="9180" sizeY="8065" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
+ <XShape positionX="8407" positionY="4376" sizeX="10666" sizeY="8129" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
<XShapes>
- <XShape positionX="16434" positionY="9300" sizeX="1140" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
+ <XShape positionX="17785" positionY="9140" sizeX="1288" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
<XShapes>
- <XShape positionX="16434" positionY="9300" sizeX="1140" sizeY="849" type="com.sun.star.drawing.TextShape" text="Yellow&#10;33%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="17785" positionY="9140" sizeX="1288" sizeY="1165" type="com.sun.star.drawing.TextShape" text="Yellow&#10;33%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -192,21 +192,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1141.000000" column2="0.000000" column3="16434.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="9300.000000"/>
+ <Line1 column1="1289.000000" column2="0.000000" column3="17785.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="9140.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1141.000000" column2="0.000000" column3="16434.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="9300.000000"/>
+ <Line1 column1="1289.000000" column2="0.000000" column3="17785.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="9140.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="10197" positionY="11602" sizeX="928" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1">
+ <XShape positionX="11823" positionY="11340" sizeX="1053" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1">
<XShapes>
- <XShape positionX="10197" positionY="11602" sizeX="928" sizeY="849" type="com.sun.star.drawing.TextShape" text="Black&#10;28%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="11823" positionY="11340" sizeX="1053" sizeY="1165" type="com.sun.star.drawing.TextShape" text="Black&#10;28%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -215,21 +215,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="10197.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="11602.000000"/>
+ <Line1 column1="1054.000000" column2="0.000000" column3="11823.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="11340.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="929.000000" column2="0.000000" column3="10197.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="11602.000000"/>
+ <Line1 column1="1054.000000" column2="0.000000" column3="11823.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="11340.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8394" positionY="7893" sizeX="1060" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2">
+ <XShape positionX="8407" positionY="7661" sizeX="1224" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2">
<XShapes>
- <XShape positionX="8394" positionY="7893" sizeX="1060" sizeY="849" type="com.sun.star.drawing.TextShape" text="Green&#10;6%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="8407" positionY="7661" sizeX="1224" sizeY="1165" type="com.sun.star.drawing.TextShape" text="Green&#10;6%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5929" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -238,21 +238,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1061.000000" column2="0.000000" column3="8394.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="7893.000000"/>
+ <Line1 column1="1225.000000" column2="0.000000" column3="8407.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="7661.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1061.000000" column2="0.000000" column3="8394.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="7893.000000"/>
+ <Line1 column1="1225.000000" column2="0.000000" column3="8407.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="7661.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="10043" positionY="5033" sizeX="716" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=3">
+ <XShape positionX="11686" positionY="4961" sizeX="838" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=3">
<XShapes>
- <XShape positionX="10043" positionY="5033" sizeX="716" sizeY="849" type="com.sun.star.drawing.TextShape" text="Red&#10;19%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="11686" positionY="4961" sizeX="838" sizeY="1165" type="com.sun.star.drawing.TextShape" text="Red&#10;19%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -261,21 +261,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="717.000000" column2="0.000000" column3="10043.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="5033.000000"/>
+ <Line1 column1="839.000000" column2="0.000000" column3="11686.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="4961.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="717.000000" column2="0.000000" column3="10043.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="5033.000000"/>
+ <Line1 column1="839.000000" column2="0.000000" column3="11686.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="4961.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14035" positionY="4386" sizeX="1034" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=4">
+ <XShape positionX="15443" positionY="4376" sizeX="1158" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=4">
<XShapes>
- <XShape positionX="14035" positionY="4386" sizeX="1034" sizeY="849" type="com.sun.star.drawing.TextShape" text="White&#10;14%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="15443" positionY="4376" sizeX="1158" sizeY="1165" type="com.sun.star.drawing.TextShape" text="White&#10;14%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="3889" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -284,49 +284,49 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="14035.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="4386.000000"/>
+ <Line1 column1="1159.000000" column2="0.000000" column3="15443.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="4376.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="1035.000000" column2="0.000000" column3="14035.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="4386.000000"/>
+ <Line1 column1="1159.000000" column2="0.000000" column3="15443.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="4376.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9181.000000" column2="0.000000" column3="8394.000000"/>
- <Line2 column1="0.000000" column2="8066.000000" column3="4386.000000"/>
+ <Line1 column1="10667.000000" column2="0.000000" column3="8407.000000"/>
+ <Line2 column1="0.000000" column2="8130.000000" column3="4376.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9181.000000" column2="0.000000" column3="8394.000000"/>
- <Line2 column1="0.000000" column2="8066.000000" column3="4386.000000"/>
+ <Line1 column1="10667.000000" column2="0.000000" column3="8407.000000"/>
+ <Line2 column1="0.000000" column2="8130.000000" column3="4376.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9181.000000" column2="0.000000" column3="8394.000000"/>
- <Line2 column1="0.000000" column2="8066.000000" column3="4386.000000"/>
+ <Line1 column1="10667.000000" column2="0.000000" column3="8407.000000"/>
+ <Line2 column1="0.000000" column2="8130.000000" column3="4376.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="11076.000000" column2="0.000000" column3="8407.000000"/>
<Line2 column1="0.000000" column2="9724.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="11076.000000" column2="0.000000" column3="8407.000000"/>
<Line2 column1="0.000000" column2="9724.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
index 639c32d00491..91fcee4428c6 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="0" positionY="0" sizeX="26494" sizeY="18368" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="0" positionY="0" sizeX="29643" sizeY="18368" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -9,14 +9,14 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="26495.000000" column2="0.000000" column3="0.000000"/>
+ <Line1 column1="29644.000000" column2="0.000000" column3="0.000000"/>
<Line2 column1="0.000000" column2="18369.000000" column3="0.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShape positionX="4506" positionY="2226" sizeX="22007" sizeY="12305" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9762" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -25,12 +25,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9762.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="4506" positionY="2226" sizeX="22007" sizeY="12305" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -39,18 +39,18 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22008.000000" column2="0.000000" column3="4506.000000"/>
+ <Line2 column1="0.000000" column2="12306.000000" column3="2226.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="4506" positionY="2226" sizeX="22007" sizeY="12305" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="9762" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+ <XShape positionX="9762" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="d9d9d9" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9762" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="d9d9d9" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -59,25 +59,25 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9762.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9762.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+ <XShape positionX="9762" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="9762" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+ <XShape positionX="9762" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
<XShapes>
- <XShape positionX="13067" positionY="5243" sizeX="4861" sizeY="8132" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,17762,9938,22457,11196/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4f81bd" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="14622" positionY="5243" sizeX="4861" sizeY="8132" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,19317,9938,24012,11196/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4f81bd" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -86,12 +86,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4861.000000" column2="0.000000" column3="13067.000000"/>
+ <Line1 column1="4861.000000" column2="0.000000" column3="14622.000000"/>
<Line2 column1="0.000000" column2="8132.000000" column3="5243.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8225" positionY="8680" sizeX="6100" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,10279,12661,7491,16643/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="c0504d" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9780" positionY="8680" sizeX="6100" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,11834,12661,9046,16643/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="c0504d" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -100,12 +100,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6100.000000" column2="0.000000" column3="8225.000000"/>
+ <Line1 column1="6100.000000" column2="0.000000" column3="9780.000000"/>
<Line2 column1="0.000000" column2="4861.000000" column3="8680.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="7422" sizeX="4860" sizeY="1682" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,8225,8256,3383,7833/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9762" positionY="7422" sizeX="4860" sizeY="1682" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,9780,8256,4938,7833/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -114,12 +114,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4860.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="4860.000000" column2="0.000000" column3="9762.000000"/>
<Line2 column1="0.000000" column2="1682.000000" column3="7422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8372" positionY="3838" sizeX="4695" sizeY="4842" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,9943,4957,6818,1233/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="8064a2" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9927" positionY="3838" sizeX="4695" sizeY="4842" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,11498,4957,8373,1233/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="8064a2" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -128,12 +128,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4695.000000" column2="0.000000" column3="8372.000000"/>
+ <Line1 column1="4695.000000" column2="0.000000" column3="9927.000000"/>
<Line2 column1="0.000000" column2="4842.000000" column3="3838.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12643" positionY="3819" sizeX="3861" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,14729,4113,16392,-454/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4bacc6" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="14198" positionY="3819" sizeX="3861" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,16284,4113,17947,-454/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4bacc6" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -142,48 +142,48 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="3861.000000" column2="0.000000" column3="12643.000000"/>
+ <Line1 column1="3861.000000" column2="0.000000" column3="14198.000000"/>
<Line2 column1="0.000000" column2="4861.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9762.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9762.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9762.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9762.000000"/>
<Line2 column1="0.000000" column2="9724.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="4506" positionY="2226" sizeX="22007" sizeY="12305" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="4506" positionY="2226" sizeX="22007" sizeY="12305" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
+ <XShape positionX="4506" positionY="2226" sizeX="22007" sizeY="12305" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
<XShapes>
- <XShape positionX="17907" positionY="9977" sizeX="6114" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
+ <XShape positionX="19462" positionY="9977" sizeX="7051" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
<XShapes>
- <XShape positionX="17907" positionY="9977" sizeX="6114" sizeY="849" type="com.sun.star.drawing.TextShape" text="Yellow - The color of sun and honey&#10;33%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="19462" positionY="9977" sizeX="7051" sizeY="1165" type="com.sun.star.drawing.TextShape" text="Yellow - The color of sun and honey&#10;33%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -192,21 +192,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6115.000000" column2="0.000000" column3="17907.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="9977.000000"/>
+ <Line1 column1="7052.000000" column2="0.000000" column3="19462.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="9977.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6115.000000" column2="0.000000" column3="17907.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="9977.000000"/>
+ <Line1 column1="7052.000000" column2="0.000000" column3="19462.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="9977.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="3974" positionY="12784" sizeX="6220" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1">
+ <XShape positionX="5958" positionY="12784" sizeX="5791" sizeY="1747" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1">
<XShapes>
- <XShape positionX="3974" positionY="12784" sizeX="6220" sizeY="849" type="com.sun.star.drawing.TextShape" text="Black - The color of night and coffee&#10;28%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="7129" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="5958" positionY="12784" sizeX="5791" sizeY="1747" type="com.sun.star.drawing.TextShape" text="Black - The color of night and coffee&#10;28%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5929" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -215,21 +215,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6221.000000" column2="0.000000" column3="3974.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="12784.000000"/>
+ <Line1 column1="5792.000000" column2="0.000000" column3="5958.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="12784.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6221.000000" column2="0.000000" column3="3974.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="12784.000000"/>
+ <Line1 column1="5792.000000" column2="0.000000" column3="5958.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="12784.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="7819" sizeX="6167" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2">
+ <XShape positionX="4506" positionY="7370" sizeX="5126" sizeY="1747" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2">
<XShapes>
- <XShape positionX="1910" positionY="7819" sizeX="6167" sizeY="849" type="com.sun.star.drawing.TextShape" text="Green - The color of grass and hope&#10;6%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="7129" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="4506" positionY="7370" sizeX="5126" sizeY="1747" type="com.sun.star.drawing.TextShape" text="Green - The color of grass and hope&#10;6%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5929" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -238,21 +238,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6168.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="7819.000000"/>
+ <Line1 column1="5127.000000" column2="0.000000" column3="4506.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="7370.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6168.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="7819.000000"/>
+ <Line1 column1="5127.000000" column2="0.000000" column3="4506.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="7370.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="3813" positionY="3994" sizeX="6035" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=3">
+ <XShape positionX="6073" positionY="3096" sizeX="5330" sizeY="1747" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=3">
<XShapes>
- <XShape positionX="3813" positionY="3994" sizeX="6035" sizeY="849" type="com.sun.star.drawing.TextShape" text="Red - The color of rose and passion&#10;19%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="7129" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="6073" positionY="3096" sizeX="5330" sizeY="1747" type="com.sun.star.drawing.TextShape" text="Red - The color of rose and passion&#10;19%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5929" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -261,21 +261,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6036.000000" column2="0.000000" column3="3813.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="3994.000000"/>
+ <Line1 column1="5331.000000" column2="0.000000" column3="6073.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="3096.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6036.000000" column2="0.000000" column3="3813.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="3994.000000"/>
+ <Line1 column1="5331.000000" column2="0.000000" column3="6073.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="3096.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14780" positionY="3124" sizeX="6140" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=4">
+ <XShape positionX="16335" positionY="2226" sizeX="5691" sizeY="1747" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=4">
<XShapes>
- <XShape positionX="14780" positionY="3124" sizeX="6140" sizeY="849" type="com.sun.star.drawing.TextShape" text="White - The color of milk and purity&#10;14%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="8832" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="16335" positionY="2226" sizeX="5691" sizeY="1747" type="com.sun.star.drawing.TextShape" text="White - The color of milk and purity&#10;14%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5929" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -284,51 +284,51 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6141.000000" column2="0.000000" column3="14780.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="3124.000000"/>
+ <Line1 column1="5692.000000" column2="0.000000" column3="16335.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="2226.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6141.000000" column2="0.000000" column3="14780.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="3124.000000"/>
+ <Line1 column1="5692.000000" column2="0.000000" column3="16335.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="2226.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22008.000000" column2="0.000000" column3="4506.000000"/>
+ <Line2 column1="0.000000" column2="12306.000000" column3="2226.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22008.000000" column2="0.000000" column3="4506.000000"/>
+ <Line2 column1="0.000000" column2="12306.000000" column3="2226.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22008.000000" column2="0.000000" column3="4506.000000"/>
+ <Line2 column1="0.000000" column2="12306.000000" column3="2226.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22008.000000" column2="0.000000" column3="4506.000000"/>
+ <Line2 column1="0.000000" column2="12306.000000" column3="2226.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22008.000000" column2="0.000000" column3="4506.000000"/>
+ <Line2 column1="0.000000" column2="12306.000000" column3="2226.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
-</XShapes> \ No newline at end of file
+</XShapes>
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
index 77be20e2147f..631bd3e18e8b 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="0" positionY="0" sizeX="26494" sizeY="18368" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="0" positionY="0" sizeX="29642" sizeY="18368" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -9,14 +9,14 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="26495.000000" column2="0.000000" column3="0.000000"/>
+ <Line1 column1="29643.000000" column2="0.000000" column3="0.000000"/>
<Line2 column1="0.000000" column2="18369.000000" column3="0.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShape positionX="2509" positionY="2808" sizeX="22658" sizeY="11141" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9761" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -25,12 +25,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="2509" positionY="2808" sizeX="22658" sizeY="11141" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -39,18 +39,18 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22659.000000" column2="0.000000" column3="2509.000000"/>
+ <Line2 column1="0.000000" column2="11142.000000" column3="2808.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="2509" positionY="2808" sizeX="22658" sizeY="11141" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="9761" positionY="3819" sizeX="9721" sizeY="9723" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+ <XShape positionX="9761" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
<XShapes>
- <XShape positionX="8207" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="d9d9d9" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9761" positionY="3821" sizeX="9721" sizeY="9721" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="d9d9d9" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -59,25 +59,25 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9722.000000" column3="3821.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+ <XShape positionX="9761" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="9761" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="8207" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+ <XShape positionX="9761" positionY="3819" sizeX="9721" sizeY="9722" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
<XShapes>
- <XShape positionX="13067" positionY="5243" sizeX="4861" sizeY="8132" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,17762,9938,22457,11196/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4f81bd" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="14621" positionY="5243" sizeX="4861" sizeY="8132" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,19316,9938,24011,11196/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4f81bd" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -86,12 +86,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4861.000000" column2="0.000000" column3="13067.000000"/>
+ <Line1 column1="4861.000000" column2="0.000000" column3="14621.000000"/>
<Line2 column1="0.000000" column2="8132.000000" column3="5243.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8225" positionY="8680" sizeX="6100" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,10279,12661,7491,16643/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="c0504d" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9779" positionY="8680" sizeX="6100" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,11833,12661,9045,16643/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="c0504d" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -100,12 +100,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6100.000000" column2="0.000000" column3="8225.000000"/>
+ <Line1 column1="6100.000000" column2="0.000000" column3="9779.000000"/>
<Line2 column1="0.000000" column2="4861.000000" column3="8680.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8207" positionY="7422" sizeX="4860" sizeY="1682" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,8225,8256,3383,7833/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9761" positionY="7422" sizeX="4860" sizeY="1682" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,9779,8256,4937,7833/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -114,12 +114,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4860.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="4860.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="1682.000000" column3="7422.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="8372" positionY="3838" sizeX="4695" sizeY="4842" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,9943,4957,6818,1233/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="8064a2" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="9926" positionY="3838" sizeX="4695" sizeY="4842" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,11497,4957,8372,1233/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="8064a2" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -128,12 +128,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="4695.000000" column2="0.000000" column3="8372.000000"/>
+ <Line1 column1="4695.000000" column2="0.000000" column3="9926.000000"/>
<Line2 column1="0.000000" column2="4842.000000" column3="3838.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="12643" positionY="3819" sizeX="3861" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,14729,4113,16392,-454/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4bacc6" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="14197" positionY="3819" sizeX="3861" sizeY="4861" type="com.sun.star.drawing.ClosedBezierShape" name="CID/MultiClick:DragMethod=PieSegmentDragging:DragParameter=0,16283,4113,17946,-454/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="26" textRightDistance="26" textUpperDistance="26" textLowerDistance="26" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="4bacc6" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -142,48 +142,48 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="3861.000000" column2="0.000000" column3="12643.000000"/>
+ <Line1 column1="3861.000000" column2="0.000000" column3="14197.000000"/>
<Line2 column1="0.000000" column2="4861.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9723.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="9722.000000" column2="0.000000" column3="8207.000000"/>
+ <Line1 column1="9722.000000" column2="0.000000" column3="9761.000000"/>
<Line2 column1="0.000000" column2="9724.000000" column3="3819.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="2509" positionY="2808" sizeX="22658" sizeY="11141" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="2509" positionY="2808" sizeX="22658" sizeY="11141" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1910" positionY="3124" sizeX="22111" sizeY="10509" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
+ <XShape positionX="2509" positionY="2808" sizeX="22658" sizeY="11141" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
<XShapes>
- <XShape positionX="17907" positionY="9977" sizeX="6114" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
+ <XShape positionX="19461" positionY="9977" sizeX="5706" sizeY="1747" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
<XShapes>
- <XShape positionX="17907" positionY="9977" sizeX="6114" sizeY="849" type="com.sun.star.drawing.TextShape" text="Yellow - The color of sun and honey&#10;33%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="7129" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="19461" positionY="9977" sizeX="5706" sizeY="1747" type="com.sun.star.drawing.TextShape" text="Yellow - The color of sun and honey&#10;33%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5929" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -192,21 +192,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6115.000000" column2="0.000000" column3="17907.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="9977.000000"/>
+ <Line1 column1="5707.000000" column2="0.000000" column3="19461.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="9977.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6115.000000" column2="0.000000" column3="17907.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="9977.000000"/>
+ <Line1 column1="5707.000000" column2="0.000000" column3="19461.000000"/>
+ <Line2 column1="0.000000" column2="1748.000000" column3="9977.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="3974" positionY="12784" sizeX="6220" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1">
+ <XShape positionX="4618" positionY="12784" sizeX="7130" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1">
<XShapes>
- <XShape positionX="3974" positionY="12784" sizeX="6220" sizeY="849" type="com.sun.star.drawing.TextShape" text="Black - The color of night and coffee&#10;28%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="4618" positionY="12784" sizeX="7130" sizeY="1165" type="com.sun.star.drawing.TextShape" text="Black - The color of night and coffee&#10;28%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -215,21 +215,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6221.000000" column2="0.000000" column3="3974.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="12784.000000"/>
+ <Line1 column1="7131.000000" column2="0.000000" column3="4618.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="12784.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6221.000000" column2="0.000000" column3="3974.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="12784.000000"/>
+ <Line1 column1="7131.000000" column2="0.000000" column3="4618.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="12784.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1910" positionY="7819" sizeX="6167" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2">
+ <XShape positionX="2509" positionY="7661" sizeX="7122" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2">
<XShapes>
- <XShape positionX="1910" positionY="7819" sizeX="6167" sizeY="849" type="com.sun.star.drawing.TextShape" text="Green - The color of grass and hope&#10;6%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="2509" positionY="7661" sizeX="7122" sizeY="1165" type="com.sun.star.drawing.TextShape" text="Green - The color of grass and hope&#10;6%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -238,21 +238,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6168.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="7819.000000"/>
+ <Line1 column1="7123.000000" column2="0.000000" column3="2509.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="7661.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6168.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="7819.000000"/>
+ <Line1 column1="7123.000000" column2="0.000000" column3="2509.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="7661.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="3813" positionY="3994" sizeX="6035" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=3">
+ <XShape positionX="4432" positionY="3678" sizeX="6970" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=3">
<XShapes>
- <XShape positionX="3813" positionY="3994" sizeX="6035" sizeY="849" type="com.sun.star.drawing.TextShape" text="Red - The color of rose and passion&#10;19%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="4432" positionY="3678" sizeX="6970" sizeY="1165" type="com.sun.star.drawing.TextShape" text="Red - The color of rose and passion&#10;19%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -261,21 +261,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6036.000000" column2="0.000000" column3="3813.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="3994.000000"/>
+ <Line1 column1="6971.000000" column2="0.000000" column3="4432.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="3678.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6036.000000" column2="0.000000" column3="3813.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="3994.000000"/>
+ <Line1 column1="6971.000000" column2="0.000000" column3="4432.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="3678.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14780" positionY="3124" sizeX="6140" sizeY="849" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=4">
+ <XShape positionX="16334" positionY="2808" sizeX="6976" sizeY="1165" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=4">
<XShapes>
- <XShape positionX="14780" positionY="3124" sizeX="6140" sizeY="849" type="com.sun.star.drawing.TextShape" text="White - The color of milk and purity&#10;14%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="16334" positionY="2808" sizeX="6976" sizeY="1165" type="com.sun.star.drawing.TextShape" text="White - The color of milk and purity&#10;14%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -284,51 +284,51 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6141.000000" column2="0.000000" column3="14780.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="3124.000000"/>
+ <Line1 column1="6977.000000" column2="0.000000" column3="16334.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="2808.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6141.000000" column2="0.000000" column3="14780.000000"/>
- <Line2 column1="0.000000" column2="850.000000" column3="3124.000000"/>
+ <Line1 column1="6977.000000" column2="0.000000" column3="16334.000000"/>
+ <Line2 column1="0.000000" column2="1166.000000" column3="2808.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22659.000000" column2="0.000000" column3="2509.000000"/>
+ <Line2 column1="0.000000" column2="11142.000000" column3="2808.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22659.000000" column2="0.000000" column3="2509.000000"/>
+ <Line2 column1="0.000000" column2="11142.000000" column3="2808.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22659.000000" column2="0.000000" column3="2509.000000"/>
+ <Line2 column1="0.000000" column2="11142.000000" column3="2808.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22659.000000" column2="0.000000" column3="2509.000000"/>
+ <Line2 column1="0.000000" column2="11142.000000" column3="2808.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="22112.000000" column2="0.000000" column3="1910.000000"/>
- <Line2 column1="0.000000" column2="10510.000000" column3="3124.000000"/>
+ <Line1 column1="22659.000000" column2="0.000000" column3="2509.000000"/>
+ <Line2 column1="0.000000" column2="11142.000000" column3="2808.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
-</XShapes> \ No newline at end of file
+</XShapes>
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
index 6b182821f1c9..198cf985e29b 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
@@ -14,7 +14,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1737" positionY="2768" sizeX="21967" sizeY="11230" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShape positionX="2778" positionY="1712" sizeX="19649" sizeY="13342" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
<XShapes>
<XShape positionX="8034" positionY="3894" sizeX="9575" sizeY="9575" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
@@ -30,7 +30,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1737" positionY="2768" sizeX="21967" sizeY="11230" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="2778" positionY="1712" sizeX="19649" sizeY="13342" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -39,12 +39,12 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="21968.000000" column2="0.000000" column3="1737.000000"/>
- <Line2 column1="0.000000" column2="11231.000000" column3="2768.000000"/>
+ <Line1 column1="19650.000000" column2="0.000000" column3="2778.000000"/>
+ <Line2 column1="0.000000" column2="13343.000000" column3="1712.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1737" positionY="2768" sizeX="21967" sizeY="11230" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="2778" positionY="1712" sizeX="19649" sizeY="13342" type="com.sun.star.drawing.GroupShape">
<XShapes>
<XShape positionX="8034" positionY="3892" sizeX="9575" sizeY="9577" type="com.sun.star.drawing.GroupShape">
<XShapes>
@@ -175,15 +175,15 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1737" positionY="2768" sizeX="21967" sizeY="11230" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="2778" positionY="1712" sizeX="19649" sizeY="13342" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1737" positionY="2768" sizeX="21967" sizeY="11230" type="com.sun.star.drawing.GroupShape">
+ <XShape positionX="2778" positionY="1712" sizeX="19649" sizeY="13342" type="com.sun.star.drawing.GroupShape">
<XShapes>
- <XShape positionX="1737" positionY="2768" sizeX="21967" sizeY="11230" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
+ <XShape positionX="2778" positionY="1712" sizeX="19649" sizeY="13342" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0:DataLabels=">
<XShapes>
- <XShape positionX="17590" positionY="9958" sizeX="6114" sizeY="1273" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
+ <XShape positionX="17590" positionY="9958" sizeX="4837" sizeY="2329" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0">
<XShapes>
- <XShape positionX="17590" positionY="9958" sizeX="6114" sizeY="1273" type="com.sun.star.drawing.TextShape" text="Yellow - The color of sun and honey&#10;120&#10;33%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="6977" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="17590" positionY="9958" sizeX="4837" sizeY="2329" type="com.sun.star.drawing.TextShape" text="Yellow - The color of sun and honey&#10;120&#10;33%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5199" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -192,21 +192,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6115.000000" column2="0.000000" column3="17590.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="9958.000000"/>
+ <Line1 column1="4838.000000" column2="0.000000" column3="17590.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="9958.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6115.000000" column2="0.000000" column3="17590.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="9958.000000"/>
+ <Line1 column1="4838.000000" column2="0.000000" column3="17590.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="9958.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="3770" positionY="12725" sizeX="6220" sizeY="1273" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1">
+ <XShape positionX="5068" positionY="12725" sizeX="4922" sizeY="2329" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1">
<XShapes>
- <XShape positionX="3770" positionY="12725" sizeX="6220" sizeY="1273" type="com.sun.star.drawing.TextShape" text="Black - The color of night and coffee&#10;100&#10;28%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="6977" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="5068" positionY="12725" sizeX="4922" sizeY="2329" type="com.sun.star.drawing.TextShape" text="Black - The color of night and coffee&#10;100&#10;28%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5199" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -215,21 +215,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6221.000000" column2="0.000000" column3="3770.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="12725.000000"/>
+ <Line1 column1="4923.000000" column2="0.000000" column3="5068.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="12725.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6221.000000" column2="0.000000" column3="3770.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="12725.000000"/>
+ <Line1 column1="4923.000000" column2="0.000000" column3="5068.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="12725.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="1737" positionY="7614" sizeX="6167" sizeY="1273" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2">
+ <XShape positionX="2778" positionY="7086" sizeX="5126" sizeY="2329" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2">
<XShapes>
- <XShape positionX="1737" positionY="7614" sizeX="6167" sizeY="1273" type="com.sun.star.drawing.TextShape" text="Green - The color of grass and hope&#10;20&#10;6%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="6977" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="2778" positionY="7086" sizeX="5126" sizeY="2329" type="com.sun.star.drawing.TextShape" text="Green - The color of grass and hope&#10;20&#10;6%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5199" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -238,21 +238,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6168.000000" column2="0.000000" column3="1737.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="7614.000000"/>
+ <Line1 column1="5127.000000" column2="0.000000" column3="2778.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="7086.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6168.000000" column2="0.000000" column3="1737.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="7614.000000"/>
+ <Line1 column1="5127.000000" column2="0.000000" column3="2778.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="7086.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="3614" positionY="3626" sizeX="6035" sizeY="1273" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=3">
+ <XShape positionX="5189" positionY="2570" sizeX="4460" sizeY="2329" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=3">
<XShapes>
- <XShape positionX="3614" positionY="3626" sizeX="6035" sizeY="1273" type="com.sun.star.drawing.TextShape" text="Red - The color of rose and passion&#10;70&#10;19%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="6977" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="5189" positionY="2570" sizeX="4460" sizeY="2329" type="com.sun.star.drawing.TextShape" text="Red - The color of rose and passion&#10;70&#10;19%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5199" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -261,21 +261,21 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6036.000000" column2="0.000000" column3="3614.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="3626.000000"/>
+ <Line1 column1="4461.000000" column2="0.000000" column3="5189.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="2570.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6036.000000" column2="0.000000" column3="3614.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="3626.000000"/>
+ <Line1 column1="4461.000000" column2="0.000000" column3="5189.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="2570.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
- <XShape positionX="14509" positionY="2768" sizeX="6140" sizeY="1273" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=4">
+ <XShape positionX="14509" positionY="1712" sizeX="4822" sizeY="2329" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=4">
<XShapes>
- <XShape positionX="14509" positionY="2768" sizeX="6140" sizeY="1273" type="com.sun.star.drawing.TextShape" text="White - The color of milk and purity&#10;50&#10;14%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="8664" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="14509" positionY="1712" sizeX="4822" sizeY="2329" type="com.sun.star.drawing.TextShape" text="White - The color of milk and purity&#10;50&#10;14%" fontHeight="12.000000" fontColor="595959" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="BOTTOM" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="5199" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
@@ -284,53 +284,51 @@
<LineStart/>
<LineEnd/>
<Transformation>
- <Line1 column1="6141.000000" column2="0.000000" column3="14509.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="2768.000000"/>
+ <Line1 column1="4823.000000" column2="0.000000" column3="14509.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="1712.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="6141.000000" column2="0.000000" column3="14509.000000"/>
- <Line2 column1="0.000000" column2="1274.000000" column3="2768.000000"/>
+ <Line1 column1="4823.000000" column2="0.000000" column3="14509.000000"/>
+ <Line2 column1="0.000000" column2="2330.000000" column3="1712.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="21968.000000" column2="0.000000" column3="1737.000000"/>
- <Line2 column1="0.000000" column2="11231.000000" column3="2768.000000"/>
+ <Line1 column1="19650.000000" column2="0.000000" column3="2778.000000"/>
+ <Line2 column1="0.000000" column2="13343.000000" column3="1712.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="21968.000000" column2="0.000000" column3="1737.000000"/>
- <Line2 column1="0.000000" column2="11231.000000" column3="2768.000000"/>
+ <Line1 column1="19650.000000" column2="0.000000" column3="2778.000000"/>
+ <Line2 column1="0.000000" column2="13343.000000" column3="1712.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="21968.000000" column2="0.000000" column3="1737.000000"/>
- <Line2 column1="0.000000" column2="11231.000000" column3="2768.000000"/>
+ <Line1 column1="19650.000000" column2="0.000000" column3="2778.000000"/>
+ <Line2 column1="0.000000" column2="13343.000000" column3="1712.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="21968.000000" column2="0.000000" column3="1737.000000"/>
- <Line2 column1="0.000000" column2="11231.000000" column3="2768.000000"/>
+ <Line1 column1="19650.000000" column2="0.000000" column3="2778.000000"/>
+ <Line2 column1="0.000000" column2="13343.000000" column3="1712.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
<Transformation>
- <Line1 column1="21968.000000" column2="0.000000" column3="1737.000000"/>
- <Line2 column1="0.000000" column2="11231.000000" column3="2768.000000"/>
+ <Line1 column1="19650.000000" column2="0.000000" column3="2778.000000"/>
+ <Line2 column1="0.000000" column2="13343.000000" column3="1712.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
-
-
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 000000000000..f86dfe0b996b
--- /dev/null
+++ b/chart2/qa/extras/xshape/data/reference/testChart.xml
@@ -0,0 +1,1218 @@
+<?xml version="1.0"?>
+<XShapes>
+ <XShape positionX="0" positionY="0" sizeX="16000" sizeY="9000" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="16001.000000" column2="0.000000" column3="0.000000"/>
+ <Line2 column1="0.000000" column2="9001.000000" column3="0.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="180" sizeX="13859" sizeY="8640" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShapes>
+ <XShape positionX="762" positionY="379" sizeX="13417" sizeY="7794" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="13418.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="379.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="180" sizeX="13859" sizeY="8640" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="13860.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="180" sizeX="13859" sizeY="8640" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="612" positionY="378" sizeX="13567" sizeY="7944" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="762" positionY="379" sizeX="13417" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+ <XShapes>
+ <XShape positionX="762" positionY="379" sizeX="13417" sizeY="7794" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall=" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="13418.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="379.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13418.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="379.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="612" positionY="378" sizeX="13566" sizeY="7944" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+ <XShapes>
+ <XShape positionX="762" positionY="378" sizeX="13416" sizeY="7794" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="762" positionY="378" sizeX="13416" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
+ <XShapes>
+ <XShape positionX="762" positionY="378" sizeX="13416" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="14178" positionY="8172"/>
+ <point positionX="762" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="14178" positionY="6873"/>
+ <point positionX="762" positionY="6873"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="14178" positionY="5574"/>
+ <point positionX="762" positionY="5574"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="14178" positionY="4275"/>
+ <point positionX="762" positionY="4275"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="14178" positionY="2976"/>
+ <point positionX="762" positionY="2976"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="14178" positionY="1677"/>
+ <point positionX="762" positionY="1677"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="14178" positionY="378"/>
+ <point positionX="762" positionY="378"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="13416" positionY="7794"/>
+ <point positionX="0" positionY="7794"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13416" positionY="6495"/>
+ <point positionX="0" positionY="6495"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13416" positionY="5196"/>
+ <point positionX="0" positionY="5196"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13416" positionY="3897"/>
+ <point positionX="0" positionY="3897"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13416" positionY="2598"/>
+ <point positionX="0" positionY="2598"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13416" positionY="1299"/>
+ <point positionX="0" positionY="1299"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13416" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="13416.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="762" positionY="378" sizeX="0" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="NONE">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="762" positionY="8172"/>
+ <point positionX="762" positionY="6873"/>
+ <point positionX="762" positionY="5574"/>
+ <point positionX="762" positionY="4275"/>
+ <point positionX="762" positionY="2976"/>
+ <point positionX="762" positionY="1677"/>
+ <point positionX="762" positionY="378"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="0" positionY="6495"/>
+ <point positionX="0" positionY="5196"/>
+ <point positionX="0" positionY="3897"/>
+ <point positionX="0" positionY="2598"/>
+ <point positionX="0" positionY="1299"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="0.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13417.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13417.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="612" positionY="378" sizeX="13566" sizeY="7944" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="762" positionY="8172" sizeX="13416" sizeY="150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShapes>
+ <XShape positionX="762" positionY="8172" sizeX="13416" sizeY="150" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="762" positionY="8322"/>
+ <point positionX="762" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="762" positionY="8322"/>
+ <point positionX="762" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="3445" positionY="8322"/>
+ <point positionX="3445" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="3445" positionY="8322"/>
+ <point positionX="3445" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="6128" positionY="8322"/>
+ <point positionX="6128" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="6128" positionY="8322"/>
+ <point positionX="6128" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="8812" positionY="8322"/>
+ <point positionX="8812" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="8812" positionY="8322"/>
+ <point positionX="8812" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="11495" positionY="8322"/>
+ <point positionX="11495" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="11495" positionY="8322"/>
+ <point positionX="11495" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="14178" positionY="8322"/>
+ <point positionX="14178" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="14178" positionY="8322"/>
+ <point positionX="14178" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="150"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="150"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="2683" positionY="150"/>
+ <point positionX="2683" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="2683" positionY="150"/>
+ <point positionX="2683" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="5366" positionY="150"/>
+ <point positionX="5366" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="5366" positionY="150"/>
+ <point positionX="5366" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="8050" positionY="150"/>
+ <point positionX="8050" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="8050" positionY="150"/>
+ <point positionX="8050" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="10733" positionY="150"/>
+ <point positionX="10733" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="10733" positionY="150"/>
+ <point positionX="10733" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13416" positionY="150"/>
+ <point positionX="13416" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="13416" positionY="150"/>
+ <point positionX="13416" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="13416.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="150.000000" column3="8172.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="762" positionY="8172" sizeX="13416" sizeY="0" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="762" positionY="8172"/>
+ <point positionX="14178" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="13416" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="13416.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="0.000000" column3="8172.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13417.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="151.000000" column3="8172.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="612" positionY="378" sizeX="150" sizeY="7794" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="612" positionY="378" sizeX="150" sizeY="7794" type="com.sun.star.drawing.PolyLineShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="612" positionY="8172"/>
+ <point positionX="762" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="8172"/>
+ <point positionX="762" positionY="8172"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="6873"/>
+ <point positionX="762" positionY="6873"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="6873"/>
+ <point positionX="762" positionY="6873"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="5574"/>
+ <point positionX="762" positionY="5574"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="5574"/>
+ <point positionX="762" positionY="5574"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="4275"/>
+ <point positionX="762" positionY="4275"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="4275"/>
+ <point positionX="762" positionY="4275"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="2976"/>
+ <point positionX="762" positionY="2976"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="2976"/>
+ <point positionX="762" positionY="2976"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="1677"/>
+ <point positionX="762" positionY="1677"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="1677"/>
+ <point positionX="762" positionY="1677"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="378"/>
+ <point positionX="762" positionY="378"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="612" positionY="378"/>
+ <point positionX="762" positionY="378"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="150" positionY="7794"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="150" positionY="7794"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="6495"/>
+ <point positionX="150" positionY="6495"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="6495"/>
+ <point positionX="150" positionY="6495"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="5196"/>
+ <point positionX="150" positionY="5196"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="5196"/>
+ <point positionX="150" positionY="5196"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="3897"/>
+ <point positionX="150" positionY="3897"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="3897"/>
+ <point positionX="150" positionY="3897"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="2598"/>
+ <point positionX="150" positionY="2598"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="2598"/>
+ <point positionX="150" positionY="2598"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="1299"/>
+ <point positionX="150" positionY="1299"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="1299"/>
+ <point positionX="150" positionY="1299"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="150" positionY="0"/>
+ </pointSequence>
+ <pointSequence>
+ <point positionX="0" positionY="0"/>
+ <point positionX="150" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="150.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="762" positionY="378" sizeX="0" sizeY="7794" type="com.sun.star.drawing.LineShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="762" positionY="8172"/>
+ <point positionX="762" positionY="378"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="7794"/>
+ <point positionX="0" positionY="0"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="0.000000" column2="0.000000" column3="762.000000"/>
+ <Line2 column1="0.000000" column2="7794.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="151.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7795.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13567.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="1209" positionY="1677" sizeX="12522" sizeY="6495" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="1209" positionY="1677" sizeX="11628" sizeY="6495" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+ <XShapes>
+ <XShape positionX="1209" positionY="6873" sizeX="894" sizeY="1299" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="1209" positionY="8172"/>
+ <point positionX="2103" positionY="8172"/>
+ <point positionX="2103" positionY="6873"/>
+ <point positionX="1209" positionY="6873"/>
+ <point positionX="1209" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="1299"/>
+ <point positionX="894" positionY="1299"/>
+ <point positionX="894" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="1299"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="894.000000" column2="0.000000" column3="1209.000000"/>
+ <Line2 column1="0.000000" column2="1299.000000" column3="6873.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="3892" positionY="5574" sizeX="895" sizeY="2598" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="3892" positionY="8172"/>
+ <point positionX="4787" positionY="8172"/>
+ <point positionX="4787" positionY="5574"/>
+ <point positionX="3892" positionY="5574"/>
+ <point positionX="3892" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="2598"/>
+ <point positionX="895" positionY="2598"/>
+ <point positionX="895" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="2598"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="895.000000" column2="0.000000" column3="3892.000000"/>
+ <Line2 column1="0.000000" column2="2598.000000" column3="5574.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="6576" positionY="4275" sizeX="894" sizeY="3897" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="6576" positionY="8172"/>
+ <point positionX="7470" positionY="8172"/>
+ <point positionX="7470" positionY="4275"/>
+ <point positionX="6576" positionY="4275"/>
+ <point positionX="6576" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="3897"/>
+ <point positionX="894" positionY="3897"/>
+ <point positionX="894" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="3897"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="894.000000" column2="0.000000" column3="6576.000000"/>
+ <Line2 column1="0.000000" column2="3897.000000" column3="4275.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="9259" positionY="2976" sizeX="894" sizeY="5196" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="9259" positionY="8172"/>
+ <point positionX="10153" positionY="8172"/>
+ <point positionX="10153" positionY="2976"/>
+ <point positionX="9259" positionY="2976"/>
+ <point positionX="9259" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="5196"/>
+ <point positionX="894" positionY="5196"/>
+ <point positionX="894" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="5196"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="894.000000" column2="0.000000" column3="9259.000000"/>
+ <Line2 column1="0.000000" column2="5196.000000" column3="2976.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="11942" positionY="1677" sizeX="895" sizeY="6495" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="11942" positionY="8172"/>
+ <point positionX="12837" positionY="8172"/>
+ <point positionX="12837" positionY="1677"/>
+ <point positionX="11942" positionY="1677"/>
+ <point positionX="11942" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="6495"/>
+ <point positionX="895" positionY="6495"/>
+ <point positionX="895" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="6495"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="895.000000" column2="0.000000" column3="11942.000000"/>
+ <Line2 column1="0.000000" column2="6495.000000" column3="1677.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="11629.000000" column2="0.000000" column3="1209.000000"/>
+ <Line2 column1="0.000000" column2="6496.000000" column3="1677.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="2103" positionY="2976" sizeX="11628" sizeY="5196" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1">
+ <XShapes>
+ <XShape positionX="2103" positionY="5574" sizeX="895" sizeY="2598" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="2103" positionY="8172"/>
+ <point positionX="2998" positionY="8172"/>
+ <point positionX="2998" positionY="5574"/>
+ <point positionX="2103" positionY="5574"/>
+ <point positionX="2103" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="2598"/>
+ <point positionX="895" positionY="2598"/>
+ <point positionX="895" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="2598"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="895.000000" column2="0.000000" column3="2103.000000"/>
+ <Line2 column1="0.000000" column2="2598.000000" column3="5574.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4787" positionY="6873" sizeX="894" sizeY="1299" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="4787" positionY="8172"/>
+ <point positionX="5681" positionY="8172"/>
+ <point positionX="5681" positionY="6873"/>
+ <point positionX="4787" positionY="6873"/>
+ <point positionX="4787" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="1299"/>
+ <point positionX="894" positionY="1299"/>
+ <point positionX="894" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="1299"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="894.000000" column2="0.000000" column3="4787.000000"/>
+ <Line2 column1="0.000000" column2="1299.000000" column3="6873.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7470" positionY="4275" sizeX="894" sizeY="3897" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="7470" positionY="8172"/>
+ <point positionX="8364" positionY="8172"/>
+ <point positionX="8364" positionY="4275"/>
+ <point positionX="7470" positionY="4275"/>
+ <point positionX="7470" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="3897"/>
+ <point positionX="894" positionY="3897"/>
+ <point positionX="894" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="3897"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="894.000000" column2="0.000000" column3="7470.000000"/>
+ <Line2 column1="0.000000" column2="3897.000000" column3="4275.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="10153" positionY="2976" sizeX="895" sizeY="5196" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="10153" positionY="8172"/>
+ <point positionX="11048" positionY="8172"/>
+ <point positionX="11048" positionY="2976"/>
+ <point positionX="10153" positionY="2976"/>
+ <point positionX="10153" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="5196"/>
+ <point positionX="895" positionY="5196"/>
+ <point positionX="895" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="5196"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="895.000000" column2="0.000000" column3="10153.000000"/>
+ <Line2 column1="0.000000" column2="5196.000000" column3="2976.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="12837" positionY="5574" sizeX="894" sizeY="2598" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=4" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <PolyPolygon>
+ <pointSequence>
+ <point positionX="12837" positionY="8172"/>
+ <point positionX="13731" positionY="8172"/>
+ <point positionX="13731" positionY="5574"/>
+ <point positionX="12837" positionY="5574"/>
+ <point positionX="12837" positionY="8172"/>
+ </pointSequence>
+ </PolyPolygon>
+ <Geometry>
+ <pointSequence>
+ <point positionX="0" positionY="2598"/>
+ <point positionX="894" positionY="2598"/>
+ <point positionX="894" positionY="0"/>
+ <point positionX="0" positionY="0"/>
+ <point positionX="0" positionY="2598"/>
+ </pointSequence>
+ </Geometry>
+ <Transformation>
+ <Line1 column1="894.000000" column2="0.000000" column3="12837.000000"/>
+ <Line2 column1="0.000000" column2="2598.000000" column3="5574.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="11629.000000" column2="0.000000" column3="2103.000000"/>
+ <Line2 column1="0.000000" column2="5197.000000" column3="2976.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12523.000000" column2="0.000000" column3="1209.000000"/>
+ <Line2 column1="0.000000" column2="6496.000000" column3="1677.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13567.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13568.000000" column2="0.000000" column3="612.000000"/>
+ <Line2 column1="0.000000" column2="7945.000000" column3="378.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="180" sizeX="12614" sizeY="8640" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="2007" positionY="8422" sizeX="10927" sizeY="398" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+ <XShapes>
+ <XShape positionX="2007" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="2007.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="4691" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="4691.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="7374" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="3" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="7374.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="10057" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="4" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="10057.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="12741" positionY="8422" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="5" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="12741.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="10928.000000" column2="0.000000" column3="2007.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="8422.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="180" sizeX="193" sizeY="8192" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+ <XShapes>
+ <XShape positionX="320" positionY="7974" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="0" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="7974.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="6675" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="6675.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="5376" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="5376.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="4077" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="3" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4077.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="2778" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="4" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="2778.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="1479" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="5" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="1479.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="320" positionY="180" sizeX="193" sizeY="398" type="com.sun.star.drawing.TextShape" text="6" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="1" textMinimumFrameWidth="1" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="194.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8193.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="12615.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13860.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="13860.000000" column2="0.000000" column3="320.000000"/>
+ <Line2 column1="0.000000" column2="8641.000000" column3="180.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14499" positionY="3952" sizeX="1291" sizeY="1096" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
+ <XShapes>
+ <XShape positionX="14499" positionY="3952" sizeX="1291" sizeY="1096" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="e6e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="1292.000000" column2="0.000000" column3="14499.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3952.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14615" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="14615" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="14615" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="14615.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14615" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="004586" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="14615.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="14615.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="14615.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14615" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
+ <XShapes>
+ <XShape positionX="14615" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
+ <XShapes>
+ <XShape positionX="14615" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="14615.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14615" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" fontHeight="12.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="ff420e" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="14615.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="14615.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="212.000000" column2="0.000000" column3="14615.000000"/>
+ <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14926" positionY="4052" sizeX="748" sizeY="398" type="com.sun.star.drawing.TextShape" text="test1" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="749.000000" column2="0.000000" column3="14926.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4052.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ <XShape positionX="14926" positionY="4550" sizeX="748" sizeY="398" type="com.sun.star.drawing.TextShape" text="test2" fontHeight="10.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="100" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="ffffff" fillTransparence="0" fillTransparenceGradientName="">
+ <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
+ <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
+ <FillBitmap/>
+ <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
+ <LineStart/>
+ <LineEnd/>
+ <Transformation>
+ <Line1 column1="749.000000" column2="0.000000" column3="14926.000000"/>
+ <Line2 column1="0.000000" column2="399.000000" column3="4550.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+ </XShapes>
+ <Transformation>
+ <Line1 column1="1292.000000" column2="0.000000" column3="14499.000000"/>
+ <Line2 column1="0.000000" column2="1097.000000" column3="3952.000000"/>
+ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
+ </Transformation>
+ </XShape>
+</XShapes>
+
+
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 000000000000..1044345619c4
--- /dev/null
+++ b/chart2/qa/extras/xshape/data/xls/tdf150832.xls
Binary files differ
diff --git a/chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx b/chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx
index 9474de35fb77..05db435f6052 100644
--- a/chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx
+++ b/chart2/qa/extras/xshape/data/xlsx/tdf90839-1.xlsx
Binary files differ
diff --git a/chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx b/chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx
index 9a5b35228118..d3922f7f20ed 100644
--- a/chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx
+++ b/chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx
Binary files differ
diff --git a/chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx b/chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx
index e256c3a0b4f9..5a3ee4cf49eb 100644
--- a/chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx
+++ b/chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx
Binary files differ
diff --git a/chart2/qa/unit/common_functor_test.cxx b/chart2/qa/unit/common_functor_test.cxx
index b2e404e13508..05e62490848d 100644
--- a/chart2/qa/unit/common_functor_test.cxx
+++ b/chart2/qa/unit/common_functor_test.cxx
@@ -48,15 +48,15 @@ void CommonFunctorsTest::testAnyToString()
std::vector<OUString> 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]);
+ std::back_inserter(aOutput), chart::CommonFunctors::ToString());
+
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, aOutput[0]);
+ CPPUNIT_ASSERT_EQUAL(u"10"_ustr, aOutput[1]);
+ CPPUNIT_ASSERT_EQUAL(u"12"_ustr, aOutput[2]);
+ CPPUNIT_ASSERT_EQUAL(u"15"_ustr, aOutput[3]);
+ CPPUNIT_ASSERT_EQUAL(u"25.234"_ustr, aOutput[4]);
+ CPPUNIT_ASSERT_EQUAL(u"123.456"_ustr, aOutput[5]);
+ CPPUNIT_ASSERT_EQUAL(u"0.12345"_ustr, aOutput[6]);
}
void CommonFunctorsTest::testDoubleToString()
@@ -65,15 +65,15 @@ void CommonFunctorsTest::testDoubleToString()
std::vector<OUString> 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]);
+ std::back_inserter(aOutput), chart::CommonFunctors::ToString());
+
+ CPPUNIT_ASSERT_EQUAL(u"2"_ustr, aOutput[0]);
+ CPPUNIT_ASSERT_EQUAL(u"10"_ustr, aOutput[1]);
+ CPPUNIT_ASSERT_EQUAL(u"12"_ustr, aOutput[2]);
+ CPPUNIT_ASSERT_EQUAL(u"15"_ustr, aOutput[3]);
+ CPPUNIT_ASSERT_EQUAL(u"25.234"_ustr, aOutput[4]);
+ CPPUNIT_ASSERT_EQUAL(u"123.456"_ustr, aOutput[5]);
+ CPPUNIT_ASSERT_EQUAL(u"0.12345"_ustr, aOutput[6]);
}
CPPUNIT_TEST_SUITE_REGISTRATION(CommonFunctorsTest);
diff --git a/chart2/qa/unit/data/reference/testChart.xml b/chart2/qa/unit/data/reference/testChart.xml
deleted file mode 100644
index 03ad3d95f85b..000000000000
--- a/chart2/qa/unit/data/reference/testChart.xml
+++ /dev/null
@@ -1,1216 +0,0 @@
-<?xml version="1.0"?>
-<XShapes>
- <XShape positionX="0" positionY="0" sizeX="16000" sizeY="9000" type="com.sun.star.drawing.RectangleShape" name="CID/Page=" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="16001.000000" column2="0.000000" column3="0.000000"/>
- <Line2 column1="0.000000" column2="9001.000000" column3="0.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="854" sizeX="13068" sizeY="7546" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
- <XShapes>
- <XShape positionX="1206" positionY="1054" sizeX="12632" sizeY="6699" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="10079487" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="12633.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="6700.000000" column3="1054.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="855" sizeX="13068" sizeY="7545" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="10079487" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="13069.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="7546.000000" column3="855.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="854" sizeX="13068" sizeY="7546" type="com.sun.star.drawing.GroupShape">
- <XShapes>
- <XShape positionX="1056" positionY="1052" sizeX="12782" sizeY="6850" type="com.sun.star.drawing.GroupShape">
- <XShapes>
- <XShape positionX="1206" positionY="1054" sizeX="12632" sizeY="6699" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
- <XShapes>
- <XShape positionX="1206" positionY="1054" sizeX="12632" sizeY="6699" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall=" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="15132390" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="12633.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="6700.000000" column3="1054.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="12633.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="6700.000000" column3="1054.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="1056" positionY="1052" sizeX="12782" sizeY="6850" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
- <XShapes>
- <XShape positionX="1206" positionY="1052" sizeX="12632" sizeY="6700" type="com.sun.star.drawing.GroupShape">
- <XShapes>
- <XShape positionX="1206" positionY="1052" sizeX="12632" sizeY="6700" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
- <XShapes>
- <XShape positionX="1206" positionY="1052" sizeX="12632" sizeY="6700" type="com.sun.star.drawing.PolyLineShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="13838" positionY="7752"/>
- <point positionX="1206" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="13838" positionY="6635"/>
- <point positionX="1206" positionY="6635"/>
- </pointSequence>
- <pointSequence>
- <point positionX="13838" positionY="5519"/>
- <point positionX="1206" positionY="5519"/>
- </pointSequence>
- <pointSequence>
- <point positionX="13838" positionY="4402"/>
- <point positionX="1206" positionY="4402"/>
- </pointSequence>
- <pointSequence>
- <point positionX="13838" positionY="3285"/>
- <point positionX="1206" positionY="3285"/>
- </pointSequence>
- <pointSequence>
- <point positionX="13838" positionY="2169"/>
- <point positionX="1206" positionY="2169"/>
- </pointSequence>
- <pointSequence>
- <point positionX="13838" positionY="1052"/>
- <point positionX="1206" positionY="1052"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="12632" positionY="6700"/>
- <point positionX="0" positionY="6700"/>
- </pointSequence>
- <pointSequence>
- <point positionX="12632" positionY="5583"/>
- <point positionX="0" positionY="5583"/>
- </pointSequence>
- <pointSequence>
- <point positionX="12632" positionY="4467"/>
- <point positionX="0" positionY="4467"/>
- </pointSequence>
- <pointSequence>
- <point positionX="12632" positionY="3350"/>
- <point positionX="0" positionY="3350"/>
- </pointSequence>
- <pointSequence>
- <point positionX="12632" positionY="2233"/>
- <point positionX="0" positionY="2233"/>
- </pointSequence>
- <pointSequence>
- <point positionX="12632" positionY="1117"/>
- <point positionX="0" positionY="1117"/>
- </pointSequence>
- <pointSequence>
- <point positionX="12632" positionY="0"/>
- <point positionX="0" positionY="0"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="12632.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="6700.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="1206" positionY="1052" sizeX="0" sizeY="6700" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="NONE">
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="1206" positionY="7752"/>
- <point positionX="1206" positionY="6635"/>
- <point positionX="1206" positionY="5519"/>
- <point positionX="1206" positionY="4402"/>
- <point positionX="1206" positionY="3285"/>
- <point positionX="1206" positionY="2169"/>
- <point positionX="1206" positionY="1052"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="6700"/>
- <point positionX="0" positionY="5583"/>
- <point positionX="0" positionY="4467"/>
- <point positionX="0" positionY="3350"/>
- <point positionX="0" positionY="2233"/>
- <point positionX="0" positionY="1117"/>
- <point positionX="0" positionY="0"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="6700.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="12633.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="6701.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="12633.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="6701.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="1056" positionY="1052" sizeX="12782" sizeY="6850" type="com.sun.star.drawing.GroupShape">
- <XShapes>
- <XShape positionX="1206" positionY="7752" sizeX="12632" sizeY="150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
- <XShapes>
- <XShape positionX="1206" positionY="7752" sizeX="12632" sizeY="150" type="com.sun.star.drawing.PolyLineShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="1206" positionY="7902"/>
- <point positionX="1206" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1206" positionY="7902"/>
- <point positionX="1206" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="3732" positionY="7902"/>
- <point positionX="3732" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="3732" positionY="7902"/>
- <point positionX="3732" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="6258" positionY="7902"/>
- <point positionX="6258" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="6258" positionY="7902"/>
- <point positionX="6258" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="8785" positionY="7902"/>
- <point positionX="8785" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="8785" positionY="7902"/>
- <point positionX="8785" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="11311" positionY="7902"/>
- <point positionX="11311" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="11311" positionY="7902"/>
- <point positionX="11311" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="13838" positionY="7902"/>
- <point positionX="13838" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="13838" positionY="7902"/>
- <point positionX="13838" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="150"/>
- <point positionX="0" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="150"/>
- <point positionX="0" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="2526" positionY="150"/>
- <point positionX="2526" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="2526" positionY="150"/>
- <point positionX="2526" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="5052" positionY="150"/>
- <point positionX="5052" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="5052" positionY="150"/>
- <point positionX="5052" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="7579" positionY="150"/>
- <point positionX="7579" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="7579" positionY="150"/>
- <point positionX="7579" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="10105" positionY="150"/>
- <point positionX="10105" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="10105" positionY="150"/>
- <point positionX="10105" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="12632" positionY="150"/>
- <point positionX="12632" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="12632" positionY="150"/>
- <point positionX="12632" positionY="0"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="12632.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="150.000000" column3="7752.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="1206" positionY="7752" sizeX="12632" sizeY="0" type="com.sun.star.drawing.LineShape" name="MarkHandles" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="1206" positionY="7752"/>
- <point positionX="13838" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="0"/>
- <point positionX="12632" positionY="0"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="12632.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="0.000000" column3="7752.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="12633.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="151.000000" column3="7752.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="1056" positionY="1052" sizeX="150" sizeY="6700" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
- <XShapes>
- <XShape positionX="1056" positionY="1052" sizeX="150" sizeY="6700" type="com.sun.star.drawing.PolyLineShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="1056" positionY="7752"/>
- <point positionX="1206" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="7752"/>
- <point positionX="1206" positionY="7752"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="6635"/>
- <point positionX="1206" positionY="6635"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="6635"/>
- <point positionX="1206" positionY="6635"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="5519"/>
- <point positionX="1206" positionY="5519"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="5519"/>
- <point positionX="1206" positionY="5519"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="4402"/>
- <point positionX="1206" positionY="4402"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="4402"/>
- <point positionX="1206" positionY="4402"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="3285"/>
- <point positionX="1206" positionY="3285"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="3285"/>
- <point positionX="1206" positionY="3285"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="2169"/>
- <point positionX="1206" positionY="2169"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="2169"/>
- <point positionX="1206" positionY="2169"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="1052"/>
- <point positionX="1206" positionY="1052"/>
- </pointSequence>
- <pointSequence>
- <point positionX="1056" positionY="1052"/>
- <point positionX="1206" positionY="1052"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="6700"/>
- <point positionX="150" positionY="6700"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="6700"/>
- <point positionX="150" positionY="6700"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="5583"/>
- <point positionX="150" positionY="5583"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="5583"/>
- <point positionX="150" positionY="5583"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="4467"/>
- <point positionX="150" positionY="4467"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="4467"/>
- <point positionX="150" positionY="4467"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="3350"/>
- <point positionX="150" positionY="3350"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="3350"/>
- <point positionX="150" positionY="3350"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="2233"/>
- <point positionX="150" positionY="2233"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="2233"/>
- <point positionX="150" positionY="2233"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="1117"/>
- <point positionX="150" positionY="1117"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="1117"/>
- <point positionX="150" positionY="1117"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="0"/>
- <point positionX="150" positionY="0"/>
- </pointSequence>
- <pointSequence>
- <point positionX="0" positionY="0"/>
- <point positionX="150" positionY="0"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="150.000000" column2="0.000000" column3="1056.000000"/>
- <Line2 column1="0.000000" column2="6700.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="1206" positionY="1052" sizeX="0" sizeY="6700" type="com.sun.star.drawing.LineShape" name="MarkHandles" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="1206" positionY="7752"/>
- <point positionX="1206" positionY="1052"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="6700"/>
- <point positionX="0" positionY="0"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="0.000000" column2="0.000000" column3="1206.000000"/>
- <Line2 column1="0.000000" column2="6700.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="151.000000" column2="0.000000" column3="1056.000000"/>
- <Line2 column1="0.000000" column2="6701.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="12783.000000" column2="0.000000" column3="1056.000000"/>
- <Line2 column1="0.000000" column2="6851.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="1627" positionY="2169" sizeX="11789" sizeY="5583" type="com.sun.star.drawing.GroupShape">
- <XShapes>
- <XShape positionX="1627" positionY="2169" sizeX="10947" sizeY="5583" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
- <XShapes>
- <XShape positionX="11732" positionY="2169" sizeX="842" sizeY="5583" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=4" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="17798" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="11732" positionY="7752"/>
- <point positionX="12574" positionY="7752"/>
- <point positionX="12574" positionY="2169"/>
- <point positionX="11732" positionY="2169"/>
- <point positionX="11732" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="5583"/>
- <point positionX="842" positionY="5583"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="5583"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="11732.000000"/>
- <Line2 column1="0.000000" column2="5583.000000" column3="2169.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="9206" positionY="3285" sizeX="842" sizeY="4467" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="17798" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="9206" positionY="7752"/>
- <point positionX="10048" positionY="7752"/>
- <point positionX="10048" positionY="3285"/>
- <point positionX="9206" positionY="3285"/>
- <point positionX="9206" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="4467"/>
- <point positionX="842" positionY="4467"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="4467"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="9206.000000"/>
- <Line2 column1="0.000000" column2="4467.000000" column3="3285.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="6679" positionY="4402" sizeX="843" sizeY="3350" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="17798" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="6679" positionY="7752"/>
- <point positionX="7522" positionY="7752"/>
- <point positionX="7522" positionY="4402"/>
- <point positionX="6679" positionY="4402"/>
- <point positionX="6679" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="3350"/>
- <point positionX="843" positionY="3350"/>
- <point positionX="843" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="3350"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="843.000000" column2="0.000000" column3="6679.000000"/>
- <Line2 column1="0.000000" column2="3350.000000" column3="4402.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="4153" positionY="5519" sizeX="842" sizeY="2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="17798" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="4153" positionY="7752"/>
- <point positionX="4995" positionY="7752"/>
- <point positionX="4995" positionY="5519"/>
- <point positionX="4153" positionY="5519"/>
- <point positionX="4153" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="2233"/>
- <point positionX="842" positionY="2233"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="2233"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="4153.000000"/>
- <Line2 column1="0.000000" column2="2233.000000" column3="5519.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="1627" positionY="6635" sizeX="842" sizeY="1117" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="17798" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="1627" positionY="7752"/>
- <point positionX="2469" positionY="7752"/>
- <point positionX="2469" positionY="6635"/>
- <point positionX="1627" positionY="6635"/>
- <point positionX="1627" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="1117"/>
- <point positionX="842" positionY="1117"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="1117"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="1627.000000"/>
- <Line2 column1="0.000000" column2="1117.000000" column3="6635.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="10948.000000" column2="0.000000" column3="1627.000000"/>
- <Line2 column1="0.000000" column2="5584.000000" column3="2169.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="2469" positionY="3285" sizeX="10947" sizeY="4467" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1">
- <XShapes>
- <XShape positionX="12574" positionY="5519" sizeX="842" sizeY="2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=4" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="16728590" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="12574" positionY="7752"/>
- <point positionX="13416" positionY="7752"/>
- <point positionX="13416" positionY="5519"/>
- <point positionX="12574" positionY="5519"/>
- <point positionX="12574" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="2233"/>
- <point positionX="842" positionY="2233"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="2233"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="12574.000000"/>
- <Line2 column1="0.000000" column2="2233.000000" column3="5519.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="10048" positionY="3285" sizeX="842" sizeY="4467" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="16728590" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="10048" positionY="7752"/>
- <point positionX="10890" positionY="7752"/>
- <point positionX="10890" positionY="3285"/>
- <point positionX="10048" positionY="3285"/>
- <point positionX="10048" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="4467"/>
- <point positionX="842" positionY="4467"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="4467"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="10048.000000"/>
- <Line2 column1="0.000000" column2="4467.000000" column3="3285.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="7522" positionY="4402" sizeX="842" sizeY="3350" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="16728590" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="7522" positionY="7752"/>
- <point positionX="8364" positionY="7752"/>
- <point positionX="8364" positionY="4402"/>
- <point positionX="7522" positionY="4402"/>
- <point positionX="7522" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="3350"/>
- <point positionX="842" positionY="3350"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="3350"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="7522.000000"/>
- <Line2 column1="0.000000" column2="3350.000000" column3="4402.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="4995" positionY="6635" sizeX="842" sizeY="1117" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="16728590" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="4995" positionY="7752"/>
- <point positionX="5837" positionY="7752"/>
- <point positionX="5837" positionY="6635"/>
- <point positionX="4995" positionY="6635"/>
- <point positionX="4995" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="1117"/>
- <point positionX="842" positionY="1117"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="1117"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="4995.000000"/>
- <Line2 column1="0.000000" column2="1117.000000" column3="6635.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="2469" positionY="5519" sizeX="842" sizeY="2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="16728590" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <PolyPolygon>
- <pointSequence>
- <point positionX="2469" positionY="7752"/>
- <point positionX="3311" positionY="7752"/>
- <point positionX="3311" positionY="5519"/>
- <point positionX="2469" positionY="5519"/>
- <point positionX="2469" positionY="7752"/>
- </pointSequence>
- </PolyPolygon>
- <Geometry>
- <pointSequence>
- <point positionX="0" positionY="2233"/>
- <point positionX="842" positionY="2233"/>
- <point positionX="842" positionY="0"/>
- <point positionX="0" positionY="0"/>
- <point positionX="0" positionY="2233"/>
- </pointSequence>
- </Geometry>
- <Transformation>
- <Line1 column1="842.000000" column2="0.000000" column3="2469.000000"/>
- <Line2 column1="0.000000" column2="2233.000000" column3="5519.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="10948.000000" column2="0.000000" column3="2469.000000"/>
- <Line2 column1="0.000000" column2="4468.000000" column3="3285.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="11790.000000" column2="0.000000" column3="1627.000000"/>
- <Line2 column1="0.000000" column2="5584.000000" column3="2169.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="12783.000000" column2="0.000000" column3="1056.000000"/>
- <Line2 column1="0.000000" column2="6851.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="12783.000000" column2="0.000000" column3="1056.000000"/>
- <Line2 column1="0.000000" column2="6851.000000" column3="1052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="854" sizeX="11898" sizeY="7546" type="com.sun.star.drawing.GroupShape">
- <XShapes>
- <XShape positionX="2376" positionY="8002" sizeX="10292" sizeY="398" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
- <XShapes>
- <XShape positionX="2376" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="1" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="2376.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="8002.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="4902" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="2" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="4902.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="8002.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="7429" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="3" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="7429.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="8002.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="9955" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="4" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="9955.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="8002.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="12481" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="5" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="12481.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="8002.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="10293.000000" column2="0.000000" column3="2376.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="8002.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="854" sizeX="187" sizeY="7098" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
- <XShapes>
- <XShape positionX="770" positionY="7554" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="0" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="7554.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="6437" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="1" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="6437.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="5321" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="2" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="5321.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="4204" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="3" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="4204.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="3087" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="4" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="3087.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="1971" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="5" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="1971.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="770" positionY="854" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="6" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="RIGHT" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="854.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="188.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="7099.000000" column3="854.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="11899.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="7547.000000" column3="854.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="13069.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="7547.000000" column3="854.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="13069.000000" column2="0.000000" column3="770.000000"/>
- <Line2 column1="0.000000" column2="7547.000000" column3="854.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="14478" positionY="3952" sizeX="1312" sizeY="1096" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
- <XShapes>
- <XShape positionX="14478" positionY="3952" sizeX="1312" sizeY="1096" type="com.sun.star.drawing.RectangleShape" name="MarkHandles" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="15132390" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="1313.000000" column2="0.000000" column3="14478.000000"/>
- <Line2 column1="0.000000" column2="1097.000000" column3="3952.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="14594" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
- <XShapes>
- <XShape positionX="14594" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
- <XShapes>
- <XShape positionX="14594" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="10079487" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14594.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="14594" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="17798" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14594.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14594.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14594.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4145.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="14594" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
- <XShapes>
- <XShape positionX="14594" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
- <XShapes>
- <XShape positionX="14594" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="10079487" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14594.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="14594" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="16728590" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14594.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14594.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="212.000000" column2="0.000000" column3="14594.000000"/>
- <Line2 column1="0.000000" column2="212.000000" column3="4643.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="14905" positionY="4052" sizeX="769" sizeY="398" type="com.sun.star.drawing.TextShape" text="test1" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="770.000000" column2="0.000000" column3="14905.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="4052.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- <XShape positionX="14905" positionY="4550" sizeX="769" sizeY="398" type="com.sun.star.drawing.TextShape" text="test2" textAutoGrowHeight="true" textAutoGrowWidth="true" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="LEFT" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="4800" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName="">
- <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
- <FillHatch style="SINGLE" color="0" distance="20" angle="0"/>
- <FillBitmap/>
- <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
- <LineStart/>
- <LineEnd/>
- <Transformation>
- <Line1 column1="770.000000" column2="0.000000" column3="14905.000000"/>
- <Line2 column1="0.000000" column2="399.000000" column3="4550.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
- </XShapes>
- <Transformation>
- <Line1 column1="1313.000000" column2="0.000000" column3="14478.000000"/>
- <Line2 column1="0.000000" column2="1097.000000" column3="3952.000000"/>
- <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
- </Transformation>
- </XShape>
-</XShapes>
diff --git a/chart2/source/chartcore.component b/chart2/source/chart2.component
index f58ba98ba3ac..b94fab20768c 100644
--- a/chart2/source/chartcore.component
+++ b/chart2/source/chart2.component
@@ -137,6 +137,11 @@
<service name="com.sun.star.chart2.ChartType"/>
<service name="com.sun.star.chart2.ColumnChartType"/>
</implementation>
+ <implementation name="com.sun.star.comp.chart.HistogramChartType"
+ constructor="com_sun_star_comp_chart_HistogramChartType_get_implementation">
+ <service name="com.sun.star.chart2.ChartType"/>
+ <service name="com.sun.star.chart2.HistogramChartType"/>
+ </implementation>
<implementation name="com.sun.star.comp.chart.DataSeries"
constructor="com_sun_star_comp_chart_DataSeries_get_implementation">
<service name="com.sun.star.beans.PropertySet"/>
@@ -155,6 +160,11 @@
<service name="com.sun.star.chart2.FormattedString"/>
<service name="com.sun.star.chart2.DataPointCustomLabelField"/>
</implementation>
+ <implementation name="com.sun.star.comp.chart.FunnelChartType"
+ constructor="com_sun_star_comp_chart_FunnelChartType_get_implementation">
+ <service name="com.sun.star.chart2.ChartType"/>
+ <service name="com.sun.star.chart2.FunnelChartType"/>
+ </implementation>
<implementation name="com.sun.star.comp.chart.LineChartType"
constructor="com_sun_star_comp_chart_LineChartType_get_implementation">
<service name="com.sun.star.beans.PropertySet"/>
@@ -220,6 +230,13 @@
<service name="com.sun.star.layout.LayoutElement"/>
<service name="com.sun.star.style.CharacterProperties"/>
</implementation>
+ <implementation name="com.sun.star.comp.chart2.DataTable"
+ constructor="com_sun_star_comp_chart2_DataTable_get_implementation">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.DataTable"/>
+ <service name="com.sun.star.drawing.FillProperties"/>
+ <service name="com.sun.star.drawing.LineProperties"/>
+ </implementation>
<implementation name="com.sun.star.comp.chart2.PageBackground"
constructor="com_sun_star_comp_chart2_PageBackground_get_implementation">
<service name="com.sun.star.beans.PropertySet"/>
@@ -256,4 +273,39 @@
constructor="com_sun_star_comp_chart2_ChartView_get_implementation">
<service name="com.sun.star.chart2.ChartView"/>
</implementation>
+ <implementation name="com.sun.star.comp.chart.ElementSelectorToolbarController"
+ constructor="com_sun_star_comp_chart_ElementSelectorToolbarController_get_implementation">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartDocumentWrapper"
+ constructor="com_sun_star_comp_chart2_ChartDocumentWrapper_get_implementation">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart.ChartDocument"/>
+ <service name="com.sun.star.chart2.ChartDocumentWrapper"/>
+ <service name="com.sun.star.xml.UserDefinedAttributesSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartFrameLoader"
+ constructor="com_sun_star_comp_chart2_ChartFrameLoader_get_implementation">
+ <service name="com.sun.star.frame.SynchronousFrameLoader"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartTypeDialog"
+ constructor="com_sun_star_comp_chart2_ChartTypeDialog_get_implementation">
+ <service name="com.sun.star.chart2.ChartTypeDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.WizardDialog"
+ constructor="com_sun_star_comp_chart2_WizardDialog_get_implementation">
+ <service name="com.sun.star.chart2.WizardDialog"/>
+ </implementation>
+ <implementation name="org.libreoffice.comp.chart2.sidebar.ChartPanelFactory"
+ constructor="org_libreoffice_comp_chart2_sidebar_ChartPanelFactory">
+ <service name="com.sun.star.ui.UIElementFactory"/>
+ </implementation>
+ <implementation name="org.libreoffice.chart2.Chart2ToolboxController"
+ constructor="org_libreoffice_chart2_Chart2ToolboxController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartColorPaletteControl"
+ constructor="com_sun_star_comp_chart2_ChartColorPaletteControl_get_implementation">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
</component>
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx
index f419ba7f7942..9add032de702 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -21,31 +21,26 @@
#include "AccessibleChartShape.hxx"
#include <ObjectHierarchy.hxx>
#include <ObjectIdentifier.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
+#include <ChartView.hxx>
+#include <ChartController.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
-#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <sal/log.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
-#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <i18nlangtag/languagetag.hxx>
-#include <vcl/unohelp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/window.hxx>
#include <vcl/settings.hxx>
#include <o3tl/functional.hxx>
#include <o3tl/safeint.hxx>
-#include <tools/diagnose_ex.h>
-#include <unotools/accessiblestatesethelper.hxx>
-#include <ChartModel.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
#include <iterator>
@@ -67,42 +62,27 @@ namespace chart
/** @param bMayHaveChildren is false per default
*/
AccessibleBase::AccessibleBase(
- const AccessibleElementInfo & rAccInfo,
+ AccessibleElementInfo aAccInfo,
bool bMayHaveChildren,
bool bAlwaysTransparent /* default: false */ ) :
- impl::AccessibleBase_Base( m_aMutex ),
- m_bIsDisposed( false ),
m_bMayHaveChildren( bMayHaveChildren ),
m_bChildrenInitialized( false ),
- m_nEventNotifierId(0),
- m_xStateSetHelper( new ::utl::AccessibleStateSetHelper() ),
- m_aAccInfo( rAccInfo ),
+ m_nStateSet( 0 ),
+ m_aAccInfo(std::move( aAccInfo )),
m_bAlwaysTransparent( bAlwaysTransparent ),
m_bStateSetInitialized( false )
{
// initialize some states
- OSL_ASSERT( m_xStateSetHelper.is() );
- m_xStateSetHelper->AddState( AccessibleStateType::ENABLED );
- m_xStateSetHelper->AddState( AccessibleStateType::SHOWING );
- m_xStateSetHelper->AddState( AccessibleStateType::VISIBLE );
- m_xStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
- m_xStateSetHelper->AddState( AccessibleStateType::FOCUSABLE );
+ m_nStateSet |= AccessibleStateType::ENABLED;
+ m_nStateSet |= AccessibleStateType::SHOWING;
+ m_nStateSet |= AccessibleStateType::VISIBLE;
+ m_nStateSet |= AccessibleStateType::SELECTABLE;
+ m_nStateSet |= AccessibleStateType::FOCUSABLE;
}
AccessibleBase::~AccessibleBase()
{
- OSL_ASSERT( m_bIsDisposed );
-}
-
-bool AccessibleBase::CheckDisposeState( bool bThrowException /* default: true */ ) const
-{
- if( bThrowException &&
- m_bIsDisposed )
- {
- throw lang::DisposedException("component has state DEFUNC",
- static_cast< uno::XWeak * >( const_cast< AccessibleBase * >( this )));
- }
- return m_bIsDisposed;
+ OSL_ASSERT(!isAlive());
}
bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId & rId )
@@ -119,11 +99,11 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId
case EventType::GOT_SELECTION:
{
AddState( AccessibleStateType::SELECTED );
- BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty );
+ NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aEmpty, aSelected);
AddState( AccessibleStateType::FOCUSED );
aSelected <<= AccessibleStateType::FOCUSED;
- BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty, true );
+ NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aEmpty, aSelected);
SAL_INFO("chart2.accessibility", "Selection acquired by: " << getAccessibleName());
}
@@ -132,11 +112,11 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId
case EventType::LOST_SELECTION:
{
RemoveState( AccessibleStateType::SELECTED );
- BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected );
+ NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aSelected, aEmpty);
AddState( AccessibleStateType::FOCUSED );
aSelected <<= AccessibleStateType::FOCUSED;
- BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected, true );
+ NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aSelected, aEmpty);
SAL_INFO("chart2.accessibility", "Selection lost by: " << getAccessibleName());
}
break;
@@ -149,15 +129,12 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId
ClearableMutexGuard aGuard( m_aMutex );
// make local copy for notification
- ChildListVectorType aLocalChildList( m_aChildList );
+ std::vector<rtl::Reference<AccessibleBase>> aLocalChildList(m_aChildList);
aGuard.clear();
for (auto const& localChild : aLocalChildList)
{
- // Note: at this place we must be sure to have an AccessibleBase
- // object in the UNO reference to XAccessible !
- bStop = (*static_cast< AccessibleBase * >
- ( localChild.get() )).NotifyEvent( eEventType, rId );
+ bStop = localChild->NotifyEvent(eEventType, rId);
if (bStop)
break;
}
@@ -167,18 +144,16 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId
return false;
}
-void AccessibleBase::AddState( sal_Int16 aState )
+void AccessibleBase::AddState( sal_Int64 aState )
{
- CheckDisposeState();
- OSL_ASSERT( m_xStateSetHelper.is() );
- m_xStateSetHelper->AddState( aState );
+ ensureAlive();
+ m_nStateSet |= aState;
}
-void AccessibleBase::RemoveState( sal_Int16 aState )
+void AccessibleBase::RemoveState( sal_Int64 aState )
{
- CheckDisposeState();
- OSL_ASSERT( m_xStateSetHelper.is() );
- m_xStateSetHelper->RemoveState( aState );
+ ensureAlive();
+ m_nStateSet &= ~aState;
}
bool AccessibleBase::UpdateChildren()
@@ -186,8 +161,7 @@ bool AccessibleBase::UpdateChildren()
bool bMustUpdateChildren = false;
{
MutexGuard aGuard( m_aMutex );
- if( ! m_bMayHaveChildren ||
- m_bIsDisposed )
+ if (!m_bMayHaveChildren || !isAlive())
return false;
bMustUpdateChildren = ( m_bMayHaveChildren &&
@@ -259,7 +233,7 @@ void AccessibleBase::AddChild( AccessibleBase * pChild )
ClearableMutexGuard aGuard( m_aMutex );
- Reference< XAccessible > xChild( pChild );
+ rtl::Reference<AccessibleBase> xChild(pChild);
m_aChildList.push_back( xChild );
m_aChildOIDMap[ pChild->GetId() ] = xChild;
@@ -268,16 +242,13 @@ void AccessibleBase::AddChild( AccessibleBase * pChild )
if( m_bChildrenInitialized )
{
Any aEmpty, aNew;
- aNew <<= xChild;
+ aNew <<= uno::Reference<XAccessible>(xChild);
aGuard.clear();
- BroadcastAccEvent( AccessibleEventId::CHILD, aNew, aEmpty );
+ NotifyAccessibleEvent(AccessibleEventId::CHILD, aEmpty, aNew);
}
}
-/** in this method we imply that the Reference< XAccessible > elements in the
- vector are AccessibleBase objects !
- */
void AccessibleBase::RemoveChildByOId( const ObjectIdentifier& rOId )
{
ClearableMutexGuard aGuard( m_aMutex );
@@ -286,14 +257,13 @@ void AccessibleBase::RemoveChildByOId( const ObjectIdentifier& rOId )
if( aIt == m_aChildOIDMap.end())
return;
- Reference< XAccessible > xChild( aIt->second );
+ rtl::Reference<AccessibleBase> xChild(aIt->second);
// remove from map
m_aChildOIDMap.erase( aIt );
// search child in vector
- ChildListVectorType::iterator aVecIter =
- std::find( m_aChildList.begin(), m_aChildList.end(), xChild );
+ auto aVecIter = std::find(m_aChildList.begin(), m_aChildList.end(), xChild);
OSL_ENSURE( aVecIter != m_aChildList.end(),
"Inconsistent ChildMap" );
@@ -309,15 +279,14 @@ void AccessibleBase::RemoveChildByOId( const ObjectIdentifier& rOId )
if( bInitialized )
{
Any aEmpty, aOld;
- aOld <<= xChild;
+ aOld <<= uno::Reference<XAccessible>(xChild);
- BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld );
+ NotifyAccessibleEvent(AccessibleEventId::CHILD, aOld, aEmpty);
}
// dispose the child
- Reference< lang::XComponent > xComp( xChild, UNO_QUERY );
- if( xComp.is())
- xComp->dispose();
+ if (xChild.is())
+ xChild->dispose();
}
awt::Point AccessibleBase::GetUpperLeftOnScreen() const
@@ -340,43 +309,12 @@ awt::Point AccessibleBase::GetUpperLeftOnScreen() const
return aResult;
}
-void AccessibleBase::BroadcastAccEvent(
- sal_Int16 nId,
- const Any & rNew,
- const Any & rOld,
- bool bSendGlobally ) const
-{
- ClearableMutexGuard aGuard( m_aMutex );
-
- if ( !m_nEventNotifierId && !bSendGlobally )
- return;
- // if we don't have a client id for the notifier, then we don't have listeners, then
- // we don't need to notify anything
- //except SendGlobally for focus handling?
-
- // the const cast is needed, because UNO parameters are never const
- const AccessibleEventObject aEvent(
- const_cast< uno::XWeak * >( static_cast< const uno::XWeak * >( this )),
- nId, rNew, rOld );
-
- if ( m_nEventNotifierId ) // let the notifier handle this event
- ::comphelper::AccessibleEventNotifier::addEvent( m_nEventNotifierId, aEvent );
-
- aGuard.clear();
-
- // send event to global message queue
- if( bSendGlobally )
- {
- vcl::unohelper::NotifyAccessibleStateEventGlobally( aEvent );
- }
-}
-
void AccessibleBase::KillAllChildren()
{
ClearableMutexGuard aGuard( m_aMutex );
// make local copy for notification, and remove all children
- ChildListVectorType aLocalChildList;
+ std::vector<rtl::Reference<AccessibleBase>> aLocalChildList;
aLocalChildList.swap( m_aChildList );
m_aChildOIDMap.clear();
@@ -384,16 +322,14 @@ void AccessibleBase::KillAllChildren()
// call dispose for all children
// and notify listeners
- Reference< lang::XComponent > xComp;
Any aEmpty, aOld;
for (auto const& localChild : aLocalChildList)
{
- aOld <<= localChild;
- BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld );
+ aOld <<= uno::Reference<XAccessible>(localChild);
+ NotifyAccessibleEvent(AccessibleEventId::CHILD, aOld, aEmpty);
- xComp.set(localChild, UNO_QUERY);
- if( xComp.is())
- xComp->dispose();
+ if (localChild.is())
+ localChild->dispose();
}
m_bChildrenInitialized = false;
}
@@ -405,8 +341,7 @@ void AccessibleBase::SetInfo( const AccessibleElementInfo & rNewInfo )
{
KillAllChildren();
}
- BroadcastAccEvent( AccessibleEventId::INVALIDATE_ALL_CHILDREN, uno::Any(), uno::Any(),
- true /* global notification */ );
+ NotifyAccessibleEvent(AccessibleEventId::INVALIDATE_ALL_CHILDREN, uno::Any(), uno::Any());
}
// ________ (XComponent::dispose) ________
@@ -414,26 +349,15 @@ void SAL_CALL AccessibleBase::disposing()
{
{
MutexGuard aGuard(m_aMutex);
- OSL_ENSURE(!m_bIsDisposed, "dispose() called twice");
+ OSL_ENSURE(isAlive(), "dispose() called twice");
- // notify disposing to all AccessibleEvent listeners asynchronous
- if (m_nEventNotifierId)
- {
- ::comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(m_nEventNotifierId,
- *this);
- m_nEventNotifierId = 0;
- }
+ OAccessible::disposing();
// reset pointers
+ m_aAccInfo.m_pWindow.reset();
m_aAccInfo.m_pParent = nullptr;
- // attach new empty state set helper to member reference
- rtl::Reference<::utl::AccessibleStateSetHelper> pHelper = new ::utl::AccessibleStateSetHelper();
- pHelper->AddState(AccessibleStateType::DEFUNC);
- // release old helper and attach new one
- m_xStateSetHelper = pHelper;
-
- m_bIsDisposed = true;
+ m_nStateSet = AccessibleStateType::DEFUNC;
}
// call listeners unguarded
@@ -446,18 +370,11 @@ void SAL_CALL AccessibleBase::disposing()
OSL_ENSURE( m_aChildList.empty(), "Child list should be empty" );
}
-// ________ XAccessible ________
-Reference< XAccessibleContext > SAL_CALL AccessibleBase::getAccessibleContext()
-{
- return this;
-}
-
// ________ AccessibleBase::XAccessibleContext ________
-sal_Int32 SAL_CALL AccessibleBase::getAccessibleChildCount()
+sal_Int64 SAL_CALL AccessibleBase::getAccessibleChildCount()
{
ClearableMutexGuard aGuard( m_aMutex );
- if( ! m_bMayHaveChildren ||
- m_bIsDisposed )
+ if (!m_bMayHaveChildren || !isAlive())
return 0;
bool bMustUpdateChildren = ( m_bMayHaveChildren &&
@@ -472,14 +389,14 @@ sal_Int32 SAL_CALL AccessibleBase::getAccessibleChildCount()
return ImplGetAccessibleChildCount();
}
-sal_Int32 AccessibleBase::ImplGetAccessibleChildCount() const
+sal_Int64 AccessibleBase::ImplGetAccessibleChildCount() const
{
return m_aChildList.size();
}
-Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleChild( sal_Int32 i )
+Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleChild( sal_Int64 i )
{
- CheckDisposeState();
+ ensureAlive();
Reference< XAccessible > xResult;
ClearableMutexGuard aGuard( m_aMutex );
@@ -496,9 +413,9 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleChild( sal_Int32
return xResult;
}
-Reference< XAccessible > AccessibleBase::ImplGetAccessibleChildById( sal_Int32 i ) const
+Reference< XAccessible > AccessibleBase::ImplGetAccessibleChildById( sal_Int64 i ) const
{
- Reference< XAccessible > xResult;
+ rtl::Reference<AccessibleBase> xResult;
MutexGuard aGuard( m_aMutex);
if( ! m_bMayHaveChildren ||
@@ -514,14 +431,14 @@ Reference< XAccessible > AccessibleBase::ImplGetAccessibleChildById( sal_Int32 i
throw aEx;
}
else
- xResult.set( m_aChildList[ i ] );
+ xResult = m_aChildList[i];
return xResult;
}
Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleParent()
{
- CheckDisposeState();
+ ensureAlive();
Reference< XAccessible > aResult;
if( m_aAccInfo.m_pParent )
aResult.set( m_aAccInfo.m_pParent );
@@ -529,9 +446,9 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleParent()
return aResult;
}
-sal_Int32 SAL_CALL AccessibleBase::getAccessibleIndexInParent()
+sal_Int64 SAL_CALL AccessibleBase::getAccessibleIndexInParent()
{
- CheckDisposeState();
+ ensureAlive();
if( m_aAccInfo.m_spObjectHierarchy )
return m_aAccInfo.m_spObjectHierarchy->getIndexInParent( GetId() );
@@ -549,11 +466,11 @@ Reference< XAccessibleRelationSet > SAL_CALL AccessibleBase::getAccessibleRelati
return aResult;
}
-Reference< XAccessibleStateSet > SAL_CALL AccessibleBase::getAccessibleStateSet()
+sal_Int64 SAL_CALL AccessibleBase::getAccessibleStateSet()
{
if( ! m_bStateSetInitialized )
{
- Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier );
+ rtl::Reference< ::chart::ChartController > xSelSupp( GetInfo().m_xChartController );
if ( xSelSupp.is() )
{
ObjectIdentifier aOID( xSelSupp->getSelection() );
@@ -566,36 +483,23 @@ Reference< XAccessibleStateSet > SAL_CALL AccessibleBase::getAccessibleStateSet(
m_bStateSetInitialized = true;
}
- return m_xStateSetHelper;
+ return m_nStateSet;
}
lang::Locale SAL_CALL AccessibleBase::getLocale()
{
- CheckDisposeState();
+ ensureAlive();
return Application::GetSettings().GetLanguageTag().getLocale();
}
// ________ AccessibleBase::XAccessibleComponent ________
-sal_Bool SAL_CALL AccessibleBase::containsPoint( const awt::Point& aPoint )
-{
- awt::Rectangle aRect( getBounds() );
-
- // contains() works with relative coordinates
- aRect.X = 0;
- aRect.Y = 0;
-
- return ( aPoint.X >= aRect.X &&
- aPoint.Y >= aRect.Y &&
- aPoint.X < (aRect.X + aRect.Width) &&
- aPoint.Y < (aRect.Y + aRect.Height) );
-}
Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const awt::Point& aPoint )
{
- CheckDisposeState();
- Reference< XAccessible > aResult;
- awt::Rectangle aRect( getBounds());
+ ensureAlive();
+ rtl::Reference< AccessibleBase > aResult;
+ awt::Rectangle aRect( implGetBounds());
// children are positioned relative to this object, so translate bound rect
aRect.X = 0;
@@ -606,20 +510,18 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const aw
( aRect.Y <= aPoint.Y && aPoint.Y <= (aRect.Y + aRect.Height)))
{
ClearableMutexGuard aGuard( m_aMutex );
- ChildListVectorType aLocalChildList( m_aChildList );
+ std::vector<rtl::Reference<AccessibleBase>> aLocalChildList(m_aChildList);
aGuard.clear();
- Reference< XAccessibleComponent > aComp;
- for (auto const& localChild : aLocalChildList)
+ for (const rtl::Reference<AccessibleBase>& xLocalChild : aLocalChildList)
{
- aComp.set(localChild, UNO_QUERY);
- if( aComp.is())
+ if (xLocalChild.is())
{
- aRect = aComp->getBounds();
+ aRect = xLocalChild->implGetBounds();
if( ( aRect.X <= aPoint.X && aPoint.X <= (aRect.X + aRect.Width) ) &&
( aRect.Y <= aPoint.Y && aPoint.Y <= (aRect.Y + aRect.Height)))
{
- aResult = localChild;
+ aResult = xLocalChild;
break;
}
}
@@ -629,14 +531,13 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const aw
return aResult;
}
-awt::Rectangle SAL_CALL AccessibleBase::getBounds()
+css::awt::Rectangle AccessibleBase::implGetBounds()
{
- ExplicitValueProvider *pExplicitValueProvider(
- comphelper::getFromUnoTunnel<ExplicitValueProvider>( m_aAccInfo.m_xView ));
- if( pExplicitValueProvider )
+ rtl::Reference<ChartView> pChartView = m_aAccInfo.m_xView.get();
+ if( pChartView )
{
- VclPtr<vcl::Window> pWindow( VCLUnoHelper::GetWindow( m_aAccInfo.m_xWindow ));
- awt::Rectangle aLogicRect( pExplicitValueProvider->getRectangleOfObject( m_aAccInfo.m_aOID.getObjectCID() ));
+ VclPtr<vcl::Window> pWindow = m_aAccInfo.m_pWindow;
+ awt::Rectangle aLogicRect( pChartView->getRectangleOfObject( m_aAccInfo.m_aOID.getObjectCID() ));
if( pWindow )
{
tools::Rectangle aRect( aLogicRect.X, aLogicRect.Y,
@@ -657,48 +558,18 @@ awt::Rectangle SAL_CALL AccessibleBase::getBounds()
aParentLocOnScreen.Y - aULOnScreen.Y );
return awt::Rectangle( aRect.Left() - aOffset.X, aRect.Top() - aOffset.Y,
- aRect.getWidth(), aRect.getHeight());
+ aRect.getOpenWidth(), aRect.getOpenHeight());
}
}
return awt::Rectangle();
}
-awt::Point SAL_CALL AccessibleBase::getLocation()
-{
- CheckDisposeState();
- awt::Rectangle aBBox( getBounds() );
- return awt::Point( aBBox.X, aBBox.Y );
-}
-
-awt::Point SAL_CALL AccessibleBase::getLocationOnScreen()
-{
- CheckDisposeState();
-
- if (AccessibleBase* pParent = m_aAccInfo.m_pParent)
- {
- awt::Point aLocThisRel( getLocation());
- awt::Point aUpperLeft(pParent->getLocationOnScreen());
-
- return awt::Point( aUpperLeft.X + aLocThisRel.X,
- aUpperLeft.Y + aLocThisRel.Y );
- }
- else
- return getLocation();
-}
-
-awt::Size SAL_CALL AccessibleBase::getSize()
-{
- CheckDisposeState();
- awt::Rectangle aBBox( getBounds() );
- return awt::Size( aBBox.Width, aBBox.Height );
-}
-
void SAL_CALL AccessibleBase::grabFocus()
{
- CheckDisposeState();
+ ensureAlive();
- Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier );
+ rtl::Reference< ::chart::ChartController > xSelSupp( GetInfo().m_xChartController );
if ( xSelSupp.is() )
{
xSelSupp->select( GetId().getAny() );
@@ -728,7 +599,7 @@ Color AccessibleBase::getColor( eColorType eColType )
if( eType == OBJECTTYPE_LEGEND_ENTRY )
{
// for colors get the data series/point properties
- OUString aParentParticle( ObjectIdentifier::getFullParentParticle( aObjectCID ));
+ std::u16string_view aParentParticle( ObjectIdentifier::getFullParentParticle( aObjectCID ));
aObjectCID = ObjectIdentifier::createClassifiedIdentifierForParticle( aParentParticle );
}
@@ -779,13 +650,13 @@ Color AccessibleBase::getColor( eColorType eColType )
{
if( eColType == ACC_BASE_FOREGROUND )
{
- drawing::LineStyle aLStyle;
+ drawing::LineStyle aLStyle = drawing::LineStyle_SOLID;
if( xObjProp->getPropertyValue( aStylePropName ) >>= aLStyle )
bTransparent = (aLStyle == drawing::LineStyle_NONE);
}
else
{
- drawing::FillStyle aFStyle;
+ drawing::FillStyle aFStyle = drawing::FillStyle_SOLID;
if( xObjProp->getPropertyValue( aStylePropName ) >>= aFStyle )
bTransparent = (aFStyle == drawing::FillStyle_NONE);
}
@@ -807,60 +678,6 @@ Color AccessibleBase::getColor( eColorType eColType )
return nResult;
}
-// ________ AccessibleBase::XServiceInfo ________
-OUString SAL_CALL AccessibleBase::getImplementationName()
-{
- return "AccessibleBase";
-}
-
-sal_Bool SAL_CALL AccessibleBase::supportsService( const OUString& ServiceName )
-{
- return cppu::supportsService( this, ServiceName );
-}
-
-uno::Sequence< OUString > SAL_CALL AccessibleBase::getSupportedServiceNames()
-{
- return {
- "com.sun.star.accessibility.Accessible",
- "com.sun.star.accessibility.AccessibleContext"
- };
-}
-
-// ________ AccessibleBase::XEventListener ________
-void SAL_CALL AccessibleBase::disposing( const lang::EventObject& /*Source*/ )
-{
-}
-
-// ________ XAccessibleEventBroadcasters ________
-void SAL_CALL AccessibleBase::addAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener )
-{
- MutexGuard aGuard( m_aMutex );
-
- if ( xListener.is() )
- {
- if ( !m_nEventNotifierId )
- m_nEventNotifierId = ::comphelper::AccessibleEventNotifier::registerClient();
-
- ::comphelper::AccessibleEventNotifier::addEventListener( m_nEventNotifierId, xListener );
- }
-}
-
-void SAL_CALL AccessibleBase::removeAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener )
-{
- MutexGuard aGuard( m_aMutex );
-
- if ( xListener.is() && m_nEventNotifierId)
- {
- sal_Int32 nListenerCount = ::comphelper::AccessibleEventNotifier::removeEventListener( m_nEventNotifierId, xListener );
- if ( !nListenerCount )
- {
- // no listeners anymore
- ::comphelper::AccessibleEventNotifier::revokeClient( m_nEventNotifierId );
- m_nEventNotifierId = 0;
- }
- }
-}
-
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/accessibility/AccessibleChartElement.cxx b/chart2/source/controller/accessibility/AccessibleChartElement.cxx
index 2afd4129e171..b935193abdb1 100644
--- a/chart2/source/controller/accessibility/AccessibleChartElement.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartElement.cxx
@@ -18,30 +18,23 @@
*/
#include "AccessibleChartElement.hxx"
+#include <AccessibleTextHelper.hxx>
#include <CharacterProperties.hxx>
#include <ChartModel.hxx>
+#include <ChartController.hxx>
#include <ObjectIdentifier.hxx>
#include <ObjectNameProvider.hxx>
-#include <servicenames.hxx>
-#include <ChartModel.hxx>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
-
-#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
namespace chart
{
@@ -49,7 +42,7 @@ namespace chart
AccessibleChartElement::AccessibleChartElement(
const AccessibleElementInfo & rAccInfo,
bool bMayHaveChildren ) :
- impl::AccessibleChartElement_Base( rAccInfo, bMayHaveChildren, false/*bAlwaysTransparent*/ ),
+ AccessibleBase(rAccInfo, bMayHaveChildren, false/*bAlwaysTransparent*/),
m_bHasText( false )
{
AddState( AccessibleStateType::TRANSIENT );
@@ -57,7 +50,7 @@ AccessibleChartElement::AccessibleChartElement(
AccessibleChartElement::~AccessibleChartElement()
{
- OSL_ASSERT( CheckDisposeState( false /* don't throw exceptions */ ) );
+ OSL_ASSERT(!isAlive());
}
// ________ protected ________
@@ -87,37 +80,21 @@ void AccessibleChartElement::InitTextEdit()
if( ! m_xTextHelper.is())
{
// get hard reference
- Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier );
- // get factory from selection supplier (controller)
- Reference< lang::XMultiServiceFactory > xFact( xSelSupp, uno::UNO_QUERY );
- if( xFact.is())
- {
- m_xTextHelper.set(
- xFact->createInstance( CHART_ACCESSIBLE_TEXT_SERVICE_NAME ), uno::UNO_QUERY );
- }
+ rtl::Reference< ::chart::ChartController > xChartController( GetInfo().m_xChartController );
+ if( xChartController.is())
+ m_xTextHelper = xChartController->createAccessibleTextContext();
}
if( !m_xTextHelper.is())
return;
- try
- {
- Reference< lang::XInitialization > xInit( m_xTextHelper, uno::UNO_QUERY_THROW );
- Sequence< uno::Any > aArgs{ uno::Any(GetInfo().m_aOID.getObjectCID()),
- uno::Any(Reference< XAccessible >( this )),
- uno::Any(Reference< awt::XWindow >( GetInfo().m_xWindow )) };
- xInit->initialize( aArgs );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
+ m_xTextHelper->initialize(GetInfo().m_aOID.getObjectCID(), this, GetInfo().m_pWindow);
}
// Interfaces
// ________ AccessibleBase::XAccessibleContext ________
-Reference< XAccessible > AccessibleChartElement::ImplGetAccessibleChildById( sal_Int32 i ) const
+Reference< XAccessible > AccessibleChartElement::ImplGetAccessibleChildById( sal_Int64 i ) const
{
Reference< XAccessible > xResult;
@@ -129,7 +106,7 @@ Reference< XAccessible > AccessibleChartElement::ImplGetAccessibleChildById( sal
return xResult;
}
-sal_Int32 AccessibleChartElement::ImplGetAccessibleChildCount() const
+sal_Int64 AccessibleChartElement::ImplGetAccessibleChildCount() const
{
if( m_bHasText )
{
@@ -141,12 +118,6 @@ sal_Int32 AccessibleChartElement::ImplGetAccessibleChildCount() const
return AccessibleBase::ImplGetAccessibleChildCount();
}
-// ________ XServiceInfo ________
-OUString SAL_CALL AccessibleChartElement::getImplementationName()
-{
- return "AccessibleChartElement";
-}
-
// ________ AccessibleChartElement::XAccessibleContext (override) ________
OUString SAL_CALL AccessibleChartElement::getAccessibleName()
{
@@ -161,85 +132,15 @@ OUString SAL_CALL AccessibleChartElement::getAccessibleDescription()
}
// ________ AccessibleChartElement::XAccessibleExtendedComponent ________
-Reference< awt::XFont > SAL_CALL AccessibleChartElement::getFont()
-{
- CheckDisposeState();
-
- Reference< awt::XFont > xFont;
- Reference< awt::XDevice > xDevice( Reference< awt::XWindow >( GetInfo().m_xWindow ), uno::UNO_QUERY );
-
- if( xDevice.is())
- {
- Reference< beans::XMultiPropertySet > xObjProp(
- ObjectIdentifier::getObjectPropertySet(
- GetInfo().m_aOID.getObjectCID(), GetInfo().m_xChartDocument ), uno::UNO_QUERY );
- awt::FontDescriptor aDescr(
- CharacterProperties::createFontDescriptorFromPropertySet( xObjProp ));
- xFont = xDevice->getFont( aDescr );
- }
-
- return xFont;
-}
-
-OUString SAL_CALL AccessibleChartElement::getTitledBorderText()
-{
- return OUString();
-}
OUString SAL_CALL AccessibleChartElement::getToolTipText()
{
- CheckDisposeState();
+ ensureAlive();
return ObjectNameProvider::getHelpText(
GetInfo().m_aOID.getObjectCID(), GetInfo().m_xChartDocument );
}
-// ________ XAccessibleComponent ________
-sal_Bool SAL_CALL AccessibleChartElement::containsPoint( const awt::Point& aPoint )
-{
- return AccessibleBase::containsPoint( aPoint );
-}
-
-Reference< XAccessible > SAL_CALL AccessibleChartElement::getAccessibleAtPoint( const awt::Point& aPoint )
-{
- return AccessibleBase::getAccessibleAtPoint( aPoint );
-}
-
-awt::Rectangle SAL_CALL AccessibleChartElement::getBounds()
-{
- return AccessibleBase::getBounds();
-}
-
-awt::Point SAL_CALL AccessibleChartElement::getLocation()
-{
- return AccessibleBase::getLocation();
-}
-
-awt::Point SAL_CALL AccessibleChartElement::getLocationOnScreen()
-{
- return AccessibleBase::getLocationOnScreen();
-}
-
-awt::Size SAL_CALL AccessibleChartElement::getSize()
-{
- return AccessibleBase::getSize();
-}
-
-void SAL_CALL AccessibleChartElement::grabFocus()
-{
- return AccessibleBase::grabFocus();
-}
-
-sal_Int32 SAL_CALL AccessibleChartElement::getForeground()
-{
- return AccessibleBase::getForeground();
-}
-
-sal_Int32 SAL_CALL AccessibleChartElement::getBackground()
-{
- return AccessibleBase::getBackground();
-}
-
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/accessibility/AccessibleChartElement.hxx b/chart2/source/controller/accessibility/AccessibleChartElement.hxx
index 12982db8faa1..4594a240bcb3 100644
--- a/chart2/source/controller/accessibility/AccessibleChartElement.hxx
+++ b/chart2/source/controller/accessibility/AccessibleChartElement.hxx
@@ -19,14 +19,12 @@
#pragma once
#include <AccessibleBase.hxx>
-#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
namespace com::sun::star::accessibility { class XAccessible; }
-namespace com::sun::star::accessibility { class XAccessibleContext; }
-namespace com::sun::star::awt { class XFont; }
namespace chart
{
+class AccessibleTextHelper;
/** Base class for all Chart Accessibility objects except the root node (see AccessibleChartView)
@@ -42,16 +40,7 @@ namespace chart
</ul>
*/
-namespace impl
-{
-typedef ::cppu::ImplInheritanceHelper<
- AccessibleBase,
- css::accessibility::XAccessibleExtendedComponent
- > AccessibleChartElement_Base;
-}
-
-class AccessibleChartElement :
- public impl::AccessibleChartElement_Base
+class AccessibleChartElement : public AccessibleBase
{
public:
AccessibleChartElement( const AccessibleElementInfo & rAccInfo,
@@ -61,39 +50,19 @@ public:
// ________ AccessibleBase ________
virtual bool ImplUpdateChildren() override;
virtual css::uno::Reference< css::accessibility::XAccessible >
- ImplGetAccessibleChildById( sal_Int32 i ) const override;
- virtual sal_Int32 ImplGetAccessibleChildCount() const override;
+ ImplGetAccessibleChildById( sal_Int64 i ) const override;
+ virtual sal_Int64 ImplGetAccessibleChildCount() const override;
// ________ XAccessibleContext ________
virtual OUString SAL_CALL getAccessibleName() override;
virtual OUString SAL_CALL getAccessibleDescription() override;
// ________ XAccessibleExtendedComponent ________
- virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override;
- virtual OUString SAL_CALL getTitledBorderText() override;
virtual OUString SAL_CALL getToolTipText() override;
- // the following interface is implemented in AccessibleBase, however it is
- // also a (non-virtual) base class of XAccessibleExtendedComponent Thus
- // these methods have to be overridden and forward to AccessibleBase
-
- // ________ XAccessibleComponent ________
- virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override;
- virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
- virtual css::awt::Rectangle SAL_CALL getBounds() override;
- virtual css::awt::Point SAL_CALL getLocation() override;
- virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
- virtual css::awt::Size SAL_CALL getSize() override;
- virtual void SAL_CALL grabFocus() override;
- virtual sal_Int32 SAL_CALL getForeground() override;
- virtual sal_Int32 SAL_CALL getBackground() override;
-
- // ________ XServiceInfo ________
- virtual OUString SAL_CALL getImplementationName() override;
-
private:
bool m_bHasText;
- css::uno::Reference< css::accessibility::XAccessibleContext >
+ rtl::Reference< ::chart::AccessibleTextHelper >
m_xTextHelper;
void InitTextEdit();
diff --git a/chart2/source/controller/accessibility/AccessibleChartShape.cxx b/chart2/source/controller/accessibility/AccessibleChartShape.cxx
index 73ff2e9c0ca8..7deb39b447e5 100644
--- a/chart2/source/controller/accessibility/AccessibleChartShape.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartShape.cxx
@@ -35,7 +35,7 @@ namespace chart
AccessibleChartShape::AccessibleChartShape(
const AccessibleElementInfo& rAccInfo )
- :impl::AccessibleChartShape_Base( rAccInfo, true/*bMayHaveChildren*/, false/*bAlwaysTransparent*/ )
+ :AccessibleBase(rAccInfo, true/*bMayHaveChildren*/, false/*bAlwaysTransparent*/)
{
if ( !rAccInfo.m_aOID.isAdditionalShape() )
return;
@@ -50,7 +50,7 @@ AccessibleChartShape::AccessibleChartShape(
m_aShapeTreeInfo.SetSdrView( rAccInfo.m_pSdrView );
m_aShapeTreeInfo.SetController( nullptr );
- m_aShapeTreeInfo.SetWindow( VCLUnoHelper::GetWindow( rAccInfo.m_xWindow ) );
+ m_aShapeTreeInfo.SetWindow(rAccInfo.m_pWindow);
m_aShapeTreeInfo.SetViewForwarder( rAccInfo.m_pViewForwarder );
::accessibility::ShapeTypeHandler& rShapeHandler = ::accessibility::ShapeTypeHandler::Instance();
@@ -63,7 +63,7 @@ AccessibleChartShape::AccessibleChartShape(
AccessibleChartShape::~AccessibleChartShape()
{
- OSL_ASSERT( CheckDisposeState( false /* don't throw exceptions */ ) );
+ OSL_ASSERT(!isAlive());
if ( m_pAccShape.is() )
{
@@ -71,16 +71,10 @@ AccessibleChartShape::~AccessibleChartShape()
}
}
-// ________ XServiceInfo ________
-OUString AccessibleChartShape::getImplementationName()
-{
- return "AccessibleChartShape";
-}
-
// ________ XAccessibleContext ________
-sal_Int32 AccessibleChartShape::getAccessibleChildCount()
+sal_Int64 AccessibleChartShape::getAccessibleChildCount()
{
- sal_Int32 nCount(0);
+ sal_Int64 nCount(0);
if ( m_pAccShape.is() )
{
nCount = m_pAccShape->getAccessibleChildCount();
@@ -88,7 +82,7 @@ sal_Int32 AccessibleChartShape::getAccessibleChildCount()
return nCount;
}
-Reference< XAccessible > AccessibleChartShape::getAccessibleChild( sal_Int32 i )
+Reference< XAccessible > AccessibleChartShape::getAccessibleChild( sal_Int64 i )
{
Reference< XAccessible > xChild;
if ( m_pAccShape.is() )
@@ -129,15 +123,6 @@ OUString AccessibleChartShape::getAccessibleName()
}
// ________ XAccessibleComponent ________
-sal_Bool AccessibleChartShape::containsPoint( const awt::Point& aPoint )
-{
- bool bReturn = false;
- if ( m_pAccShape.is() )
- {
- bReturn = m_pAccShape->containsPoint( aPoint );
- }
- return bReturn;
-}
Reference< XAccessible > AccessibleChartShape::getAccessibleAtPoint( const awt::Point& aPoint )
{
@@ -149,7 +134,7 @@ Reference< XAccessible > AccessibleChartShape::getAccessibleAtPoint( const awt::
return xResult;
}
-awt::Rectangle AccessibleChartShape::getBounds()
+awt::Rectangle AccessibleChartShape::implGetBounds()
{
awt::Rectangle aBounds;
if ( m_pAccShape.is() )
@@ -159,41 +144,6 @@ awt::Rectangle AccessibleChartShape::getBounds()
return aBounds;
}
-awt::Point AccessibleChartShape::getLocation()
-{
- awt::Point aLocation;
- if ( m_pAccShape.is() )
- {
- aLocation = m_pAccShape->getLocation();
- }
- return aLocation;
-}
-
-awt::Point AccessibleChartShape::getLocationOnScreen()
-{
- awt::Point aLocation;
- if ( m_pAccShape.is() )
- {
- aLocation = m_pAccShape->getLocationOnScreen();
- }
- return aLocation;
-}
-
-awt::Size AccessibleChartShape::getSize()
-{
- awt::Size aSize;
- if ( m_pAccShape.is() )
- {
- aSize = m_pAccShape->getSize();
- }
- return aSize;
-}
-
-void AccessibleChartShape::grabFocus()
-{
- return AccessibleBase::grabFocus();
-}
-
sal_Int32 AccessibleChartShape::getForeground()
{
sal_Int32 nColor(0);
@@ -215,15 +165,6 @@ sal_Int32 AccessibleChartShape::getBackground()
}
// ________ XAccessibleExtendedComponent ________
-Reference< awt::XFont > AccessibleChartShape::getFont()
-{
- Reference< awt::XFont > xFont;
- if ( m_pAccShape.is() )
- {
- xFont.set( m_pAccShape->getFont() );
- }
- return xFont;
-}
OUString AccessibleChartShape::getTitledBorderText()
{
diff --git a/chart2/source/controller/accessibility/AccessibleChartShape.hxx b/chart2/source/controller/accessibility/AccessibleChartShape.hxx
index 4377929fa41d..db169bd3b5c1 100644
--- a/chart2/source/controller/accessibility/AccessibleChartShape.hxx
+++ b/chart2/source/controller/accessibility/AccessibleChartShape.hxx
@@ -20,7 +20,6 @@
#include <AccessibleBase.hxx>
-#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
#include <cppuhelper/implbase.hxx>
#include <svx/AccessibleShapeTreeInfo.hxx>
@@ -32,44 +31,29 @@ class AccessibleShape;
namespace chart
{
-namespace impl
-{
-typedef ::cppu::ImplInheritanceHelper<
- AccessibleBase,
- css::accessibility::XAccessibleExtendedComponent > AccessibleChartShape_Base;
-}
-
-class AccessibleChartShape :
- public impl::AccessibleChartShape_Base
+class AccessibleChartShape : public AccessibleBase
{
public:
explicit AccessibleChartShape( const AccessibleElementInfo& rAccInfo );
virtual ~AccessibleChartShape() override;
- // ________ XServiceInfo ________
- virtual OUString SAL_CALL getImplementationName() override;
-
// ________ XAccessibleContext ________
- virtual sal_Int32 SAL_CALL getAccessibleChildCount() override;
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
- getAccessibleChild( sal_Int32 i ) override;
+ getAccessibleChild( sal_Int64 i ) override;
virtual sal_Int16 SAL_CALL getAccessibleRole() override;
virtual OUString SAL_CALL getAccessibleDescription() override;
virtual OUString SAL_CALL getAccessibleName() override;
+ // OAccessible
+ virtual css::awt::Rectangle implGetBounds() override;
+
// ________ XAccessibleComponent ________
- virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override;
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
- virtual css::awt::Rectangle SAL_CALL getBounds() override;
- virtual css::awt::Point SAL_CALL getLocation() override;
- virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
- virtual css::awt::Size SAL_CALL getSize() override;
- virtual void SAL_CALL grabFocus() override;
virtual sal_Int32 SAL_CALL getForeground() override;
virtual sal_Int32 SAL_CALL getBackground() override;
// ________ XAccessibleExtendedComponent ________
- virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override;
virtual OUString SAL_CALL getTitledBorderText() override;
virtual OUString SAL_CALL getToolTipText() override;
diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx
index c0dac3c22657..7216c6bbc665 100644
--- a/chart2/source/controller/accessibility/AccessibleChartView.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx
@@ -18,20 +18,18 @@
*/
#include <AccessibleChartView.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
#include <ObjectHierarchy.hxx>
#include <ObjectIdentifier.hxx>
#include <ResId.hxx>
#include <strings.hrc>
#include "AccessibleViewForwarder.hxx"
#include <ChartModel.hxx>
+#include <ChartView.hxx>
+#include <ChartController.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-
-#include <comphelper/servicehelper.hxx>
#include <rtl/ustring.hxx>
#include <vcl/window.hxx>
@@ -42,22 +40,19 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
-using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::WeakReference;
-using ::com::sun::star::uno::Any;
using osl::MutexGuard;
namespace chart
{
-AccessibleChartView::AccessibleChartView(SdrView* pView ) :
- impl::AccessibleChartView_Base(
- AccessibleElementInfo(), // empty for now
- true, // has children
- true // always transparent
- ),
- m_pSdrView( pView )
+AccessibleChartView::AccessibleChartView(SdrView* pView)
+ : ImplInheritanceHelper(AccessibleElementInfo(), // empty for now
+ true, // has children
+ true // always transparent
+ )
+ , m_pSdrView(pView)
{
AddState( AccessibleStateType::OPAQUE );
}
@@ -68,20 +63,19 @@ AccessibleChartView::~AccessibleChartView()
awt::Rectangle AccessibleChartView::GetWindowPosSize() const
{
- Reference< awt::XWindow > xWindow( GetInfo().m_xWindow );
- if( ! xWindow.is())
- return awt::Rectangle();
+ SolarMutexGuard aSolarGuard;
- awt::Rectangle aBBox( xWindow->getPosSize() );
+ VclPtr<vcl::Window> pWindow = GetInfo().m_pWindow;
+ if (!pWindow)
+ return awt::Rectangle();
- VclPtr<vcl::Window> pWindow( VCLUnoHelper::GetWindow( GetInfo().m_xWindow ));
- if( pWindow )
- {
- SolarMutexGuard aSolarGuard;
- Point aVCLPoint( pWindow->OutputToAbsoluteScreenPixel( Point( 0, 0 ) ));
- aBBox.X = aVCLPoint.getX();
- aBBox.Y = aVCLPoint.getY();
- }
+ awt::Rectangle aBBox;
+ Point aVCLPoint( pWindow->OutputToAbsoluteScreenPixel( Point( 0, 0 ) ));
+ const Size aSize = pWindow->GetSizePixel();
+ aBBox.X = aVCLPoint.getX();
+ aBBox.Y = aVCLPoint.getY();
+ aBBox.Width = aSize.Width();
+ aBBox.Height = aSize.Height();
return aBBox;
}
@@ -113,7 +107,7 @@ Reference< XAccessible > SAL_CALL AccessibleChartView::getAccessibleParent()
return Reference< XAccessible >( m_xParent );
}
-sal_Int32 SAL_CALL AccessibleChartView::getAccessibleIndexInParent()
+sal_Int64 SAL_CALL AccessibleChartView::getAccessibleIndexInParent()
{
// the document is always the only child of the window
return 0;
@@ -124,8 +118,7 @@ sal_Int16 SAL_CALL AccessibleChartView::getAccessibleRole()
return AccessibleRole::DOCUMENT;
}
-// ________ XAccessibleComponent ________
-awt::Rectangle SAL_CALL AccessibleChartView::getBounds()
+awt::Rectangle AccessibleChartView::implGetBounds()
{
awt::Rectangle aResult( GetWindowPosSize());
Reference< XAccessible > xParent( m_xParent );
@@ -142,25 +135,19 @@ awt::Rectangle SAL_CALL AccessibleChartView::getBounds()
return aResult;
}
-awt::Point SAL_CALL AccessibleChartView::getLocationOnScreen()
+
+void SAL_CALL AccessibleChartView::disposing()
{
- awt::Rectangle aBounds( getBounds());
- awt::Point aResult;
- Reference< XAccessible > xParent( m_xParent );
- if( xParent.is())
- {
- Reference< XAccessibleComponent > xAccComp(
- xParent->getAccessibleContext(), uno::UNO_QUERY );
- aResult = xAccComp->getLocationOnScreen();
- aResult.X += aBounds.X;
- aResult.Y += aBounds.Y;
- }
- return aResult;
-}
+ m_pChartWindow.reset();
-// lang::XInitialization
+ AccessibleBase::disposing();
+}
-void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments )
+void AccessibleChartView::initialize( ChartController& rNewChartController,
+ const rtl::Reference<::chart::ChartModel>& xNewChartModel,
+ const rtl::Reference<::chart::ChartView>& xNewChartView,
+ const uno::Reference< XAccessible >& xNewParent,
+ ChartWindow* pNewChartWindow)
{
//0: view::XSelectionSupplier offers notifications for selection changes and access to the selection itself
//1: frame::XModel representing the chart model - offers access to object data
@@ -171,125 +158,170 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments
bool bOldInvalid = false;
bool bNewInvalid = false;
- Reference< view::XSelectionSupplier > xSelectionSupplier;
+ rtl::Reference< ::chart::ChartController > xChartController;
rtl::Reference<::chart::ChartModel> xChartModel;
- Reference< uno::XInterface > xChartView;
+ rtl::Reference<::chart::ChartView> xChartView;
Reference< XAccessible > xParent;
- Reference< awt::XWindow > xWindow;
+ VclPtr<ChartWindow> pChartWindow;
{
MutexGuard aGuard( m_aMutex);
- xSelectionSupplier.set( m_xSelectionSupplier );
+ xChartController = m_xChartController;
xChartModel = m_xChartModel;
- xChartView.set( m_xChartView );
+ xChartView = m_xChartView;
xParent.set( m_xParent );
- xWindow.set( m_xWindow );
+ pChartWindow = m_pChartWindow;
}
- if( !xSelectionSupplier.is() || !xChartModel.is() || !xChartView.is() )
+ if( !xChartController.is() || !xChartModel.is() || !xChartView.is() )
{
bOldInvalid = true;
}
- if( rArguments.getLength() > 1 )
+ if( xNewChartModel.get() != xChartModel.get() )
{
- Reference< frame::XModel > xNewChartModel;
- rArguments[1] >>= xNewChartModel;
- assert(!xNewChartModel || dynamic_cast<::chart::ChartModel*>(xNewChartModel.get()));
- ::chart::ChartModel* pNewChartModel = dynamic_cast<::chart::ChartModel*>(xNewChartModel.get());
- if( pNewChartModel != xChartModel.get() )
- {
- xChartModel = pNewChartModel;
- bChanged = true;
- }
+ xChartModel = xNewChartModel;
+ bChanged = true;
}
- else if( xChartModel.is() )
+
+ if( xNewChartView != xChartView )
{
+ xChartView = xNewChartView;
bChanged = true;
- xChartModel = nullptr;
}
- if( rArguments.getLength() > 2 )
+ if( xNewParent != xParent )
{
- Reference< uno::XInterface > xNewChartView;
- rArguments[2] >>= xNewChartView;
- if( xNewChartView != xChartView )
- {
- xChartView = xNewChartView;
- bChanged = true;
- }
+ xParent = xNewParent;
+ bChanged = true;
}
- else if( xChartView.is() )
+
+ if (pNewChartWindow != pChartWindow)
{
+ pChartWindow = pNewChartWindow;
bChanged = true;
- xChartView = nullptr;
}
- if( rArguments.getLength() > 3 )
+ if(xChartController != &rNewChartController)
{
- Reference< XAccessible > xNewParent;
- rArguments[3] >>= xNewParent;
- if( xNewParent != xParent )
- {
- xParent = xNewParent;
- bChanged = true;
- }
+ if (xChartController)
+ xChartController->removeSelectionChangeListener(this);
+ rNewChartController.addSelectionChangeListener(this);
+ xChartController = &rNewChartController;
+ bChanged = true;
}
- if( rArguments.getLength() > 4 )
+ if( !xChartController.is() || !xChartModel.is() || !xChartView.is() )
{
- Reference< awt::XWindow > xNewWindow;
- rArguments[4] >>= xNewWindow;
- if( xNewWindow != xWindow )
+ if(xChartController.is())
{
- xWindow.set( xNewWindow );
- bChanged = true;
+ xChartController->removeSelectionChangeListener(this);
+ xChartController.clear();
}
+ xChartModel.clear();
+ xChartView.clear();
+ xParent.clear();
+ pChartWindow.reset();
+
+ bNewInvalid = true;
}
- if( rArguments.hasElements() && xChartModel.is() && xChartView.is() )
{
- Reference< view::XSelectionSupplier > xNewSelectionSupplier;
- rArguments[0] >>= xNewSelectionSupplier;
- if(xSelectionSupplier!=xNewSelectionSupplier)
- {
- bChanged = true;
- if(xSelectionSupplier.is())
- xSelectionSupplier->removeSelectionChangeListener(this);
- if(xNewSelectionSupplier.is())
- xNewSelectionSupplier->addSelectionChangeListener(this);
- xSelectionSupplier = xNewSelectionSupplier;
- }
+ MutexGuard aGuard( m_aMutex);
+ m_xChartController = xChartController.get();
+ m_xChartModel = xChartModel.get();
+ m_xChartView = xChartView.get();
+ m_xParent = xParent;
+ m_pChartWindow = std::move(pChartWindow);
}
- else if( xSelectionSupplier.is() )
+
+ if( bOldInvalid && bNewInvalid )
+ bChanged = false;
+
+ if( !bChanged )
+ return;
+
+ {
+ //before notification we prepare for creation of new context
+ //the old context will be deleted after notification than
+ MutexGuard aGuard( m_aMutex);
+ if( xChartModel.is())
+ m_spObjectHierarchy =
+ std::make_shared<ObjectHierarchy>( xChartModel, m_xChartView.get().get() );
+ else
+ m_spObjectHierarchy.reset();
+ }
+
+ {
+ AccessibleElementInfo aAccInfo;
+ aAccInfo.m_aOID = ObjectIdentifier(u"ROOT"_ustr);
+ aAccInfo.m_xChartDocument = m_xChartModel;
+ aAccInfo.m_xChartController = m_xChartController;
+ aAccInfo.m_xView = m_xChartView;
+ aAccInfo.m_pWindow = m_pChartWindow;
+ aAccInfo.m_pParent = nullptr;
+ aAccInfo.m_spObjectHierarchy = m_spObjectHierarchy;
+ aAccInfo.m_pSdrView = m_pSdrView;
+ m_pViewForwarder.reset(new AccessibleViewForwarder(this, m_pChartWindow));
+ aAccInfo.m_pViewForwarder = m_pViewForwarder.get();
+ // broadcasts an INVALIDATE_ALL_CHILDREN event globally
+ SetInfo( aAccInfo );
+ }
+}
+
+void AccessibleChartView::initialize()
+{
+ //0: view::XSelectionSupplier offers notifications for selection changes and access to the selection itself
+ //1: frame::XModel representing the chart model - offers access to object data
+ //2: lang::XInterface representing the normal chart view - offers access to some extra object data
+
+ //all arguments are only valid until next initialization
+ bool bChanged = false;
+ bool bOldInvalid = false;
+
+ rtl::Reference< ::chart::ChartController > xChartController;
+ rtl::Reference<::chart::ChartModel> xChartModel;
+ rtl::Reference<::chart::ChartView> xChartView;
+ {
+ MutexGuard aGuard( m_aMutex);
+ xChartController = m_xChartController;
+ xChartModel = m_xChartModel;
+ xChartView = m_xChartView;
+ }
+
+ if( !xChartController.is() || !xChartModel.is() || !xChartView.is() )
+ {
+ bOldInvalid = true;
+ }
+
+ if( xChartModel.is() )
{
bChanged = true;
- xSelectionSupplier->removeSelectionChangeListener(this);
- xSelectionSupplier = nullptr;
+ xChartModel = nullptr;
}
- if( !xSelectionSupplier.is() || !xChartModel.is() || !xChartView.is() )
+ if( xChartView.is() )
{
- if(xSelectionSupplier.is())
- xSelectionSupplier->removeSelectionChangeListener(this);
- xSelectionSupplier = nullptr;
- xChartModel.clear();
- xChartView.clear();
- xParent.clear();
- xWindow.clear();
+ bChanged = true;
+ xChartView = nullptr;
+ }
- bNewInvalid = true;
+ if( xChartController.is() )
+ {
+ bChanged = true;
+ xChartController->removeSelectionChangeListener(this);
+ xChartController = nullptr;
}
{
MutexGuard aGuard( m_aMutex);
- m_xSelectionSupplier = WeakReference< view::XSelectionSupplier >(xSelectionSupplier);
+ m_xChartController = xChartController.get();
m_xChartModel = xChartModel.get();
- m_xChartView = WeakReference< uno::XInterface >(xChartView);
- m_xParent = WeakReference< XAccessible >(xParent);
- m_xWindow = WeakReference< awt::XWindow >(xWindow);
+ m_xChartView = xChartView.get();
+ m_xParent.clear();
+ m_pChartWindow.reset();
}
- if( bOldInvalid && bNewInvalid )
+ if( bOldInvalid )
bChanged = false;
if( !bChanged )
@@ -301,23 +333,22 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments
MutexGuard aGuard( m_aMutex);
if( xChartModel.is())
m_spObjectHierarchy =
- std::make_shared<ObjectHierarchy>( xChartModel, comphelper::getFromUnoTunnel<ExplicitValueProvider>(m_xChartView) );
+ std::make_shared<ObjectHierarchy>( xChartModel, m_xChartView.get().get() );
else
m_spObjectHierarchy.reset();
}
{
AccessibleElementInfo aAccInfo;
- aAccInfo.m_aOID = ObjectIdentifier("ROOT");
+ aAccInfo.m_aOID = ObjectIdentifier(u"ROOT"_ustr);
aAccInfo.m_xChartDocument = m_xChartModel;
- aAccInfo.m_xSelectionSupplier = m_xSelectionSupplier;
+ aAccInfo.m_xChartController = m_xChartController;
aAccInfo.m_xView = m_xChartView;
- aAccInfo.m_xWindow = m_xWindow;
+ aAccInfo.m_pWindow.reset();
aAccInfo.m_pParent = nullptr;
aAccInfo.m_spObjectHierarchy = m_spObjectHierarchy;
aAccInfo.m_pSdrView = m_pSdrView;
- VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( m_xWindow );
- m_pViewForwarder.reset( new AccessibleViewForwarder( this, pWindow ) );
+ m_pViewForwarder.reset(new AccessibleViewForwarder(this, nullptr));
aAccInfo.m_pViewForwarder = m_pViewForwarder.get();
// broadcasts an INVALIDATE_ALL_CHILDREN event globally
SetInfo( aAccInfo );
@@ -328,16 +359,16 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments
void SAL_CALL AccessibleChartView::selectionChanged( const lang::EventObject& /*rEvent*/ )
{
- Reference< view::XSelectionSupplier > xSelectionSupplier;
+ rtl::Reference< ::chart::ChartController > xChartController;
{
MutexGuard aGuard( m_aMutex);
- xSelectionSupplier.set(m_xSelectionSupplier);
+ xChartController = m_xChartController.get();
}
- if( !xSelectionSupplier.is() )
+ if( !xChartController.is() )
return;
- ObjectIdentifier aSelectedOID( xSelectionSupplier->getSelection() );
+ ObjectIdentifier aSelectedOID( xChartController->getSelection() );
if ( m_aCurrentSelectionOID.isValid() )
{
NotifyEvent( EventType::LOST_SELECTION, m_aCurrentSelectionOID );
@@ -346,7 +377,7 @@ void SAL_CALL AccessibleChartView::selectionChanged( const lang::EventObject& /*
{
NotifyEvent( EventType::GOT_SELECTION, aSelectedOID );
}
- m_aCurrentSelectionOID = aSelectedOID;
+ m_aCurrentSelectionOID = std::move(aSelectedOID);
}
// XEventListener
diff --git a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
index 2a58d9484f17..b58cb1c62294 100644
--- a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
+++ b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
@@ -39,7 +39,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
namespace chart
{
@@ -53,64 +52,52 @@ AccessibleTextHelper::~AccessibleTextHelper()
{
}
-// ____ XInitialization ____
-void SAL_CALL AccessibleTextHelper::initialize( const Sequence< uno::Any >& aArguments )
+void AccessibleTextHelper::initialize(const OUString& aCID,
+ const rtl::Reference<comphelper::OAccessible>& rEventSource,
+ vcl::Window* pWindow)
{
- OUString aCID;
- Reference< XAccessible > xEventSource;
- Reference< awt::XWindow > xWindow;
-
- if( aArguments.getLength() >= 3 )
- {
- aArguments[0] >>= aCID;
- aArguments[1] >>= xEventSource;
- aArguments[2] >>= xWindow;
- }
OSL_ENSURE( !aCID.isEmpty(), "Empty CID" );
- OSL_ENSURE( xEventSource.is(), "Empty Event Source" );
- OSL_ENSURE( xWindow.is(), "Empty Window" );
- if( !xEventSource.is() || aCID.isEmpty() )
+ assert(rEventSource.is() && "Empty Event Source");
+ if (aCID.isEmpty())
return;
SolarMutexGuard aSolarGuard;
- m_pTextHelper.reset();
+ m_oTextHelper.reset();
- VclPtr<vcl::Window> pWindow( VCLUnoHelper::GetWindow( xWindow ));
if( pWindow )
{
- SdrView * pView = m_pDrawViewWrapper;
- if( pView )
+ if (m_pDrawViewWrapper)
{
SdrObject * pTextObj = m_pDrawViewWrapper->getNamedSdrObject( aCID );
if( pTextObj )
{
- m_pTextHelper.reset( new ::accessibility::AccessibleTextHelper(std::make_unique<SvxTextEditSource>(*pTextObj, nullptr, *pView, *pWindow->GetOutDev())) );
- m_pTextHelper->SetEventSource( xEventSource );
+ m_oTextHelper.emplace(std::make_unique<SvxTextEditSource>(*pTextObj, nullptr, *m_pDrawViewWrapper, *pWindow->GetOutDev()));
+ m_oTextHelper->SetEventSource(rEventSource);
}
}
}
- OSL_ENSURE( m_pTextHelper, "Couldn't create text helper" );
+ OSL_ENSURE( m_oTextHelper, "Couldn't create text helper" );
}
// ____ XAccessibleContext ____
-::sal_Int32 SAL_CALL AccessibleTextHelper::getAccessibleChildCount()
+sal_Int64 SAL_CALL AccessibleTextHelper::getAccessibleChildCount()
{
- if( m_pTextHelper )
+ if( m_oTextHelper )
{
SolarMutexGuard aSolarGuard;
- return m_pTextHelper->GetChildCount();
+ return m_oTextHelper->GetChildCount();
}
return 0;
}
-Reference< XAccessible > SAL_CALL AccessibleTextHelper::getAccessibleChild( ::sal_Int32 i )
+Reference< XAccessible > SAL_CALL AccessibleTextHelper::getAccessibleChild( sal_Int64 i )
{
- if( m_pTextHelper )
+ if( m_oTextHelper )
{
SolarMutexGuard aSolarGuard;
- return m_pTextHelper->GetChild( i );
+ return m_oTextHelper->GetChild( i );
}
return Reference< XAccessible >();
}
@@ -121,7 +108,7 @@ Reference< XAccessible > SAL_CALL AccessibleTextHelper::getAccessibleParent()
return Reference< XAccessible >();
}
-::sal_Int32 SAL_CALL AccessibleTextHelper::getAccessibleIndexInParent()
+sal_Int64 SAL_CALL AccessibleTextHelper::getAccessibleIndexInParent()
{
OSL_FAIL( "Not implemented in this helper" );
return -1;
@@ -151,10 +138,10 @@ Reference< XAccessibleRelationSet > SAL_CALL AccessibleTextHelper::getAccessible
return Reference< XAccessibleRelationSet >();
}
-Reference< XAccessibleStateSet > SAL_CALL AccessibleTextHelper::getAccessibleStateSet()
+sal_Int64 SAL_CALL AccessibleTextHelper::getAccessibleStateSet()
{
OSL_FAIL( "Not implemented in this helper" );
- return Reference< XAccessibleStateSet >();
+ return 0;
}
lang::Locale SAL_CALL AccessibleTextHelper::getLocale()
diff --git a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
index 31395f1181dc..dbd8ac0d51f2 100644
--- a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
+++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
@@ -45,9 +45,9 @@ tools::Rectangle AccessibleViewForwarder::GetVisibleArea() const
tools::Rectangle aVisibleArea;
if ( m_pWindow )
{
- aVisibleArea.SetPos( Point( 0, 0 ) );
- aVisibleArea.SetSize( m_pWindow->GetOutputSizePixel() );
- aVisibleArea = m_pWindow->PixelToLogic( aVisibleArea, m_aMapMode );
+ aVisibleArea = m_pWindow->PixelToLogic(
+ tools::Rectangle( Point( 0, 0 ), m_pWindow->GetOutputSizePixel() ),
+ m_aMapMode );
}
return aVisibleArea;
}
diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
index 7cbef7d67e2c..11884859927a 100644
--- a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
@@ -20,7 +20,6 @@
#include "AreaWrapper.hxx"
#include "Chart2ModelContact.hxx"
#include <WrappedDirectStateProperty.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -29,51 +28,18 @@
#include <UserDefinedProperties.hxx>
#include <algorithm>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::beans::Property;
-using ::osl::MutexGuard;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-namespace
-{
-
-struct StaticAreaWrapperPropertyArray_Initializer
-{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticAreaWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAreaWrapperPropertyArray_Initializer >
-{
-};
-
-} // anonymous namespace
-
namespace chart::wrapper
{
-AreaWrapper::AreaWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact(spChart2ModelContact)
- , m_aEventListenerContainer(m_aMutex)
+AreaWrapper::AreaWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact(std::move(spChart2ModelContact))
{
}
@@ -104,29 +70,31 @@ void SAL_CALL AreaWrapper::setSize( const awt::Size& /*aSize*/ )
// ____ XShapeDescriptor (base of XShape) ____
OUString SAL_CALL AreaWrapper::getShapeType()
{
- return "com.sun.star.chart.ChartArea";
+ return u"com.sun.star.chart.ChartArea"_ustr;
}
// ____ XComponent ____
void SAL_CALL AreaWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
- MutexGuard aGuard( m_aMutex);
clearWrappedPropertySet();
}
void SAL_CALL AreaWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL AreaWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
// WrappedPropertySet
@@ -141,21 +109,33 @@ Reference< beans::XPropertySet > AreaWrapper::getInnerPropertySet()
const Sequence< beans::Property >& AreaWrapper::getPropertySequence()
{
- return *StaticAreaWrapperPropertyArray::get();
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
}
std::vector< std::unique_ptr<WrappedProperty> > AreaWrapper::createWrappedProperties()
{
std::vector< std::unique_ptr<WrappedProperty> > aWrappedProperties;
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty("LineStyle","LineStyle") );
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty(u"LineStyle"_ustr,u"LineStyle"_ustr) );
return aWrappedProperties;
}
OUString SAL_CALL AreaWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.Area";
+ return u"com.sun.star.comp.chart.Area"_ustr;
}
sal_Bool SAL_CALL AreaWrapper::supportsService( const OUString& rServiceName )
@@ -166,10 +146,10 @@ sal_Bool SAL_CALL AreaWrapper::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL AreaWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.beans.PropertySet",
- "com.sun.star.drawing.FillProperties",
- "com.sun.star.drawing.LineProperties" };
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr,
+ u"com.sun.star.drawing.FillProperties"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr };
}
} // namespace chart::wrapper
diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.hxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.hxx
index 3de57f421313..c150d5bbfcef 100644
--- a/chart2/source/controller/chartapiwrapper/AreaWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.hxx
@@ -20,7 +20,7 @@
#include <WrappedPropertySet.hxx>
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -40,7 +40,7 @@ class AreaWrapper : public ::cppu::ImplInheritanceHelper<
>
{
public:
- explicit AreaWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit AreaWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~AreaWrapper() override;
/// XServiceInfo declarations
@@ -72,7 +72,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
};
} // namespace chart::wrapper
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index db3e413ba919..3376282d6ffc 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -18,6 +18,7 @@
*/
#include "AxisWrapper.hxx"
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <TitleHelper.hxx>
#include "Chart2ModelContact.hxx"
@@ -35,8 +36,6 @@
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <CharacterProperties.hxx>
#include <LinePropertiesHelper.hxx>
@@ -49,7 +48,8 @@
#include "WrappedScaleTextProperties.hxx"
#include <algorithm>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -335,33 +335,23 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID );
}
-struct StaticAxisWrapperPropertyArray_Initializer
-{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticAxisWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAxisWrapperPropertyArray_Initializer >
+const Sequence< Property >& StaticAxisWrapperPropertyArray()
{
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+ ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
};
} // anonymous namespace
@@ -370,9 +360,8 @@ namespace chart::wrapper
{
AxisWrapper::AxisWrapper(
- tAxisType eType, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact) :
- m_spChart2ModelContact( spChart2ModelContact ),
- m_aEventListenerContainer( m_aMutex ),
+ tAxisType eType, std::shared_ptr<Chart2ModelContact> spChart2ModelContact) :
+ m_spChart2ModelContact(std::move( spChart2ModelContact )),
m_eType( eType )
{
}
@@ -484,7 +473,7 @@ void SAL_CALL AxisWrapper::setSize( const awt::Size& /*aSize*/ )
// ____ XShapeDescriptor (base of XShape) ____
OUString SAL_CALL AxisWrapper::getShapeType()
{
- return "com.sun.star.chart.ChartAxis";
+ return u"com.sun.star.chart.ChartAxis"_ustr;
}
// ____ XNumberFormatsSupplier ____
@@ -526,8 +515,9 @@ void AxisWrapper::getDimensionAndMainAxisBool( tAxisType eType, sal_Int32& rnDim
// ____ XComponent ____
void SAL_CALL AxisWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
DisposeHelper::DisposeAndClear( m_xAxisTitle );
DisposeHelper::DisposeAndClear( m_xMajorGrid );
@@ -539,13 +529,15 @@ void SAL_CALL AxisWrapper::dispose()
void SAL_CALL AxisWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL AxisWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
//ReferenceSizePropertyProvider
@@ -554,8 +546,8 @@ void AxisWrapper::updateReferenceSize()
Reference< beans::XPropertySet > xProp( getAxis(), uno::UNO_QUERY );
if( xProp.is() )
{
- if( xProp->getPropertyValue("ReferencePageSize").hasValue() )
- xProp->setPropertyValue("ReferencePageSize", uno::Any(
+ if( xProp->getPropertyValue(u"ReferencePageSize"_ustr).hasValue() )
+ xProp->setPropertyValue(u"ReferencePageSize"_ustr, uno::Any(
m_spChart2ModelContact->GetPageSize() ));
}
}
@@ -564,7 +556,7 @@ Any AxisWrapper::getReferenceSize()
Any aRet;
Reference< beans::XPropertySet > xProp( getAxis(), uno::UNO_QUERY );
if( xProp.is() )
- aRet = xProp->getPropertyValue("ReferencePageSize");
+ aRet = xProp->getPropertyValue(u"ReferencePageSize"_ustr);
return aRet;
}
awt::Size AxisWrapper::getCurrentSizeForReference()
@@ -574,7 +566,7 @@ awt::Size AxisWrapper::getCurrentSizeForReference()
Reference< chart2::XAxis > AxisWrapper::getAxis()
{
- Reference< chart2::XAxis > xAxis;
+ rtl::Reference< Axis > xAxis;
try
{
sal_Int32 nDimensionIndex = 0;
@@ -586,9 +578,8 @@ Reference< chart2::XAxis > AxisWrapper::getAxis()
if( !xAxis.is() )
{
xAxis = AxisHelper::createAxis( nDimensionIndex, bMainAxis, xDiagram, m_spChart2ModelContact->m_xContext );
- Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
- if( xProp.is() )
- xProp->setPropertyValue("Show", uno::Any( false ) );
+ if( xAxis.is() )
+ xAxis->setPropertyValue(u"Show"_ustr, uno::Any( false ) );
}
}
catch( const uno::Exception & )
@@ -606,7 +597,7 @@ Reference< beans::XPropertySet > AxisWrapper::getInnerPropertySet()
const Sequence< beans::Property >& AxisWrapper::getPropertySequence()
{
- return *StaticAxisWrapperPropertyArray::get();
+ return StaticAxisWrapperPropertyArray();
}
std::vector< std::unique_ptr<WrappedProperty> > AxisWrapper::createWrappedProperties()
@@ -614,19 +605,19 @@ std::vector< std::unique_ptr<WrappedProperty> > AxisWrapper::createWrappedProper
std::vector< std::unique_ptr<WrappedProperty> > aWrappedProperties;
aWrappedProperties.emplace_back( new WrappedTextRotationProperty() );
- aWrappedProperties.emplace_back( new WrappedProperty("Marks","MajorTickmarks") );
- aWrappedProperties.emplace_back( new WrappedProperty("HelpMarks","MinorTickmarks") );
- aWrappedProperties.emplace_back( new WrappedProperty("TextCanOverlap","TextOverlap") );
- aWrappedProperties.emplace_back( new WrappedProperty("ArrangeOrder","ArrangeOrder") );
- aWrappedProperties.emplace_back( new WrappedProperty("Visible","Show") );
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty("DisplayLabels","DisplayLabels") );
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty("TryStaggeringFirst","TryStaggeringFirst") );
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty("TextBreak","TextBreak") );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"Marks"_ustr,u"MajorTickmarks"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"HelpMarks"_ustr,u"MinorTickmarks"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"TextCanOverlap"_ustr,u"TextOverlap"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"ArrangeOrder"_ustr,u"ArrangeOrder"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"Visible"_ustr,u"Show"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty(u"DisplayLabels"_ustr,u"DisplayLabels"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty(u"TryStaggeringFirst"_ustr,u"TryStaggeringFirst"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty(u"TextBreak"_ustr,u"TextBreak"_ustr) );
aWrappedProperties.emplace_back( new WrappedNumberFormatProperty(m_spChart2ModelContact) );
aWrappedProperties.emplace_back( new WrappedLinkNumberFormatProperty );
- aWrappedProperties.emplace_back( new WrappedProperty("StackedText","StackCharacters") );
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty("CrossoverPosition","CrossoverPosition") );
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty("MajorOrigin","MajorOrigin") );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"StackedText"_ustr,u"StackCharacters"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty(u"CrossoverPosition"_ustr,u"CrossoverPosition"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty(u"MajorOrigin"_ustr,u"MajorOrigin"_ustr) );
{
WrappedGapwidthProperty* pWrappedGapwidthProperty( new WrappedGapwidthProperty( m_spChart2ModelContact ) );
WrappedBarOverlapProperty* pWrappedBarOverlapProperty( new WrappedBarOverlapProperty( m_spChart2ModelContact ) );
@@ -652,7 +643,7 @@ std::vector< std::unique_ptr<WrappedProperty> > AxisWrapper::createWrappedProper
OUString SAL_CALL AxisWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.Axis";
+ return u"com.sun.star.comp.chart.Axis"_ustr;
}
sal_Bool SAL_CALL AxisWrapper::supportsService( const OUString& rServiceName )
@@ -663,9 +654,9 @@ sal_Bool SAL_CALL AxisWrapper::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL AxisWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartAxis",
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.style.CharacterProperties"
+ u"com.sun.star.chart.ChartAxis"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.style.CharacterProperties"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
index b421ab331ab6..3b63c45c100d 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
@@ -21,13 +21,13 @@
#include <WrappedPropertySet.hxx>
#include "ReferenceSizePropertyProvider.hxx"
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/chart/XAxis.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-
+#include <rtl/ref.hxx>
#include <memory>
namespace com::sun::star::chart2 { class XAxis; }
@@ -35,6 +35,8 @@ namespace com::sun::star::chart2 { class XAxis; }
namespace chart::wrapper
{
class Chart2ModelContact;
+class TitleWrapper;
+class GridWrapper;
class AxisWrapper : public ::cppu::ImplInheritanceHelper<
WrappedPropertySet
@@ -56,7 +58,7 @@ public:
SECOND_Y_AXIS
};
- AxisWrapper(tAxisType eType, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ AxisWrapper(tAxisType eType, std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~AxisWrapper() override;
static void getDimensionAndMainAxisBool( tAxisType eType, sal_Int32& rnDimensionIndex, bool& rbMainAxis );
@@ -109,13 +111,13 @@ private: //methods
private: //member
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
tAxisType m_eType;
- css::uno::Reference< css::beans::XPropertySet > m_xAxisTitle;
- css::uno::Reference< css::beans::XPropertySet > m_xMajorGrid;
- css::uno::Reference< css::beans::XPropertySet > m_xMinorGrid;
+ rtl::Reference< TitleWrapper > m_xAxisTitle;
+ rtl::Reference< GridWrapper > m_xMajorGrid;
+ rtl::Reference< GridWrapper > m_xMinorGrid;
};
} // namespace chart::wrapper
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
index aefdc29b1dce..f7ed5ca5165b 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
@@ -18,13 +18,13 @@
*/
#include "Chart2ModelContact.hxx"
-#include <ChartModelHelper.hxx>
+#include <Legend.hxx>
#include <LegendHelper.hxx>
#include <CommonConverters.hxx>
#include <servicenames.hxx>
#include <ObjectIdentifier.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
#include <chartview/DrawModelWrapper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <ChartView.hxx>
#include <DiagramHelper.hxx>
@@ -32,8 +32,8 @@
#include <ChartModel.hxx>
-#include <comphelper/servicehelper.hxx>
-#include <tools/diagnose_ex.h>
+#include <com/sun/star/chart2/XDataSeries.hpp>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -62,16 +62,11 @@ void Chart2ModelContact::setDocumentModel( ChartModel* pChartModel )
if( !pChartModel )
return;
- uno::Reference< container::XNameContainer > xDashTable( pChartModel->createInstance("com.sun.star.drawing.DashTable"), uno::UNO_QUERY );
- uno::Reference< container::XNameContainer > xGradientTable( pChartModel->createInstance("com.sun.star.drawing.GradientTable"), uno::UNO_QUERY );
- uno::Reference< container::XNameContainer > xHatchTable( pChartModel->createInstance("com.sun.star.drawing.HatchTable"), uno::UNO_QUERY );
- uno::Reference< container::XNameContainer > xBitmapTable( pChartModel->createInstance("com.sun.star.drawing.BitmapTable"), uno::UNO_QUERY );
- uno::Reference< container::XNameContainer > xTransparencyGradientTable( pChartModel->createInstance("com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY );
- m_aTableMap["LineDashName"] = xDashTable;
- m_aTableMap["FillGradientName"] = xGradientTable;
- m_aTableMap["FillHatchName"] = xHatchTable;
- m_aTableMap["FillBitmapName"] = xBitmapTable;
- m_aTableMap["FillTransparenceGradientName"] = xTransparencyGradientTable;
+ m_aTableMap[u"LineDashName"_ustr].set(pChartModel->createInstance(u"com.sun.star.drawing.DashTable"_ustr), uno::UNO_QUERY);
+ m_aTableMap[u"FillGradientName"_ustr].set(pChartModel->createInstance(u"com.sun.star.drawing.GradientTable"_ustr), uno::UNO_QUERY);
+ m_aTableMap[u"FillHatchName"_ustr].set(pChartModel->createInstance(u"com.sun.star.drawing.HatchTable"_ustr), uno::UNO_QUERY);
+ m_aTableMap[u"FillBitmapName"_ustr].set(pChartModel->createInstance(u"com.sun.star.drawing.BitmapTable"_ustr), uno::UNO_QUERY);
+ m_aTableMap[u"FillTransparenceGradientName"_ustr].set(pChartModel->createInstance(u"com.sun.star.drawing.TransparencyGradientTable"_ustr), uno::UNO_QUERY);
}
void Chart2ModelContact::clear()
@@ -107,74 +102,54 @@ rtl::Reference< ::chart::ChartView > const & Chart2ModelContact::getChartView()
// get the chart view
rtl::Reference<ChartModel> xChartModel( m_xChartModel );
if( xChartModel )
- {
- auto xInstance = xChartModel->createInstance( CHART_VIEW_SERVICE_NAME );
- auto pChartView = dynamic_cast<ChartView*>(xInstance.get());
- assert(!xInstance || pChartView);
- m_xChartView = pChartView;
- }
+ m_xChartView = xChartModel->createChartView();
}
return m_xChartView;
}
-ExplicitValueProvider* Chart2ModelContact::getExplicitValueProvider() const
-{
- getChartView();
-
- //obtain the ExplicitValueProvider from the chart view
- return m_xChartView.get();
-}
-
rtl::Reference<SvxDrawPage> Chart2ModelContact::getDrawPage() const
{
rtl::Reference<SvxDrawPage> xResult;
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider )
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView )
{
- xResult = pProvider->getDrawModelWrapper()->getMainDrawPage();
+ xResult = rxChartView->getDrawModelWrapper()->getMainDrawPage();
}
return xResult;
}
void Chart2ModelContact::getExplicitValuesForAxis(
- const Reference< XAxis > & xAxis,
+ const rtl::Reference< Axis > & xAxis,
ExplicitScaleData & rOutExplicitScale,
ExplicitIncrementData & rOutExplicitIncrement )
{
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider )
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView )
{
- pProvider->getExplicitValuesForAxis(
+ rxChartView->getExplicitValuesForAxis(
xAxis, rOutExplicitScale, rOutExplicitIncrement );
}
}
sal_Int32 Chart2ModelContact::getExplicitNumberFormatKeyForAxis(
- const Reference< chart2::XAxis >& xAxis )
+ const rtl::Reference< ::chart::Axis >& xAxis )
{
- Reference< chart2::XCoordinateSystem > xCooSys(
+ rtl::Reference< BaseCoordinateSystem > xCooSys(
AxisHelper::getCoordinateSystemOfAxis(
- xAxis, ChartModelHelper::findDiagram( m_xChartModel ) ) );
+ xAxis, m_xChartModel.get()->getFirstChartDiagram() ) );
- return ExplicitValueProvider::getExplicitNumberFormatKeyForAxis( xAxis, xCooSys
+ return ChartView::getExplicitNumberFormatKeyForAxis( xAxis, xCooSys
, m_xChartModel.get() );
}
-sal_Int32 Chart2ModelContact::getExplicitNumberFormatKeyForSeries(
- const Reference< chart2::XDataSeries >& xSeries )
-{
- return ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
- uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ));
-}
-
awt::Size Chart2ModelContact::GetPageSize() const
{
- return ChartModelHelper::getPageSize(m_xChartModel.get());
+ return m_xChartModel.get()->getPageSize();
}
awt::Rectangle Chart2ModelContact::SubstractAxisTitleSizes( const awt::Rectangle& rPositionRect )
{
- awt::Rectangle aRect = ExplicitValueProvider::AddSubtractAxisTitleSizes(
+ awt::Rectangle aRect = ChartView::AddSubtractAxisTitleSizes(
*m_xChartModel.get(), getChartView().get(), rPositionRect, true );
return aRect;
}
@@ -184,7 +159,7 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleIncludingTitle() const
awt::Rectangle aRect( GetDiagramRectangleIncludingAxes() );
//add axis title sizes to the diagram size
- aRect = ExplicitValueProvider::AddSubtractAxisTitleSizes(
+ aRect = ChartView::AddSubtractAxisTitleSizes(
*m_xChartModel.get(), getChartView().get(), aRect, false );
return aRect;
@@ -193,15 +168,15 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleIncludingTitle() const
awt::Rectangle Chart2ModelContact::GetDiagramRectangleIncludingAxes() const
{
awt::Rectangle aRect(0,0,0,0);
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( m_xChartModel );
+ rtl::Reference< Diagram > xDiagram = m_xChartModel.get()->getFirstChartDiagram();
- if( DiagramHelper::getDiagramPositioningMode( xDiagram ) == DiagramPositioningMode_INCLUDING )
+ if( xDiagram && xDiagram->getDiagramPositioningMode() == DiagramPositioningMode::Including )
aRect = DiagramHelper::getDiagramRectangleFromModel(m_xChartModel.get());
else
{
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider )
- aRect = pProvider->getRectangleOfObject("PlotAreaIncludingAxes");
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView )
+ aRect = rxChartView->getRectangleOfObject(u"PlotAreaIncludingAxes"_ustr);
}
return aRect;
}
@@ -209,15 +184,15 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleIncludingAxes() const
awt::Rectangle Chart2ModelContact::GetDiagramRectangleExcludingAxes() const
{
awt::Rectangle aRect(0,0,0,0);
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( m_xChartModel );
+ rtl::Reference< Diagram > xDiagram = m_xChartModel.get()->getFirstChartDiagram();
- if( DiagramHelper::getDiagramPositioningMode( xDiagram ) == DiagramPositioningMode_EXCLUDING )
+ if( xDiagram && xDiagram->getDiagramPositioningMode() == DiagramPositioningMode::Excluding )
aRect = DiagramHelper::getDiagramRectangleFromModel(m_xChartModel.get());
else
{
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider )
- aRect = pProvider->getDiagramRectangleExcludingAxes();
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView )
+ aRect = rxChartView->getDiagramRectangleExcludingAxes();
}
return aRect;
}
@@ -225,12 +200,12 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleExcludingAxes() const
awt::Size Chart2ModelContact::GetLegendSize() const
{
awt::Size aSize;
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider )
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView )
{
- uno::Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( *m_xChartModel.get() ) );
- OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, m_xChartModel.get() ) );
- aSize = ToSize( pProvider->getRectangleOfObject( aCID ) );
+ rtl::Reference< Legend > xLegend = LegendHelper::getLegend( *m_xChartModel.get() );
+ OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, m_xChartModel ) );
+ aSize = ToSize( rxChartView->getRectangleOfObject( aCID ) );
}
return aSize;
}
@@ -238,12 +213,12 @@ awt::Size Chart2ModelContact::GetLegendSize() const
awt::Point Chart2ModelContact::GetLegendPosition() const
{
awt::Point aPoint;
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider )
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView )
{
- uno::Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( *m_xChartModel.get() ) );
- OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, m_xChartModel.get() ) );
- aPoint = ToPoint( pProvider->getRectangleOfObject( aCID ) );
+ rtl::Reference< Legend > xLegend = LegendHelper::getLegend( *m_xChartModel.get() );
+ OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, m_xChartModel ) );
+ aPoint = ToPoint( rxChartView->getRectangleOfObject( aCID ) );
}
return aPoint;
}
@@ -251,11 +226,11 @@ awt::Point Chart2ModelContact::GetLegendPosition() const
awt::Size Chart2ModelContact::GetTitleSize( const uno::Reference< css::chart2::XTitle > & xTitle ) const
{
awt::Size aSize;
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider && xTitle.is() )
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView && xTitle.is() )
{
- OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, m_xChartModel.get() ) );
- aSize = ToSize( pProvider->getRectangleOfObject( aCID ) );
+ OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, m_xChartModel ) );
+ aSize = ToSize( rxChartView->getRectangleOfObject( aCID ) );
}
return aSize;
}
@@ -263,11 +238,11 @@ awt::Size Chart2ModelContact::GetTitleSize( const uno::Reference< css::chart2::X
awt::Point Chart2ModelContact::GetTitlePosition( const uno::Reference< css::chart2::XTitle > & xTitle ) const
{
awt::Point aPoint;
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider && xTitle.is() )
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView && xTitle.is() )
{
OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, m_xChartModel.get() ) );
- aPoint = ToPoint( pProvider->getRectangleOfObject( aCID ) );
+ aPoint = ToPoint( rxChartView->getRectangleOfObject( aCID ) );
}
return aPoint;
}
@@ -275,11 +250,11 @@ awt::Point Chart2ModelContact::GetTitlePosition( const uno::Reference< css::char
awt::Size Chart2ModelContact::GetAxisSize( const uno::Reference< css::chart2::XAxis > & xAxis ) const
{
awt::Size aSize;
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider && xAxis.is() )
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView && xAxis.is() )
{
OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, m_xChartModel.get() ) );
- aSize = ToSize( pProvider->getRectangleOfObject( aCID ) );
+ aSize = ToSize( rxChartView->getRectangleOfObject( aCID ) );
}
return aSize;
}
@@ -287,11 +262,11 @@ awt::Size Chart2ModelContact::GetAxisSize( const uno::Reference< css::chart2::XA
awt::Point Chart2ModelContact::GetAxisPosition( const uno::Reference< css::chart2::XAxis > & xAxis ) const
{
awt::Point aPoint;
- ExplicitValueProvider* pProvider( getExplicitValueProvider() );
- if( pProvider && xAxis.is() )
+ rtl::Reference< ChartView > const & rxChartView = getChartView();
+ if( rxChartView && xAxis.is() )
{
OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, m_xChartModel.get() ) );
- aPoint = ToPoint( pProvider->getRectangleOfObject( aCID ) );
+ aPoint = ToPoint( rxChartView->getRectangleOfObject( aCID ) );
}
return aPoint;
}
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
index 837c09341fd3..40ef39fd105f 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
@@ -18,7 +18,6 @@
*/
#pragma once
-#include <cppuhelper/weakref.hxx>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
@@ -32,14 +31,9 @@
namespace chart { struct ExplicitIncrementData; }
namespace chart { struct ExplicitScaleData; }
namespace com::sun::star::chart2 { class XAxis; }
-namespace com::sun::star::chart2 { class XChartDocument; }
namespace com::sun::star::chart2 { class XDataSeries; }
-namespace com::sun::star::chart2 { class XDiagram; }
namespace com::sun::star::chart2 { class XTitle; }
namespace com::sun::star::container { class XNameContainer; }
-namespace com::sun::star::drawing { class XDrawPage; }
-namespace com::sun::star::frame { class XModel; }
-namespace com::sun::star::lang { class XUnoTunnel; }
namespace com::sun::star::uno { class XComponentContext; }
@@ -71,15 +65,12 @@ public:
case properties are 'auto'.
*/
void getExplicitValuesForAxis(
- const css::uno::Reference< css::chart2::XAxis > & xAxis,
+ const rtl::Reference< ::chart::Axis > & xAxis,
ExplicitScaleData & rOutExplicitScale,
ExplicitIncrementData & rOutExplicitIncrement );
sal_Int32 getExplicitNumberFormatKeyForAxis(
- const css::uno::Reference< css::chart2::XAxis >& xAxis );
-
- static sal_Int32 getExplicitNumberFormatKeyForSeries(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
+ const rtl::Reference< ::chart::Axis >& xAxis );
/** Returns the size of the page in logic coordinates. This value is used
for setting an appropriate "ReferencePageSize" for FontHeights.
@@ -130,7 +121,6 @@ public:
css::awt::Point GetAxisPosition( const css::uno::Reference< css::chart2::XAxis > & xAxis ) const;
private: //methods
- ExplicitValueProvider* getExplicitValueProvider() const;
rtl::Reference< ChartView > const & getChartView() const;
public: //member
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index 3b0a56818e77..b2c38d31bde5 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -20,17 +20,16 @@
#include "ChartDataWrapper.hxx"
#include <DiagramHelper.hxx>
#include <DataSourceHelper.hxx>
-#include <ChartModelHelper.hxx>
#include <InternalDataProvider.hxx>
#include <ControllerLockGuard.hxx>
#include "Chart2ModelContact.hxx"
#include <cppuhelper/supportsservice.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <float.h>
#include <cmath>
#include <limits>
+#include <utility>
#include <osl/diagnose.h>
using namespace ::com::sun::star;
@@ -121,6 +120,11 @@ struct lcl_AllOperator : public lcl_Operator
virtual bool setsCategories( bool /*bDataInColumns*/ ) override
{
+ // Do not force creation of categories, when original has no categories
+ if (auto pDataWrapper = dynamic_cast<const ChartDataWrapper*>(m_xDataToApply.get()))
+ if (auto xChartModel = pDataWrapper->getChartModel())
+ if (auto xDiagram = xChartModel->getFirstChartDiagram())
+ return xDiagram->getCategories().is();
return true;
}
@@ -177,9 +181,9 @@ struct lcl_DataOperator : public lcl_Operator
struct lcl_RowDescriptionsOperator : public lcl_Operator
{
lcl_RowDescriptionsOperator( const Sequence< OUString >& rRowDescriptions
- , const rtl::Reference<::chart::ChartModel>& xChartDoc )
+ , rtl::Reference<::chart::ChartModel> xChartDoc )
: m_rRowDescriptions( rRowDescriptions )
- , m_xChartDoc(xChartDoc)
+ , m_xChartDoc(std::move(xChartDoc))
, m_bDataInColumns(true)
{
}
@@ -208,9 +212,9 @@ struct lcl_RowDescriptionsOperator : public lcl_Operator
struct lcl_ComplexRowDescriptionsOperator : public lcl_Operator
{
lcl_ComplexRowDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexRowDescriptions
- , const rtl::Reference<::chart::ChartModel>& xChartDoc )
+ , rtl::Reference<::chart::ChartModel> xChartDoc )
: m_rComplexRowDescriptions( rComplexRowDescriptions )
- , m_xChartDoc(xChartDoc)
+ , m_xChartDoc(std::move(xChartDoc))
, m_bDataInColumns(true)
{
}
@@ -260,9 +264,9 @@ struct lcl_AnyRowDescriptionsOperator : public lcl_Operator
struct lcl_ColumnDescriptionsOperator : public lcl_Operator
{
lcl_ColumnDescriptionsOperator( const Sequence< OUString >& rColumnDescriptions
- , const rtl::Reference<::chart::ChartModel>& xChartDoc )
+ , rtl::Reference<::chart::ChartModel> xChartDoc )
: m_rColumnDescriptions( rColumnDescriptions )
- , m_xChartDoc(xChartDoc)
+ , m_xChartDoc(std::move(xChartDoc))
, m_bDataInColumns(true)
{
}
@@ -291,9 +295,9 @@ struct lcl_ColumnDescriptionsOperator : public lcl_Operator
struct lcl_ComplexColumnDescriptionsOperator : public lcl_Operator
{
lcl_ComplexColumnDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexColumnDescriptions
- , const rtl::Reference<::chart::ChartModel>& xChartDoc )
+ , rtl::Reference<::chart::ChartModel> xChartDoc )
: m_rComplexColumnDescriptions( rComplexColumnDescriptions )
- , m_xChartDoc(xChartDoc)
+ , m_xChartDoc(std::move(xChartDoc))
, m_bDataInColumns(true)
{
}
@@ -364,19 +368,17 @@ struct lcl_DateCategoriesOperator : public lcl_Operator
}
-ChartDataWrapper::ChartDataWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact(spChart2ModelContact)
- , m_aEventListenerContainer(m_aMutex)
+ChartDataWrapper::ChartDataWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact(std::move(spChart2ModelContact))
{
osl_atomic_increment( &m_refCount );
initDataAccess();
osl_atomic_decrement( &m_refCount );
}
-ChartDataWrapper::ChartDataWrapper( const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
+ChartDataWrapper::ChartDataWrapper( std::shared_ptr<Chart2ModelContact> spChart2ModelContact,
const Reference< XChartData >& xNewData ) :
- m_spChart2ModelContact( spChart2ModelContact ),
- m_aEventListenerContainer( m_aMutex )
+ m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
osl_atomic_increment( &m_refCount );
lcl_AllOperator aOperator( xNewData );
@@ -513,13 +515,15 @@ void SAL_CALL ChartDataWrapper::setDateCategories( const Sequence< double >& rDa
void SAL_CALL ChartDataWrapper::addChartDataChangeEventListener(
const uno::Reference< css::chart::XChartDataChangeEventListener >& aListener )
{
- m_aEventListenerContainer.addInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, aListener );
}
void SAL_CALL ChartDataWrapper::removeChartDataChangeEventListener(
const uno::Reference< css::chart::XChartDataChangeEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
double SAL_CALL ChartDataWrapper::getNotANumber()
@@ -537,20 +541,23 @@ sal_Bool SAL_CALL ChartDataWrapper::isNotANumber( double nNumber )
// ____ XComponent ____
void SAL_CALL ChartDataWrapper::dispose()
{
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( static_cast< ::cppu::OWeakObject* >( this )));
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( static_cast< ::cppu::OWeakObject* >( this )));
m_xDataAccess=nullptr;
}
void SAL_CALL ChartDataWrapper::addEventListener(
const uno::Reference< lang::XEventListener > & xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL ChartDataWrapper::removeEventListener(
const uno::Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
// ____ XEventListener ____
@@ -560,15 +567,22 @@ void SAL_CALL ChartDataWrapper::disposing( const lang::EventObject& /* Source */
void ChartDataWrapper::fireChartDataChangeEvent( css::chart::ChartDataChangeEvent& aEvent )
{
- if( ! m_aEventListenerContainer.getLength() )
+ std::unique_lock g(m_aMutex);
+ if( ! m_aEventListenerContainer.getLength(g) )
return;
uno::Reference< uno::XInterface > xSrc( static_cast< cppu::OWeakObject* >( this ));
OSL_ASSERT( xSrc.is());
if( xSrc.is() )
- aEvent.Source = xSrc;
+ aEvent.Source = std::move(xSrc);
- m_aEventListenerContainer.notifyEach( &css::chart::XChartDataChangeEventListener::chartDataChanged, aEvent );
+ m_aEventListenerContainer.forEach( g,
+ [&aEvent](const uno::Reference<css::lang::XEventListener>& l)
+ {
+ uno::Reference<css::chart::XChartDataChangeEventListener> cl(l, uno::UNO_QUERY);
+ if (cl)
+ cl->chartDataChanged(aEvent);
+ });
}
void ChartDataWrapper::switchToInternalDataProvider()
@@ -590,9 +604,9 @@ void ChartDataWrapper::initDataAccess()
else
{
//create a separate "internal data provider" that is not connected to the model
- auto xInternal = ChartModelHelper::createInternalDataProvider(
- xChartDoc, false /*bConnectToModel*/ );
- m_xDataAccess.set( static_cast<cppu::OWeakObject*>(xInternal.get()), uno::UNO_QUERY_THROW );
+ rtl::Reference<InternalDataProvider> xInternal
+ = new InternalDataProvider( xChartDoc, /*bConnectToModel*/false, /*bDefaultDataInColumns*/ true );
+ m_xDataAccess = xInternal;
}
}
@@ -612,9 +626,9 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
uno::Reference< beans::XPropertySet > xDiaProp( xOldDoc->getDiagram(), uno::UNO_QUERY );
if( xDiaProp.is())
{
- xDiaProp->getPropertyValue("Stacked") >>= bStacked;
- xDiaProp->getPropertyValue("Percent") >>= bPercent;
- xDiaProp->getPropertyValue("Deep") >>= bDeep;
+ xDiaProp->getPropertyValue(u"Stacked"_ustr) >>= bStacked;
+ xDiaProp->getPropertyValue(u"Percent"_ustr) >>= bPercent;
+ xDiaProp->getPropertyValue(u"Deep"_ustr) >>= bDeep;
}
//detect arguments for the new data source
@@ -647,7 +661,7 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
return;
uno::Reference< chart2::data::XDataSource > xSource( xDataProvider->createDataSource( aArguments ) );
- uno::Reference< chart2::XDiagram > xDia( xChartDoc->getFirstDiagram() );
+ rtl::Reference< Diagram > xDia( xChartDoc->getFirstChartDiagram() );
if( xDia.is() )
xDia->setDiagramData( xSource, aArguments );
@@ -659,7 +673,7 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
eStackMode = StackMode::ZStacked;
else if( bPercent )
eStackMode = StackMode::YStackedPercent;
- DiagramHelper::setStackMode( xDia, eStackMode );
+ xDia->setStackMode( eStackMode );
}
// notify listeners
@@ -672,7 +686,7 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
OUString SAL_CALL ChartDataWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.ChartData";
+ return u"com.sun.star.comp.chart.ChartData"_ustr;
}
sal_Bool SAL_CALL ChartDataWrapper::supportsService( const OUString& rServiceName )
@@ -683,11 +697,16 @@ sal_Bool SAL_CALL ChartDataWrapper::supportsService( const OUString& rServiceNam
css::uno::Sequence< OUString > SAL_CALL ChartDataWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartDataArray",
- "com.sun.star.chart.ChartData"
+ u"com.sun.star.chart.ChartDataArray"_ustr,
+ u"com.sun.star.chart.ChartData"_ustr
};
}
+rtl::Reference<ChartModel> ChartDataWrapper::getChartModel() const
+{
+ return m_spChart2ModelContact->getDocumentModel();
+}
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
index dcf7c50ade36..9a44e53b8b12 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
@@ -18,9 +18,10 @@
*/
#pragma once
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer4.hxx>
+#include <rtl/ref.hxx>
+
#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
#include <com/sun/star/chart/XDateCategories.hpp>
#include <com/sun/star/lang/XComponent.hpp>
@@ -29,13 +30,17 @@
#include <memory>
-namespace chart::wrapper
+namespace chart
+{
+class ChartModel;
+
+namespace wrapper
{
class Chart2ModelContact;
struct lcl_Operator;
-class ChartDataWrapper final : public cppu::BaseMutex, public
+class ChartDataWrapper final : public
::cppu::WeakImplHelper<
css::chart2::XAnyDescriptionAccess,
css::chart::XDateCategories,
@@ -44,8 +49,8 @@ class ChartDataWrapper final : public cppu::BaseMutex, public
css::lang::XComponent >
{
public:
- explicit ChartDataWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
- ChartDataWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact
+ explicit ChartDataWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
+ ChartDataWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact
, const css::uno::Reference< css::chart::XChartData >& xNewData );
virtual ~ChartDataWrapper() override;
@@ -54,6 +59,8 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+ rtl::Reference<ChartModel> getChartModel() const;
+
private:
// ____ XDateCategories ____
virtual css::uno::Sequence< double > SAL_CALL getDateCategories() override;
@@ -107,12 +114,13 @@ private:
void initDataAccess();
void applyData( lcl_Operator& rDataOperator );
+ std::mutex m_aMutex;
css::uno::Reference< css::chart2::XAnyDescriptionAccess > m_xDataAccess;
-
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
};
} // namespace chart::wrapper
+} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index e75bd16e8e24..2bbff1f3c293 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -19,25 +19,24 @@
#include <ChartDocumentWrapper.hxx>
#include <ChartView.hxx>
+#include <ChartViewHelper.hxx>
#include <ChartTypeManager.hxx>
#include <ChartTypeTemplate.hxx>
#include <servicenames.hxx>
#include <PropertyHelper.hxx>
#include <TitleHelper.hxx>
+#include <Legend.hxx>
#include <LegendHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <DisposeHelper.hxx>
#include "DataSeriesPointWrapper.hxx"
-#include <chartview/ExplicitValueProvider.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include "Chart2ModelContact.hxx"
#include <BaseCoordinateSystem.hxx>
#include <ChartModel.hxx>
-#include <DiagramHelper.hxx>
#include <DataSourceHelper.hxx>
-#include <ChartModelHelper.hxx>
#include <AxisHelper.hxx>
#include <ThreeDHelper.hxx>
@@ -51,7 +50,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
-#include <comphelper/servicehelper.hxx>
+#include <utility>
#include <vcl/settings.hxx>
#include <com/sun/star/drawing/ShapeCollection.hpp>
@@ -59,9 +58,8 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
-#include <vector>
#include <algorithm>
#include <map>
@@ -220,30 +218,20 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT );
}
-struct StaticChartDocumentWrapperPropertyArray_Initializer
+const Sequence< Property > & StaticChartDocumentWrapperPropertyArray()
{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
- return comphelper::containerToSequence( aProperties );
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticChartDocumentWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticChartDocumentWrapperPropertyArray_Initializer >
-{
-};
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
+}
} // anonymous namespace
@@ -256,7 +244,7 @@ namespace {
class WrappedDataSourceLabelsInFirstRowProperty : public WrappedProperty
{
public:
- explicit WrappedDataSourceLabelsInFirstRowProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedDataSourceLabelsInFirstRowProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -271,9 +259,9 @@ private: //member
}
-WrappedDataSourceLabelsInFirstRowProperty::WrappedDataSourceLabelsInFirstRowProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("DataSourceLabelsInFirstRow",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedDataSourceLabelsInFirstRowProperty::WrappedDataSourceLabelsInFirstRowProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"DataSourceLabelsInFirstRow"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
m_aOuterValue = WrappedDataSourceLabelsInFirstRowProperty::getPropertyDefault( nullptr );
}
@@ -282,7 +270,7 @@ void WrappedDataSourceLabelsInFirstRowProperty::setPropertyValue( const Any& rOu
{
bool bLabelsInFirstRow = true;
if( ! (rOuterValue >>= bLabelsInFirstRow) )
- throw lang::IllegalArgumentException("Property DataSourceLabelsInFirstRow requires value of type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException(u"Property DataSourceLabelsInFirstRow requires value of type boolean"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
bool bNewValue = bLabelsInFirstRow;
@@ -346,7 +334,7 @@ namespace {
class WrappedDataSourceLabelsInFirstColumnProperty : public WrappedProperty
{
public:
- explicit WrappedDataSourceLabelsInFirstColumnProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedDataSourceLabelsInFirstColumnProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -361,9 +349,9 @@ private: //member
}
-WrappedDataSourceLabelsInFirstColumnProperty::WrappedDataSourceLabelsInFirstColumnProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("DataSourceLabelsInFirstColumn",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedDataSourceLabelsInFirstColumnProperty::WrappedDataSourceLabelsInFirstColumnProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"DataSourceLabelsInFirstColumn"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
m_aOuterValue = WrappedDataSourceLabelsInFirstColumnProperty::getPropertyDefault( nullptr );
}
@@ -372,7 +360,7 @@ void WrappedDataSourceLabelsInFirstColumnProperty::setPropertyValue( const Any&
{
bool bLabelsInFirstRow = true;
if( ! (rOuterValue >>= bLabelsInFirstRow) )
- throw lang::IllegalArgumentException("Property DataSourceLabelsInFirstRow requires value of type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException(u"Property DataSourceLabelsInFirstRow requires value of type boolean"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
bool bNewValue = bLabelsInFirstRow;
@@ -436,7 +424,7 @@ namespace {
class WrappedHasLegendProperty : public WrappedProperty
{
public:
- explicit WrappedHasLegendProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedHasLegendProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -450,9 +438,9 @@ private: //member
}
-WrappedHasLegendProperty::WrappedHasLegendProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("HasLegend",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedHasLegendProperty::WrappedHasLegendProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"HasLegend"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
}
@@ -460,19 +448,18 @@ void WrappedHasLegendProperty::setPropertyValue( const Any& rOuterValue, const R
{
bool bNewValue = true;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException("Property HasLegend requires value of type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException(u"Property HasLegend requires value of type boolean"_ustr, nullptr, 0 );
try
{
- Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( *m_spChart2ModelContact->getDocumentModel(), m_spChart2ModelContact->m_xContext,bNewValue ));
+ rtl::Reference< Legend > xLegend = LegendHelper::getLegend( *m_spChart2ModelContact->getDocumentModel(), m_spChart2ModelContact->m_xContext,bNewValue );
if(xLegend.is())
{
- Reference< beans::XPropertySet > xLegendProp( xLegend, uno::UNO_QUERY_THROW );
bool bOldValue = true;
- Any aAOld = xLegendProp->getPropertyValue("Show");
+ Any aAOld = xLegend->getPropertyValue(u"Show"_ustr);
aAOld >>= bOldValue;
if( bOldValue != bNewValue )
- xLegendProp->setPropertyValue("Show", uno::Any( bNewValue ));
+ xLegend->setPropertyValue(u"Show"_ustr, uno::Any( bNewValue ));
}
}
catch (const uno::Exception&)
@@ -486,10 +473,10 @@ Any WrappedHasLegendProperty::getPropertyValue( const Reference< beans::XPropert
Any aRet;
try
{
- Reference< beans::XPropertySet > xLegendProp(
- LegendHelper::getLegend( *m_spChart2ModelContact->getDocumentModel() ), uno::UNO_QUERY );
- if( xLegendProp.is())
- aRet = xLegendProp->getPropertyValue("Show");
+ rtl::Reference< Legend > xLegend =
+ LegendHelper::getLegend( *m_spChart2ModelContact->getDocumentModel() );
+ if( xLegend.is())
+ aRet = xLegend->getPropertyValue(u"Show"_ustr);
else
aRet <<= false;
}
@@ -513,7 +500,7 @@ namespace {
class WrappedHasMainTitleProperty : public WrappedProperty
{
public:
- explicit WrappedHasMainTitleProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedHasMainTitleProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -527,9 +514,9 @@ private: //member
}
-WrappedHasMainTitleProperty::WrappedHasMainTitleProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("HasMainTitle",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedHasMainTitleProperty::WrappedHasMainTitleProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"HasMainTitle"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
}
@@ -537,12 +524,12 @@ void WrappedHasMainTitleProperty::setPropertyValue( const Any& rOuterValue, cons
{
bool bNewValue = true;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException("Property HasMainTitle requires value of type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException(u"Property HasMainTitle requires value of type boolean"_ustr, nullptr, 0 );
try
{
if( bNewValue )
- TitleHelper::createTitle( TitleHelper::MAIN_TITLE, "main-title", m_spChart2ModelContact->getDocumentModel(), m_spChart2ModelContact->m_xContext );
+ TitleHelper::createTitle( TitleHelper::MAIN_TITLE, u"main-title"_ustr, m_spChart2ModelContact->getDocumentModel(), m_spChart2ModelContact->m_xContext );
else
TitleHelper::removeTitle( TitleHelper::MAIN_TITLE, m_spChart2ModelContact->getDocumentModel() );
}
@@ -579,7 +566,7 @@ namespace {
class WrappedHasSubTitleProperty : public WrappedProperty
{
public:
- explicit WrappedHasSubTitleProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedHasSubTitleProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -593,9 +580,9 @@ private: //member
}
-WrappedHasSubTitleProperty::WrappedHasSubTitleProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("HasSubTitle",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedHasSubTitleProperty::WrappedHasSubTitleProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"HasSubTitle"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
}
@@ -603,12 +590,12 @@ void WrappedHasSubTitleProperty::setPropertyValue( const Any& rOuterValue, const
{
bool bNewValue = true;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException("Property HasSubTitle requires value of type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException(u"Property HasSubTitle requires value of type boolean"_ustr, nullptr, 0 );
try
{
if( bNewValue )
- TitleHelper::createTitle( TitleHelper::SUB_TITLE, "", m_spChart2ModelContact->getDocumentModel(), m_spChart2ModelContact->m_xContext );
+ TitleHelper::createTitle( TitleHelper::SUB_TITLE, u""_ustr, m_spChart2ModelContact->getDocumentModel(), m_spChart2ModelContact->m_xContext );
else
TitleHelper::removeTitle( TitleHelper::SUB_TITLE, m_spChart2ModelContact->getDocumentModel() );
}
@@ -653,6 +640,7 @@ ChartDocumentWrapper::~ChartDocumentWrapper()
}
// ____ XInterface (for new interfaces) ____
+// [-loplugin:unoaggregation]
uno::Any SAL_CALL ChartDocumentWrapper::queryInterface( const uno::Type& aType )
{
if( m_xDelegator.is())
@@ -720,20 +708,18 @@ Reference< XDiagram > SAL_CALL ChartDocumentWrapper::getDiagram()
return m_xDiagram;
}
-void SAL_CALL ChartDocumentWrapper::setDiagram( const Reference< XDiagram >& xDiagram )
+void SAL_CALL ChartDocumentWrapper::setDiagram( const Reference< XDiagram >& _xDiagram )
{
- uno::Reference< util::XRefreshable > xAddIn( xDiagram, uno::UNO_QUERY );
- if( xAddIn.is() )
- {
- setAddIn( xAddIn );
- }
- else if( xDiagram.is() && xDiagram != m_xDiagram )
+ if (!_xDiagram.is())
+ return;
+ auto xDiagram = dynamic_cast<DiagramWrapper*>(_xDiagram.get());
+ assert(xDiagram);
+ if( xDiagram != m_xDiagram )
{
// set new wrapped diagram at new chart. This requires the old
// diagram given as parameter to implement the new interface. If
// this is not possible throw an exception
- Reference< chart2::XDiagramProvider > xNewDiaProvider( xDiagram, uno::UNO_QUERY_THROW );
- Reference< chart2::XDiagram > xNewDia( xNewDiaProvider->getDiagram());
+ rtl::Reference< ::chart::Diagram > xNewDia( xDiagram->getUnderlyingDiagram());
try
{
@@ -864,23 +850,26 @@ Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::getCurrentSelection(
void SAL_CALL ChartDocumentWrapper::dispose()
{
if( m_bIsDisposed )
- throw lang::DisposedException("ChartDocumentWrapper is disposed",
- static_cast< ::cppu::OWeakObject* >( this ));
+ return;
m_bIsDisposed = true;
try
{
Reference< lang::XComponent > xFormerDelegator( m_xDelegator, uno::UNO_QUERY );
- DisposeHelper::DisposeAndClear( m_xTitle );
+ if (m_xTitle)
+ {
+ m_xTitle->dispose();
+ m_xTitle.clear();
+ }
DisposeHelper::DisposeAndClear( m_xSubTitle );
DisposeHelper::DisposeAndClear( m_xLegend );
DisposeHelper::DisposeAndClear( m_xChartData );
DisposeHelper::DisposeAndClear( m_xDiagram );
DisposeHelper::DisposeAndClear( m_xArea );
- m_xChartView.set( nullptr );
- m_xShapeFactory.set( nullptr );
- m_xDelegator.set( nullptr );
+ m_xChartView.clear();
+ m_xShapeFactory.clear();
+ m_xDelegator.clear();
clearWrappedPropertySet();
m_spChart2ModelContact->clear();
@@ -907,7 +896,7 @@ void SAL_CALL ChartDocumentWrapper::dispose()
void ChartDocumentWrapper::impl_resetAddIn()
{
Reference< util::XRefreshable > xAddIn( m_xAddIn );
- m_xAddIn.set( nullptr );
+ m_xAddIn.clear();
if( !xAddIn.is() )
return;
@@ -1045,11 +1034,10 @@ rtl::Reference<SvxDrawPage> ChartDocumentWrapper::impl_getDrawPage() const
namespace {
-uno::Reference< lang::XMultiServiceFactory > getShapeFactory(const uno::Reference<uno::XInterface>& xChartView)
+uno::Reference< lang::XMultiServiceFactory > getShapeFactory(const rtl::Reference<ChartView>& xChartView)
{
- auto pProvider = comphelper::getFromUnoTunnel<ExplicitValueProvider>(xChartView);
- if( pProvider )
- return pProvider->getDrawModelWrapper()->getShapeFactory();
+ if( xChartView )
+ return xChartView->getDrawModelWrapper()->getShapeFactory();
return uno::Reference< lang::XMultiServiceFactory >();
}
@@ -1083,7 +1071,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.Area");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.Area"_ustr);
bCreateDiagram = true;
}
break;
@@ -1093,7 +1081,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
// this is for bar and column (the latter is the default if
// no "Vertical=false" property was set)
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.Column");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.Column"_ustr);
bCreateDiagram = true;
}
break;
@@ -1101,7 +1089,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.Donut");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.Donut"_ustr);
bCreateDiagram = true;
}
break;
@@ -1109,7 +1097,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.Line");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.Line"_ustr);
bCreateDiagram = true;
}
break;
@@ -1117,7 +1105,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.Net");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.Net"_ustr);
bCreateDiagram = true;
}
break;
@@ -1125,7 +1113,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.FilledNet");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.FilledNet"_ustr);
bCreateDiagram = true;
}
break;
@@ -1133,7 +1121,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.Pie");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.Pie"_ustr);
bCreateDiagram = true;
}
break;
@@ -1141,7 +1129,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.StockLowHighClose");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.StockLowHighClose"_ustr);
bCreateDiagram = true;
}
break;
@@ -1149,7 +1137,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.ScatterLineSymbol");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.ScatterLineSymbol"_ustr);
bCreateDiagram = true;
}
break;
@@ -1158,7 +1146,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xChartTypeManager.is())
{
xTemplate =
- xChartTypeManager->createTemplate("com.sun.star.chart2.template.Bubble");
+ xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.Bubble"_ustr);
bCreateDiagram = true;
}
break;
@@ -1189,17 +1177,17 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
{
// locked controllers
ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartDoc );
- ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram );
+ rtl::Reference< Diagram > xDiagram = xChartDoc->getFirstChartDiagram();
+ ThreeDLookScheme e3DScheme = xDiagram->detectScheme();
rtl::Reference< ::chart::ChartTypeManager > xTemplateManager = xChartDoc->getTypeManager();
- DiagramHelper::tTemplateWithServiceName aTemplateWithService(
- DiagramHelper::getTemplateForDiagram( xDiagram, xTemplateManager ));
+ Diagram::tTemplateWithServiceName aTemplateWithService(
+ xDiagram->getTemplate( xTemplateManager ));
if( aTemplateWithService.xChartTypeTemplate.is())
- aTemplateWithService.xChartTypeTemplate->resetStyles( xDiagram );//#i109371#
+ aTemplateWithService.xChartTypeTemplate->resetStyles2( xDiagram );//#i109371#
xTemplate->changeDiagram( xDiagram );
if( AllSettings::GetMathLayoutRTL() )
AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) );
- ThreeDHelper::setScheme( xDiagram, e3DScheme );
+ xDiagram->setScheme( e3DScheme );
}
else
{
@@ -1257,7 +1245,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
{
if( !m_xShapeFactory.is() && m_xChartView.is() )
{
- m_xShapeFactory = getShapeFactory( static_cast<cppu::OWeakObject*>(m_xChartView.get()) );
+ m_xShapeFactory = getShapeFactory( m_xChartView );
}
else
{
@@ -1265,7 +1253,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if(pModel)
{
m_xChartView = pModel->getChartView();
- m_xShapeFactory = getShapeFactory( static_cast<cppu::OWeakObject*>(m_xChartView.get()) );
+ m_xShapeFactory = getShapeFactory( m_xChartView );
}
}
@@ -1325,7 +1313,7 @@ void SAL_CALL ChartDocumentWrapper::setDelegator(
if( m_bIsDisposed )
{
if( rDelegator.is() )
- throw lang::DisposedException("ChartDocumentWrapper is disposed",
+ throw lang::DisposedException(u"ChartDocumentWrapper is disposed"_ustr,
static_cast< ::cppu::OWeakObject* >( this ));
return;
}
@@ -1359,22 +1347,36 @@ uno::Any SAL_CALL ChartDocumentWrapper::queryAggregation( const uno::Type& rType
// ____ ::utl::OEventListenerAdapter ____
void ChartDocumentWrapper::_disposing( const lang::EventObject& rSource )
{
- if( rSource.Source == m_xTitle )
- m_xTitle.set( nullptr );
- else if( rSource.Source == m_xSubTitle )
- m_xSubTitle.set( nullptr );
- else if( rSource.Source == m_xLegend )
- m_xLegend.set( nullptr );
+ if( rSource.Source == cppu::getXWeak(m_xTitle.get()) )
+ m_xTitle.clear();
+ else if( rSource.Source == cppu::getXWeak(m_xSubTitle.get()) )
+ m_xSubTitle.clear();
+ else if( rSource.Source == cppu::getXWeak(m_xLegend.get()) )
+ m_xLegend.clear();
else if( rSource.Source == m_xChartData )
- m_xChartData.set( nullptr );
- else if( rSource.Source == m_xDiagram )
- m_xDiagram.set( nullptr );
+ m_xChartData.clear();
+ else if( rSource.Source == cppu::getXWeak(m_xDiagram.get()) )
+ m_xDiagram.clear();
else if( rSource.Source == m_xArea )
- m_xArea.set( nullptr );
+ m_xArea.clear();
else if( rSource.Source == m_xAddIn )
- m_xAddIn.set( nullptr );
+ m_xAddIn.clear();
else if( rSource.Source == static_cast<cppu::OWeakObject*>(m_xChartView.get()) )
- m_xChartView.set( nullptr );
+ m_xChartView.clear();
+}
+
+// ____ XPropertySet ____
+void SAL_CALL ChartDocumentWrapper::setPropertyValue(const OUString& rPropertyName, const css::uno::Any& rValue)
+{
+ if (rPropertyName == u"ODFImport_UpdateView")
+ {
+ // A hack used at load time to notify the view that it needs an update
+ // See SchXMLImport::~SchXMLImport
+ if (auto xChartModel = rValue.query<css::chart2::XChartDocument>())
+ ChartViewHelper::setViewToDirtyState_UNO(xChartModel);
+ return;
+ }
+ ChartDocumentWrapper_Base::setPropertyValue(rPropertyName, rValue);
}
// WrappedPropertySet
@@ -1384,7 +1386,7 @@ Reference< beans::XPropertySet > ChartDocumentWrapper::getInnerPropertySet()
}
const Sequence< beans::Property >& ChartDocumentWrapper::getPropertySequence()
{
- return *StaticChartDocumentWrapperPropertyArray::get();
+ return StaticChartDocumentWrapperPropertyArray();
}
std::vector< std::unique_ptr<WrappedProperty> > ChartDocumentWrapper::createWrappedProperties()
@@ -1399,16 +1401,16 @@ std::vector< std::unique_ptr<WrappedProperty> > ChartDocumentWrapper::createWrap
aWrappedProperties.emplace_back( new WrappedBaseDiagramProperty( *this ) );
aWrappedProperties.emplace_back( new WrappedAdditionalShapesProperty( *this ) );
aWrappedProperties.emplace_back( new WrappedRefreshAddInAllowedProperty( *this ) );
- aWrappedProperties.emplace_back( new WrappedIgnoreProperty("NullDate",Any() ) ); // i99104
- aWrappedProperties.emplace_back( new WrappedIgnoreProperty("EnableComplexChartTypes", uno::Any(true) ) );
- aWrappedProperties.emplace_back( new WrappedIgnoreProperty("EnableDataTableDialog", uno::Any(true) ) );
+ aWrappedProperties.emplace_back( new WrappedIgnoreProperty(u"NullDate"_ustr,Any() ) ); // i99104
+ aWrappedProperties.emplace_back( new WrappedIgnoreProperty(u"EnableComplexChartTypes"_ustr, uno::Any(true) ) );
+ aWrappedProperties.emplace_back( new WrappedIgnoreProperty(u"EnableDataTableDialog"_ustr, uno::Any(true) ) );
return aWrappedProperties;
}
OUString SAL_CALL ChartDocumentWrapper::getImplementationName()
{
- return CHART_CHARTAPIWRAPPER_IMPLEMENTATION_NAME;
+ return u"com.sun.star.comp.chart2.ChartDocumentWrapper"_ustr;
}
sal_Bool SAL_CALL ChartDocumentWrapper::supportsService( const OUString& rServiceName )
@@ -1419,10 +1421,10 @@ sal_Bool SAL_CALL ChartDocumentWrapper::supportsService( const OUString& rServic
css::uno::Sequence< OUString > SAL_CALL ChartDocumentWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartDocument",
- CHART_CHARTAPIWRAPPER_SERVICE_NAME,
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.beans.PropertySet"
+ u"com.sun.star.chart.ChartDocument"_ustr,
+ u"com.sun.star.chart2.ChartDocumentWrapper"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index e49239935c6d..fe2552f7f5b4 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -19,8 +19,11 @@
#include "DataSeriesPointWrapper.hxx"
#include "Chart2ModelContact.hxx"
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <DiagramHelper.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
#include <LinePropertiesHelper.hxx>
#include <FillProperties.hxx>
#include <CharacterProperties.hxx>
@@ -37,6 +40,7 @@
#include "WrappedTextRotationProperty.hxx"
#include <unonames.hxx>
+#include <o3tl/safeint.hxx>
#include <rtl/math.hxx>
#include <algorithm>
@@ -45,6 +49,7 @@
#include <com/sun/star/chart/ChartAxisAssign.hpp>
#include <com/sun/star/chart/ChartErrorCategory.hpp>
#include <com/sun/star/chart/ChartSymbolType.hpp>
+#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
@@ -55,6 +60,7 @@
using namespace ::com::sun::star;
using namespace ::chart::wrapper;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -243,30 +249,16 @@ uno::Sequence< Property > lcl_GetPropertySequence( DataSeriesPointWrapper::eType
return comphelper::containerToSequence( aProperties );
}
-struct StaticSeriesWrapperPropertyArray_Initializer
+const Sequence< Property >& StaticSeriesWrapperPropertyArray()
{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_SERIES ) );
- return &aPropSeq;
- }
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_SERIES ) );
+ return aPropSeq;
};
-struct StaticSeriesWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticSeriesWrapperPropertyArray_Initializer >
-{
-};
-
-struct StaticPointWrapperPropertyArray_Initializer
-{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_POINT ) );
- return &aPropSeq;
- }
-};
-
-struct StaticPointWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticPointWrapperPropertyArray_Initializer >
+const Sequence< Property >& StaticPointWrapperPropertyArray()
{
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_POINT ) );
+ return aPropSeq;
};
//PROP_SERIES_ATTACHED_AXIS
@@ -287,7 +279,7 @@ protected:
WrappedAttachedAxisProperty::WrappedAttachedAxisProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact )
- : WrappedProperty("Axis",OUString())
+ : WrappedProperty(u"Axis"_ustr,OUString())
, m_spChart2ModelContact( spChart2ModelContact )
{
}
@@ -303,8 +295,8 @@ Any WrappedAttachedAxisProperty::getPropertyValue( const Reference< beans::XProp
{
Any aRet;
- uno::Reference< chart2::XDataSeries > xDataSeries( xInnerPropertySet, uno::UNO_QUERY );
- bool bAttachedToMainAxis = ::chart::DiagramHelper::isSeriesAttachedToMainAxis( xDataSeries );
+ rtl::Reference< ::chart::DataSeries > xDataSeries( dynamic_cast<::chart::DataSeries*>(xInnerPropertySet.get()) );
+ bool bAttachedToMainAxis = xDataSeries->isAttachedToMainAxis();
if( bAttachedToMainAxis )
aRet <<= css::chart::ChartAxisAssign::PRIMARY_Y;
else
@@ -314,20 +306,20 @@ Any WrappedAttachedAxisProperty::getPropertyValue( const Reference< beans::XProp
void WrappedAttachedAxisProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
{
- uno::Reference< chart2::XDataSeries > xDataSeries( xInnerPropertySet, uno::UNO_QUERY );
+ rtl::Reference< ::chart::DataSeries > xDataSeries( dynamic_cast<::chart::DataSeries*>(xInnerPropertySet.get()) );
sal_Int32 nChartAxisAssign = css::chart::ChartAxisAssign::PRIMARY_Y;
if( ! (rOuterValue >>= nChartAxisAssign) )
- throw lang::IllegalArgumentException("Property Axis requires value of type sal_Int32", nullptr, 0 );
+ throw lang::IllegalArgumentException(u"Property Axis requires value of type sal_Int32"_ustr, nullptr, 0 );
bool bNewAttachedToMainAxis = nChartAxisAssign == css::chart::ChartAxisAssign::PRIMARY_Y;
- bool bOldAttachedToMainAxis = ::chart::DiagramHelper::isSeriesAttachedToMainAxis( xDataSeries );
+ bool bOldAttachedToMainAxis = xDataSeries->isAttachedToMainAxis();
if( bNewAttachedToMainAxis != bOldAttachedToMainAxis)
{
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
if( xDiagram.is() )
- ::chart::DiagramHelper::attachSeriesToAxis( bNewAttachedToMainAxis, xDataSeries, xDiagram, m_spChart2ModelContact->m_xContext, false );
+ xDiagram->attachSeriesToAxis( bNewAttachedToMainAxis, xDataSeries, m_spChart2ModelContact->m_xContext, false );
}
}
@@ -342,7 +334,7 @@ protected:
};
WrappedSegmentOffsetProperty::WrappedSegmentOffsetProperty() :
- WrappedProperty("SegmentOffset","Offset")
+ WrappedProperty(u"SegmentOffset"_ustr,u"Offset"_ustr)
{}
Any WrappedSegmentOffsetProperty::convertInnerToOuterValue( const Any& rInnerValue ) const
@@ -387,7 +379,7 @@ protected:
WrappedLineColorProperty::WrappedLineColorProperty(
DataSeriesPointWrapper* pDataSeriesPointWrapper )
- : WrappedSeriesAreaOrLineProperty("LineColor","BorderColor","Color", pDataSeriesPointWrapper )
+ : WrappedSeriesAreaOrLineProperty(u"LineColor"_ustr,u"BorderColor"_ustr,u"Color"_ustr, pDataSeriesPointWrapper )
, m_pDataSeriesPointWrapper( pDataSeriesPointWrapper )
, m_aDefaultValue(uno::Any(sal_Int32( 0x0099ccff ))) // blue 8
{
@@ -428,7 +420,7 @@ protected:
WrappedLineStyleProperty::WrappedLineStyleProperty(
DataSeriesPointWrapper* pDataSeriesPointWrapper )
- : WrappedSeriesAreaOrLineProperty("LineStyle","BorderStyle", "LineStyle", pDataSeriesPointWrapper )
+ : WrappedSeriesAreaOrLineProperty(u"LineStyle"_ustr,u"BorderStyle"_ustr, u"LineStyle"_ustr, pDataSeriesPointWrapper )
, m_pDataSeriesPointWrapper( pDataSeriesPointWrapper )
{
}
@@ -454,9 +446,8 @@ void WrappedLineStyleProperty::setPropertyToDefault( const Reference< beans::XPr
namespace chart::wrapper
{
-DataSeriesPointWrapper::DataSeriesPointWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact( spChart2ModelContact )
- , m_aEventListenerContainer( m_aMutex )
+DataSeriesPointWrapper::DataSeriesPointWrapper( std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact( std::move(spChart2ModelContact) )
, m_eType( DATA_SERIES )
, m_nSeriesIndexInNewAPI( -1 )
, m_nPointIndex( -1 )
@@ -473,14 +464,18 @@ void SAL_CALL DataSeriesPointWrapper::initialize( const uno::Sequence< uno::Any
m_nPointIndex = -1;
if( aArguments.hasElements() )
{
- aArguments[0] >>= m_xDataSeries;
+ uno::Reference<chart2::XDataSeries> xTmp;
+ aArguments[0] >>= xTmp;
+ auto p = dynamic_cast<DataSeries*>(xTmp.get());
+ assert(p);
+ m_xDataSeries = p;
if( aArguments.getLength() >= 2 )
aArguments[1] >>= m_nPointIndex;
}
if( !m_xDataSeries.is() )
throw uno::Exception(
- "DataSeries index invalid", static_cast< ::cppu::OWeakObject * >( this ));
+ u"DataSeries index invalid"_ustr, static_cast< ::cppu::OWeakObject * >( this ));
//todo: check upper border of point index
@@ -493,9 +488,8 @@ void SAL_CALL DataSeriesPointWrapper::initialize( const uno::Sequence< uno::Any
DataSeriesPointWrapper::DataSeriesPointWrapper(eType _eType,
sal_Int32 nSeriesIndexInNewAPI ,
sal_Int32 nPointIndex, //ignored for series
- const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact( spChart2ModelContact )
- , m_aEventListenerContainer( m_aMutex )
+ std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact( std::move(spChart2ModelContact) )
, m_eType( _eType )
, m_nSeriesIndexInNewAPI( nSeriesIndexInNewAPI )
, m_nPointIndex( (_eType == DATA_POINT) ? nPointIndex : -1 )
@@ -510,8 +504,9 @@ DataSeriesPointWrapper::~DataSeriesPointWrapper()
// ____ XComponent ____
void SAL_CALL DataSeriesPointWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
uno::Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
m_xDataSeries.clear();
clearWrappedPropertySet();
@@ -520,13 +515,15 @@ void SAL_CALL DataSeriesPointWrapper::dispose()
void SAL_CALL DataSeriesPointWrapper::addEventListener(
const uno::Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL DataSeriesPointWrapper::removeEventListener(
const uno::Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
// ____ XEventListener ____
@@ -536,24 +533,25 @@ void SAL_CALL DataSeriesPointWrapper::disposing( const lang::EventObject& /*Sour
bool DataSeriesPointWrapper::isSupportingAreaProperties()
{
- Reference< chart2::XDataSeries > xSeries( getDataSeries() );
+ rtl::Reference< DataSeries > xSeries( getDataSeries() );
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
-
- return ChartTypeHelper::isSupportingAreaProperties( xChartType, nDimensionCount );
+ rtl::Reference< ::chart::ChartType > xChartType( xDiagram->getChartTypeOfSeries( xSeries ) );
+ if (!xChartType.is())
+ return false;
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
+ return xChartType->isSupportingAreaProperties(nDimensionCount);
}
-Reference< chart2::XDataSeries > DataSeriesPointWrapper::getDataSeries()
+rtl::Reference< DataSeries > DataSeriesPointWrapper::getDataSeries()
{
- Reference< chart2::XDataSeries > xSeries( m_xDataSeries );
+ rtl::Reference< DataSeries > xSeries = m_xDataSeries;
if( !xSeries.is() )
{
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
- ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesList =
+ xDiagram->getDataSeries();
- if( m_nSeriesIndexInNewAPI >= 0 && m_nSeriesIndexInNewAPI < static_cast<sal_Int32>(aSeriesList.size()) )
+ if( m_nSeriesIndexInNewAPI >= 0 && o3tl::make_unsigned(m_nSeriesIndexInNewAPI) < aSeriesList.size() )
xSeries = aSeriesList[m_nSeriesIndexInNewAPI];
}
@@ -564,7 +562,7 @@ Reference< beans::XPropertySet > DataSeriesPointWrapper::getDataPointProperties(
{
Reference< beans::XPropertySet > xPointProp;
- Reference< chart2::XDataSeries > xSeries( getDataSeries() );
+ rtl::Reference< DataSeries > xSeries( getDataSeries() );
// may throw an IllegalArgumentException
if( xSeries.is() )
@@ -579,8 +577,8 @@ void DataSeriesPointWrapper::updateReferenceSize()
Reference< beans::XPropertySet > xProp = getInnerPropertySet();
if( xProp.is() )
{
- if( xProp->getPropertyValue("ReferencePageSize").hasValue() )
- xProp->setPropertyValue("ReferencePageSize", uno::Any(
+ if( xProp->getPropertyValue(u"ReferencePageSize"_ustr).hasValue() )
+ xProp->setPropertyValue(u"ReferencePageSize"_ustr, uno::Any(
m_spChart2ModelContact->GetPageSize() ));
}
}
@@ -589,7 +587,7 @@ Any DataSeriesPointWrapper::getReferenceSize()
Any aRet;
Reference< beans::XPropertySet > xProp = getInnerPropertySet();
if( xProp.is() )
- aRet = xProp->getPropertyValue("ReferencePageSize");
+ aRet = xProp->getPropertyValue(u"ReferencePageSize"_ustr);
return aRet;
}
awt::Size DataSeriesPointWrapper::getCurrentSizeForReference()
@@ -607,7 +605,7 @@ beans::PropertyState SAL_CALL DataSeriesPointWrapper::getPropertyState( const OU
{
if (rPropertyName == "SymbolBitmap" || rPropertyName == "SymbolBitmapURL")
{
- uno::Any aAny = WrappedPropertySet::getPropertyValue("SymbolType");
+ uno::Any aAny = WrappedPropertySet::getPropertyValue(u"SymbolType"_ustr);
sal_Int32 nVal = css::chart::ChartSymbolType::NONE;
if (aAny >>= nVal)
{
@@ -622,9 +620,10 @@ beans::PropertyState SAL_CALL DataSeriesPointWrapper::getPropertyState( const OU
{
if( rPropertyName == "FillColor")
{
- Reference< beans::XPropertySet > xSeriesProp( getDataSeries(), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xSeries = getDataSeries();
bool bVaryColorsByPoint = false;
- if( xSeriesProp.is() && (xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint)
+ // "VaryColorsByPoint"
+ if( xSeries.is() && (xSeries->getFastPropertyValue(PROP_DATASERIES_VARY_COLORS_BY_POINT) >>= bVaryColorsByPoint)
&& bVaryColorsByPoint )
return beans::PropertyState_DIRECT_VALUE;
}
@@ -683,7 +682,7 @@ Any SAL_CALL DataSeriesPointWrapper::getPropertyDefault( const OUString& rProper
if( nHandle > 0 )
{
//always take the series current value as default for points
- Reference< beans::XPropertySet > xInnerPropertySet( getDataSeries(), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xInnerPropertySet = getDataSeries();
if( xInnerPropertySet.is() )
{
const WrappedProperty* pWrappedProperty = getWrappedProperty( rPropertyName );
@@ -704,16 +703,16 @@ Any SAL_CALL DataSeriesPointWrapper::getPropertyDefault( const OUString& rProper
Reference< beans::XPropertySet > DataSeriesPointWrapper::getInnerPropertySet()
{
if( m_eType == DATA_SERIES )
- return Reference< beans::XPropertySet >( getDataSeries(), uno::UNO_QUERY );
+ return getDataSeries();
return getDataPointProperties();
}
const Sequence< beans::Property >& DataSeriesPointWrapper::getPropertySequence()
{
if( m_eType == DATA_SERIES )
- return *StaticSeriesWrapperPropertyArray::get();
+ return StaticSeriesWrapperPropertyArray();
else
- return *StaticPointWrapperPropertyArray::get();
+ return StaticPointWrapperPropertyArray();
}
std::vector< std::unique_ptr<WrappedProperty> > DataSeriesPointWrapper::createWrappedProperties()
@@ -737,38 +736,38 @@ std::vector< std::unique_ptr<WrappedProperty> > DataSeriesPointWrapper::createWr
//add unnamed line properties (different inner names here)
- aWrappedProperties.emplace_back( new WrappedProperty("FillColor","Color") );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillColor"_ustr,u"Color"_ustr) );
aWrappedProperties.emplace_back( new WrappedLineStyleProperty( this ) );
aWrappedProperties.emplace_back( new WrappedLineColorProperty( this ) );
- aWrappedProperties.emplace_back( new WrappedSeriesAreaOrLineProperty("LineDashName","BorderDashName","LineDashName", this ) );
- aWrappedProperties.emplace_back( new WrappedSeriesAreaOrLineProperty("LineTransparence","BorderTransparency","Transparency", this ) );
- aWrappedProperties.emplace_back( new WrappedSeriesAreaOrLineProperty("LineWidth","BorderWidth","LineWidth", this ) );
- aWrappedProperties.emplace_back( new WrappedSeriesAreaOrLineProperty("LineCap","LineCap","LineCap", this ) );
- aWrappedProperties.emplace_back( new WrappedProperty("FillStyle","FillStyle" ) );
- aWrappedProperties.emplace_back( new WrappedProperty("FillTransparence","Transparency") );
-
- aWrappedProperties.emplace_back( new WrappedIgnoreProperty("LineJoint", uno::Any( drawing::LineJoint_ROUND ) ) );
- aWrappedProperties.emplace_back( new WrappedProperty("FillTransparenceGradientName","TransparencyGradientName") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillGradientName","GradientName") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillGradientStepCount","GradientStepCount") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillHatchName","HatchName") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapName","FillBitmapName") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBackground","FillBackground") );
+ aWrappedProperties.emplace_back( new WrappedSeriesAreaOrLineProperty(u"LineDashName"_ustr,u"BorderDashName"_ustr,u"LineDashName"_ustr, this ) );
+ aWrappedProperties.emplace_back( new WrappedSeriesAreaOrLineProperty(u"LineTransparence"_ustr,u"BorderTransparency"_ustr,u"Transparency"_ustr, this ) );
+ aWrappedProperties.emplace_back( new WrappedSeriesAreaOrLineProperty(u"LineWidth"_ustr,u"BorderWidth"_ustr,u"LineWidth"_ustr, this ) );
+ aWrappedProperties.emplace_back( new WrappedSeriesAreaOrLineProperty(u"LineCap"_ustr,u"LineCap"_ustr,u"LineCap"_ustr, this ) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillStyle"_ustr,u"FillStyle"_ustr ) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillTransparence"_ustr,u"Transparency"_ustr) );
+
+ aWrappedProperties.emplace_back( new WrappedIgnoreProperty(u"LineJoint"_ustr, uno::Any( drawing::LineJoint_ROUND ) ) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillTransparenceGradientName"_ustr,u"TransparencyGradientName"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillGradientName"_ustr,u"GradientName"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillGradientStepCount"_ustr,u"GradientStepCount"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillHatchName"_ustr,u"HatchName"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapName"_ustr,u"FillBitmapName"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBackground"_ustr,u"FillBackground"_ustr) );
//bitmap properties
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapMode","FillBitmapMode") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapSizeX","FillBitmapSizeX") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapSizeY","FillBitmapSizeY") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapLogicalSize","FillBitmapLogicalSize") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapOffsetX","FillBitmapOffsetX") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapOffsetY","FillBitmapOffsetY") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapRectanglePoint","FillBitmapRectanglePoint") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapPositionOffsetX","FillBitmapPositionOffsetX") );
- aWrappedProperties.emplace_back( new WrappedProperty("FillBitmapPositionOffsetY","FillBitmapPositionOffsetY") );
-
- aWrappedProperties.emplace_back( new WrappedProperty("SolidType","Geometry3D") );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapMode"_ustr,u"FillBitmapMode"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapSizeX"_ustr,u"FillBitmapSizeX"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapSizeY"_ustr,u"FillBitmapSizeY"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapLogicalSize"_ustr,u"FillBitmapLogicalSize"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapOffsetX"_ustr,u"FillBitmapOffsetX"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapOffsetY"_ustr,u"FillBitmapOffsetY"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapRectanglePoint"_ustr,u"FillBitmapRectanglePoint"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapPositionOffsetX"_ustr,u"FillBitmapPositionOffsetX"_ustr) );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"FillBitmapPositionOffsetY"_ustr,u"FillBitmapPositionOffsetY"_ustr) );
+
+ aWrappedProperties.emplace_back( new WrappedProperty(u"SolidType"_ustr,u"Geometry3D"_ustr) );
aWrappedProperties.emplace_back( new WrappedSegmentOffsetProperty() );
- aWrappedProperties.emplace_back( new WrappedProperty("D3DPercentDiagonal","PercentDiagonal") );
+ aWrappedProperties.emplace_back( new WrappedProperty(u"D3DPercentDiagonal"_ustr,u"PercentDiagonal"_ustr) );
aWrappedProperties.emplace_back( new WrappedTextRotationProperty() );
@@ -780,11 +779,11 @@ void SAL_CALL DataSeriesPointWrapper::setPropertyValue( const OUString& rPropert
if(rPropertyName == "Lines")
{
if( ! (rValue >>= m_bLinesAllowed) )
- throw lang::IllegalArgumentException("Property Lines requires value of type sal_Bool", nullptr, 0 );
+ throw lang::IllegalArgumentException(u"Property Lines requires value of type sal_Bool"_ustr, nullptr, 0 );
}
sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
- static const sal_Int32 nErrorCategoryHandle = getInfoHelper().getHandleByName("ErrorCategory");
+ static const sal_Int32 nErrorCategoryHandle = getInfoHelper().getHandleByName(u"ErrorCategory"_ustr);
if( nErrorCategoryHandle == nHandle )
{
css::chart::ChartErrorCategory aNewValue = css::chart::ChartErrorCategory_NONE;
@@ -794,16 +793,16 @@ void SAL_CALL DataSeriesPointWrapper::setPropertyValue( const OUString& rPropert
switch(aNewValue)
{
case css::chart::ChartErrorCategory_CONSTANT_VALUE:
- aHigh = getPropertyValue("ConstantErrorHigh");
- aLow = getPropertyValue("ConstantErrorLow");
+ aHigh = getPropertyValue(u"ConstantErrorHigh"_ustr);
+ aLow = getPropertyValue(u"ConstantErrorLow"_ustr);
bSetHighAndLowValues = true;
break;
case css::chart::ChartErrorCategory_PERCENT:
- aHigh = aLow = getPropertyValue("PercentageError");
+ aHigh = aLow = getPropertyValue(u"PercentageError"_ustr);
bSetHighAndLowValues = true;
break;
case css::chart::ChartErrorCategory_ERROR_MARGIN:
- aHigh = aLow = getPropertyValue("ErrorMargin");
+ aHigh = aLow = getPropertyValue(u"ErrorMargin"_ustr);
bSetHighAndLowValues = true;
break;
default:
@@ -817,14 +816,14 @@ void SAL_CALL DataSeriesPointWrapper::setPropertyValue( const OUString& rPropert
switch(aNewValue)
{
case css::chart::ChartErrorCategory_CONSTANT_VALUE:
- setPropertyValue("ConstantErrorHigh",aHigh);
- setPropertyValue("ConstantErrorLow",aLow);
+ setPropertyValue(u"ConstantErrorHigh"_ustr,aHigh);
+ setPropertyValue(u"ConstantErrorLow"_ustr,aLow);
break;
case css::chart::ChartErrorCategory_PERCENT:
- setPropertyValue("PercentageError",aHigh);
+ setPropertyValue(u"PercentageError"_ustr,aHigh);
break;
case css::chart::ChartErrorCategory_ERROR_MARGIN:
- setPropertyValue("ErrorMargin",aHigh);
+ setPropertyValue(u"ErrorMargin"_ustr,aHigh);
break;
default:
break;
@@ -841,13 +840,14 @@ Any SAL_CALL DataSeriesPointWrapper::getPropertyValue( const OUString& rProperty
{
if( rPropertyName == "FillColor" )
{
- Reference< beans::XPropertySet > xSeriesProp( getDataSeries(), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xSeries = getDataSeries();
bool bVaryColorsByPoint = false;
- if( xSeriesProp.is() && (xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint)
+ // "VaryColorsByPoint"
+ if( xSeries.is() && (xSeries->getFastPropertyValue(PROP_DATASERIES_VARY_COLORS_BY_POINT) >>= bVaryColorsByPoint)
&& bVaryColorsByPoint )
{
uno::Reference< beans::XPropertyState > xPointState( DataSeriesPointWrapper::getDataPointProperties(), uno::UNO_QUERY );
- if( xPointState.is() && xPointState->getPropertyState("Color") == beans::PropertyState_DEFAULT_VALUE )
+ if( xPointState.is() && xPointState->getPropertyState(u"Color"_ustr) == beans::PropertyState_DEFAULT_VALUE )
{
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
if( xDiagram.is() )
@@ -865,7 +865,7 @@ Any SAL_CALL DataSeriesPointWrapper::getPropertyValue( const OUString& rProperty
OUString SAL_CALL DataSeriesPointWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.DataSeries";
+ return u"com.sun.star.comp.chart.DataSeries"_ustr;
}
sal_Bool SAL_CALL DataSeriesPointWrapper::supportsService( const OUString& rServiceName )
@@ -876,13 +876,13 @@ sal_Bool SAL_CALL DataSeriesPointWrapper::supportsService( const OUString& rServ
css::uno::Sequence< OUString > SAL_CALL DataSeriesPointWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartDataRowProperties",
- "com.sun.star.chart.ChartDataPointProperties",
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.beans.PropertySet",
- "com.sun.star.drawing.FillProperties",
- "com.sun.star.drawing.LineProperties",
- "com.sun.star.style.CharacterProperties"
+ u"com.sun.star.chart.ChartDataRowProperties"_ustr,
+ u"com.sun.star.chart.ChartDataPointProperties"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr,
+ u"com.sun.star.drawing.FillProperties"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr,
+ u"com.sun.star.style.CharacterProperties"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx
index f5fbab3f332b..52322dfe46c9 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.hxx
@@ -21,15 +21,15 @@
#include <WrappedPropertySet.hxx>
#include "ReferenceSizePropertyProvider.hxx"
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-
+#include <rtl/ref.hxx>
#include <memory>
-namespace com::sun::star::chart2 { class XDataSeries; }
+namespace chart { class DataSeries; }
namespace chart::wrapper
{
@@ -54,12 +54,12 @@ public:
};
//this constructor needs an initialize call afterwards
- explicit DataSeriesPointWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit DataSeriesPointWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
DataSeriesPointWrapper(eType eType
, sal_Int32 nSeriesIndexInNewAPI
, sal_Int32 nPointIndex //ignored for series
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~DataSeriesPointWrapper() override;
@@ -100,11 +100,11 @@ private:
virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
//own methods
- css::uno::Reference< css::chart2::XDataSeries > getDataSeries();
+ rtl::Reference< ::chart::DataSeries > getDataSeries();
css::uno::Reference< css::beans::XPropertySet > getDataPointProperties();
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
eType m_eType;
sal_Int32 m_nSeriesIndexInNewAPI;
@@ -115,7 +115,7 @@ private:
//this should only be used, if the DataSeriesPointWrapper is initialized via the XInitialize interface
//because a big change in the chartmodel may lead to a dataseriespointer that is not connected to the model anymore
//with the indices instead we can always get the new dataseries
- css::uno::Reference< css::chart2::XDataSeries > m_xDataSeries;
+ rtl::Reference< ::chart::DataSeries > m_xDataSeries;
};
} // namespace chart::wrapper
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index d9deba9857d4..217921db9f00 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -20,14 +20,17 @@
#include "DiagramWrapper.hxx"
#include <servicenames_charttypes.hxx>
#include "DataSeriesPointWrapper.hxx"
+#include <DataSeriesProperties.hxx>
#include "AxisWrapper.hxx"
#include "Chart2ModelContact.hxx"
#include "WallFloorWrapper.hxx"
#include "MinMaxLineWrapper.hxx"
#include "UpDownBarWrapper.hxx"
+#include <Diagram.hxx>
#include <DiagramHelper.hxx>
#include <DataSourceHelper.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
+#include <DataSeries.hxx>
#include <WrappedIgnoreProperty.hxx>
#include "WrappedAxisAndGridExistenceProperties.hxx"
#include "WrappedStatisticProperties.hxx"
@@ -50,10 +53,9 @@
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
#include <com/sun/star/chart/ChartSolidType.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <LinePropertiesHelper.hxx>
#include <FillProperties.hxx>
@@ -64,17 +66,19 @@
#include <map>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <o3tl/string_view.hxx>
+#include <utility>
using namespace ::com::sun::star;
using namespace ::chart::wrapper;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::beans::Property;
using ::com::sun::star::chart::XAxis;
-using ::osl::MutexGuard;
namespace
{
@@ -98,6 +102,8 @@ enum
PROP_DIAGRAM_SORT_BY_X_VALUES,
PROP_DIAGRAM_STARTING_ANGLE,
+ PROP_DIAGRAM_OF_PIE_TYPE,
+ PROP_DIAGRAM_SPLIT_POS,
PROP_DIAGRAM_RIGHT_ANGLED_AXES,
PROP_DIAGRAM_PERSPECTIVE,
@@ -134,9 +140,6 @@ enum
PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE,
PROP_DIAGRAM_AUTOMATIC_SIZE,
- PROP_DIAGRAM_DATATABLEHBORDER,
- PROP_DIAGRAM_DATATABLEVBORDER,
- PROP_DIAGRAM_DATATABLEOUTLINE,
PROP_DIAGRAM_EXTERNALDATA
};
@@ -227,6 +230,16 @@ void lcl_AddPropertiesToVector(
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( "SubPieType",
+ PROP_DIAGRAM_OF_PIE_TYPE,
+ cppu::UnoType<chart2::PieChartSubType>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( "SplitPos",
+ PROP_DIAGRAM_SPLIT_POS,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
//new for 3D charts
rOutProperties.emplace_back( "RightAngledAxes",
@@ -378,21 +391,7 @@ void lcl_AddPropertiesToVector(
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "DataTableHBorder",
- PROP_DIAGRAM_DATATABLEHBORDER,
- cppu::UnoType<bool>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "DataTableVBorder",
- PROP_DIAGRAM_DATATABLEVBORDER,
- cppu::UnoType<bool>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "DataTableOutline",
- PROP_DIAGRAM_DATATABLEOUTLINE,
- cppu::UnoType<bool>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
+
rOutProperties.emplace_back( "ExternalData",
PROP_DIAGRAM_EXTERNALDATA,
cppu::UnoType<OUString>::get(),
@@ -400,45 +399,35 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID );
}
-struct StaticDiagramWrapperPropertyArray_Initializer
-{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- ::chart::SceneProperties::AddPropertiesToVector( aProperties );
- WrappedStatisticProperties::addProperties( aProperties );
- WrappedSymbolProperties::addProperties( aProperties );
- WrappedDataCaptionProperties::addProperties( aProperties );
- WrappedSplineProperties::addProperties( aProperties );
- WrappedStockProperties::addProperties( aProperties );
- WrappedAutomaticPositionProperties::addProperties( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticDiagramWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticDiagramWrapperPropertyArray_Initializer >
+const Sequence< Property >& StaticDiagramWrapperPropertyArray()
{
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+ ::chart::SceneProperties::AddPropertiesToVector( aProperties );
+ WrappedStatisticProperties::addProperties( aProperties );
+ WrappedSymbolProperties::addProperties( aProperties );
+ WrappedDataCaptionProperties::addProperties( aProperties );
+ WrappedSplineProperties::addProperties( aProperties );
+ WrappedStockProperties::addProperties( aProperties );
+ WrappedAutomaticPositionProperties::addProperties( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
};
-bool lcl_isXYChart( const Reference< chart2::XDiagram >& rDiagram )
+bool lcl_isXYChart( const rtl::Reference< ::chart::Diagram >& xDiagram )
{
bool bRet = false;
- Reference< chart2::XChartType > xChartType( ::chart::DiagramHelper::getChartTypeByIndex( rDiagram, 0 ) );
+ rtl::Reference< ::chart::ChartType > xChartType( xDiagram->getChartTypeByIndex( 0 ) );
if( xChartType.is() )
{
OUString aChartType( xChartType->getChartType() );
@@ -450,7 +439,7 @@ bool lcl_isXYChart( const Reference< chart2::XDiagram >& rDiagram )
sal_Int32 lcl_getNewAPIIndexForOldAPIIndex(
sal_Int32 nOldAPIIndex
- , const Reference< chart2::XDiagram >& xDiagram )
+ , const rtl::Reference< ::chart::Diagram >& xDiagram )
{
sal_Int32 nNewAPIIndex = nOldAPIIndex;
@@ -460,30 +449,39 @@ sal_Int32 lcl_getNewAPIIndexForOldAPIIndex(
nNewAPIIndex -= 1;
}
- std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
- ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< ::chart::DataSeries > > aSeriesList =
+ xDiagram->getDataSeries();
if( nNewAPIIndex >= static_cast<sal_Int32>(aSeriesList.size()) )
nNewAPIIndex = -1;
return nNewAPIIndex;
}
-OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
+OUString lcl_getDiagramType( std::u16string_view rTemplateServiceName )
{
- static const OUStringLiteral aPrefix(u"com.sun.star.chart2.template.");
+ static constexpr OUString aPrefix(u"com.sun.star.chart2.template."_ustr);
- if( rTemplateServiceName.match( aPrefix ))
+ if( o3tl::starts_with(rTemplateServiceName, aPrefix) )
{
- const OUString aName( rTemplateServiceName.copy( aPrefix.getLength()));
+ const std::u16string_view aName( rTemplateServiceName.substr( aPrefix.getLength()));
// "Area" "StackedArea" "PercentStackedArea" "ThreeDArea"
// "StackedThreeDArea" "PercentStackedThreeDArea"
- if( aName.indexOf( "Area" ) != -1 )
- return "com.sun.star.chart.AreaDiagram";
+ if( aName.find( u"Area" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.AreaDiagram"_ustr;
+
+ // Handle bar-of-pie and pie-of-pie before simple pie
+ // "BarOfPie"
+ if( aName.find( u"BarOfPie" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.BarOfPieDiagram"_ustr;
+
+ // "PieOfPie"
+ if( aName.find( u"PieOfPie" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.PieOfPieDiagram"_ustr;
// "Pie" "PieAllExploded" "ThreeDPie" "ThreeDPieAllExploded"
- if( aName.indexOf( "Pie" ) != -1 )
- return "com.sun.star.chart.PieDiagram";
+ if( aName.find( u"Pie" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.PieDiagram"_ustr;
// "Column" "StackedColumn" "PercentStackedColumn" "ThreeDColumnDeep"
// "ThreeDColumnFlat" "StackedThreeDColumnFlat"
@@ -491,34 +489,34 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
// "PercentStackedBar" "ThreeDBarDeep" "ThreeDBarFlat"
// "StackedThreeDBarFlat" "PercentStackedThreeDBarFlat" "ColumnWithLine"
// "StackedColumnWithLine"
- if( aName.indexOf( "Column" ) != -1 || aName.indexOf( "Bar" ) != -1 )
- return "com.sun.star.chart.BarDiagram";
+ if( aName.find( u"Column" ) != std::u16string_view::npos || aName.find( u"Bar" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.BarDiagram"_ustr;
// "Donut" "DonutAllExploded" "ThreeDDonut" "ThreeDDonutAllExploded"
- if( aName.indexOf( "Donut" ) != -1 )
- return "com.sun.star.chart.DonutDiagram";
+ if( aName.find( u"Donut" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.DonutDiagram"_ustr;
// "ScatterLineSymbol" "ScatterLine" "ScatterSymbol" "ThreeDScatter"
- if( aName.indexOf( "Scatter" ) != -1 )
- return "com.sun.star.chart.XYDiagram";
+ if( aName.find( u"Scatter" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.XYDiagram"_ustr;
// "FilledNet" "StackedFilledNet" "PercentStackedFilledNet"
- if( aName.indexOf( "FilledNet" ) != -1 )
- return "com.sun.star.chart.FilledNetDiagram";
+ if( aName.find( u"FilledNet" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.FilledNetDiagram"_ustr;
// "Net" "NetSymbol" "NetLine" "StackedNet" "StackedNetSymbol"
// "StackedNetLine" "PercentStackedNet" "PercentStackedNetSymbol"
// "PercentStackedNetLine"
- if( aName.indexOf( "Net" ) != -1 )
- return "com.sun.star.chart.NetDiagram";
+ if( aName.find( u"Net" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.NetDiagram"_ustr;
// "StockLowHighClose" "StockOpenLowHighClose" "StockVolumeLowHighClose"
// "StockVolumeOpenLowHighClose"
- if( aName.indexOf( "Stock" ) != -1 )
- return "com.sun.star.chart.StockDiagram";
+ if( aName.find( u"Stock" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.StockDiagram"_ustr;
- if( aName.indexOf( "Bubble" ) != -1 )
- return "com.sun.star.chart.BubbleDiagram";
+ if( aName.find( u"Bubble" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.BubbleDiagram"_ustr;
// Note: this must be checked after Bar, Net and Scatter
@@ -526,8 +524,11 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
// "PercentStackedLine" "LineSymbol" "StackedLineSymbol"
// "PercentStackedLineSymbol" "ThreeDLine" "StackedThreeDLine"
// "PercentStackedThreeDLine" "ThreeDLineDeep"
- if( aName.indexOf( "Line" ) != -1 || aName.indexOf( "Symbol" ) != -1 )
- return "com.sun.star.chart.LineDiagram";
+ if( aName.find(u"Line") != std::u16string_view::npos || aName.find( u"Symbol" ) != std::u16string_view::npos )
+ return u"com.sun.star.chart.LineDiagram"_ustr;
+
+ if (aName.find(u"Histogram") != std::u16string_view::npos)
+ return u"com.sun.star.chart.HistogramDiagram"_ustr;
OSL_FAIL( "unknown template" );
}
@@ -543,6 +544,7 @@ const tMakeStringStringMap& lcl_getChartTypeNameMap()
{"com.sun.star.chart2.LineChartType", "com.sun.star.chart.LineDiagram"},
{"com.sun.star.chart2.AreaChartType", "com.sun.star.chart.AreaDiagram"},
{"com.sun.star.chart2.ColumnChartType", "com.sun.star.chart.BarDiagram"},
+ {"com.sun.star.chart2.HistogramChartType", "com.sun.star.chart.HistogramDiagram"},
{"com.sun.star.chart2.PieChartType", "com.sun.star.chart.PieDiagram"},
{"com.sun.star.chart2.DonutChartType", "com.sun.star.chart.DonutDiagram"},
{"com.sun.star.chart2.ScatterChartType", "com.sun.star.chart.XYDiagram"},
@@ -572,9 +574,8 @@ OUString lcl_getOldChartTypeName( const OUString & rNewChartTypeName )
namespace chart::wrapper
{
-DiagramWrapper::DiagramWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact(spChart2ModelContact)
- , m_aEventListenerContainer(m_aMutex)
+DiagramWrapper::DiagramWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact(std::move(spChart2ModelContact))
{
}
@@ -594,7 +595,7 @@ OUString SAL_CALL DiagramWrapper::getDiagramType()
if( xChartDocProp.is() )
{
uno::Reference< util::XRefreshable > xAddIn;
- if( xChartDocProp->getPropertyValue( "AddIn" ) >>= xAddIn )
+ if( xChartDocProp->getPropertyValue( u"AddIn"_ustr ) >>= xAddIn )
{
uno::Reference< lang::XServiceName > xServiceName( xAddIn, uno::UNO_QUERY );
if( xServiceName.is())
@@ -603,26 +604,29 @@ OUString SAL_CALL DiagramWrapper::getDiagramType()
}
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = xChartDoc->getTypeManager();
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
+ Diagram::tTemplateWithServiceName aTemplateAndService =
+ xDiagram->getTemplate( xChartTypeManager );
aRet = lcl_getDiagramType( aTemplateAndService.sServiceName );
}
- if( aRet.isEmpty())
+ if( !aRet.isEmpty())
+ return aRet;
+
+ // none of the standard templates matched
+ // use first chart type
+ if (xDiagram)
{
- // none of the standard templates matched
- // use first chart type
- Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeByIndex( 0 ) );
if( xChartType.is() )
{
aRet = xChartType->getChartType();
if( !aRet.isEmpty() )
aRet = lcl_getOldChartTypeName( aRet );
}
- if( aRet.isEmpty())
- aRet = "com.sun.star.chart.BarDiagram";
}
+ if( aRet.isEmpty())
+ aRet = "com.sun.star.chart.BarDiagram";
return aRet;
}
@@ -631,12 +635,12 @@ Reference<
beans::XPropertySet > SAL_CALL DiagramWrapper::getDataRowProperties( sal_Int32 nRow )
{
if( nRow < 0 )
- throw lang::IndexOutOfBoundsException("DataSeries index invalid",
+ throw lang::IndexOutOfBoundsException(u"DataSeries index invalid"_ustr,
static_cast< ::cppu::OWeakObject * >( this ));
sal_Int32 nNewAPIIndex = lcl_getNewAPIIndexForOldAPIIndex( nRow, m_spChart2ModelContact->getDiagram() );
if( nNewAPIIndex < 0 )
- throw lang::IndexOutOfBoundsException("DataSeries index invalid",
+ throw lang::IndexOutOfBoundsException(u"DataSeries index invalid"_ustr,
static_cast< ::cppu::OWeakObject * >( this ));
Reference< beans::XPropertySet > xRet( new DataSeriesPointWrapper(
@@ -648,12 +652,12 @@ Reference<
beans::XPropertySet > SAL_CALL DiagramWrapper::getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow )
{
if( nCol < 0 || nRow < 0 )
- throw lang::IndexOutOfBoundsException("DataSeries index invalid",
+ throw lang::IndexOutOfBoundsException(u"DataSeries index invalid"_ustr,
static_cast< ::cppu::OWeakObject * >( this ));
sal_Int32 nNewAPIIndex = lcl_getNewAPIIndexForOldAPIIndex( nRow, m_spChart2ModelContact->getDiagram() );
if( nNewAPIIndex < 0 )
- throw lang::IndexOutOfBoundsException("DataSeries index invalid",
+ throw lang::IndexOutOfBoundsException(u"DataSeries index invalid"_ustr,
static_cast< ::cppu::OWeakObject * >( this ));
//todo: check borders of point index
@@ -688,11 +692,11 @@ void SAL_CALL DiagramWrapper::setPosition( const awt::Point& aPosition )
{
OSL_FAIL("DiagramWrapper::setPosition called with a position out of range -> automatic values are taken instead" );
uno::Any aEmpty;
- xProp->setPropertyValue( "RelativePosition", aEmpty );
+ xProp->setPropertyValue( u"RelativePosition"_ustr, aEmpty );
return;
}
- xProp->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) );
- xProp->setPropertyValue( "PosSizeExcludeAxes", uno::Any(false) );
+ xProp->setPropertyValue( u"RelativePosition"_ustr, uno::Any(aRelativePosition) );
+ xProp->setPropertyValue( u"PosSizeExcludeAxes"_ustr, uno::Any(false) );
}
awt::Size SAL_CALL DiagramWrapper::getSize()
@@ -718,18 +722,18 @@ void SAL_CALL DiagramWrapper::setSize( const awt::Size& aSize )
{
OSL_FAIL("DiagramWrapper::setSize called with sizes bigger than page -> automatic values are taken instead" );
uno::Any aEmpty;
- xProp->setPropertyValue( "RelativeSize", aEmpty );
+ xProp->setPropertyValue( u"RelativeSize"_ustr, aEmpty );
return;
}
- xProp->setPropertyValue( "RelativeSize", uno::Any(aRelativeSize) );
- xProp->setPropertyValue( "PosSizeExcludeAxes", uno::Any(false) );
+ xProp->setPropertyValue( u"RelativeSize"_ustr, uno::Any(aRelativeSize) );
+ xProp->setPropertyValue( u"PosSizeExcludeAxes"_ustr, uno::Any(false) );
}
// ____ XShapeDescriptor (base of XShape) ____
OUString SAL_CALL DiagramWrapper::getShapeType()
{
- return "com.sun.star.chart.Diagram";
+ return u"com.sun.star.chart.Diagram"_ustr;
}
// ____ XDiagramPositioning ____
@@ -740,8 +744,8 @@ void SAL_CALL DiagramWrapper::setAutomaticDiagramPositioning()
uno::Reference< beans::XPropertySet > xDiaProps( getDiagram(), uno::UNO_QUERY );
if( xDiaProps.is() )
{
- xDiaProps->setPropertyValue( "RelativeSize", Any() );
- xDiaProps->setPropertyValue( "RelativePosition", Any() );
+ xDiaProps->setPropertyValue( u"RelativeSize"_ustr, Any() );
+ xDiaProps->setPropertyValue( u"RelativePosition"_ustr, Any() );
}
}
sal_Bool SAL_CALL DiagramWrapper::isAutomaticDiagramPositioning( )
@@ -749,8 +753,8 @@ sal_Bool SAL_CALL DiagramWrapper::isAutomaticDiagramPositioning( )
uno::Reference< beans::XPropertySet > xDiaProps( getDiagram(), uno::UNO_QUERY );
if( xDiaProps.is() )
{
- Any aRelativeSize( xDiaProps->getPropertyValue( "RelativeSize" ) );
- Any aRelativePosition( xDiaProps->getPropertyValue( "RelativePosition" ) );
+ Any aRelativeSize( xDiaProps->getPropertyValue( u"RelativeSize"_ustr ) );
+ Any aRelativePosition( xDiaProps->getPropertyValue( u"RelativePosition"_ustr ) );
if( aRelativeSize.hasValue() && aRelativePosition.hasValue() )
return false;
}
@@ -762,19 +766,19 @@ void SAL_CALL DiagramWrapper::setDiagramPositionExcludingAxes( const awt::Rectan
DiagramHelper::setDiagramPositioning( m_spChart2ModelContact->getDocumentModel(), rPositionRect );
uno::Reference< beans::XPropertySet > xDiaProps( getDiagram(), uno::UNO_QUERY );
if( xDiaProps.is() )
- xDiaProps->setPropertyValue("PosSizeExcludeAxes", uno::Any(true) );
+ xDiaProps->setPropertyValue(u"PosSizeExcludeAxes"_ustr, uno::Any(true) );
}
sal_Bool SAL_CALL DiagramWrapper::isExcludingDiagramPositioning()
{
uno::Reference< beans::XPropertySet > xDiaProps( getDiagram(), uno::UNO_QUERY );
if( xDiaProps.is() )
{
- Any aRelativeSize( xDiaProps->getPropertyValue( "RelativeSize" ) );
- Any aRelativePosition( xDiaProps->getPropertyValue( "RelativePosition" ) );
+ Any aRelativeSize( xDiaProps->getPropertyValue( u"RelativeSize"_ustr ) );
+ Any aRelativePosition( xDiaProps->getPropertyValue( u"RelativePosition"_ustr ) );
if( aRelativeSize.hasValue() && aRelativePosition.hasValue() )
{
bool bPosSizeExcludeAxes = false;
- xDiaProps->getPropertyValue( "PosSizeExcludeAxes" ) >>= bPosSizeExcludeAxes;
+ xDiaProps->getPropertyValue( u"PosSizeExcludeAxes"_ustr ) >>= bPosSizeExcludeAxes;
return bPosSizeExcludeAxes;
}
}
@@ -790,7 +794,7 @@ void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxes( const awt::Rectan
DiagramHelper::setDiagramPositioning( m_spChart2ModelContact->getDocumentModel(), rPositionRect );
uno::Reference< beans::XPropertySet > xDiaProps( getDiagram(), uno::UNO_QUERY );
if( xDiaProps.is() )
- xDiaProps->setPropertyValue("PosSizeExcludeAxes", uno::Any(false) );
+ xDiaProps->setPropertyValue(u"PosSizeExcludeAxes"_ustr, uno::Any(false) );
}
awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionIncludingAxes( )
{
@@ -810,7 +814,7 @@ css::awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionIncludingAx
// ____ XAxisSupplier ____
Reference< XAxis > SAL_CALL DiagramWrapper::getAxis( sal_Int32 nDimensionIndex )
{
- Reference< XAxis > xAxis;
+ rtl::Reference< AxisWrapper > xAxis;
if(!nDimensionIndex)
{
if( !m_xXAxis.is() )
@@ -834,7 +838,7 @@ Reference< XAxis > SAL_CALL DiagramWrapper::getAxis( sal_Int32 nDimensionIndex )
Reference< XAxis > SAL_CALL DiagramWrapper::getSecondaryAxis( sal_Int32 nDimensionIndex )
{
- Reference< XAxis > xAxis;
+ rtl::Reference< AxisWrapper > xAxis;
if(!nDimensionIndex)
{
if( !m_xSecondXAxis.is() )
@@ -882,7 +886,7 @@ Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis()
{
if( ! m_xZAxis.is())
m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
- return Reference< beans::XPropertySet >( m_xZAxis, uno::UNO_QUERY );
+ return m_xZAxis;
}
// ____ XTwoAxisXSupplier ____
@@ -890,7 +894,7 @@ Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis()
{
if( ! m_xSecondXAxis.is())
m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
- return Reference< beans::XPropertySet >( m_xSecondXAxis, uno::UNO_QUERY );
+ return m_xSecondXAxis;
}
// ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
@@ -907,7 +911,7 @@ Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis()
{
if( ! m_xXAxis.is())
m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
- return Reference< beans::XPropertySet >( m_xXAxis, uno::UNO_QUERY );
+ return m_xXAxis;
}
Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid()
@@ -933,7 +937,7 @@ Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis()
{
if( ! m_xSecondYAxis.is())
m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
- return Reference< beans::XPropertySet >( m_xSecondYAxis, uno::UNO_QUERY );
+ return m_xSecondYAxis;
}
// ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
@@ -950,7 +954,7 @@ Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis()
{
if( ! m_xYAxis.is())
m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
- return Reference< beans::XPropertySet >( m_xYAxis, uno::UNO_QUERY );
+ return m_xYAxis;
}
Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid()
@@ -1066,9 +1070,8 @@ void SAL_CALL DiagramWrapper::setDefaultIllumination()
// ____ XComponent ____
void SAL_CALL DiagramWrapper::dispose()
{
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( static_cast< ::cppu::OWeakObject* >( this )));
-
- MutexGuard aGuard( m_aMutex);
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( static_cast< ::cppu::OWeakObject* >( this )));
DisposeHelper::DisposeAndClear( m_xXAxis );
DisposeHelper::DisposeAndClear( m_xYAxis );
@@ -1087,13 +1090,15 @@ void SAL_CALL DiagramWrapper::dispose()
void SAL_CALL DiagramWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL DiagramWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
namespace {
@@ -1102,7 +1107,7 @@ namespace {
class WrappedDataRowSourceProperty : public WrappedProperty
{
public:
- explicit WrappedDataRowSourceProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedDataRowSourceProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -1117,9 +1122,9 @@ private: //member
}
-WrappedDataRowSourceProperty::WrappedDataRowSourceProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("DataRowSource",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedDataRowSourceProperty::WrappedDataRowSourceProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"DataRowSource"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
m_aOuterValue = WrappedDataRowSourceProperty::getPropertyDefault( nullptr );
}
@@ -1131,7 +1136,7 @@ void WrappedDataRowSourceProperty::setPropertyValue( const Any& rOuterValue, con
{
sal_Int32 nNew = sal_Int32(css::chart::ChartDataRowSource_ROWS);
if( !(rOuterValue >>= nNew) )
- throw lang::IllegalArgumentException( "Property DataRowSource requires css::chart::ChartDataRowSource value", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property DataRowSource requires css::chart::ChartDataRowSource value"_ustr, nullptr, 0 );
eChartDataRowSource = css::chart::ChartDataRowSource(nNew);
}
@@ -1195,7 +1200,7 @@ namespace {
class WrappedStackingProperty : public WrappedProperty
{
public:
- WrappedStackingProperty(StackMode eStackMode, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ WrappedStackingProperty(StackMode eStackMode, std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -1214,9 +1219,9 @@ std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
}
-WrappedStackingProperty::WrappedStackingProperty(StackMode eStackMode, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
+WrappedStackingProperty::WrappedStackingProperty(StackMode eStackMode, std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
: WrappedProperty(OUString(),OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
, m_eStackMode( eStackMode )
{
switch( m_eStackMode )
@@ -1240,8 +1245,8 @@ bool WrappedStackingProperty::detectInnerValue( StackMode& eStackMode ) const
{
bool bHasDetectableInnerValue = false;
bool bIsAmbiguous = false;
- eStackMode = DiagramHelper::getStackMode( m_spChart2ModelContact->getDiagram()
- , bHasDetectableInnerValue, bIsAmbiguous );
+ rtl::Reference<Diagram> xDiagram = m_spChart2ModelContact->getDiagram();
+ eStackMode = xDiagram ? xDiagram->getStackMode( bHasDetectableInnerValue, bIsAmbiguous ) : StackMode::NONE;
return bHasDetectableInnerValue;
}
@@ -1249,7 +1254,7 @@ void WrappedStackingProperty::setPropertyValue( const Any& rOuterValue, const Re
{
bool bNewValue = false;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( "Stacking Properties require boolean values", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Stacking Properties require boolean values"_ustr, nullptr, 0 );
StackMode eInnerStackMode;
bool bHasDetectableInnerValue = detectInnerValue( eInnerStackMode );
@@ -1269,7 +1274,7 @@ void WrappedStackingProperty::setPropertyValue( const Any& rOuterValue, const Re
if( xDiagram.is() )
{
StackMode eNewStackMode = bNewValue ? m_eStackMode : StackMode::NONE;
- DiagramHelper::setStackMode( xDiagram, eNewStackMode );
+ xDiagram->setStackMode( eNewStackMode );
}
}
@@ -1297,7 +1302,7 @@ namespace {
class WrappedDim3DProperty : public WrappedProperty
{
public:
- explicit WrappedDim3DProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedDim3DProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -1312,9 +1317,9 @@ private: //member
}
-WrappedDim3DProperty::WrappedDim3DProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("Dim3D",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedDim3DProperty::WrappedDim3DProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"Dim3D"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
m_aOuterValue = WrappedDim3DProperty::getPropertyDefault( nullptr );
}
@@ -1323,7 +1328,7 @@ void WrappedDim3DProperty::setPropertyValue( const Any& rOuterValue, const Refer
{
bool bNew3D = false;
if( ! (rOuterValue >>= bNew3D) )
- throw lang::IllegalArgumentException( "Property Dim3D requires boolean value", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property Dim3D requires boolean value"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
@@ -1331,9 +1336,9 @@ void WrappedDim3DProperty::setPropertyValue( const Any& rOuterValue, const Refer
if( !xDiagram.is() )
return;
- bool bOld3D = DiagramHelper::getDimension( xDiagram ) == 3;
+ bool bOld3D = xDiagram->getDimension() == 3;
if( bOld3D != bNew3D )
- DiagramHelper::setDimension( xDiagram, bNew3D ? 3 : 2 );
+ xDiagram->setDimension( bNew3D ? 3 : 2 );
}
Any WrappedDim3DProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
@@ -1341,7 +1346,7 @@ Any WrappedDim3DProperty::getPropertyValue( const Reference< beans::XPropertySet
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
if( xDiagram.is() )
{
- bool b3D = DiagramHelper::getDimension( xDiagram ) == 3;
+ bool b3D = xDiagram->getDimension() == 3;
m_aOuterValue <<= b3D;
}
return m_aOuterValue;
@@ -1360,7 +1365,7 @@ namespace {
class WrappedVerticalProperty : public WrappedProperty
{
public:
- explicit WrappedVerticalProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedVerticalProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -1375,9 +1380,9 @@ private: //member
}
-WrappedVerticalProperty::WrappedVerticalProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("Vertical",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedVerticalProperty::WrappedVerticalProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"Vertical"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
m_aOuterValue = WrappedVerticalProperty::getPropertyDefault( nullptr );
}
@@ -1386,7 +1391,7 @@ void WrappedVerticalProperty::setPropertyValue( const Any& rOuterValue, const Re
{
bool bNewVertical = false;
if( ! (rOuterValue >>= bNewVertical) )
- throw lang::IllegalArgumentException( "Property Vertical requires boolean value", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property Vertical requires boolean value"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
@@ -1396,9 +1401,9 @@ void WrappedVerticalProperty::setPropertyValue( const Any& rOuterValue, const Re
bool bFound = false;
bool bAmbiguous = false;
- bool bOldVertical = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
+ bool bOldVertical = xDiagram->getVertical( bFound, bAmbiguous );
if( bFound && ( bOldVertical != bNewVertical || bAmbiguous ) )
- DiagramHelper::setVertical( xDiagram, bNewVertical );
+ xDiagram->setVertical( bNewVertical );
}
Any WrappedVerticalProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
@@ -1408,7 +1413,7 @@ Any WrappedVerticalProperty::getPropertyValue( const Reference< beans::XProperty
{
bool bFound = false;
bool bAmbiguous = false;
- bool bVertical = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
+ bool bVertical = xDiagram->getVertical( bFound, bAmbiguous );
if( bFound )
m_aOuterValue <<= bVertical;
}
@@ -1428,7 +1433,7 @@ namespace {
class WrappedNumberOfLinesProperty : public WrappedProperty
{
public:
- explicit WrappedNumberOfLinesProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedNumberOfLinesProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -1446,9 +1451,9 @@ private: //member
}
-WrappedNumberOfLinesProperty::WrappedNumberOfLinesProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("NumberOfLines",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedNumberOfLinesProperty::WrappedNumberOfLinesProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"NumberOfLines"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
, m_aOuterValue( getPropertyDefault(nullptr) )
{
}
@@ -1461,13 +1466,13 @@ bool WrappedNumberOfLinesProperty::detectInnerValue( uno::Any& rInnerValue ) con
rtl::Reference< ChartModel > xChartDoc( m_spChart2ModelContact->getDocumentModel() );
if( xDiagram.is() && xChartDoc.is() )
{
- std::vector< uno::Reference< chart2::XDataSeries > > aSeriesVector(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector =
+ xDiagram->getDataSeries();
if( !aSeriesVector.empty() )
{
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = xChartDoc->getTypeManager();
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
+ Diagram::tTemplateWithServiceName aTemplateAndService =
+ xDiagram->getTemplate( xChartTypeManager );
if( aTemplateAndService.sServiceName == "com.sun.star.chart2.template.ColumnWithLine" )
{
try
@@ -1492,19 +1497,21 @@ void WrappedNumberOfLinesProperty::setPropertyValue( const Any& rOuterValue, con
{
sal_Int32 nNewValue;
if( ! (rOuterValue >>= nNewValue) )
- throw lang::IllegalArgumentException( "property NumberOfLines requires sal_Int32 value", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"property NumberOfLines requires sal_Int32 value"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
rtl::Reference< ChartModel > xChartDoc( m_spChart2ModelContact->getDocumentModel() );
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- sal_Int32 nDimension = ::chart::DiagramHelper::getDimension( xDiagram );
- if( !(xChartDoc.is() && xDiagram.is() && nDimension == 2) )
+ if( !xChartDoc || !xDiagram )
+ return;
+ sal_Int32 nDimension = xDiagram->getDimension();
+ if( nDimension != 2 )
return;
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = xChartDoc->getTypeManager();
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
+ Diagram::tTemplateWithServiceName aTemplateAndService =
+ xDiagram->getTemplate( xChartTypeManager );
rtl::Reference< ChartTypeTemplate > xTemplate;
if( aTemplateAndService.sServiceName == "com.sun.star.chart2.template.ColumnWithLine" )
@@ -1527,14 +1534,14 @@ void WrappedNumberOfLinesProperty::setPropertyValue( const Any& rOuterValue, con
}
else
{
- xTemplate = xChartTypeManager->createTemplate("com.sun.star.chart2.template.Column");
+ xTemplate = xChartTypeManager->createTemplate(u"com.sun.star.chart2.template.Column"_ustr);
}
}
else if( aTemplateAndService.sServiceName == "com.sun.star.chart2.template.Column" )
{
if( nNewValue == 0 )
return;
- xTemplate = xChartTypeManager->createTemplate( "com.sun.star.chart2.template.ColumnWithLine" );
+ xTemplate = xChartTypeManager->createTemplate( u"com.sun.star.chart2.template.ColumnWithLine"_ustr );
}
if(!xTemplate.is())
@@ -1545,7 +1552,7 @@ void WrappedNumberOfLinesProperty::setPropertyValue( const Any& rOuterValue, con
// locked controllers
ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getDocumentModel() );
uno::Reference< beans::XPropertySet > xProp( static_cast<cppu::OWeakObject*>(xTemplate.get()), uno::UNO_QUERY );
- xProp->setPropertyValue( "NumberOfLines", uno::Any(nNewValue) );
+ xProp->setPropertyValue( u"NumberOfLines"_ustr, uno::Any(nNewValue) );
xTemplate->changeDiagram( xDiagram );
}
catch( const uno::Exception & )
@@ -1575,7 +1582,7 @@ namespace {
class WrappedAttributedDataPointsProperty : public WrappedProperty
{
public:
- explicit WrappedAttributedDataPointsProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedAttributedDataPointsProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -1590,9 +1597,9 @@ private: //member
}
-WrappedAttributedDataPointsProperty::WrappedAttributedDataPointsProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("AttributedDataPoints",OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedAttributedDataPointsProperty::WrappedAttributedDataPointsProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"AttributedDataPoints"_ustr,OUString())
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
m_aOuterValue = WrappedAttributedDataPointsProperty::getPropertyDefault( nullptr );
}
@@ -1601,7 +1608,7 @@ void WrappedAttributedDataPointsProperty::setPropertyValue( const Any& rOuterVal
{
uno::Sequence< uno::Sequence< sal_Int32 > > aNewValue;
if( ! (rOuterValue >>= aNewValue) )
- throw lang::IllegalArgumentException( "Property AttributedDataPoints requires value of type uno::Sequence< uno::Sequence< sal_Int32 > >", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property AttributedDataPoints requires value of type uno::Sequence< uno::Sequence< sal_Int32 > >"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
@@ -1610,25 +1617,21 @@ void WrappedAttributedDataPointsProperty::setPropertyValue( const Any& rOuterVal
if( !xDiagram )
return;
- std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
- ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector =
+ xDiagram->getDataSeries();
sal_Int32 i = 0;
for (auto const& series : aSeriesVector)
{
- Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY);
- if( xProp.is())
+ uno::Any aVal;
+ if( i < aNewValue.getLength() )
+ aVal <<= aNewValue[i];
+ else
{
- uno::Any aVal;
- if( i < aNewValue.getLength() )
- aVal <<= aNewValue[i];
- else
- {
- //set empty sequence
- uno::Sequence< sal_Int32 > aSeq;
- aVal <<= aSeq;
- }
- xProp->setPropertyValue( "AttributedDataPoints", aVal );
+ //set empty sequence
+ uno::Sequence< sal_Int32 > aSeq;
+ aVal <<= aSeq;
}
+ series->setFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS, aVal ); // "AttributedDataPoints"
++i;
}
}
@@ -1639,23 +1642,19 @@ Any WrappedAttributedDataPointsProperty::getPropertyValue( const Reference< bean
if( xDiagram )
{
- std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
- ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector =
+ xDiagram->getDataSeries();
uno::Sequence< uno::Sequence< sal_Int32 > > aResult( aSeriesVector.size() );
auto aResultRange = asNonConstRange(aResult);
sal_Int32 i = 0;
for (auto const& series : aSeriesVector)
{
- Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY);
- if( xProp.is())
- {
- uno::Any aVal(
- xProp->getPropertyValue("AttributedDataPoints"));
- uno::Sequence< sal_Int32 > aSeq;
- if( aVal >>= aSeq )
- aResultRange[ i ] = aSeq;
- }
+ uno::Any aVal(
+ series->getFastPropertyValue(PROP_DATASERIES_ATTRIBUTED_DATA_POINTS)); // "AttributedDataPoints"
+ uno::Sequence< sal_Int32 > aSeq;
+ if( aVal >>= aSeq )
+ aResultRange[ i ] = std::move(aSeq);
++i;
}
m_aOuterValue <<= aResult;
@@ -1677,7 +1676,7 @@ namespace {
class WrappedSolidTypeProperty : public WrappedProperty
{
public:
- explicit WrappedSolidTypeProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedSolidTypeProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -1692,9 +1691,9 @@ private: //member
}
-WrappedSolidTypeProperty::WrappedSolidTypeProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty( "SolidType", OUString() )
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedSolidTypeProperty::WrappedSolidTypeProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty( u"SolidType"_ustr, OUString() )
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
m_aOuterValue = WrappedSolidTypeProperty::getPropertyDefault( nullptr );
}
@@ -1703,7 +1702,7 @@ void WrappedSolidTypeProperty::setPropertyValue( const Any& rOuterValue, const R
{
sal_Int32 nNewSolidType = css::chart::ChartSolidType::RECTANGULAR_SOLID;
if( ! (rOuterValue >>= nNewSolidType) )
- throw lang::IllegalArgumentException( "Property SolidType requires integer value", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property SolidType requires integer value"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
@@ -1713,9 +1712,9 @@ void WrappedSolidTypeProperty::setPropertyValue( const Any& rOuterValue, const R
bool bFound = false;
bool bAmbiguous = false;
- sal_Int32 nOldSolidType = DiagramHelper::getGeometry3D( xDiagram, bFound, bAmbiguous );
+ sal_Int32 nOldSolidType = xDiagram->getGeometry3D( bFound, bAmbiguous );
if( bFound && ( nOldSolidType != nNewSolidType || bAmbiguous ) )
- DiagramHelper::setGeometry3D( xDiagram, nNewSolidType );
+ xDiagram->setGeometry3D( nNewSolidType );
}
Any WrappedSolidTypeProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
@@ -1725,7 +1724,7 @@ Any WrappedSolidTypeProperty::getPropertyValue( const Reference< beans::XPropert
{
bool bFound = false;
bool bAmbiguous = false;
- sal_Int32 nGeometry = DiagramHelper::getGeometry3D( xDiagram, bFound, bAmbiguous );
+ sal_Int32 nGeometry = xDiagram->getGeometry3D( bFound, bAmbiguous );
if( bFound )
m_aOuterValue <<= nGeometry;
}
@@ -1754,7 +1753,7 @@ public:
}
WrappedAutomaticSizeProperty::WrappedAutomaticSizeProperty()
- : WrappedProperty( "AutomaticSize", OUString() )
+ : WrappedProperty( u"AutomaticSize"_ustr, OUString() )
{
}
@@ -1765,15 +1764,15 @@ void WrappedAutomaticSizeProperty::setPropertyValue( const Any& rOuterValue, con
bool bNewValue = true;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( "Property AutomaticSize requires value of type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property AutomaticSize requires value of type boolean"_ustr, nullptr, 0 );
try
{
if( bNewValue )
{
- Any aRelativeSize( xInnerPropertySet->getPropertyValue( "RelativeSize" ) );
+ Any aRelativeSize( xInnerPropertySet->getPropertyValue( u"RelativeSize"_ustr ) );
if( aRelativeSize.hasValue() )
- xInnerPropertySet->setPropertyValue( "RelativeSize", Any() );
+ xInnerPropertySet->setPropertyValue( u"RelativeSize"_ustr, Any() );
}
}
catch( const uno::Exception & )
@@ -1787,7 +1786,7 @@ Any WrappedAutomaticSizeProperty::getPropertyValue( const Reference< beans::XPro
Any aRet( getPropertyDefault( Reference< beans::XPropertyState >( xInnerPropertySet, uno::UNO_QUERY ) ) );
if( xInnerPropertySet.is() )
{
- Any aRelativeSize( xInnerPropertySet->getPropertyValue( "RelativeSize" ) );
+ Any aRelativeSize( xInnerPropertySet->getPropertyValue( u"RelativeSize"_ustr ) );
if( !aRelativeSize.hasValue() )
aRet <<= true;
}
@@ -1807,7 +1806,7 @@ namespace {
class WrappedIncludeHiddenCellsProperty : public WrappedProperty
{
public:
- explicit WrappedIncludeHiddenCellsProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedIncludeHiddenCellsProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
virtual Any getPropertyValue(const Reference<beans::XPropertySet>& xInnerPropertySet) const override;
@@ -1818,9 +1817,9 @@ private: //member
}
-WrappedIncludeHiddenCellsProperty::WrappedIncludeHiddenCellsProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedProperty("IncludeHiddenCells","IncludeHiddenCells")
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedIncludeHiddenCellsProperty::WrappedIncludeHiddenCellsProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : WrappedProperty(u"IncludeHiddenCells"_ustr,u"IncludeHiddenCells"_ustr)
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
}
@@ -1828,14 +1827,14 @@ void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any& rOuterValue
{
bool bNewValue = false;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( "Property IncludeHiddenCells requires boolean value", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property IncludeHiddenCells requires boolean value"_ustr, nullptr, 0 );
- ChartModelHelper::setIncludeHiddenCells( bNewValue, *m_spChart2ModelContact->getDocumentModel() );
+ m_spChart2ModelContact->getDocumentModel()->setIncludeHiddenCells(bNewValue);
}
Any WrappedIncludeHiddenCellsProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
{
- bool bValue = ChartModelHelper::isIncludeHiddenCells( m_spChart2ModelContact->getDocumentModel() );
+ bool bValue = m_spChart2ModelContact->getDocumentModel()->isIncludeHiddenCells();
return uno::Any(bValue);
}
@@ -1845,6 +1844,11 @@ Reference< chart2::XDiagram > SAL_CALL DiagramWrapper::getDiagram()
return m_spChart2ModelContact->getDiagram();
}
+rtl::Reference< ::chart::Diagram > DiagramWrapper::getUnderlyingDiagram()
+{
+ return m_spChart2ModelContact->getDiagram();
+}
+
void SAL_CALL DiagramWrapper::setDiagram(
const Reference< chart2::XDiagram >& /*xDiagram*/ )
{
@@ -1859,7 +1863,7 @@ Reference< beans::XPropertySet > DiagramWrapper::getInnerPropertySet()
const Sequence< beans::Property >& DiagramWrapper::getPropertySequence()
{
- return *StaticDiagramWrapperPropertyArray::get();
+ return StaticDiagramWrapperPropertyArray();
}
std::vector< std::unique_ptr<WrappedProperty> > DiagramWrapper::createWrappedProperties()
@@ -1887,7 +1891,7 @@ std::vector< std::unique_ptr<WrappedProperty> > DiagramWrapper::createWrappedPro
aWrappedProperties.emplace_back( new WrappedVerticalProperty( m_spChart2ModelContact ) );
aWrappedProperties.emplace_back( new WrappedNumberOfLinesProperty( m_spChart2ModelContact ) );
aWrappedProperties.emplace_back( new WrappedAttributedDataPointsProperty( m_spChart2ModelContact ) );
- aWrappedProperties.emplace_back( new WrappedProperty( "StackedBarsConnected", "ConnectBars" ) );
+ aWrappedProperties.emplace_back( new WrappedProperty( u"StackedBarsConnected"_ustr, u"ConnectBars"_ustr ) );
aWrappedProperties.emplace_back( new WrappedSolidTypeProperty( m_spChart2ModelContact ) );
aWrappedProperties.emplace_back( new WrappedAutomaticSizeProperty() );
aWrappedProperties.emplace_back( new WrappedIncludeHiddenCellsProperty( m_spChart2ModelContact ) );
@@ -1897,7 +1901,7 @@ std::vector< std::unique_ptr<WrappedProperty> > DiagramWrapper::createWrappedPro
OUString SAL_CALL DiagramWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.Diagram";
+ return u"com.sun.star.comp.chart.Diagram"_ustr;
}
sal_Bool SAL_CALL DiagramWrapper::supportsService( const OUString& rServiceName )
@@ -1908,14 +1912,14 @@ sal_Bool SAL_CALL DiagramWrapper::supportsService( const OUString& rServiceName
css::uno::Sequence< OUString > SAL_CALL DiagramWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.Diagram",
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.chart.StackableDiagram",
- "com.sun.star.chart.ChartAxisXSupplier",
- "com.sun.star.chart.ChartAxisYSupplier",
- "com.sun.star.chart.ChartAxisZSupplier",
- "com.sun.star.chart.ChartTwoAxisXSupplier",
- "com.sun.star.chart.ChartTwoAxisYSupplier"
+ u"com.sun.star.chart.Diagram"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.chart.StackableDiagram"_ustr,
+ u"com.sun.star.chart.ChartAxisXSupplier"_ustr,
+ u"com.sun.star.chart.ChartAxisYSupplier"_ustr,
+ u"com.sun.star.chart.ChartAxisZSupplier"_ustr,
+ u"com.sun.star.chart.ChartTwoAxisXSupplier"_ustr,
+ u"com.sun.star.chart.ChartTwoAxisYSupplier"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
index bef53a739386..99fdf7fa02d4 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
@@ -20,7 +20,7 @@
#include <WrappedPropertySet.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XDiagramProvider.hpp>
#include <com/sun/star/chart/XDiagram.hpp>
@@ -33,16 +33,20 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
-
#include <com/sun/star/chart/X3DDefaultSetter.hpp>
+#include <rtl/ref.hxx>
#include <memory>
namespace com::sun::star::chart2 { class XDiagram; }
namespace com::sun::star::lang { class XEventListener; }
+namespace chart { class Diagram; }
namespace chart::wrapper
{
-
+class AxisWrapper;
+class WallFloorWrapper;
+class MinMaxLineWrapper;
+class UpDownBarWrapper;
class Chart2ModelContact;
class DiagramWrapper : public cppu::ImplInheritanceHelper<
@@ -63,7 +67,7 @@ class DiagramWrapper : public cppu::ImplInheritanceHelper<
>
{
public:
- explicit DiagramWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit DiagramWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~DiagramWrapper() override;
/// XServiceInfo declarations
@@ -178,6 +182,8 @@ public:
virtual css::uno::Reference< css::chart2::XDiagram > SAL_CALL getDiagram() override;
virtual void SAL_CALL setDiagram( const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override;
+ rtl::Reference< ::chart::Diagram > getUnderlyingDiagram();
+
protected:
// ____ WrappedPropertySet ____
virtual const css::uno::Sequence< css::beans::Property >& getPropertySequence() override;
@@ -186,30 +192,18 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
-
- css::uno::Reference<
- css::chart::XAxis > m_xXAxis;
- css::uno::Reference<
- css::chart::XAxis > m_xYAxis;
- css::uno::Reference<
- css::chart::XAxis > m_xZAxis;
- css::uno::Reference<
- css::chart::XAxis > m_xSecondXAxis;
- css::uno::Reference<
- css::chart::XAxis > m_xSecondYAxis;
-
- css::uno::Reference<
- css::beans::XPropertySet > m_xWall;
- css::uno::Reference<
- css::beans::XPropertySet > m_xFloor;
-
- css::uno::Reference<
- css::beans::XPropertySet > m_xMinMaxLineWrapper;
- css::uno::Reference<
- css::beans::XPropertySet > m_xUpBarWrapper;
- css::uno::Reference<
- css::beans::XPropertySet > m_xDownBarWrapper;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
+
+ rtl::Reference< AxisWrapper > m_xXAxis;
+ rtl::Reference< AxisWrapper > m_xYAxis;
+ rtl::Reference< AxisWrapper > m_xZAxis;
+ rtl::Reference< AxisWrapper > m_xSecondXAxis;
+ rtl::Reference< AxisWrapper > m_xSecondYAxis;
+ rtl::Reference< WallFloorWrapper > m_xWall;
+ rtl::Reference< WallFloorWrapper > m_xFloor;
+ rtl::Reference< MinMaxLineWrapper > m_xMinMaxLineWrapper;
+ rtl::Reference< UpDownBarWrapper > m_xUpBarWrapper;
+ rtl::Reference< UpDownBarWrapper > m_xDownBarWrapper;
};
} // namespace chart::wrapper
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
index 0cf33baa5848..4931b661cc53 100644
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
@@ -30,51 +30,20 @@
#include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <algorithm>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using ::com::sun::star::beans::Property;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-namespace
-{
-
-struct StaticGridWrapperPropertyArray_Initializer
-{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticGridWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticGridWrapperPropertyArray_Initializer >
-{
-};
-
-} // anonymous namespace
-
namespace chart::wrapper
{
-GridWrapper::GridWrapper(tGridType eType, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact(spChart2ModelContact)
- , m_aEventListenerContainer(m_aMutex)
+GridWrapper::GridWrapper(tGridType eType, std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact(std::move(spChart2ModelContact))
, m_eType(eType)
{
}
@@ -107,8 +76,9 @@ void GridWrapper::getDimensionAndSubGridBool( tGridType eType, sal_Int32& rnDime
// ____ XComponent ____
void SAL_CALL GridWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
clearWrappedPropertySet();
}
@@ -116,31 +86,33 @@ void SAL_CALL GridWrapper::dispose()
void SAL_CALL GridWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL GridWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
// WrappedPropertySet
Reference< beans::XPropertySet > GridWrapper::getInnerPropertySet()
{
- Reference< beans::XPropertySet > xRet;
+ rtl::Reference< GridProperties > xRet;
try
{
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- uno::Reference< XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 /*nCooSysIndex*/ ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 /*nCooSysIndex*/ ) );
sal_Int32 nDimensionIndex = 1;
bool bSubGrid = false;
getDimensionAndSubGridBool( m_eType, nDimensionIndex, bSubGrid );
sal_Int32 nSubGridIndex = bSubGrid ? 0 : -1;
- xRet.set( AxisHelper::getGridProperties( xCooSys , nDimensionIndex, MAIN_AXIS_INDEX, nSubGridIndex ) );
+ xRet = AxisHelper::getGridProperties( xCooSys , nDimensionIndex, MAIN_AXIS_INDEX, nSubGridIndex );
}
catch( const uno::Exception & )
{
@@ -151,21 +123,32 @@ Reference< beans::XPropertySet > GridWrapper::getInnerPropertySet()
const Sequence< beans::Property >& GridWrapper::getPropertySequence()
{
- return *StaticGridWrapperPropertyArray::get();
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
}
std::vector< std::unique_ptr<WrappedProperty> > GridWrapper::createWrappedProperties()
{
std::vector< std::unique_ptr<WrappedProperty> > aWrappedProperties;
- aWrappedProperties.emplace_back( new WrappedDefaultProperty( "LineColor", "LineColor", uno::Any( sal_Int32( 0x000000) ) ) ); // black
+ aWrappedProperties.emplace_back( new WrappedDefaultProperty( u"LineColor"_ustr, u"LineColor"_ustr, uno::Any( sal_Int32( 0x000000) ) ) ); // black
return aWrappedProperties;
}
OUString SAL_CALL GridWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.Grid";
+ return u"com.sun.star.comp.chart.Grid"_ustr;
}
sal_Bool SAL_CALL GridWrapper::supportsService( const OUString& rServiceName )
@@ -176,10 +159,10 @@ sal_Bool SAL_CALL GridWrapper::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL GridWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartGrid",
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.drawing.LineProperties",
- "com.sun.star.beans.PropertySet"
+ u"com.sun.star.chart.ChartGrid"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
index 0a16368e9ccf..c978f3bb8d83 100644
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
@@ -20,7 +20,7 @@
#include <WrappedPropertySet.hxx>
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -48,7 +48,7 @@ public:
Z_MINOR_GRID
};
- GridWrapper(tGridType eType, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ GridWrapper(tGridType eType, std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~GridWrapper() override;
static void getDimensionAndSubGridBool( tGridType eType, sal_Int32& rnDimensionIndex, bool& rbSubGrid );
@@ -71,7 +71,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
tGridType m_eType;
};
diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
index ca5a25005152..5d17f3a609c0 100644
--- a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
@@ -26,7 +26,6 @@
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
#include <CharacterProperties.hxx>
#include <LinePropertiesHelper.hxx>
@@ -39,10 +38,10 @@
#include "WrappedScaleTextProperties.hxx"
#include <algorithm>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::beans::Property;
-using ::osl::MutexGuard;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -67,7 +66,7 @@ protected:
}
WrappedLegendAlignmentProperty::WrappedLegendAlignmentProperty()
- : ::chart::WrappedProperty( "Alignment", "AnchorPosition" )
+ : ::chart::WrappedProperty( u"Alignment"_ustr, u"AnchorPosition"_ustr )
{
}
@@ -77,7 +76,7 @@ Any WrappedLegendAlignmentProperty::getPropertyValue( const Reference< beans::XP
if( xInnerPropertySet.is() )
{
bool bShowLegend = true;
- xInnerPropertySet->getPropertyValue( "Show" ) >>= bShowLegend;
+ xInnerPropertySet->getPropertyValue( u"Show"_ustr ) >>= bShowLegend;
if(!bShowLegend)
{
aRet <<= css::chart::ChartLegendPosition_NONE;
@@ -102,11 +101,11 @@ void WrappedLegendAlignmentProperty::setPropertyValue( const Any& rOuterValue, c
css::chart::ChartLegendPosition eOuterPos(css::chart::ChartLegendPosition_NONE);
if( (rOuterValue >>= eOuterPos) && eOuterPos == css::chart::ChartLegendPosition_NONE )
bNewShowLegend = false;
- xInnerPropertySet->getPropertyValue( "Show" ) >>= bOldShowLegend;
+ xInnerPropertySet->getPropertyValue( u"Show"_ustr ) >>= bOldShowLegend;
}
if(bNewShowLegend!=bOldShowLegend)
{
- xInnerPropertySet->setPropertyValue( "Show", uno::Any(bNewShowLegend) );
+ xInnerPropertySet->setPropertyValue( u"Show"_ustr, uno::Any(bNewShowLegend) );
}
if(!bNewShowLegend)
return;
@@ -127,17 +126,17 @@ void WrappedLegendAlignmentProperty::setPropertyValue( const Any& rOuterValue, c
css::chart::ChartLegendExpansion eOldExpansion( css::chart::ChartLegendExpansion_HIGH );
bool bExpansionWasSet(
- xInnerPropertySet->getPropertyValue( "Expansion" ) >>= eOldExpansion );
+ xInnerPropertySet->getPropertyValue( u"Expansion"_ustr ) >>= eOldExpansion );
if( !bExpansionWasSet || (eOldExpansion != eNewExpansion))
- xInnerPropertySet->setPropertyValue( "Expansion", uno::Any( eNewExpansion ));
+ xInnerPropertySet->setPropertyValue( u"Expansion"_ustr, uno::Any( eNewExpansion ));
}
//correct RelativePosition
- Any aRelativePosition( xInnerPropertySet->getPropertyValue("RelativePosition") );
+ Any aRelativePosition( xInnerPropertySet->getPropertyValue(u"RelativePosition"_ustr) );
if(aRelativePosition.hasValue())
{
- xInnerPropertySet->setPropertyValue( "RelativePosition", Any() );
+ xInnerPropertySet->setPropertyValue( u"RelativePosition"_ustr, Any() );
}
}
@@ -225,35 +224,25 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT );
}
-struct StaticLegendWrapperPropertyArray_Initializer
-{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- ::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
- ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticLegendWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticLegendWrapperPropertyArray_Initializer >
+const Sequence< Property >& StaticLegendWrapperPropertyArray()
{
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+ ::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
+ ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
};
} // anonymous namespace
@@ -261,9 +250,8 @@ struct StaticLegendWrapperPropertyArray : public rtl::StaticAggregate< Sequence<
namespace chart::wrapper
{
-LegendWrapper::LegendWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact(spChart2ModelContact)
- , m_aEventListenerContainer(m_aMutex)
+LegendWrapper::LegendWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact(std::move(spChart2ModelContact))
{
}
@@ -288,7 +276,7 @@ void SAL_CALL LegendWrapper::setPosition( const awt::Point& aPosition )
aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
aRelativePosition.Primary = aPageSize.Width == 0 ? 0 : double(aPosition.X)/double(aPageSize.Width);
aRelativePosition.Secondary = aPageSize.Height == 0 ? 0 : double(aPosition.Y)/double(aPageSize.Height);
- xProp->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) );
+ xProp->setPropertyValue( u"RelativePosition"_ustr, uno::Any(aRelativePosition) );
}
}
@@ -316,29 +304,31 @@ void SAL_CALL LegendWrapper::setSize( const awt::Size& aSize )
// ____ XShapeDescriptor (base of XShape) ____
OUString SAL_CALL LegendWrapper::getShapeType()
{
- return "com.sun.star.chart.ChartLegend";
+ return u"com.sun.star.chart.ChartLegend"_ustr;
}
// ____ XComponent ____
void SAL_CALL LegendWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
- MutexGuard aGuard( m_aMutex);
clearWrappedPropertySet();
}
void SAL_CALL LegendWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL LegendWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
//ReferenceSizePropertyProvider
@@ -347,8 +337,8 @@ void LegendWrapper::updateReferenceSize()
Reference< beans::XPropertySet > xProp = getInnerPropertySet();
if( xProp.is() )
{
- if( xProp->getPropertyValue( "ReferencePageSize" ).hasValue() )
- xProp->setPropertyValue( "ReferencePageSize", uno::Any(
+ if( xProp->getPropertyValue( u"ReferencePageSize"_ustr ).hasValue() )
+ xProp->setPropertyValue( u"ReferencePageSize"_ustr, uno::Any(
m_spChart2ModelContact->GetPageSize() ));
}
}
@@ -357,7 +347,7 @@ Any LegendWrapper::getReferenceSize()
Any aRet;
Reference< beans::XPropertySet > xProp = getInnerPropertySet();
if( xProp.is() )
- aRet = xProp->getPropertyValue( "ReferencePageSize" );
+ aRet = xProp->getPropertyValue( u"ReferencePageSize"_ustr );
return aRet;
}
@@ -379,7 +369,7 @@ Reference< beans::XPropertySet > LegendWrapper::getInnerPropertySet()
const Sequence< beans::Property >& LegendWrapper::getPropertySequence()
{
- return *StaticLegendWrapperPropertyArray::get();
+ return StaticLegendWrapperPropertyArray();
}
std::vector< std::unique_ptr<WrappedProperty> > LegendWrapper::createWrappedProperties()
@@ -387,11 +377,11 @@ std::vector< std::unique_ptr<WrappedProperty> > LegendWrapper::createWrappedProp
std::vector< std::unique_ptr<WrappedProperty> > aWrappedProperties;
aWrappedProperties.emplace_back( new WrappedLegendAlignmentProperty() );
- aWrappedProperties.emplace_back( new WrappedProperty( "Expansion", "Expansion"));
+ aWrappedProperties.emplace_back( new WrappedProperty( u"Expansion"_ustr, u"Expansion"_ustr));
WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
//same problem as for wall: the defaults in the old chart are different for different charttypes, so we need to export explicitly
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty("FillStyle", "FillStyle"));
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty("FillColor", "FillColor"));
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty(u"FillStyle"_ustr, u"FillStyle"_ustr));
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty(u"FillColor"_ustr, u"FillColor"_ustr));
WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties );
WrappedScaleTextProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
@@ -400,7 +390,7 @@ std::vector< std::unique_ptr<WrappedProperty> > LegendWrapper::createWrappedProp
OUString SAL_CALL LegendWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.Legend";
+ return u"com.sun.star.comp.chart.Legend"_ustr;
}
sal_Bool SAL_CALL LegendWrapper::supportsService( const OUString& rServiceName )
@@ -411,10 +401,10 @@ sal_Bool SAL_CALL LegendWrapper::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL LegendWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartLegend",
- "com.sun.star.drawing.Shape",
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.style.CharacterProperties"
+ u"com.sun.star.chart.ChartLegend"_ustr,
+ u"com.sun.star.drawing.Shape"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.style.CharacterProperties"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.hxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.hxx
index 128c5fbcf970..5b4deac2a1f9 100644
--- a/chart2/source/controller/chartapiwrapper/LegendWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.hxx
@@ -21,7 +21,7 @@
#include <WrappedPropertySet.hxx>
#include "ReferenceSizePropertyProvider.hxx"
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -42,7 +42,7 @@ class LegendWrapper : public ::cppu::ImplInheritanceHelper<
, public ReferenceSizePropertyProvider
{
public:
- explicit LegendWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit LegendWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~LegendWrapper() override;
/// XServiceInfo declarations
@@ -79,7 +79,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
};
} // namespace chart::wrapper
diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
index 516a96b2a042..fa34ef63a825 100644
--- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
@@ -19,21 +19,19 @@
#include "MinMaxLineWrapper.hxx"
#include "Chart2ModelContact.hxx"
-#include <DiagramHelper.hxx>
+#include <ChartType.hxx>
#include <servicenames_charttypes.hxx>
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <com/sun/star/chart2/XChartType.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
#include <comphelper/sequence.hxx>
-
+#include <DataSeries.hxx>
#include <LinePropertiesHelper.hxx>
#include <UserDefinedProperties.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using ::com::sun::star::beans::Property;
using ::com::sun::star::uno::Reference;
@@ -43,72 +41,34 @@ using ::com::sun::star::uno::Any;
namespace
{
-struct StaticMinMaxLineWrapperDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- ::chart::LinePropertiesHelper::AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-};
-
-struct StaticMinMaxLineWrapperDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticMinMaxLineWrapperDefaults_Initializer >
-{
-};
-
-struct StaticMinMaxLineWrapperPropertyArray_Initializer
+Sequence< Property >& StaticMinMaxLineWrapperPropertyArray()
{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
-
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
-struct StaticMinMaxLineWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticMinMaxLineWrapperPropertyArray_Initializer >
-{
-};
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-struct StaticMinMaxLineWrapperInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( *StaticMinMaxLineWrapperPropertyArray::get() );
- return &aPropHelper;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticMinMaxLineWrapperInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticMinMaxLineWrapperInfoHelper_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
};
-struct StaticMinMaxLineWrapperInfo_Initializer
+::cppu::OPropertyArrayHelper& StaticMinMaxLineWrapperInfoHelper()
{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticMinMaxLineWrapperInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
+ static ::cppu::OPropertyArrayHelper aPropHelper( StaticMinMaxLineWrapperPropertyArray() );
+ return aPropHelper;
};
-struct StaticMinMaxLineWrapperInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticMinMaxLineWrapperInfo_Initializer >
+uno::Reference< beans::XPropertySetInfo >& StaticMinMaxLineWrapperInfo()
{
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo( StaticMinMaxLineWrapperInfoHelper() ) );
+ return xPropertySetInfo;
};
} // anonymous namespace
@@ -116,10 +76,9 @@ struct StaticMinMaxLineWrapperInfo : public rtl::StaticAggregate< uno::Reference
namespace chart::wrapper
{
-MinMaxLineWrapper::MinMaxLineWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact( spChart2ModelContact )
- , m_aEventListenerContainer( m_aMutex )
- , m_aWrappedLineJointProperty( "LineJoint", uno::Any( drawing::LineJoint_NONE ))
+MinMaxLineWrapper::MinMaxLineWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact(std::move( spChart2ModelContact ))
+ , m_aWrappedLineJointProperty( u"LineJoint"_ustr, uno::Any( drawing::LineJoint_NONE ))
{
}
@@ -130,58 +89,53 @@ MinMaxLineWrapper::~MinMaxLineWrapper()
// ____ XComponent ____
void SAL_CALL MinMaxLineWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
}
void SAL_CALL MinMaxLineWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL MinMaxLineWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
//XPropertySet
uno::Reference< beans::XPropertySetInfo > SAL_CALL MinMaxLineWrapper::getPropertySetInfo()
{
- return *StaticMinMaxLineWrapperInfo::get();
+ return StaticMinMaxLineWrapperInfo();
}
void SAL_CALL MinMaxLineWrapper::setPropertyValue( const OUString& rPropertyName, const uno::Any& rValue )
{
- Reference< beans::XPropertySet > xPropSet;
-
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- const Sequence< Reference< chart2::XChartType > > aTypes(
- ::chart::DiagramHelper::getChartTypesFromDiagram( xDiagram ) );
- for( Reference< chart2::XChartType > const & xType : aTypes )
+ const std::vector< rtl::Reference< ChartType > > aTypes = xDiagram->getChartTypes();
+ for( rtl::Reference< ChartType > const & xType : aTypes )
{
if( xType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK )
{
- Reference< chart2::XDataSeriesContainer > xSeriesContainer(xType,uno::UNO_QUERY);
- if( xSeriesContainer.is() )
+ const std::vector< rtl::Reference< DataSeries > > & aSeriesSeq( xType->getDataSeries2() );
+ if(!aSeriesSeq.empty())
{
- Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xSeriesContainer->getDataSeries() );
- if(aSeriesSeq.hasElements())
+ if(aSeriesSeq[0].is())
{
- xPropSet.set(aSeriesSeq[0],uno::UNO_QUERY);
- if(xPropSet.is())
- {
- if( rPropertyName == "LineColor" )
- xPropSet->setPropertyValue( "Color", rValue );
- else if( rPropertyName == "LineTransparence" )
- xPropSet->setPropertyValue( "Transparency", rValue );
- else if( rPropertyName == m_aWrappedLineJointProperty.getOuterName() )
- m_aWrappedLineJointProperty.setPropertyValue( rValue, xPropSet );
- else
- xPropSet->setPropertyValue( rPropertyName, rValue );
- return;
- }
+ if( rPropertyName == "LineColor" )
+ aSeriesSeq[0]->setPropertyValue( u"Color"_ustr, rValue );
+ else if( rPropertyName == "LineTransparence" )
+ aSeriesSeq[0]->setPropertyValue( u"Transparency"_ustr, rValue );
+ else if( rPropertyName == m_aWrappedLineJointProperty.getOuterName() )
+ m_aWrappedLineJointProperty.setPropertyValue( rValue, aSeriesSeq[0] );
+ else
+ aSeriesSeq[0]->setPropertyValue( rPropertyName, rValue );
+ return;
}
}
}
@@ -191,33 +145,28 @@ uno::Any SAL_CALL MinMaxLineWrapper::getPropertyValue( const OUString& rProperty
{
Any aRet;
- Reference< beans::XPropertySet > xPropSet;
+ rtl::Reference< DataSeries > xPropSet;
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- const Sequence< Reference< chart2::XChartType > > aTypes(
- ::chart::DiagramHelper::getChartTypesFromDiagram( xDiagram ) );
- for( Reference< chart2::XChartType > const & xType : aTypes )
+ const std::vector< rtl::Reference< ChartType > > aTypes = xDiagram->getChartTypes();
+ for( rtl::Reference< ChartType > const & xType : aTypes )
{
if( xType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK )
{
- Reference< chart2::XDataSeriesContainer > xSeriesContainer(xType,uno::UNO_QUERY);
- if( xSeriesContainer.is() )
+ const std::vector< rtl::Reference< DataSeries > > & aSeriesSeq( xType->getDataSeries2() );
+ if(!aSeriesSeq.empty())
{
- Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xSeriesContainer->getDataSeries() );
- if(aSeriesSeq.hasElements())
- {
- xPropSet.set(aSeriesSeq[0],uno::UNO_QUERY);
- break;
- }
+ xPropSet = aSeriesSeq[0];
+ break;
}
}
}
if(xPropSet.is())
{
if( rPropertyName == "LineColor" )
- aRet = xPropSet->getPropertyValue( "Color" );
+ aRet = xPropSet->getPropertyValue( u"Color"_ustr );
else if( rPropertyName == "LineTransparence" )
- aRet = xPropSet->getPropertyValue( "Transparency" );
+ aRet = xPropSet->getPropertyValue( u"Transparency"_ustr );
else if( rPropertyName == m_aWrappedLineJointProperty.getOuterName() )
aRet = m_aWrappedLineJointProperty.getPropertyValue( xPropSet );
else
@@ -251,7 +200,7 @@ void SAL_CALL MinMaxLineWrapper::setPropertyValues( const uno::Sequence< OUStrin
sal_Int32 nMinCount = std::min( rValueSeq.getLength(), rNameSeq.getLength() );
for(sal_Int32 nN=0; nN<nMinCount; nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
+ const OUString& aPropertyName( rNameSeq[nN] );
try
{
setPropertyValue( aPropertyName, rValueSeq[nN] );
@@ -272,7 +221,7 @@ uno::Sequence< uno::Any > SAL_CALL MinMaxLineWrapper::getPropertyValues( const u
auto pRetSeq = aRetSeq.getArray();
for(sal_Int32 nN=0; nN<rNameSeq.getLength(); nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
+ const OUString& aPropertyName( rNameSeq[nN] );
pRetSeq[nN] = getPropertyValue( aPropertyName );
}
}
@@ -319,7 +268,7 @@ uno::Sequence< beans::PropertyState > SAL_CALL MinMaxLineWrapper::getPropertySta
auto pRetSeq = aRetSeq.getArray();
for(sal_Int32 nN=0; nN<rNameSeq.getLength(); nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
+ const OUString& aPropertyName( rNameSeq[nN] );
pRetSeq[nN] = getPropertyState( aPropertyName );
}
}
@@ -332,9 +281,14 @@ void SAL_CALL MinMaxLineWrapper::setPropertyToDefault( const OUString& rProperty
uno::Any SAL_CALL MinMaxLineWrapper::getPropertyDefault( const OUString& rPropertyName )
{
- const tPropertyValueMap& rStaticDefaults = *StaticMinMaxLineWrapperDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( StaticMinMaxLineWrapperInfoHelper::get()->getHandleByName( rPropertyName ) ) );
- if( aFound == rStaticDefaults.end() )
+ static const ::chart::tPropertyValueMap aStaticDefaults = []
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aTmp );
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( StaticMinMaxLineWrapperInfoHelper().getHandleByName( rPropertyName ) ) );
+ if( aFound == aStaticDefaults.end() )
return uno::Any();
return (*aFound).second;
}
@@ -343,7 +297,7 @@ uno::Any SAL_CALL MinMaxLineWrapper::getPropertyDefault( const OUString& rProper
//getPropertyStates() already declared in XPropertyState
void SAL_CALL MinMaxLineWrapper::setAllPropertiesToDefault( )
{
- const Sequence< beans::Property >& rPropSeq = *StaticMinMaxLineWrapperPropertyArray::get();
+ const Sequence< beans::Property >& rPropSeq = StaticMinMaxLineWrapperPropertyArray();
for(beans::Property const & prop : rPropSeq)
{
setPropertyToDefault( prop.Name );
@@ -365,7 +319,7 @@ uno::Sequence< uno::Any > SAL_CALL MinMaxLineWrapper::getPropertyDefaults( const
auto pRetSeq = aRetSeq.getArray();
for(sal_Int32 nN=0; nN<rNameSeq.getLength(); nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
+ const OUString& aPropertyName( rNameSeq[nN] );
pRetSeq[nN] = getPropertyDefault( aPropertyName );
}
}
@@ -374,7 +328,7 @@ uno::Sequence< uno::Any > SAL_CALL MinMaxLineWrapper::getPropertyDefaults( const
OUString SAL_CALL MinMaxLineWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.ChartLine";
+ return u"com.sun.star.comp.chart.ChartLine"_ustr;
}
sal_Bool SAL_CALL MinMaxLineWrapper::supportsService( const OUString& rServiceName )
@@ -385,9 +339,9 @@ sal_Bool SAL_CALL MinMaxLineWrapper::supportsService( const OUString& rServiceNa
css::uno::Sequence< OUString > SAL_CALL MinMaxLineWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartLine",
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.drawing.LineProperties"
+ u"com.sun.star.chart.ChartLine"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
index 33cabe1743e2..337ca8bdebd7 100644
--- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
@@ -19,9 +19,8 @@
#pragma once
#include <WrappedIgnoreProperty.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertyStates.hpp>
@@ -37,8 +36,7 @@ namespace chart::wrapper
class Chart2ModelContact;
-class MinMaxLineWrapper : public cppu::BaseMutex
- , public ::cppu::WeakImplHelper
+class MinMaxLineWrapper : public ::cppu::WeakImplHelper
< css::lang::XComponent
, css::lang::XServiceInfo
, css::beans::XPropertySet
@@ -48,7 +46,7 @@ class MinMaxLineWrapper : public cppu::BaseMutex
>
{
public:
- explicit MinMaxLineWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit MinMaxLineWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~MinMaxLineWrapper() override;
/// XServiceInfo declarations
@@ -93,8 +91,9 @@ public:
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults( const css::uno::Sequence< OUString >& aPropertyNames ) override;
private: //member
+ std::mutex m_aMutex;
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
WrappedIgnoreProperty m_aWrappedLineJointProperty;
};
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index 074a37778e65..e4ca74c37f19 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -26,7 +26,6 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <CharacterProperties.hxx>
#include <LinePropertiesHelper.hxx>
@@ -40,10 +39,10 @@
#include <algorithm>
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/propshlp.hxx>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::beans::Property;
-using ::osl::MutexGuard;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -68,19 +67,19 @@ protected:
}
WrappedTitleStringProperty::WrappedTitleStringProperty( const Reference< uno::XComponentContext >& xContext )
- : ::chart::WrappedProperty( "String", OUString() )
+ : ::chart::WrappedProperty( u"String"_ustr, OUString() )
, m_xContext( xContext )
{
}
void WrappedTitleStringProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
{
- Reference< chart2::XTitle > xTitle(xInnerPropertySet,uno::UNO_QUERY);
- if(xTitle.is())
+ Title* pTitle = dynamic_cast<Title*>(xInnerPropertySet.get());
+ if(pTitle)
{
OUString aString;
rOuterValue >>= aString;
- TitleHelper::setCompleteString( aString, xTitle, m_xContext );
+ TitleHelper::setCompleteString( aString, pTitle, m_xContext );
}
}
Any WrappedTitleStringProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -107,6 +106,51 @@ Any WrappedTitleStringProperty::getPropertyDefault( const Reference< beans::XPro
namespace {
+ class WrappedTitleFormStringsProperty : public WrappedProperty
+ {
+ public:
+ explicit WrappedTitleFormStringsProperty();
+
+ virtual void setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const override;
+ virtual Any getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const override;
+ virtual Any getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const override;
+ };
+
+}
+
+WrappedTitleFormStringsProperty::WrappedTitleFormStringsProperty()
+ : ::chart::WrappedProperty( u"FormattedStrings"_ustr, OUString() )
+{
+}
+
+void WrappedTitleFormStringsProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
+{
+ Title* pTitle = dynamic_cast<Title*>(xInnerPropertySet.get());
+ if (pTitle)
+ {
+ Sequence< Reference< chart2::XFormattedString >> xFormattedStrings;
+ rOuterValue >>= xFormattedStrings;
+ TitleHelper::setFormattedString(pTitle, xFormattedStrings);
+ }
+}
+Any WrappedTitleFormStringsProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
+{
+ Any aRet(getPropertyDefault(Reference< beans::XPropertyState >(xInnerPropertySet, uno::UNO_QUERY)));
+ Reference< chart2::XTitle > xTitle(xInnerPropertySet, uno::UNO_QUERY);
+ if (xTitle.is())
+ {
+ const Sequence< Reference< chart2::XFormattedString > > aStrings(xTitle->getText());
+ aRet <<= aStrings;
+ }
+ return aRet;
+}
+Any WrappedTitleFormStringsProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
+{
+ return uno::Any(Sequence< Reference< chart2::XFormattedString > >()); //default title is an empty Sequence of XFormattedStrings
+}
+
+namespace {
+
class WrappedStackedTextProperty : public WrappedProperty
{
public:
@@ -116,7 +160,7 @@ public:
}
WrappedStackedTextProperty::WrappedStackedTextProperty()
- : ::chart::WrappedProperty( "StackedText", "StackCharacters" )
+ : ::chart::WrappedProperty( u"StackedText"_ustr, u"StackCharacters"_ustr )
{
}
@@ -128,6 +172,8 @@ namespace
enum
{
PROP_TITLE_STRING,
+ PROP_TITLE_FORMATTED_STRINGS,
+ PROP_TITLE_VISIBLE,
PROP_TITLE_TEXT_ROTATION,
PROP_TITLE_TEXT_STACKED
};
@@ -141,6 +187,18 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID );
+ rOutProperties.emplace_back( "FormattedStrings",
+ PROP_TITLE_FORMATTED_STRINGS,
+ cppu::UnoType< Sequence< Reference< chart2::XFormattedString >>>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID );
+
+ rOutProperties.emplace_back( "Visible",
+ PROP_TITLE_VISIBLE,
+ cppu::UnoType<OUString>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID );
+
rOutProperties.emplace_back( "TextRotation",
PROP_TITLE_TEXT_ROTATION,
cppu::UnoType<sal_Int32>::get(),
@@ -153,36 +211,27 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT );
}
-struct StaticTitleWrapperPropertyArray_Initializer
+const Sequence< Property > & StaticTitleWrapperPropertyArray()
{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- ::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
- ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+ ::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
+ ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
};
-struct StaticTitleWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticTitleWrapperPropertyArray_Initializer >
-{
-};
} // anonymous namespace
@@ -190,9 +239,8 @@ namespace chart::wrapper
{
TitleWrapper::TitleWrapper( ::chart::TitleHelper::eTitleType eTitleType,
- const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact ) :
- m_spChart2ModelContact( spChart2ModelContact ),
- m_aEventListenerContainer( m_aMutex ),
+ std::shared_ptr<Chart2ModelContact> spChart2ModelContact ) :
+ m_spChart2ModelContact(std::move( spChart2ModelContact )),
m_eTitleType(eTitleType)
{
ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getDocumentModel() );
@@ -221,7 +269,7 @@ void SAL_CALL TitleWrapper::setPosition( const awt::Point& aPosition )
aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
aRelativePosition.Primary = double(aPosition.X)/double(aPageSize.Width);
aRelativePosition.Secondary = double(aPosition.Y)/double(aPageSize.Height);
- xPropertySet->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) );
+ xPropertySet->setPropertyValue( u"RelativePosition"_ustr, uno::Any(aRelativePosition) );
}
}
@@ -238,44 +286,31 @@ void SAL_CALL TitleWrapper::setSize( const awt::Size& /*aSize*/ )
// ____ XShapeDescriptor (base of XShape) ____
OUString SAL_CALL TitleWrapper::getShapeType()
{
- return "com.sun.star.chart.ChartTitle";
+ return u"com.sun.star.chart.ChartTitle"_ustr;
}
// ____ XComponent ____
void SAL_CALL TitleWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
- MutexGuard aGuard( m_aMutex);
clearWrappedPropertySet();
}
void SAL_CALL TitleWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL TitleWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
-}
-
-Reference< beans::XPropertySet > TitleWrapper::getFirstCharacterPropertySet()
-{
- Reference< beans::XPropertySet > xProp;
-
- Reference< chart2::XTitle > xTitle( getTitleObject() );
- if( xTitle.is())
- {
- Sequence< Reference< chart2::XFormattedString > > aStrings( xTitle->getText());
- if( aStrings.hasElements() )
- xProp.set( aStrings[0], uno::UNO_QUERY );
- }
-
- return xProp;
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
void TitleWrapper::getFastCharacterPropertyValue( sal_Int32 nHandle, Any& rValue )
@@ -283,7 +318,7 @@ void TitleWrapper::getFastCharacterPropertyValue( sal_Int32 nHandle, Any& rValue
OSL_ASSERT( FAST_PROPERTY_ID_START_CHAR_PROP <= nHandle &&
nHandle < CharacterProperties::FAST_PROPERTY_ID_END_CHAR_PROP );
- Reference< beans::XPropertySet > xProp = getFirstCharacterPropertySet();
+ Reference< beans::XPropertySet > xProp = getInnerPropertySet();
Reference< beans::XFastPropertySet > xFastProp( xProp, uno::UNO_QUERY );
if(xProp.is())
{
@@ -323,6 +358,16 @@ void TitleWrapper::setFastCharacterPropertyValue(
else if( xFastPropertySet.is() )
xFastPropertySet->setFastPropertyValue( nHandle, rValue );
}
+
+ Reference< beans::XPropertySet > xInnerProp = getInnerPropertySet();
+ Reference< beans::XFastPropertySet > xFastInnerProp( xInnerProp, uno::UNO_QUERY );
+ if (xInnerProp.is())
+ {
+ if (pWrappedProperty)
+ pWrappedProperty->setPropertyValue(rValue, xInnerProp);
+ else if (xFastInnerProp.is())
+ xFastInnerProp->setFastPropertyValue(nHandle, rValue);
+ }
}
// WrappedPropertySet
@@ -356,7 +401,7 @@ beans::PropertyState SAL_CALL TitleWrapper::getPropertyState( const OUString& rP
sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
{
- Reference< beans::XPropertyState > xPropState( getFirstCharacterPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertyState > xPropState( getInnerPropertySet(), uno::UNO_QUERY);
if( xPropState.is() )
{
const WrappedProperty* pWrappedProperty = getWrappedProperty( rPropertyName );
@@ -389,7 +434,7 @@ Any SAL_CALL TitleWrapper::getPropertyDefault( const OUString& rPropertyName )
sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
{
- Reference< beans::XPropertyState > xPropState( getFirstCharacterPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertyState > xPropState( getInnerPropertySet(), uno::UNO_QUERY );
if( xPropState.is() )
{
const WrappedProperty* pWrappedProperty = getWrappedProperty( rPropertyName );
@@ -410,7 +455,7 @@ void SAL_CALL TitleWrapper::addPropertyChangeListener( const OUString& rProperty
sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
{
- Reference< beans::XPropertySet > xPropSet = getFirstCharacterPropertySet();
+ Reference< beans::XPropertySet > xPropSet = getInnerPropertySet();
if( xPropSet.is() )
xPropSet->addPropertyChangeListener( rPropertyName, xListener );
}
@@ -422,7 +467,7 @@ void SAL_CALL TitleWrapper::removePropertyChangeListener( const OUString& rPrope
sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
{
- Reference< beans::XPropertySet > xPropSet = getFirstCharacterPropertySet();
+ Reference< beans::XPropertySet > xPropSet = getInnerPropertySet();
if( xPropSet.is() )
xPropSet->removePropertyChangeListener( rPropertyName, xListener );
}
@@ -436,8 +481,8 @@ void TitleWrapper::updateReferenceSize()
Reference< beans::XPropertySet > xProp( getTitleObject(), uno::UNO_QUERY );
if( xProp.is() )
{
- if( xProp->getPropertyValue( "ReferencePageSize" ).hasValue() )
- xProp->setPropertyValue( "ReferencePageSize", uno::Any(
+ if( xProp->getPropertyValue( u"ReferencePageSize"_ustr ).hasValue() )
+ xProp->setPropertyValue( u"ReferencePageSize"_ustr, uno::Any(
m_spChart2ModelContact->GetPageSize() ));
}
}
@@ -446,7 +491,7 @@ Any TitleWrapper::getReferenceSize()
Any aRet;
Reference< beans::XPropertySet > xProp( getTitleObject(), uno::UNO_QUERY );
if( xProp.is() )
- aRet = xProp->getPropertyValue( "ReferencePageSize" );
+ aRet = xProp->getPropertyValue( u"ReferencePageSize"_ustr );
return aRet;
}
@@ -469,7 +514,7 @@ Reference< beans::XPropertySet > TitleWrapper::getInnerPropertySet()
const Sequence< beans::Property >& TitleWrapper::getPropertySequence()
{
- return *StaticTitleWrapperPropertyArray::get();
+ return StaticTitleWrapperPropertyArray();
}
std::vector< std::unique_ptr<WrappedProperty> > TitleWrapper::createWrappedProperties()
@@ -477,6 +522,7 @@ std::vector< std::unique_ptr<WrappedProperty> > TitleWrapper::createWrappedPrope
std::vector< std::unique_ptr<WrappedProperty> > aWrappedProperties;
aWrappedProperties.emplace_back( new WrappedTitleStringProperty( m_spChart2ModelContact->m_xContext ) );
+ aWrappedProperties.emplace_back( new WrappedTitleFormStringsProperty() );
aWrappedProperties.emplace_back( new WrappedTextRotationProperty( true ) );
aWrappedProperties.emplace_back( new WrappedStackedTextProperty() );
WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
@@ -488,7 +534,7 @@ std::vector< std::unique_ptr<WrappedProperty> > TitleWrapper::createWrappedPrope
OUString SAL_CALL TitleWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.Title";
+ return u"com.sun.star.comp.chart.Title"_ustr;
}
sal_Bool SAL_CALL TitleWrapper::supportsService( const OUString& rServiceName )
@@ -499,10 +545,10 @@ sal_Bool SAL_CALL TitleWrapper::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL TitleWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartTitle",
- "com.sun.star.drawing.Shape",
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.style.CharacterProperties"
+ u"com.sun.star.chart.ChartTitle"_ustr,
+ u"com.sun.star.drawing.Shape"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.style.CharacterProperties"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.hxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.hxx
index 5cc3ed477d01..03c551fcf52d 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.hxx
@@ -22,7 +22,7 @@
#include "ReferenceSizePropertyProvider.hxx"
#include <TitleHelper.hxx>
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -45,7 +45,7 @@ class TitleWrapper final : public ::cppu::ImplInheritanceHelper<
{
public:
TitleWrapper( ::chart::TitleHelper::eTitleType eTitleType,
- const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact );
+ std::shared_ptr<Chart2ModelContact> spChart2ModelContact );
virtual ~TitleWrapper() override;
/// XServiceInfo declarations
@@ -58,7 +58,6 @@ public:
virtual css::uno::Any getReferenceSize() override;
virtual css::awt::Size getCurrentSizeForReference() override;
-private:
// ____ XShape ____
virtual css::awt::Point SAL_CALL getPosition() override;
virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
@@ -95,12 +94,11 @@ private:
virtual const css::uno::Sequence< css::beans::Property >& getPropertySequence() override;
virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties() override;
- css::uno::Reference< css::beans::XPropertySet > getFirstCharacterPropertySet();
-
+private:
css::uno::Reference< css::chart2::XTitle > getTitleObject();
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
::chart::TitleHelper::eTitleType m_eTitleType;
};
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
index 2922f91c466b..92128857b891 100644
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
@@ -19,20 +19,19 @@
#include "UpDownBarWrapper.hxx"
#include "Chart2ModelContact.hxx"
-#include <DiagramHelper.hxx>
+#include <ChartType.hxx>
#include <servicenames_charttypes.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/propshlp.hxx>
-#include <com/sun/star/chart2/XChartType.hpp>
#include <comphelper/sequence.hxx>
#include <LinePropertiesHelper.hxx>
#include <FillProperties.hxx>
#include <UserDefinedProperties.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using ::com::sun::star::beans::Property;
using ::com::sun::star::uno::Reference;
@@ -42,79 +41,28 @@ using ::com::sun::star::uno::Any;
namespace
{
-struct StaticUpDownBarWrapperPropertyArray_Initializer
+const Sequence< Property > & StaticUpDownBarWrapperPropertyArray()
{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
-
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticUpDownBarWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticUpDownBarWrapperPropertyArray_Initializer >
-{
-};
-
-struct StaticUpDownBarWrapperInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( *StaticUpDownBarWrapperPropertyArray::get() );
- return &aPropHelper;
- }
-};
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
-struct StaticUpDownBarWrapperInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticUpDownBarWrapperInfoHelper_Initializer >
-{
-};
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-struct StaticUpDownBarWrapperInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticUpDownBarWrapperInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticUpDownBarWrapperInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticUpDownBarWrapperInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
};
-struct StaticUpDownBarWrapperDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
- ::chart::FillProperties::AddDefaultsToMap( rOutMap );
- }
-};
-
-struct StaticUpDownBarWrapperDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticUpDownBarWrapperDefaults_Initializer >
+::cppu::OPropertyArrayHelper& StaticUpDownBarWrapperInfoHelper()
{
+ static ::cppu::OPropertyArrayHelper aPropHelper( StaticUpDownBarWrapperPropertyArray() );
+ return aPropHelper;
};
} // anonymous namespace
@@ -123,10 +71,9 @@ namespace chart::wrapper
{
UpDownBarWrapper::UpDownBarWrapper(
- bool bUp, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : m_spChart2ModelContact( spChart2ModelContact )
- , m_aEventListenerContainer( m_aMutex )
- , m_aPropertySetName( bUp ? OUString( "WhiteDay" ) : OUString( "BlackDay" ))
+ bool bUp, std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : m_spChart2ModelContact(std::move( spChart2ModelContact ))
+ , m_aPropertySetName( bUp ? u"WhiteDay"_ustr : u"BlackDay"_ustr)
{
}
@@ -137,42 +84,44 @@ UpDownBarWrapper::~UpDownBarWrapper()
// ____ XComponent ____
void SAL_CALL UpDownBarWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
}
void SAL_CALL UpDownBarWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL UpDownBarWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
//XPropertySet
uno::Reference< beans::XPropertySetInfo > SAL_CALL UpDownBarWrapper::getPropertySetInfo()
{
- return *StaticUpDownBarWrapperInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticUpDownBarWrapperInfoHelper() ) );
+ return xPropertySetInfo;
}
+
void SAL_CALL UpDownBarWrapper::setPropertyValue( const OUString& rPropertyName, const uno::Any& rValue )
{
Reference< beans::XPropertySet > xPropSet;
- const Sequence< Reference< chart2::XChartType > > aTypes(
- ::chart::DiagramHelper::getChartTypesFromDiagram( m_spChart2ModelContact->getDiagram() ) );
- for( Reference< chart2::XChartType > const & xType : aTypes )
+ const std::vector< rtl::Reference< ChartType > > aTypes =
+ m_spChart2ModelContact->getDiagram()->getChartTypes();
+ for( rtl::Reference< ChartType > const & xType : aTypes )
{
if( xType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK )
{
- Reference< beans::XPropertySet > xTypeProps( xType, uno::UNO_QUERY );
- if(xTypeProps.is())
- {
- xTypeProps->getPropertyValue( m_aPropertySetName ) >>= xPropSet;
- }
+ xType->getPropertyValue( m_aPropertySetName ) >>= xPropSet;
}
}
if(xPropSet.is())
@@ -184,17 +133,13 @@ uno::Any SAL_CALL UpDownBarWrapper::getPropertyValue( const OUString& rPropertyN
Reference< beans::XPropertySet > xPropSet;
- const Sequence< Reference< chart2::XChartType > > aTypes(
- ::chart::DiagramHelper::getChartTypesFromDiagram( m_spChart2ModelContact->getDiagram() ) );
- for( Reference< chart2::XChartType > const & xType : aTypes )
+ const std::vector< rtl::Reference< ChartType > > aTypes =
+ m_spChart2ModelContact->getDiagram()->getChartTypes();
+ for( rtl::Reference<ChartType > const & xType : aTypes )
{
if( xType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK )
{
- Reference< beans::XPropertySet > xTypeProps( xType, uno::UNO_QUERY );
- if(xTypeProps.is())
- {
- xTypeProps->getPropertyValue( m_aPropertySetName ) >>= xPropSet;
- }
+ xType->getPropertyValue( m_aPropertySetName ) >>= xPropSet;
}
}
if(xPropSet.is())
@@ -226,7 +171,7 @@ void SAL_CALL UpDownBarWrapper::setPropertyValues( const uno::Sequence< OUString
sal_Int32 nMinCount = std::min( rValueSeq.getLength(), rNameSeq.getLength() );
for(sal_Int32 nN=0; nN<nMinCount; nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
+ const OUString& aPropertyName( rNameSeq[nN] );
try
{
setPropertyValue( aPropertyName, rValueSeq[nN] );
@@ -247,7 +192,7 @@ uno::Sequence< uno::Any > SAL_CALL UpDownBarWrapper::getPropertyValues( const un
auto pRetSeq = aRetSeq.getArray();
for(sal_Int32 nN=0; nN<rNameSeq.getLength(); nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
+ const OUString& aPropertyName( rNameSeq[nN] );
pRetSeq[nN] = getPropertyValue( aPropertyName );
}
}
@@ -286,7 +231,7 @@ uno::Sequence< beans::PropertyState > SAL_CALL UpDownBarWrapper::getPropertyStat
auto pRetSeq = aRetSeq.getArray();
for(sal_Int32 nN=0; nN<rNameSeq.getLength(); nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
+ const OUString& aPropertyName( rNameSeq[nN] );
pRetSeq[nN] = getPropertyState( aPropertyName );
}
}
@@ -299,9 +244,15 @@ void SAL_CALL UpDownBarWrapper::setPropertyToDefault( const OUString& rPropertyN
uno::Any SAL_CALL UpDownBarWrapper::getPropertyDefault( const OUString& rPropertyName )
{
- const tPropertyValueMap& rStaticDefaults = *StaticUpDownBarWrapperDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( StaticUpDownBarWrapperInfoHelper::get()->getHandleByName( rPropertyName ) ) );
- if( aFound == rStaticDefaults.end() )
+ static const ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aTmp );
+ ::chart::FillProperties::AddDefaultsToMap( aTmp );
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( StaticUpDownBarWrapperInfoHelper().getHandleByName( rPropertyName ) ) );
+ if( aFound == aStaticDefaults.end() )
return uno::Any();
return (*aFound).second;
}
@@ -310,7 +261,7 @@ uno::Any SAL_CALL UpDownBarWrapper::getPropertyDefault( const OUString& rPropert
//getPropertyStates() already declared in XPropertyState
void SAL_CALL UpDownBarWrapper::setAllPropertiesToDefault( )
{
- const Sequence< beans::Property >& rPropSeq = *StaticUpDownBarWrapperPropertyArray::get();
+ const Sequence< beans::Property >& rPropSeq = StaticUpDownBarWrapperPropertyArray();
for(beans::Property const & prop : rPropSeq)
{
setPropertyToDefault( prop.Name );
@@ -332,7 +283,7 @@ uno::Sequence< uno::Any > SAL_CALL UpDownBarWrapper::getPropertyDefaults( const
auto pRetSeq = aRetSeq.getArray();
for(sal_Int32 nN=0; nN<rNameSeq.getLength(); nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
+ const OUString& aPropertyName( rNameSeq[nN] );
pRetSeq[nN] = getPropertyDefault( aPropertyName );
}
}
@@ -341,7 +292,7 @@ uno::Sequence< uno::Any > SAL_CALL UpDownBarWrapper::getPropertyDefaults( const
OUString SAL_CALL UpDownBarWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.ChartArea";
+ return u"com.sun.star.comp.chart.ChartArea"_ustr;
}
sal_Bool SAL_CALL UpDownBarWrapper::supportsService( const OUString& rServiceName )
@@ -352,10 +303,10 @@ sal_Bool SAL_CALL UpDownBarWrapper::supportsService( const OUString& rServiceNam
css::uno::Sequence< OUString > SAL_CALL UpDownBarWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.chart.ChartArea",
- "com.sun.star.drawing.LineProperties",
- "com.sun.star.drawing.FillProperties",
- "com.sun.star.xml.UserDefinedAttributesSupplier"
+ u"com.sun.star.chart.ChartArea"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr,
+ u"com.sun.star.drawing.FillProperties"_ustr,
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
index 63e1c44db4d8..517a2406fe2c 100644
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
@@ -18,9 +18,8 @@
*/
#pragma once
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertyStates.hpp>
@@ -36,8 +35,7 @@ namespace chart::wrapper
class Chart2ModelContact;
-class UpDownBarWrapper : public cppu::BaseMutex
- , public ::cppu::WeakImplHelper
+class UpDownBarWrapper : public ::cppu::WeakImplHelper
< css::lang::XComponent
, css::lang::XServiceInfo
, css::beans::XPropertySet
@@ -47,7 +45,7 @@ class UpDownBarWrapper : public cppu::BaseMutex
>
{
public:
- UpDownBarWrapper(bool bUp, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ UpDownBarWrapper(bool bUp, std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~UpDownBarWrapper() override;
/// XServiceInfo declarations
@@ -94,8 +92,9 @@ public:
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults( const css::uno::Sequence< OUString >& aPropertyNames ) override;
private: //member
+ std::mutex m_aMutex;
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
OUString m_aPropertySetName;
};
diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
index 711f68201727..23ef0780ccae 100644
--- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
@@ -21,7 +21,6 @@
#include "Chart2ModelContact.hxx"
#include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <com/sun/star/chart2/XDiagram.hpp>
#include <FillProperties.hxx>
#include <LinePropertiesHelper.hxx>
@@ -29,54 +28,20 @@
#include <WrappedDirectStateProperty.hxx>
#include <algorithm>
+#include <utility>
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using ::com::sun::star::beans::Property;
-using ::osl::MutexGuard;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-namespace
-{
-
-struct StaticWallFloorWrapperPropertyArray_Initializer
-{
- Sequence< Property >* operator()()
- {
- static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
- return &aPropSeq;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticWallFloorWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticWallFloorWrapperPropertyArray_Initializer >
-{
-};
-
-} // anonymous namespace
-
namespace chart::wrapper
{
WallFloorWrapper::WallFloorWrapper( bool bWall,
- const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact ) :
- m_spChart2ModelContact( spChart2ModelContact ),
- m_aEventListenerContainer( m_aMutex ),
+ std::shared_ptr<Chart2ModelContact> spChart2ModelContact ) :
+ m_spChart2ModelContact(std::move( spChart2ModelContact )),
m_bWall( bWall )
{
@@ -89,23 +54,25 @@ WallFloorWrapper::~WallFloorWrapper()
// ____ XComponent ____
void SAL_CALL WallFloorWrapper::dispose()
{
+ std::unique_lock g(m_aMutex);
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ m_aEventListenerContainer.disposeAndClear( g, lang::EventObject( xSource ) );
- MutexGuard aGuard( m_aMutex);
clearWrappedPropertySet();
}
void SAL_CALL WallFloorWrapper::addEventListener(
const Reference< lang::XEventListener >& xListener )
{
- m_aEventListenerContainer.addInterface( xListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.addInterface( g, xListener );
}
void SAL_CALL WallFloorWrapper::removeEventListener(
const Reference< lang::XEventListener >& aListener )
{
- m_aEventListenerContainer.removeInterface( aListener );
+ std::unique_lock g(m_aMutex);
+ m_aEventListenerContainer.removeInterface( g, aListener );
}
// WrappedPropertySet
@@ -127,7 +94,19 @@ Reference< beans::XPropertySet > WallFloorWrapper::getInnerPropertySet()
const Sequence< beans::Property >& WallFloorWrapper::getPropertySequence()
{
- return *StaticWallFloorWrapperPropertyArray::get();
+ static Sequence< Property > aPropSeq = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropSeq;
}
std::vector< std::unique_ptr<WrappedProperty> > WallFloorWrapper::createWrappedProperties()
@@ -138,15 +117,15 @@ std::vector< std::unique_ptr<WrappedProperty> > WallFloorWrapper::createWrappedP
// exported. Because in the old chart the defaults is as follows:
// Floor: SOLID (new and old model default), Wall: NONE, except for some chart types (line, scatter)
if( m_bWall )
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty( "FillStyle", "FillStyle" ));
- aWrappedProperties.emplace_back( new WrappedDirectStateProperty( "FillColor", "FillColor" ));
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty( u"FillStyle"_ustr, u"FillStyle"_ustr ));
+ aWrappedProperties.emplace_back( new WrappedDirectStateProperty( u"FillColor"_ustr, u"FillColor"_ustr ));
return aWrappedProperties;
}
OUString SAL_CALL WallFloorWrapper::getImplementationName()
{
- return "com.sun.star.comp.chart.WallOrFloor";
+ return u"com.sun.star.comp.chart.WallOrFloor"_ustr;
}
sal_Bool SAL_CALL WallFloorWrapper::supportsService( const OUString& rServiceName )
@@ -157,10 +136,10 @@ sal_Bool SAL_CALL WallFloorWrapper::supportsService( const OUString& rServiceNam
css::uno::Sequence< OUString > SAL_CALL WallFloorWrapper::getSupportedServiceNames()
{
return {
- "com.sun.star.xml.UserDefinedAttributesSupplier",
- "com.sun.star.drawing.FillProperties",
- "com.sun.star.drawing.LineProperties",
- "com.sun.star.beans.PropertySet"
+ u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
+ u"com.sun.star.drawing.FillProperties"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr
};
}
diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx
index 3df4a9f1af0b..4a85bd8d5b37 100644
--- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.hxx
@@ -20,7 +20,7 @@
#include <WrappedPropertySet.hxx>
#include <cppuhelper/implbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -38,7 +38,7 @@ class WallFloorWrapper : public ::cppu::ImplInheritanceHelper<
>
{
public:
- WallFloorWrapper(bool bWall, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ WallFloorWrapper(bool bWall, std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~WallFloorWrapper() override;
/// XServiceInfo declarations
@@ -59,7 +59,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aEventListenerContainer;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListenerContainer;
bool m_bWall;
};
diff --git a/chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx
index 24a6dfb78a1c..261826eb0497 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx
@@ -29,7 +29,7 @@ namespace chart::wrapper
{
WrappedAddInProperty::WrappedAddInProperty( ChartDocumentWrapper& rChartDocumentWrapper )
- : ::chart::WrappedProperty( "AddIn", OUString() )
+ : ::chart::WrappedProperty( u"AddIn"_ustr, OUString() )
, m_rChartDocumentWrapper( rChartDocumentWrapper )
{
}
@@ -41,7 +41,7 @@ void WrappedAddInProperty::setPropertyValue( const Any& rOuterValue, const Refer
{
Reference< util::XRefreshable > xAddIn;
if( ! (rOuterValue >>= xAddIn) )
- throw lang::IllegalArgumentException( "AddIn properties require type XRefreshable", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"AddIn properties require type XRefreshable"_ustr, nullptr, 0 );
m_rChartDocumentWrapper.setAddIn( xAddIn );
}
@@ -52,7 +52,7 @@ Any WrappedAddInProperty::getPropertyValue( const Reference< beans::XPropertySet
}
WrappedBaseDiagramProperty::WrappedBaseDiagramProperty( ChartDocumentWrapper& rChartDocumentWrapper )
- : ::chart::WrappedProperty( "BaseDiagram" , OUString() )
+ : ::chart::WrappedProperty( u"BaseDiagram"_ustr , OUString() )
, m_rChartDocumentWrapper( rChartDocumentWrapper )
{
}
@@ -64,7 +64,7 @@ void WrappedBaseDiagramProperty::setPropertyValue( const Any& rOuterValue, const
{
OUString aBaseDiagram;
if( ! (rOuterValue >>= aBaseDiagram) )
- throw lang::IllegalArgumentException( "BaseDiagram properties require type OUString", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"BaseDiagram properties require type OUString"_ustr, nullptr, 0 );
m_rChartDocumentWrapper.setBaseDiagram( aBaseDiagram );
}
@@ -75,7 +75,7 @@ Any WrappedBaseDiagramProperty::getPropertyValue( const Reference< beans::XPrope
}
WrappedAdditionalShapesProperty::WrappedAdditionalShapesProperty( ChartDocumentWrapper& rChartDocumentWrapper )
- : ::chart::WrappedProperty( "AdditionalShapes" , OUString() )
+ : ::chart::WrappedProperty( u"AdditionalShapes"_ustr , OUString() )
, m_rChartDocumentWrapper( rChartDocumentWrapper )
{
}
@@ -85,7 +85,7 @@ WrappedAdditionalShapesProperty::~WrappedAdditionalShapesProperty()
void WrappedAdditionalShapesProperty::setPropertyValue( const Any& /*rOuterValue*/, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
{
- throw lang::IllegalArgumentException( "AdditionalShapes is a read only property", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"AdditionalShapes is a read only property"_ustr, nullptr, 0 );
}
Any WrappedAdditionalShapesProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
@@ -94,7 +94,7 @@ Any WrappedAdditionalShapesProperty::getPropertyValue( const Reference< beans::X
}
WrappedRefreshAddInAllowedProperty::WrappedRefreshAddInAllowedProperty( ChartDocumentWrapper& rChartDocumentWrapper )
- : ::chart::WrappedProperty( "RefreshAddInAllowed" , OUString() )
+ : ::chart::WrappedProperty( u"RefreshAddInAllowed"_ustr , OUString() )
, m_rChartDocumentWrapper( rChartDocumentWrapper )
{
}
@@ -106,7 +106,7 @@ void WrappedRefreshAddInAllowedProperty::setPropertyValue( const Any& rOuterValu
{
bool bUpdateAddIn = true;
if( ! (rOuterValue >>= bUpdateAddIn) )
- throw lang::IllegalArgumentException( "The property RefreshAddInAllowed requires type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"The property RefreshAddInAllowed requires type boolean"_ustr, nullptr, 0 );
m_rChartDocumentWrapper.setUpdateAddIn( bUpdateAddIn );
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
index 2bfb5ed42211..0434e6dc041e 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
@@ -23,7 +23,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
@@ -48,7 +48,7 @@ public:
}
WrappedAutomaticPositionProperty::WrappedAutomaticPositionProperty()
- : ::chart::WrappedProperty( "AutomaticPosition" , OUString() )
+ : ::chart::WrappedProperty( u"AutomaticPosition"_ustr , OUString() )
{
}
@@ -59,15 +59,15 @@ void WrappedAutomaticPositionProperty::setPropertyValue( const Any& rOuterValue,
bool bNewValue = true;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( "Property AutomaticPosition requires value of type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property AutomaticPosition requires value of type boolean"_ustr, nullptr, 0 );
try
{
if( bNewValue )
{
- Any aRelativePosition( xInnerPropertySet->getPropertyValue( "RelativePosition" ) );
+ Any aRelativePosition( xInnerPropertySet->getPropertyValue( u"RelativePosition"_ustr ) );
if( aRelativePosition.hasValue() )
- xInnerPropertySet->setPropertyValue( "RelativePosition", Any() );
+ xInnerPropertySet->setPropertyValue( u"RelativePosition"_ustr, Any() );
}
}
catch( const uno::Exception & )
@@ -81,7 +81,7 @@ Any WrappedAutomaticPositionProperty::getPropertyValue( const Reference< beans::
Any aRet( getPropertyDefault( Reference< beans::XPropertyState >( xInnerPropertySet, uno::UNO_QUERY ) ) );
if( xInnerPropertySet.is() )
{
- Any aRelativePosition( xInnerPropertySet->getPropertyValue( "RelativePosition" ) );
+ Any aRelativePosition( xInnerPropertySet->getPropertyValue( u"RelativePosition"_ustr ) );
if( !aRelativePosition.hasValue() )
aRet <<= true;
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
index 4895e1c40b9d..1208ad539d3e 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
@@ -23,13 +23,12 @@
#include "WrappedAxisAndGridExistenceProperties.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <WrappedProperty.hxx>
#include "Chart2ModelContact.hxx"
#include <TitleHelper.hxx>
-#include <ChartView.hxx>
+#include <utility>
#include <osl/diagnose.h>
using namespace ::com::sun::star;
@@ -45,7 +44,7 @@ class WrappedAxisAndGridExistenceProperty : public WrappedProperty
{
public:
WrappedAxisAndGridExistenceProperty( bool bAxis, bool bMain, sal_Int32 nDimensionIndex
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact );
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact );
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -81,9 +80,9 @@ void WrappedAxisAndGridExistenceProperties::addWrappedProperties( std::vector< s
}
WrappedAxisAndGridExistenceProperty::WrappedAxisAndGridExistenceProperty( bool bAxis, bool bMain, sal_Int32 nDimensionIndex
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact )
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact )
: WrappedProperty(OUString(),OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
, m_bAxis( bAxis )
, m_bMain( bMain )
, m_nDimensionIndex( nDimensionIndex )
@@ -150,7 +149,7 @@ void WrappedAxisAndGridExistenceProperty::setPropertyValue( const Any& rOuterVal
{
bool bNewValue = false;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( "Has axis or grid properties require boolean values", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Has axis or grid properties require boolean values"_ustr, nullptr, 0 );
bool bOldValue = false;
getPropertyValue( xInnerPropertySet ) >>= bOldValue;
@@ -205,7 +204,7 @@ class WrappedAxisTitleExistenceProperty : public WrappedProperty
{
public:
WrappedAxisTitleExistenceProperty( sal_Int32 nTitleIndex
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact );
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact );
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -231,9 +230,9 @@ void WrappedAxisTitleExistenceProperties::addWrappedProperties( std::vector< std
}
WrappedAxisTitleExistenceProperty::WrappedAxisTitleExistenceProperty(sal_Int32 nTitleIndex
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
: WrappedProperty(OUString(),OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
, m_eTitleType( TitleHelper::Y_AXIS_TITLE )
{
switch( nTitleIndex )
@@ -265,7 +264,7 @@ void WrappedAxisTitleExistenceProperty::setPropertyValue( const Any& rOuterValue
{
bool bNewValue = false;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( "Has axis or grid properties require boolean values", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Has axis or grid properties require boolean values"_ustr, nullptr, 0 );
bool bOldValue = false;
getPropertyValue( xInnerPropertySet ) >>= bOldValue;
@@ -288,7 +287,7 @@ Any WrappedAxisTitleExistenceProperty::getPropertyValue( const Reference< beans:
{
bool bHasTitle = false;
- Reference< chart2::XTitle > xTitle( TitleHelper::getTitle( m_eTitleType, m_spChart2ModelContact->getDocumentModel() ) );
+ rtl::Reference< Title > xTitle( TitleHelper::getTitle( m_eTitleType, m_spChart2ModelContact->getDocumentModel() ) );
if( xTitle.is() && !TitleHelper::getCompleteString( xTitle ).isEmpty() )
bHasTitle = true;
@@ -311,7 +310,7 @@ class WrappedAxisLabelExistenceProperty : public WrappedProperty
{
public:
WrappedAxisLabelExistenceProperty( bool bMain, sal_Int32 nDimensionIndex
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact );
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact );
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -338,9 +337,9 @@ void WrappedAxisLabelExistenceProperties::addWrappedProperties( std::vector< std
}
WrappedAxisLabelExistenceProperty::WrappedAxisLabelExistenceProperty(bool bMain, sal_Int32 nDimensionIndex
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
: WrappedProperty(OUString(),OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
, m_bMain( bMain )
, m_nDimensionIndex( nDimensionIndex )
{
@@ -363,7 +362,7 @@ void WrappedAxisLabelExistenceProperty::setPropertyValue( const Any& rOuterValue
{
bool bNewValue = false;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( "Has axis or grid properties require boolean values", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Has axis or grid properties require boolean values"_ustr, nullptr, 0 );
bool bOldValue = false;
getPropertyValue( xInnerPropertySet ) >>= bOldValue;
@@ -372,25 +371,25 @@ void WrappedAxisLabelExistenceProperty::setPropertyValue( const Any& rOuterValue
return;
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- Reference< beans::XPropertySet > xProp( AxisHelper::getAxis( m_nDimensionIndex, m_bMain, xDiagram ), uno::UNO_QUERY );
+ rtl::Reference< Axis > xProp = AxisHelper::getAxis( m_nDimensionIndex, m_bMain, xDiagram );
if( !xProp.is() && bNewValue )
{
//create axis if needed
- xProp.set( AxisHelper::createAxis( m_nDimensionIndex, m_bMain, xDiagram, m_spChart2ModelContact->m_xContext ), uno::UNO_QUERY );
+ xProp = AxisHelper::createAxis( m_nDimensionIndex, m_bMain, xDiagram, m_spChart2ModelContact->m_xContext );
if( xProp.is() )
- xProp->setPropertyValue( "Show", uno::Any( false ) );
+ xProp->setPropertyValue( u"Show"_ustr, uno::Any( false ) );
}
if( xProp.is() )
- xProp->setPropertyValue( "DisplayLabels", rOuterValue );
+ xProp->setPropertyValue( u"DisplayLabels"_ustr, rOuterValue );
}
Any WrappedAxisLabelExistenceProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
{
Any aRet;
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- Reference< beans::XPropertySet > xProp( AxisHelper::getAxis( m_nDimensionIndex, m_bMain, xDiagram ), uno::UNO_QUERY );
+ rtl::Reference< Axis > xProp = AxisHelper::getAxis( m_nDimensionIndex, m_bMain, xDiagram );
if( xProp.is() )
- aRet = xProp->getPropertyValue( "DisplayLabels" );
+ aRet = xProp->getPropertyValue( u"DisplayLabels"_ustr );
else
aRet <<= false;
return aRet;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
index 67ea51b0e913..6e09285dfd62 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
@@ -110,7 +110,7 @@ Any WrappedCharacterHeightProperty_Base::convertOuterToInnerValue( const Any& rO
}
WrappedCharacterHeightProperty::WrappedCharacterHeightProperty( ReferenceSizePropertyProvider* pRefSizePropProvider )
- : WrappedCharacterHeightProperty_Base( "CharHeight", pRefSizePropProvider )
+ : WrappedCharacterHeightProperty_Base( u"CharHeight"_ustr, pRefSizePropProvider )
{
}
WrappedCharacterHeightProperty::~WrappedCharacterHeightProperty()
@@ -118,7 +118,7 @@ WrappedCharacterHeightProperty::~WrappedCharacterHeightProperty()
}
WrappedAsianCharacterHeightProperty::WrappedAsianCharacterHeightProperty( ReferenceSizePropertyProvider* pRefSizePropProvider )
- : WrappedCharacterHeightProperty_Base( "CharHeightAsian", pRefSizePropProvider )
+ : WrappedCharacterHeightProperty_Base( u"CharHeightAsian"_ustr, pRefSizePropProvider )
{
}
WrappedAsianCharacterHeightProperty::~WrappedAsianCharacterHeightProperty()
@@ -126,7 +126,7 @@ WrappedAsianCharacterHeightProperty::~WrappedAsianCharacterHeightProperty()
}
WrappedComplexCharacterHeightProperty::WrappedComplexCharacterHeightProperty( ReferenceSizePropertyProvider* pRefSizePropProvider )
- : WrappedCharacterHeightProperty_Base( "CharHeightComplex", pRefSizePropProvider )
+ : WrappedCharacterHeightProperty_Base( u"CharHeightComplex"_ustr, pRefSizePropProvider )
{
}
WrappedComplexCharacterHeightProperty::~WrappedComplexCharacterHeightProperty()
diff --git a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.hxx
index 7eee90a2c209..be9457d0ffd7 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.hxx
@@ -45,7 +45,7 @@ protected:
virtual css::uno::Any convertInnerToOuterValue( const css::uno::Any& rInnerValue ) const override;
virtual css::uno::Any convertOuterToInnerValue( const css::uno::Any& rOuterValue ) const override;
-protected:
+private:
ReferenceSizePropertyProvider* m_pRefSizePropProvider;
};
diff --git a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
index d317210c3608..792bfdfadcb4 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
@@ -127,7 +127,7 @@ void WrappedDataCaptionProperties::addWrappedPropertiesForDiagram( std::vector<
WrappedDataCaptionProperty::WrappedDataCaptionProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact
, tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedSeriesOrDiagramProperty< sal_Int32 >( "DataCaption"
+ : WrappedSeriesOrDiagramProperty< sal_Int32 >( u"DataCaption"_ustr
, uno::Any( sal_Int32(0) ), spChart2ModelContact, ePropertyType )
{
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
index c0f100d335a7..1da4fe9195cb 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
@@ -17,10 +17,15 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "WrappedGapwidthProperty.hxx"
#include "Chart2ModelContact.hxx"
-#include <DiagramHelper.hxx>
+#include <ChartType.hxx>
#include <tools/long.hxx>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -35,15 +40,15 @@ const sal_Int32 DEFAULT_OVERLAP = 0;
WrappedBarPositionProperty_Base::WrappedBarPositionProperty_Base(
const OUString& rOuterName
- , const OUString& rInnerSequencePropertyName
+ , OUString aInnerSequencePropertyName
, sal_Int32 nDefaultValue
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact )
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact )
: WrappedDefaultProperty( rOuterName, OUString(), uno::Any( nDefaultValue ) )
, m_nDimensionIndex(0)
, m_nAxisIndex(0)
- , m_spChart2ModelContact( spChart2ModelContact )
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
, m_nDefaultValue( nDefaultValue )
- , m_InnerSequencePropertyName( rInnerSequencePropertyName )
+ , m_InnerSequencePropertyName(std::move( aInnerSequencePropertyName ))
{
}
@@ -61,7 +66,7 @@ void WrappedBarPositionProperty_Base::setPropertyValue( const Any& rOuterValue,
{
sal_Int32 nNewValue = 0;
if( ! (rOuterValue >>= nNewValue) )
- throw lang::IllegalArgumentException( "GapWidth and Overlap property require value of type sal_Int32", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"GapWidth and Overlap property require value of type sal_Int32"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
@@ -72,29 +77,25 @@ void WrappedBarPositionProperty_Base::setPropertyValue( const Any& rOuterValue,
if( m_nDimensionIndex!=1 )
return;
- const Sequence< Reference< chart2::XChartType > > aChartTypeList( DiagramHelper::getChartTypesFromDiagram( xDiagram ) );
- for( Reference< chart2::XChartType > const & chartType : aChartTypeList )
+ const std::vector< rtl::Reference< ChartType > > aChartTypeList( xDiagram->getChartTypes() );
+ for( rtl::Reference< ChartType > const & chartType : aChartTypeList )
{
try
{
- Reference< beans::XPropertySet > xProp( chartType, uno::UNO_QUERY );
- if( xProp.is() )
+ Sequence< sal_Int32 > aBarPositionSequence;
+ chartType->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence;
+
+ tools::Long nOldLength = aBarPositionSequence.getLength();
+ if( nOldLength <= m_nAxisIndex )
+ aBarPositionSequence.realloc( m_nAxisIndex+1 );
+ auto pBarPositionSequence = aBarPositionSequence.getArray();
+ for( sal_Int32 i=nOldLength; i<m_nAxisIndex; i++ )
{
- Sequence< sal_Int32 > aBarPositionSequence;
- xProp->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence;
-
- tools::Long nOldLength = aBarPositionSequence.getLength();
- if( nOldLength <= m_nAxisIndex )
- aBarPositionSequence.realloc( m_nAxisIndex+1 );
- auto pBarPositionSequence = aBarPositionSequence.getArray();
- for( sal_Int32 i=nOldLength; i<m_nAxisIndex; i++ )
- {
- pBarPositionSequence[i] = m_nDefaultValue;
- }
- pBarPositionSequence[m_nAxisIndex] = nNewValue;
-
- xProp->setPropertyValue( m_InnerSequencePropertyName, uno::Any( aBarPositionSequence ) );
+ pBarPositionSequence[i] = m_nDefaultValue;
}
+ pBarPositionSequence[m_nAxisIndex] = nNewValue;
+
+ chartType->setPropertyValue( m_InnerSequencePropertyName, uno::Any( aBarPositionSequence ) );
}
catch( uno::Exception& e )
{
@@ -115,21 +116,17 @@ Any WrappedBarPositionProperty_Base::getPropertyValue( const Reference< beans::X
if( m_nDimensionIndex==1 )
{
- Sequence< Reference< chart2::XChartType > > aChartTypeList( DiagramHelper::getChartTypesFromDiagram( xDiagram ) );
- for( sal_Int32 nN = 0; nN < aChartTypeList.getLength() && !bInnerValueDetected; nN++ )
+ std::vector< rtl::Reference< ChartType > > aChartTypeList = xDiagram->getChartTypes();
+ for( std::size_t nN = 0; nN < aChartTypeList.size() && !bInnerValueDetected; nN++ )
{
try
{
- Reference< beans::XPropertySet > xProp( aChartTypeList[nN], uno::UNO_QUERY );
- if( xProp.is() )
+ Sequence< sal_Int32 > aBarPositionSequence;
+ aChartTypeList[nN]->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence;
+ if( m_nAxisIndex < aBarPositionSequence.getLength() )
{
- Sequence< sal_Int32 > aBarPositionSequence;
- xProp->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence;
- if( m_nAxisIndex < aBarPositionSequence.getLength() )
- {
- nInnerValue = aBarPositionSequence[m_nAxisIndex];
- bInnerValueDetected = true;
- }
+ nInnerValue = aBarPositionSequence[m_nAxisIndex];
+ bInnerValueDetected = true;
}
}
catch( uno::Exception& e )
@@ -150,7 +147,7 @@ Any WrappedBarPositionProperty_Base::getPropertyValue( const Reference< beans::X
WrappedGapwidthProperty::WrappedGapwidthProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedBarPositionProperty_Base( "GapWidth", "GapwidthSequence", DEFAULT_GAPWIDTH, spChart2ModelContact )
+ : WrappedBarPositionProperty_Base( u"GapWidth"_ustr, u"GapwidthSequence"_ustr, DEFAULT_GAPWIDTH, spChart2ModelContact )
{
}
WrappedGapwidthProperty::~WrappedGapwidthProperty()
@@ -159,7 +156,7 @@ WrappedGapwidthProperty::~WrappedGapwidthProperty()
WrappedBarOverlapProperty::WrappedBarOverlapProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact )
- : WrappedBarPositionProperty_Base( "Overlap", "OverlapSequence", DEFAULT_OVERLAP, spChart2ModelContact )
+ : WrappedBarPositionProperty_Base( u"Overlap"_ustr, u"OverlapSequence"_ustr, DEFAULT_OVERLAP, spChart2ModelContact )
{
}
WrappedBarOverlapProperty::~WrappedBarOverlapProperty()
diff --git a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.hxx
index 550b0ce6ad9d..6ac43e9f7635 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.hxx
@@ -32,9 +32,9 @@ class WrappedBarPositionProperty_Base : public WrappedDefaultProperty
public:
WrappedBarPositionProperty_Base(
const OUString& rOuterName
- , const OUString& rInnerSequencePropertyName
+ , OUString aInnerSequencePropertyName
, sal_Int32 nDefaultValue
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact );
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact );
virtual ~WrappedBarPositionProperty_Base() override;
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -43,7 +43,7 @@ public:
void setDimensionAndAxisIndex( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
-protected:
+private:
sal_Int32 m_nDimensionIndex;
sal_Int32 m_nAxisIndex;
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
index 1ce277c321ba..bc1f5aed14f6 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
@@ -19,9 +19,11 @@
#include "WrappedNumberFormatProperty.hxx"
#include "Chart2ModelContact.hxx"
-#include <com/sun/star/chart2/XAxis.hpp>
+#include <Axis.hxx>
+#include <DataSeries.hxx>
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <unonames.hxx>
+#include <utility>
#include <osl/diagnose.h>
using namespace ::com::sun::star;
@@ -31,9 +33,9 @@ using ::com::sun::star::uno::Any;
namespace chart::wrapper
{
-WrappedNumberFormatProperty::WrappedNumberFormatProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
+WrappedNumberFormatProperty::WrappedNumberFormatProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
: WrappedDirectStateProperty( CHART_UNONAME_NUMFMT, CHART_UNONAME_NUMFMT )
- , m_spChart2ModelContact(spChart2ModelContact)
+ , m_spChart2ModelContact(std::move(spChart2ModelContact))
{
}
@@ -45,7 +47,7 @@ void WrappedNumberFormatProperty::setPropertyValue( const Any& rOuterValue, cons
{
sal_Int32 nFormat = 0;
if( ! (rOuterValue >>= nFormat) )
- throw lang::IllegalArgumentException( "Property 'NumberFormat' requires value of type sal_Int32", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property 'NumberFormat' requires value of type sal_Int32"_ustr, nullptr, 0 );
if(xInnerPropertySet.is())
xInnerPropertySet->setPropertyValue(getInnerName(), convertOuterToInnerValue(rOuterValue));
@@ -63,11 +65,12 @@ Any WrappedNumberFormatProperty::getPropertyValue( const Reference< beans::XProp
{
sal_Int32 nKey = 0;
Reference< chart2::XDataSeries > xSeries( xInnerPropertySet, uno::UNO_QUERY );
- if( xSeries.is() )
- nKey = Chart2ModelContact::getExplicitNumberFormatKeyForSeries( xSeries );
+ if( ::chart::DataSeries* pDataSeries = dynamic_cast<DataSeries*>(xSeries.get()) )
+ nKey = pDataSeries->getExplicitNumberFormatKeyForDataLabel();
else
{
- Reference< chart2::XAxis > xAxis( xInnerPropertySet, uno::UNO_QUERY );
+ rtl::Reference< Axis > xAxis = dynamic_cast<Axis*>(xInnerPropertySet.get());
+ assert(xAxis || !xInnerPropertySet);
nKey = m_spChart2ModelContact->getExplicitNumberFormatKeyForAxis( xAxis );
}
aRet <<= nKey;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
index fa4042ceaedf..cf2f706c61c7 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
@@ -31,7 +31,7 @@ namespace chart::wrapper
class WrappedNumberFormatProperty : public WrappedDirectStateProperty
{
public:
- explicit WrappedNumberFormatProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedNumberFormatProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~WrappedNumberFormatProperty() override;
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
index 27e07256e51d..35b8cd3040ea 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
@@ -20,11 +20,13 @@
#include "WrappedScaleProperty.hxx"
#include "Chart2ModelContact.hxx"
#include <CommonConverters.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart/ChartAxisType.hpp>
#include <chartview/ExplicitScaleValues.hxx>
+#include <utility>
#include <osl/diagnose.h>
using namespace ::com::sun::star;
@@ -38,9 +40,9 @@ namespace chart::wrapper
{
WrappedScaleProperty::WrappedScaleProperty(tScaleProperty eScaleProperty
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
: WrappedProperty(OUString(),OUString())
- , m_spChart2ModelContact( spChart2ModelContact )
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
, m_eScaleProperty( eScaleProperty )
{
switch( m_eScaleProperty )
@@ -295,7 +297,7 @@ void WrappedScaleProperty::setPropertyValue( tScaleProperty eScaleProperty, cons
{
TimeIncrement aTimeIncrement;
rOuterValue >>= aTimeIncrement;
- aScaleData.TimeIncrement = aTimeIncrement;
+ aScaleData.TimeIncrement = std::move(aTimeIncrement);
bSetScaleData = true;
break;
}
@@ -348,7 +350,7 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
{
Any aRet( m_aOuterValue );
- Reference< chart2::XAxis > xAxis( xInnerPropertySet, uno::UNO_QUERY );
+ rtl::Reference< Axis > xAxis = dynamic_cast<Axis*>(xInnerPropertySet.get());
OSL_ENSURE(xAxis.is(),"need an XAxis");
if(!xAxis.is())
return aRet;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
index 64e8071b5345..eca52953552d 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
@@ -51,7 +51,7 @@ public:
, SCALE_PROP_REVERSEDIRECTION
};
- WrappedScaleProperty(tScaleProperty eScaleProperty, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ WrappedScaleProperty(tScaleProperty eScaleProperty, std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~WrappedScaleProperty() override;
static void addWrappedProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList, const std::shared_ptr< Chart2ModelContact >& spChart2ModelContact );
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
index 8551915d9c88..60a026c2fcaf 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
@@ -25,7 +25,8 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
@@ -40,7 +41,7 @@ namespace {
class WrappedScaleTextProperty : public WrappedProperty
{
public:
- explicit WrappedScaleTextProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ explicit WrappedScaleTextProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual void setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const override;
virtual Any getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const override;
@@ -52,15 +53,15 @@ private:
}
-WrappedScaleTextProperty::WrappedScaleTextProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : ::chart::WrappedProperty( "ScaleText" , OUString() )
- , m_spChart2ModelContact( spChart2ModelContact )
+WrappedScaleTextProperty::WrappedScaleTextProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
+ : ::chart::WrappedProperty( u"ScaleText"_ustr , OUString() )
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
}
void WrappedScaleTextProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
{
- static constexpr OUStringLiteral aRefSizeName = u"ReferencePageSize";
+ static constexpr OUString aRefSizeName = u"ReferencePageSize"_ustr;
if( !xInnerPropertySet.is() )
return;
@@ -69,7 +70,7 @@ void WrappedScaleTextProperty::setPropertyValue( const Any& rOuterValue, const R
if( ! (rOuterValue >>= bNewValue) )
{
if( rOuterValue.hasValue() )
- throw lang::IllegalArgumentException( "Property ScaleText requires value of type boolean", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property ScaleText requires value of type boolean"_ustr, nullptr, 0 );
}
try
@@ -93,7 +94,7 @@ Any WrappedScaleTextProperty::getPropertyValue( const Reference< beans::XPropert
Any aRet( getPropertyDefault( Reference< beans::XPropertyState >( xInnerPropertySet, uno::UNO_QUERY ) ) );
if( xInnerPropertySet.is() )
{
- if( xInnerPropertySet->getPropertyValue( "ReferencePageSize" ).hasValue() )
+ if( xInnerPropertySet->getPropertyValue( u"ReferencePageSize"_ustr ).hasValue() )
aRet <<= true;
else
aRet <<= false;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
index 2430dcba7ac6..cf7a820115c3 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
@@ -19,8 +19,8 @@
#include "WrappedSceneProperty.hxx"
#include "Chart2ModelContact.hxx"
-#include <DiagramHelper.hxx>
#include <BaseGFXHelper.hxx>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
@@ -36,9 +36,9 @@ void WrappedSceneProperty::addWrappedProperties( std::vector< std::unique_ptr<Wr
}
WrappedD3DTransformMatrixProperty::WrappedD3DTransformMatrixProperty(
- const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact )
- : WrappedProperty("D3DTransformMatrix","D3DTransformMatrix")
- , m_spChart2ModelContact( spChart2ModelContact )
+ std::shared_ptr<Chart2ModelContact> spChart2ModelContact )
+ : WrappedProperty(u"D3DTransformMatrix"_ustr,u"D3DTransformMatrix"_ustr)
+ , m_spChart2ModelContact(std::move( spChart2ModelContact ))
{
}
@@ -48,7 +48,7 @@ WrappedD3DTransformMatrixProperty::~WrappedD3DTransformMatrixProperty()
void WrappedD3DTransformMatrixProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
{
- if( DiagramHelper::isPieOrDonutChart( m_spChart2ModelContact->getDiagram() ) )
+ if( m_spChart2ModelContact->getDiagram()->isPieOrDonutChart() )
{
drawing::HomogenMatrix aHM;
if( rOuterValue >>= aHM )
@@ -73,7 +73,7 @@ void WrappedD3DTransformMatrixProperty::setPropertyValue( const Any& rOuterValue
Any WrappedD3DTransformMatrixProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
{
- if( DiagramHelper::isPieOrDonutChart( m_spChart2ModelContact->getDiagram() ) )
+ if( m_spChart2ModelContact->getDiagram()->isPieOrDonutChart() )
{
uno::Any aAMatrix( WrappedProperty::getPropertyValue( xInnerPropertySet ) );
drawing::HomogenMatrix aHM;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx
index 7e6679016537..31ef35abc566 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx
@@ -39,7 +39,7 @@ class WrappedD3DTransformMatrixProperty : public WrappedProperty
{
public:
explicit WrappedD3DTransformMatrixProperty(
- const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact);
+ std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
virtual ~WrappedD3DTransformMatrixProperty() override;
virtual void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx
index 88fa72696c03..5b073ca80152 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <utility>
+
#include "WrappedSeriesAreaOrLineProperty.hxx"
#include "DataSeriesPointWrapper.hxx"
@@ -25,13 +27,13 @@ namespace chart::wrapper
WrappedSeriesAreaOrLineProperty::WrappedSeriesAreaOrLineProperty(
const OUString& rOuterName
- , const OUString& rInnerAreaTypeName
- , const OUString& rInnerLineTypeName
+ , OUString aInnerAreaTypeName
+ , OUString aInnerLineTypeName
, DataSeriesPointWrapper* pDataSeriesPointWrapper )
: WrappedProperty( rOuterName, OUString() )
, m_pDataSeriesPointWrapper( pDataSeriesPointWrapper )
- , m_aInnerAreaTypeName( rInnerAreaTypeName )
- , m_aInnerLineTypeName( rInnerLineTypeName )
+ , m_aInnerAreaTypeName(std::move( aInnerAreaTypeName ))
+ , m_aInnerLineTypeName(std::move( aInnerLineTypeName ))
{
}
WrappedSeriesAreaOrLineProperty::~WrappedSeriesAreaOrLineProperty()
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.hxx
index ba77b6939f34..f3561e7361d4 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.hxx
@@ -28,7 +28,7 @@ class WrappedSeriesAreaOrLineProperty : public WrappedProperty
{
public:
WrappedSeriesAreaOrLineProperty( const OUString& rOuterName
- , const OUString& rInnerAreaTypeName, const OUString& rInnerLineTypeName
+ , OUString aInnerAreaTypeName, OUString aInnerLineTypeName
, DataSeriesPointWrapper* pDataSeriesPointWrapper );
virtual ~WrappedSeriesAreaOrLineProperty() override;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
index 88dc862ea2d9..61946ea5d75f 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
@@ -20,13 +20,12 @@
#include <WrappedProperty.hxx>
#include "Chart2ModelContact.hxx"
-#include <DiagramHelper.hxx>
+#include <DataSeries.hxx>
#include <memory>
+#include <utility>
#include <vector>
-namespace com::sun::star::chart2 { class XDataSeries; }
-
namespace chart::wrapper
{
@@ -46,10 +45,10 @@ public:
virtual void setValueToSeries( const css::uno::Reference< css::beans::XPropertySet >& xSeriesPropertySet, const PROPERTYTYPE & aNewValue ) const =0;
explicit WrappedSeriesOrDiagramProperty( const OUString& rName, const css::uno::Any& rDefaulValue
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact
, tSeriesOrDiagramPropertyType ePropertyType )
: WrappedProperty(rName,OUString())
- , m_spChart2ModelContact(spChart2ModelContact)
+ , m_spChart2ModelContact(std::move(spChart2ModelContact))
, m_aOuterValue(rDefaulValue)
, m_aDefaultValue(rDefaulValue)
, m_ePropertyType( ePropertyType )
@@ -58,30 +57,31 @@ public:
bool detectInnerValue( PROPERTYTYPE& rValue, bool& rHasAmbiguousValue ) const
{
- bool bHasDetectableInnerValue = false;
rHasAmbiguousValue = false;
- if( m_ePropertyType == DIAGRAM &&
- m_spChart2ModelContact )
+ if( m_ePropertyType != DIAGRAM || !m_spChart2ModelContact )
+ return false;
+ bool bHasDetectableInnerValue = false;
+ rtl::Reference<Diagram> xDiagram = m_spChart2ModelContact->getDiagram();
+ if (!xDiagram)
+ return false;
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector =
+ xDiagram->getDataSeries();
+ for (auto const& series : aSeriesVector)
{
- std::vector< css::uno::Reference< css::chart2::XDataSeries > > aSeriesVector(
- ::chart::DiagramHelper::getDataSeriesFromDiagram( m_spChart2ModelContact->getDiagram() ) );
- for (auto const& series : aSeriesVector)
+ PROPERTYTYPE aCurValue = getValueFromSeries( series );
+ if( !bHasDetectableInnerValue )
+ rValue = aCurValue;
+ else
{
- PROPERTYTYPE aCurValue = getValueFromSeries( css::uno::Reference< css::beans::XPropertySet >::query(series) );
- if( !bHasDetectableInnerValue )
- rValue = aCurValue;
- else
+ if( rValue != aCurValue )
{
- if( rValue != aCurValue )
- {
- rHasAmbiguousValue = true;
- break;
- }
- else
- rValue = aCurValue;
+ rHasAmbiguousValue = true;
+ break;
}
- bHasDetectableInnerValue = true;
+ else
+ rValue = aCurValue;
}
+ bHasDetectableInnerValue = true;
}
return bHasDetectableInnerValue;
}
@@ -90,15 +90,11 @@ public:
if( m_ePropertyType == DIAGRAM &&
m_spChart2ModelContact )
{
- std::vector< css::uno::Reference< css::chart2::XDataSeries > > aSeriesVector(
- ::chart::DiagramHelper::getDataSeriesFromDiagram( m_spChart2ModelContact->getDiagram() ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector =
+ m_spChart2ModelContact->getDiagram()->getDataSeries();
for (auto const& series : aSeriesVector)
{
- css::uno::Reference< css::beans::XPropertySet > xSeriesPropertySet(series, css::uno::UNO_QUERY);
- if( xSeriesPropertySet.is() )
- {
- setValueToSeries( xSeriesPropertySet, aNewValue );
- }
+ setValueToSeries( series, aNewValue );
}
}
}
@@ -106,7 +102,7 @@ public:
{
PROPERTYTYPE aNewValue = PROPERTYTYPE();
if( ! (rOuterValue >>= aNewValue) )
- throw css::lang::IllegalArgumentException( "statistic property requires different type", nullptr, 0 );
+ throw css::lang::IllegalArgumentException( u"statistic property requires different type"_ustr, nullptr, 0 );
if( m_ePropertyType == DIAGRAM )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
index 6d088a50bd81..f40b9edd7fb2 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
@@ -20,7 +20,7 @@
#include "WrappedSplineProperties.hxx"
#include "Chart2ModelContact.hxx"
#include <FastPropertyIdRanges.hxx>
-#include <DiagramHelper.hxx>
+#include <ChartType.hxx>
#include <WrappedProperty.hxx>
#include <unonames.hxx>
@@ -29,10 +29,10 @@
#include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Sequence;
using ::com::sun::star::beans::Property;
namespace chart::wrapper
@@ -47,32 +47,30 @@ template< typename PROPERTYTYPE >
class WrappedSplineProperty : public WrappedProperty
{
public:
- explicit WrappedSplineProperty( const OUString& rOuterName, const OUString& rInnerName
+ explicit WrappedSplineProperty( const OUString& rOuterName, OUString aInnerName
, const css::uno::Any& rDefaulValue
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact )
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact )
: WrappedProperty(rOuterName,OUString())
- , m_spChart2ModelContact(spChart2ModelContact)
+ , m_spChart2ModelContact(std::move(spChart2ModelContact))
, m_aOuterValue(rDefaulValue)
, m_aDefaultValue(rDefaulValue)
- , m_aOwnInnerName(rInnerName)
+ , m_aOwnInnerName(std::move(aInnerName))
{
}
bool detectInnerValue( PROPERTYTYPE& rValue, bool& rHasAmbiguousValue ) const
{
- bool bHasDetectableInnerValue = false;
rHasAmbiguousValue = false;
- Sequence< css::uno::Reference< css::chart2::XChartType > > aChartTypes(
- ::chart::DiagramHelper::getChartTypesFromDiagram( m_spChart2ModelContact->getDiagram() ) );
- for( sal_Int32 nN = aChartTypes.getLength(); nN--; )
+ rtl::Reference<Diagram> xDiagram = m_spChart2ModelContact->getDiagram();
+ if (!xDiagram)
+ return false;
+ bool bHasDetectableInnerValue = false;
+ std::vector< rtl::Reference< ChartType > > aChartTypes = xDiagram->getChartTypes();
+ for( sal_Int32 nN = aChartTypes.size(); nN--; )
{
try
{
- uno::Reference<beans::XPropertySet> xChartTypePropertySet(aChartTypes[nN], uno::UNO_QUERY);
- if (!xChartTypePropertySet.is())
- continue;
-
- Any aSingleValue = convertInnerToOuterValue( xChartTypePropertySet->getPropertyValue(m_aOwnInnerName) );
+ Any aSingleValue = convertInnerToOuterValue( aChartTypes[nN]->getPropertyValue(m_aOwnInnerName) );
PROPERTYTYPE aCurValue = PROPERTYTYPE();
aSingleValue >>= aCurValue;
if( !bHasDetectableInnerValue )
@@ -102,7 +100,7 @@ public:
{
PROPERTYTYPE aNewValue;
if( ! (rOuterValue >>= aNewValue) )
- throw css::lang::IllegalArgumentException( "spline property requires different type", nullptr, 0 );
+ throw css::lang::IllegalArgumentException( u"spline property requires different type"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
@@ -114,17 +112,13 @@ public:
if( !(bHasAmbiguousValue || aNewValue != aOldValue) )
return;
- Sequence< css::uno::Reference< css::chart2::XChartType > > aChartTypes(
- ::chart::DiagramHelper::getChartTypesFromDiagram( m_spChart2ModelContact->getDiagram() ) );
- for( sal_Int32 nN = aChartTypes.getLength(); nN--; )
+ std::vector< rtl::Reference< ChartType > > aChartTypes =
+ m_spChart2ModelContact->getDiagram()->getChartTypes();
+ for( sal_Int32 nN = aChartTypes.size(); nN--; )
{
try
{
- css::uno::Reference< css::beans::XPropertySet > xChartTypePropertySet( aChartTypes[nN], css::uno::UNO_QUERY );
- if( xChartTypePropertySet.is() )
- {
- xChartTypePropertySet->setPropertyValue(m_aOwnInnerName,convertOuterToInnerValue(uno::Any(aNewValue)));
- }
+ aChartTypes[nN]->setPropertyValue(m_aOwnInnerName,convertOuterToInnerValue(uno::Any(aNewValue)));
}
catch( uno::Exception & ex )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index bc83ba60df87..c17f6c50c263 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -21,6 +21,7 @@
#include "WrappedSeriesOrDiagramProperty.hxx"
#include <FastPropertyIdRanges.hxx>
#include <RegressionCurveHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include <ErrorBar.hxx>
#include <StatisticsHelper.hxx>
#include <unonames.hxx>
@@ -31,7 +32,6 @@
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart/ChartErrorIndicatorType.hpp>
#include <com/sun/star/chart/ChartRegressionCurveType.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <utility>
@@ -116,7 +116,7 @@ sal_Int32 lcl_getErrorBarStyle( const uno::Reference< beans::XPropertySet >& xEr
{
sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
if(xErrorBarProperties.is())
- xErrorBarProperties->getPropertyValue( "ErrorBarStyle" ) >>= nStyle;
+ xErrorBarProperties->getPropertyValue( u"ErrorBarStyle"_ustr ) >>= nStyle;
return nStyle;
}
@@ -144,8 +144,7 @@ void lcl_ConvertRangeFromXML(
lcl_getDataProviderFromContact( spChart2ModelContact ), uno::UNO_QUERY );
if( xConverter.is())
{
- OUString aResult = xConverter->convertRangeFromXML( rInOutRange );
- rInOutRange = aResult;
+ rInOutRange = xConverter->convertRangeFromXML( rInOutRange );
}
}
}
@@ -160,8 +159,7 @@ void lcl_ConvertRangeToXML(
lcl_getDataProviderFromContact( spChart2ModelContact ), uno::UNO_QUERY );
if( xConverter.is())
{
- OUString aResult = xConverter->convertRangeToXML( rInOutRange );
- rInOutRange = aResult;
+ rInOutRange = xConverter->convertRangeToXML( rInOutRange );
}
}
}
@@ -189,9 +187,9 @@ protected:
{
xErrorBarProperties = new ::chart::ErrorBar;
//default in new and old api are different
- xErrorBarProperties->setPropertyValue( "ShowPositiveError" , uno::Any(false) );
- xErrorBarProperties->setPropertyValue( "ShowNegativeError" , uno::Any(false) );
- xErrorBarProperties->setPropertyValue( "ErrorBarStyle" , uno::Any(css::chart::ErrorBarStyle::NONE) );
+ xErrorBarProperties->setPropertyValue( u"ShowPositiveError"_ustr , uno::Any(false) );
+ xErrorBarProperties->setPropertyValue( u"ShowNegativeError"_ustr , uno::Any(false) );
+ xErrorBarProperties->setPropertyValue( u"ErrorBarStyle"_ustr , uno::Any(css::chart::ErrorBarStyle::NONE) );
xSeriesPropertySet->setPropertyValue( CHART_UNONAME_ERRORBAR_Y , uno::Any( xErrorBarProperties ) );
}
return xErrorBarProperties;
@@ -218,7 +216,7 @@ private:
WrappedConstantErrorLowProperty::WrappedConstantErrorLowProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< double >( "ConstantErrorLow"
+ : WrappedStatisticProperty< double >( u"ConstantErrorLow"_ustr
, uno::Any( 0.0 ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -231,7 +229,7 @@ double WrappedConstantErrorLowProperty::getValueFromSeries( const Reference< bea
if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ABSOLUTE )
- xErrorBarProperties->getPropertyValue( "NegativeError" ) >>= aRet;
+ xErrorBarProperties->getPropertyValue( u"NegativeError"_ustr ) >>= aRet;
else
m_aOuterValue >>= aRet;
}
@@ -246,7 +244,7 @@ void WrappedConstantErrorLowProperty::setValueToSeries( const Reference< beans::
m_aOuterValue <<= aNewValue;
if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ABSOLUTE )
{
- xErrorBarProperties->setPropertyValue( "NegativeError", m_aOuterValue );
+ xErrorBarProperties->setPropertyValue( u"NegativeError"_ustr, m_aOuterValue );
}
}
}
@@ -272,7 +270,7 @@ private:
WrappedConstantErrorHighProperty::WrappedConstantErrorHighProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< double >( "ConstantErrorHigh"
+ : WrappedStatisticProperty< double >( u"ConstantErrorHigh"_ustr
, uno::Any( 0.0 ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -285,7 +283,7 @@ double WrappedConstantErrorHighProperty::getValueFromSeries( const Reference< be
if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ABSOLUTE )
- xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
+ xErrorBarProperties->getPropertyValue( u"PositiveError"_ustr ) >>= aRet;
else
m_aOuterValue >>= aRet;
}
@@ -300,7 +298,7 @@ void WrappedConstantErrorHighProperty::setValueToSeries( const Reference< beans:
m_aOuterValue <<= aNewValue;
if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ABSOLUTE )
{
- xErrorBarProperties->setPropertyValue( "PositiveError" , m_aOuterValue );
+ xErrorBarProperties->setPropertyValue( u"PositiveError"_ustr , m_aOuterValue );
}
}
}
@@ -323,7 +321,7 @@ public:
WrappedMeanValueProperty::WrappedMeanValueProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< bool >( "MeanValue", uno::Any( false ), std::move(spChart2ModelContact), ePropertyType )
+ : WrappedStatisticProperty< bool >( u"MeanValue"_ustr, uno::Any( false ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -367,7 +365,7 @@ public:
WrappedErrorCategoryProperty::WrappedErrorCategoryProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< css::chart::ChartErrorCategory >( "ErrorCategory"
+ : WrappedStatisticProperty< css::chart::ChartErrorCategory >( u"ErrorCategory"_ustr
, uno::Any( css::chart::ChartErrorCategory_NONE ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -380,7 +378,7 @@ css::chart::ChartErrorCategory WrappedErrorCategoryProperty::getValueFromSeries(
if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
- xErrorBarProperties->getPropertyValue( "ErrorBarStyle" ) >>= nStyle;
+ xErrorBarProperties->getPropertyValue( u"ErrorBarStyle"_ustr ) >>= nStyle;
switch(nStyle)
{
case css::chart::ErrorBarStyle::NONE:
@@ -444,7 +442,7 @@ void WrappedErrorCategoryProperty::setValueToSeries( const Reference< beans::XPr
default:
break;
}
- xErrorBarProperties->setPropertyValue( "ErrorBarStyle" , uno::Any(nNewStyle) );
+ xErrorBarProperties->setPropertyValue( u"ErrorBarStyle"_ustr , uno::Any(nNewStyle) );
}
namespace {
@@ -468,7 +466,7 @@ private:
WrappedPercentageErrorProperty::WrappedPercentageErrorProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< double >( "PercentageError"
+ : WrappedStatisticProperty< double >( u"PercentageError"_ustr
, uno::Any( 0.0 ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -481,7 +479,7 @@ double WrappedPercentageErrorProperty::getValueFromSeries( const Reference< bean
if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::RELATIVE )
- xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
+ xErrorBarProperties->getPropertyValue( u"PositiveError"_ustr ) >>= aRet;
else
m_aOuterValue >>= aRet;
}
@@ -495,8 +493,8 @@ void WrappedPercentageErrorProperty::setValueToSeries( const Reference< beans::X
m_aOuterValue <<= aNewValue;
if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::RELATIVE )
{
- xErrorBarProperties->setPropertyValue( "PositiveError" , m_aOuterValue );
- xErrorBarProperties->setPropertyValue( "NegativeError" , m_aOuterValue );
+ xErrorBarProperties->setPropertyValue( u"PositiveError"_ustr , m_aOuterValue );
+ xErrorBarProperties->setPropertyValue( u"NegativeError"_ustr , m_aOuterValue );
}
}
}
@@ -522,7 +520,7 @@ private:
WrappedErrorMarginProperty::WrappedErrorMarginProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< double >( "ErrorMargin"
+ : WrappedStatisticProperty< double >( u"ErrorMargin"_ustr
, uno::Any( 0.0 ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -535,7 +533,7 @@ double WrappedErrorMarginProperty::getValueFromSeries( const Reference< beans::X
if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ERROR_MARGIN )
- xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
+ xErrorBarProperties->getPropertyValue( u"PositiveError"_ustr ) >>= aRet;
else
m_aOuterValue >>= aRet;
}
@@ -549,8 +547,8 @@ void WrappedErrorMarginProperty::setValueToSeries( const Reference< beans::XProp
m_aOuterValue <<= aNewValue;
if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ERROR_MARGIN )
{
- xErrorBarProperties->setPropertyValue( "PositiveError" , m_aOuterValue );
- xErrorBarProperties->setPropertyValue( "NegativeError" , m_aOuterValue );
+ xErrorBarProperties->setPropertyValue( u"PositiveError"_ustr , m_aOuterValue );
+ xErrorBarProperties->setPropertyValue( u"NegativeError"_ustr , m_aOuterValue );
}
}
}
@@ -573,7 +571,7 @@ public:
WrappedErrorIndicatorProperty::WrappedErrorIndicatorProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< css::chart::ChartErrorIndicatorType >( "ErrorIndicator"
+ : WrappedStatisticProperty< css::chart::ChartErrorIndicatorType >( u"ErrorIndicator"_ustr
, uno::Any( css::chart::ChartErrorIndicatorType_NONE ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -587,8 +585,8 @@ css::chart::ChartErrorIndicatorType WrappedErrorIndicatorProperty::getValueFromS
{
bool bPositive = false;
bool bNegative = false;
- xErrorBarProperties->getPropertyValue( "ShowPositiveError" ) >>= bPositive;
- xErrorBarProperties->getPropertyValue( "ShowNegativeError" ) >>= bNegative;
+ xErrorBarProperties->getPropertyValue( u"ShowPositiveError"_ustr ) >>= bPositive;
+ xErrorBarProperties->getPropertyValue( u"ShowNegativeError"_ustr ) >>= bNegative;
if( bPositive && bNegative )
aRet = css::chart::ChartErrorIndicatorType_TOP_AND_BOTTOM;
@@ -623,8 +621,8 @@ void WrappedErrorIndicatorProperty::setValueToSeries( const Reference< beans::XP
break;
}
- xErrorBarProperties->setPropertyValue( "ShowPositiveError" , uno::Any(bPositive) );
- xErrorBarProperties->setPropertyValue( "ShowNegativeError" , uno::Any(bNegative) );
+ xErrorBarProperties->setPropertyValue( u"ShowPositiveError"_ustr , uno::Any(bPositive) );
+ xErrorBarProperties->setPropertyValue( u"ShowNegativeError"_ustr , uno::Any(bNegative) );
}
namespace {
@@ -646,7 +644,7 @@ public:
WrappedErrorBarStyleProperty::WrappedErrorBarStyleProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< sal_Int32 >( "ErrorBarStyle"
+ : WrappedStatisticProperty< sal_Int32 >( u"ErrorBarStyle"_ustr
, uno::Any( css::chart::ErrorBarStyle::NONE ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -658,7 +656,7 @@ sal_Int32 WrappedErrorBarStyleProperty::getValueFromSeries( const Reference< bea
uno::Reference< beans::XPropertySet > xErrorBarProperties;
if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
- xErrorBarProperties->getPropertyValue( "ErrorBarStyle" ) >>= nRet;
+ xErrorBarProperties->getPropertyValue( u"ErrorBarStyle"_ustr ) >>= nRet;
}
return nRet;
}
@@ -670,7 +668,7 @@ void WrappedErrorBarStyleProperty::setValueToSeries( const Reference< beans::XPr
uno::Reference< beans::XPropertySet > xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet) );
if( xErrorBarProperties.is() )
{
- xErrorBarProperties->setPropertyValue( "ErrorBarStyle" , uno::Any( nNewValue ));
+ xErrorBarProperties->setPropertyValue( u"ErrorBarStyle"_ustr , uno::Any( nNewValue ));
}
}
@@ -692,7 +690,7 @@ public:
WrappedErrorBarRangePositiveProperty::WrappedErrorBarRangePositiveProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< OUString >( "ErrorBarRangePositive"
+ : WrappedStatisticProperty< OUString >( u"ErrorBarRangePositive"_ustr
, uno::Any( OUString() ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -730,7 +728,7 @@ void WrappedErrorBarRangePositiveProperty::setValueToSeries( const Reference< be
if( xDataSource.is() && xDataProvider.is())
{
OUString aTmp( aNewValue );
- OUString aXMLRange( aNewValue );
+ const OUString& aXMLRange( aNewValue );
lcl_ConvertRangeFromXML( aTmp, m_spChart2ModelContact );
StatisticsHelper::setErrorDataSequence(
xDataSource, xDataProvider, aTmp, true /* positive */, true /* y-error */, &aXMLRange );
@@ -756,7 +754,7 @@ public:
WrappedErrorBarRangeNegativeProperty::WrappedErrorBarRangeNegativeProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< OUString >( "ErrorBarRangeNegative"
+ : WrappedStatisticProperty< OUString >( u"ErrorBarRangeNegative"_ustr
, uno::Any( OUString() ), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -794,7 +792,7 @@ void WrappedErrorBarRangeNegativeProperty::setValueToSeries( const Reference< be
if( xDataSource.is() && xDataProvider.is())
{
OUString aTmp( aNewValue );
- OUString aXMLRange( aNewValue );
+ const OUString& aXMLRange( aNewValue );
lcl_ConvertRangeFromXML( aTmp, m_spChart2ModelContact );
StatisticsHelper::setErrorDataSequence(
xDataSource, xDataProvider, aTmp, false /* positive */, true /* y-error */, &aXMLRange );
@@ -820,7 +818,7 @@ public:
WrappedRegressionCurvesProperty::WrappedRegressionCurvesProperty(
std::shared_ptr< Chart2ModelContact > spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedStatisticProperty< css::chart::ChartRegressionCurveType >( "RegressionCurves"
+ : WrappedStatisticProperty< css::chart::ChartRegressionCurveType >( u"RegressionCurves"_ustr
, lcl_getRegressionDefault(), std::move(spChart2ModelContact), ePropertyType )
{
}
@@ -840,9 +838,10 @@ css::chart::ChartRegressionCurveType WrappedRegressionCurvesProperty::getValueFr
void WrappedRegressionCurvesProperty::setValueToSeries( const Reference< beans::XPropertySet >& xSeriesPropertySet, const css::chart::ChartRegressionCurveType& aNewValue ) const
{
uno::Reference< chart2::XRegressionCurveContainer > xRegressionCurveContainer( xSeriesPropertySet, uno::UNO_QUERY );
- uno::Reference< chart2::XRegressionCurve > xRegressionCurve( xSeriesPropertySet, uno::UNO_QUERY );
-
- if( xRegressionCurveContainer.is() && xRegressionCurve.is() )
+ if (!xRegressionCurveContainer)
+ return;
+ rtl::Reference< ::chart::RegressionCurveModel> xRegressionCurve = RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegressionCurveContainer );
+ if( xRegressionCurve.is() )
{
SvxChartRegress eNewRegressionType = lcl_getRegressionType( aNewValue );
@@ -888,10 +887,10 @@ WrappedStatisticPropertySetProperty::WrappedStatisticPropertySetProperty(
, tSeriesOrDiagramPropertyType ePropertyType )
: WrappedStatisticProperty< Reference< beans::XPropertySet > >(
(ePropertySetType == PROPERTY_SET_TYPE_REGRESSION)
- ? OUString("DataRegressionProperties")
+ ? u"DataRegressionProperties"_ustr
: (ePropertySetType == PROPERTY_SET_TYPE_ERROR_BAR)
- ? OUString("DataErrorProperties")
- : OUString("DataMeanValueProperties")
+ ? u"DataErrorProperties"_ustr
+ : u"DataMeanValueProperties"_ustr
, uno::Any(), std::move(spChart2ModelContact), ePropertyType )
, m_eType( ePropertySetType )
{
@@ -906,7 +905,7 @@ Reference< beans::XPropertySet > WrappedStatisticPropertySetProperty::getValueFr
{
case PROPERTY_SET_TYPE_REGRESSION:
if( xRegCnt.is() )
- xResult.set( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCnt ), uno::UNO_QUERY );
+ xResult = RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCnt );
break;
case PROPERTY_SET_TYPE_ERROR_BAR:
if( xSeriesPropertySet.is())
@@ -914,7 +913,7 @@ Reference< beans::XPropertySet > WrappedStatisticPropertySetProperty::getValueFr
break;
case PROPERTY_SET_TYPE_MEAN_VALUE:
if( xRegCnt.is() )
- xResult.set( RegressionCurveHelper::getMeanValueLine( xRegCnt ), uno::UNO_QUERY );
+ xResult = RegressionCurveHelper::getMeanValueLine( xRegCnt );
break;
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
index 3a8068ec984a..afd0d0d7e85a 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
@@ -20,15 +20,14 @@
#include "WrappedStockProperties.hxx"
#include "Chart2ModelContact.hxx"
#include <FastPropertyIdRanges.hxx>
-#include <DiagramHelper.hxx>
+#include <DataSeries.hxx>
#include <ControllerLockGuard.hxx>
#include <WrappedProperty.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <ChartTypeManager.hxx>
#include <ChartTypeTemplate.hxx>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -43,14 +42,14 @@ class WrappedStockProperty : public WrappedProperty
{
public:
explicit WrappedStockProperty( const OUString& rOuterName
- , const css::uno::Any& rDefaulValue
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact );
+ , css::uno::Any aDefaultValue
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact );
void setPropertyValue( const css::uno::Any& rOuterValue, const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
css::uno::Any getPropertyDefault( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const override;
- virtual uno::Reference< chart2::XChartTypeTemplate > getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const Reference< lang::XMultiServiceFactory >& xFactory ) const = 0;
+ virtual rtl::Reference< ::chart::ChartTypeTemplate > getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const rtl::Reference< ::chart::ChartTypeManager >& xFactory ) const = 0;
protected:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
@@ -61,11 +60,11 @@ protected:
}
WrappedStockProperty::WrappedStockProperty( const OUString& rOuterName
- , const css::uno::Any& rDefaulValue
- , const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact )
+ , css::uno::Any aDefaultValue
+ , std::shared_ptr<Chart2ModelContact> spChart2ModelContact )
: WrappedProperty(rOuterName,OUString())
- , m_spChart2ModelContact(spChart2ModelContact)
- , m_aDefaultValue(rDefaulValue)
+ , m_spChart2ModelContact(std::move(spChart2ModelContact))
+ , m_aDefaultValue(std::move(aDefaultValue))
{
}
@@ -73,21 +72,23 @@ void WrappedStockProperty::setPropertyValue( const css::uno::Any& rOuterValue, c
{
bool bNewValue = false;
if( ! (rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( "stock properties require type sal_Bool", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"stock properties require type sal_Bool"_ustr, nullptr, 0 );
m_aOuterValue = rOuterValue;
rtl::Reference< ChartModel > xChartDoc( m_spChart2ModelContact->getDocumentModel() );
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- sal_Int32 nDimension = ::chart::DiagramHelper::getDimension( xDiagram );
- if( !(xChartDoc.is() && xDiagram.is() && nDimension==2) )
+ if( !xChartDoc || !xDiagram )
+ return;
+ sal_Int32 nDimension = xDiagram->getDimension();
+ if( nDimension != 2 )
return;
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = xChartDoc->getTypeManager();
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
+ Diagram::tTemplateWithServiceName aTemplateAndService =
+ xDiagram->getTemplate( xChartTypeManager );
- uno::Reference< chart2::XChartTypeTemplate > xTemplate =
+ rtl::Reference< ::chart::ChartTypeTemplate > xTemplate =
getNewTemplate( bNewValue, aTemplateAndService.sServiceName, xChartTypeManager );
if(!xTemplate.is())
@@ -119,13 +120,13 @@ public:
css::uno::Any getPropertyValue( const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
- uno::Reference< chart2::XChartTypeTemplate > getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const Reference< lang::XMultiServiceFactory >& xFactory ) const override;
+ rtl::Reference< ::chart::ChartTypeTemplate > getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const rtl::Reference< ::chart::ChartTypeManager >& xFactory ) const override;
};
}
WrappedVolumeProperty::WrappedVolumeProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedStockProperty( "Volume", uno::Any(false) , spChart2ModelContact )
+ : WrappedStockProperty( u"Volume"_ustr, uno::Any(false) , spChart2ModelContact )
{
}
@@ -135,13 +136,13 @@ css::uno::Any WrappedVolumeProperty::getPropertyValue( const css::uno::Reference
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
if( xDiagram.is() && xChartDoc.is() )
{
- std::vector< uno::Reference< chart2::XDataSeries > > aSeriesVector(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector =
+ xDiagram->getDataSeries();
if( !aSeriesVector.empty() )
{
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = xChartDoc->getTypeManager();
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
+ Diagram::tTemplateWithServiceName aTemplateAndService =
+ xDiagram->getTemplate( xChartTypeManager );
if( aTemplateAndService.sServiceName == "com.sun.star.chart2.template.StockVolumeLowHighClose"
|| aTemplateAndService.sServiceName == "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" )
@@ -155,9 +156,9 @@ css::uno::Any WrappedVolumeProperty::getPropertyValue( const css::uno::Reference
return m_aOuterValue;
}
-uno::Reference< chart2::XChartTypeTemplate > WrappedVolumeProperty::getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const Reference< lang::XMultiServiceFactory >& xFactory ) const
+rtl::Reference< ::chart::ChartTypeTemplate > WrappedVolumeProperty::getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const rtl::Reference< ::chart::ChartTypeManager >& xFactory ) const
{
- uno::Reference< chart2::XChartTypeTemplate > xTemplate;
+ rtl::Reference< ::chart::ChartTypeTemplate > xTemplate;
if(!xFactory.is())
return xTemplate;
@@ -165,16 +166,16 @@ uno::Reference< chart2::XChartTypeTemplate > WrappedVolumeProperty::getNewTempla
if( bNewValue ) //add volume
{
if( rCurrentTemplate == "com.sun.star.chart2.template.StockLowHighClose" )
- xTemplate.set( xFactory->createInstance( "com.sun.star.chart2.template.StockVolumeLowHighClose" ), uno::UNO_QUERY );
+ xTemplate = xFactory->createTemplate( u"com.sun.star.chart2.template.StockVolumeLowHighClose"_ustr );
else if( rCurrentTemplate == "com.sun.star.chart2.template.StockOpenLowHighClose" )
- xTemplate.set( xFactory->createInstance( "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" ), uno::UNO_QUERY );
+ xTemplate = xFactory->createTemplate( u"com.sun.star.chart2.template.StockVolumeOpenLowHighClose"_ustr );
}
else //remove volume
{
if( rCurrentTemplate == "com.sun.star.chart2.template.StockVolumeLowHighClose" )
- xTemplate.set( xFactory->createInstance( "com.sun.star.chart2.template.StockLowHighClose" ), uno::UNO_QUERY );
+ xTemplate = xFactory->createTemplate( u"com.sun.star.chart2.template.StockLowHighClose"_ustr );
else if( rCurrentTemplate == "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" )
- xTemplate.set( xFactory->createInstance( "com.sun.star.chart2.template.StockOpenLowHighClose" ), uno::UNO_QUERY );
+ xTemplate = xFactory->createTemplate( u"com.sun.star.chart2.template.StockOpenLowHighClose"_ustr );
}
return xTemplate;
}
@@ -188,13 +189,13 @@ public:
css::uno::Any getPropertyValue( const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
- uno::Reference< chart2::XChartTypeTemplate > getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const Reference< lang::XMultiServiceFactory >& xFactory ) const override;
+ rtl::Reference< ::chart::ChartTypeTemplate > getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const rtl::Reference< ChartTypeManager >& xFactory ) const override;
};
}
WrappedUpDownProperty::WrappedUpDownProperty(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
- : WrappedStockProperty( "UpDown", uno::Any(false) , spChart2ModelContact )
+ : WrappedStockProperty( u"UpDown"_ustr, uno::Any(false) , spChart2ModelContact )
{
}
@@ -204,13 +205,13 @@ css::uno::Any WrappedUpDownProperty::getPropertyValue( const css::uno::Reference
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
if( xDiagram.is() && xChartDoc.is() )
{
- std::vector< uno::Reference< chart2::XDataSeries > > aSeriesVector(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector =
+ xDiagram->getDataSeries();
if( !aSeriesVector.empty() )
{
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = xChartDoc->getTypeManager();
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
+ Diagram::tTemplateWithServiceName aTemplateAndService =
+ xDiagram->getTemplate( xChartTypeManager );
if( aTemplateAndService.sServiceName == "com.sun.star.chart2.template.StockOpenLowHighClose"
|| aTemplateAndService.sServiceName == "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" )
@@ -223,22 +224,22 @@ css::uno::Any WrappedUpDownProperty::getPropertyValue( const css::uno::Reference
}
return m_aOuterValue;
}
-uno::Reference< chart2::XChartTypeTemplate > WrappedUpDownProperty::getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const Reference< lang::XMultiServiceFactory >& xFactory ) const
+rtl::Reference< ::chart::ChartTypeTemplate > WrappedUpDownProperty::getNewTemplate( bool bNewValue, const OUString& rCurrentTemplate, const rtl::Reference< ChartTypeManager >& xFactory ) const
{
- uno::Reference< chart2::XChartTypeTemplate > xTemplate;
+ rtl::Reference< ::chart::ChartTypeTemplate > xTemplate;
if( bNewValue ) //add open series
{
if( rCurrentTemplate == "com.sun.star.chart2.template.StockLowHighClose" )
- xTemplate.set( xFactory->createInstance( "com.sun.star.chart2.template.StockOpenLowHighClose" ), uno::UNO_QUERY );
+ xTemplate = xFactory->createTemplate( u"com.sun.star.chart2.template.StockOpenLowHighClose"_ustr );
else if( rCurrentTemplate == "com.sun.star.chart2.template.StockVolumeLowHighClose" )
- xTemplate.set( xFactory->createInstance( "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" ), uno::UNO_QUERY );
+ xTemplate = xFactory->createTemplate( u"com.sun.star.chart2.template.StockVolumeOpenLowHighClose"_ustr );
}
else //remove open series
{
if( rCurrentTemplate == "com.sun.star.chart2.template.StockOpenLowHighClose" )
- xTemplate.set( xFactory->createInstance( "com.sun.star.chart2.template.StockLowHighClose" ), uno::UNO_QUERY );
+ xTemplate = xFactory->createTemplate( u"com.sun.star.chart2.template.StockLowHighClose"_ustr );
else if( rCurrentTemplate == "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" )
- xTemplate.set( xFactory->createInstance( "com.sun.star.chart2.template.StockVolumeLowHighClose" ), uno::UNO_QUERY );
+ xTemplate = xFactory->createTemplate( u"com.sun.star.chart2.template.StockVolumeLowHighClose"_ustr );
}
return xTemplate;
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
index 484861b68338..19c05e5274bc 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
@@ -20,6 +20,7 @@
#include "WrappedSymbolProperties.hxx"
#include "WrappedSeriesOrDiagramProperty.hxx"
#include <FastPropertyIdRanges.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart2/SymbolStyle.hpp>
@@ -31,7 +32,7 @@
#include <vcl/GraphicLoader.hxx>
#include <vcl/graph.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
@@ -117,14 +118,12 @@ sal_Int32 lcl_getSymbolType( const css::chart2::Symbol& rSymbol )
case chart2::SymbolStyle_NONE:
break;
case chart2::SymbolStyle_AUTO:
+ case chart2::SymbolStyle_POLYGON://new feature
nSymbol = css::chart::ChartSymbolType::AUTO;
break;
case chart2::SymbolStyle_STANDARD:
nSymbol = rSymbol.StandardSymbol%15;
break;
- case chart2::SymbolStyle_POLYGON://new feature
- nSymbol = css::chart::ChartSymbolType::AUTO;
- break;
case chart2::SymbolStyle_GRAPHIC:
nSymbol = css::chart::ChartSymbolType::BITMAPURL;
break;
@@ -215,7 +214,7 @@ void WrappedSymbolProperties::addWrappedPropertiesForDiagram( std::vector< std::
WrappedSymbolTypeProperty::WrappedSymbolTypeProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedSeriesOrDiagramProperty< sal_Int32 >( "SymbolType"
+ : WrappedSeriesOrDiagramProperty< sal_Int32 >( u"SymbolType"_ustr
, uno::Any( css::chart::ChartSymbolType::NONE )
, spChart2ModelContact
, ePropertyType )
@@ -227,7 +226,7 @@ sal_Int32 WrappedSymbolTypeProperty::getValueFromSeries( const Reference< beans:
sal_Int32 aRet = 0;
m_aDefaultValue >>= aRet;
chart2::Symbol aSymbol;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol ) )
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymbol ) )
aRet = lcl_getSymbolType( aSymbol );
return aRet;
}
@@ -238,10 +237,10 @@ void WrappedSymbolTypeProperty::setValueToSeries( const Reference< beans::XPrope
return;
chart2::Symbol aSymbol;
- xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol;
+ xSeriesPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymbol;
lcl_setSymbolTypeToSymbol( nSymbolType, aSymbol );
- xSeriesPropertySet->setPropertyValue( "Symbol", uno::Any( aSymbol ) );
+ xSeriesPropertySet->setPropertyValue( u"Symbol"_ustr, uno::Any( aSymbol ) );
}
Any WrappedSymbolTypeProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -285,9 +284,9 @@ beans::PropertyState WrappedSymbolTypeProperty::getPropertyState( const Referenc
m_spChart2ModelContact)
{
rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() );
- Reference< chart2::XDataSeries > xSeries( xInnerPropertyState, uno::UNO_QUERY );
- Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
- if( ChartTypeHelper::isSupportingSymbolProperties( xChartType, 2 ) )
+ rtl::Reference< ::chart::DataSeries > xSeries( dynamic_cast<DataSeries*>(xInnerPropertyState.get()) );
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeOfSeries( xSeries ) );
+ if (xChartType.is() && xChartType->isSupportingSymbolProperties(2))
return beans::PropertyState_DIRECT_VALUE;
}
return WrappedProperty::getPropertyState( xInnerPropertyState );
@@ -296,7 +295,7 @@ beans::PropertyState WrappedSymbolTypeProperty::getPropertyState( const Referenc
WrappedSymbolBitmapURLProperty::WrappedSymbolBitmapURLProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedSeriesOrDiagramProperty<OUString>("SymbolBitmapURL",
+ : WrappedSeriesOrDiagramProperty<OUString>(u"SymbolBitmapURL"_ustr,
uno::Any(OUString()), spChart2ModelContact, ePropertyType)
{
}
@@ -314,13 +313,13 @@ void WrappedSymbolBitmapURLProperty::setValueToSeries(
return;
chart2::Symbol aSymbol;
- if (xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol)
+ if (xSeriesPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymbol)
{
if (!xNewGraphicURL.isEmpty())
{
Graphic aGraphic = vcl::graphic::loadFromURL(xNewGraphicURL);
aSymbol.Graphic.set(aGraphic.GetXGraphic());
- xSeriesPropertySet->setPropertyValue("Symbol", uno::Any(aSymbol));
+ xSeriesPropertySet->setPropertyValue(u"Symbol"_ustr, uno::Any(aSymbol));
}
}
}
@@ -328,7 +327,7 @@ void WrappedSymbolBitmapURLProperty::setValueToSeries(
WrappedSymbolBitmapProperty::WrappedSymbolBitmapProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedSeriesOrDiagramProperty<uno::Reference<graphic::XGraphic>>("SymbolBitmap",
+ : WrappedSeriesOrDiagramProperty<uno::Reference<graphic::XGraphic>>(u"SymbolBitmap"_ustr,
uno::Any(uno::Reference<graphic::XGraphic>()), spChart2ModelContact, ePropertyType)
{
}
@@ -339,7 +338,7 @@ uno::Reference<graphic::XGraphic> WrappedSymbolBitmapProperty::getValueFromSerie
m_aDefaultValue >>= xGraphic;
chart2::Symbol aSymbol;
- if (xSeriesPropertySet.is() && (xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol)
+ if (xSeriesPropertySet.is() && (xSeriesPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymbol)
&& aSymbol.Graphic.is())
{
xGraphic = aSymbol.Graphic;
@@ -355,12 +354,12 @@ void WrappedSymbolBitmapProperty::setValueToSeries(
return;
chart2::Symbol aSymbol;
- if (xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol)
+ if (xSeriesPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymbol)
{
if (xNewGraphic.is())
{
aSymbol.Graphic.set(xNewGraphic);
- xSeriesPropertySet->setPropertyValue("Symbol", uno::Any(aSymbol));
+ xSeriesPropertySet->setPropertyValue(u"Symbol"_ustr, uno::Any(aSymbol));
}
}
}
@@ -388,7 +387,7 @@ void lcl_correctSymbolSizeForBitmaps( chart2::Symbol& rSymbol )
bool bFoundSize = false;
try
{
- if( xProp->getPropertyValue( "Size100thMM" ) >>= aSize )
+ if( xProp->getPropertyValue( u"Size100thMM"_ustr ) >>= aSize )
{
if( aSize.Width == 0 && aSize.Height == 0 )
aSize = aDefaultSize;
@@ -404,7 +403,7 @@ void lcl_correctSymbolSizeForBitmaps( chart2::Symbol& rSymbol )
if(!bFoundSize)
{
awt::Size aAWTPixelSize(10,10);
- if( xProp->getPropertyValue( "SizePixel" ) >>= aAWTPixelSize )
+ if( xProp->getPropertyValue( u"SizePixel"_ustr ) >>= aAWTPixelSize )
{
Size aPixelSize(aAWTPixelSize.Width,aAWTPixelSize.Height);
Size aNewSize = o3tl::convert(aPixelSize, o3tl::Length::pt, o3tl::Length::mm100);
@@ -429,7 +428,7 @@ void lcl_correctSymbolSizeForBitmaps( chart2::Symbol& rSymbol )
WrappedSymbolSizeProperty::WrappedSymbolSizeProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedSeriesOrDiagramProperty< awt::Size >( "SymbolSize"
+ : WrappedSeriesOrDiagramProperty< awt::Size >( u"SymbolSize"_ustr
, uno::Any( awt::Size(250,250) ), spChart2ModelContact, ePropertyType )
{
}
@@ -439,7 +438,7 @@ awt::Size WrappedSymbolSizeProperty::getValueFromSeries( const Reference< beans:
awt::Size aRet;
m_aDefaultValue >>= aRet;
chart2::Symbol aSymbol;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol ))
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymbol ))
aRet = aSymbol.Size;
return aRet;
}
@@ -452,11 +451,11 @@ void WrappedSymbolSizeProperty::setValueToSeries(
return;
chart2::Symbol aSymbol;
- if( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol )
+ if( xSeriesPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymbol )
{
aSymbol.Size = aNewSize;
lcl_correctSymbolSizeForBitmaps(aSymbol);
- xSeriesPropertySet->setPropertyValue( "Symbol", uno::Any( aSymbol ) );
+ xSeriesPropertySet->setPropertyValue( u"Symbol"_ustr, uno::Any( aSymbol ) );
}
}
@@ -470,7 +469,7 @@ beans::PropertyState WrappedSymbolSizeProperty::getPropertyState( const Referenc
{
chart2::Symbol aSymbol;
Reference< beans::XPropertySet > xSeriesPropertySet( xInnerPropertyState, uno::UNO_QUERY );
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol ))
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue(u"Symbol"_ustr) >>= aSymbol ))
{
if( aSymbol.Style != chart2::SymbolStyle_NONE )
return beans::PropertyState_DIRECT_VALUE;
@@ -486,7 +485,7 @@ beans::PropertyState WrappedSymbolSizeProperty::getPropertyState( const Referenc
WrappedSymbolAndLinesProperty::WrappedSymbolAndLinesProperty(
const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
tSeriesOrDiagramPropertyType ePropertyType )
- : WrappedSeriesOrDiagramProperty< bool >( "Lines"
+ : WrappedSeriesOrDiagramProperty< bool >( u"Lines"_ustr
, uno::Any( true ), spChart2ModelContact, ePropertyType )
{
}
@@ -505,17 +504,17 @@ void WrappedSymbolAndLinesProperty::setValueToSeries(
return;
drawing::LineStyle eOldLineStyle( drawing::LineStyle_SOLID );
- xSeriesPropertySet->getPropertyValue( "LineStyle" ) >>= eOldLineStyle;
+ xSeriesPropertySet->getPropertyValue( u"LineStyle"_ustr ) >>= eOldLineStyle;
if( bDrawLines )
{
//#i114298# don't overwrite dashed lines with solid lines here
if( eOldLineStyle == drawing::LineStyle_NONE )
- xSeriesPropertySet->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_SOLID ) );
+ xSeriesPropertySet->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_SOLID ) );
}
else
{
if( eOldLineStyle != drawing::LineStyle_NONE )
- xSeriesPropertySet->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_NONE ) );
+ xSeriesPropertySet->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
}
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx
index c35a75e31a54..850e916eaf0f 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx
@@ -28,7 +28,7 @@ namespace chart
{
WrappedTextRotationProperty::WrappedTextRotationProperty( bool bDirectState )
- : ::chart::WrappedProperty( "TextRotation" , "TextRotation" )
+ : ::chart::WrappedProperty( u"TextRotation"_ustr , u"TextRotation"_ustr )
, m_bDirectState( bDirectState )
{
}
diff --git a/chart2/source/controller/chartcontroller.component b/chart2/source/controller/chartcontroller.component
deleted file mode 100644
index 01201cbb2494..000000000000
--- a/chart2/source/controller/chartcontroller.component
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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 .
- -->
-
-<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.chart.ElementSelectorToolbarController"
- constructor="com_sun_star_comp_chart_ElementSelectorToolbarController_get_implementation">
- <service name="com.sun.star.frame.ToolbarController"/>
- </implementation>
- <implementation name="com.sun.star.comp.chart2.ChartController"
- constructor="com_sun_star_comp_chart2_ChartController_get_implementation">
- <service name="com.sun.star.chart2.ChartController"/>
- <service name="com.sun.star.frame.Controller"/>
- </implementation>
- <implementation name="com.sun.star.comp.chart2.ChartDocumentWrapper"
- constructor="com_sun_star_comp_chart2_ChartDocumentWrapper_get_implementation">
- <service name="com.sun.star.beans.PropertySet"/>
- <service name="com.sun.star.chart.ChartDocument"/>
- <service name="com.sun.star.chart2.ChartDocumentWrapper"/>
- <service name="com.sun.star.xml.UserDefinedAttributesSupplier"/>
- </implementation>
- <implementation name="com.sun.star.comp.chart2.ChartFrameLoader"
- constructor="com_sun_star_comp_chart2_ChartFrameLoader_get_implementation">
- <service name="com.sun.star.frame.SynchronousFrameLoader"/>
- </implementation>
- <implementation name="com.sun.star.comp.chart2.ChartTypeDialog"
- constructor="com_sun_star_comp_chart2_ChartTypeDialog_get_implementation">
- <service name="com.sun.star.chart2.ChartTypeDialog"/>
- </implementation>
- <implementation name="com.sun.star.comp.chart2.WizardDialog"
- constructor="com_sun_star_comp_chart2_WizardDialog_get_implementation">
- <service name="com.sun.star.chart2.WizardDialog"/>
- </implementation>
- <implementation name="org.libreoffice.comp.chart2.sidebar.ChartPanelFactory"
- constructor="org_libreoffice_comp_chart2_sidebar_ChartPanelFactory">
- <service name="com.sun.star.ui.UIElementFactory"/>
- </implementation>
- <implementation name="org.libreoffice.chart2.Chart2ToolboxController"
- constructor="org_libreoffice_chart2_Chart2ToolboxController">
- <service name="com.sun.star.frame.ToolbarController"/>
- </implementation>
-</component>
diff --git a/chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx b/chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx
index 91307afaad3d..3e426c4e02c9 100644
--- a/chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx
+++ b/chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx
@@ -32,11 +32,12 @@ const sal_uInt16 CUBIC_SPLINE_POS = 0;
const sal_uInt16 B_SPLINE_POS = 1;
SplinePropertiesDialog::SplinePropertiesDialog(weld::Window* pParent)
- : GenericDialogController(pParent, "modules/schart/ui/smoothlinesdlg.ui", "SmoothLinesDialog")
- , m_xLB_Spline_Type(m_xBuilder->weld_combo_box("SplineTypeComboBox"))
- , m_xMF_SplineResolution(m_xBuilder->weld_spin_button("ResolutionSpinbutton"))
- , m_xFT_SplineOrder(m_xBuilder->weld_label("PolynomialsLabel"))
- , m_xMF_SplineOrder(m_xBuilder->weld_spin_button("PolynomialsSpinButton"))
+ : GenericDialogController(pParent, u"modules/schart/ui/smoothlinesdlg.ui"_ustr,
+ u"SmoothLinesDialog"_ustr)
+ , m_xLB_Spline_Type(m_xBuilder->weld_combo_box(u"SplineTypeComboBox"_ustr))
+ , m_xMF_SplineResolution(m_xBuilder->weld_spin_button(u"ResolutionSpinbutton"_ustr))
+ , m_xFT_SplineOrder(m_xBuilder->weld_label(u"PolynomialsLabel"_ustr))
+ , m_xMF_SplineOrder(m_xBuilder->weld_spin_button(u"PolynomialsSpinButton"_ustr))
{
m_xDialog->set_title(SchResId(STR_DLG_SMOOTH_LINE_PROPERTIES));
@@ -85,11 +86,12 @@ IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox&, v
}
SteppedPropertiesDialog::SteppedPropertiesDialog(weld::Window* pParent)
- : GenericDialogController(pParent, "modules/schart/ui/steppedlinesdlg.ui", "SteppedLinesDialog")
- , m_xRB_Start(m_xBuilder->weld_radio_button("step_start_rb"))
- , m_xRB_End(m_xBuilder->weld_radio_button("step_end_rb"))
- , m_xRB_CenterX(m_xBuilder->weld_radio_button("step_center_x_rb"))
- , m_xRB_CenterY(m_xBuilder->weld_radio_button("step_center_y_rb"))
+ : GenericDialogController(pParent, u"modules/schart/ui/steppedlinesdlg.ui"_ustr,
+ u"SteppedLinesDialog"_ustr)
+ , m_xRB_Start(m_xBuilder->weld_radio_button(u"step_start_rb"_ustr))
+ , m_xRB_End(m_xBuilder->weld_radio_button(u"step_end_rb"_ustr))
+ , m_xRB_CenterX(m_xBuilder->weld_radio_button(u"step_center_x_rb"_ustr))
+ , m_xRB_CenterY(m_xBuilder->weld_radio_button(u"step_center_y_rb"_ustr))
{
m_xDialog->set_title(SchResId(STR_DLG_STEPPED_LINE_PROPERTIES));
}
diff --git a/chart2/source/controller/dialogs/ChartResourceGroups.cxx b/chart2/source/controller/dialogs/ChartResourceGroups.cxx
index 19534aa1e0b0..f773eefd7062 100644
--- a/chart2/source/controller/dialogs/ChartResourceGroups.cxx
+++ b/chart2/source/controller/dialogs/ChartResourceGroups.cxx
@@ -29,8 +29,8 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
Dim3DLookResourceGroup::Dim3DLookResourceGroup(weld::Builder* pBuilder)
- : m_xCB_3DLook(pBuilder->weld_check_button("3dlook"))
- , m_xLB_Scheme(pBuilder->weld_combo_box("3dscheme"))
+ : m_xCB_3DLook(pBuilder->weld_check_button(u"3dlook"_ustr))
+ , m_xLB_Scheme(pBuilder->weld_combo_box(u"3dscheme"_ustr))
{
m_xCB_3DLook->connect_toggled(LINK(this, Dim3DLookResourceGroup, Dim3DLookCheckHdl));
m_xLB_Scheme->connect_changed(LINK(this, Dim3DLookResourceGroup, SelectSchemeHdl));
@@ -87,7 +87,7 @@ IMPL_LINK_NOARG(Dim3DLookResourceGroup, SelectSchemeHdl, weld::ComboBox&, void)
}
SortByXValuesResourceGroup::SortByXValuesResourceGroup(weld::Builder* pBuilder)
- : m_xCB_XValueSorting(pBuilder->weld_check_button("sort"))
+ : m_xCB_XValueSorting(pBuilder->weld_check_button(u"sort"_ustr))
{
m_xCB_XValueSorting->connect_toggled(
LINK(this, SortByXValuesResourceGroup, SortByXValuesCheckHdl));
@@ -115,10 +115,10 @@ IMPL_LINK_NOARG(SortByXValuesResourceGroup, SortByXValuesCheckHdl, weld::Togglea
}
StackingResourceGroup::StackingResourceGroup(weld::Builder* pBuilder)
- : m_xCB_Stacked(pBuilder->weld_check_button("stack"))
- , m_xRB_Stack_Y(pBuilder->weld_radio_button("ontop"))
- , m_xRB_Stack_Y_Percent(pBuilder->weld_radio_button("percent"))
- , m_xRB_Stack_Z(pBuilder->weld_radio_button("deep"))
+ : m_xCB_Stacked(pBuilder->weld_check_button(u"stack"_ustr))
+ , m_xRB_Stack_Y(pBuilder->weld_radio_button(u"ontop"_ustr))
+ , m_xRB_Stack_Y_Percent(pBuilder->weld_radio_button(u"percent"_ustr))
+ , m_xRB_Stack_Z(pBuilder->weld_radio_button(u"deep"_ustr))
{
m_xCB_Stacked->connect_toggled(LINK(this, StackingResourceGroup, StackingEnableHdl));
m_xRB_Stack_Y->connect_toggled(LINK(this, StackingResourceGroup, StackingChangeHdl));
@@ -142,9 +142,6 @@ void StackingResourceGroup::fillControls(const ChartTypeParameter& rParameter)
!= GlobalStackMode_STACK_Z); //todo remove this condition if z stacking radio button is really used
switch (rParameter.eStackMode)
{
- case GlobalStackMode_STACK_Y:
- m_xRB_Stack_Y->set_active(true);
- break;
case GlobalStackMode_STACK_Y_PERCENT:
m_xRB_Stack_Y_Percent->set_active(true);
break;
@@ -157,6 +154,7 @@ void StackingResourceGroup::fillControls(const ChartTypeParameter& rParameter)
*/
m_xRB_Stack_Y->set_active(true);
break;
+ case GlobalStackMode_STACK_Y:
default:
m_xRB_Stack_Y->set_active(true);
break;
@@ -198,29 +196,29 @@ IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl, weld::Toggleable&, voi
SplineResourceGroup::SplineResourceGroup(weld::Builder* pBuilder, weld::Window* pParent)
: m_pParent(pParent)
- , m_xFT_LineType(pBuilder->weld_label("linetypeft"))
- , m_xLB_LineType(pBuilder->weld_combo_box("linetype"))
- , m_xPB_DetailsDialog(pBuilder->weld_button("properties"))
+ , m_xFT_LineType(pBuilder->weld_label(u"linetypeft"_ustr))
+ , m_xLB_LineType(pBuilder->weld_combo_box(u"linetype"_ustr))
+ , m_xPB_DetailsDialog(pBuilder->weld_button(u"properties"_ustr))
{
m_xLB_LineType->connect_changed(LINK(this, SplineResourceGroup, LineTypeChangeHdl));
}
-SplinePropertiesDialog& SplineResourceGroup::getSplinePropertiesDialog()
+const std::shared_ptr<SplinePropertiesDialog>& SplineResourceGroup::getSplinePropertiesDialog()
{
if (!m_xSplinePropertiesDialog)
{
m_xSplinePropertiesDialog.reset(new SplinePropertiesDialog(m_pParent));
}
- return *m_xSplinePropertiesDialog;
+ return m_xSplinePropertiesDialog;
}
-SteppedPropertiesDialog& SplineResourceGroup::getSteppedPropertiesDialog()
+const std::shared_ptr<SteppedPropertiesDialog>& SplineResourceGroup::getSteppedPropertiesDialog()
{
if (!m_xSteppedPropertiesDialog)
{
m_xSteppedPropertiesDialog.reset(new SteppedPropertiesDialog(m_pParent));
}
- return *m_xSteppedPropertiesDialog;
+ return m_xSteppedPropertiesDialog;
}
void SplineResourceGroup::showControls(bool bShow)
@@ -245,7 +243,7 @@ void SplineResourceGroup::fillControls(const ChartTypeParameter& rParameter)
m_xPB_DetailsDialog->connect_clicked(
LINK(this, SplineResourceGroup, SplineDetailsDialogHdl));
m_xPB_DetailsDialog->set_tooltip_text(SchResId(STR_DLG_SMOOTH_LINE_PROPERTIES));
- getSplinePropertiesDialog().fillControls(rParameter);
+ getSplinePropertiesDialog()->fillControls(rParameter);
break;
case CurveStyle_STEP_START:
case CurveStyle_STEP_END:
@@ -256,7 +254,7 @@ void SplineResourceGroup::fillControls(const ChartTypeParameter& rParameter)
m_xPB_DetailsDialog->connect_clicked(
LINK(this, SplineResourceGroup, SteppedDetailsDialogHdl));
m_xPB_DetailsDialog->set_tooltip_text(SchResId(STR_DLG_STEPPED_LINE_PROPERTIES));
- getSteppedPropertiesDialog().fillControls(rParameter);
+ getSteppedPropertiesDialog()->fillControls(rParameter);
break;
default:
m_xLB_LineType->set_active(-1);
@@ -268,10 +266,10 @@ void SplineResourceGroup::fillParameter(ChartTypeParameter& rParameter)
switch (m_xLB_LineType->get_active())
{
case POS_LINETYPE_SMOOTH:
- getSplinePropertiesDialog().fillParameter(rParameter, true);
+ getSplinePropertiesDialog()->fillParameter(rParameter, true);
break;
case POS_LINETYPE_STEPPED:
- getSteppedPropertiesDialog().fillParameter(rParameter, true);
+ getSteppedPropertiesDialog()->fillParameter(rParameter, true);
break;
default: // includes POS_LINETYPE_STRAIGHT
rParameter.eCurveStyle = CurveStyle_LINES;
@@ -288,43 +286,65 @@ IMPL_LINK_NOARG(SplineResourceGroup, LineTypeChangeHdl, weld::ComboBox&, void)
IMPL_LINK_NOARG(SplineResourceGroup, SplineDetailsDialogHdl, weld::Button&, void)
{
ChartTypeParameter aOldParameter;
- getSplinePropertiesDialog().fillParameter(aOldParameter,
- m_xLB_LineType->get_active() == POS_LINETYPE_SMOOTH);
+ std::shared_ptr<SplinePropertiesDialog> xDlg = getSplinePropertiesDialog();
+ xDlg->fillParameter(aOldParameter, m_xLB_LineType->get_active() == POS_LINETYPE_SMOOTH);
const sal_Int32 iOldLineTypePos = m_xLB_LineType->get_active();
m_xLB_LineType->set_active(POS_LINETYPE_SMOOTH);
- if (getSplinePropertiesDialog().run() == RET_OK)
- {
- if (m_pChangeListener)
- m_pChangeListener->stateChanged();
- }
- else
- {
- //restore old state:
- m_xLB_LineType->set_active(iOldLineTypePos);
- getSplinePropertiesDialog().fillControls(aOldParameter);
- }
+ weld::GenericDialogController::runAsync(xDlg, [this, xDlg, aOldParameter,
+ iOldLineTypePos](sal_Int32 nResult) {
+ m_xSplinePropertiesDialog = nullptr;
+ auto xNewDlg = getSplinePropertiesDialog();
+
+ if (nResult == RET_OK)
+ {
+ ChartTypeParameter aNewParameter;
+ xDlg->fillParameter(aNewParameter, m_xLB_LineType->get_active() == POS_LINETYPE_SMOOTH);
+ xNewDlg->fillControls(aNewParameter);
+
+ if (m_pChangeListener)
+ m_pChangeListener->stateChanged();
+ }
+ else
+ {
+ //restore old state:
+ m_xLB_LineType->set_active(iOldLineTypePos);
+ xNewDlg->fillControls(aOldParameter);
+ }
+ });
}
IMPL_LINK_NOARG(SplineResourceGroup, SteppedDetailsDialogHdl, weld::Button&, void)
{
ChartTypeParameter aOldParameter;
- getSteppedPropertiesDialog().fillParameter(aOldParameter, m_xLB_LineType->get_active()
- == POS_LINETYPE_STEPPED);
+ std::shared_ptr<SteppedPropertiesDialog> xDlg = getSteppedPropertiesDialog();
+ xDlg->fillParameter(aOldParameter, m_xLB_LineType->get_active() == POS_LINETYPE_STEPPED);
const sal_Int32 iOldLineTypePos = m_xLB_LineType->get_active();
m_xLB_LineType->set_active(POS_LINETYPE_STEPPED);
- if (getSteppedPropertiesDialog().run() == RET_OK)
- {
- if (m_pChangeListener)
- m_pChangeListener->stateChanged();
- }
- else
- {
- //restore old state:
- m_xLB_LineType->set_active(iOldLineTypePos);
- getSteppedPropertiesDialog().fillControls(aOldParameter);
- }
+
+ weld::GenericDialogController::runAsync(
+ xDlg, [this, xDlg, aOldParameter, iOldLineTypePos](sal_Int32 nResult) {
+ m_xSteppedPropertiesDialog = nullptr;
+ auto xNewDlg = getSteppedPropertiesDialog();
+
+ if (nResult == RET_OK)
+ {
+ ChartTypeParameter aNewParameter;
+ xDlg->fillParameter(aNewParameter,
+ m_xLB_LineType->get_active() == POS_LINETYPE_STEPPED);
+ xNewDlg->fillControls(aNewParameter);
+
+ if (m_pChangeListener)
+ m_pChangeListener->stateChanged();
+ }
+ else
+ {
+ //restore old state:
+ m_xLB_LineType->set_active(iOldLineTypePos);
+ xDlg->fillControls(aOldParameter);
+ }
+ });
}
GeometryResourceGroup::GeometryResourceGroup(weld::Builder* pBuilder)
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 06d2dd952892..555600b86edf 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -23,8 +23,8 @@
#include <ResId.hxx>
#include <strings.hrc>
#include <bitmaps.hlst>
-#include <ChartModelHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesHelper.hxx>
#include <Diagram.hxx>
#include <ControllerLockGuard.hxx>
#include <AxisHelper.hxx>
@@ -33,14 +33,12 @@
#include <ChartModel.hxx>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <svtools/valueset.hxx>
#include <vcl/image.hxx>
#include <vcl/settings.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -149,7 +147,7 @@ ChartTypeParameter ChartTypeDialogController::getChartTypeParameterForService(
try
{
- xTemplateProps->getPropertyValue( "Geometry3D" ) >>= aRet.nGeometry3D;
+ xTemplateProps->getPropertyValue( u"Geometry3D"_ustr ) >>= aRet.nGeometry3D;
}
catch( uno::Exception& ex )
{
@@ -283,7 +281,7 @@ rtl::Reference< ChartTypeTemplate > ChartTypeDialogController::getCurrentTemplat
}
try
{
- xTemplateProps->setPropertyValue( "Geometry3D" , uno::Any(rParameter.nGeometry3D) );
+ xTemplateProps->setPropertyValue( u"Geometry3D"_ustr , uno::Any(rParameter.nGeometry3D) );
}
catch( uno::Exception & ex )
{
@@ -306,29 +304,45 @@ rtl::Reference< ChartTypeTemplate > ChartTypeDialogController::getCurrentTemplat
}
void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParameter
- , const rtl::Reference<::chart::ChartModel>& xChartModel )
+ , const rtl::Reference<::chart::ChartModel>& xChartModel
+ , const uno::Reference<beans::XPropertySet>& xTemplateProps)
{
rtl::Reference< ::chart::ChartTypeManager > xTemplateManager = xChartModel->getTypeManager();
- uno::Reference< XChartTypeTemplate > xTemplate( getCurrentTemplate( rParameter, xTemplateManager ) );
+ rtl::Reference< ::chart::ChartTypeTemplate > xTemplate( getCurrentTemplate( rParameter, xTemplateManager ) );
if(!xTemplate.is())
return;
// locked controllers
ControllerLockGuardUNO aCtrlLockGuard( xChartModel );
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
- DiagramHelper::tTemplateWithServiceName aTemplateWithService(
- DiagramHelper::getTemplateForDiagram( xDiagram, xTemplateManager ));
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
+ Diagram::tTemplateWithServiceName aTemplateWithService;
+ if (xDiagram)
+ aTemplateWithService = xDiagram->getTemplate( xTemplateManager );
if( aTemplateWithService.xChartTypeTemplate.is())
- aTemplateWithService.xChartTypeTemplate->resetStyles( xDiagram );
+ aTemplateWithService.xChartTypeTemplate->resetStyles2( xDiagram );
xTemplate->changeDiagram( xDiagram );
if( AllSettings::GetMathLayoutRTL() )
AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) );
if( rParameter.b3DLook )
- ThreeDHelper::setScheme( xDiagram, rParameter.eThreeDLookScheme );
+ xDiagram->setScheme( rParameter.eThreeDLookScheme );
if (xDiagram.is())
{
xDiagram->setPropertyValue(CHART_UNONAME_SORT_BY_XVALUES, uno::Any(rParameter.bSortByXValues));
+
+ sal_Int32 nSplitPos;
+ try {
+ if (xTemplateProps.is()) {
+ xTemplateProps->getPropertyValue(u"SplitPos"_ustr) >>= nSplitPos;
+ xDiagram->setPropertyValue(u"SplitPos"_ustr, uno::Any(nSplitPos));
+ }
+ }
+ catch( uno::Exception & ex )
+ {
+ //not all templates need to support SplitPos
+ ex.Context.is();//to have debug information without compilation warnings
+ }
+
}
}
void ChartTypeDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ )
@@ -542,6 +556,61 @@ void BarChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const Ch
rSubTypeList.SetItemText( 4, SchResId( STR_DEEP ) );
}
+HistogramChartDialogController::HistogramChartDialogController()
+{
+ bSupports3D = false;
+}
+
+HistogramChartDialogController::~HistogramChartDialogController()
+{
+}
+
+OUString HistogramChartDialogController::getName()
+{
+ return SchResId(STR_TYPE_HISTOGRAM);
+}
+
+OUString HistogramChartDialogController::getImage()
+{
+ return BMP_TYPE_HISTOGRAM;
+}
+
+const tTemplateServiceChartTypeParameterMap& HistogramChartDialogController::getTemplateMap() const
+{
+ static tTemplateServiceChartTypeParameterMap s_aTemplateMap{
+ {"com.sun.star.chart2.template.Histogram" , ChartTypeParameter(1, false, false, GlobalStackMode_NONE)}
+ };
+ return s_aTemplateMap;
+}
+void HistogramChartDialogController::fillSubTypeList(ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/)
+{
+ rSubTypeList.Clear();
+ rSubTypeList.InsertItem(1, Image(StockImage::Yes, BMP_HISTOGRAM));
+ rSubTypeList.SetItemText(1, SchResId(STR_HISTOGRAM));
+}
+
+void HistogramChartDialogController::adjustParameterToSubType(ChartTypeParameter& rParameter)
+{
+ rParameter.b3DLook = false;
+
+ switch (rParameter.nSubTypeIndex)
+ {
+ case 2:
+ // Pareto Histogram
+ break;
+ default:
+ // Standard Histogram
+ rParameter.eStackMode = GlobalStackMode_NONE; // Ensure no stacking
+ rParameter.bXAxisWithValues = false; // Standard histogram may not need X-axis values
+ // Set default bin width or other relevant properties if needed
+ break;
+ }
+}
+
+//=========
+// PieChartDialogController
+//=========
+
PieChartDialogController::PieChartDialogController()
{
}
@@ -608,6 +677,157 @@ void PieChartDialogController::adjustParameterToSubType( ChartTypeParameter& rPa
rParameter.eStackMode = GlobalStackMode_NONE;
}
+//=========
+// OfPieChartDialogController
+//=========
+
+OfPieChartDialogController::OfPieChartDialogController()
+{
+}
+
+OfPieChartDialogController::~OfPieChartDialogController()
+{
+}
+
+OUString OfPieChartDialogController::getName()
+{
+ return SchResId(STR_TYPE_OFPIE);
+}
+
+OUString OfPieChartDialogController::getImage()
+{
+ return BMP_TYPE_OFPIE;
+}
+
+const tTemplateServiceChartTypeParameterMap& OfPieChartDialogController::getTemplateMap() const
+{
+ static tTemplateServiceChartTypeParameterMap s_aTemplateMap{
+ {"com.sun.star.chart2.template.BarOfPie" , ChartTypeParameter(1,false,false)},
+ {"com.sun.star.chart2.template.PieOfPie" , ChartTypeParameter(2,false,false)}};
+ return s_aTemplateMap;
+}
+void OfPieChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ )
+{
+ rSubTypeList.Clear();
+
+ rSubTypeList.InsertItem(1, Image(StockImage::Yes, BMP_BAR_OF_PIE));
+ rSubTypeList.InsertItem(2, Image(StockImage::Yes, BMP_PIE_OF_PIE));
+ rSubTypeList.SetItemText( 1, SchResId( STR_BAR_OF_PIE ) );
+ rSubTypeList.SetItemText( 2, SchResId( STR_PIE_OF_PIE ) );
+}
+
+bool OfPieChartDialogController::shouldShow_3DLookControl() const
+{
+ // Maybe a TODO?
+ return false;
+}
+
+void OfPieChartDialogController::adjustParameterToSubType( ChartTypeParameter& rParameter )
+{
+ if(rParameter.eStackMode==GlobalStackMode_STACK_Z)
+ rParameter.eStackMode = GlobalStackMode_NONE;
+}
+
+void OfPieChartDialogController::showExtraControls(weld::Builder* pBuilder)
+{
+ if (!m_xFT_CompositeSize)
+ {
+ m_xFT_CompositeSize = pBuilder->weld_label(u"compositesizeft"_ustr);
+ assert(m_xFT_CompositeSize);
+ }
+ if (!m_xMF_CompositeSize)
+ {
+ m_xMF_CompositeSize = pBuilder->weld_spin_button(u"compositesize"_ustr);
+ assert(m_xMF_CompositeSize);
+
+ m_xMF_CompositeSize->set_increments(1, 10);
+ m_xMF_CompositeSize->set_range(2, 100);
+
+ m_xMF_CompositeSize->connect_value_changed( LINK( this,
+ OfPieChartDialogController, ChangeCompositeSizeHdl ) );
+ m_xMF_CompositeSize->set_sensitive(true);
+ }
+
+ m_xFT_CompositeSize->show();
+ m_xMF_CompositeSize->show();
+}
+
+void OfPieChartDialogController::hideExtraControls() const
+{
+ if (m_xFT_CompositeSize)
+ m_xFT_CompositeSize->hide();
+ if (m_xMF_CompositeSize)
+ m_xMF_CompositeSize->hide();
+}
+
+void OfPieChartDialogController::fillExtraControls(
+ const rtl::Reference<::chart::ChartModel>& xChartModel
+ , const uno::Reference< beans::XPropertySet >& xTemplateProps ) const
+{
+ if (!m_xMF_CompositeSize)
+ return;
+
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
+ if(!xDiagram.is())
+ return;
+
+ sal_Int32 nCompositeSize = 2;
+
+ if(xTemplateProps.is())
+ {
+ try
+ {
+ xTemplateProps->getPropertyValue( u"SplitPos"_ustr ) >>= nCompositeSize;
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ }
+ if( nCompositeSize < 2 )
+ nCompositeSize = 2;
+ m_xMF_CompositeSize->set_value(nCompositeSize);
+
+ // Limit based on number of entries in the series
+ const std::vector< rtl::Reference< DataSeries > > dataSeriesVec = xChartModel->getDataSeries();
+ if (!dataSeriesVec.empty()) {
+ const rtl::Reference<DataSeries>& ds = dataSeriesVec[0];
+ const DataSeries::tDataSequenceContainer data = ds->getDataSequences2();
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aValuesSeries(
+ DataSeriesHelper::getAllDataSequencesByRole( data , u"values"_ustr ) );
+
+ assert(!aValuesSeries.empty());
+
+ const uno::Reference< chart2::data::XDataSequence > xSeq( aValuesSeries.front()->getValues() );
+
+ // Allow all but one entry to be aggregated in the composite wedge
+ sal_Int32 nMaxCompositeSize = xSeq->getData().getLength() - 1;
+
+ if( nMaxCompositeSize < 2 )
+ nMaxCompositeSize = 2;
+ m_xMF_CompositeSize->set_max(nMaxCompositeSize);
+ }
+}
+
+void OfPieChartDialogController::setTemplateProperties( const uno::Reference< beans::XPropertySet >& xTemplateProps ) const
+{
+ if( xTemplateProps.is())
+ {
+ sal_Int32 nCompositeSize = m_xMF_CompositeSize->get_value();
+ xTemplateProps->setPropertyValue( u"SplitPos"_ustr , uno::Any(nCompositeSize) );
+ }
+}
+
+IMPL_LINK_NOARG(OfPieChartDialogController, ChangeCompositeSizeHdl, weld::SpinButton&, void)
+{
+ if( m_pChangeListener )
+ m_pChangeListener->stateChanged();
+}
+
+//=========
+// LineChartDialogController
+//=========
+
LineChartDialogController::LineChartDialogController()
{
}
@@ -1125,11 +1345,11 @@ void CombiColumnLineChartDialogController::showExtraControls(weld::Builder* pBui
{
if (!m_xFT_NumberOfLines)
{
- m_xFT_NumberOfLines = pBuilder->weld_label("nolinesft");
+ m_xFT_NumberOfLines = pBuilder->weld_label(u"nolinesft"_ustr);
}
if (!m_xMF_NumberOfLines)
{
- m_xMF_NumberOfLines = pBuilder->weld_spin_button("nolines");
+ m_xMF_NumberOfLines = pBuilder->weld_spin_button(u"nolines"_ustr);
m_xMF_NumberOfLines->set_increments(1, 10);
m_xMF_NumberOfLines->set_range(1, 100);
@@ -1156,7 +1376,7 @@ void CombiColumnLineChartDialogController::fillExtraControls(
if (!m_xMF_NumberOfLines)
return;
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
if(!xDiagram.is())
return;
@@ -1166,7 +1386,7 @@ void CombiColumnLineChartDialogController::fillExtraControls(
{
try
{
- xTemplateProps->getPropertyValue( "NumberOfLines" ) >>= nNumLines;
+ xTemplateProps->getPropertyValue( u"NumberOfLines"_ustr ) >>= nNumLines;
}
catch( const uno::Exception & )
{
@@ -1177,7 +1397,7 @@ void CombiColumnLineChartDialogController::fillExtraControls(
nNumLines = 0;
m_xMF_NumberOfLines->set_value(nNumLines);
- sal_Int32 nMaxLines = ChartModelHelper::getDataSeries( xChartModel ).size() - 1;
+ sal_Int32 nMaxLines = xChartModel->getDataSeries().size() - 1;
if( nMaxLines < 0 )
nMaxLines = 0;
m_xMF_NumberOfLines->set_max(nMaxLines);
@@ -1187,7 +1407,7 @@ void CombiColumnLineChartDialogController::setTemplateProperties( const uno::Ref
if( xTemplateProps.is() )
{
sal_Int32 nNumLines = m_xMF_NumberOfLines->get_value();
- xTemplateProps->setPropertyValue( "NumberOfLines" , uno::Any(nNumLines) );
+ xTemplateProps->setPropertyValue( u"NumberOfLines"_ustr , uno::Any(nNumLines) );
}
}
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index ebe1941010ad..7cab156b530c 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -20,8 +20,9 @@
#include <svl/zforlist.hxx>
#include "DataBrowser.hxx"
-#include "DataBrowserModel.hxx"
+#include <DataBrowserModel.hxx>
#include <strings.hrc>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <DiagramHelper.hxx>
#include <CommonConverters.hxx>
@@ -31,6 +32,7 @@
#include <bitmaps.hlst>
#include <helpids.h>
#include <ChartModel.hxx>
+#include <ChartType.hxx>
#include <vcl/weld.hxx>
#include <vcl/settings.hxx>
@@ -41,8 +43,6 @@
#include <svl/numformat.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
#include <algorithm>
@@ -88,7 +88,7 @@ namespace impl
class SeriesHeaderEdit
{
public:
- explicit SeriesHeaderEdit(std::unique_ptr<weld::Entry> xControl);
+ explicit SeriesHeaderEdit(std::unique_ptr<weld::Entry> xControl, sal_Int32 nHeader);
void setStartColumn( sal_Int32 nStartColumn );
sal_Int32 getStartColumn() const { return m_nStartColumn;}
@@ -117,7 +117,7 @@ private:
bool m_bShowWarningBox;
};
-SeriesHeaderEdit::SeriesHeaderEdit(std::unique_ptr<weld::Entry> xControl)
+SeriesHeaderEdit::SeriesHeaderEdit(std::unique_ptr<weld::Entry> xControl, sal_Int32 nHeader)
: m_xControl(std::move(xControl))
, m_nStartColumn(0)
, m_bShowWarningBox(false)
@@ -126,6 +126,8 @@ SeriesHeaderEdit::SeriesHeaderEdit(std::unique_ptr<weld::Entry> xControl)
m_xControl->connect_changed(LINK(this, SeriesHeaderEdit, NameEdited));
m_xControl->connect_focus_in(LINK(this, SeriesHeaderEdit, NameFocusIn));
m_xControl->connect_mouse_press(LINK(this, SeriesHeaderEdit, MousePressHdl));
+
+ m_xControl->set_buildable_name(m_xControl->get_buildable_name() + OUString::number(nHeader));
}
IMPL_LINK_NOARG(SeriesHeaderEdit, NameEdited, weld::Entry&, void)
@@ -164,13 +166,13 @@ IMPL_LINK_NOARG(SeriesHeaderEdit, MousePressHdl, const MouseEvent&, bool)
class SeriesHeader
{
public:
- explicit SeriesHeader(weld::Container* pParent, weld::Container* pColorParent);
+ explicit SeriesHeader(weld::Container* pParent, weld::Container* pColorParent, sal_Int32 nHeader);
~SeriesHeader();
void SetColor( const Color & rCol );
void SetPos();
void SetWidth( sal_Int32 nWidth );
- void SetChartType( const Reference< chart2::XChartType > & xChartType,
+ void SetChartType( const rtl::Reference< ::chart::ChartType > & xChartType,
bool bSwapXAndYAxis );
void SetSeriesName( const OUString & rName );
void SetRange( sal_Int32 nStartCol, sal_Int32 nEndCol );
@@ -222,7 +224,7 @@ private:
DECL_LINK( SeriesNameEdited, SeriesHeaderEdit&, void );
static OUString GetChartTypeImage(
- const Reference< chart2::XChartType > & xChartType,
+ const rtl::Reference< ::chart::ChartType > & xChartType,
bool bSwapXAndYAxis
);
@@ -231,17 +233,17 @@ private:
bool m_bSeriesNameChangePending;
};
-SeriesHeader::SeriesHeader(weld::Container* pParent, weld::Container* pColorParent)
+SeriesHeader::SeriesHeader(weld::Container* pParent, weld::Container* pColorParent, sal_Int32 nHeader)
: m_aUpdateDataTimer( "SeriesHeader UpdateDataTimer" )
- , m_xBuilder1(Application::CreateBuilder(pParent, "modules/schart/ui/columnfragment.ui"))
- , m_xBuilder2(Application::CreateBuilder(pColorParent, "modules/schart/ui/imagefragment.ui"))
+ , m_xBuilder1(Application::CreateBuilder(pParent, u"modules/schart/ui/columnfragment.ui"_ustr))
+ , m_xBuilder2(Application::CreateBuilder(pColorParent, u"modules/schart/ui/imagefragment.ui"_ustr))
, m_pParent(pParent)
, m_pColorParent(pColorParent)
- , m_xContainer1(m_xBuilder1->weld_container("container"))
- , m_xContainer2(m_xBuilder2->weld_container("container"))
- , m_spSymbol(m_xBuilder1->weld_image("image"))
- , m_spSeriesName(new SeriesHeaderEdit(m_xBuilder1->weld_entry("entry")))
- , m_spColorBar(m_xBuilder2->weld_image("image"))
+ , m_xContainer1(m_xBuilder1->weld_container(u"container"_ustr))
+ , m_xContainer2(m_xBuilder2->weld_container(u"container"_ustr))
+ , m_spSymbol(m_xBuilder1->weld_image(u"image"_ustr))
+ , m_spSeriesName(new SeriesHeaderEdit(m_xBuilder1->weld_entry(u"entry"_ustr), nHeader))
+ , m_spColorBar(m_xBuilder2->weld_image(u"image"_ustr))
, m_xDevice(Application::GetDefaultDevice())
, m_nStartCol( 0 )
, m_nEndCol( 0 )
@@ -291,20 +293,15 @@ void SeriesHeader::SetPos()
// series name edit field
m_spSeriesName->set_margin_start(2);
- aSize.setWidth(nSymbolHeight);
- aSize.setHeight(12);
- aSize = m_xDevice->LogicToPixel(aSize, MapMode(MapUnit::MapAppFont));
- aSize.setWidth(m_nWidth - aSize.Width() - 2);
- m_spSeriesName->set_size_request(aSize.Width(), aSize.Height());
+ sal_Int32 nHeightPx = m_xDevice->LogicToPixel(Size(0, 12), MapMode(MapUnit::MapAppFont)).Height();
+ m_spSeriesName->set_size_request(m_nWidth - aSize.Width() - 2, nHeightPx);
// color bar
- aSize.setHeight(3);
- aSize = m_xDevice->LogicToPixel(aSize, MapMode(MapUnit::MapAppFont));
- aSize.setWidth(m_nWidth);
- m_spColorBar->set_size_request(aSize.Width(), aSize.Height());
+ nHeightPx = m_xDevice->LogicToPixel(Size(0, 3), MapMode(MapUnit::MapAppFont)).Height();
+ m_spColorBar->set_size_request(m_nWidth, nHeightPx);
ScopedVclPtr<VirtualDevice> xVirDev(m_spColorBar->create_virtual_device());
- xVirDev->SetOutputSizePixel(aSize);
+ xVirDev->SetOutputSizePixel(Size(m_nWidth, nHeightPx));
xVirDev->SetFillColor(m_aColor);
xVirDev->SetLineColor(m_aColor);
xVirDev->DrawRect(tools::Rectangle(Point(0, 0), aSize));
@@ -323,7 +320,7 @@ void SeriesHeader::SetPixelWidth( sal_Int32 nWidth )
}
void SeriesHeader::SetChartType(
- const Reference< chart2::XChartType > & xChartType,
+ const rtl::Reference< ChartType > & xChartType,
bool bSwapXAndYAxis
)
{
@@ -381,7 +378,7 @@ bool SeriesHeader::HasFocus() const
}
OUString SeriesHeader::GetChartTypeImage(
- const Reference< chart2::XChartType > & xChartType,
+ const rtl::Reference< ChartType > & xChartType,
bool bSwapXAndYAxis
)
{
@@ -620,7 +617,7 @@ void DataBrowser::RenewTable()
GetDataWindow().LogicToPixel( Size( 42, 0 )).getWidth() ));
OUString aDefaultSeriesName(SchResId(STR_COLUMN_LABEL));
- replaceParamterInString( aDefaultSeriesName, "%COLUMNNUMBER", OUString::number( 24 ) );
+ replaceParamterInString( aDefaultSeriesName, u"%COLUMNNUMBER", OUString::number( 24 ) );
sal_Int32 nColumnWidth = GetDataWindow().GetTextWidth( aDefaultSeriesName )
+ GetDataWindow().LogicToPixel(Point(8 + impl::SeriesHeader::GetRelativeAppFontXPosForNameField(), 0), MapMode(MapUnit::MapAppFont)).X();
sal_Int32 nColumnCount = m_apDataBrowserModel->getColumnCount();
@@ -641,22 +638,21 @@ void DataBrowser::RenewTable()
Link<impl::SeriesHeaderEdit&,void> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
Link<impl::SeriesHeaderEdit&,void> aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
- for (auto const& elemHeader : aHeaders)
+ for (size_t i = 0; i < aHeaders.size(); ++i)
{
- auto spHeader = std::make_shared<impl::SeriesHeader>( m_pColumnsWin, m_pColorsWin );
- Reference< beans::XPropertySet > xSeriesProp( elemHeader.m_xDataSeries, uno::UNO_QUERY );
+ auto const& elemHeader = aHeaders[i];
+ auto spHeader = std::make_shared<impl::SeriesHeader>( m_pColumnsWin, m_pColorsWin, i);
Color nColor;
// @todo: Set "DraftColor", i.e. interpolated colors for gradients, bitmaps, etc.
- if( xSeriesProp.is() &&
- ( xSeriesProp->getPropertyValue( "Color" ) >>= nColor ))
+ if( elemHeader.m_xDataSeries.is() &&
+ ( elemHeader.m_xDataSeries->getPropertyValue( u"Color"_ustr ) >>= nColor ))
spHeader->SetColor( nColor );
spHeader->SetChartType( elemHeader.m_xChartType, elemHeader.m_bSwapXAndYAxis );
spHeader->SetSeriesName(
- DataSeriesHelper::getDataSeriesLabel(
- elemHeader.m_xDataSeries,
- (elemHeader.m_xChartType.is() ?
+ elemHeader.m_xDataSeries->getLabelForRole(
+ elemHeader.m_xChartType.is() ?
elemHeader.m_xChartType->getRoleOfSequenceForSeriesLabel() :
- OUString("values-y"))));
+ u"values-y"_ustr));
// index is 1-based, as 0 is for the column that contains the row-numbers
spHeader->SetRange( elemHeader.m_nStartColumn + 1, elemHeader.m_nEndColumn + 1 );
spHeader->SetGetFocusHdl( aFocusLink );
@@ -670,12 +666,12 @@ void DataBrowser::RenewTable()
Invalidate();
}
-OUString DataBrowser::GetColString( sal_Int32 nColumnId ) const
+const OUString & DataBrowser::GetColString( sal_Int32 nColumnId ) const
{
OSL_ASSERT(m_apDataBrowserModel);
if( nColumnId > 0 )
return m_apDataBrowserModel->getRoleOfColumn( nColumnId - 1 );
- return OUString();
+ return EMPTY_OUSTRING;
}
OUString DataBrowser::GetCellText( sal_Int32 nRow, sal_uInt16 nColumnId ) const
@@ -832,12 +828,11 @@ void DataBrowser::CellModified()
}
void DataBrowser::SetDataFromModel(
- const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const Reference< uno::XComponentContext > & xContext )
+ const rtl::Reference<::chart::ChartModel> & xChartDoc )
{
m_xChartDoc = xChartDoc;
- m_apDataBrowserModel.reset( new DataBrowserModel( m_xChartDoc, xContext ));
+ m_apDataBrowserModel.reset( new DataBrowserModel( m_xChartDoc ));
m_spNumberFormatterWrapper =
std::make_shared<NumberFormatterWrapper>(m_xChartDoc);
@@ -948,7 +943,7 @@ void DataBrowser::MoveLeftColumn()
// keep cursor in swapped column
if(( 0 < GetCurColumnId() ) && ( GetCurColumnId() <= ColCount() - 1 ))
{
- Dispatch( BROWSER_CURSORLEFT );
+ Dispatch(BrowserDispatchId::CURSORLEFT);
}
RenewTable();
}
@@ -969,7 +964,7 @@ void DataBrowser::MoveRightColumn()
// keep cursor in swapped column
if( GetCurColumnId() < ColCount() - 1 )
{
- Dispatch( BROWSER_CURSORRIGHT );
+ Dispatch(BrowserDispatchId::CURSORRIGHT);
}
RenewTable();
}
@@ -990,7 +985,7 @@ void DataBrowser::MoveUpRow()
// keep cursor in swapped row
if(( 0 < GetCurRow() ) && ( GetCurRow() <= GetRowCount() - 1 ))
{
- Dispatch( BROWSER_CURSORUP );
+ Dispatch(BrowserDispatchId::CURSORUP);
}
RenewTable();
}
@@ -1011,7 +1006,7 @@ void DataBrowser::MoveDownRow()
// keep cursor in swapped row
if( GetCurRow() < GetRowCount() - 1 )
{
- Dispatch( BROWSER_CURSORDOWN );
+ Dispatch(BrowserDispatchId::CURSORDOWN);
}
RenewTable();
}
@@ -1269,21 +1264,21 @@ void DataBrowser::RenewSeriesHeaders()
Link<impl::SeriesHeaderEdit&,void> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
Link<impl::SeriesHeaderEdit&,void> aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
- for (auto const& elemHeader : aHeaders)
+
+ for (size_t i = 0; i < aHeaders.size(); ++i)
{
- auto spHeader = std::make_shared<impl::SeriesHeader>( m_pColumnsWin, m_pColorsWin );
- Reference< beans::XPropertySet > xSeriesProp(elemHeader.m_xDataSeries, uno::UNO_QUERY);
+ auto const& elemHeader = aHeaders[i];
+ auto spHeader = std::make_shared<impl::SeriesHeader>( m_pColumnsWin, m_pColorsWin, i );
Color nColor;
- if( xSeriesProp.is() &&
- ( xSeriesProp->getPropertyValue( "Color" ) >>= nColor ))
+ if( elemHeader.m_xDataSeries.is() &&
+ ( elemHeader.m_xDataSeries->getPropertyValue( u"Color"_ustr ) >>= nColor ))
spHeader->SetColor( nColor );
spHeader->SetChartType( elemHeader.m_xChartType, elemHeader.m_bSwapXAndYAxis );
spHeader->SetSeriesName(
- DataSeriesHelper::getDataSeriesLabel(
- elemHeader.m_xDataSeries,
- (elemHeader.m_xChartType.is() ?
+ elemHeader.m_xDataSeries->getLabelForRole(
+ elemHeader.m_xChartType.is() ?
elemHeader.m_xChartType->getRoleOfSequenceForSeriesLabel() :
- OUString( "values-y"))));
+ u"values-y"_ustr));
spHeader->SetRange( elemHeader.m_nStartColumn + 1, elemHeader.m_nEndColumn + 1 );
spHeader->SetGetFocusHdl( aFocusLink );
spHeader->SetEditChangedHdl( aSeriesHeaderChangedLink );
@@ -1360,18 +1355,17 @@ IMPL_LINK( DataBrowser, SeriesHeaderGotFocus, impl::SeriesHeaderEdit&, rEdit, vo
IMPL_LINK( DataBrowser, SeriesHeaderChanged, impl::SeriesHeaderEdit&, rEdit, void )
{
- Reference< chart2::XDataSeries > xSeries(
- m_apDataBrowserModel->getDataSeriesByColumn( rEdit.getStartColumn() - 1 ));
- Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
- if( !xSource.is())
+ rtl::Reference< DataSeries > xSeries =
+ m_apDataBrowserModel->getDataSeriesByColumn( rEdit.getStartColumn() - 1 );
+ if( !xSeries.is())
return;
- Reference< chart2::XChartType > xChartType(
+ rtl::Reference< ChartType > xChartType(
m_apDataBrowserModel->getHeaderForSeries( xSeries ).m_xChartType );
if( xChartType.is())
{
- Reference< chart2::data::XLabeledDataSequence > xLabeledSeq(
- DataSeriesHelper::getDataSequenceByRole( xSource, xChartType->getRoleOfSequenceForSeriesLabel()));
+ uno::Reference< chart2::data::XLabeledDataSequence > xLabeledSeq =
+ DataSeriesHelper::getDataSequenceByRole( xSeries, xChartType->getRoleOfSequenceForSeriesLabel());
if( xLabeledSeq.is())
{
Reference< container::XIndexReplace > xIndexReplace( xLabeledSeq->getLabel(), uno::UNO_QUERY );
diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx
index ec85160e4437..46c62ba63e3c 100644
--- a/chart2/source/controller/dialogs/DataBrowser.hxx
+++ b/chart2/source/controller/dialogs/DataBrowser.hxx
@@ -98,8 +98,7 @@ public:
void SetReadOnly( bool bNewState );
bool IsReadOnly() const { return m_bIsReadOnly;}
- void SetDataFromModel( const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const css::uno::Reference< css::uno::XComponentContext > & xContext );
+ void SetDataFromModel( const rtl::Reference<::chart::ChartModel> & xChartDoc );
// predicates to determine what actions are possible at the current cursor
// position. This depends on the implementation of the according mutators
@@ -175,7 +174,7 @@ private:
void RenewTable();
void ImplAdjustHeaderControls();
- OUString GetColString( sal_Int32 nColumnId ) const;
+ const OUString & GetColString( sal_Int32 nColumnId ) const;
DECL_LINK( SeriesHeaderGotFocus, impl::SeriesHeaderEdit&, void );
DECL_LINK( SeriesHeaderChanged, impl::SeriesHeaderEdit&, void );
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index c73781770549..e3c4d35a685e 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -17,40 +17,36 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "DataBrowserModel.hxx"
#include "DialogModel.hxx"
-#include <ChartModelHelper.hxx>
+#include <DataBrowserModel.hxx>
+#include <ChartType.hxx>
#include <ChartTypeManager.hxx>
-#include <DiagramHelper.hxx>
+#include <ChartView.hxx>
#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <StatisticsHelper.hxx>
#include <ChartTypeHelper.hxx>
-#include <ChartTypeTemplate.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
#include <ExplicitCategoriesProvider.hxx>
#include <BaseCoordinateSystem.hxx>
-
#include <ChartModel.hxx>
#include <unonames.hxx>
#include <com/sun/star/container/XIndexReplace.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
#include <o3tl/safeint.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/property.hxx>
#include <algorithm>
+#include <cstddef>
#include <limits>
+#include <utility>
using namespace ::com::sun::star;
@@ -70,7 +66,7 @@ OUString lcl_getRole(
{
try
{
- xProp->getPropertyValue( "Role" ) >>= aResult;
+ xProp->getPropertyValue( u"Role"_ustr ) >>= aResult;
}
catch( const uno::Exception & )
{
@@ -99,7 +95,7 @@ void lcl_copyDataSequenceProperties(
}
bool lcl_SequenceOfSeriesIsShared(
- const Reference< chart2::XDataSeries > & xSeries,
+ const rtl::Reference< ::chart::DataSeries > & xSeries,
const Reference< chart2::data::XDataSequence > & xValues )
{
bool bResult = false;
@@ -109,9 +105,8 @@ bool lcl_SequenceOfSeriesIsShared(
{
OUString aValuesRole( lcl_getRole( xValues ));
OUString aValuesRep( xValues->getSourceRangeRepresentation());
- Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY_THROW );
- const Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeq( xSource->getDataSequences());
- for( Reference< chart2::data::XLabeledDataSequence > const & labeledDataSeq : aLSeq )
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aLSeq( xSeries->getDataSequences2());
+ for( uno::Reference< chart2::data::XLabeledDataSequence > const & labeledDataSeq : aLSeq )
if (labeledDataSeq.is() && DataSeriesHelper::getRole(labeledDataSeq) == aValuesRole)
{
// getValues().is(), because lcl_getRole checked that already
@@ -127,24 +122,22 @@ bool lcl_SequenceOfSeriesIsShared(
return bResult;
}
-typedef std::vector< Reference< chart2::data::XLabeledDataSequence > > lcl_tSharedSeqVec;
+typedef std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > lcl_tSharedSeqVec;
-lcl_tSharedSeqVec lcl_getSharedSequences( const Sequence< Reference< chart2::XDataSeries > > & rSeries )
+lcl_tSharedSeqVec lcl_getSharedSequences( const std::vector< rtl::Reference< DataSeries > > & rSeries )
{
// @todo: if only some series share a sequence, those have to be duplicated
// and made unshared for all series
lcl_tSharedSeqVec aResult;
// if we have only one series, we don't want any shared sequences
- if( rSeries.getLength() <= 1 )
+ if( rSeries.size() <= 1 )
return aResult;
- Reference< chart2::data::XDataSource > xSource( rSeries[0], uno::UNO_QUERY );
- const Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeq( xSource->getDataSequences());
- for( Reference< chart2::data::XLabeledDataSequence > const & labeledDataSeq : aLSeq )
+ for( uno::Reference< chart2::data::XLabeledDataSequence > const & labeledDataSeq : rSeries[0]->getDataSequences2() )
{
Reference< chart2::data::XDataSequence > xValues( labeledDataSeq->getValues());
bool bShared = true;
- for( sal_Int32 nSeriesIdx=1; nSeriesIdx<rSeries.getLength(); ++nSeriesIdx )
+ for( std::size_t nSeriesIdx=1; nSeriesIdx<rSeries.size(); ++nSeriesIdx )
{
bShared = lcl_SequenceOfSeriesIsShared( rSeries[nSeriesIdx], xValues );
if( !bShared )
@@ -193,10 +186,10 @@ private:
struct lcl_RolesOfLSeqMatch
{
- explicit lcl_RolesOfLSeqMatch( const Reference< chart2::data::XLabeledDataSequence > & xLSeq ) :
+ explicit lcl_RolesOfLSeqMatch( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq ) :
m_aRole(DataSeriesHelper::getRole(xLSeq)) {}
- bool operator() ( const Reference< chart2::data::XLabeledDataSequence > & xLSeq )
+ bool operator() ( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq )
{
return DataSeriesHelper::getRole(xLSeq) == m_aRole;
}
@@ -204,16 +197,16 @@ private:
OUString m_aRole;
};
-bool lcl_ShowCategoriesAsDataLabel( const Reference< chart2::XDiagram > & xDiagram )
+bool lcl_ShowCategoriesAsDataLabel( const rtl::Reference< ::chart::Diagram > & xDiagram )
{
- return !DiagramHelper::isCategoryDiagram(xDiagram);
+ return !xDiagram->isCategory();
}
} // anonymous namespace
struct DataBrowserModel::tDataColumn
{
- uno::Reference<chart2::XDataSeries> m_xDataSeries;
+ rtl::Reference<DataSeries> m_xDataSeries;
OUString m_aUIRoleName;
uno::Reference<chart2::data::XLabeledDataSequence> m_xLabeledDataSequence;
eCellType m_eCellType;
@@ -223,14 +216,14 @@ struct DataBrowserModel::tDataColumn
tDataColumn() : m_eCellType( TEXT ), m_nNumberFormatKey( 0 ) {}
// "full" CTOR
tDataColumn(
- const uno::Reference<chart2::XDataSeries> & xDataSeries,
- const OUString& aUIRoleName,
- const uno::Reference<chart2::data::XLabeledDataSequence>& xLabeledDataSequence,
+ rtl::Reference<DataSeries> xDataSeries,
+ OUString aUIRoleName,
+ uno::Reference<chart2::data::XLabeledDataSequence> xLabeledDataSequence,
eCellType aCellType,
sal_Int32 nNumberFormatKey ) :
- m_xDataSeries( xDataSeries ),
- m_aUIRoleName( aUIRoleName ),
- m_xLabeledDataSequence( xLabeledDataSequence ),
+ m_xDataSeries(std::move( xDataSeries )),
+ m_aUIRoleName(std::move( aUIRoleName )),
+ m_xLabeledDataSequence(std::move( xLabeledDataSequence )),
m_eCellType( aCellType ),
m_nNumberFormatKey( nNumberFormatKey )
{}
@@ -250,10 +243,9 @@ struct DataBrowserModel::implColumnLess
};
DataBrowserModel::DataBrowserModel(
- const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const Reference< uno::XComponentContext > & xContext ) :
+ const rtl::Reference<::chart::ChartModel> & xChartDoc ) :
m_xChartDocument( xChartDoc ),
- m_apDialogModel( new DialogModel( xChartDoc, xContext ))
+ m_apDialogModel( new DialogModel( xChartDoc ))
{
updateFromModel();
}
@@ -266,15 +258,15 @@ namespace
struct lcl_DataSeriesOfHeaderMatches
{
explicit lcl_DataSeriesOfHeaderMatches(
- const Reference< chart2::XDataSeries > & xSeriesToCompareWith ) :
- m_xSeries( xSeriesToCompareWith )
+ rtl::Reference< ::chart::DataSeries > xSeriesToCompareWith ) :
+ m_xSeries(std::move( xSeriesToCompareWith ))
{}
bool operator() ( const ::chart::DataBrowserModel::tDataHeader & rHeader )
{
return (m_xSeries == rHeader.m_xDataSeries);
}
private:
- Reference< chart2::XDataSeries > m_xSeries;
+ rtl::Reference< ::chart::DataSeries > m_xSeries;
};
}
@@ -292,18 +284,18 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
nAfterColumnIndex = getCategoryColumnCount()-1;
sal_Int32 nStartCol = 0;
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram(m_xChartDocument);
- Reference<chart2::XChartType> xChartType;
- Reference<chart2::XDataSeries> xSeries;
+ rtl::Reference< Diagram > xDiagram = m_xChartDocument->getFirstChartDiagram();
+ rtl::Reference<ChartType> xChartType;
+ rtl::Reference<DataSeries> xSeries;
if (o3tl::make_unsigned(nAfterColumnIndex) < m_aColumns.size())
// Get the data series at specific column position (if available).
- xSeries.set( m_aColumns[nAfterColumnIndex].m_xDataSeries );
+ xSeries = m_aColumns[nAfterColumnIndex].m_xDataSeries;
sal_Int32 nSeriesNumberFormat = 0;
if( xSeries.is())
{
// Use the chart type of the currently selected data series.
- xChartType.set( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ));
+ xChartType = xDiagram->getChartTypeOfSeries( xSeries );
// Find the corresponding header and determine the last column of this
// data series.
@@ -314,14 +306,13 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
nStartCol = aIt->m_nEndColumn;
// Get the number format too.
- Reference< beans::XPropertySet > xSeriesProps( xSeries, uno::UNO_QUERY );
- if( xSeriesProps.is() )
- xSeriesProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nSeriesNumberFormat;
+ if( xSeries.is() )
+ xSeries->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nSeriesNumberFormat;
}
else
{
// No data series at specified column position. Use the first chart type.
- xChartType.set( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ));
+ xChartType = xDiagram->getChartTypeByIndex( 0 );
nStartCol = nAfterColumnIndex;
}
@@ -330,68 +321,59 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
// Get shared sequences of current series. Normally multiple data series
// only share "values-x" sequences. (TODO: simplify this logic).
- Reference< chart2::XDataSeriesContainer > xSeriesCnt( xChartType, uno::UNO_QUERY );
- lcl_tSharedSeqVec aSharedSequences;
- if( xSeriesCnt.is())
- aSharedSequences = lcl_getSharedSequences( xSeriesCnt->getDataSeries());
+ lcl_tSharedSeqVec aSharedSequences = lcl_getSharedSequences( xChartType->getDataSeries2());
- Reference<chart2::XDataSeries> xNewSeries =
+ rtl::Reference<::chart::DataSeries> xNewSeries =
m_apDialogModel->insertSeriesAfter(xSeries, xChartType, true);
if (!xNewSeries.is())
// Failed to insert new data series to the model. Bail out.
return;
- Reference< chart2::data::XDataSource > xSource( xNewSeries, uno::UNO_QUERY );
- if (xSource.is())
+ const std::vector<uno::Reference<chart2::data::XLabeledDataSequence> > & aLSequences = xNewSeries->getDataSequences2();
+ sal_Int32 nSeqIdx = 0;
+ sal_Int32 nSeqSize = aLSequences.size();
+ for (sal_Int32 nIndex = nStartCol; nSeqIdx < nSeqSize; ++nSeqIdx)
{
- Sequence<Reference<chart2::data::XLabeledDataSequence> > aLSequences = xSource->getDataSequences();
- sal_Int32 nSeqIdx = 0;
- sal_Int32 nSeqSize = aLSequences.getLength();
- for (sal_Int32 nIndex = nStartCol; nSeqIdx < nSeqSize; ++nSeqIdx)
- {
- lcl_tSharedSeqVec::const_iterator aSharedIt(
- std::find_if( aSharedSequences.begin(), aSharedSequences.end(),
- lcl_RolesOfLSeqMatch( aLSequences[nSeqIdx] )));
+ lcl_tSharedSeqVec::const_iterator aSharedIt(
+ std::find_if( aSharedSequences.begin(), aSharedSequences.end(),
+ lcl_RolesOfLSeqMatch( aLSequences[nSeqIdx] )));
- if( aSharedIt != aSharedSequences.end())
- {
- // Shared sequence. Most likely "values-x" sequence. Copy it from existing sequence.
- aLSequences[nSeqIdx]->setValues( (*aSharedIt)->getValues());
- aLSequences[nSeqIdx]->setLabel( (*aSharedIt)->getLabel());
- }
- else
- {
- // Insert a new column in the internal data for the new sequence.
- xDataProvider->insertSequence( nIndex - 1 );
-
- // values
- Reference< chart2::data::XDataSequence > xNewSeq(
- xDataProvider->createDataSequenceByRangeRepresentation(
- OUString::number( nIndex )));
- lcl_copyDataSequenceProperties(
- aLSequences[nSeqIdx]->getValues(), xNewSeq );
- aLSequences[nSeqIdx]->setValues( xNewSeq );
-
- // labels
- Reference< chart2::data::XDataSequence > xNewLabelSeq(
- xDataProvider->createDataSequenceByRangeRepresentation(
- "label " +
- OUString::number( nIndex )));
- lcl_copyDataSequenceProperties(
- aLSequences[nSeqIdx]->getLabel(), xNewLabelSeq );
- aLSequences[nSeqIdx]->setLabel( xNewLabelSeq );
- ++nIndex;
- }
+ if( aSharedIt != aSharedSequences.end())
+ {
+ // Shared sequence. Most likely "values-x" sequence. Copy it from existing sequence.
+ aLSequences[nSeqIdx]->setValues( (*aSharedIt)->getValues());
+ aLSequences[nSeqIdx]->setLabel( (*aSharedIt)->getLabel());
+ }
+ else
+ {
+ // Insert a new column in the internal data for the new sequence.
+ xDataProvider->insertSequence( nIndex - 1 );
+
+ // values
+ Reference< chart2::data::XDataSequence > xNewSeq(
+ xDataProvider->createDataSequenceByRangeRepresentation(
+ OUString::number( nIndex )));
+ lcl_copyDataSequenceProperties(
+ aLSequences[nSeqIdx]->getValues(), xNewSeq );
+ aLSequences[nSeqIdx]->setValues( xNewSeq );
+
+ // labels
+ Reference< chart2::data::XDataSequence > xNewLabelSeq(
+ xDataProvider->createDataSequenceByRangeRepresentation(
+ "label " +
+ OUString::number( nIndex )));
+ lcl_copyDataSequenceProperties(
+ aLSequences[nSeqIdx]->getLabel(), xNewLabelSeq );
+ aLSequences[nSeqIdx]->setLabel( xNewLabelSeq );
+ ++nIndex;
}
}
if( nSeriesNumberFormat != 0 )
{
//give the new series the same number format as the former series especially for bubble charts thus the bubble size values can be edited with same format immediately
- Reference< beans::XPropertySet > xNewSeriesProps( xNewSeries, uno::UNO_QUERY );
- if( xNewSeriesProps.is() )
- xNewSeriesProps->setPropertyValue(CHART_UNONAME_NUMFMT , uno::Any(nSeriesNumberFormat));
+ xNewSeries->setPropertyValue(CHART_UNONAME_NUMFMT , uno::Any(nSeriesNumberFormat));
}
updateFromModel();
@@ -450,7 +432,7 @@ void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColu
return;
}
- const Reference<chart2::XDataSeries>& xSeries = m_aColumns[nAtColumnIndex].m_xDataSeries;
+ const rtl::Reference<DataSeries>& xSeries = m_aColumns[nAtColumnIndex].m_xDataSeries;
m_apDialogModel->deleteSeries(xSeries, getHeaderForSeries(xSeries).m_xChartType);
@@ -458,16 +440,14 @@ void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColu
//but do not delete sequences that are still in use by the remaining series
Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY );
- Reference< chart2::data::XDataSource > xSourceOfDeleted( xSeries, uno::UNO_QUERY );
- if (!xDataProvider.is() || !xSourceOfDeleted.is())
+ if (!xDataProvider.is() || !xSeries.is())
{
// Something went wrong. Bail out.
updateFromModel();
return;
}
- Reference<chart2::XDataSeriesContainer> xSeriesCnt(
- getHeaderForSeries(xSeries).m_xChartType, uno::UNO_QUERY);
+ rtl::Reference<ChartType> xSeriesCnt(getHeaderForSeries(xSeries).m_xChartType);
if (!xSeriesCnt.is())
{
// Unexpected happened. Bail out.
@@ -477,13 +457,13 @@ void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColu
// Collect all the remaining data sequences in the same chart type. The
// deleted data series is already gone by this point.
- std::vector<Reference<chart2::data::XLabeledDataSequence> > aAllDataSeqs =
- DataSeriesHelper::getAllDataSequences(xSeriesCnt->getDataSeries());
+ std::vector<uno::Reference<chart2::data::XLabeledDataSequence> > aAllDataSeqs =
+ DataSeriesHelper::getAllDataSequences(xSeriesCnt->getDataSeries2());
// Check if the sequences to be deleted are still referenced by any of
// the other data series. If not, mark them for deletion.
std::vector<sal_Int32> aSequenceIndexesToDelete;
- const Sequence<Reference<chart2::data::XLabeledDataSequence> > aSequencesOfDeleted = xSourceOfDeleted->getDataSequences();
+ const std::vector<uno::Reference<chart2::data::XLabeledDataSequence> > & aSequencesOfDeleted = xSeries->getDataSequences2();
for (auto const & labeledDataSeq : aSequencesOfDeleted)
{
// if not used by the remaining series this sequence can be deleted
@@ -511,7 +491,7 @@ void DataBrowserModel::swapDataSeries( sal_Int32 nFirstColumnIndex )
OSL_ASSERT(m_apDialogModel);
if( o3tl::make_unsigned( nFirstColumnIndex ) < m_aColumns.size() - 1 )
{
- Reference< chart2::XDataSeries > xSeries( m_aColumns[nFirstColumnIndex].m_xDataSeries );
+ rtl::Reference< DataSeries > xSeries( m_aColumns[nFirstColumnIndex].m_xDataSeries );
if( xSeries.is())
{
m_apDialogModel->moveSeries( xSeries, DialogModel::MoveDirection::Down );
@@ -557,15 +537,17 @@ void DataBrowserModel::removeDataPointForAllSeries( sal_Int32 nAtIndex )
DataBrowserModel::tDataHeader DataBrowserModel::getHeaderForSeries(
const Reference< chart2::XDataSeries > & xSeries ) const
{
+ rtl::Reference<DataSeries> pSeries = dynamic_cast<DataSeries*>(xSeries.get());
+ assert(!xSeries || pSeries);
for (auto const& elemHeader : m_aHeaders)
{
- if( elemHeader.m_xDataSeries == xSeries )
+ if( elemHeader.m_xDataSeries == pSeries )
return elemHeader;
}
return tDataHeader();
}
-Reference< chart2::XDataSeries >
+rtl::Reference< DataSeries >
DataBrowserModel::getDataSeriesByColumn( sal_Int32 nColumn ) const
{
tDataColumnVector::size_type nIndex( nColumn );
@@ -725,12 +707,12 @@ sal_Int32 DataBrowserModel::getMaxRowCount() const
return nResult;
}
-OUString DataBrowserModel::getRoleOfColumn( sal_Int32 nColumnIndex ) const
+const OUString & DataBrowserModel::getRoleOfColumn( sal_Int32 nColumnIndex ) const
{
if( nColumnIndex != -1 &&
o3tl::make_unsigned( nColumnIndex ) < m_aColumns.size())
return m_aColumns[ nColumnIndex ].m_aUIRoleName;
- return OUString();
+ return EMPTY_OUSTRING;
}
bool DataBrowserModel::isCategoriesColumn( sal_Int32 nColumnIndex ) const
@@ -765,32 +747,32 @@ void DataBrowserModel::updateFromModel()
m_aColumns.clear();
m_aHeaders.clear();
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( m_xChartDocument ));
+ rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram());
if( !xDiagram.is())
return;
// set template at DialogModel
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = m_xChartDocument->getTypeManager();
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
+ Diagram::tTemplateWithServiceName aTemplateAndService =
+ xDiagram->getTemplate( xChartTypeManager );
if( aTemplateAndService.xChartTypeTemplate.is())
m_apDialogModel->setTemplate( aTemplateAndService.xChartTypeTemplate );
sal_Int32 nHeaderStart = 0;
sal_Int32 nHeaderEnd = 0;
{
- ExplicitCategoriesProvider aExplicitCategoriesProvider( ChartModelHelper::getFirstCoordinateSystem(m_xChartDocument), *m_xChartDocument );
+ ExplicitCategoriesProvider aExplicitCategoriesProvider( m_xChartDocument->getFirstCoordinateSystem(), *m_xChartDocument );
- const Sequence< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList( aExplicitCategoriesProvider.getSplitCategoriesList() );
- sal_Int32 nLevelCount = rSplitCategoriesList.getLength();
+ const std::vector< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList = aExplicitCategoriesProvider.getSplitCategoriesList();
+ sal_Int32 nLevelCount = rSplitCategoriesList.size();
for( sal_Int32 nL = 0; nL<nLevelCount; nL++ )
{
- Reference< chart2::data::XLabeledDataSequence > xCategories( rSplitCategoriesList[nL] );
+ const Reference< chart2::data::XLabeledDataSequence >& xCategories( rSplitCategoriesList[nL] );
if( !xCategories.is() )
continue;
tDataColumn aCategories;
- aCategories.m_xLabeledDataSequence.set( xCategories );
+ aCategories.m_xLabeledDataSequence = xCategories;
if( lcl_ShowCategoriesAsDataLabel( xDiagram ))
aCategories.m_aUIRoleName = DialogModel::GetRoleDataLabel();
else
@@ -806,101 +788,96 @@ void DataBrowserModel::updateFromModel()
const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysSeq( xDiagram->getBaseCoordinateSystems());
for( rtl::Reference< BaseCoordinateSystem > const & coords : aCooSysSeq )
{
- const Sequence< Reference< chart2::XChartType > > aChartTypes( coords->getChartTypes());
+ const std::vector< rtl::Reference< ChartType > > aChartTypes( coords->getChartTypes2());
sal_Int32 nXAxisNumberFormat = DataSeriesHelper::getNumberFormatKeyFromAxis( nullptr, coords, 0, 0 );
- for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
+ for( auto const & CT: aChartTypes )
{
- Reference< chart2::XDataSeriesContainer > xSeriesCnt( aChartTypes[nCTIdx], uno::UNO_QUERY );
- if( xSeriesCnt.is())
- {
- OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( aChartTypes[nCTIdx] );
+ const rtl::Reference< ChartType >& xSeriesCnt( CT );
+ OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( CT );
- const Sequence< Reference< chart2::XDataSeries > > aSeries( xSeriesCnt->getDataSeries());
- lcl_tSharedSeqVec aSharedSequences( lcl_getSharedSequences( aSeries ));
- for (auto const& sharedSequence : aSharedSequences)
- {
- tDataColumn aSharedSequence;
- aSharedSequence.m_xLabeledDataSequence = sharedSequence;
- aSharedSequence.m_aUIRoleName = lcl_getUIRoleName(sharedSequence);
- aSharedSequence.m_eCellType = NUMBER;
- // as the sequences are shared it should be ok to take the first series
- // @todo: dimension index 0 for x-values used here. This is just a guess.
- // Also, the axis index is 0, as there is usually only one x-axis
- aSharedSequence.m_nNumberFormatKey = nXAxisNumberFormat;
- m_aColumns.push_back( aSharedSequence );
- ++nHeaderStart;
- }
- for( Reference< chart2::XDataSeries > const & dataSeries : aSeries )
+ const std::vector< rtl::Reference< DataSeries > > & aSeries( xSeriesCnt->getDataSeries2());
+ lcl_tSharedSeqVec aSharedSequences( lcl_getSharedSequences( aSeries ));
+ for (auto const& sharedSequence : aSharedSequences)
+ {
+ tDataColumn aSharedSequence;
+ aSharedSequence.m_xLabeledDataSequence = sharedSequence;
+ aSharedSequence.m_aUIRoleName = lcl_getUIRoleName(sharedSequence);
+ aSharedSequence.m_eCellType = NUMBER;
+ // as the sequences are shared it should be ok to take the first series
+ // @todo: dimension index 0 for x-values used here. This is just a guess.
+ // Also, the axis index is 0, as there is usually only one x-axis
+ aSharedSequence.m_nNumberFormatKey = nXAxisNumberFormat;
+ m_aColumns.push_back( aSharedSequence );
+ ++nHeaderStart;
+ }
+ for( rtl::Reference< DataSeries > const & dataSeries : aSeries )
+ {
+ tDataColumnVector::size_type nStartColIndex = m_aColumns.size();
+ const rtl::Reference< DataSeries >& xSeries( dataSeries );
+ if( xSeries.is())
{
- tDataColumnVector::size_type nStartColIndex = m_aColumns.size();
- Reference< chart2::XDataSeries > xSeries( dataSeries );
- Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
- if( xSource.is())
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aLSeqs( xSeries->getDataSequences2());
+ if( aLSeqs.empty() )
+ continue;
+ nHeaderEnd = nHeaderStart;
+
+ // @todo: dimension index 1 for y-values used here. This is just a guess
+ sal_Int32 nYAxisNumberFormatKey =
+ DataSeriesHelper::getNumberFormatKeyFromAxis(
+ dataSeries, coords, 1 );
+
+ sal_Int32 nSeqIdx=0;
+ for( ; nSeqIdx<static_cast<sal_Int32>(aLSeqs.size()); ++nSeqIdx )
{
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeqs( xSource->getDataSequences());
- if( !aLSeqs.hasElements() )
- continue;
- nHeaderEnd = nHeaderStart;
-
- // @todo: dimension index 1 for y-values used here. This is just a guess
- sal_Int32 nYAxisNumberFormatKey =
- DataSeriesHelper::getNumberFormatKeyFromAxis(
- dataSeries, coords, 1 );
-
- sal_Int32 nSeqIdx=0;
- for( ; nSeqIdx<aLSeqs.getLength(); ++nSeqIdx )
+ sal_Int32 nSequenceNumberFormatKey = nYAxisNumberFormatKey;
+ OUString aRole = DataSeriesHelper::getRole(aLSeqs[nSeqIdx]);
+
+ if( aRole == aRoleForDataLabelNumberFormat )
{
- sal_Int32 nSequenceNumberFormatKey = nYAxisNumberFormatKey;
- OUString aRole = DataSeriesHelper::getRole(aLSeqs[nSeqIdx]);
-
- if( aRole == aRoleForDataLabelNumberFormat )
- {
- nSequenceNumberFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
- Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ));
- }
- else if( aRole == "values-x" )
- nSequenceNumberFormatKey = nXAxisNumberFormat;
-
- if( std::none_of( aSharedSequences.begin(), aSharedSequences.end(),
- lcl_RepresentationsOfLSeqMatch( aLSeqs[nSeqIdx] )) )
- {
- // no shared sequence
- m_aColumns.emplace_back(
- dataSeries,
- lcl_getUIRoleName( aLSeqs[nSeqIdx] ),
- aLSeqs[nSeqIdx],
- NUMBER,
- nSequenceNumberFormatKey );
- ++nHeaderEnd;
- }
- // else skip
+ nSequenceNumberFormatKey = xSeries->getExplicitNumberFormatKeyForDataLabel();
}
- bool bSwapXAndYAxis = false;
- try
+ else if( aRole == "values-x" )
+ nSequenceNumberFormatKey = nXAxisNumberFormat;
+
+ if( std::none_of( aSharedSequences.begin(), aSharedSequences.end(),
+ lcl_RepresentationsOfLSeqMatch( aLSeqs[nSeqIdx] )) )
{
- coords->getPropertyValue( "SwapXAndYAxis" ) >>= bSwapXAndYAxis;
+ // no shared sequence
+ m_aColumns.emplace_back(
+ dataSeries,
+ lcl_getUIRoleName( aLSeqs[nSeqIdx] ),
+ aLSeqs[nSeqIdx],
+ NUMBER,
+ nSequenceNumberFormatKey );
+ ++nHeaderEnd;
}
- catch( const beans::UnknownPropertyException & ) {}
+ // else skip
+ }
+ bool bSwapXAndYAxis = false;
+ try
+ {
+ coords->getPropertyValue( u"SwapXAndYAxis"_ustr ) >>= bSwapXAndYAxis;
+ }
+ catch( const beans::UnknownPropertyException & ) {}
- // add ranges for error bars if present for a series
- if( StatisticsHelper::usesErrorBarRanges( dataSeries ))
- addErrorBarRanges( dataSeries, nYAxisNumberFormatKey, nSeqIdx, nHeaderEnd, true );
+ // add ranges for error bars if present for a series
+ if( StatisticsHelper::usesErrorBarRanges( dataSeries ))
+ addErrorBarRanges( dataSeries, nYAxisNumberFormatKey, nSeqIdx, nHeaderEnd, true );
- if( StatisticsHelper::usesErrorBarRanges( dataSeries, /* bYError = */ false ))
- addErrorBarRanges( dataSeries, nYAxisNumberFormatKey, nSeqIdx, nHeaderEnd, false );
+ if( StatisticsHelper::usesErrorBarRanges( dataSeries, /* bYError = */ false ))
+ addErrorBarRanges( dataSeries, nYAxisNumberFormatKey, nSeqIdx, nHeaderEnd, false );
- m_aHeaders.emplace_back(
- dataSeries,
- aChartTypes[nCTIdx],
- bSwapXAndYAxis,
- nHeaderStart,
- nHeaderEnd - 1 );
+ m_aHeaders.emplace_back(
+ dataSeries,
+ CT,
+ bSwapXAndYAxis,
+ nHeaderStart,
+ nHeaderEnd - 1 );
- nHeaderStart = nHeaderEnd;
+ nHeaderStart = nHeaderEnd;
- std::sort( m_aColumns.begin() + nStartColIndex, m_aColumns.end(), implColumnLess() );
- }
+ std::sort( m_aColumns.begin() + nStartColIndex, m_aColumns.end(), implColumnLess() );
}
}
}
@@ -908,35 +885,35 @@ void DataBrowserModel::updateFromModel()
}
void DataBrowserModel::addErrorBarRanges(
- const Reference< chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference< DataSeries > & xDataSeries,
sal_Int32 nNumberFormatKey,
sal_Int32 & rInOutSequenceIndex,
sal_Int32 & rInOutHeaderEnd, bool bYError )
{
try
{
- std::vector< Reference< chart2::data::XLabeledDataSequence > > aSequences;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences;
Reference< chart2::data::XDataSource > xErrorSource(
StatisticsHelper::getErrorBars( xDataSeries, bYError ), uno::UNO_QUERY );
- Reference< chart2::data::XLabeledDataSequence > xErrorLSequence(
+ uno::Reference< chart2::data::XLabeledDataSequence > xErrorLSequence =
StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
xErrorSource,
/* bPositiveValue = */ true,
- bYError ));
+ bYError );
if( xErrorLSequence.is())
aSequences.push_back( xErrorLSequence );
- xErrorLSequence.set(
+ xErrorLSequence =
StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
xErrorSource,
/* bPositiveValue = */ false,
- bYError ));
+ bYError );
if( xErrorLSequence.is())
aSequences.push_back( xErrorLSequence );
- for (Reference<chart2::data::XLabeledDataSequence> const & rDataSequence : aSequences)
+ for (uno::Reference<chart2::data::XLabeledDataSequence> const & rDataSequence : aSequences)
{
m_aColumns.emplace_back(xDataSeries, lcl_getUIRoleName(rDataSequence),
rDataSequence, NUMBER, nNumberFormatKey);
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index 73b438acef92..1ea7ddfe56d1 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -19,33 +19,31 @@
#include "DialogModel.hxx"
#include <RangeSelectionHelper.hxx>
+#include <DataInterpreter.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <DataSourceHelper.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <strings.hrc>
#include <ResId.hxx>
#include <ControllerLockGuard.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ChartTypeTemplate.hxx>
#include <ThreeDHelper.hxx>
#include <ChartModel.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <LabeledDataSequence.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/data/XDataSink.hpp>
-#include <comphelper/sequence.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <rtl/ustring.hxx>
#include <utility>
#include <algorithm>
+#include <cstddef>
#include <iterator>
#include <numeric>
@@ -57,16 +55,8 @@ using ::com::sun::star::uno::Sequence;
namespace
{
-constexpr OUStringLiteral lcl_aLabelRole( u"label" );
+constexpr OUString lcl_aLabelRole( u"label"_ustr );
-struct lcl_ChartTypeToSeriesCnt
-{
- Reference< XDataSeriesContainer > operator() (
- const Reference< XChartType > & xChartType )
- {
- return Reference< XDataSeriesContainer >::query( xChartType );
- }
-};
OUString lcl_ConvertRole( const OUString & rRoleString )
{
@@ -109,72 +99,25 @@ lcl_tRoleIndexMap lcl_createRoleIndexMap()
lcl_tRoleIndexMap aMap;
sal_Int32 nIndex = 0;
- aMap[ "label" ] = ++nIndex;
- aMap[ "categories" ] = ++nIndex;
- aMap[ "values-x" ] = ++nIndex;
- aMap[ "values-y" ] = ++nIndex;
- aMap[ "error-bars-x" ] = ++nIndex;
- aMap[ "error-bars-x-positive" ] = ++nIndex;
- aMap[ "error-bars-x-negative" ] = ++nIndex;
- aMap[ "error-bars-y" ] = ++nIndex;
- aMap[ "error-bars-y-positive" ] = ++nIndex;
- aMap[ "error-bars-y-negative" ] = ++nIndex;
- aMap[ "values-first" ] = ++nIndex;
- aMap[ "values-min" ] = ++nIndex;
- aMap[ "values-max" ] = ++nIndex;
- aMap[ "values-last" ] = ++nIndex;
- aMap[ "values-size" ] = ++nIndex;
+ aMap[ u"label"_ustr ] = ++nIndex;
+ aMap[ u"categories"_ustr ] = ++nIndex;
+ aMap[ u"values-x"_ustr ] = ++nIndex;
+ aMap[ u"values-y"_ustr ] = ++nIndex;
+ aMap[ u"error-bars-x"_ustr ] = ++nIndex;
+ aMap[ u"error-bars-x-positive"_ustr ] = ++nIndex;
+ aMap[ u"error-bars-x-negative"_ustr ] = ++nIndex;
+ aMap[ u"error-bars-y"_ustr ] = ++nIndex;
+ aMap[ u"error-bars-y-positive"_ustr ] = ++nIndex;
+ aMap[ u"error-bars-y-negative"_ustr ] = ++nIndex;
+ aMap[ u"values-first"_ustr ] = ++nIndex;
+ aMap[ u"values-min"_ustr ] = ++nIndex;
+ aMap[ u"values-max"_ustr ] = ++nIndex;
+ aMap[ u"values-last"_ustr ] = ++nIndex;
+ aMap[ u"values-size"_ustr ] = ++nIndex;
return aMap;
}
-struct lcl_DataSeriesContainerAppend
-{
- typedef Reference< XDataSeriesContainer > value_type;
- typedef std::vector< ::chart::DialogModel::tSeriesWithChartTypeByName > tContainerType;
-
- explicit lcl_DataSeriesContainerAppend( tContainerType * rCnt )
- : m_rDestCnt( rCnt )
- {}
-
- lcl_DataSeriesContainerAppend & operator= ( const value_type & xVal )
- {
- try
- {
- if( xVal.is())
- {
- const Sequence< Reference< XDataSeries > > aSeq( xVal->getDataSeries());
- OUString aRole( "values-y" );
- Reference< XChartType > xCT( xVal, uno::UNO_QUERY );
- if( xCT.is())
- aRole = xCT->getRoleOfSequenceForSeriesLabel();
- for( Reference< XDataSeries > const & dataSeries : aSeq )
- {
- m_rDestCnt->push_back(
- ::chart::DialogModel::tSeriesWithChartTypeByName(
- ::chart::DataSeriesHelper::getDataSeriesLabel( dataSeries, aRole ),
- std::make_pair( dataSeries, xCT )));
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- return *this;
- }
-
- // Implement output operator requirements as required by std::copy (and
- // implement prefix increment in terms of postfix increment to avoid unused
- // member function warnings for the latter in the common case where
- // std::copy would not actually need it):
- lcl_DataSeriesContainerAppend & operator* () { return *this; }
- lcl_DataSeriesContainerAppend & operator++ () { return operator++(0); }
- lcl_DataSeriesContainerAppend & operator++ (int) { return *this; }
-
-private:
- tContainerType * m_rDestCnt;
-};
struct lcl_RolesWithRangeAppend
{
@@ -182,9 +125,9 @@ struct lcl_RolesWithRangeAppend
typedef ::chart::DialogModel::tRolesWithRanges tContainerType;
explicit lcl_RolesWithRangeAppend( tContainerType * rCnt,
- const OUString & aLabelRole )
+ OUString aLabelRole )
: m_rDestCnt( rCnt ),
- m_aRoleForLabelSeq( aLabelRole )
+ m_aRoleForLabelSeq(std::move( aLabelRole ))
{}
lcl_RolesWithRangeAppend & operator= ( const value_type & xVal )
@@ -199,7 +142,7 @@ struct lcl_RolesWithRangeAppend
{
OUString aRole;
Reference< beans::XPropertySet > xProp( xSeq, uno::UNO_QUERY_THROW );
- if( xProp->getPropertyValue( "Role" ) >>= aRole )
+ if( xProp->getPropertyValue( u"Role"_ustr ) >>= aRole )
{
m_rDestCnt->emplace(aRole, xSeq->getSourceRangeRepresentation());
// label
@@ -240,13 +183,6 @@ private:
namespace std
{
- template<> struct iterator_traits<lcl_DataSeriesContainerAppend>
- {
- typedef std::output_iterator_tag iterator_category;
- typedef Reference< XDataSeriesContainer > value_type;
- typedef value_type& reference;
- };
-
template<> struct iterator_traits<lcl_RolesWithRangeAppend>
{
typedef std::output_iterator_tag iterator_category;
@@ -263,7 +199,7 @@ void lcl_SetSequenceRole(
{
Reference< beans::XPropertySet > xProp( xSeq, uno::UNO_QUERY );
if( xProp.is())
- xProp->setPropertyValue( "Role" , uno::Any( rRole ));
+ xProp->setPropertyValue( u"Role"_ustr , uno::Any( rRole ));
}
Sequence< OUString > lcl_CopyExcludingValuesFirst(
@@ -288,52 +224,43 @@ Sequence< OUString > lcl_CopyExcludingValuesFirst(
return aOutput;
}
-Reference< XDataSeries > lcl_CreateNewSeries(
- const Reference< uno::XComponentContext > & xContext,
- const Reference< XChartType > & xChartType,
+rtl::Reference< ::chart::DataSeries > lcl_CreateNewSeries(
+ const rtl::Reference< ::chart::ChartType > & xChartType,
sal_Int32 nNewSeriesIndex,
sal_Int32 nTotalNumberOfSeriesInCTGroup,
- const Reference< XDiagram > & xDiagram,
- const Reference< XChartTypeTemplate > & xTemplate,
+ const rtl::Reference< ::chart::Diagram > & xDiagram,
+ const rtl::Reference< ::chart::ChartTypeTemplate > & xTemplate,
bool bCreateDataCachedSequences )
{
// create plain series
- Reference< XDataSeries > xResult(
- xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.DataSeries" ,
- xContext ), uno::UNO_QUERY );
+ rtl::Reference< ::chart::DataSeries > xResult = new ::chart::DataSeries();
if( xTemplate.is())
{
- Reference< beans::XPropertySet > xResultProp( xResult, uno::UNO_QUERY );
- if( xResultProp.is())
- {
- // @deprecated: correct default color should be found by view
- // without setting it as hard attribute
- Reference< XColorScheme > xColorScheme( xDiagram->getDefaultColorScheme());
- if( xColorScheme.is())
- xResultProp->setPropertyValue( "Color" , uno::Any( xColorScheme->getColorByIndex( nNewSeriesIndex )));
- }
- sal_Int32 nGroupIndex=0;
+ // @deprecated: correct default color should be found by view
+ // without setting it as hard attribute
+ Reference< XColorScheme > xColorScheme( xDiagram->getDefaultColorScheme());
+ if( xColorScheme.is())
+ xResult->setPropertyValue( u"Color"_ustr , uno::Any( xColorScheme->getColorByIndex( nNewSeriesIndex )));
+ std::size_t nGroupIndex=0;
if( xChartType.is())
{
- Sequence< Reference< XChartType > > aCTs(
- ::chart::DiagramHelper::getChartTypesFromDiagram( xDiagram ));
- for( ; nGroupIndex<aCTs.getLength(); ++nGroupIndex)
+ std::vector< rtl::Reference< ::chart::ChartType > > aCTs =
+ xDiagram->getChartTypes();
+ for( ; nGroupIndex < aCTs.size(); ++nGroupIndex)
if( aCTs[nGroupIndex] == xChartType )
break;
- if( nGroupIndex == aCTs.getLength())
+ if( nGroupIndex == aCTs.size())
nGroupIndex = 0;
}
- xTemplate->applyStyle( xResult, nGroupIndex, nNewSeriesIndex, nTotalNumberOfSeriesInCTGroup );
+ xTemplate->applyStyle2( xResult, nGroupIndex, nNewSeriesIndex, nTotalNumberOfSeriesInCTGroup );
}
if( bCreateDataCachedSequences )
{
// set chart type specific roles
- Reference< data::XDataSink > xSink( xResult, uno::UNO_QUERY );
- if( xChartType.is() && xSink.is())
+ if( xChartType.is() )
{
- std::vector< Reference< data::XLabeledDataSequence > > aNewSequences;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewSequences;
const OUString aRoleOfSeqForSeriesLabel = xChartType->getRoleOfSequenceForSeriesLabel();
const OUString aLabel(::chart::SchResId(STR_DATA_UNNAMED_SERIES));
Sequence< OUString > aPossibleRoles( xChartType->getSupportedMandatoryRoles());
@@ -342,11 +269,11 @@ Reference< XDataSeries > lcl_CreateNewSeries(
//special handling for candlestick type
if( xTemplate.is())
{
- Reference< XDataInterpreter > xInterpreter( xTemplate->getDataInterpreter());
+ rtl::Reference< ::chart::DataInterpreter > xInterpreter( xTemplate->getDataInterpreter2());
if( xInterpreter.is())
{
sal_Int32 nStockVariant;
- if( xInterpreter->getChartTypeSpecificData("stock variant") >>= nStockVariant )
+ if( xInterpreter->getChartTypeSpecificData(u"stock variant"_ustr) >>= nStockVariant )
{
if( nStockVariant == 0 || nStockVariant == 2) {
//delete "values-first" role
@@ -386,7 +313,7 @@ Reference< XDataSeries > lcl_CreateNewSeries(
aNewSequences.push_back( ::chart::DataSourceHelper::createLabeledDataSequence( xSeq ));
}
- xSink->setData( comphelper::containerToSequence( aNewSequences ));
+ xResult->setData( aNewSequences );
}
}
@@ -416,10 +343,8 @@ DialogModelTimeBasedInfo::DialogModelTimeBasedInfo():
}
DialogModel::DialogModel(
- const rtl::Reference<::chart::ChartModel> & xChartDocument,
- const Reference< uno::XComponentContext > & xContext ) :
- m_xChartDocument( xChartDocument ),
- m_xContext( xContext ),
+ rtl::Reference<::chart::ChartModel> xChartDocument ) :
+ m_xChartDocument(std::move( xChartDocument )),
m_aTimerTriggeredControllerLock( m_xChartDocument )
{
}
@@ -461,10 +386,10 @@ Reference< data::XDataProvider > DialogModel::getDataProvider() const
return xResult;
}
-std::vector< Reference< XDataSeriesContainer > >
+std::vector< rtl::Reference< ChartType > >
DialogModel::getAllDataSeriesContainers() const
{
- std::vector< Reference< XDataSeriesContainer > > aResult;
+ std::vector< rtl::Reference< ChartType > > aResult;
try
{
@@ -473,15 +398,14 @@ std::vector< Reference< XDataSeriesContainer > >
rtl::Reference< Diagram > xDiagram = m_xChartDocument->getFirstChartDiagram();
if( xDiagram.is())
{
- const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysSeq(
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysSeq(
xDiagram->getBaseCoordinateSystems());
for( rtl::Reference< BaseCoordinateSystem > const & coords : aCooSysSeq )
{
- const Sequence< Reference< XChartType > > aChartTypeSeq( coords->getChartTypes());
- std::transform(
- aChartTypeSeq.begin(), aChartTypeSeq.end(),
- std::back_inserter( aResult ),
- lcl_ChartTypeToSeriesCnt() );
+ aResult.insert(aResult.end(),
+ coords->getChartTypes2().begin(),
+ coords->getChartTypes2().end());
+
}
}
}
@@ -497,11 +421,29 @@ std::vector< DialogModel::tSeriesWithChartTypeByName >
DialogModel::getAllDataSeriesWithLabel() const
{
std::vector< tSeriesWithChartTypeByName > aResult;
- std::vector< Reference< XDataSeriesContainer > > aContainers(
+ std::vector< rtl::Reference< ChartType > > aContainers(
getAllDataSeriesContainers());
- std::copy( aContainers.begin(), aContainers.end(),
- lcl_DataSeriesContainerAppend( &aResult ));
+ for (const auto & rxChartType : aContainers )
+ {
+ try
+ {
+ const std::vector< rtl::Reference< DataSeries > > & aSeq = rxChartType->getDataSeries2();
+ OUString aRole = rxChartType->getRoleOfSequenceForSeriesLabel();
+ for( rtl::Reference< DataSeries > const & dataSeries : aSeq )
+ {
+ aResult.push_back(
+ ::chart::DialogModel::tSeriesWithChartTypeByName(
+ dataSeries->getLabelForRole( aRole ),
+ std::make_pair( dataSeries, rxChartType )));
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ }
+
return aResult;
}
@@ -526,15 +468,13 @@ void addMissingRoles(DialogModel::tRolesWithRanges& rResult, const uno::Sequence
* @param xNewSeries new data series to insert.
*/
void addNewSeriesToContainer(
- const Reference<XChartType>& xChartType,
- const Reference<XDataSeries>& xSeries,
- const Reference<XDataSeries>& xNewSeries )
+ const rtl::Reference<ChartType>& xChartType,
+ const rtl::Reference<DataSeries>& xSeries,
+ const rtl::Reference<DataSeries>& xNewSeries )
{
- Reference<XDataSeriesContainer> xSeriesCnt(xChartType, uno::UNO_QUERY_THROW);
- auto aSeries = comphelper::sequenceToContainer<std::vector<Reference<XDataSeries> >>(xSeriesCnt->getDataSeries());
+ auto aSeries = xChartType->getDataSeries2();
- std::vector<Reference<XDataSeries> >::iterator aIt =
- std::find( aSeries.begin(), aSeries.end(), xSeries);
+ auto aIt = std::find( aSeries.begin(), aSeries.end(), xSeries);
if( aIt == aSeries.end())
// if we have no series we insert at the first position.
@@ -544,7 +484,7 @@ void addNewSeriesToContainer(
++aIt;
aSeries.insert(aIt, xNewSeries);
- xSeriesCnt->setDataSeries(comphelper::containerToSequence(aSeries));
+ xChartType->setDataSeries(aSeries);
}
}
@@ -552,7 +492,7 @@ void addNewSeriesToContainer(
DialogModel::tRolesWithRanges DialogModel::getRolesWithRanges(
const Reference< XDataSeries > & xSeries,
const OUString & aRoleOfSequenceForLabel,
- const Reference< chart2::XChartType > & xChartType )
+ const rtl::Reference< ::chart::ChartType > & xChartType )
{
DialogModel::tRolesWithRanges aResult;
try
@@ -584,54 +524,54 @@ DialogModel::tRolesWithRanges DialogModel::getRolesWithRanges(
}
void DialogModel::moveSeries(
- const Reference< XDataSeries > & xSeries,
+ const rtl::Reference< DataSeries > & xSeries,
MoveDirection eDirection )
{
m_aTimerTriggeredControllerLock.startTimer();
ControllerLockGuardUNO aLockedControllers( m_xChartDocument );
- Reference< XDiagram > xDiagram( m_xChartDocument->getFirstDiagram());
- DiagramHelper::moveSeries( xDiagram, xSeries, eDirection==MoveDirection::Down );
+ rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram());
+ xDiagram->moveSeries( xSeries, eDirection==MoveDirection::Down );
}
-Reference< chart2::XDataSeries > DialogModel::insertSeriesAfter(
- const Reference< XDataSeries > & xSeries,
- const Reference< XChartType > & xChartType,
+rtl::Reference< ::chart::DataSeries > DialogModel::insertSeriesAfter(
+ const Reference< XDataSeries > & xUnoSeries,
+ const rtl::Reference< ::chart::ChartType > & xChartType,
bool bCreateDataCachedSequences /* = false */ )
{
m_aTimerTriggeredControllerLock.startTimer();
ControllerLockGuardUNO aLockedControllers( m_xChartDocument );
- Reference< XDataSeries > xNewSeries;
+ rtl::Reference< ::chart::DataSeries > xNewSeries;
+ rtl::Reference<DataSeries> xSeries = dynamic_cast<DataSeries*>(xUnoSeries.get());
+ assert(xSeries || !xUnoSeries);
try
{
- Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
- ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram );
+ rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram() );
+ ThreeDLookScheme e3DScheme = xDiagram->detectScheme();
sal_Int32 nSeriesInChartType = 0;
const sal_Int32 nTotalSeries = countSeries();
if( xChartType.is())
{
- Reference< XDataSeriesContainer > xCnt( xChartType, uno::UNO_QUERY_THROW );
- nSeriesInChartType = xCnt->getDataSeries().getLength();
+ nSeriesInChartType = xChartType->getDataSeries().getLength();
}
// create new series
- xNewSeries.set(
+ xNewSeries =
lcl_CreateNewSeries(
- m_xContext,
xChartType,
nTotalSeries, // new series' index
nSeriesInChartType,
xDiagram,
m_xTemplate,
- bCreateDataCachedSequences ));
+ bCreateDataCachedSequences );
// add new series to container
if( xNewSeries.is())
addNewSeriesToContainer(xChartType, xSeries, xNewSeries);
- ThreeDHelper::setScheme( xDiagram, e3DScheme );
+ xDiagram->setScheme( e3DScheme );
}
catch( const uno::Exception & )
{
@@ -641,24 +581,25 @@ Reference< chart2::XDataSeries > DialogModel::insertSeriesAfter(
}
void DialogModel::deleteSeries(
- const Reference< XDataSeries > & xSeries,
- const Reference< XChartType > & xChartType )
+ const rtl::Reference< DataSeries > & xSeries,
+ const rtl::Reference< ChartType > & xChartType )
{
m_aTimerTriggeredControllerLock.startTimer();
ControllerLockGuardUNO aLockedControllers( m_xChartDocument );
- DataSeriesHelper::deleteSeries( xSeries, xChartType );
+ xChartType->deleteSeries( xSeries );
}
-Reference< data::XLabeledDataSequence > DialogModel::getCategories() const
+uno::Reference< chart2::data::XLabeledDataSequence > DialogModel::getCategories() const
{
- Reference< data::XLabeledDataSequence > xResult;
+ uno::Reference< chart2::data::XLabeledDataSequence > xResult;
try
{
if( m_xChartDocument.is())
{
- Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram());
- xResult.set( DiagramHelper::getCategoriesFromDiagram( xDiagram ));
+ rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram());
+ if (xDiagram.is())
+ xResult = xDiagram->getCategories();
}
}
catch( const uno::Exception & )
@@ -673,31 +614,38 @@ void DialogModel::setCategories( const Reference< chart2::data::XLabeledDataSequ
if( !m_xChartDocument.is())
return;
- Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram());
+ rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram());
if( !xDiagram.is())
return;
// categories
bool bSupportsCategories = true;
- Reference< XChartType > xFirstChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
+ rtl::Reference< ChartType > xFirstChartType( xDiagram->getChartTypeByIndex( 0 ) );
if( xFirstChartType.is() )
{
- sal_Int32 nAxisType = ChartTypeHelper::getAxisType( xFirstChartType, 0 ); // x-axis
+ sal_Int32 nAxisType = xFirstChartType->getAxisType(0); // x-axis
bSupportsCategories = (nAxisType == AxisType::CATEGORY);
}
- DiagramHelper::setCategoriesToDiagram( xCategories, xDiagram, true, bSupportsCategories );
+ xDiagram->setCategories( xCategories, true, bSupportsCategories );
}
OUString DialogModel::getCategoriesRange() const
{
- Reference< data::XLabeledDataSequence > xLSeq( getCategories());
OUString aRange;
- if( xLSeq.is())
+ try
{
- Reference< data::XDataSequence > xSeq( xLSeq->getValues());
- if( xSeq.is())
- aRange = xSeq->getSourceRangeRepresentation();
+ uno::Reference< chart2::data::XLabeledDataSequence > xLSeq( getCategories());
+ if( xLSeq.is())
+ {
+ Reference< data::XDataSequence > xSeq( xLSeq->getValues());
+ if( xSeq.is())
+ aRange = xSeq->getSourceRangeRepresentation();
+ }
+ }
+ catch (const lang::DisposedException&)
+ {
+ TOOLS_WARN_EXCEPTION( "chart2", "unexpected exception caught" );
}
return aRange;
}
@@ -705,8 +653,8 @@ OUString DialogModel::getCategoriesRange() const
bool DialogModel::isCategoryDiagram() const
{
bool bRet = false;
- if( m_xChartDocument.is())
- bRet = DiagramHelper::isCategoryDiagram( m_xChartDocument->getFirstDiagram() );
+ if( m_xChartDocument.is() && m_xChartDocument->getFirstChartDiagram())
+ bRet = m_xChartDocument->getFirstChartDiagram()->isCategory();
return bRet;
}
@@ -763,22 +711,22 @@ void DialogModel::setData(
Reference< chart2::data::XDataSource > xDataSource(
xDataProvider->createDataSource( rArguments ) );
- Reference< chart2::XDataInterpreter > xInterpreter(
- m_xTemplate->getDataInterpreter());
+ rtl::Reference< ::chart::DataInterpreter > xInterpreter(
+ m_xTemplate->getDataInterpreter2());
if( xInterpreter.is())
{
- Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
- ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram );
+ rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram() );
+ ThreeDLookScheme e3DScheme = xDiagram->detectScheme();
- std::vector< Reference< XDataSeries > > aSeriesToReUse(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesToReUse =
+ xDiagram->getDataSeries();
applyInterpretedData(
xInterpreter->interpretDataSource(
xDataSource, rArguments,
- comphelper::containerToSequence( aSeriesToReUse )),
+ aSeriesToReUse ),
aSeriesToReUse);
- ThreeDHelper::setScheme( xDiagram, e3DScheme );
+ xDiagram->setScheme( e3DScheme );
}
}
catch( const uno::Exception & )
@@ -819,13 +767,13 @@ sal_Int32 DialogModel::GetRoleIndexForSorting( const OUString & rInternalRoleStr
void DialogModel::applyInterpretedData(
const InterpretedData & rNewData,
- const std::vector< Reference< XDataSeries > > & rSeriesToReUse )
+ const std::vector< rtl::Reference< DataSeries > > & rSeriesToReUse )
{
if( ! m_xChartDocument.is())
return;
m_aTimerTriggeredControllerLock.startTimer();
- Reference< XDiagram > xDiagram( m_xChartDocument->getFirstDiagram());
+ rtl::Reference< Diagram > xDiagram( m_xChartDocument->getFirstChartDiagram());
if( !xDiagram.is())
return;
@@ -835,43 +783,40 @@ void DialogModel::applyInterpretedData(
sal_Int32 nGroup = 0;
sal_Int32 nSeriesCounter = 0;
sal_Int32 nNewSeriesIndex = static_cast< sal_Int32 >( rSeriesToReUse.size());
- const sal_Int32 nOuterSize=rNewData.Series.getLength();
+ const sal_Int32 nOuterSize=rNewData.Series.size();
for(; nGroup < nOuterSize; ++nGroup)
{
- Sequence< Reference< XDataSeries > > aSeries( rNewData.Series[ nGroup ] );
- const sal_Int32 nSeriesInGroup = aSeries.getLength();
+ const std::vector< rtl::Reference< DataSeries > > & aSeries( rNewData.Series[ nGroup ] );
+ const sal_Int32 nSeriesInGroup = aSeries.size();
for( sal_Int32 nSeries=0; nSeries<nSeriesInGroup; ++nSeries, ++nSeriesCounter )
{
if( std::find( rSeriesToReUse.begin(), rSeriesToReUse.end(), aSeries[nSeries] )
== rSeriesToReUse.end())
{
- Reference< beans::XPropertySet > xSeriesProp( aSeries[nSeries], uno::UNO_QUERY );
- if( xSeriesProp.is())
+ if( aSeries[nSeries].is())
{
// @deprecated: correct default color should be found by view
// without setting it as hard attribute
Reference< XColorScheme > xColorScheme( xDiagram->getDefaultColorScheme());
if( xColorScheme.is())
- xSeriesProp->setPropertyValue( "Color" ,
+ aSeries[nSeries]->setPropertyValue( u"Color"_ustr ,
uno::Any( xColorScheme->getColorByIndex( nSeriesCounter )));
}
- m_xTemplate->applyStyle( aSeries[nSeries], nGroup, nNewSeriesIndex++, nSeriesInGroup );
+ m_xTemplate->applyStyle2( aSeries[nSeries], nGroup, nNewSeriesIndex++, nSeriesInGroup );
}
}
}
}
// data series
- std::vector< Reference< XDataSeriesContainer > > aSeriesCnt( getAllDataSeriesContainers());
- auto aNewSeries(
- comphelper::sequenceToContainer<std::vector< Sequence< Reference< XDataSeries > > >>( rNewData.Series ));
+ std::vector< rtl::Reference< ChartType > > aSeriesCnt = getAllDataSeriesContainers();
- OSL_ASSERT( aSeriesCnt.size() == aNewSeries.size());
+ OSL_ASSERT( aSeriesCnt.size() == rNewData.Series.size());
- std::vector< Sequence< Reference< XDataSeries > > >::const_iterator aSrcIt( aNewSeries.begin());
- std::vector< Reference< XDataSeriesContainer > >::iterator aDestIt( aSeriesCnt.begin());
- for(; aSrcIt != aNewSeries.end() && aDestIt != aSeriesCnt.end();
+ auto aSrcIt = rNewData.Series.begin();
+ auto aDestIt = aSeriesCnt.begin();
+ for(; aSrcIt != rNewData.Series.end() && aDestIt != aSeriesCnt.end();
++aSrcIt, ++aDestIt )
{
try
@@ -890,16 +835,13 @@ void DialogModel::applyInterpretedData(
sal_Int32 DialogModel::countSeries() const
{
- std::vector< Reference< XDataSeriesContainer > > aCnt( getAllDataSeriesContainers());
+ std::vector< rtl::Reference< ChartType > > aCnt( getAllDataSeriesContainers());
return std::accumulate( aCnt.begin(), aCnt.end(), 0, lcl_addSeriesNumber());
}
ChartModel& DialogModel::getModel() const
{
- uno::Reference< frame::XModel > xModel = getChartModel();
- ChartModel* pModel = dynamic_cast<ChartModel*>(xModel.get());
- assert(pModel);
- return *pModel;
+ return *m_xChartDocument;
}
} // namespace chart
diff --git a/chart2/source/controller/dialogs/DialogModel.hxx b/chart2/source/controller/dialogs/DialogModel.hxx
index 2bd8d55faf00..857803fe46f1 100644
--- a/chart2/source/controller/dialogs/DialogModel.hxx
+++ b/chart2/source/controller/dialogs/DialogModel.hxx
@@ -21,6 +21,7 @@
#include <TimerTriggeredControllerLock.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
+#include <ChartTypeTemplate.hxx>
#include <map>
#include <memory>
@@ -28,17 +29,10 @@
namespace chart { class ChartModel; }
namespace com::sun::star::beans { struct PropertyValue; }
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::frame { class XModel; }
-namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::uno { template <class E> class Sequence; }
namespace com::sun::star::chart2 {
- class XDataSeriesContainer;
class XDataSeries;
- class XChartType;
- class XChartTypeTemplate;
- struct InterpretedData;
namespace data {
class XDataProvider;
class XLabeledDataSequence;
@@ -47,9 +41,10 @@ namespace com::sun::star::chart2 {
namespace chart
{
-
+class ChartType;
+class DataSeries;
+struct InterpretedData;
class RangeSelectionHelper;
-class ChartTypeTemplate;
struct DialogModelTimeBasedInfo
{
@@ -63,15 +58,13 @@ struct DialogModelTimeBasedInfo
class DialogModel
{
public:
- explicit DialogModel(
- const rtl::Reference<::chart::ChartModel> & xChartDocument,
- const css::uno::Reference< css::uno::XComponentContext > & xContext );
+ explicit DialogModel( rtl::Reference<::chart::ChartModel> xChartDocument );
~DialogModel();
typedef std::pair<
OUString,
- std::pair< css::uno::Reference< css::chart2::XDataSeries >,
- css::uno::Reference< css::chart2::XChartType > > >
+ std::pair< rtl::Reference< ::chart::DataSeries >,
+ rtl::Reference< ::chart::ChartType > > >
tSeriesWithChartTypeByName;
typedef std::map< OUString, OUString >
@@ -89,7 +82,7 @@ public:
css::uno::Reference< css::chart2::data::XDataProvider >
getDataProvider() const;
- std::vector< css::uno::Reference< css::chart2::XDataSeriesContainer > >
+ std::vector< rtl::Reference< ::chart::ChartType > >
getAllDataSeriesContainers() const;
std::vector< tSeriesWithChartTypeByName >
@@ -98,26 +91,26 @@ public:
static tRolesWithRanges getRolesWithRanges(
const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
const OUString & aRoleOfSequenceForLabel,
- const css::uno::Reference< css::chart2::XChartType > & xChartType );
+ const rtl::Reference< ::chart::ChartType > & xChartType );
enum class MoveDirection
{
Down, Up
};
- void moveSeries( const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
+ void moveSeries( const rtl::Reference< DataSeries > & xSeries,
MoveDirection eDirection );
/// @return the newly inserted series
- css::uno::Reference<
- css::chart2::XDataSeries > insertSeriesAfter(
+ rtl::Reference<
+ ::chart::DataSeries > insertSeriesAfter(
const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
- const css::uno::Reference< css::chart2::XChartType > & xChartType,
+ const rtl::Reference< ::chart::ChartType > & xChartType,
bool bCreateDataCachedSequences = false );
void deleteSeries(
- const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
- const css::uno::Reference< css::chart2::XChartType > & xChartType );
+ const rtl::Reference< ::chart::DataSeries > & xSeries,
+ const rtl::Reference< ::chart::ChartType > & xChartType );
css::uno::Reference< css::chart2::data::XLabeledDataSequence >
getCategories() const;
@@ -155,11 +148,7 @@ private:
rtl::Reference<::chart::ChartModel>
m_xChartDocument;
- css::uno::Reference< css::chart2::XChartTypeTemplate >
- m_xTemplate;
-
- css::uno::Reference< css::uno::XComponentContext >
- m_xContext;
+ rtl::Reference< ::chart::ChartTypeTemplate > m_xTemplate;
mutable std::shared_ptr< RangeSelectionHelper >
m_spRangeSelectionHelper;
@@ -168,8 +157,8 @@ private:
private:
void applyInterpretedData(
- const css::chart2::InterpretedData & rNewData,
- const std::vector< css::uno::Reference< css::chart2::XDataSeries > > & rSeriesToReUse );
+ const InterpretedData & rNewData,
+ const std::vector< rtl::Reference< ::chart::DataSeries > > & rSeriesToReUse );
sal_Int32 countSeries() const;
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 201671e87bcf..ef9893ca7ddb 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -24,11 +24,12 @@
#include <ObjectNameProvider.hxx>
#include <ResId.hxx>
#include <strings.hrc>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <ChartType.hxx>
#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <TitleHelper.hxx>
#include <ExplicitCategoriesProvider.hxx>
@@ -36,16 +37,17 @@
#include <NumberFormatterWrapper.hxx>
#include <RegressionCurveHelper.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <RegressionCurveModel.hxx>
+#include <RegressionCurveCalculator.hxx>
#include <rtl/math.hxx>
#include <rtl/ustring.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <unotools/localedatawrapper.hxx>
-#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/chart2/MovingAverageType.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <o3tl/string_view.hxx>
namespace chart
{
@@ -58,29 +60,29 @@ using ::com::sun::star::uno::Any;
namespace
{
-OUString lcl_getDataSeriesName( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel )
+OUString lcl_getDataSeriesName( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel )
{
OUString aRet;
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
- Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel );
if( xDiagram.is() && xSeries.is() )
{
- Reference< XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeOfSeries( xSeries ) );
if( xChartType.is() )
{
- aRet = ::chart::DataSeriesHelper::getDataSeriesLabel(
- xSeries, xChartType->getRoleOfSequenceForSeriesLabel() ) ;
+ aRet = xSeries->getLabelForRole(
+ xChartType->getRoleOfSequenceForSeriesLabel() ) ;
}
}
return aRet;
}
-OUString lcl_getFullSeriesName( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel )
+OUString lcl_getFullSeriesName( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel )
{
OUString aRet(SchResId(STR_TIP_DATASERIES));
- OUString aWildcard( "%SERIESNAME" );
+ OUString aWildcard( u"%SERIESNAME"_ustr );
sal_Int32 nIndex = aRet.indexOf( aWildcard );
if( nIndex != -1 )
aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), lcl_getDataSeriesName( rObjectCID, xChartModel ) );
@@ -95,19 +97,17 @@ void lcl_addText( OUString& rOut, std::u16string_view rSeparator, std::u16string
rOut+=rNext;
}
-OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal_Int32 nPointIndex,
- const Reference< XCoordinateSystem >& xCooSys,
+OUString lcl_getDataPointValueText( const rtl::Reference< DataSeries >& xSeries, sal_Int32 nPointIndex,
+ const rtl::Reference< BaseCoordinateSystem >& xCooSys,
const Reference< frame::XModel >& xChartModel )
{
OUString aRet;
- Reference<data::XDataSource> xDataSource(
- uno::Reference<data::XDataSource>( xSeries, uno::UNO_QUERY ) );
- if(!xDataSource.is())
+ if(!xSeries.is())
return aRet;
- Sequence< Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aDataSequences = xSeries->getDataSequences2();
OUString aX, aY, aY_Min, aY_Max, aY_First, aY_Last, a_Size;
double fValue = 0;
@@ -117,20 +117,22 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
Color nLabelColor;//dummy
bool bColorChanged;//dummy
- for(sal_Int32 nN = aDataSequences.getLength();nN--;)
+ for(sal_Int32 nN = aDataSequences.size();nN--;)
{
uno::Reference<data::XDataSequence> xDataSequence( aDataSequences[nN]->getValues());
if( !xDataSequence.is() )
continue;
- Sequence< Any > aData( xDataSequence->getData() );
- if( nPointIndex >= aData.getLength() )
- continue;
- uno::Reference<beans::XPropertySet> xProp(xDataSequence, uno::UNO_QUERY );
- if( xProp.is())
+
+ try
{
- try
+ Sequence< Any > aData( xDataSequence->getData() );
+
+ if( nPointIndex >= aData.getLength() )
+ continue;
+ uno::Reference<beans::XPropertySet> xProp(xDataSequence, uno::UNO_QUERY );
+ if( xProp.is())
{
- uno::Any aARole = xProp->getPropertyValue( "Role" );
+ uno::Any aARole = xProp->getPropertyValue( u"Role"_ustr );
OUString aRole;
aARole >>= aRole;
@@ -177,10 +179,14 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
a_Size = aNumberFormatterWrapper.getFormattedString( nNumberFormatKey, fValue, nLabelColor, bColorChanged );
}
}
- catch( const uno::Exception& )
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
+ }
+ catch (const lang::DisposedException&)
+ {
+ TOOLS_WARN_EXCEPTION( "chart2", "unexpected exception caught" );
+ }
+ catch( const uno::Exception& )
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
}
}
@@ -194,7 +200,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
aRet = aX;
}
- OUString aSeparator( " " );
+ OUString aSeparator( u" "_ustr );
lcl_addText( aRet, aSeparator, aY );
lcl_addText( aRet, aSeparator, aY_First );
@@ -248,6 +254,7 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural )
}
break;
case OBJECTTYPE_AXIS_UNITLABEL:
+ case OBJECTTYPE_DATA_LABEL:
aRet=SchResId(STR_OBJECT_LABEL);//@todo maybe a more concrete name
break;
case OBJECTTYPE_GRID:
@@ -278,9 +285,6 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural )
case OBJECTTYPE_DATA_LABELS:
aRet=SchResId(STR_OBJECT_DATALABELS);
break;
- case OBJECTTYPE_DATA_LABEL:
- aRet=SchResId(STR_OBJECT_LABEL);
- break;
case OBJECTTYPE_DATA_ERRORS_X:
aRet=SchResId(STR_OBJECT_ERROR_BARS_X);
break;
@@ -312,24 +316,27 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural )
case OBJECTTYPE_DATA_CURVE_EQUATION:
aRet=SchResId(STR_OBJECT_CURVE_EQUATION);
break;
+ case OBJECTTYPE_DATA_TABLE:
+ aRet=SchResId(STR_DATA_TABLE);
+ break;
default: //OBJECTTYPE_UNKNOWN
;
}
return aRet;
}
-OUString ObjectNameProvider::getAxisName( const OUString& rObjectCID
+OUString ObjectNameProvider::getAxisName( std::u16string_view rObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel )
{
OUString aRet;
- Reference< XAxis > xAxis(
- ObjectIdentifier::getObjectPropertySet( rObjectCID , xChartModel ), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis =
+ dynamic_cast<::chart::Axis*>(ObjectIdentifier::getObjectPropertySet( rObjectCID , xChartModel ).get());
sal_Int32 nCooSysIndex = 0;
sal_Int32 nDimensionIndex = 0;
sal_Int32 nAxisIndex = 0;
- AxisHelper::getIndicesForAxis( xAxis, ChartModelHelper::findDiagram( xChartModel ), nCooSysIndex, nDimensionIndex, nAxisIndex );
+ AxisHelper::getIndicesForAxis( xAxis, xChartModel->getFirstChartDiagram(), nCooSysIndex, nDimensionIndex, nAxisIndex );
switch(nDimensionIndex)
{
@@ -394,14 +401,14 @@ OUString ObjectNameProvider::getTitleNameByType( TitleHelper::eTitleType eType )
return aRet;
}
-OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID
+OUString ObjectNameProvider::getTitleName( std::u16string_view rObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel )
{
OUString aRet;
- Reference< XTitle > xTitle(
- ObjectIdentifier::getObjectPropertySet( rObjectCID , xChartModel ), uno::UNO_QUERY );
- if( xTitle.is() )
+ rtl::Reference<Title> xTitle =
+ dynamic_cast<Title*>(ObjectIdentifier::getObjectPropertySet( rObjectCID , xChartModel ).get());
+ if( xTitle )
{
TitleHelper::eTitleType eType;
if( TitleHelper::getTitleType( eType, xTitle, xChartModel ) )
@@ -413,7 +420,7 @@ OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID
return aRet;
}
-OUString ObjectNameProvider::getGridName( const OUString& rObjectCID
+OUString ObjectNameProvider::getGridName( std::u16string_view rObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel )
{
OUString aRet;
@@ -421,8 +428,8 @@ OUString ObjectNameProvider::getGridName( const OUString& rObjectCID
sal_Int32 nCooSysIndex = -1;
sal_Int32 nDimensionIndex = -1;
sal_Int32 nAxisIndex = -1;
- Reference< XAxis > xAxis( ObjectIdentifier::getAxisForCID( rObjectCID , xChartModel ) );
- AxisHelper::getIndicesForAxis( xAxis, ChartModelHelper::findDiagram( xChartModel )
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( rObjectCID , xChartModel );
+ AxisHelper::getIndicesForAxis( xAxis, xChartModel->getFirstChartDiagram()
, nCooSysIndex , nDimensionIndex, nAxisIndex );
bool bMainGrid = (ObjectIdentifier::getObjectType( rObjectCID ) == OBJECTTYPE_GRID);
@@ -466,7 +473,7 @@ OUString ObjectNameProvider::getGridName( const OUString& rObjectCID
return aRet;
}
-OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose )
+OUString ObjectNameProvider::getHelpText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose )
{
OUString aRet;
ObjectType eObjectType( ObjectIdentifier::getObjectType(rObjectCID) );
@@ -498,14 +505,14 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl:
else
aRet=SchResId(STR_TIP_DATAPOINT);
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
- Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel );
if( xDiagram.is() && xSeries.is() )
{
- sal_Int32 nPointIndex( ObjectIdentifier::getParticleID(rObjectCID).toInt32() );
+ sal_Int32 nPointIndex = o3tl::toInt32(ObjectIdentifier::getParticleID(rObjectCID));
//replace data point index
- OUString aWildcard( "%POINTNUMBER" );
+ OUString aWildcard( u"%POINTNUMBER"_ustr );
sal_Int32 nIndex = aRet.indexOf( aWildcard );
if( nIndex != -1 )
{
@@ -517,8 +524,8 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl:
nIndex = aRet.indexOf( aWildcard );
if( nIndex != -1 )
{
- std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector =
+ xDiagram->getDataSeries();
sal_Int32 nSeriesIndex = -1;
for( nSeriesIndex=aSeriesVector.size();nSeriesIndex--;)
{
@@ -551,82 +558,76 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl:
if( bVerbose )
{
aRet = SchResId( STR_OBJECT_CURVE_WITH_PARAMETERS );
- Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel ));
- Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel ));
- if( xCurveCnt.is())
+ if( xSeries.is())
{
sal_Int32 nCurveIndex = ObjectIdentifier::getIndexFromParticleOrCID( rObjectCID );
- Reference< chart2::XRegressionCurve > xCurve( RegressionCurveHelper::getRegressionCurveAtIndex(xCurveCnt, nCurveIndex) );
+ rtl::Reference< RegressionCurveModel > xCurve = RegressionCurveHelper::getRegressionCurveAtIndex(xSeries, nCurveIndex);
if( xCurve.is())
{
try
{
- Reference< chart2::XRegressionCurveCalculator > xCalculator( xCurve->getCalculator(), uno::UNO_SET_THROW );
+ rtl::Reference< RegressionCurveCalculator > xCalculator( xCurve->getCurveCalculator() );
sal_Int32 aDegree = 2;
sal_Int32 aPeriod = 2;
sal_Int32 aMovingType = css::chart2::MovingAverageType::Prior;
bool bForceIntercept = false;
double aInterceptValue = 0.0;
- OUString aXName ("x"), aYName ("f(x)");
+ OUString aXName (u"x"_ustr), aYName (u"f(x)"_ustr);
const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
const OUString& aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
sal_Unicode cDecSeparator = aNumDecimalSep[0];
- uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- if ( xProperties.is())
+ xCurve->getPropertyValue( u"PolynomialDegree"_ustr) >>= aDegree;
+ xCurve->getPropertyValue( u"MovingAveragePeriod"_ustr) >>= aPeriod;
+ xCurve->getPropertyValue( u"MovingAverageType"_ustr) >>= aMovingType;
+ xCurve->getPropertyValue( u"ForceIntercept"_ustr) >>= bForceIntercept;
+ if (bForceIntercept)
+ xCurve->getPropertyValue( u"InterceptValue"_ustr) >>= aInterceptValue;
+ uno::Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties());
+ if( xEqProp.is())
{
- xProperties->getPropertyValue( "PolynomialDegree") >>= aDegree;
- xProperties->getPropertyValue( "MovingAveragePeriod") >>= aPeriod;
- xProperties->getPropertyValue( "MovingAverageType") >>= aMovingType;
- xProperties->getPropertyValue( "ForceIntercept") >>= bForceIntercept;
- if (bForceIntercept)
- xProperties->getPropertyValue( "InterceptValue") >>= aInterceptValue;
- uno::Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties());
- if( xEqProp.is())
- {
- if ( !(xEqProp->getPropertyValue( "XName") >>= aXName) )
- aXName = "x";
- if ( !(xEqProp->getPropertyValue( "YName") >>= aYName) )
- aYName = "f(x)";
- }
+ if ( !(xEqProp->getPropertyValue( u"XName"_ustr) >>= aXName) )
+ aXName = "x";
+ if ( !(xEqProp->getPropertyValue( u"YName"_ustr) >>= aYName) )
+ aYName = "f(x)";
}
- xCalculator->setRegressionProperties(aDegree, bForceIntercept, aInterceptValue, 2, aMovingType);
+ xCalculator->setRegressionProperties(aDegree, bForceIntercept, aInterceptValue, aPeriod, aMovingType);
xCalculator->setXYNames ( aXName, aYName );
RegressionCurveHelper::initializeCurveCalculator( xCalculator, xSeries, xChartModel );
// change text for Moving Average
- OUString aWildcard( "%PERIOD" );
- sal_Int32 nIndex = xCalculator->getRepresentation().indexOf( aWildcard );
- if( nIndex != -1 )
- { // replace period
- aRet = xCalculator->getRepresentation();
- aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), OUString::number(aPeriod) );
+ if ( RegressionCurveHelper::getRegressionType( xCurve ) == SvxChartRegress::MovingAverage )
+ {
+ aRet = xCalculator->getRepresentation();
}
-
- // replace formula
- aWildcard = "%FORMULA";
- nIndex = aRet.indexOf( aWildcard );
- if( nIndex != -1 )
+ else
{
- OUString aFormula ( xCalculator->getRepresentation() );
- if ( cDecSeparator != '.' )
+ // replace formula
+ OUString aWildcard = u"%FORMULA"_ustr;
+ sal_Int32 nIndex = aRet.indexOf( aWildcard );
+ if( nIndex != -1 )
{
- aFormula = aFormula.replace( '.', cDecSeparator );
+ OUString aFormula ( xCalculator->getRepresentation() );
+ if ( cDecSeparator != '.' )
+ {
+ aFormula = aFormula.replace( '.', cDecSeparator );
+ }
+ aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), aFormula );
}
- aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), aFormula );
- }
- // replace r^2
- aWildcard = "%RSQUARED";
- nIndex = aRet.indexOf( aWildcard );
- if( nIndex != -1 )
- {
- double fR( xCalculator->getCorrelationCoefficient());
- aRet = aRet.replaceAt(
- nIndex, aWildcard.getLength(),
- ::rtl::math::doubleToUString(
- fR*fR, rtl_math_StringFormat_G, 4, cDecSeparator, true ));
+ // replace r^2
+ aWildcard = "%RSQUARED";
+ nIndex = aRet.indexOf( aWildcard );
+ if( nIndex != -1 )
+ {
+ double fR( xCalculator->getCorrelationCoefficient());
+ aRet = aRet.replaceAt(
+ nIndex, aWildcard.getLength(),
+ ::rtl::math::doubleToUString(
+ fR*fR, rtl_math_StringFormat_G, 4, cDecSeparator, true ));
+ }
}
}
catch( const uno::Exception & )
@@ -638,14 +639,13 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl:
}
else
{
- Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID(rObjectCID , xChartModel));
- Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID(rObjectCID , xChartModel));
aRet += getName(eObjectType);
- if( xCurveCnt.is())
+ if( xSeries.is())
{
sal_Int32 nCurveIndex = ObjectIdentifier::getIndexFromParticleOrCID( rObjectCID );
- Reference< chart2::XRegressionCurve > xCurve( RegressionCurveHelper::getRegressionCurveAtIndex(xCurveCnt, nCurveIndex) );
+ rtl::Reference< RegressionCurveModel > xCurve( RegressionCurveHelper::getRegressionCurveAtIndex(xSeries, nCurveIndex) );
if( xCurve.is())
{
aRet += " (" + RegressionCurveHelper::getRegressionCurveName(xCurve) + " )";
@@ -658,23 +658,22 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl:
if( bVerbose )
{
aRet = SchResId(STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS);
- Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel ));
- Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
- if( xCurveCnt.is())
+ rtl::Reference< DataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel ));
+ if( xSeries.is())
{
- Reference< chart2::XRegressionCurve > xCurve( RegressionCurveHelper::getMeanValueLine( xCurveCnt ));
+ rtl::Reference< RegressionCurveModel > xCurve( RegressionCurveHelper::getMeanValueLine( xSeries ));
if( xCurve.is())
{
try
{
- Reference< chart2::XRegressionCurveCalculator > xCalculator( xCurve->getCalculator(), uno::UNO_SET_THROW );
+ rtl::Reference< RegressionCurveCalculator > xCalculator( xCurve->getCurveCalculator() );
RegressionCurveHelper::initializeCurveCalculator( xCalculator, xSeries, xChartModel );
const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
const OUString& aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
sal_Unicode cDecSeparator = aNumDecimalSep[0];
- OUString aWildcard( "%AVERAGE_VALUE" );
+ OUString aWildcard( u"%AVERAGE_VALUE"_ustr );
sal_Int32 nIndex = aRet.indexOf( aWildcard );
// as the curve is constant, the value at any x-value is ok
if( nIndex != -1 )
@@ -718,7 +717,7 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const rtl:
return aRet;
}
-OUString ObjectNameProvider::getSelectedObjectText( const OUString & rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument )
+OUString ObjectNameProvider::getSelectedObjectText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument )
{
OUString aRet;
ObjectType eObjectType( ObjectIdentifier::getObjectType(rObjectCID) );
@@ -727,30 +726,30 @@ OUString ObjectNameProvider::getSelectedObjectText( const OUString & rObjectCID,
{
aRet = SchResId( STR_STATUS_DATAPOINT_MARKED );
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartDocument ) );
- Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartDocument );
+ rtl::Reference< Diagram > xDiagram( xChartDocument->getFirstChartDiagram() );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartDocument );
if( xDiagram.is() && xSeries.is() )
{
- sal_Int32 nPointIndex( ObjectIdentifier::getParticleID(rObjectCID).toInt32() );
+ sal_Int32 nPointIndex = o3tl::toInt32( ObjectIdentifier::getParticleID(rObjectCID) );
// replace data point index
- replaceParamterInString( aRet, "%POINTNUMBER", OUString::number( nPointIndex + 1 ));
+ replaceParamterInString( aRet, u"%POINTNUMBER", OUString::number( nPointIndex + 1 ));
// replace data series index
{
- std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector(
+ xDiagram->getDataSeries() );
sal_Int32 nSeriesIndex = -1;
for( nSeriesIndex=aSeriesVector.size();nSeriesIndex--;)
{
if( aSeriesVector[nSeriesIndex] == xSeries )
break;
}
- replaceParamterInString( aRet, "%SERIESNUMBER", OUString::number( nSeriesIndex + 1 ) );
+ replaceParamterInString( aRet, u"%SERIESNUMBER", OUString::number( nSeriesIndex + 1 ) );
}
// replace point value
- replaceParamterInString( aRet, "%POINTVALUES", lcl_getDataPointValueText(
+ replaceParamterInString( aRet, u"%POINTVALUES", lcl_getDataPointValueText(
xSeries, nPointIndex, DataSeriesHelper::getCoordinateSystemOfSeries(xSeries, xDiagram), xChartDocument ) );
}
}
@@ -762,7 +761,7 @@ OUString ObjectNameProvider::getSelectedObjectText( const OUString & rObjectCID,
if( !aHelpText.isEmpty())
{
aRet = SchResId( STR_STATUS_OBJECT_MARKED );
- replaceParamterInString( aRet, "%OBJECTNAME", aHelpText );
+ replaceParamterInString( aRet, u"%OBJECTNAME", aHelpText );
}
}
@@ -770,7 +769,7 @@ OUString ObjectNameProvider::getSelectedObjectText( const OUString & rObjectCID,
}
OUString ObjectNameProvider::getNameForCID(
- const OUString& rObjectCID,
+ std::u16string_view rObjectCID,
const rtl::Reference<::chart::ChartModel>& xChartDocument )
{
ObjectType eType( ObjectIdentifier::getObjectType( rObjectCID ));
@@ -809,15 +808,14 @@ OUString ObjectNameProvider::getNameForCID(
}
else if (eType == OBJECTTYPE_DATA_CURVE || eType == OBJECTTYPE_DATA_CURVE_EQUATION)
{
- Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartDocument ));
- Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartDocument ));
aRet += " " + getName(eType);
- if( xCurveCnt.is())
+ if( xSeries.is())
{
sal_Int32 nCurveIndex = ObjectIdentifier::getIndexFromParticleOrCID( rObjectCID );
- Reference< chart2::XRegressionCurve > xCurve( RegressionCurveHelper::getRegressionCurveAtIndex(xCurveCnt, nCurveIndex) );
+ rtl::Reference< RegressionCurveModel > xCurve( RegressionCurveHelper::getRegressionCurveAtIndex(xSeries, nCurveIndex) );
if( xCurve.is())
{
aRet += " (" + RegressionCurveHelper::getRegressionCurveName(xCurve) + ")";
@@ -839,15 +837,15 @@ OUString ObjectNameProvider::getNameForCID(
OUString ObjectNameProvider::getName_ObjectForSeries(
ObjectType eObjectType,
- const OUString& rSeriesCID,
+ std::u16string_view rSeriesCID,
const rtl::Reference<::chart::ChartModel>& xChartDocument )
{
- Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSeriesCID , xChartDocument );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSeriesCID , xChartDocument );
if( xSeries.is() )
{
OUString aRet = SchResId(STR_OBJECT_FOR_SERIES);
- replaceParamterInString( aRet, "%OBJECTNAME", getName( eObjectType ) );
- replaceParamterInString( aRet, "%SERIESNAME", lcl_getDataSeriesName( rSeriesCID, xChartDocument ) );
+ replaceParamterInString( aRet, u"%OBJECTNAME", getName( eObjectType ) );
+ replaceParamterInString( aRet, u"%SERIESNAME", lcl_getDataSeriesName( rSeriesCID, xChartDocument ) );
return aRet;
}
else
@@ -857,7 +855,7 @@ OUString ObjectNameProvider::getName_ObjectForSeries(
OUString ObjectNameProvider::getName_ObjectForAllSeries( ObjectType eObjectType )
{
OUString aRet = SchResId(STR_OBJECT_FOR_ALL_SERIES);
- replaceParamterInString( aRet, "%OBJECTNAME", getName( eObjectType, true /*bPlural*/ ) );
+ replaceParamterInString( aRet, u"%OBJECTNAME", getName( eObjectType, true /*bPlural*/ ) );
return aRet;
}
diff --git a/chart2/source/controller/dialogs/RangeSelectionHelper.cxx b/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
index 5cbc07f76078..1ae7b3377b25 100644
--- a/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
+++ b/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
@@ -20,10 +20,10 @@
#include <RangeSelectionHelper.hxx>
#include <RangeSelectionListener.hxx>
#include <com/sun/star/awt/XTopWindow.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <ChartModel.hxx>
+#include <utility>
using namespace ::com::sun::star;
@@ -34,8 +34,8 @@ namespace chart
{
RangeSelectionHelper::RangeSelectionHelper(
- const rtl::Reference<::chart::ChartModel> & xChartDocument ) :
- m_xChartDocument( xChartDocument )
+ rtl::Reference<::chart::ChartModel> xChartDocument ) :
+ m_xChartDocument(std::move( xChartDocument ))
{}
RangeSelectionHelper::~RangeSelectionHelper()
@@ -112,17 +112,17 @@ bool RangeSelectionHelper::chooseRange(
{
Sequence< beans::PropertyValue > aArgs{
beans::PropertyValue(
- "InitialValue", -1, uno::Any( aCurrentRange ),
+ u"InitialValue"_ustr, -1, uno::Any( aCurrentRange ),
beans::PropertyState_DIRECT_VALUE ),
beans::PropertyValue(
- "Title", -1,
+ u"Title"_ustr, -1,
uno::Any( aUIString ),
beans::PropertyState_DIRECT_VALUE ),
beans::PropertyValue(
- "CloseOnMouseRelease", -1, uno::Any( true ),
+ u"CloseOnMouseRelease"_ustr, -1, uno::Any( true ),
beans::PropertyState_DIRECT_VALUE ),
beans::PropertyValue(
- "MultiSelectionMode", -1, uno::Any( true ),
+ u"MultiSelectionMode"_ustr, -1, uno::Any( true ),
beans::PropertyState_DIRECT_VALUE )
};
if( m_xRangeSelectionListener.is() )
diff --git a/chart2/source/controller/dialogs/RangeSelectionListener.cxx b/chart2/source/controller/dialogs/RangeSelectionListener.cxx
index 473ad909f8f5..ec5d5f0ded43 100644
--- a/chart2/source/controller/dialogs/RangeSelectionListener.cxx
+++ b/chart2/source/controller/dialogs/RangeSelectionListener.cxx
@@ -19,20 +19,20 @@
#include <RangeSelectionListener.hxx>
#include <ChartModel.hxx>
+#include <vcl/weld.hxx>
+#include <utility>
using namespace ::com::sun::star;
-using ::com::sun::star::uno::Reference;
-
namespace chart
{
RangeSelectionListener::RangeSelectionListener(
RangeSelectionListenerParent & rParent,
- const OUString & rInitialRange,
+ OUString aInitialRange,
const rtl::Reference<::chart::ChartModel>& xModelToLockController ) :
m_rParent( rParent ),
- m_aRange( rInitialRange ),
+ m_aRange(std::move( aInitialRange )),
m_aControllerLockGuard( xModelToLockController )
{}
@@ -57,6 +57,23 @@ void SAL_CALL RangeSelectionListener::disposing( const lang::EventObject& /*Sour
m_rParent.disposingRangeSelection();
}
+void RangeSelectionListenerParent::enableRangeChoosing(bool bEnable, weld::DialogController* pDialog)
+{
+ if (!pDialog)
+ return;
+ weld::Dialog* pDlg = pDialog->getDialog();
+ // tdf#158753 save the current page when hiding the wizard,
+ // and restore it on showing the wizard to workaround that
+ // that GtkAssistant resets to page 0 on hide+show
+ weld::Assistant* pAss = dynamic_cast<weld::Assistant*>(pDlg);
+ if (pAss && bEnable)
+ m_sRestorePageIdent = pAss->get_current_page_ident();
+ pDlg->set_modal(!bEnable);
+ pDlg->set_visible(!bEnable);
+ if (pAss && !bEnable)
+ pAss->set_current_page(m_sRestorePageIdent);
+}
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx
index 33fe0ff6955f..cee4af1fb013 100644
--- a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx
+++ b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx
@@ -17,18 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/frame/XModel.hpp>
#include <TimerTriggeredControllerLock.hxx>
#include <ControllerLockGuard.hxx>
#include <ChartModel.hxx>
+#include <utility>
namespace chart
{
using namespace ::com::sun::star;
TimerTriggeredControllerLock::TimerTriggeredControllerLock(
- const rtl::Reference<::chart::ChartModel>& xModel)
- : m_xModel(xModel)
+ rtl::Reference<::chart::ChartModel> xModel)
+ : m_xModel(std::move(xModel))
, m_aTimer("chart2 TimerTriggeredControllerLock")
{
m_aTimer.SetTimeout(4 * EDIT_UPDATEDATA_TIMEOUT);
diff --git a/chart2/source/controller/dialogs/TitleDialogData.cxx b/chart2/source/controller/dialogs/TitleDialogData.cxx
index 7f48d90a0b24..75d59bbb43b4 100644
--- a/chart2/source/controller/dialogs/TitleDialogData.cxx
+++ b/chart2/source/controller/dialogs/TitleDialogData.cxx
@@ -19,11 +19,8 @@
#include <sal/config.h>
-#include <com/sun/star/frame/XModel.hpp>
-
#include <TitleDialogData.hxx>
#include <TitleHelper.hxx>
-#include <ChartModelHelper.hxx>
#include <Diagram.hxx>
#include <AxisHelper.hxx>
#include <ChartModel.hxx>
@@ -31,9 +28,8 @@
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
-TitleDialogData::TitleDialogData( std::unique_ptr<ReferenceSizeProvider> pRefSizeProvider )
+TitleDialogData::TitleDialogData( std::optional<ReferenceSizeProvider> pRefSizeProvider )
: aPossibilityList{ true, true, true, true, true, true, true }
, aExistenceList{ false, false, false, false, false, false, false }
, aTextList(7)
@@ -43,7 +39,7 @@ TitleDialogData::TitleDialogData( std::unique_ptr<ReferenceSizeProvider> pRefSiz
void TitleDialogData::readFromModel( const rtl::Reference<::chart::ChartModel>& xChartModel )
{
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram(xChartModel);
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
//get possibilities
uno::Sequence< sal_Bool > aAxisPossibilityList;
@@ -59,11 +55,11 @@ void TitleDialogData::readFromModel( const rtl::Reference<::chart::ChartModel>&
auto pTextList = aTextList.getArray();
//find out which title exists and get their text
//main title:
- for( sal_Int32 nTitleIndex = static_cast< sal_Int32 >( TitleHelper::TITLE_BEGIN);
- nTitleIndex < static_cast< sal_Int32 >( TitleHelper::NORMAL_TITLE_END );
+ for( auto nTitleIndex = +TitleHelper::TITLE_BEGIN;
+ nTitleIndex < +TitleHelper::NORMAL_TITLE_END;
nTitleIndex++)
{
- uno::Reference< XTitle > xTitle = TitleHelper::getTitle(
+ rtl::Reference< Title > xTitle = TitleHelper::getTitle(
static_cast< TitleHelper::eTitleType >( nTitleIndex ), xChartModel );
pExistenceList[nTitleIndex] = xTitle.is();
pTextList[nTitleIndex]=TitleHelper::getCompleteString( xTitle );
@@ -73,11 +69,11 @@ void TitleDialogData::readFromModel( const rtl::Reference<::chart::ChartModel>&
bool TitleDialogData::writeDifferenceToModel(
const rtl::Reference<::chart::ChartModel>& xChartModel
, const uno::Reference< uno::XComponentContext >& xContext
- , TitleDialogData* pOldState )
+ , const TitleDialogData* pOldState )
{
bool bChanged = false;
- for( sal_Int32 nN = static_cast< sal_Int32 >( TitleHelper::TITLE_BEGIN );
- nN < static_cast< sal_Int32 >( TitleHelper::NORMAL_TITLE_END );
+ for( auto nN = +TitleHelper::TITLE_BEGIN;
+ nN < +TitleHelper::NORMAL_TITLE_END;
nN++)
{
if( !pOldState || ( pOldState->aExistenceList[nN] != aExistenceList[nN] ) )
@@ -86,7 +82,7 @@ bool TitleDialogData::writeDifferenceToModel(
{
TitleHelper::createTitle(
static_cast< TitleHelper::eTitleType >( nN ), aTextList[nN], xChartModel, xContext,
- apReferenceSizeProvider.get() );
+ apReferenceSizeProvider.has_value() ? &*apReferenceSizeProvider : nullptr );
bChanged = true;
}
else
@@ -98,11 +94,11 @@ bool TitleDialogData::writeDifferenceToModel(
else if( !pOldState || ( pOldState->aTextList[nN] != aTextList[nN] ) )
{
//change content
- uno::Reference< XTitle > xTitle(
+ rtl::Reference< Title > xTitle(
TitleHelper::getTitle( static_cast< TitleHelper::eTitleType >( nN ), xChartModel ) );
if(xTitle.is())
{
- TitleHelper::setCompleteString( aTextList[nN], xTitle, xContext );
+ TitleHelper::setCompleteString( aTextList[nN], xTitle, xContext, nullptr, true );
bChanged = true;
}
}
diff --git a/chart2/source/controller/dialogs/dlg_ChartType.cxx b/chart2/source/controller/dialogs/dlg_ChartType.cxx
index 59ca6be0c99a..837f3f3acc25 100644
--- a/chart2/source/controller/dialogs/dlg_ChartType.cxx
+++ b/chart2/source/controller/dialogs/dlg_ChartType.cxx
@@ -19,19 +19,19 @@
#include <dlg_ChartType.hxx>
#include "tp_ChartType.hxx"
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <ChartModel.hxx>
+#include <utility>
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
ChartTypeDialog::ChartTypeDialog(weld::Window* pParent,
- const rtl::Reference<::chart::ChartModel>& xChartModel)
- : GenericDialogController(pParent, "modules/schart/ui/charttypedialog.ui", "ChartTypeDialog")
- , m_xChartModel(xChartModel)
- , m_xContentArea(m_xDialog->weld_content_area())
+ rtl::Reference<::chart::ChartModel> xChartModel)
+ : GenericDialogController(pParent, u"modules/schart/ui/charttypedialog.ui"_ustr,
+ u"ChartTypeDialog"_ustr)
+ , m_xChartModel(std::move(xChartModel))
+ , m_xContentArea(m_xBuilder->weld_container(u"content"_ustr))
{
m_xChartTypeTabPage = std::make_unique<ChartTypeTabPage>(
m_xContentArea.get(), this, m_xChartModel, false /*don't show title description*/);
diff --git a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx
index 873edbc48ada..c92148b036c0 100644
--- a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx
@@ -23,9 +23,6 @@
#include <servicenames.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#include <com/sun/star/frame/XModel.hpp>
-
-namespace com::sun::star::awt { class XWindow; }
namespace chart
{
@@ -48,12 +45,12 @@ ChartTypeUnoDlg::~ChartTypeUnoDlg()
// lang::XServiceInfo
OUString SAL_CALL ChartTypeUnoDlg::getImplementationName()
{
- return CHART_TYPE_DIALOG_SERVICE_IMPLEMENTATION_NAME;
+ return u"com.sun.star.comp.chart2.ChartTypeDialog"_ustr;
}
css::uno::Sequence<OUString> SAL_CALL ChartTypeUnoDlg::getSupportedServiceNames()
{
- return { CHART_TYPE_DIALOG_SERVICE_NAME };
+ return { u"com.sun.star.chart2.ChartTypeDialog"_ustr };
}
uno::Sequence< sal_Int8 > SAL_CALL ChartTypeUnoDlg::getImplementationId()
{
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
index e186633c869f..ddfa7a3b4e3e 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
@@ -29,15 +29,16 @@
#include "tp_DataSource.hxx"
#include <ChartTypeTemplateProvider.hxx>
#include <ChartTypeTemplate.hxx>
+#include <utility>
#include "DialogModel.hxx"
using namespace css;
using vcl::RoadmapWizardTypes::WizardPath;
+using vcl::RoadmapWizardTypes::PathId;
namespace chart
{
-#define PATH_FULL 1
#define STATE_FIRST 0
#define STATE_CHARTTYPE STATE_FIRST
#define STATE_SIMPLE_RANGE 1
@@ -46,15 +47,15 @@ namespace chart
#define STATE_LAST STATE_OBJECTS
CreationWizard::CreationWizard(weld::Window* pParent, const rtl::Reference<::chart::ChartModel>& xChartModel,
- const uno::Reference<uno::XComponentContext>& xContext)
+ uno::Reference<uno::XComponentContext> xContext)
: vcl::RoadmapWizardMachine(pParent)
- , m_xChartModel(xChartModel,uno::UNO_QUERY)
- , m_xComponentContext(xContext)
+ , m_xChartModel(xChartModel)
+ , m_xComponentContext(std::move(xContext))
, m_pTemplateProvider(nullptr)
, m_aTimerTriggeredControllerLock(xChartModel)
, m_bCanTravel(true)
{
- m_pDialogModel.reset(new DialogModel(m_xChartModel, m_xComponentContext));
+ m_pDialogModel.reset(new DialogModel(m_xChartModel));
defaultButton(WizardButtonFlags::FINISH);
setTitleBase(SchResId(STR_DLG_CHART_WIZARD));
@@ -71,7 +72,7 @@ CreationWizard::CreationWizard(weld::Window* pParent, const rtl::Reference<::cha
STATE_OBJECTS
};
- declarePath(PATH_FULL, aPath);
+ declarePath(PathId::COMPLETE, aPath);
// tdf#135935 ensure help ID is set when no element is clicked in the dialog
m_xAssistant->set_help_id(HID_SCH_WIZARD_ROADMAP);
@@ -94,7 +95,7 @@ std::unique_ptr<BuilderPage> CreationWizard::createPage(WizardState nState)
{
std::unique_ptr<vcl::OWizardPage> xRet;
- OString sIdent(OString::number(nState));
+ OUString sIdent(OUString::number(nState));
weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
switch( nState )
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index 973b8fa74027..694397a83b5f 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -22,22 +22,25 @@
#include <ChartModel.hxx>
#include <servicenames.hxx>
#include <TimerTriggeredControllerLock.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
+#include <vcl/weldutils.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/Desktop.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sfx2/viewsh.hxx>
+
namespace chart
{
using namespace ::com::sun::star;
-CreationWizardUnoDlg::CreationWizardUnoDlg(const uno::Reference<uno::XComponentContext>& xContext)
+CreationWizardUnoDlg::CreationWizardUnoDlg(uno::Reference<uno::XComponentContext> xContext)
: OComponentHelper(m_aMutex)
- , m_xCC(xContext)
+ , m_xCC(std::move(xContext))
, m_bUnlockControllersOnExecute(false)
{
uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(m_xCC);
@@ -54,7 +57,7 @@ CreationWizardUnoDlg::~CreationWizardUnoDlg()
// lang::XServiceInfo
OUString SAL_CALL CreationWizardUnoDlg::getImplementationName()
{
- return CHART_WIZARD_DIALOG_SERVICE_IMPLEMENTATION_NAME;
+ return u"com.sun.star.comp.chart2.WizardDialog"_ustr;
}
sal_Bool SAL_CALL CreationWizardUnoDlg::supportsService( const OUString& rServiceName )
@@ -64,7 +67,7 @@ sal_Bool SAL_CALL CreationWizardUnoDlg::supportsService( const OUString& rServic
css::uno::Sequence< OUString > SAL_CALL CreationWizardUnoDlg::getSupportedServiceNames()
{
- return { CHART_WIZARD_DIALOG_SERVICE_NAME };
+ return { u"com.sun.star.chart2.WizardDialog"_ustr };
}
// XInterface
@@ -166,10 +169,18 @@ void CreationWizardUnoDlg::createDialogOnDemand()
m_xParentWindow = xFrame->getContainerWindow();
}
}
+
+ weld::Window* pParent(Application::GetFrameWeld(m_xParentWindow));
+ if (!pParent)
+ {
+ if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(m_xParentWindow.get()))
+ pParent = dynamic_cast<weld::Window*>(pTunnel->getWidget());
+ }
+
uno::Reference< XComponent > xKeepAlive( this );
if( m_xChartModel.is() )
{
- m_xDialog = std::make_shared<CreationWizard>(Application::GetFrameWeld(m_xParentWindow), m_xChartModel, m_xCC);
+ m_xDialog = std::make_shared<CreationWizard>(pParent, m_xChartModel, m_xCC);
}
}
@@ -274,10 +285,10 @@ void SAL_CALL CreationWizardUnoDlg::setPropertyValue(const OUString& rPropertyNa
else if( rPropertyName == "UnlockControllersOnExecute" )
{
if( ! (rValue >>= m_bUnlockControllersOnExecute) )
- throw lang::IllegalArgumentException( "Property 'UnlockControllers' requires value of type boolean" , nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property 'UnlockControllers' requires value of type boolean"_ustr , nullptr, 0 );
}
else
- throw beans::UnknownPropertyException( "unknown property was tried to set to chart wizard" , nullptr );
+ throw beans::UnknownPropertyException( u"unknown property was tried to set to chart wizard"_ustr , nullptr );
}
uno::Any SAL_CALL CreationWizardUnoDlg::getPropertyValue( const OUString& rPropertyName )
@@ -314,7 +325,7 @@ uno::Any SAL_CALL CreationWizardUnoDlg::getPropertyValue( const OUString& rPrope
aRet <<= m_bUnlockControllersOnExecute;
}
else
- throw beans::UnknownPropertyException( "unknown property was tried to get from chart wizard" , nullptr );
+ throw beans::UnknownPropertyException( u"unknown property was tried to get from chart wizard"_ustr , nullptr );
return aRet;
}
diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
index 1e442a102f09..a62a9d712693 100644
--- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
@@ -20,11 +20,9 @@
#include <dlg_DataEditor.hxx>
#include "DataBrowser.hxx"
#include <ChartModel.hxx>
-#include <comphelper/stl_types.hxx>
#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -33,17 +31,17 @@ namespace chart
{
DataEditor::DataEditor(weld::Window* pParent,
- const rtl::Reference<::chart::ChartModel> & xChartDoc,
+ rtl::Reference<::chart::ChartModel> xChartDoc,
const Reference< uno::XComponentContext > & xContext)
- : GenericDialogController(pParent, "modules/schart/ui/chartdatadialog.ui", "ChartDataDialog")
+ : GenericDialogController(pParent, u"modules/schart/ui/chartdatadialog.ui"_ustr, u"ChartDataDialog"_ustr)
, m_bReadOnly(false)
- , m_xChartDoc(xChartDoc)
+ , m_xChartDoc(std::move(xChartDoc))
, m_xContext(xContext)
- , m_xTbxData(m_xBuilder->weld_toolbar("toolbar"))
- , m_xCloseBtn(m_xBuilder->weld_button("close"))
- , m_xTable(m_xBuilder->weld_container("datawindow"))
- , m_xColumns(m_xBuilder->weld_container("columns"))
- , m_xColors(m_xBuilder->weld_container("colorcolumns"))
+ , m_xTbxData(m_xBuilder->weld_toolbar(u"toolbar"_ustr))
+ , m_xCloseBtn(m_xBuilder->weld_button(u"close"_ustr))
+ , m_xTable(m_xBuilder->weld_container(u"datawindow"_ustr))
+ , m_xColumns(m_xBuilder->weld_container(u"columns"_ustr))
+ , m_xColors(m_xBuilder->weld_container(u"colorcolumns"_ustr))
, m_xTableCtrlParent(m_xTable->CreateChildFrame())
, m_xBrwData(VclPtr<DataBrowser>::Create(m_xTableCtrlParent, m_xColumns.get(), m_xColors.get()))
{
@@ -58,7 +56,7 @@ DataEditor::DataEditor(weld::Window* pParent,
m_xBrwData->SetCursorMovedHdl( LINK( this, DataEditor, BrowserCursorMovedHdl ));
- m_xBrwData->SetDataFromModel( m_xChartDoc, m_xContext );
+ m_xBrwData->SetDataFromModel( m_xChartDoc );
m_xBrwData->GrabFocus();
bool bReadOnly = true;
@@ -75,7 +73,7 @@ DataEditor::~DataEditor()
}
// react on click (or keypress) on toolbar icon
-IMPL_LINK(DataEditor, ToolboxHdl, const OString&, rId, void)
+IMPL_LINK(DataEditor, ToolboxHdl, const OUString&, rId, void)
{
if (rId == "InsertRow")
m_xBrwData->InsertRow();
@@ -105,16 +103,16 @@ IMPL_LINK_NOARG(DataEditor, BrowserCursorMovedHdl, DataBrowser*, void)
bool bIsDataValid = m_xBrwData->IsEnableItem();
- m_xTbxData->set_item_sensitive("InsertRow", bIsDataValid && m_xBrwData->MayInsertRow() );
- m_xTbxData->set_item_sensitive("InsertColumn", bIsDataValid && m_xBrwData->MayInsertColumn() );
- m_xTbxData->set_item_sensitive("InsertTextColumn", bIsDataValid && m_xBrwData->MayInsertColumn() );
- m_xTbxData->set_item_sensitive("RemoveRow", m_xBrwData->MayDeleteRow() );
- m_xTbxData->set_item_sensitive("RemoveColumn", m_xBrwData->MayDeleteColumn() );
+ m_xTbxData->set_item_sensitive(u"InsertRow"_ustr, bIsDataValid && m_xBrwData->MayInsertRow() );
+ m_xTbxData->set_item_sensitive(u"InsertColumn"_ustr, bIsDataValid && m_xBrwData->MayInsertColumn() );
+ m_xTbxData->set_item_sensitive(u"InsertTextColumn"_ustr, bIsDataValid && m_xBrwData->MayInsertColumn() );
+ m_xTbxData->set_item_sensitive(u"RemoveRow"_ustr, m_xBrwData->MayDeleteRow() );
+ m_xTbxData->set_item_sensitive(u"RemoveColumn"_ustr, m_xBrwData->MayDeleteColumn() );
- m_xTbxData->set_item_sensitive("MoveLeftColumn", bIsDataValid && m_xBrwData->MayMoveLeftColumns() );
- m_xTbxData->set_item_sensitive("MoveRightColumn", bIsDataValid && m_xBrwData->MayMoveRightColumns() );
- m_xTbxData->set_item_sensitive("MoveUpRow", bIsDataValid && m_xBrwData->MayMoveDownRows() );
- m_xTbxData->set_item_sensitive("MoveDownRow", bIsDataValid && m_xBrwData->MayMoveUpRows() );
+ m_xTbxData->set_item_sensitive(u"MoveLeftColumn"_ustr, bIsDataValid && m_xBrwData->MayMoveLeftColumns() );
+ m_xTbxData->set_item_sensitive(u"MoveRightColumn"_ustr, bIsDataValid && m_xBrwData->MayMoveRightColumns() );
+ m_xTbxData->set_item_sensitive(u"MoveDownRow"_ustr, bIsDataValid && m_xBrwData->MayMoveDownRows() );
+ m_xTbxData->set_item_sensitive(u"MoveUpRow"_ustr, bIsDataValid && m_xBrwData->MayMoveUpRows() );
}
// disable all modifying controls
@@ -123,15 +121,15 @@ void DataEditor::SetReadOnly( bool bReadOnly )
m_bReadOnly = bReadOnly;
if( m_bReadOnly )
{
- m_xTbxData->set_item_sensitive("InsertRow", false);
- m_xTbxData->set_item_sensitive("InsertColumn", false);
- m_xTbxData->set_item_sensitive("InsertTextColumn", false);
- m_xTbxData->set_item_sensitive("RemoveRow", false);
- m_xTbxData->set_item_sensitive("RemoveColumn", false);
- m_xTbxData->set_item_sensitive("MoveLeftColumn", false);
- m_xTbxData->set_item_sensitive("MoveRightColumn", false);
- m_xTbxData->set_item_sensitive("MoveUpRow", false);
- m_xTbxData->set_item_sensitive("MoveDownRow", false);
+ m_xTbxData->set_item_sensitive(u"InsertRow"_ustr, false);
+ m_xTbxData->set_item_sensitive(u"InsertColumn"_ustr, false);
+ m_xTbxData->set_item_sensitive(u"InsertTextColumn"_ustr, false);
+ m_xTbxData->set_item_sensitive(u"RemoveRow"_ustr, false);
+ m_xTbxData->set_item_sensitive(u"RemoveColumn"_ustr, false);
+ m_xTbxData->set_item_sensitive(u"MoveLeftColumn"_ustr, false);
+ m_xTbxData->set_item_sensitive(u"MoveRightColumn"_ustr, false);
+ m_xTbxData->set_item_sensitive(u"MoveUpRow"_ustr, false);
+ m_xTbxData->set_item_sensitive(u"MoveDownRow"_ustr, false);
}
m_xBrwData->SetReadOnly( m_bReadOnly );
diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx
index 7c804ba8a235..c00698fef60d 100644
--- a/chart2/source/controller/dialogs/dlg_DataSource.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx
@@ -18,13 +18,11 @@
*/
#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <dlg_DataSource.hxx>
#include <ChartTypeTemplateProvider.hxx>
-#include <ChartTypeManager.hxx>
#include <ChartTypeTemplate.hxx>
-#include <DiagramHelper.hxx>
+#include <Diagram.hxx>
#include "DialogModel.hxx"
#include <ChartModel.hxx>
@@ -32,11 +30,8 @@
#include "tp_DataSource.hxx"
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using namespace ::chart;
-using ::com::sun::star::uno::Reference;
-
namespace chart
{
@@ -63,13 +58,11 @@ DocumentChartTypeTemplateProvider::DocumentChartTypeTemplateProvider(
if( !xDoc.is())
return;
- Reference< chart2::XDiagram > xDia( xDoc->getFirstDiagram());
+ rtl::Reference< Diagram > xDia( xDoc->getFirstChartDiagram());
if( xDia.is())
{
- DiagramHelper::tTemplateWithServiceName aResult(
- DiagramHelper::getTemplateForDiagram(
- xDia,
- xDoc->getTypeManager() ));
+ Diagram::tTemplateWithServiceName aResult(
+ xDia->getTemplate( xDoc->getTypeManager() ));
m_xTemplate = aResult.xChartTypeTemplate;
}
}
@@ -82,26 +75,26 @@ rtl::Reference< ::chart::ChartTypeTemplate > DocumentChartTypeTemplateProvider::
sal_uInt16 DataSourceDialog::m_nLastPageId = 0;
DataSourceDialog::DataSourceDialog(weld::Window * pParent,
- const rtl::Reference<::chart::ChartModel> & xChartDocument,
- const Reference< uno::XComponentContext > & xContext)
- : GenericDialogController(pParent, "modules/schart/ui/datarangedialog.ui",
- "DataRangeDialog")
+ const rtl::Reference<::chart::ChartModel> & xChartDocument)
+ : GenericDialogController(pParent, u"modules/schart/ui/datarangedialog.ui"_ustr,
+ u"DataRangeDialog"_ustr)
, m_apDocTemplateProvider(new DocumentChartTypeTemplateProvider(xChartDocument))
- , m_apDialogModel(new DialogModel(xChartDocument, xContext))
+ , m_apDialogModel(new DialogModel(xChartDocument))
, m_bRangeChooserTabIsValid(true)
, m_bDataSourceTabIsValid(true)
, m_bTogglingEnabled(true)
- , m_xTabControl(m_xBuilder->weld_notebook("tabcontrol"))
- , m_xBtnOK(m_xBuilder->weld_button("ok"))
+ , m_xTabControl(m_xBuilder->weld_notebook(u"tabcontrol"_ustr))
+ , m_xBtnOK(m_xBuilder->weld_button(u"ok"_ustr))
{
- m_xRangeChooserTabPage = std::make_unique<RangeChooserTabPage>(m_xTabControl->get_page("range"), this,
+ m_xRangeChooserTabPage = std::make_unique<RangeChooserTabPage>(m_xTabControl->get_page(u"range"_ustr), this,
*m_apDialogModel,
m_apDocTemplateProvider.get(), true /* bHideDescription */ );
- m_xDataSourceTabPage = std::make_unique<DataSourceTabPage>(m_xTabControl->get_page("series"), this,
+ m_xDataSourceTabPage = std::make_unique<DataSourceTabPage>(m_xTabControl->get_page(u"series"_ustr), this,
*m_apDialogModel,
m_apDocTemplateProvider.get(), true /* bHideDescription */ );
m_xTabControl->connect_enter_page(LINK(this, DataSourceDialog, ActivatePageHdl));
m_xTabControl->connect_leave_page(LINK(this, DataSourceDialog, DeactivatePageHdl));
+ m_xBtnOK->connect_clicked(LINK(this, DataSourceDialog, OkHdl));
ActivatePageHdl(m_xTabControl->get_current_page_ident());
if (m_nLastPageId != 0)
{
@@ -117,20 +110,21 @@ DataSourceDialog::~DataSourceDialog()
m_nLastPageId = m_xTabControl->get_current_page();
}
-short DataSourceDialog::run()
+void DataSourceDialog::commitPages()
{
- short nResult = GenericDialogController::run();
- if( nResult == RET_OK )
- {
- if( m_xRangeChooserTabPage )
- m_xRangeChooserTabPage->commitPage();
- if( m_xDataSourceTabPage )
- m_xDataSourceTabPage->commitPage();
- }
- return nResult;
+ if (m_xRangeChooserTabPage)
+ m_xRangeChooserTabPage->commitPage();
+ if (m_xDataSourceTabPage)
+ m_xDataSourceTabPage->commitPage();
+}
+
+IMPL_LINK_NOARG(DataSourceDialog, OkHdl, weld::Button&, void)
+{
+ commitPages();
+ m_xDialog->response(RET_OK);
}
-IMPL_LINK(DataSourceDialog, ActivatePageHdl, const OString&, rPage, void)
+IMPL_LINK(DataSourceDialog, ActivatePageHdl, const OUString&, rPage, void)
{
if (rPage == "range")
m_xRangeChooserTabPage->Activate();
@@ -139,7 +133,7 @@ IMPL_LINK(DataSourceDialog, ActivatePageHdl, const OString&, rPage, void)
}
// allow/disallow user to leave page
-IMPL_LINK_NOARG(DataSourceDialog, DeactivatePageHdl, const OString&, bool)
+IMPL_LINK_NOARG(DataSourceDialog, DeactivatePageHdl, const OUString&, bool)
{
return m_bTogglingEnabled;
}
diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
index f20571e22f55..0fcdcaf164a9 100644
--- a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
@@ -34,17 +34,17 @@ SchAxisDlg::SchAxisDlg(weld::Window* pWindow,
const InsertAxisOrGridDialogData& rInput, bool bAxisDlg)
: GenericDialogController(pWindow,
bAxisDlg ?
- OUString("modules/schart/ui/insertaxisdlg.ui") :
- OUString("modules/schart/ui/insertgriddlg.ui"),
+ u"modules/schart/ui/insertaxisdlg.ui"_ustr :
+ u"modules/schart/ui/insertgriddlg.ui"_ustr,
bAxisDlg ?
- OString("InsertAxisDialog") :
- OString("InsertGridDialog"))
- , m_xCbPrimaryX(m_xBuilder->weld_check_button("primaryX"))
- , m_xCbPrimaryY(m_xBuilder->weld_check_button("primaryY"))
- , m_xCbPrimaryZ(m_xBuilder->weld_check_button("primaryZ"))
- , m_xCbSecondaryX(m_xBuilder->weld_check_button("secondaryX"))
- , m_xCbSecondaryY(m_xBuilder->weld_check_button("secondaryY"))
- , m_xCbSecondaryZ(m_xBuilder->weld_check_button("secondaryZ"))
+ u"InsertAxisDialog"_ustr :
+ u"InsertGridDialog"_ustr)
+ , m_xCbPrimaryX(m_xBuilder->weld_check_button(u"primaryX"_ustr))
+ , m_xCbPrimaryY(m_xBuilder->weld_check_button(u"primaryY"_ustr))
+ , m_xCbPrimaryZ(m_xBuilder->weld_check_button(u"primaryZ"_ustr))
+ , m_xCbSecondaryX(m_xBuilder->weld_check_button(u"secondaryX"_ustr))
+ , m_xCbSecondaryY(m_xBuilder->weld_check_button(u"secondaryY"_ustr))
+ , m_xCbSecondaryZ(m_xBuilder->weld_check_button(u"secondaryZ"_ustr))
{
if (bAxisDlg)
{
diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
index 57817d883d66..c917e4f0fb82 100644
--- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
@@ -24,7 +24,7 @@ namespace chart
{
DataLabelsDialog::DataLabelsDialog(weld::Window* pWindow, const SfxItemSet& rInAttrs, SvNumberFormatter* pFormatter)
- : GenericDialogController(pWindow, "modules/schart/ui/dlg_DataLabel.ui", "dlg_DataLabels")
+ : GenericDialogController(pWindow, u"modules/schart/ui/dlg_DataLabel.ui"_ustr, u"dlg_DataLabels"_ustr)
, m_apDataLabelResources(new DataLabelResources(m_xBuilder.get(), pWindow, rInAttrs))
{
m_apDataLabelResources->SetNumberFormatter( pFormatter );
diff --git a/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx
new file mode 100644
index 000000000000..a2adef7c0f1a
--- /dev/null
+++ b/chart2/source/controller/dialogs/dlg_InsertDataTable.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 <dlg_InsertDataTable.hxx>
+
+namespace chart
+{
+InsertDataTableDialog::InsertDataTableDialog(weld::Window* pWindow)
+ : GenericDialogController(pWindow, u"modules/schart/ui/dlg_InsertDataTable.ui"_ustr,
+ u"InsertDataTableDialog"_ustr)
+ , m_aDataTablePropertiesResources(*m_xBuilder)
+ , m_xCbShowDataTable(m_xBuilder->weld_check_button(u"showDataTable"_ustr))
+{
+ m_xCbShowDataTable->connect_toggled(LINK(this, InsertDataTableDialog, ShowDataTableToggle));
+ init(m_aData);
+}
+
+IMPL_LINK_NOARG(InsertDataTableDialog, ShowDataTableToggle, weld::Toggleable&, void)
+{
+ changeEnabled();
+}
+
+void InsertDataTableDialog::changeEnabled()
+{
+ bool bEnable = m_xCbShowDataTable->get_active();
+ m_aDataTablePropertiesResources.setChecksSensitive(bEnable);
+ m_aData.mbShow = bEnable;
+}
+
+void InsertDataTableDialog::init(DataTableDialogData const& rData)
+{
+ m_aData = rData;
+ m_aDataTablePropertiesResources.setHorizontalBorder(m_aData.mbHorizontalBorders);
+ m_aDataTablePropertiesResources.setVerticalBorder(m_aData.mbVerticalBorders);
+ m_aDataTablePropertiesResources.setOutline(m_aData.mbOutline);
+ m_aDataTablePropertiesResources.setKeys(m_aData.mbKeys);
+ m_xCbShowDataTable->set_active(m_aData.mbShow);
+ changeEnabled();
+}
+
+DataTableDialogData& InsertDataTableDialog::getDataTableDialogData()
+{
+ m_aData.mbShow = m_xCbShowDataTable->get_active();
+
+ m_aData.mbHorizontalBorders = m_aDataTablePropertiesResources.getHorizontalBorder();
+ m_aData.mbVerticalBorders = m_aDataTablePropertiesResources.getVerticalBorder();
+ m_aData.mbOutline = m_aDataTablePropertiesResources.getOutline();
+ m_aData.mbKeys = m_aDataTablePropertiesResources.getKeys();
+
+ return m_aData;
+}
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
index ceec42d736e8..9b098feb1b09 100644
--- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
@@ -20,19 +20,15 @@
#include <dlg_InsertErrorBars.hxx>
#include <res_ErrorBar.hxx>
#include <chartview/ExplicitScaleValues.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
+#include <ChartView.hxx>
#include <ObjectIdentifier.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <ObjectNameProvider.hxx>
+#include <DataSeries.hxx>
-#include <com/sun/star/frame/XModel.hpp>
-#include <comphelper/servicehelper.hxx>
-
-using ::com::sun::star::uno::Reference;
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -43,7 +39,7 @@ InsertErrorBarsDialog::InsertErrorBarsDialog(
weld::Window* pParent, const SfxItemSet& rMyAttrs,
const rtl::Reference<::chart::ChartModel> & xChartDocument,
ErrorBarResources::tErrorBarType eType /* = ErrorBarResources::ERROR_BAR_Y */ )
- : GenericDialogController(pParent, "modules/schart/ui/dlg_InsertErrorBars.ui", "dlg_InsertErrorBars")
+ : GenericDialogController(pParent, u"modules/schart/ui/dlg_InsertErrorBars.ui"_ustr, u"dlg_InsertErrorBars"_ustr)
, m_apErrorBarResources( new ErrorBarResources(
m_xBuilder.get(), this, rMyAttrs,
/* bNoneAvailable = */ true, eType ))
@@ -67,18 +63,17 @@ void InsertErrorBarsDialog::SetAxisMinorStepWidthForErrorBarDecimals( double fMi
double InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals(
const rtl::Reference<::chart::ChartModel>& xChartModel,
- const Reference< uno::XInterface >& xChartView,
- const OUString& rSelectedObjectCID )
+ const rtl::Reference<::chart::ChartView>& xChartView,
+ std::u16string_view rSelectedObjectCID )
{
double fStepWidth = 0.001;
- ExplicitValueProvider* pExplicitValueProvider( comphelper::getFromUnoTunnel<ExplicitValueProvider>(xChartView) );
+ ChartView* pExplicitValueProvider( xChartView.get() );
if( pExplicitValueProvider )
{
- Reference< XAxis > xAxis;
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
- Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSelectedObjectCID, xChartModel );
- xAxis = DiagramHelper::getAttachedAxis( xSeries, xDiagram );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSelectedObjectCID, xChartModel );
+ rtl::Reference< Axis > xAxis = xDiagram->getAttachedAxis( xSeries );
if(!xAxis.is())
xAxis = AxisHelper::getAxis( 1/*nDimensionIndex*/, true/*bMainAxis*/, xDiagram );
if(xAxis.is())
diff --git a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx
index c55ecc3e88d6..919a99ba1ffc 100644
--- a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx
@@ -25,7 +25,8 @@ namespace chart
using namespace ::com::sun::star;
SchLegendDlg::SchLegendDlg(weld::Window* pWindow, const uno::Reference<uno::XComponentContext>& xCC)
- : GenericDialogController(pWindow, "modules/schart/ui/dlg_InsertLegend.ui", "dlg_InsertLegend")
+ : GenericDialogController(pWindow, u"modules/schart/ui/dlg_InsertLegend.ui"_ustr,
+ u"dlg_InsertLegend"_ustr)
, m_xLegendPositionResources(new LegendPositionResources(*m_xBuilder, xCC))
{
}
diff --git a/chart2/source/controller/dialogs/dlg_InsertTitle.cxx b/chart2/source/controller/dialogs/dlg_InsertTitle.cxx
index 03f942945823..5e96f9ae9c73 100644
--- a/chart2/source/controller/dialogs/dlg_InsertTitle.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertTitle.cxx
@@ -24,7 +24,8 @@
namespace chart
{
SchTitleDlg::SchTitleDlg(weld::Window* pWindow, const TitleDialogData& rInput)
- : GenericDialogController(pWindow, "modules/schart/ui/inserttitledlg.ui", "InsertTitleDialog")
+ : GenericDialogController(pWindow, u"modules/schart/ui/inserttitledlg.ui"_ustr,
+ u"InsertTitleDialog"_ustr)
, m_xTitleResources(new TitleResources(*m_xBuilder, true))
{
m_xDialog->set_title(ObjectNameProvider::getName(OBJECTTYPE_TITLE, true));
diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
index 7750588ccaa7..968c437c049e 100644
--- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
+++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
@@ -30,13 +30,14 @@ namespace chart
using namespace ::com::sun::star;
NumberFormatDialog::NumberFormatDialog(weld::Window* pParent, const SfxItemSet& rSet)
- : SfxSingleTabDialogController(pParent, &rSet, "cui/ui/formatnumberdialog.ui", "FormatNumberDialog")
+ : SfxSingleTabDialogController(pParent, &rSet, u"cui/ui/formatnumberdialog.ui"_ustr, u"FormatNumberDialog"_ustr)
+ , m_xContent( m_xBuilder->weld_container(u"content"_ustr) )
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT );
if (fnCreatePage)
{
- std::unique_ptr<SfxTabPage> xTabPage = (*fnCreatePage)(get_content_area(), this, &rSet);
+ std::unique_ptr<SfxTabPage> xTabPage = (*fnCreatePage)(m_xContent.get(), this, &rSet);
xTabPage->PageCreated(rSet);
SetTabPage(std::move(xTabPage));
}
diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.hxx b/chart2/source/controller/dialogs/dlg_NumberFormat.hxx
index 56d5acd20867..2bb84696ac57 100644
--- a/chart2/source/controller/dialogs/dlg_NumberFormat.hxx
+++ b/chart2/source/controller/dialogs/dlg_NumberFormat.hxx
@@ -20,10 +20,6 @@
#include <sfx2/basedlgs.hxx>
-namespace weld
-{
-class Window;
-}
class SfxItemSet;
class SfxItemPool;
@@ -31,6 +27,8 @@ namespace chart
{
class NumberFormatDialog : public SfxSingleTabDialogController
{
+ std::unique_ptr<weld::Container> m_xContent;
+
public:
NumberFormatDialog(weld::Window* pParent, const SfxItemSet& rSet);
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 84740d9bf708..8148bd6b880a 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include <dlg_ObjectProperties.hxx>
#include <strings.hrc>
#include "tp_AxisLabel.hxx"
@@ -31,14 +35,18 @@
#include "tp_TitleRotation.hxx"
#include "tp_PolarOptions.hxx"
#include "tp_DataPointOption.hxx"
+#include "tp_DataTable.hxx"
+#include "tp_ChartColorPalette.hxx"
#include <ResId.hxx>
#include <ViewElementListProvider.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ObjectNameProvider.hxx>
+#include <DataSeries.hxx>
#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <NumberFormatterWrapper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <ExplicitCategoriesProvider.hxx>
#include <ChartModel.hxx>
@@ -64,10 +72,8 @@
#include <svx/numinf.hxx>
#include <svl/cjkoptions.hxx>
-#include <tools/diagnose_ex.h>
-
-namespace com::sun::star::chart2 { class XChartType; }
-namespace com::sun::star::chart2 { class XDataSeries; }
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -79,8 +85,8 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::beans::XPropertySet;
-ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const OUString& rObjectCID )
- : m_aObjectCID( rObjectCID )
+ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( OUString aObjectCID )
+ : m_aObjectCID(std::move( aObjectCID ))
, m_eObjectType( ObjectIdentifier::getObjectType( m_aObjectCID ) )
, m_bAffectsMultipleObjects(false)
, m_bHasGeometryProperties(false)
@@ -103,8 +109,8 @@ ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const OUString
, m_bComplexCategoriesAxis( false )
, m_nNbPoints( 0 )
{
- OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
- m_bAffectsMultipleObjects = (aParticleID == "ALLELEMENTS");
+ std::u16string_view aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
+ m_bAffectsMultipleObjects = (aParticleID == u"ALLELEMENTS");
}
ObjectPropertiesDialogParameter::~ObjectPropertiesDialogParameter()
{
@@ -113,28 +119,30 @@ ObjectPropertiesDialogParameter::~ObjectPropertiesDialogParameter()
void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartModel>& xChartModel )
{
m_xChartDocument = xChartModel;
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
- uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aObjectCID, xChartModel );
- uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries );
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aObjectCID, xChartModel );
+ rtl::Reference< ChartType > xChartType = xChartModel->getChartTypeOfSeries( xSeries );
+ sal_Int32 nDimensionCount = 0;
+ if (xDiagram)
+ nDimensionCount = xDiagram->getDimension();
bool bHasSeriesProperties = (m_eObjectType==OBJECTTYPE_DATA_SERIES);
bool bHasDataPointproperties = (m_eObjectType==OBJECTTYPE_DATA_POINT);
if( bHasSeriesProperties || bHasDataPointproperties )
{
- m_bHasGeometryProperties = ChartTypeHelper::isSupportingGeometryProperties( xChartType, nDimensionCount );
- m_bHasAreaProperties = ChartTypeHelper::isSupportingAreaProperties( xChartType, nDimensionCount );
- m_bHasSymbolProperties = ChartTypeHelper::isSupportingSymbolProperties( xChartType, nDimensionCount );
- m_bIsPieChartDataPoint = bHasDataPointproperties && ChartTypeHelper::isSupportingStartingAngle( xChartType );
+ m_bHasGeometryProperties = xChartType->isSupportingGeometryProperties(nDimensionCount );
+ m_bHasAreaProperties = xChartType->isSupportingAreaProperties(nDimensionCount);
+ m_bHasSymbolProperties = xChartType->isSupportingSymbolProperties(nDimensionCount);
+ m_bIsPieChartDataPoint = bHasDataPointproperties && xChartType->isSupportingStartingAngle();
if( bHasSeriesProperties )
{
- m_bHasStatisticProperties = ChartTypeHelper::isSupportingStatisticProperties( xChartType, nDimensionCount );
- m_bProvidesSecondaryYAxis = ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount );
- m_bProvidesOverlapAndGapWidth = ChartTypeHelper::isSupportingOverlapAndGapWidthProperties( xChartType, nDimensionCount );
- m_bProvidesBarConnectors = ChartTypeHelper::isSupportingBarConnectors( xChartType, nDimensionCount );
- m_bProvidesStartingAngle = ChartTypeHelper::isSupportingStartingAngle( xChartType );
+ m_bHasStatisticProperties = xChartType->isSupportingStatisticProperties(nDimensionCount);
+ m_bProvidesSecondaryYAxis = xChartType->isSupportingSecondaryAxis(nDimensionCount);
+ m_bProvidesOverlapAndGapWidth = xChartType->isSupportingOverlapAndGapWidthProperties(nDimensionCount);
+ m_bProvidesBarConnectors = xChartType->isSupportingBarConnectors(nDimensionCount);
+ m_bProvidesStartingAngle = xChartType->isSupportingStartingAngle();
m_bProvidesMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType )
.hasElements();
@@ -153,7 +161,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
if( m_bHasScaleProperties )
{
- uno::Reference< XAxis > xAxis( ObjectIdentifier::getAxisForCID( m_aObjectCID, xChartModel ) );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aObjectCID, xChartModel );
if( xAxis.is() )
{
//no scale page for series axis
@@ -165,7 +173,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
//is the crossing main axis a category axes?:
rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( xAxis, xDiagram ) );
- uno::Reference< XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( xAxis, xCooSys ) );
+ rtl::Reference< Axis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( xAxis, xCooSys ) );
if( xCrossingMainAxis.is() )
{
ScaleData aScale( xCrossingMainAxis->getScaleData() );
@@ -184,10 +192,10 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
{
xChartType = AxisHelper::getFirstChartTypeWithSeriesAttachedToAxisIndex( xDiagram, nAxisIndex );
//show positioning controls only if they make sense
- m_bSupportingAxisPositioning = ChartTypeHelper::isSupportingAxisPositioning( xChartType, nDimensionCount, nDimensionIndex );
+ m_bSupportingAxisPositioning = xChartType->isSupportingAxisPositioning(nDimensionCount, nDimensionIndex);
//show axis origin only for secondary y axis
- if( nDimensionIndex==1 && nAxisIndex==1 && ChartTypeHelper::isSupportingBaseValue( xChartType ) )
+ if( nDimensionIndex==1 && nAxisIndex==1 && xChartType->isSupportingBaseValue())
m_bShowAxisOrigin = true;
if ( nDimensionIndex == 0 && ( aData.AxisType == chart2::AxisType::CATEGORY || aData.AxisType == chart2::AxisType::DATE ) )
@@ -199,7 +207,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
}
if (!m_bComplexCategoriesAxis)
- m_bSupportingCategoryPositioning = ChartTypeHelper::isSupportingCategoryPositioning( xChartType, nDimensionCount );
+ m_bSupportingCategoryPositioning = xChartType->isSupportingCategoryPositioning(nDimensionCount);
}
}
}
@@ -211,14 +219,12 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
if( m_eObjectType == OBJECTTYPE_DATA_CURVE )
{
- uno::Reference< data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
- Sequence< Reference< data::XLabeledDataSequence > > aDataSeqs( xSource->getDataSequences());
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aDataSeqs( xSeries->getDataSequences2());
Sequence< double > aXValues, aYValues;
bool bXValuesFound = false, bYValuesFound = false;
m_nNbPoints = 0;
- sal_Int32 i = 0;
- for( i=0;
- ! (bXValuesFound && bYValuesFound) && i<aDataSeqs.getLength();
+ for( std::size_t i=0;
+ ! (bXValuesFound && bYValuesFound) && i<aDataSeqs.size();
++i )
{
try
@@ -226,7 +232,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
Reference< data::XDataSequence > xSeq( aDataSeqs[i]->getValues());
Reference< XPropertySet > xProp( xSeq, uno::UNO_QUERY_THROW );
OUString aRole;
- if( xProp->getPropertyValue( "Role" ) >>= aRole )
+ if( xProp->getPropertyValue( u"Role"_ustr ) >>= aRole )
{
if( !bXValuesFound && aRole == "values-x" )
{
@@ -251,7 +257,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
//first category (index 0) matches with real number 1.0
aXValues.realloc( aYValues.getLength() );
auto pXValues = aXValues.getArray();
- for( i=0; i<aXValues.getLength(); ++i )
+ for( sal_Int32 i=0; i<aXValues.getLength(); ++i )
pXValues[i] = i+1;
bXValuesFound = true;
}
@@ -309,10 +315,10 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM
const sal_uInt16 nNoArrowNoShadowDlg = 1101;
void SchAttribTabDlg::setSymbolInformation( SfxItemSet&& rSymbolShapeProperties,
- std::unique_ptr<Graphic> pAutoSymbolGraphic )
+ std::optional<Graphic> oAutoSymbolGraphic )
{
m_oSymbolShapeProperties.emplace(std::move(rSymbolShapeProperties));
- m_pAutoSymbolGraphic = std::move(pAutoSymbolGraphic);
+ m_oAutoSymbolGraphic = std::move(oAutoSymbolGraphic);
}
void SchAttribTabDlg::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth )
@@ -325,7 +331,7 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
const ObjectPropertiesDialogParameter* pDialogParameter,
const ViewElementListProvider* pViewElementListProvider,
const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier)
- : SfxTabDialogController(pParent, "modules/schart/ui/attributedialog.ui", "AttributeDialog", pAttr)
+ : SfxTabDialogController(pParent, u"modules/schart/ui/attributedialog.ui"_ustr, u"AttributeDialog"_ustr, pAttr)
, m_pParameter( pDialogParameter )
, m_pViewElementListProvider( pViewElementListProvider )
, m_pNumberFormatter(nullptr)
@@ -337,58 +343,61 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
m_xDialog->set_title(pDialogParameter->getLocalizedName());
- switch (pDialogParameter->getObjectType())
+ ObjectType eType = pDialogParameter->getObjectType();
+ switch (eType)
{
case OBJECTTYPE_TITLE:
- AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
- AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
- AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
- AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
- AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
- AddTabPage("alignment", SchResId(STR_PAGE_ALIGNMENT), SchAlignmentTabPage::Create);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+ AddTabPage(u"area"_ustr, SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+ AddTabPage(u"transparent"_ustr, SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
+ AddTabPage(u"fontname"_ustr, SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
+ AddTabPage(u"effects"_ustr, SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
+ AddTabPage(u"alignment"_ustr, SchResId(STR_PAGE_ALIGNMENT), SchAlignmentTabPage::Create);
if( SvtCJKOptions::IsAsianTypographyEnabled() )
- AddTabPage("asian", SchResId(STR_PAGE_ASIAN), RID_SVXPAGE_PARA_ASIAN);
+ AddTabPage(u"asian"_ustr, SchResId(STR_PAGE_ASIAN), RID_SVXPAGE_PARA_ASIAN);
break;
case OBJECTTYPE_LEGEND:
- AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
- AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
- AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
- AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
- AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
- AddTabPage("legendpos", SchResId(STR_PAGE_POSITION), SchLegendPosTabPage::Create);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+ AddTabPage(u"area"_ustr, SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+ AddTabPage(u"transparent"_ustr, SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
+ AddTabPage(u"colorpalette"_ustr, SchResId(STR_PAGE_COLOR_PALETTE), ChartColorPaletteTabPage::Create);
+ AddTabPage(u"fontname"_ustr, SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
+ AddTabPage(u"effects"_ustr, SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
+ AddTabPage(u"legendpos"_ustr, SchResId(STR_PAGE_POSITION), SchLegendPosTabPage::Create);
if (SvtCJKOptions::IsAsianTypographyEnabled())
- AddTabPage("asian", SchResId(STR_PAGE_ASIAN), RID_SVXPAGE_PARA_ASIAN);
+ AddTabPage(u"asian"_ustr, SchResId(STR_PAGE_ASIAN), RID_SVXPAGE_PARA_ASIAN);
break;
case OBJECTTYPE_DATA_SERIES:
case OBJECTTYPE_DATA_POINT:
if( m_pParameter->ProvidesSecondaryYAxis() || m_pParameter->ProvidesOverlapAndGapWidth() || m_pParameter->ProvidesMissingValueTreatments() )
- AddTabPage("options", SchResId(STR_PAGE_OPTIONS),SchOptionTabPage::Create);
+ AddTabPage(u"options"_ustr, SchResId(STR_PAGE_OPTIONS),SchOptionTabPage::Create);
if( m_pParameter->ProvidesStartingAngle())
- AddTabPage("polaroptions", SchResId(STR_PAGE_OPTIONS), PolarOptionsTabPage::Create);
+ AddTabPage(u"polaroptions"_ustr, SchResId(STR_PAGE_OPTIONS), PolarOptionsTabPage::Create);
if (m_pParameter->IsPieChartDataPoint())
- AddTabPage("datapointoption", SchResId(STR_PAGE_OPTIONS), DataPointOptionTabPage::Create);
+ AddTabPage(u"datapointoption"_ustr, SchResId(STR_PAGE_OPTIONS), DataPointOptionTabPage::Create);
if( m_pParameter->HasGeometryProperties() )
- AddTabPage("layout", SchResId(STR_PAGE_LAYOUT), SchLayoutTabPage::Create);
+ AddTabPage(u"layout"_ustr, SchResId(STR_PAGE_LAYOUT), SchLayoutTabPage::Create);
if(m_pParameter->HasAreaProperties())
{
- AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
- AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
+ AddTabPage(u"area"_ustr, SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+ AddTabPage(u"transparent"_ustr, SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
}
- AddTabPage("border", SchResId( m_pParameter->HasAreaProperties() ? STR_PAGE_BORDER : STR_PAGE_LINE ), RID_SVXPAGE_LINE);
+ AddTabPage(u"border"_ustr, SchResId( m_pParameter->HasAreaProperties() ? STR_PAGE_BORDER : STR_PAGE_LINE ), RID_SVXPAGE_LINE);
+ AddTabPage(u"colorpalette"_ustr, SchResId(STR_PAGE_COLOR_PALETTE), ChartColorPaletteTabPage::Create);
break;
case OBJECTTYPE_DATA_LABEL:
case OBJECTTYPE_DATA_LABELS:
- AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
- AddTabPage("datalabels", SchResId(STR_OBJECT_DATALABELS), DataLabelsTabPage::Create);
- AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
- AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+ AddTabPage(u"datalabels"_ustr, SchResId(STR_OBJECT_DATALABELS), DataLabelsTabPage::Create);
+ AddTabPage(u"fontname"_ustr, SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
+ AddTabPage(u"effects"_ustr, SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
if( SvtCJKOptions::IsAsianTypographyEnabled() )
- AddTabPage("asian", SchResId(STR_PAGE_ASIAN), RID_SVXPAGE_PARA_ASIAN);
+ AddTabPage(u"asian"_ustr, SchResId(STR_PAGE_ASIAN), RID_SVXPAGE_PARA_ASIAN);
break;
@@ -396,29 +405,29 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
{
if( m_pParameter->HasScaleProperties() )
{
- AddTabPage("scale", SchResId(STR_PAGE_SCALE), ScaleTabPage::Create);
+ AddTabPage(u"scale"_ustr, SchResId(STR_PAGE_SCALE), ScaleTabPage::Create);
//no positioning page for z axes so far as the tickmarks are not shown so far
- AddTabPage("axispos", SchResId(STR_PAGE_POSITIONING), AxisPositionsTabPage::Create);
+ AddTabPage(u"axispos"_ustr, SchResId(STR_PAGE_POSITIONING), AxisPositionsTabPage::Create);
}
- AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
- AddTabPage("axislabel", SchResId(STR_OBJECT_LABEL), SchAxisLabelTabPage::Create);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
+ AddTabPage(u"axislabel"_ustr, SchResId(STR_OBJECT_LABEL), SchAxisLabelTabPage::Create);
if( m_pParameter->HasNumberProperties() )
- AddTabPage("numberformat", SchResId(STR_PAGE_NUMBERS), RID_SVXPAGE_NUMBERFORMAT);
- AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
- AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
+ AddTabPage(u"numberformat"_ustr, SchResId(STR_PAGE_NUMBERS), RID_SVXPAGE_NUMBERFORMAT);
+ AddTabPage(u"fontname"_ustr, SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
+ AddTabPage(u"effects"_ustr, SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
if( SvtCJKOptions::IsAsianTypographyEnabled() )
- AddTabPage("asian", SchResId(STR_PAGE_ASIAN), RID_SVXPAGE_PARA_ASIAN);
+ AddTabPage(u"asian"_ustr, SchResId(STR_PAGE_ASIAN), RID_SVXPAGE_PARA_ASIAN);
break;
}
case OBJECTTYPE_DATA_ERRORS_X:
- AddTabPage("xerrorbar", SchResId(STR_PAGE_XERROR_BARS), ErrorBarsTabPage::Create);
- AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
+ AddTabPage(u"xerrorbar"_ustr, SchResId(STR_PAGE_XERROR_BARS), ErrorBarsTabPage::Create);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
break;
case OBJECTTYPE_DATA_ERRORS_Y:
- AddTabPage("yerrorbar", SchResId(STR_PAGE_YERROR_BARS), ErrorBarsTabPage::Create);
- AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
+ AddTabPage(u"yerrorbar"_ustr, SchResId(STR_PAGE_YERROR_BARS), ErrorBarsTabPage::Create);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
break;
case OBJECTTYPE_DATA_ERRORS_Z:
@@ -428,12 +437,12 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
case OBJECTTYPE_SUBGRID:
case OBJECTTYPE_DATA_AVERAGE_LINE:
case OBJECTTYPE_DATA_STOCK_RANGE:
- AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
break;
case OBJECTTYPE_DATA_CURVE:
- AddTabPage("trendline", SchResId(STR_PAGE_TRENDLINE_TYPE), TrendlineTabPage::Create);
- AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
+ AddTabPage(u"trendline"_ustr, SchResId(STR_PAGE_TRENDLINE_TYPE), TrendlineTabPage::Create);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
break;
case OBJECTTYPE_DATA_STOCK_LOSS:
@@ -442,9 +451,11 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
case OBJECTTYPE_DIAGRAM_FLOOR:
case OBJECTTYPE_DIAGRAM_WALL:
case OBJECTTYPE_DIAGRAM:
- AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
- AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
- AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+ AddTabPage(u"area"_ustr, SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+ AddTabPage(u"transparent"_ustr, SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
+ if (eType != OBJECTTYPE_DATA_STOCK_LOSS && eType != OBJECTTYPE_DATA_STOCK_GAIN)
+ AddTabPage(u"colorpalette"_ustr, SchResId(STR_PAGE_COLOR_PALETTE), ChartColorPaletteTabPage::Create);
break;
case OBJECTTYPE_LEGEND_ENTRY:
@@ -452,19 +463,26 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
case OBJECTTYPE_UNKNOWN:
// nothing
break;
+ case OBJECTTYPE_DATA_TABLE:
+ AddTabPage(u"datatable"_ustr, SchResId(STR_DATA_TABLE), DataTableTabPage::Create);
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
+ AddTabPage(u"area"_ustr, SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+ AddTabPage(u"fontname"_ustr, SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
+ AddTabPage(u"effects"_ustr, SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
+ break;
case OBJECTTYPE_DATA_CURVE_EQUATION:
- AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
- AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
- AddTabPage("transparent", SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
- AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
- AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
- AddTabPage("numberformat", SchResId(STR_PAGE_NUMBERS), RID_SVXPAGE_NUMBERFORMAT);
- if (SvtCTLOptions().IsCTLFontEnabled())
+ AddTabPage(u"border"_ustr, SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE);
+ AddTabPage(u"area"_ustr, SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA);
+ AddTabPage(u"transparent"_ustr, SchResId(STR_PAGE_TRANSPARENCY), RID_SVXPAGE_TRANSPARENCE);
+ AddTabPage(u"fontname"_ustr, SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
+ AddTabPage(u"effects"_ustr, SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
+ AddTabPage(u"numberformat"_ustr, SchResId(STR_PAGE_NUMBERS), RID_SVXPAGE_NUMBERFORMAT);
+ if (SvtCTLOptions::IsCTLFontEnabled())
{
/* When rotation is supported for equation text boxes, use
SchAlignmentTabPage::Create here. The special
SchAlignmentTabPage::CreateWithoutRotation can be deleted. */
- AddTabPage("alignment", SchResId(STR_PAGE_ALIGNMENT), SchAlignmentTabPage::CreateWithoutRotation);
+ AddTabPage(u"alignment"_ustr, SchResId(STR_PAGE_ALIGNMENT), SchAlignmentTabPage::CreateWithoutRotation);
}
break;
default:
@@ -481,7 +499,7 @@ SchAttribTabDlg::~SchAttribTabDlg()
{
}
-void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
+void SchAttribTabDlg::PageCreated(const OUString& rId, SfxTabPage &rPage)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
if (rId == "border")
@@ -497,8 +515,8 @@ void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
aSet.Put(OfaPtrItem(SID_OBJECT_LIST,m_pViewElementListProvider->GetSymbolList()));
if( m_oSymbolShapeProperties )
aSet.Put(SfxTabDialogItem(SID_ATTR_SET, *m_oSymbolShapeProperties));
- if( m_pAutoSymbolGraphic )
- aSet.Put(SvxGraphicItem(*m_pAutoSymbolGraphic));
+ if( m_oAutoSymbolGraphic )
+ aSet.Put(SvxGraphicItem(*m_oAutoSymbolGraphic));
}
rPage.PageCreated(aSet);
}
@@ -568,7 +586,7 @@ void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
}
else if (rId == "numberformat")
{
- aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)));
+ aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, SID_ATTR_NUMBERFORMAT_INFO));
rPage.PageCreated(aSet);
}
else if (rId == "xerrorbar")
@@ -609,6 +627,14 @@ void SchAttribTabDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
pTrendlineTabPage->SetNbPoints( m_pParameter->getNbPoints() );
}
}
+ else if (rId == "colorpalette")
+ {
+ auto* pColorPaletteTabPage = dynamic_cast<ChartColorPaletteTabPage*>( &rPage );
+ if (pColorPaletteTabPage)
+ {
+ pColorPaletteTabPage->init(m_pParameter->getDocument());
+ }
+ }
}
IMPL_LINK(SchAttribTabDlg, OKPressed, weld::Button&, rButton, void)
diff --git a/chart2/source/controller/dialogs/dlg_ShapeFont.cxx b/chart2/source/controller/dialogs/dlg_ShapeFont.cxx
index f5fc702a2a76..4f4efb96085d 100644
--- a/chart2/source/controller/dialogs/dlg_ShapeFont.cxx
+++ b/chart2/source/controller/dialogs/dlg_ShapeFont.cxx
@@ -33,15 +33,15 @@ namespace chart
ShapeFontDialog::ShapeFontDialog(weld::Window* pParent, const SfxItemSet* pAttr,
const ViewElementListProvider* pViewElementListProvider)
- : SfxTabDialogController(pParent, "modules/schart/ui/chardialog.ui", "CharDialog", pAttr)
+ : SfxTabDialogController(pParent, u"modules/schart/ui/chardialog.ui"_ustr, u"CharDialog"_ustr, pAttr)
, m_pViewElementListProvider(pViewElementListProvider)
{
- AddTabPage("font", RID_SVXPAGE_CHAR_NAME);
- AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS);
- AddTabPage("position", RID_SVXPAGE_CHAR_POSITION );
+ AddTabPage(u"font"_ustr, RID_SVXPAGE_CHAR_NAME);
+ AddTabPage(u"fonteffects"_ustr, RID_SVXPAGE_CHAR_EFFECTS);
+ AddTabPage(u"position"_ustr, RID_SVXPAGE_CHAR_POSITION );
}
-void ShapeFontDialog::PageCreated(const OString& rId, SfxTabPage& rPage)
+void ShapeFontDialog::PageCreated(const OUString& rId, SfxTabPage& rPage)
{
SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
if (rId == "font")
diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
index e5b422ceaf16..9af94eef04d0 100644
--- a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
+++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
@@ -32,22 +32,22 @@ namespace chart
ShapeParagraphDialog::ShapeParagraphDialog(weld::Window* pParent,
const SfxItemSet* pAttr)
- : SfxTabDialogController(pParent, "modules/schart/ui/paradialog.ui", "ParagraphDialog", pAttr)
+ : SfxTabDialogController(pParent, u"modules/schart/ui/paradialog.ui"_ustr, u"ParagraphDialog"_ustr, pAttr)
{
- AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH);
- AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH );
+ AddTabPage(u"labelTP_PARA_STD"_ustr, RID_SVXPAGE_STD_PARAGRAPH);
+ AddTabPage(u"labelTP_PARA_ALIGN"_ustr, RID_SVXPAGE_ALIGN_PARAGRAPH );
if (SvtCJKOptions::IsAsianTypographyEnabled())
{
- AddTabPage("labelTP_PARA_ASIAN", RID_SVXPAGE_PARA_ASIAN);
+ AddTabPage(u"labelTP_PARA_ASIAN"_ustr, RID_SVXPAGE_PARA_ASIAN);
}
else
{
- RemoveTabPage("labelTP_PARA_ASIAN");
+ RemoveTabPage(u"labelTP_PARA_ASIAN"_ustr);
}
- AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
+ AddTabPage(u"labelTP_TABULATOR"_ustr, RID_SVXPAGE_TABULATOR);
}
-void ShapeParagraphDialog::PageCreated(const OString& rId, SfxTabPage& rPage)
+void ShapeParagraphDialog::PageCreated(const OUString& rId, SfxTabPage& rPage)
{
if (rId == "labelTP_TABULATOR")
{
diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx
index 09fc4923bdd9..e8f41a7ff39e 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.cxx
+++ b/chart2/source/controller/dialogs/dlg_View3D.cxx
@@ -23,36 +23,31 @@
#include "tp_3D_SceneGeometry.hxx"
#include "tp_3D_SceneAppearance.hxx"
#include "tp_3D_SceneIllumination.hxx"
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
#include <Diagram.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
-#include <com/sun/star/frame/XModel.hpp>
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
sal_uInt16 View3DDialog::m_nLastPageId = 0;
View3DDialog::View3DDialog(weld::Window* pParent, const rtl::Reference<::chart::ChartModel> & xChartModel)
- : GenericDialogController(pParent, "modules/schart/ui/3dviewdialog.ui", "3DViewDialog")
+ : GenericDialogController(pParent, u"modules/schart/ui/3dviewdialog.ui"_ustr, u"3DViewDialog"_ustr)
, m_aControllerLocker(xChartModel)
- , m_xTabControl(m_xBuilder->weld_notebook("tabcontrol"))
+ , m_xTabControl(m_xBuilder->weld_notebook(u"tabcontrol"_ustr))
{
- rtl::Reference< Diagram > xSceneProperties = ChartModelHelper::findDiagram( xChartModel );
+ rtl::Reference< Diagram > xSceneProperties = xChartModel->getFirstChartDiagram();
- m_xTabControl->append_page("geometry", SchResId(STR_PAGE_PERSPECTIVE));
- m_xGeometry.reset(new ThreeD_SceneGeometry_TabPage(m_xTabControl->get_page("geometry"), xSceneProperties, m_aControllerLocker));
+ m_xTabControl->append_page(u"geometry"_ustr, SchResId(STR_PAGE_PERSPECTIVE));
+ m_xGeometry.reset(new ThreeD_SceneGeometry_TabPage(m_xTabControl->get_page(u"geometry"_ustr), xSceneProperties, m_aControllerLocker));
- m_xTabControl->append_page("appearance", SchResId(STR_PAGE_APPEARANCE));
- m_xAppearance.reset(new ThreeD_SceneAppearance_TabPage(m_xTabControl->get_page("appearance"), xChartModel, m_aControllerLocker));
+ m_xTabControl->append_page(u"appearance"_ustr, SchResId(STR_PAGE_APPEARANCE));
+ m_xAppearance.reset(new ThreeD_SceneAppearance_TabPage(m_xTabControl->get_page(u"appearance"_ustr), xChartModel, m_aControllerLocker));
- m_xTabControl->append_page("illumination", SchResId(STR_PAGE_ILLUMINATION));
- m_xIllumination.reset(new ThreeD_SceneIllumination_TabPage(m_xTabControl->get_page("illumination"), m_xDialog.get(),
+ m_xTabControl->append_page(u"illumination"_ustr, SchResId(STR_PAGE_ILLUMINATION));
+ m_xIllumination.reset(new ThreeD_SceneIllumination_TabPage(m_xTabControl->get_page(u"illumination"_ustr), m_xDialog.get(),
xSceneProperties, xChartModel));
m_xTabControl->connect_enter_page(LINK(this, View3DDialog, ActivatePageHdl));
@@ -60,7 +55,7 @@ View3DDialog::View3DDialog(weld::Window* pParent, const rtl::Reference<::chart::
m_xTabControl->set_current_page(m_nLastPageId);
}
-IMPL_LINK(View3DDialog, ActivatePageHdl, const OString&, rPage, void)
+IMPL_LINK(View3DDialog, ActivatePageHdl, const OUString&, rPage, void)
{
if (rPage == "appearance")
m_xAppearance->ActivatePage();
diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx
index 182d391aac33..927906b06915 100644
--- a/chart2/source/controller/dialogs/res_BarGeometry.cxx
+++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx
@@ -24,18 +24,17 @@
namespace chart
{
BarGeometryResources::BarGeometryResources(weld::Builder* pBuilder)
- : m_xFT_Geometry(pBuilder->weld_label("shapeft"))
- , m_xLB_Geometry(pBuilder->weld_tree_view("shape"))
+ : m_xFT_Geometry(pBuilder->weld_label(u"shapeft"_ustr))
+ , m_xLB_Geometry(pBuilder->weld_tree_view(u"shape"_ustr))
{
- for (size_t i = 0; i < SAL_N_ELEMENTS(CHART_TYPE); ++i)
+ for (size_t i = 0; i < std::size(CHART_TYPE); ++i)
m_xLB_Geometry->append_text(SchResId(CHART_TYPE[i]));
- m_xLB_Geometry->set_size_request(-1,
- m_xLB_Geometry->get_height_rows(SAL_N_ELEMENTS(CHART_TYPE)));
+ m_xLB_Geometry->set_size_request(-1, m_xLB_Geometry->get_height_rows(std::size(CHART_TYPE)));
}
void BarGeometryResources::connect_changed(const Link<weld::TreeView&, void>& rLink)
{
- m_xLB_Geometry->connect_changed(rLink);
+ m_xLB_Geometry->connect_selection_changed(rLink);
}
void BarGeometryResources::set_visible(bool bShow)
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 6bba918d6937..98db10ff1873 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -46,41 +46,36 @@ namespace
const std::u16string_view our_aLBEntryMap[] = {u" ", u", ", u"; ", u"\n", u". "};
-bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, sal_uInt16 nValueWhich, sal_uInt16 nSourceFormatWhich, sal_uInt32& rnFormatKeyOut, bool& rbSourceFormatOut, bool& rbSourceFormatMixedStateOut )
+bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, TypedWhichId<SfxUInt32Item> nValueWhich, TypedWhichId<SfxBoolItem> nSourceFormatWhich, sal_uInt32& rnFormatKeyOut, bool& rbSourceFormatOut, bool& rbSourceFormatMixedStateOut )
{
bool bSet = false;
- const SfxPoolItem *pItem1 = nullptr;
- if( rSet.GetItemState( nValueWhich, true, &pItem1 ) == SfxItemState::SET )
+ if( const SfxUInt32Item* pNumItem = rSet.GetItemIfSet( nValueWhich ) )
{
- const SfxUInt32Item * pNumItem = dynamic_cast< const SfxUInt32Item * >( pItem1 );
- if( pNumItem )
- {
- rnFormatKeyOut = pNumItem->GetValue();
- bSet = true;
- }
+ rnFormatKeyOut = pNumItem->GetValue();
+ bSet = true;
}
rbSourceFormatMixedStateOut=true;
- const SfxPoolItem *pItem2 = nullptr;
- if( rSet.GetItemState( nSourceFormatWhich, true, &pItem2 ) == SfxItemState::SET )
+ if( const SfxBoolItem * pBoolItem = rSet.GetItemIfSet( nSourceFormatWhich ) )
{
- const SfxBoolItem * pBoolItem = dynamic_cast< const SfxBoolItem * >( pItem2 );
- if( pBoolItem )
- {
- rbSourceFormatOut = pBoolItem->GetValue();
- rbSourceFormatMixedStateOut=false;
- }
+ rbSourceFormatOut = pBoolItem->GetValue();
+ rbSourceFormatMixedStateOut=false;
}
return bSet;
}
-void lcl_setBoolItemToCheckBox(const SfxItemSet& rInAttrs, sal_uInt16 nWhichId, weld::CheckButton& rCheckbox)
+void lcl_setBoolItemToCheckBox(const SfxItemSet& rInAttrs, TypedWhichId<SfxBoolItem> nWhichId, weld::CheckButton& rCheckbox, weld::TriStateEnabled& rTriState)
{
- const SfxPoolItem *pPoolItem = nullptr;
- if( rInAttrs.GetItemState(nWhichId, true, &pPoolItem) == SfxItemState::SET )
- rCheckbox.set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ if( const SfxBoolItem* pPoolItem = rInAttrs.GetItemIfSet(nWhichId) )
+ {
+ rCheckbox.set_active(pPoolItem->GetValue());
+ rTriState.bTriStateEnabled = false;
+ }
else
+ {
rCheckbox.set_state(TRISTATE_INDET);
+ rTriState.bTriStateEnabled = true;
+ }
}
}//end anonymous namespace
@@ -97,25 +92,25 @@ DataLabelResources::DataLabelResources(weld::Builder* pBuilder, weld::Window* pP
, m_bSourceFormatForPercent(true)
, m_pWindow(pParent)
, m_pPool(rInAttrs.GetPool())
- , m_xCBNumber(pBuilder->weld_check_button("CB_VALUE_AS_NUMBER"))
- , m_xPB_NumberFormatForValue(pBuilder->weld_button("PB_NUMBERFORMAT"))
- , m_xCBPercent(pBuilder->weld_check_button("CB_VALUE_AS_PERCENTAGE"))
- , m_xPB_NumberFormatForPercent(pBuilder->weld_button("PB_PERCENT_NUMBERFORMAT"))
- , m_xFT_NumberFormatForPercent(pBuilder->weld_label("STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE"))
- , m_xCBCategory(pBuilder->weld_check_button("CB_CATEGORY"))
- , m_xCBSymbol(pBuilder->weld_check_button("CB_SYMBOL"))
- , m_xCBDataSeries(pBuilder->weld_check_button("CB_DATA_SERIES_NAME"))
- , m_xCBWrapText(pBuilder->weld_check_button("CB_WRAP_TEXT"))
- , m_xLB_Separator(pBuilder->weld_combo_box("LB_TEXT_SEPARATOR"))
- , m_xLB_LabelPlacement(pBuilder->weld_combo_box("LB_LABEL_PLACEMENT"))
- , m_xBxOrientation(pBuilder->weld_widget("boxORIENTATION"))
- , m_xFT_Dial(pBuilder->weld_label("CT_LABEL_DIAL"))
- , m_xNF_Degrees(pBuilder->weld_metric_spin_button("NF_LABEL_DEGREES", FieldUnit::DEGREE))
- , m_xBxTextDirection(pBuilder->weld_widget("boxTXT_DIRECTION"))
- , m_xLB_TextDirection(new TextDirectionListBox(pBuilder->weld_combo_box("LB_LABEL_TEXTDIR")))
+ , m_xCBNumber(pBuilder->weld_check_button(u"CB_VALUE_AS_NUMBER"_ustr))
+ , m_xPB_NumberFormatForValue(pBuilder->weld_button(u"PB_NUMBERFORMAT"_ustr))
+ , m_xCBPercent(pBuilder->weld_check_button(u"CB_VALUE_AS_PERCENTAGE"_ustr))
+ , m_xPB_NumberFormatForPercent(pBuilder->weld_button(u"PB_PERCENT_NUMBERFORMAT"_ustr))
+ , m_xFT_NumberFormatForPercent(pBuilder->weld_label(u"STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE"_ustr))
+ , m_xCBCategory(pBuilder->weld_check_button(u"CB_CATEGORY"_ustr))
+ , m_xCBSymbol(pBuilder->weld_check_button(u"CB_SYMBOL"_ustr))
+ , m_xCBDataSeries(pBuilder->weld_check_button(u"CB_DATA_SERIES_NAME"_ustr))
+ , m_xCBWrapText(pBuilder->weld_check_button(u"CB_WRAP_TEXT"_ustr))
+ , m_xLB_Separator(pBuilder->weld_combo_box(u"LB_TEXT_SEPARATOR"_ustr))
+ , m_xLB_LabelPlacement(pBuilder->weld_combo_box(u"LB_LABEL_PLACEMENT"_ustr))
+ , m_xBxOrientation(pBuilder->weld_widget(u"boxORIENTATION"_ustr))
+ , m_xFT_Dial(pBuilder->weld_label(u"CT_LABEL_DIAL"_ustr))
+ , m_xNF_Degrees(pBuilder->weld_metric_spin_button(u"NF_LABEL_DEGREES"_ustr, FieldUnit::DEGREE))
+ , m_xBxTextDirection(pBuilder->weld_widget(u"boxTXT_DIRECTION"_ustr))
+ , m_aLB_TextDirection(pBuilder->weld_combo_box(u"LB_LABEL_TEXTDIR"_ustr))
, m_xDC_Dial(new svx::DialControl)
- , m_xDC_DialWin(new weld::CustomWeld(*pBuilder, "CT_DIAL", *m_xDC_Dial))
- , m_xCBCustomLeaderLines(pBuilder->weld_check_button("CB_CUSTOM_LEADER_LINES"))
+ , m_xDC_DialWin(new weld::CustomWeld(*pBuilder, u"CT_DIAL"_ustr, *m_xDC_Dial))
+ , m_xCBCustomLeaderLines(pBuilder->weld_check_button(u"CB_CUSTOM_LEADER_LINES"_ustr))
{
m_xDC_Dial->SetText(m_xFT_Dial->get_label());
@@ -126,9 +121,8 @@ DataLabelResources::DataLabelResources(weld::Builder* pBuilder, weld::Window* pP
std::vector< sal_Int32 > aAvailablePlacementList;
- const SfxPoolItem *pPoolItem = nullptr;
- if( rInAttrs.GetItemState(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, true, &pPoolItem) == SfxItemState::SET )
- aAvailablePlacementList = static_cast<const SfxIntegerListItem*>(pPoolItem)->GetList();
+ if( const SfxIntegerListItem* pPlacementsItem = rInAttrs.GetItemIfSet(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS) )
+ aAvailablePlacementList = pPlacementsItem->GetList();
m_xLB_LabelPlacement->clear();
for( size_t nN=0; nN<aAvailablePlacementList.size(); ++nN )
@@ -154,9 +148,9 @@ DataLabelResources::DataLabelResources(weld::Builder* pBuilder, weld::Window* pP
m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
- if( rInAttrs.GetItemState(SCHATTR_DATADESCR_NO_PERCENTVALUE, true, &pPoolItem) == SfxItemState::SET )
+ if( const SfxBoolItem* pNoPercentValueItem = rInAttrs.GetItemIfSet(SCHATTR_DATADESCR_NO_PERCENTVALUE) )
{
- bool bForbidPercentValue = rInAttrs.Get( SCHATTR_DATADESCR_NO_PERCENTVALUE ).GetValue();
+ bool bForbidPercentValue = pNoPercentValueItem->GetValue();
if( bForbidPercentValue )
m_xCBPercent->set_sensitive(false);
}
@@ -182,12 +176,18 @@ IMPL_LINK(DataLabelResources, NumberFormatDialogHdl, weld::Button&, rButton, voi
}
if (&rButton == m_xPB_NumberFormatForValue.get() && !m_xCBNumber->get_active())
+ {
m_xCBNumber->set_active(true);
+ m_aNumberState.bTriStateEnabled = false;
+ }
else if (&rButton == m_xPB_NumberFormatForPercent.get() && !m_xCBPercent->get_active())
+ {
m_xCBPercent->set_active(true);
+ m_aPercentState.bTriStateEnabled = false;
+ }
SfxItemSet aNumberSet = NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( *m_pPool );
- aNumberSet.Put (SvxNumberInfoItem( m_pNumberFormatter, static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)));
+ aNumberSet.Put (SvxNumberInfoItem( m_pNumberFormatter, SID_ATTR_NUMBERFORMAT_INFO));
bool bPercent = (&rButton == m_xPB_NumberFormatForPercent.get());
@@ -221,8 +221,22 @@ IMPL_LINK(DataLabelResources, NumberFormatDialogHdl, weld::Button&, rButton, voi
}
}
-IMPL_LINK_NOARG(DataLabelResources, CheckHdl, weld::Toggleable&, void)
+IMPL_LINK(DataLabelResources, CheckHdl, weld::Toggleable&, rToggle, void)
{
+ if (&rToggle == m_xCBNumber.get())
+ m_aNumberState.ButtonToggled(rToggle);
+ else if (&rToggle == m_xCBPercent.get())
+ m_aPercentState.ButtonToggled(rToggle);
+ else if (&rToggle == m_xCBCategory.get())
+ m_aCategoryState.ButtonToggled(rToggle);
+ else if (&rToggle == m_xCBSymbol.get())
+ m_aSymbolState.ButtonToggled(rToggle);
+ else if (&rToggle == m_xCBDataSeries.get())
+ m_aDataSeriesState.ButtonToggled(rToggle);
+ else if (&rToggle == m_xCBWrapText.get())
+ m_aWrapTextState.ButtonToggled(rToggle);
+ else if (&rToggle == m_xCBCustomLeaderLines.get())
+ m_aCustomLeaderLinesState.ButtonToggled(rToggle);
EnableControls();
}
@@ -305,8 +319,8 @@ void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
rOutAttrs->Put( SfxInt32Item( SCHATTR_DATADESCR_PLACEMENT, nValue ) );
}
- if (m_xLB_TextDirection->get_active() != -1)
- rOutAttrs->Put( SvxFrameDirectionItem( m_xLB_TextDirection->get_active_id(), EE_PARA_WRITINGDIR ) );
+ if (m_aLB_TextDirection.get_active() != -1)
+ rOutAttrs->Put( SvxFrameDirectionItem( m_aLB_TextDirection.get_active_id(), EE_PARA_WRITINGDIR ) );
if( m_xDC_Dial->IsVisible() )
{
@@ -320,30 +334,29 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
// default state
m_xCBSymbol->set_sensitive( false );
- lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_NUMBER, *m_xCBNumber );
- lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, *m_xCBPercent );
- lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_CATEGORY, *m_xCBCategory );
- lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_SYMBOL, *m_xCBSymbol );
- lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME, *m_xCBDataSeries );
- lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_WRAP_TEXT, *m_xCBWrapText );
- lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_CUSTOM_LEADER_LINES, *m_xCBCustomLeaderLines );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_NUMBER, *m_xCBNumber, m_aNumberState );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, *m_xCBPercent, m_aPercentState );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_CATEGORY, *m_xCBCategory, m_aCategoryState );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_SYMBOL, *m_xCBSymbol, m_aSymbolState );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME, *m_xCBDataSeries, m_aDataSeriesState );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_WRAP_TEXT, *m_xCBWrapText, m_aWrapTextState );
+ lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_CUSTOM_LEADER_LINES, *m_xCBCustomLeaderLines, m_aCustomLeaderLinesState );
m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
- const SfxPoolItem *pPoolItem = nullptr;
- if( rInAttrs.GetItemState(SCHATTR_DATADESCR_SEPARATOR, true, &pPoolItem) == SfxItemState::SET )
- for(size_t i=0; i < SAL_N_ELEMENTS(our_aLBEntryMap); ++i )
+ if( const SfxStringItem* pSeparatorItem = rInAttrs.GetItemIfSet(SCHATTR_DATADESCR_SEPARATOR) )
+ for(size_t i=0; i < std::size(our_aLBEntryMap); ++i )
{
- if( our_aLBEntryMap[i] == static_cast<const SfxStringItem*>(pPoolItem)->GetValue())
+ if( our_aLBEntryMap[i] == pSeparatorItem->GetValue())
m_xLB_Separator->set_active( i );
}
else
m_xLB_Separator->set_active( 0 );
- if( rInAttrs.GetItemState(SCHATTR_DATADESCR_PLACEMENT, true, &pPoolItem) == SfxItemState::SET )
+ if( const SfxInt32Item* pPlacementItem = rInAttrs.GetItemIfSet(SCHATTR_DATADESCR_PLACEMENT) )
{
- sal_Int32 nPlacement = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ sal_Int32 nPlacement = pPlacementItem->GetValue();
std::map< sal_Int32, sal_uInt16 >::const_iterator aIt( m_aPlacementToListBoxMap.find(nPlacement) );
if(aIt!=m_aPlacementToListBoxMap.end())
{
@@ -356,12 +369,12 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
else
m_xLB_LabelPlacement->set_active(-1);
- if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET )
- m_xLB_TextDirection->set_active_id( static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue() );
+ if( const SvxFrameDirectionItem* pDirectionItem = rInAttrs.GetItemIfSet(EE_PARA_WRITINGDIR) )
+ m_aLB_TextDirection.set_active_id( pDirectionItem->GetValue() );
- if( rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SdrAngleItem* pAngleItem = rInAttrs.GetItemIfSet( SCHATTR_TEXT_DEGREES ) )
{
- Degree100 nDegrees = static_cast< const SdrAngleItem * >( pPoolItem )->GetValue();
+ Degree100 nDegrees = pAngleItem->GetValue();
m_xDC_Dial->SetRotation( nDegrees );
}
else
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx
index 56115b2a779c..66a062d2ca24 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -20,11 +20,11 @@
#include <svl/itemset.hxx>
#include <svx/dialcontrol.hxx>
+#include <TextDirectionListBox.hxx>
#include <map>
class SvNumberFormatter;
-namespace chart { class TextDirectionListBox; }
namespace chart
{
@@ -58,6 +58,14 @@ private:
weld::Window* m_pWindow;
SfxItemPool* m_pPool;
+ weld::TriStateEnabled m_aNumberState;
+ weld::TriStateEnabled m_aPercentState;
+ weld::TriStateEnabled m_aCategoryState;
+ weld::TriStateEnabled m_aSymbolState;
+ weld::TriStateEnabled m_aDataSeriesState;
+ weld::TriStateEnabled m_aWrapTextState;
+ weld::TriStateEnabled m_aCustomLeaderLinesState;
+
std::unique_ptr<weld::CheckButton> m_xCBNumber;
std::unique_ptr<weld::Button> m_xPB_NumberFormatForValue;
std::unique_ptr<weld::CheckButton> m_xCBPercent;
@@ -77,7 +85,7 @@ private:
std::unique_ptr<weld::Widget> m_xBxTextDirection;
- std::unique_ptr<TextDirectionListBox> m_xLB_TextDirection;
+ TextDirectionListBox m_aLB_TextDirection;
std::unique_ptr<svx::DialControl> m_xDC_Dial;
std::unique_ptr<weld::CustomWeld> m_xDC_DialWin;
diff --git a/chart2/source/controller/dialogs/res_DataTableProperties.cxx b/chart2/source/controller/dialogs/res_DataTableProperties.cxx
new file mode 100644
index 000000000000..493be52ea5bc
--- /dev/null
+++ b/chart2/source/controller/dialogs/res_DataTableProperties.cxx
@@ -0,0 +1,111 @@
+/* -*- 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 <res_DataTableProperties.hxx>
+
+#include <chartview/ChartSfxItemIds.hxx>
+#include <svl/eitem.hxx>
+
+using namespace css;
+
+namespace chart
+{
+DataTablePropertiesResources::DataTablePropertiesResources(weld::Builder& rBuilder)
+ : m_xCbHorizontalBorder(rBuilder.weld_check_button(u"horizontalBorderCB"_ustr))
+ , m_xCbVerticalBorder(rBuilder.weld_check_button(u"verticalBorderCB"_ustr))
+ , m_xCbOutilne(rBuilder.weld_check_button(u"outlineCB"_ustr))
+ , m_xCbKeys(rBuilder.weld_check_button(u"keysCB"_ustr))
+{
+}
+
+void DataTablePropertiesResources::setChecksSensitive(bool bSensitive)
+{
+ m_xCbHorizontalBorder->set_sensitive(bSensitive);
+ m_xCbVerticalBorder->set_sensitive(bSensitive);
+ m_xCbOutilne->set_sensitive(bSensitive);
+ m_xCbKeys->set_sensitive(bSensitive);
+}
+
+void DataTablePropertiesResources::initFromItemSet(const SfxItemSet& rInAttrs)
+{
+ const SfxPoolItem* pPoolItem = nullptr;
+ SfxItemState aState;
+
+ aState = rInAttrs.GetItemState(SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, false, &pPoolItem);
+ if (aState == SfxItemState::INVALID)
+ {
+ m_xCbHorizontalBorder->set_state(TRISTATE_INDET);
+ }
+ else
+ {
+ if (aState == SfxItemState::SET)
+ m_xCbHorizontalBorder->set_active(
+ static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ }
+
+ aState = rInAttrs.GetItemState(SCHATTR_DATA_TABLE_VERTICAL_BORDER, false, &pPoolItem);
+ if (aState == SfxItemState::INVALID)
+ {
+ m_xCbVerticalBorder->set_state(TRISTATE_INDET);
+ }
+ else
+ {
+ if (aState == SfxItemState::SET)
+ m_xCbVerticalBorder->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ }
+
+ aState = rInAttrs.GetItemState(SCHATTR_DATA_TABLE_OUTLINE, false, &pPoolItem);
+ if (aState == SfxItemState::INVALID)
+ {
+ m_xCbOutilne->set_state(TRISTATE_INDET);
+ }
+ else
+ {
+ if (aState == SfxItemState::SET)
+ m_xCbOutilne->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ }
+
+ aState = rInAttrs.GetItemState(SCHATTR_DATA_TABLE_KEYS, false, &pPoolItem);
+ if (aState == SfxItemState::INVALID)
+ {
+ m_xCbKeys->set_state(TRISTATE_INDET);
+ }
+ else
+ {
+ if (aState == SfxItemState::SET)
+ m_xCbKeys->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ }
+}
+
+bool DataTablePropertiesResources::writeToItemSet(SfxItemSet& rOutAttrs) const
+{
+ if (m_xCbHorizontalBorder->get_state() != TRISTATE_INDET)
+ {
+ rOutAttrs.Put(
+ SfxBoolItem(SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, m_xCbHorizontalBorder->get_active()));
+ }
+ if (m_xCbVerticalBorder->get_state() != TRISTATE_INDET)
+ {
+ rOutAttrs.Put(
+ SfxBoolItem(SCHATTR_DATA_TABLE_VERTICAL_BORDER, m_xCbVerticalBorder->get_active()));
+ }
+ if (m_xCbOutilne->get_state() != TRISTATE_INDET)
+ {
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_DATA_TABLE_OUTLINE, m_xCbOutilne->get_active()));
+ }
+ if (m_xCbKeys->get_state() != TRISTATE_INDET)
+ {
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_DATA_TABLE_KEYS, m_xCbKeys->get_active()));
+ }
+ return true;
+}
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index 1e5078a301fc..1e30311ae28b 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -22,12 +22,12 @@
#include <RangeSelectionHelper.hxx>
#include <helpids.h>
#include <chartview/ChartSfxItemIds.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <vcl/weld.hxx>
#include <ChartModel.hxx>
+#include "DialogModel.hxx"
#include <rtl/math.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <svl/stritem.hxx>
@@ -40,12 +40,6 @@ using namespace ::com::sun::star;
namespace
{
-void lcl_enableRangeChoosing(bool bEnable, weld::DialogController* pController)
-{
- weld::Window* pWeldDialog = pController->getDialog();
- pWeldDialog->set_modal(!bEnable);
- pWeldDialog->set_visible(!bEnable);
-}
sal_uInt16 lcl_getLbEntryPosByErrorKind( SvxChartKindError eErrorKind )
{
@@ -57,14 +51,12 @@ sal_uInt16 lcl_getLbEntryPosByErrorKind( SvxChartKindError eErrorKind )
case SvxChartKindError::Percent:
case SvxChartKindError::Const:
case SvxChartKindError::Range:
+ case SvxChartKindError::Sigma:
nResult = CHART_LB_FUNCTION_STD_DEV;
break;
case SvxChartKindError::Variant:
nResult = CHART_LB_FUNCTION_VARIANCE;
break;
- case SvxChartKindError::Sigma:
- nResult = CHART_LB_FUNCTION_STD_DEV;
- break;
case SvxChartKindError::BigError:
nResult = CHART_LB_FUNCTION_ERROR_MARGIN;
break;
@@ -97,31 +89,31 @@ ErrorBarResources::ErrorBarResources(weld::Builder* pParent, weld::DialogControl
, m_pCurrentRangeChoosingField( nullptr )
, m_bHasInternalDataProvider( true )
, m_bEnableDataTableDialog( true )
- , m_xRbNone(pParent->weld_radio_button("RB_NONE"))
- , m_xRbConst(pParent->weld_radio_button("RB_CONST"))
- , m_xRbPercent(pParent->weld_radio_button("RB_PERCENT"))
- , m_xRbFunction(pParent->weld_radio_button("RB_FUNCTION"))
- , m_xRbRange(pParent->weld_radio_button("RB_RANGE"))
- , m_xLbFunction(pParent->weld_combo_box("LB_FUNCTION"))
- , m_xFlParameters(pParent->weld_frame("framePARAMETERS"))
- , m_xBxPositive(pParent->weld_widget("boxPOSITIVE"))
- , m_xMfPositive(pParent->weld_metric_spin_button("MF_POSITIVE", FieldUnit::NONE))
- , m_xEdRangePositive(pParent->weld_entry("ED_RANGE_POSITIVE"))
- , m_xIbRangePositive(pParent->weld_button("IB_RANGE_POSITIVE"))
- , m_xBxNegative(pParent->weld_widget("boxNEGATIVE"))
- , m_xMfNegative(pParent->weld_metric_spin_button("MF_NEGATIVE", FieldUnit::NONE))
- , m_xEdRangeNegative(pParent->weld_entry("ED_RANGE_NEGATIVE"))
- , m_xIbRangeNegative(pParent->weld_button("IB_RANGE_NEGATIVE"))
- , m_xCbSyncPosNeg(pParent->weld_check_button("CB_SYN_POS_NEG"))
- , m_xRbBoth(pParent->weld_radio_button("RB_BOTH"))
- , m_xRbPositive(pParent->weld_radio_button("RB_POSITIVE"))
- , m_xRbNegative(pParent->weld_radio_button("RB_NEGATIVE"))
- , m_xFiBoth(pParent->weld_image("FI_BOTH"))
- , m_xFiPositive(pParent->weld_image("FI_POSITIVE"))
- , m_xFiNegative(pParent->weld_image("FI_NEGATIVE"))
- , m_xUIStringPos(pParent->weld_label("STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS"))
- , m_xUIStringNeg(pParent->weld_label("STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS"))
- , m_xUIStringRbRange(pParent->weld_label("STR_CONTROLTEXT_ERROR_BARS_FROM_DATA"))
+ , m_xRbNone(pParent->weld_radio_button(u"RB_NONE"_ustr))
+ , m_xRbConst(pParent->weld_radio_button(u"RB_CONST"_ustr))
+ , m_xRbPercent(pParent->weld_radio_button(u"RB_PERCENT"_ustr))
+ , m_xRbFunction(pParent->weld_radio_button(u"RB_FUNCTION"_ustr))
+ , m_xRbRange(pParent->weld_radio_button(u"RB_RANGE"_ustr))
+ , m_xLbFunction(pParent->weld_combo_box(u"LB_FUNCTION"_ustr))
+ , m_xFlParameters(pParent->weld_frame(u"framePARAMETERS"_ustr))
+ , m_xBxPositive(pParent->weld_widget(u"boxPOSITIVE"_ustr))
+ , m_xMfPositive(pParent->weld_metric_spin_button(u"MF_POSITIVE"_ustr, FieldUnit::NONE))
+ , m_xEdRangePositive(pParent->weld_entry(u"ED_RANGE_POSITIVE"_ustr))
+ , m_xIbRangePositive(pParent->weld_button(u"IB_RANGE_POSITIVE"_ustr))
+ , m_xBxNegative(pParent->weld_widget(u"boxNEGATIVE"_ustr))
+ , m_xMfNegative(pParent->weld_metric_spin_button(u"MF_NEGATIVE"_ustr, FieldUnit::NONE))
+ , m_xEdRangeNegative(pParent->weld_entry(u"ED_RANGE_NEGATIVE"_ustr))
+ , m_xIbRangeNegative(pParent->weld_button(u"IB_RANGE_NEGATIVE"_ustr))
+ , m_xCbSyncPosNeg(pParent->weld_check_button(u"CB_SYN_POS_NEG"_ustr))
+ , m_xRbBoth(pParent->weld_radio_button(u"RB_BOTH"_ustr))
+ , m_xRbPositive(pParent->weld_radio_button(u"RB_POSITIVE"_ustr))
+ , m_xRbNegative(pParent->weld_radio_button(u"RB_NEGATIVE"_ustr))
+ , m_xFiBoth(pParent->weld_image(u"FI_BOTH"_ustr))
+ , m_xFiPositive(pParent->weld_image(u"FI_POSITIVE"_ustr))
+ , m_xFiNegative(pParent->weld_image(u"FI_NEGATIVE"_ustr))
+ , m_xUIStringPos(pParent->weld_label(u"STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS"_ustr))
+ , m_xUIStringNeg(pParent->weld_label(u"STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS"_ustr))
+ , m_xUIStringRbRange(pParent->weld_label(u"STR_CONTROLTEXT_ERROR_BARS_FROM_DATA"_ustr))
{
if( bNoneAvailable )
m_xRbNone->connect_toggled(LINK(this, ErrorBarResources, CategoryChosen));
@@ -176,7 +168,7 @@ void ErrorBarResources::SetChartDocumentForRangeChoosing(
{
try
{
- xProps->getPropertyValue("EnableDataTableDialog") >>= m_bEnableDataTableDialog;
+ xProps->getPropertyValue(u"EnableDataTableDialog"_ustr) >>= m_bEnableDataTableDialog;
}
catch( const uno::Exception& )
{
@@ -448,7 +440,7 @@ IMPL_LINK(ErrorBarResources, ChooseRange, weld::Button&, rButton, void)
aUIString = m_xUIStringNeg->get_label();
}
- lcl_enableRangeChoosing(true, m_pController);
+ enableRangeChoosing(true, m_pController);
m_apRangeSelectionHelper->chooseRange(
m_pCurrentRangeChoosingField->get_text(),
aUIString, *this );
@@ -476,7 +468,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
// category
m_eErrorKind = SvxChartKindError::NONE;
SfxItemState aState = rInAttrs.GetItemState( SCHATTR_STAT_KIND_ERROR, true, &pPoolItem );
- m_bErrorKindUnique = ( aState != SfxItemState::DONTCARE );
+ m_bErrorKindUnique = ( aState != SfxItemState::INVALID );
if( aState == SfxItemState::SET )
m_eErrorKind = static_cast<const SvxChartKindErrorItem*>(pPoolItem)->GetValue();
@@ -516,16 +508,14 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
}
// parameters
- aState = rInAttrs.GetItemState( SCHATTR_STAT_CONSTPLUS, true, &pPoolItem );
- if( aState == SfxItemState::SET )
+ if( const SvxDoubleItem* pDoubleItem = rInAttrs.GetItemIfSet( SCHATTR_STAT_CONSTPLUS ) )
{
- m_fPlusValue = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue();
+ m_fPlusValue = pDoubleItem->GetValue();
}
- aState = rInAttrs.GetItemState( SCHATTR_STAT_CONSTMINUS, true, &pPoolItem );
- if( aState == SfxItemState::SET )
+ if( const SvxDoubleItem* pStatItem = rInAttrs.GetItemIfSet( SCHATTR_STAT_CONSTMINUS ) )
{
- m_fMinusValue = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue();
+ m_fMinusValue = pStatItem->GetValue();
if( m_eErrorKind != SvxChartKindError::Range &&
m_fPlusValue == m_fMinusValue )
@@ -534,7 +524,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
// indicator
aState = rInAttrs.GetItemState( SCHATTR_STAT_INDICATE, true, &pPoolItem );
- m_bIndicatorUnique = ( aState != SfxItemState::DONTCARE );
+ m_bIndicatorUnique = ( aState != SfxItemState::INVALID );
if( aState == SfxItemState::SET)
m_eIndicate = static_cast<const SvxChartIndicateItem *>(pPoolItem)->GetValue();
@@ -563,7 +553,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
// ranges
aState = rInAttrs.GetItemState( SCHATTR_STAT_RANGE_POS, true, &pPoolItem );
- m_bRangePosUnique = ( aState != SfxItemState::DONTCARE );
+ m_bRangePosUnique = ( aState != SfxItemState::INVALID );
if( aState == SfxItemState::SET )
{
OUString sRangePositive = static_cast< const SfxStringItem * >( pPoolItem )->GetValue();
@@ -571,7 +561,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
}
aState = rInAttrs.GetItemState( SCHATTR_STAT_RANGE_NEG, true, &pPoolItem );
- m_bRangeNegUnique = ( aState != SfxItemState::DONTCARE );
+ m_bRangeNegUnique = ( aState != SfxItemState::INVALID );
if( aState == SfxItemState::SET )
{
OUString sRangeNegative = static_cast< const SfxStringItem * >( pPoolItem )->GetValue();
@@ -687,7 +677,7 @@ void ErrorBarResources::listeningFinished(
m_pCurrentRangeChoosingField = nullptr;
UpdateControlStates();
- lcl_enableRangeChoosing(false, m_pController);
+ enableRangeChoosing(false, m_pController);
}
void ErrorBarResources::disposingRangeSelection()
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index aac0a11368a1..e1743886086a 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -18,7 +18,7 @@
*/
#include <res_LegendPosition.hxx>
-#include <ChartModelHelper.hxx>
+#include <Legend.hxx>
#include <LegendHelper.hxx>
#include <ChartModel.hxx>
#include <Diagram.hxx>
@@ -30,7 +30,8 @@
#include <chartview/ChartSfxItemIds.hxx>
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <utility>
#include <vcl/weld.hxx>
namespace chart
@@ -40,22 +41,22 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
LegendPositionResources::LegendPositionResources(weld::Builder& rBuilder)
- : m_xRbtLeft(rBuilder.weld_radio_button("left"))
- , m_xRbtRight(rBuilder.weld_radio_button("right"))
- , m_xRbtTop(rBuilder.weld_radio_button("top"))
- , m_xRbtBottom(rBuilder.weld_radio_button("bottom"))
+ : m_xRbtLeft(rBuilder.weld_radio_button(u"left"_ustr))
+ , m_xRbtRight(rBuilder.weld_radio_button(u"right"_ustr))
+ , m_xRbtTop(rBuilder.weld_radio_button(u"top"_ustr))
+ , m_xRbtBottom(rBuilder.weld_radio_button(u"bottom"_ustr))
{
impl_setRadioButtonToggleHdl();
}
LegendPositionResources::LegendPositionResources(weld::Builder& rBuilder,
- const uno::Reference< uno::XComponentContext >& xCC)
- : m_xCC(xCC)
- , m_xCbxShow(rBuilder.weld_check_button("show"))
- , m_xRbtLeft(rBuilder.weld_radio_button("left"))
- , m_xRbtRight(rBuilder.weld_radio_button("right"))
- , m_xRbtTop(rBuilder.weld_radio_button("top"))
- , m_xRbtBottom(rBuilder.weld_radio_button("bottom"))
+ uno::Reference< uno::XComponentContext > xCC)
+ : m_xCC(std::move(xCC))
+ , m_xCbxShow(rBuilder.weld_check_button(u"show"_ustr))
+ , m_xRbtLeft(rBuilder.weld_radio_button(u"left"_ustr))
+ , m_xRbtRight(rBuilder.weld_radio_button(u"right"_ustr))
+ , m_xRbtTop(rBuilder.weld_radio_button(u"top"_ustr))
+ , m_xRbtBottom(rBuilder.weld_radio_button(u"bottom"_ustr))
{
m_xCbxShow->connect_toggled( LINK( this, LegendPositionResources, PositionEnableHdl ) );
impl_setRadioButtonToggleHdl();
@@ -77,20 +78,20 @@ void LegendPositionResources::writeToResources( const rtl::Reference<::chart::Ch
{
try
{
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
- uno::Reference< beans::XPropertySet > xProp( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xProp.is() )
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
+ rtl::Reference< Legend > xLegend = xDiagram->getLegend2();
+ if( xLegend.is() )
{
//show
bool bShowLegend = false;
- xProp->getPropertyValue( "Show" ) >>= bShowLegend;
+ xLegend->getPropertyValue( u"Show"_ustr ) >>= bShowLegend;
if (m_xCbxShow)
m_xCbxShow->set_active( bShowLegend );
- PositionEnableHdl(*m_xCbxShow);
+ PositionEnable();
//position
chart2::LegendPosition ePos;
- xProp->getPropertyValue( "AnchorPosition" ) >>= ePos;
+ xLegend->getPropertyValue( u"AnchorPosition"_ustr ) >>= ePos;
switch( ePos )
{
case chart2::LegendPosition_LINE_START:
@@ -121,11 +122,11 @@ void LegendPositionResources::writeToModel( const rtl::Reference<::chart::ChartM
{
bool bShowLegend = m_xCbxShow && m_xCbxShow->get_active();
ChartModel& rModel = *xChartModel;
- uno::Reference< beans::XPropertySet > xProp(LegendHelper::getLegend(rModel, m_xCC, bShowLegend), uno::UNO_QUERY);
+ rtl::Reference< Legend > xProp = LegendHelper::getLegend(rModel, m_xCC, bShowLegend);
if( xProp.is() )
{
//show
- xProp->setPropertyValue( "Show" , uno::Any( bShowLegend ));
+ xProp->setPropertyValue( u"Show"_ustr , uno::Any( bShowLegend ));
//position
chart2::LegendPosition eNewPos;
@@ -148,9 +149,9 @@ void LegendPositionResources::writeToModel( const rtl::Reference<::chart::ChartM
eExp = css::chart::ChartLegendExpansion_WIDE;
}
- xProp->setPropertyValue( "AnchorPosition" , uno::Any( eNewPos ));
- xProp->setPropertyValue( "Expansion" , uno::Any( eExp ));
- xProp->setPropertyValue( "RelativePosition" , uno::Any());
+ xProp->setPropertyValue( u"AnchorPosition"_ustr , uno::Any( eNewPos ));
+ xProp->setPropertyValue( u"Expansion"_ustr , uno::Any( eExp ));
+ xProp->setPropertyValue( u"RelativePosition"_ustr , uno::Any());
}
}
catch( const uno::Exception & )
@@ -161,6 +162,11 @@ void LegendPositionResources::writeToModel( const rtl::Reference<::chart::ChartM
IMPL_LINK_NOARG(LegendPositionResources, PositionEnableHdl, weld::Toggleable&, void)
{
+ PositionEnable();
+}
+
+void LegendPositionResources::PositionEnable()
+{
bool bEnable = !m_xCbxShow || m_xCbxShow->get_active();
m_xRbtLeft->set_sensitive( bEnable );
@@ -173,10 +179,9 @@ IMPL_LINK_NOARG(LegendPositionResources, PositionEnableHdl, weld::Toggleable&, v
void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs )
{
- const SfxPoolItem* pPoolItem = nullptr;
- if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxInt32Item* pPosItem = rInAttrs.GetItemIfSet( SCHATTR_LEGEND_POS ) )
{
- chart2::LegendPosition nLegendPosition = static_cast<chart2::LegendPosition>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
+ chart2::LegendPosition nLegendPosition = static_cast<chart2::LegendPosition>(pPosItem->GetValue());
switch( nLegendPosition )
{
case chart2::LegendPosition_LINE_START:
@@ -196,10 +201,10 @@ void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs )
}
}
- if( m_xCbxShow && rInAttrs.GetItemState( SCHATTR_LEGEND_SHOW, true, &pPoolItem ) == SfxItemState::SET )
+ const SfxBoolItem* pShowItem;
+ if( m_xCbxShow && (pShowItem = rInAttrs.GetItemIfSet( SCHATTR_LEGEND_SHOW )) )
{
- bool bShow = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
- m_xCbxShow->set_active(bShow);
+ m_xCbxShow->set_active(pShowItem->GetValue());
}
}
diff --git a/chart2/source/controller/dialogs/res_Titles.cxx b/chart2/source/controller/dialogs/res_Titles.cxx
index 59b0f00b9b37..dda48b055320 100644
--- a/chart2/source/controller/dialogs/res_Titles.cxx
+++ b/chart2/source/controller/dialogs/res_Titles.cxx
@@ -24,20 +24,20 @@
namespace chart
{
TitleResources::TitleResources(weld::Builder& rBuilder, bool bShowSecondaryAxesTitle)
- : m_xFT_Main(rBuilder.weld_label("labelMainTitle"))
- , m_xFT_Sub(rBuilder.weld_label("labelSubTitle"))
- , m_xEd_Main(rBuilder.weld_entry("maintitle"))
- , m_xEd_Sub(rBuilder.weld_entry("subtitle"))
- , m_xFT_XAxis(rBuilder.weld_label("labelPrimaryXaxis"))
- , m_xFT_YAxis(rBuilder.weld_label("labelPrimaryYaxis"))
- , m_xFT_ZAxis(rBuilder.weld_label("labelPrimaryZaxis"))
- , m_xEd_XAxis(rBuilder.weld_entry("primaryXaxis"))
- , m_xEd_YAxis(rBuilder.weld_entry("primaryYaxis"))
- , m_xEd_ZAxis(rBuilder.weld_entry("primaryZaxis"))
- , m_xFT_SecondaryXAxis(rBuilder.weld_label("labelSecondaryXAxis"))
- , m_xFT_SecondaryYAxis(rBuilder.weld_label("labelSecondaryYAxis"))
- , m_xEd_SecondaryXAxis(rBuilder.weld_entry("secondaryXaxis"))
- , m_xEd_SecondaryYAxis(rBuilder.weld_entry("secondaryYaxis"))
+ : m_xFT_Main(rBuilder.weld_label(u"labelMainTitle"_ustr))
+ , m_xFT_Sub(rBuilder.weld_label(u"labelSubTitle"_ustr))
+ , m_xEd_Main(rBuilder.weld_entry(u"maintitle"_ustr))
+ , m_xEd_Sub(rBuilder.weld_entry(u"subtitle"_ustr))
+ , m_xFT_XAxis(rBuilder.weld_label(u"labelPrimaryXaxis"_ustr))
+ , m_xFT_YAxis(rBuilder.weld_label(u"labelPrimaryYaxis"_ustr))
+ , m_xFT_ZAxis(rBuilder.weld_label(u"labelPrimaryZaxis"_ustr))
+ , m_xEd_XAxis(rBuilder.weld_entry(u"primaryXaxis"_ustr))
+ , m_xEd_YAxis(rBuilder.weld_entry(u"primaryYaxis"_ustr))
+ , m_xEd_ZAxis(rBuilder.weld_entry(u"primaryZaxis"_ustr))
+ , m_xFT_SecondaryXAxis(rBuilder.weld_label(u"labelSecondaryXAxis"_ustr))
+ , m_xFT_SecondaryYAxis(rBuilder.weld_label(u"labelSecondaryYAxis"_ustr))
+ , m_xEd_SecondaryXAxis(rBuilder.weld_entry(u"secondaryXaxis"_ustr))
+ , m_xEd_SecondaryYAxis(rBuilder.weld_entry(u"secondaryYaxis"_ustr))
{
m_xFT_SecondaryXAxis->set_visible(bShowSecondaryAxesTitle);
m_xFT_SecondaryYAxis->set_visible(bShowSecondaryAxesTitle);
diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index ca1fe7bcfb83..ce8a893702d7 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -46,30 +46,30 @@ TrendlineResources::TrendlineResources(weld::Builder& rBuilder, const SfxItemSet
, m_bTrendLineUnique(true)
, m_pNumFormatter(nullptr)
, m_nNbPoints(0)
- , m_xRB_Linear(rBuilder.weld_radio_button("linear"))
- , m_xRB_Logarithmic(rBuilder.weld_radio_button("logarithmic"))
- , m_xRB_Exponential(rBuilder.weld_radio_button("exponential"))
- , m_xRB_Power(rBuilder.weld_radio_button("power"))
- , m_xRB_Polynomial(rBuilder.weld_radio_button("polynomial"))
- , m_xRB_MovingAverage(rBuilder.weld_radio_button("movingAverage"))
- , m_xFI_Linear(rBuilder.weld_image("imageLinear"))
- , m_xFI_Logarithmic(rBuilder.weld_image("imageLogarithmic"))
- , m_xFI_Exponential(rBuilder.weld_image("imageExponential"))
- , m_xFI_Power(rBuilder.weld_image("imagePower"))
- , m_xFI_Polynomial(rBuilder.weld_image("imagePolynomial"))
- , m_xFI_MovingAverage(rBuilder.weld_image("imageMovingAverage"))
- , m_xNF_Degree(rBuilder.weld_spin_button("degree"))
- , m_xNF_Period(rBuilder.weld_spin_button("period"))
- , m_xEE_Name(rBuilder.weld_entry("entry_name"))
- , m_xFmtFld_ExtrapolateForward(rBuilder.weld_formatted_spin_button("extrapolateForward"))
- , m_xFmtFld_ExtrapolateBackward(rBuilder.weld_formatted_spin_button("extrapolateBackward"))
- , m_xCB_SetIntercept(rBuilder.weld_check_button("setIntercept"))
- , m_xFmtFld_InterceptValue(rBuilder.weld_formatted_spin_button("interceptValue"))
- , m_xCB_ShowEquation(rBuilder.weld_check_button("showEquation"))
- , m_xEE_XName(rBuilder.weld_entry("entry_Xname"))
- , m_xEE_YName(rBuilder.weld_entry("entry_Yname"))
- , m_xCB_ShowCorrelationCoeff(rBuilder.weld_check_button("showCorrelationCoefficient"))
- , m_xCB_RegressionMovingType(rBuilder.weld_combo_box("combo_moving_type"))
+ , m_xRB_Linear(rBuilder.weld_radio_button(u"linear"_ustr))
+ , m_xRB_Logarithmic(rBuilder.weld_radio_button(u"logarithmic"_ustr))
+ , m_xRB_Exponential(rBuilder.weld_radio_button(u"exponential"_ustr))
+ , m_xRB_Power(rBuilder.weld_radio_button(u"power"_ustr))
+ , m_xRB_Polynomial(rBuilder.weld_radio_button(u"polynomial"_ustr))
+ , m_xRB_MovingAverage(rBuilder.weld_radio_button(u"movingAverage"_ustr))
+ , m_xFI_Linear(rBuilder.weld_image(u"imageLinear"_ustr))
+ , m_xFI_Logarithmic(rBuilder.weld_image(u"imageLogarithmic"_ustr))
+ , m_xFI_Exponential(rBuilder.weld_image(u"imageExponential"_ustr))
+ , m_xFI_Power(rBuilder.weld_image(u"imagePower"_ustr))
+ , m_xFI_Polynomial(rBuilder.weld_image(u"imagePolynomial"_ustr))
+ , m_xFI_MovingAverage(rBuilder.weld_image(u"imageMovingAverage"_ustr))
+ , m_xNF_Degree(rBuilder.weld_spin_button(u"degree"_ustr))
+ , m_xNF_Period(rBuilder.weld_spin_button(u"period"_ustr))
+ , m_xEE_Name(rBuilder.weld_entry(u"entry_name"_ustr))
+ , m_xFmtFld_ExtrapolateForward(rBuilder.weld_formatted_spin_button(u"extrapolateForward"_ustr))
+ , m_xFmtFld_ExtrapolateBackward(rBuilder.weld_formatted_spin_button(u"extrapolateBackward"_ustr))
+ , m_xCB_SetIntercept(rBuilder.weld_check_button(u"setIntercept"_ustr))
+ , m_xFmtFld_InterceptValue(rBuilder.weld_formatted_spin_button(u"interceptValue"_ustr))
+ , m_xCB_ShowEquation(rBuilder.weld_check_button(u"showEquation"_ustr))
+ , m_xEE_XName(rBuilder.weld_entry(u"entry_Xname"_ustr))
+ , m_xEE_YName(rBuilder.weld_entry(u"entry_Yname"_ustr))
+ , m_xCB_ShowCorrelationCoeff(rBuilder.weld_check_button(u"showCorrelationCoefficient"_ustr))
+ , m_xCB_RegressionMovingType(rBuilder.weld_combo_box(u"combo_moving_type"_ustr))
{
FillValueSets();
@@ -126,38 +126,37 @@ IMPL_LINK_NOARG(TrendlineResources, SelectTrendLine, weld::Toggleable&, void)
void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
{
- const SfxPoolItem *pPoolItem = nullptr;
-
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_CURVE_NAME, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxStringItem* pCurveNameItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_CURVE_NAME ) )
{
- OUString aName = static_cast< const SfxStringItem* >(pPoolItem)->GetValue();
+ OUString aName = pCurveNameItem->GetValue();
m_xEE_Name->set_text(aName);
}
else
{
- m_xEE_Name->set_text("");
+ m_xEE_Name->set_text(u""_ustr);
}
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_XNAME, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxStringItem* pRegressionXNameItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_XNAME ) )
{
- OUString aName = static_cast< const SfxStringItem* >(pPoolItem)->GetValue();
+ OUString aName = pRegressionXNameItem->GetValue();
m_xEE_XName->set_text(aName);
}
else
{
- m_xEE_XName->set_text("x");
+ m_xEE_XName->set_text(u"x"_ustr);
}
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_YNAME, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxStringItem* pRegressionYNameItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_YNAME ) )
{
- OUString aName = static_cast< const SfxStringItem* >(pPoolItem)->GetValue();
+ OUString aName = pRegressionYNameItem->GetValue();
m_xEE_YName->set_text(aName);
}
else
{
- m_xEE_YName->set_text("f(x)");
+ m_xEE_YName->set_text(u"f(x)"_ustr);
}
+ const SfxPoolItem* pPoolItem = nullptr;
SfxItemState aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem );
- m_bTrendLineUnique = ( aState != SfxItemState::DONTCARE );
+ m_bTrendLineUnique = ( aState != SfxItemState::INVALID );
if( aState == SfxItemState::SET )
{
const SvxChartRegressItem * pItem = dynamic_cast< const SvxChartRegressItem * >( pPoolItem );
@@ -167,9 +166,9 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
}
}
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_DEGREE, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxInt32Item* pDegreeItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_DEGREE ) )
{
- sal_Int32 nDegree = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_Int32 nDegree = pDegreeItem->GetValue();
m_xNF_Degree->set_value( nDegree );
}
else
@@ -179,9 +178,9 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
m_xNF_Degree->save_value();
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_PERIOD, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxInt32Item* pPeriodItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_PERIOD ) )
{
- sal_Int32 nPeriod = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_Int32 nPeriod = pPeriodItem->GetValue();
m_xNF_Period->set_value( nPeriod );
}
else
@@ -192,28 +191,28 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
m_xNF_Period->save_value();
double nValue = 0.0;
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SvxDoubleItem* pForwardItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD ) )
{
- nValue = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue() ;
+ nValue = pForwardItem->GetValue() ;
}
lcl_setValue(*m_xFmtFld_ExtrapolateForward, nValue);
nValue = 0.0;
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SvxDoubleItem* pBackwardItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD ) )
{
- nValue = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue() ;
+ nValue = pBackwardItem->GetValue() ;
}
lcl_setValue(*m_xFmtFld_ExtrapolateBackward, nValue);
nValue = 0.0;
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_INTERCEPT_VALUE, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SvxDoubleItem* pValueItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_INTERCEPT_VALUE ) )
{
- nValue = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue() ;
+ nValue = pValueItem->GetValue() ;
}
lcl_setValue(*m_xFmtFld_InterceptValue, nValue);
aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_SET_INTERCEPT, true, &pPoolItem );
- if( aState == SfxItemState::DONTCARE )
+ if( aState == SfxItemState::INVALID )
{
m_xCB_SetIntercept->set_state(TRISTATE_INDET);
}
@@ -224,7 +223,7 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
}
aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_SHOW_EQUATION, true, &pPoolItem );
- if( aState == SfxItemState::DONTCARE )
+ if( aState == SfxItemState::INVALID )
{
m_xCB_ShowEquation->set_state(TRISTATE_INDET);
}
@@ -235,7 +234,7 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
}
aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_SHOW_COEFF, true, &pPoolItem );
- if( aState == SfxItemState::DONTCARE )
+ if( aState == SfxItemState::INVALID )
{
m_xCB_ShowCorrelationCoeff->set_state(TRISTATE_INDET);
}
@@ -245,9 +244,9 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
m_xCB_ShowCorrelationCoeff->set_active( static_cast< const SfxBoolItem * >( pPoolItem )->GetValue());
}
- if( rInAttrs.GetItemState( SCHATTR_REGRESSION_MOVING_TYPE, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxInt32Item* pMovingTypeItem = rInAttrs.GetItemIfSet( SCHATTR_REGRESSION_MOVING_TYPE ) )
{
- sal_Int32 nMovingType = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_Int32 nMovingType = pMovingTypeItem->GetValue();
if (nMovingType == MovingAverageType::Prior)
m_xCB_RegressionMovingType->set_active(0);
else if (nMovingType == MovingAverageType::Central)
@@ -373,10 +372,8 @@ void TrendlineResources::UpdateControlStates()
m_xFmtFld_InterceptValue->set_sensitive( bInterceptAvailable );
if( bMovingAverage )
{
- m_xCB_ShowEquation->set_state(TRISTATE_FALSE);
m_xCB_ShowCorrelationCoeff->set_state(TRISTATE_FALSE);
}
- m_xCB_ShowEquation->set_sensitive( !bMovingAverage );
m_xCB_ShowCorrelationCoeff->set_sensitive( !bMovingAverage );
m_xCB_RegressionMovingType->set_sensitive(bMovingAverage);
m_xNF_Period->set_sensitive(bMovingAverage);
@@ -429,8 +426,6 @@ void TrendlineResources::SetNbPoints( sal_Int32 nNbPoints )
IMPL_LINK_NOARG(TrendlineResources, ShowEquation, weld::Toggleable&, void)
{
- m_xEE_XName->set_sensitive(m_xCB_ShowEquation->get_active());
- m_xEE_YName->set_sensitive(m_xCB_ShowEquation->get_active());
UpdateControlStates();
}
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
index 40dd7b9cd493..9e0127f23180 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
@@ -18,16 +18,13 @@
*/
#include "tp_3D_SceneAppearance.hxx"
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
#include <ThreeDHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <Diagram.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -55,10 +52,10 @@ lcl_ModelProperties lcl_getPropertiesFromModel( rtl::Reference<::chart::ChartMod
lcl_ModelProperties aProps;
try
{
- rtl::Reference< ::chart::Diagram > xDiagram( ::chart::ChartModelHelper::findDiagram( xModel ) );
- xDiagram->getPropertyValue( "D3DSceneShadeMode" ) >>= aProps.m_aShadeMode;
+ rtl::Reference< ::chart::Diagram > xDiagram( xModel->getFirstChartDiagram() );
+ xDiagram->getPropertyValue( u"D3DSceneShadeMode"_ustr ) >>= aProps.m_aShadeMode;
::chart::ThreeDHelper::getRoundedEdgesAndObjectLines( xDiagram, aProps.m_nRoundedEdges, aProps.m_nObjectLines );
- aProps.m_eScheme = ::chart::ThreeDHelper::detectScheme( xDiagram );
+ aProps.m_eScheme = xDiagram->detectScheme();
}
catch( const uno::Exception & )
{
@@ -71,8 +68,8 @@ void lcl_setShadeModeAtModel( rtl::Reference<::chart::ChartModel> const & xModel
{
try
{
- rtl::Reference< ::chart::Diagram > xDiaProp = ::chart::ChartModelHelper::findDiagram( xModel );
- xDiaProp->setPropertyValue( "D3DSceneShadeMode" , uno::Any( aShadeMode ));
+ rtl::Reference< ::chart::Diagram > xDiaProp = xModel->getFirstChartDiagram();
+ xDiaProp->setPropertyValue( u"D3DSceneShadeMode"_ustr , uno::Any( aShadeMode ));
}
catch( const uno::Exception & )
{
@@ -90,18 +87,18 @@ namespace chart
#define POS_3DSCHEME_CUSTOM 2
ThreeD_SceneAppearance_TabPage::ThreeD_SceneAppearance_TabPage(weld::Container* pParent,
- const rtl::Reference<::chart::ChartModel>& xChartModel,
+ rtl::Reference<::chart::ChartModel> xChartModel,
ControllerLockHelper& rControllerLockHelper)
- : m_xChartModel(xChartModel)
+ : m_xChartModel(std::move(xChartModel))
, m_bUpdateOtherControls(true)
, m_bCommitToModel(true)
, m_rControllerLockHelper(rControllerLockHelper)
- , m_xBuilder(Application::CreateBuilder(pParent, "modules/schart/ui/tp_3D_SceneAppearance.ui"))
- , m_xContainer(m_xBuilder->weld_container("tp_3D_SceneAppearance"))
- , m_xLB_Scheme(m_xBuilder->weld_combo_box("LB_SCHEME"))
- , m_xCB_Shading(m_xBuilder->weld_check_button("CB_SHADING"))
- , m_xCB_ObjectLines(m_xBuilder->weld_check_button("CB_OBJECTLINES"))
- , m_xCB_RoundedEdge(m_xBuilder->weld_check_button("CB_ROUNDEDEDGE"))
+ , m_xBuilder(Application::CreateBuilder(pParent, u"modules/schart/ui/tp_3D_SceneAppearance.ui"_ustr))
+ , m_xContainer(m_xBuilder->weld_container(u"tp_3D_SceneAppearance"_ustr))
+ , m_xLB_Scheme(m_xBuilder->weld_combo_box(u"LB_SCHEME"_ustr))
+ , m_xCB_Shading(m_xBuilder->weld_check_button(u"CB_SHADING"_ustr))
+ , m_xCB_ObjectLines(m_xBuilder->weld_check_button(u"CB_OBJECTLINES"_ustr))
+ , m_xCB_RoundedEdge(m_xBuilder->weld_check_button(u"CB_ROUNDEDEDGE"_ustr))
{
m_aCustom = m_xLB_Scheme->get_text(POS_3DSCHEME_CUSTOM);
m_xLB_Scheme->remove(POS_3DSCHEME_CUSTOM);
@@ -161,7 +158,7 @@ void ThreeD_SceneAppearance_TabPage::applyRoundedEdgeAndObjectLinesToModel()
// locked controllers
ControllerLockHelperGuard aGuard( m_rControllerLockHelper );
ThreeDHelper::setRoundedEdgesAndObjectLines(
- ::chart::ChartModelHelper::findDiagram( m_xChartModel ), nCurrentRoundedEdges, nObjectLines );
+ m_xChartModel->getFirstChartDiagram(), nCurrentRoundedEdges, nObjectLines );
}
void ThreeD_SceneAppearance_TabPage::applyShadeModeToModel()
@@ -272,12 +269,12 @@ IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl, weld::ComboBox&
// locked controllers
ControllerLockHelperGuard aGuard( m_rControllerLockHelper );
- rtl::Reference< Diagram > xDiagram = ::chart::ChartModelHelper::findDiagram( m_xChartModel );
+ rtl::Reference< Diagram > xDiagram = m_xChartModel->getFirstChartDiagram();
if( m_xLB_Scheme->get_active() == POS_3DSCHEME_REALISTIC )
- ThreeDHelper::setScheme( xDiagram, ThreeDLookScheme::ThreeDLookScheme_Realistic );
+ xDiagram->setScheme( ThreeDLookScheme::ThreeDLookScheme_Realistic );
else if( m_xLB_Scheme->get_active() == POS_3DSCHEME_SIMPLE )
- ThreeDHelper::setScheme( xDiagram, ThreeDLookScheme::ThreeDLookScheme_Simple );
+ xDiagram->setScheme( ThreeDLookScheme::ThreeDLookScheme_Simple );
else
{
OSL_FAIL( "Invalid Entry selected" );
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
index 9d255c076e28..0f5d82d10f1d 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
@@ -21,7 +21,6 @@
#include <vcl/weld.hxx>
namespace chart { class ControllerLockHelper; }
-namespace com::sun::star::frame { class XModel; }
namespace chart
{
@@ -32,7 +31,7 @@ class ThreeD_SceneAppearance_TabPage
public:
ThreeD_SceneAppearance_TabPage(
weld::Container* pParent,
- const rtl::Reference<::chart::ChartModel> & xChartModel,
+ rtl::Reference<::chart::ChartModel> xChartModel,
ControllerLockHelper & rControllerLockHelper );
void ActivatePage();
~ThreeD_SceneAppearance_TabPage();
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
index 3a76aa57f6dd..99755db26f9e 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
@@ -19,13 +19,15 @@
#include "tp_3D_SceneGeometry.hxx"
-#include <DiagramHelper.hxx>
+#include <Diagram.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ThreeDHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <com/sun/star/drawing/ProjectionMode.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/helpers.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
namespace chart
@@ -44,9 +46,9 @@ void lcl_SetMetricFieldLimits(weld::MetricSpinButton& rField, sal_Int64 nLimit)
}
ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage(weld::Container* pParent,
- const uno::Reference< beans::XPropertySet > & xSceneProperties,
+ rtl::Reference< ::chart::Diagram > xDiagram,
ControllerLockHelper & rControllerLockHelper)
- : m_xSceneProperties( xSceneProperties )
+ : m_xDiagram(std::move( xDiagram ))
, m_aAngleTimer("chart2 ThreeD_SceneGeometry_TabPage m_aAngleTimer")
, m_aPerspectiveTimer("chart2 ThreeD_SceneGeometry_TabPage m_aPerspectiveTimer")
, m_nXRotation(0)
@@ -55,18 +57,18 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage(weld::Container* pPar
, m_bAngleChangePending( false )
, m_bPerspectiveChangePending( false )
, m_rControllerLockHelper( rControllerLockHelper )
- , m_xBuilder(Application::CreateBuilder(pParent, "modules/schart/ui/tp_3D_SceneGeometry.ui"))
- , m_xContainer(m_xBuilder->weld_container("tp_3DSceneGeometry"))
- , m_xCbxRightAngledAxes(m_xBuilder->weld_check_button("CBX_RIGHT_ANGLED_AXES"))
- , m_xMFXRotation(m_xBuilder->weld_metric_spin_button("MTR_FLD_X_ROTATION", FieldUnit::DEGREE))
- , m_xMFYRotation(m_xBuilder->weld_metric_spin_button("MTR_FLD_Y_ROTATION", FieldUnit::DEGREE))
- , m_xFtZRotation(m_xBuilder->weld_label("FT_Z_ROTATION"))
- , m_xMFZRotation(m_xBuilder->weld_metric_spin_button("MTR_FLD_Z_ROTATION", FieldUnit::DEGREE))
- , m_xCbxPerspective(m_xBuilder->weld_check_button("CBX_PERSPECTIVE"))
- , m_xMFPerspective(m_xBuilder->weld_metric_spin_button("MTR_FLD_PERSPECTIVE", FieldUnit::PERCENT))
+ , m_xBuilder(Application::CreateBuilder(pParent, u"modules/schart/ui/tp_3D_SceneGeometry.ui"_ustr))
+ , m_xContainer(m_xBuilder->weld_container(u"tp_3DSceneGeometry"_ustr))
+ , m_xCbxRightAngledAxes(m_xBuilder->weld_check_button(u"CBX_RIGHT_ANGLED_AXES"_ustr))
+ , m_xMFXRotation(m_xBuilder->weld_metric_spin_button(u"MTR_FLD_X_ROTATION"_ustr, FieldUnit::DEGREE))
+ , m_xMFYRotation(m_xBuilder->weld_metric_spin_button(u"MTR_FLD_Y_ROTATION"_ustr, FieldUnit::DEGREE))
+ , m_xFtZRotation(m_xBuilder->weld_label(u"FT_Z_ROTATION"_ustr))
+ , m_xMFZRotation(m_xBuilder->weld_metric_spin_button(u"MTR_FLD_Z_ROTATION"_ustr, FieldUnit::DEGREE))
+ , m_xCbxPerspective(m_xBuilder->weld_check_button(u"CBX_PERSPECTIVE"_ustr))
+ , m_xMFPerspective(m_xBuilder->weld_metric_spin_button(u"MTR_FLD_PERSPECTIVE"_ustr, FieldUnit::PERCENT))
{
double fXAngle, fYAngle, fZAngle;
- ThreeDHelper::getRotationAngleFromDiagram( m_xSceneProperties, fXAngle, fYAngle, fZAngle );
+ m_xDiagram->getRotationAngle( fXAngle, fYAngle, fZAngle );
fXAngle = basegfx::rad2deg(fXAngle);
fYAngle = basegfx::rad2deg(fYAngle);
@@ -97,12 +99,12 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage(weld::Container* pPar
m_xMFZRotation->connect_value_changed( aAngleEditedLink );
drawing::ProjectionMode aProjectionMode = drawing::ProjectionMode_PERSPECTIVE;
- m_xSceneProperties->getPropertyValue( "D3DScenePerspective" ) >>= aProjectionMode;
+ m_xDiagram->getPropertyValue( u"D3DScenePerspective"_ustr ) >>= aProjectionMode;
m_xCbxPerspective->set_active( aProjectionMode == drawing::ProjectionMode_PERSPECTIVE );
m_xCbxPerspective->connect_toggled( LINK( this, ThreeD_SceneGeometry_TabPage, PerspectiveToggled ));
sal_Int32 nPerspectivePercentage = 20;
- m_xSceneProperties->getPropertyValue( "Perspective" ) >>= nPerspectivePercentage;
+ m_xDiagram->getPropertyValue( u"Perspective"_ustr ) >>= nPerspectivePercentage;
m_xMFPerspective->set_value(nPerspectivePercentage, FieldUnit::PERCENT);
m_aPerspectiveTimer.SetTimeout(nTimeout);
@@ -111,11 +113,11 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage(weld::Container* pPar
m_xMFPerspective->set_sensitive( m_xCbxPerspective->get_active() );
//RightAngledAxes
- uno::Reference< chart2::XDiagram > xDiagram( m_xSceneProperties, uno::UNO_QUERY );
- if (ChartTypeHelper::isSupportingRightAngledAxes(DiagramHelper::getChartTypeByIndex(xDiagram, 0)))
+ auto xChartType = m_xDiagram->getChartTypeByIndex(0);
+ if (xChartType.is() && xChartType->isSupportingRightAngledAxes())
{
bool bRightAngledAxes = false;
- m_xSceneProperties->getPropertyValue( "RightAngledAxes" ) >>= bRightAngledAxes;
+ m_xDiagram->getPropertyValue( u"RightAngledAxes"_ustr ) >>= bRightAngledAxes;
m_xCbxRightAngledAxes->connect_toggled( LINK( this, ThreeD_SceneGeometry_TabPage, RightAngledAxesToggled ));
m_xCbxRightAngledAxes->set_active( bRightAngledAxes );
RightAngledAxesToggled(*m_xCbxRightAngledAxes);
@@ -157,7 +159,7 @@ void ThreeD_SceneGeometry_TabPage::applyAnglesToModel()
fYAngle = basegfx::deg2rad(fYAngle);
fZAngle = basegfx::deg2rad(fZAngle);
- ThreeDHelper::setRotationAngleToDiagram( m_xSceneProperties, fXAngle, fYAngle, fZAngle );
+ m_xDiagram->setRotationAngle( fXAngle, fYAngle, fZAngle );
m_bAngleChangePending = false;
m_aAngleTimer.Stop();
@@ -188,8 +190,8 @@ void ThreeD_SceneGeometry_TabPage::applyPerspectiveToModel()
try
{
- m_xSceneProperties->setPropertyValue( "D3DScenePerspective" , uno::Any( aMode ));
- m_xSceneProperties->setPropertyValue( "Perspective" , uno::Any( static_cast<sal_Int32>(m_xMFPerspective->get_value(FieldUnit::PERCENT)) ));
+ m_xDiagram->setPropertyValue( u"D3DScenePerspective"_ustr , uno::Any( aMode ));
+ m_xDiagram->setPropertyValue( u"Perspective"_ustr , uno::Any( static_cast<sal_Int32>(m_xMFPerspective->get_value(FieldUnit::PERCENT)) ));
}
catch( const uno::Exception & )
{
@@ -232,7 +234,7 @@ IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, RightAngledAxesToggled, weld::Togg
m_xMFXRotation->set_value(static_cast<sal_Int64>(ThreeDHelper::getValueClippedToRange(static_cast<double>(m_nXRotation), ThreeDHelper::getXDegreeAngleLimitForRightAngledAxes())), FieldUnit::DEGREE);
m_xMFYRotation->set_value(static_cast<sal_Int64>(ThreeDHelper::getValueClippedToRange(static_cast<double>(m_nYRotation), ThreeDHelper::getYDegreeAngleLimitForRightAngledAxes())), FieldUnit::DEGREE);
- m_xMFZRotation->set_text("");
+ m_xMFZRotation->set_text(u""_ustr);
lcl_SetMetricFieldLimits( *m_xMFXRotation, static_cast<sal_Int64>(ThreeDHelper::getXDegreeAngleLimitForRightAngledAxes()));
lcl_SetMetricFieldLimits( *m_xMFYRotation, static_cast<sal_Int64>(ThreeDHelper::getYDegreeAngleLimitForRightAngledAxes()));
@@ -247,7 +249,8 @@ IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, RightAngledAxesToggled, weld::Togg
m_xMFZRotation->set_value(m_nZRotation, FieldUnit::DEGREE);
}
- ThreeDHelper::switchRightAngledAxes( m_xSceneProperties, m_xCbxRightAngledAxes->get_active() );
+ if (m_xDiagram)
+ m_xDiagram->switchRightAngledAxes( m_xCbxRightAngledAxes->get_active() );
}
} //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
index ca7f75ebea0d..027070048501 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
@@ -20,18 +20,19 @@
#include <vcl/timer.hxx>
#include <vcl/weld.hxx>
+#include <rtl/ref.hxx>
-namespace com::sun::star::beans { class XPropertySet; }
namespace chart { class ControllerLockHelper; }
namespace chart
{
+class Diagram;
class ThreeD_SceneGeometry_TabPage
{
public:
ThreeD_SceneGeometry_TabPage(weld::Container* pWindow,
- const css::uno::Reference< css::beans::XPropertySet > & xSceneProperties,
+ rtl::Reference< ::chart::Diagram > xDiagram,
ControllerLockHelper & rControllerLockHelper);
~ThreeD_SceneGeometry_TabPage();
@@ -54,7 +55,7 @@ private:
void applyAnglesToModel();
void applyPerspectiveToModel();
- css::uno::Reference< css::beans::XPropertySet > m_xSceneProperties;
+ rtl::Reference< ::chart::Diagram > m_xDiagram;
Timer m_aAngleTimer;
Timer m_aPerspectiveTimer;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 56d2d44f9ce6..4a43cbbadaeb 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -26,11 +26,12 @@
#include <svx/float3d.hxx>
#include <svx/strings.hrc>
#include <svx/dialmgr.hxx>
-#include <svtools/colrdlg.hxx>
#include <svx/svx3ditems.hxx>
#include <svx/svddef.hxx>
+#include <utility>
+#include <vcl/ColorDialog.hxx>
#include <vcl/svapp.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -99,7 +100,7 @@ namespace
void lcl_selectColor(ColorListBox& rListBox, const Color& rColor)
{
rListBox.SetNoSelection();
- rListBox.SelectEntry(std::make_pair(rColor, lcl_makeColorName(rColor)));
+ rListBox.SelectEntry({rColor, lcl_makeColorName(rColor)});
}
::chart::LightSource lcl_getLightSourceFromProperties(
@@ -138,7 +139,7 @@ namespace
try
{
xSceneProperties->setPropertyValue( "D3DSceneLightColor" + aIndex,
- uno::makeAny( rLightSource.nDiffuseColor ));
+ uno::Any( rLightSource.nDiffuseColor ));
xSceneProperties->setPropertyValue( "D3DSceneLightDirection" + aIndex,
uno::Any( rLightSource.aDirection ));
xSceneProperties->setPropertyValue( "D3DSceneLightOn" + aIndex,
@@ -156,7 +157,7 @@ namespace
Color nResult;
try
{
- xSceneProperties->getPropertyValue("D3DSceneAmbientColor") >>= nResult;
+ xSceneProperties->getPropertyValue(u"D3DSceneAmbientColor"_ustr) >>= nResult;
}
catch( const uno::Exception & )
{
@@ -171,8 +172,8 @@ namespace
{
try
{
- xSceneProperties->setPropertyValue("D3DSceneAmbientColor",
- uno::makeAny( rColor ));
+ xSceneProperties->setPropertyValue(u"D3DSceneAmbientColor"_ustr,
+ uno::Any( rColor ));
}
catch( const uno::Exception & )
{
@@ -183,55 +184,55 @@ namespace
ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage(weld::Container* pParent,
weld::Window* pTopLevel,
- const uno::Reference< beans::XPropertySet > & xSceneProperties,
+ uno::Reference< beans::XPropertySet > xSceneProperties,
const rtl::Reference<::chart::ChartModel>& xChartModel)
- : m_xSceneProperties( xSceneProperties )
+ : m_xSceneProperties(std::move( xSceneProperties ))
, m_aTimerTriggeredControllerLock( xChartModel )
, m_bInCommitToModel( false )
, m_aModelChangeListener( LINK( this, ThreeD_SceneIllumination_TabPage, fillControlsFromModel ) )
, m_xChartModel( xChartModel )
, m_pTopLevel(pTopLevel)
- , m_xBuilder(Application::CreateBuilder(pParent, "modules/schart/ui/tp_3D_SceneIllumination.ui"))
- , m_xContainer(m_xBuilder->weld_container("tp_3D_SceneIllumination"))
- , m_xBtn_Light1(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_1")))
- , m_xBtn_Light2(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_2")))
- , m_xBtn_Light3(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_3")))
- , m_xBtn_Light4(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_4")))
- , m_xBtn_Light5(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_5")))
- , m_xBtn_Light6(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_6")))
- , m_xBtn_Light7(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_7")))
- , m_xBtn_Light8(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_8")))
- , m_xLB_LightSource(new ColorListBox(m_xBuilder->weld_menu_button("LB_LIGHTSOURCE"), [this]{ return m_pTopLevel; }))
- , m_xBtn_LightSource_Color(m_xBuilder->weld_button("BTN_LIGHTSOURCE_COLOR"))
- , m_xLB_AmbientLight(new ColorListBox(m_xBuilder->weld_menu_button("LB_AMBIENTLIGHT"), [this]{ return m_pTopLevel; }))
- , m_xBtn_AmbientLight_Color(m_xBuilder->weld_button("BTN_AMBIENT_COLOR"))
- , m_xHoriScale(m_xBuilder->weld_scale("hori"))
- , m_xVertScale(m_xBuilder->weld_scale("vert"))
- , m_xBtn_Corner(m_xBuilder->weld_button("corner"))
+ , m_xBuilder(Application::CreateBuilder(pParent, u"modules/schart/ui/tp_3D_SceneIllumination.ui"_ustr))
+ , m_xContainer(m_xBuilder->weld_container(u"tp_3D_SceneIllumination"_ustr))
+ , m_aBtn_Light1(m_xBuilder->weld_toggle_button(u"BTN_LIGHT_1"_ustr))
+ , m_aBtn_Light2(m_xBuilder->weld_toggle_button(u"BTN_LIGHT_2"_ustr))
+ , m_aBtn_Light3(m_xBuilder->weld_toggle_button(u"BTN_LIGHT_3"_ustr))
+ , m_aBtn_Light4(m_xBuilder->weld_toggle_button(u"BTN_LIGHT_4"_ustr))
+ , m_aBtn_Light5(m_xBuilder->weld_toggle_button(u"BTN_LIGHT_5"_ustr))
+ , m_aBtn_Light6(m_xBuilder->weld_toggle_button(u"BTN_LIGHT_6"_ustr))
+ , m_aBtn_Light7(m_xBuilder->weld_toggle_button(u"BTN_LIGHT_7"_ustr))
+ , m_aBtn_Light8(m_xBuilder->weld_toggle_button(u"BTN_LIGHT_8"_ustr))
+ , m_xLB_LightSource(new ColorListBox(m_xBuilder->weld_menu_button(u"LB_LIGHTSOURCE"_ustr), [this]{ return m_pTopLevel; }))
+ , m_xBtn_LightSource_Color(m_xBuilder->weld_button(u"BTN_LIGHTSOURCE_COLOR"_ustr))
+ , m_xLB_AmbientLight(new ColorListBox(m_xBuilder->weld_menu_button(u"LB_AMBIENTLIGHT"_ustr), [this]{ return m_pTopLevel; }))
+ , m_xBtn_AmbientLight_Color(m_xBuilder->weld_button(u"BTN_AMBIENT_COLOR"_ustr))
+ , m_xHoriScale(m_xBuilder->weld_scale(u"hori"_ustr))
+ , m_xVertScale(m_xBuilder->weld_scale(u"vert"_ustr))
+ , m_xBtn_Corner(m_xBuilder->weld_button(u"corner"_ustr))
, m_xPreview(new Svx3DLightControl)
- , m_xPreviewWnd(new weld::CustomWeld(*m_xBuilder, "CTL_LIGHT_PREVIEW", *m_xPreview))
+ , m_xPreviewWnd(new weld::CustomWeld(*m_xBuilder, u"CTL_LIGHT_PREVIEW"_ustr, *m_xPreview))
, m_xCtl_Preview(new SvxLightCtl3D(*m_xPreview, *m_xHoriScale, *m_xVertScale, *m_xBtn_Corner))
{
m_pLightSourceInfoList.reset(new LightSourceInfo[8]);
- m_pLightSourceInfoList[0].pButton = m_xBtn_Light1.get();
- m_pLightSourceInfoList[1].pButton = m_xBtn_Light2.get();
- m_pLightSourceInfoList[2].pButton = m_xBtn_Light3.get();
- m_pLightSourceInfoList[3].pButton = m_xBtn_Light4.get();
- m_pLightSourceInfoList[4].pButton = m_xBtn_Light5.get();
- m_pLightSourceInfoList[5].pButton = m_xBtn_Light6.get();
- m_pLightSourceInfoList[6].pButton = m_xBtn_Light7.get();
- m_pLightSourceInfoList[7].pButton = m_xBtn_Light8.get();
+ m_pLightSourceInfoList[0].pButton = &m_aBtn_Light1;
+ m_pLightSourceInfoList[1].pButton = &m_aBtn_Light2;
+ m_pLightSourceInfoList[2].pButton = &m_aBtn_Light3;
+ m_pLightSourceInfoList[3].pButton = &m_aBtn_Light4;
+ m_pLightSourceInfoList[4].pButton = &m_aBtn_Light5;
+ m_pLightSourceInfoList[5].pButton = &m_aBtn_Light6;
+ m_pLightSourceInfoList[6].pButton = &m_aBtn_Light7;
+ m_pLightSourceInfoList[7].pButton = &m_aBtn_Light8;
fillControlsFromModel(nullptr);
- m_xBtn_Light1->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
- m_xBtn_Light2->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
- m_xBtn_Light3->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
- m_xBtn_Light4->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
- m_xBtn_Light5->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
- m_xBtn_Light6->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
- m_xBtn_Light7->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
- m_xBtn_Light8->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+ m_aBtn_Light1.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+ m_aBtn_Light2.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+ m_aBtn_Light3.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+ m_aBtn_Light4.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+ m_aBtn_Light5.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+ m_aBtn_Light6.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+ m_aBtn_Light7.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
+ m_aBtn_Light8.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
m_xLB_AmbientLight->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
m_xLB_LightSource->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
@@ -242,13 +243,15 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage(weld::Contain
m_xCtl_Preview->SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) );
m_xCtl_Preview->SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) );
- ClickLightSourceButtonHdl(*m_xBtn_Light2->get_widget());
+ ClickLightSourceButtonHdl(*m_aBtn_Light2.get_widget());
m_aModelChangeListener.startListening( uno::Reference< util::XModifyBroadcaster >(m_xSceneProperties, uno::UNO_QUERY) );
}
ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage()
{
+ // drop page view before the widget it paints to is destroyed
+ m_xPreview->ClearPageView();
}
IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel, void*, void)
@@ -353,9 +356,9 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, weld::Button&, rBut
bool bIsAmbientLight = (&rButton == m_xBtn_AmbientLight_Color.get());
ColorListBox* pListBox = bIsAmbientLight ? m_xLB_AmbientLight.get() : m_xLB_LightSource.get();
- SvColorDialog aColorDlg;
+ ColorDialog aColorDlg(m_pTopLevel);
aColorDlg.SetColor( pListBox->GetSelectEntryColor() );
- if( aColorDlg.Execute(m_pTopLevel) != RET_OK )
+ if (aColorDlg.Execute() != RET_OK)
return;
Color aColor( aColorDlg.GetColor());
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
index 7ad91e225d37..98a1f3273620 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
@@ -22,6 +22,7 @@
#include <TimerTriggeredControllerLock.hxx>
#include <vcl/weld.hxx>
#include <svx/dlgctl3d.hxx>
+#include <svx/float3d.hxx>
namespace com::sun::star::beans
{
@@ -29,7 +30,6 @@ class XPropertySet;
}
class ColorListBox;
-class LightButton;
namespace chart
{
@@ -39,10 +39,9 @@ class ChartModel;
class ThreeD_SceneIllumination_TabPage
{
public:
- ThreeD_SceneIllumination_TabPage(
- weld::Container* pParent, weld::Window* pTopLevel,
- const css::uno::Reference<css::beans::XPropertySet>& xSceneProperties,
- const rtl::Reference<::chart::ChartModel>& xChartModel);
+ ThreeD_SceneIllumination_TabPage(weld::Container* pParent, weld::Window* pTopLevel,
+ css::uno::Reference<css::beans::XPropertySet> xSceneProperties,
+ const rtl::Reference<::chart::ChartModel>& xChartModel);
~ThreeD_SceneIllumination_TabPage();
private:
@@ -74,14 +73,14 @@ private:
weld::Window* m_pTopLevel;
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Container> m_xContainer;
- std::unique_ptr<LightButton> m_xBtn_Light1;
- std::unique_ptr<LightButton> m_xBtn_Light2;
- std::unique_ptr<LightButton> m_xBtn_Light3;
- std::unique_ptr<LightButton> m_xBtn_Light4;
- std::unique_ptr<LightButton> m_xBtn_Light5;
- std::unique_ptr<LightButton> m_xBtn_Light6;
- std::unique_ptr<LightButton> m_xBtn_Light7;
- std::unique_ptr<LightButton> m_xBtn_Light8;
+ LightButton m_aBtn_Light1;
+ LightButton m_aBtn_Light2;
+ LightButton m_aBtn_Light3;
+ LightButton m_aBtn_Light4;
+ LightButton m_aBtn_Light5;
+ LightButton m_aBtn_Light6;
+ LightButton m_aBtn_Light7;
+ LightButton m_aBtn_Light8;
std::unique_ptr<ColorListBox> m_xLB_LightSource;
std::unique_ptr<weld::Button> m_xBtn_LightSource_Color;
std::unique_ptr<ColorListBox> m_xLB_AmbientLight;
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index 1ee392238141..396086bb46a6 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -31,31 +31,30 @@ namespace chart
{
SchAxisLabelTabPage::SchAxisLabelTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_axisLabel.ui", "AxisLabelTabPage", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_axisLabel.ui"_ustr, u"AxisLabelTabPage"_ustr, &rInAttrs)
, m_bShowStaggeringControls( true )
, m_nInitialDegrees( 0 )
, m_bHasInitialDegrees( true )
, m_bInitialStacking( false )
, m_bHasInitialStacking( true )
, m_bComplexCategories( false )
- , m_xCbShowDescription(m_xBuilder->weld_check_button("showlabelsCB"))
- , m_xFlOrder(m_xBuilder->weld_label("orderL"))
- , m_xRbSideBySide(m_xBuilder->weld_radio_button("tile"))
- , m_xRbUpDown(m_xBuilder->weld_radio_button("odd"))
- , m_xRbDownUp(m_xBuilder->weld_radio_button("even"))
- , m_xRbAuto(m_xBuilder->weld_radio_button("auto"))
- , m_xFlTextFlow(m_xBuilder->weld_label("textflowL"))
- , m_xCbTextOverlap(m_xBuilder->weld_check_button("overlapCB"))
- , m_xCbTextBreak(m_xBuilder->weld_check_button("breakCB"))
- , m_xFtABCD(m_xBuilder->weld_label("labelABCD"))
- , m_xFlOrient(m_xBuilder->weld_label("labelTextOrient"))
- , m_xFtRotate(m_xBuilder->weld_label("degreeL"))
- , m_xNfRotate(m_xBuilder->weld_metric_spin_button("OrientDegree", FieldUnit::DEGREE))
- , m_xCbStacked(m_xBuilder->weld_check_button("stackedCB"))
- , m_xFtTextDirection(m_xBuilder->weld_label("textdirL"))
- , m_xLbTextDirection(new TextDirectionListBox(m_xBuilder->weld_combo_box("textdirLB")))
+ , m_xCbShowDescription(m_xBuilder->weld_check_button(u"showlabelsCB"_ustr))
+ , m_xFlOrder(m_xBuilder->weld_label(u"orderL"_ustr))
+ , m_xRbSideBySide(m_xBuilder->weld_radio_button(u"tile"_ustr))
+ , m_xRbUpDown(m_xBuilder->weld_radio_button(u"odd"_ustr))
+ , m_xRbDownUp(m_xBuilder->weld_radio_button(u"even"_ustr))
+ , m_xRbAuto(m_xBuilder->weld_radio_button(u"auto"_ustr))
+ , m_xFlTextFlow(m_xBuilder->weld_label(u"textflowL"_ustr))
+ , m_xCbTextOverlap(m_xBuilder->weld_check_button(u"overlapCB"_ustr))
+ , m_xCbTextBreak(m_xBuilder->weld_check_button(u"breakCB"_ustr))
+ , m_xFtABCD(m_xBuilder->weld_label(u"labelABCD"_ustr))
+ , m_xFtRotate(m_xBuilder->weld_label(u"degreeL"_ustr))
+ , m_xNfRotate(m_xBuilder->weld_metric_spin_button(u"OrientDegree"_ustr, FieldUnit::DEGREE))
+ , m_xCbStacked(m_xBuilder->weld_check_button(u"stackedCB"_ustr))
+ , m_xFtTextDirection(m_xBuilder->weld_label(u"textdirL"_ustr))
+ , m_aLbTextDirection(m_xBuilder->weld_combo_box(u"textdirLB"_ustr))
, m_xCtrlDial(new svx::DialControl)
- , m_xCtrlDialWin(new weld::CustomWeld(*m_xBuilder, "dialCtrl", *m_xCtrlDial))
+ , m_xCtrlDialWin(new weld::CustomWeld(*m_xBuilder, u"dialCtrl"_ustr, *m_xCtrlDial))
{
m_xCtrlDial->SetText(m_xFtABCD->get_label());
m_xCtrlDial->SetLinkedField(m_xNfRotate.get());
@@ -72,7 +71,6 @@ SchAxisLabelTabPage::~SchAxisLabelTabPage()
{
m_xCtrlDialWin.reset();
m_xCtrlDial.reset();
- m_xLbTextDirection.reset();
}
std::unique_ptr<SfxTabPage> SchAxisLabelTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrs)
@@ -124,8 +122,8 @@ bool SchAxisLabelTabPage::FillItemSet( SfxItemSet* rOutAttrs )
if( m_xCbShowDescription->get_state() != TRISTATE_INDET )
rOutAttrs->Put( SfxBoolItem( SCHATTR_AXIS_SHOWDESCR, m_xCbShowDescription->get_active() ) );
- if (m_xLbTextDirection->get_active() != -1)
- rOutAttrs->Put( SvxFrameDirectionItem( m_xLbTextDirection->get_active_id(), EE_PARA_WRITINGDIR ) );
+ if (m_aLbTextDirection.get_active() != -1)
+ rOutAttrs->Put( SvxFrameDirectionItem( m_aLbTextDirection.get_active_id(), EE_PARA_WRITINGDIR ) );
return true;
}
@@ -136,7 +134,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
// show description
SfxItemState aState = rInAttrs->GetItemState( SCHATTR_AXIS_SHOWDESCR, false, &pPoolItem );
- if( aState == SfxItemState::DONTCARE )
+ if( aState == SfxItemState::INVALID )
{
m_xCbShowDescription->set_state( TRISTATE_INDET );
}
@@ -159,7 +157,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
if( aState == SfxItemState::SET )
m_nInitialDegrees = static_cast< const SdrAngleItem * >( pPoolItem )->GetValue();
- m_bHasInitialDegrees = aState != SfxItemState::DONTCARE;
+ m_bHasInitialDegrees = aState != SfxItemState::INVALID;
if( m_bHasInitialDegrees )
m_xCtrlDial->SetRotation( m_nInitialDegrees );
else
@@ -171,19 +169,19 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
if( aState == SfxItemState::SET )
m_bInitialStacking = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
- m_bHasInitialStacking = aState != SfxItemState::DONTCARE;
+ m_bHasInitialStacking = aState != SfxItemState::INVALID;
if( m_bHasInitialDegrees )
m_xCbStacked->set_state(m_bInitialStacking ? TRISTATE_TRUE : TRISTATE_FALSE);
else
m_xCbStacked->set_state(TRISTATE_INDET);
StackedToggleHdl(*m_xCbStacked);
- if( rInAttrs->GetItemState( EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET )
- m_xLbTextDirection->set_active_id( static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue() );
+ if( const SvxFrameDirectionItem* pDirectionItem = rInAttrs->GetItemIfSet( EE_PARA_WRITINGDIR ) )
+ m_aLbTextDirection.set_active_id( pDirectionItem->GetValue() );
// Text overlap ----------
aState = rInAttrs->GetItemState( SCHATTR_AXIS_LABEL_OVERLAP, false, &pPoolItem );
- if( aState == SfxItemState::DONTCARE )
+ if( aState == SfxItemState::INVALID )
{
m_xCbTextOverlap->set_state( TRISTATE_INDET );
}
@@ -200,7 +198,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
// text break ----------
aState = rInAttrs->GetItemState( SCHATTR_AXIS_LABEL_BREAK, false, &pPoolItem );
- if( aState == SfxItemState::DONTCARE )
+ if( aState == SfxItemState::INVALID )
{
m_xCbTextBreak->set_state( TRISTATE_INDET );
}
@@ -222,10 +220,9 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
// text order ----------
if( m_bShowStaggeringControls )
{
- aState = rInAttrs->GetItemState( SCHATTR_AXIS_LABEL_ORDER, false, &pPoolItem );
- if( aState == SfxItemState::SET )
+ if( const SvxChartTextOrderItem* pOrderItem = rInAttrs->GetItemIfSet( SCHATTR_AXIS_LABEL_ORDER, false ) )
{
- SvxChartTextOrder eOrder = static_cast< const SvxChartTextOrderItem * >( pPoolItem )->GetValue();
+ SvxChartTextOrder eOrder = pOrderItem->GetValue();
switch( eOrder )
{
@@ -296,7 +293,7 @@ IMPL_LINK_NOARG(SchAxisLabelTabPage, ToggleShowLabel, weld::Toggleable&, void)
m_xCbTextBreak->set_sensitive( bEnable );
m_xFtTextDirection->set_sensitive( bEnable );
- m_xLbTextDirection->set_sensitive( bEnable );
+ m_aLbTextDirection.set_sensitive( bEnable );
}
} //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
index a94a030fe9a1..f3062163e28c 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
@@ -21,15 +21,13 @@
#include <sfx2/tabdlg.hxx>
#include <svx/dialcontrol.hxx>
#include <tools/degree.hxx>
+#include <TextDirectionListBox.hxx>
-namespace chart { class TextDirectionListBox; }
namespace weld {
class CheckButton;
class CustomWeld;
class Label;
class RadioButton;
- class SpinButton;
- class ToggleButton;
}
namespace chart
@@ -56,12 +54,11 @@ private:
std::unique_ptr<weld::CheckButton> m_xCbTextOverlap;
std::unique_ptr<weld::CheckButton> m_xCbTextBreak;
std::unique_ptr<weld::Label> m_xFtABCD;
- std::unique_ptr<weld::Label> m_xFlOrient;
std::unique_ptr<weld::Label> m_xFtRotate;
std::unique_ptr<weld::MetricSpinButton> m_xNfRotate;
std::unique_ptr<weld::CheckButton> m_xCbStacked;
std::unique_ptr<weld::Label> m_xFtTextDirection;
- std::unique_ptr<TextDirectionListBox> m_xLbTextDirection;
+ TextDirectionListBox m_aLbTextDirection;
std::unique_ptr<svx::DialControl> m_xCtrlDial;
std::unique_ptr<weld::CustomWeld> m_xCtrlDialWin;
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index 6812e9f94818..2faddaad81dd 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -33,28 +33,26 @@ namespace chart
{
AxisPositionsTabPage::AxisPositionsTabPage(weld::Container* pPage, weld::DialogController* pController,const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_AxisPositions.ui", "tp_AxisPositions", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_AxisPositions.ui"_ustr, u"tp_AxisPositions"_ustr, &rInAttrs)
, m_pNumFormatter(nullptr)
, m_bCrossingAxisIsCategoryAxis(false)
, m_bSupportAxisPositioning(false)
, m_bSupportCategoryPositioning(false)
- , m_xFL_AxisLine(m_xBuilder->weld_frame("FL_AXIS_LINE"))
- , m_xLB_CrossesAt(m_xBuilder->weld_combo_box("LB_CROSSES_OTHER_AXIS_AT"))
- , m_xED_CrossesAt(m_xBuilder->weld_formatted_spin_button("EDT_CROSSES_OTHER_AXIS_AT"))
- , m_xED_CrossesAtCategory(m_xBuilder->weld_combo_box( "EDT_CROSSES_OTHER_AXIS_AT_CATEGORY"))
- , m_xCB_AxisBetweenCategories(m_xBuilder->weld_check_button("CB_AXIS_BETWEEN_CATEGORIES"))
- , m_xFL_Position(m_xBuilder->weld_frame("FL_POSITION"))
- , m_xRB_On(m_xBuilder->weld_radio_button("RB_ON"))
- , m_xRB_Between(m_xBuilder->weld_radio_button("RB_BETWEEN"))
- , m_xFL_Labels(m_xBuilder->weld_frame("FL_LABELS"))
- , m_xLB_PlaceLabels(m_xBuilder->weld_combo_box("LB_PLACE_LABELS"))
- , m_xED_LabelDistance(m_xBuilder->weld_formatted_spin_button("EDT_AXIS_LABEL_DISTANCE"))
- , m_xCB_TicksInner(m_xBuilder->weld_check_button("CB_TICKS_INNER"))
- , m_xCB_TicksOuter(m_xBuilder->weld_check_button("CB_TICKS_OUTER"))
- , m_xCB_MinorInner(m_xBuilder->weld_check_button("CB_MINOR_INNER"))
- , m_xCB_MinorOuter(m_xBuilder->weld_check_button("CB_MINOR_OUTER"))
- , m_xBxPlaceTicks(m_xBuilder->weld_widget("boxPLACE_TICKS"))
- , m_xLB_PlaceTicks(m_xBuilder->weld_combo_box("LB_PLACE_TICKS"))
+ , m_xFL_AxisLine(m_xBuilder->weld_frame(u"FL_AXIS_LINE"_ustr))
+ , m_xLB_CrossesAt(m_xBuilder->weld_combo_box(u"LB_CROSSES_OTHER_AXIS_AT"_ustr))
+ , m_xED_CrossesAt(m_xBuilder->weld_formatted_spin_button(u"EDT_CROSSES_OTHER_AXIS_AT"_ustr))
+ , m_xED_CrossesAtCategory(m_xBuilder->weld_combo_box( u"EDT_CROSSES_OTHER_AXIS_AT_CATEGORY"_ustr))
+ , m_xFL_Position(m_xBuilder->weld_frame(u"FL_POSITION"_ustr))
+ , m_xRB_On(m_xBuilder->weld_radio_button(u"RB_ON"_ustr))
+ , m_xRB_Between(m_xBuilder->weld_radio_button(u"RB_BETWEEN"_ustr))
+ , m_xFL_Labels(m_xBuilder->weld_frame(u"FL_LABELS"_ustr))
+ , m_xLB_PlaceLabels(m_xBuilder->weld_combo_box(u"LB_PLACE_LABELS"_ustr))
+ , m_xCB_TicksInner(m_xBuilder->weld_check_button(u"CB_TICKS_INNER"_ustr))
+ , m_xCB_TicksOuter(m_xBuilder->weld_check_button(u"CB_TICKS_OUTER"_ustr))
+ , m_xCB_MinorInner(m_xBuilder->weld_check_button(u"CB_MINOR_INNER"_ustr))
+ , m_xCB_MinorOuter(m_xBuilder->weld_check_button(u"CB_MINOR_OUTER"_ustr))
+ , m_xBxPlaceTicks(m_xBuilder->weld_widget(u"boxPLACE_TICKS"_ustr))
+ , m_xLB_PlaceTicks(m_xBuilder->weld_combo_box(u"LB_PLACE_TICKS"_ustr))
{
m_xLB_CrossesAt->connect_changed(LINK(this, AxisPositionsTabPage, CrossesAtSelectHdl));
m_xLB_PlaceLabels->connect_changed(LINK(this, AxisPositionsTabPage, PlaceLabelsSelectHdl));
@@ -100,8 +98,8 @@ bool AxisPositionsTabPage::FillItemSet(SfxItemSet* rOutAttrs)
rOutAttrs->Put( SfxInt32Item( SCHATTR_AXIS_LABEL_POSITION, nLabelPos ));
// tick marks
- tools::Long nTicks=0;
- tools::Long nMinorTicks=0;
+ sal_Int32 nTicks=0;
+ sal_Int32 nMinorTicks=0;
if(m_xCB_MinorInner->get_active())
nMinorTicks|=CHAXIS_MARK_INNER;
@@ -129,7 +127,7 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
m_xED_CrossesAtCategory->set_visible( m_bCrossingAxisIsCategoryAxis );
if (m_bCrossingAxisIsCategoryAxis)
{
- for( auto const & cat : std::as_const(m_aCategories) )
+ for (auto const& cat : m_aCategories)
m_xED_CrossesAtCategory->append_text(cat);
}
@@ -142,13 +140,12 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
}
//fill controls
- const SfxPoolItem *pPoolItem = nullptr;
//axis line
- if(rInAttrs->GetItemState(SCHATTR_AXIS_POSITION,true, &pPoolItem)== SfxItemState::SET)
+ if(SfxInt32Item const * pPositionItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_POSITION))
{
bool bZero = false;
- sal_Int32 nPos = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_Int32 nPos = pPositionItem->GetValue();
if(nPos==0)
{
//switch to value
@@ -162,11 +159,12 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
m_xLB_CrossesAt->set_active( nPos );
CrossesAtSelectHdl( *m_xLB_CrossesAt );
- if( rInAttrs->GetItemState(SCHATTR_AXIS_POSITION_VALUE,true, &pPoolItem)== SfxItemState::SET || bZero )
+ const SvxDoubleItem* pPosValueItem;
+ if( (pPosValueItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_POSITION_VALUE)) || bZero )
{
double fCrossover = 0.0;
if( !bZero )
- fCrossover = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue();
+ fCrossover = pPosValueItem->GetValue();
if( m_bCrossingAxisIsCategoryAxis )
m_xED_CrossesAtCategory->set_active( static_cast<sal_uInt16>(::rtl::math::round(fCrossover-1.0)) );
else
@@ -178,7 +176,7 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
else
{
m_xED_CrossesAtCategory->set_active(-1);
- m_xED_CrossesAt->set_text("");
+ m_xED_CrossesAt->set_text(u""_ustr);
}
}
else
@@ -188,9 +186,10 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
}
// shifted category position
- if (m_bSupportCategoryPositioning && rInAttrs->GetItemState(SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION, true, &pPoolItem) == SfxItemState::SET)
+ const SfxBoolItem* pCatPosItem;
+ if (m_bSupportCategoryPositioning && (pCatPosItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION)))
{
- if (static_cast<const SfxBoolItem*>(pPoolItem)->GetValue())
+ if (pCatPosItem->GetValue())
m_xRB_Between->set_active(true);
else
m_xRB_On->set_active(true);
@@ -199,9 +198,9 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
m_xFL_Position->hide();
// Labels
- if( rInAttrs->GetItemState( SCHATTR_AXIS_LABEL_POSITION, false, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxInt32Item* pLabelPosItem = rInAttrs->GetItemIfSet( SCHATTR_AXIS_LABEL_POSITION, false) )
{
- sal_Int32 nPos = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_Int32 nPos = pLabelPosItem->GetValue();
if( nPos < m_xLB_PlaceLabels->get_count() )
m_xLB_PlaceLabels->set_active( nPos );
}
@@ -211,10 +210,10 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
// Tick marks
tools::Long nTicks = 0, nMinorTicks = 0;
- if (rInAttrs->GetItemState(SCHATTR_AXIS_TICKS,true, &pPoolItem)== SfxItemState::SET)
- nTicks = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
- if (rInAttrs->GetItemState(SCHATTR_AXIS_HELPTICKS,true, &pPoolItem)== SfxItemState::SET)
- nMinorTicks = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ if (const SfxInt32Item* pTicksItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_TICKS))
+ nTicks = pTicksItem->GetValue();
+ if (const SfxInt32Item* pHelpTicksItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_HELPTICKS))
+ nMinorTicks = pHelpTicksItem->GetValue();
m_xCB_TicksInner->set_active(bool(nTicks&CHAXIS_MARK_INNER));
m_xCB_TicksOuter->set_active(bool(nTicks&CHAXIS_MARK_OUTER));
@@ -222,9 +221,9 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
m_xCB_MinorOuter->set_active(bool(nMinorTicks&CHAXIS_MARK_OUTER));
// Tick position
- if( rInAttrs->GetItemState( SCHATTR_AXIS_MARK_POSITION, false, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxInt32Item* pMarkPosItem = rInAttrs->GetItemIfSet( SCHATTR_AXIS_MARK_POSITION, false) )
{
- sal_Int32 nPos = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_Int32 nPos = pMarkPosItem->GetValue();
if( nPos < m_xLB_PlaceTicks->get_count() )
m_xLB_PlaceTicks->set_active( nPos );
}
@@ -261,10 +260,9 @@ void AxisPositionsTabPage::SetNumFormatter( SvNumberFormatter* pFormatter )
rCrossFormatter.SetFormatter(m_pNumFormatter);
rCrossFormatter.UseInputStringForFormatting();
- const SfxPoolItem *pPoolItem = nullptr;
- if( GetItemSet().GetItemState( SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxUInt32Item* pNumFormatItem = GetItemSet().GetItemIfSet(SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT) )
{
- sal_uLong nFmt = static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
+ sal_uInt32 nFmt = pNumFormatItem->GetValue();
rCrossFormatter.SetFormatKey(nFmt);
}
}
@@ -297,7 +295,7 @@ IMPL_LINK_NOARG(AxisPositionsTabPage, CrossesAtSelectHdl, weld::ComboBox&, void)
if (m_xED_CrossesAt->get_text().isEmpty())
m_xED_CrossesAt->GetFormatter().SetValue(0.0);
- if (m_xED_CrossesAtCategory->get_active() == -1)
+ if (m_xED_CrossesAtCategory->get_active() == -1 && m_xED_CrossesAtCategory->get_count())
m_xED_CrossesAtCategory->set_active(0);
PlaceLabelsSelectHdl(*m_xLB_PlaceLabels);
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.hxx b/chart2/source/controller/dialogs/tp_AxisPositions.hxx
index d7f18242dd42..0b570d651d1f 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.hxx
@@ -20,6 +20,8 @@
#include <sfx2/tabdlg.hxx>
+class SvNumberFormatter;
+
namespace chart
{
class AxisPositionsTabPage : public SfxTabPage
@@ -60,7 +62,6 @@ private: //member:
std::unique_ptr<weld::ComboBox> m_xLB_CrossesAt;
std::unique_ptr<weld::FormattedSpinButton> m_xED_CrossesAt;
std::unique_ptr<weld::ComboBox> m_xED_CrossesAtCategory;
- std::unique_ptr<weld::CheckButton> m_xCB_AxisBetweenCategories;
std::unique_ptr<weld::Frame> m_xFL_Position;
std::unique_ptr<weld::RadioButton> m_xRB_On;
@@ -68,7 +69,6 @@ private: //member:
std::unique_ptr<weld::Frame> m_xFL_Labels;
std::unique_ptr<weld::ComboBox> m_xLB_PlaceLabels;
- std::unique_ptr<weld::FormattedSpinButton> m_xED_LabelDistance;
std::unique_ptr<weld::CheckButton> m_xCB_TicksInner;
std::unique_ptr<weld::CheckButton> m_xCB_TicksOuter;
diff --git a/chart2/source/controller/dialogs/tp_ChartColorPalette.cxx b/chart2/source/controller/dialogs/tp_ChartColorPalette.cxx
new file mode 100644
index 000000000000..c52148c9dc17
--- /dev/null
+++ b/chart2/source/controller/dialogs/tp_ChartColorPalette.cxx
@@ -0,0 +1,188 @@
+/* -*- 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 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 .
+ */
+
+#include "tp_ChartColorPalette.hxx"
+
+#include <ChartColorPaletteHelper.hxx>
+#include <ChartModel.hxx>
+#include <chartview/ChartSfxItemIds.hxx>
+#include <svx/chrtitem.hxx>
+#include <vcl/svapp.hxx>
+
+namespace chart
+{
+ChartColorPaletteTabPage::ChartColorPaletteTabPage(weld::Container* pPage,
+ weld::DialogController* pController,
+ const SfxItemSet& rInAttrs)
+ : SfxTabPage(pPage, pController, "modules/schart/ui/tp_ChartColorPalette.ui",
+ "tp_ChartColorPalette", &rInAttrs)
+ , mxColorfulValueSet(new ChartColorPalettes)
+ , mxColorfulValueSetWin(
+ new weld::CustomWeld(*m_xBuilder, "colorful_palettes", *mxColorfulValueSet))
+ , mxMonoValueSet(new ChartColorPalettes)
+ , mxMonoValueSetWin(
+ new weld::CustomWeld(*m_xBuilder, "monochromatic_palettes", *mxMonoValueSet))
+{
+ mxColorfulValueSet->SetColCount(2);
+ mxColorfulValueSet->SetLineCount(2);
+ mxColorfulValueSet->SetColor(Application::GetSettings().GetStyleSettings().GetFaceColor());
+
+ mxMonoValueSet->SetColCount(2);
+ mxMonoValueSet->SetLineCount(3);
+ mxMonoValueSet->SetColor(Application::GetSettings().GetStyleSettings().GetFaceColor());
+
+ mxColorfulValueSet->SetOptimalSize();
+ mxColorfulValueSet->SetSelectHdl(
+ LINK(this, ChartColorPaletteTabPage, SelectColorfulValueSetHdl));
+
+ mxMonoValueSet->SetOptimalSize();
+ mxMonoValueSet->SetSelectHdl(LINK(this, ChartColorPaletteTabPage, SelectMonoValueSetHdl));
+}
+
+ChartColorPaletteTabPage::~ChartColorPaletteTabPage()
+{
+ mxColorfulValueSetWin.reset();
+ mxColorfulValueSet.reset();
+ mxMonoValueSetWin.reset();
+ mxMonoValueSet.reset();
+}
+
+std::unique_ptr<SfxTabPage> ChartColorPaletteTabPage::Create(weld::Container* pPage,
+ weld::DialogController* pController,
+ const SfxItemSet* rInAttrs)
+{
+ return std::make_unique<ChartColorPaletteTabPage>(pPage, pController, *rInAttrs);
+}
+
+void ChartColorPaletteTabPage::init(const rtl::Reference<ChartModel>& xChartModel)
+{
+ assert(xChartModel);
+ mxChartModel = xChartModel;
+
+ const std::shared_ptr<model::Theme> pTheme = mxChartModel->getDocumentTheme();
+ mxHelper = std::make_unique<ChartColorPaletteHelper>(pTheme);
+
+ selectItem(mxChartModel->getColorPaletteType(), mxChartModel->getColorPaletteIndex() + 1);
+ initColorPalettes();
+}
+
+void ChartColorPaletteTabPage::initColorPalettes() const
+{
+ if (!mxHelper)
+ return;
+ // colorful palettes
+ for (size_t i = 0; i < ChartColorPaletteHelper::ColorfulPaletteSize; ++i)
+ mxColorfulValueSet->insert(mxHelper->getColorPalette(ChartColorPaletteType::Colorful, i));
+ // monotonic palettes
+ for (size_t i = 0; i < ChartColorPaletteHelper::MonotonicPaletteSize; ++i)
+ mxMonoValueSet->insert(mxHelper->getColorPalette(ChartColorPaletteType::Monochromatic, i));
+}
+
+void ChartColorPaletteTabPage::selectItem(const ChartColorPaletteType eType,
+ const sal_uInt32 nIndex) const
+{
+ switch (eType)
+ {
+ default:
+ case ChartColorPaletteType::Unknown:
+ mxColorfulValueSet->SetNoSelection();
+ mxMonoValueSet->SetNoSelection();
+ break;
+ case ChartColorPaletteType::Colorful:
+ mxMonoValueSet->SetNoSelection();
+ mxColorfulValueSet->SelectItem(nIndex);
+ break;
+ case ChartColorPaletteType::Monochromatic:
+ mxColorfulValueSet->SetNoSelection();
+ mxMonoValueSet->SelectItem(nIndex);
+ break;
+ }
+}
+
+bool ChartColorPaletteTabPage::FillItemSet(SfxItemSet* pOutAttrs)
+{
+ ChartColorPaletteType eType = ChartColorPaletteType::Unknown;
+ sal_uInt32 nIndex = 0;
+
+ if (!mxColorfulValueSet->IsNoSelection())
+ {
+ eType = ChartColorPaletteType::Colorful;
+ nIndex = mxColorfulValueSet->GetSelectedItemId() - 1;
+ }
+ else if (!mxMonoValueSet->IsNoSelection())
+ {
+ eType = ChartColorPaletteType::Monochromatic;
+ nIndex = mxMonoValueSet->GetSelectedItemId() - 1;
+ }
+
+ pOutAttrs->Put(SvxChartColorPaletteItem(eType, nIndex, SCHATTR_COLOR_PALETTE));
+
+ return true;
+}
+
+void ChartColorPaletteTabPage::Reset(const SfxItemSet*)
+{
+ selectItem(mxChartModel->getColorPaletteType(), mxChartModel->getColorPaletteIndex() + 1);
+}
+
+DeactivateRC ChartColorPaletteTabPage::DeactivatePage(SfxItemSet* pItemSet)
+{
+ if (pItemSet)
+ FillItemSet(pItemSet);
+
+ return DeactivateRC::LeavePage;
+}
+
+IMPL_LINK_NOARG(ChartColorPaletteTabPage, SelectColorfulValueSetHdl, ValueSet*, void)
+{
+ sal_uInt32 nIndex = SelectValueSetHdl(mxColorfulValueSet);
+ if (nIndex != static_cast<sal_uInt32>(-1))
+ {
+ mxMonoValueSet->SetNoSelection();
+ }
+}
+
+IMPL_LINK_NOARG(ChartColorPaletteTabPage, SelectMonoValueSetHdl, ValueSet*, void)
+{
+ sal_uInt32 nIndex = SelectValueSetHdl(mxMonoValueSet);
+ if (nIndex != static_cast<sal_uInt32>(-1))
+ {
+ mxColorfulValueSet->SetNoSelection();
+ }
+}
+
+sal_uInt32
+ChartColorPaletteTabPage::SelectValueSetHdl(const std::unique_ptr<ChartColorPalettes>& xValueSet)
+{
+ const sal_uInt32 nItemId = xValueSet->GetSelectedItemId();
+
+ if (!nItemId)
+ return static_cast<sal_uInt32>(-1);
+
+ const sal_uInt32 nIndex = nItemId - 1;
+
+ if (xValueSet->getPalette(nIndex))
+ {
+ return nIndex;
+ }
+ return static_cast<sal_uInt32>(-1);
+}
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/tp_ChartColorPalette.hxx b/chart2/source/controller/dialogs/tp_ChartColorPalette.hxx
new file mode 100644
index 000000000000..02cfe3cd5c94
--- /dev/null
+++ b/chart2/source/controller/dialogs/tp_ChartColorPalette.hxx
@@ -0,0 +1,64 @@
+/* -*- 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 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 .
+ */
+
+#pragma once
+
+#include <sfx2/tabdlg.hxx>
+#include <ChartColorPalettes.hxx>
+
+namespace chart
+{
+class ChartModel;
+class ChartColorPaletteHelper;
+
+class ChartColorPaletteTabPage final : public SfxTabPage
+{
+public:
+ ChartColorPaletteTabPage(weld::Container* pPage, weld::DialogController* pController,
+ const SfxItemSet& rInAttrs);
+ ~ChartColorPaletteTabPage() override;
+
+ static std::unique_ptr<SfxTabPage>
+ Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rInAttrs);
+
+ bool FillItemSet(SfxItemSet* pOutAttrs) override;
+ void Reset(const SfxItemSet* rInAttrs) override;
+ DeactivateRC DeactivatePage(SfxItemSet* pItemSet) override;
+
+ void init(const rtl::Reference<ChartModel>& xChartModel);
+
+private:
+ void selectItem(ChartColorPaletteType eType, sal_uInt32 nIndex) const;
+ void initColorPalettes() const;
+
+private:
+ rtl::Reference<ChartModel> mxChartModel;
+ std::unique_ptr<ChartColorPaletteHelper> mxHelper;
+ std::unique_ptr<ChartColorPalettes> mxColorfulValueSet;
+ std::unique_ptr<weld::CustomWeld> mxColorfulValueSetWin;
+ std::unique_ptr<ChartColorPalettes> mxMonoValueSet;
+ std::unique_ptr<weld::CustomWeld> mxMonoValueSetWin;
+
+ DECL_LINK(SelectColorfulValueSetHdl, ValueSet*, void);
+ DECL_LINK(SelectMonoValueSetHdl, ValueSet*, void);
+ static sal_uInt32 SelectValueSetHdl(const std::unique_ptr<ChartColorPalettes>& xValueSet);
+};
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index f5eec8625bc7..45f5b277ef7e 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -22,43 +22,40 @@
#include <ChartTypeManager.hxx>
#include <strings.hrc>
#include <ResId.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
#include <ChartTypeTemplate.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <unonames.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <svtools/valueset.hxx>
+#include <utility>
#include <vcl/weld.hxx>
#include <vcl/outdev.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-ChartTypeTabPage::ChartTypeTabPage(weld::Container* pPage, weld::DialogController* pController, const rtl::Reference<::chart::ChartModel>& xChartModel,
+ChartTypeTabPage::ChartTypeTabPage(weld::Container* pPage, weld::DialogController* pController, rtl::Reference<::chart::ChartModel> xChartModel,
bool bShowDescription)
- : OWizardPage(pPage, pController, "modules/schart/ui/tp_ChartType.ui", "tp_ChartType")
+ : OWizardPage(pPage, pController, u"modules/schart/ui/tp_ChartType.ui"_ustr, u"tp_ChartType"_ustr)
, m_pDim3DLookResourceGroup( new Dim3DLookResourceGroup(m_xBuilder.get()) )
, m_pStackingResourceGroup( new StackingResourceGroup(m_xBuilder.get()) )
, m_pSplineResourceGroup( new SplineResourceGroup(m_xBuilder.get(), pController->getDialog()) )
, m_pGeometryResourceGroup( new GeometryResourceGroup(m_xBuilder.get()) )
, m_pSortByXValuesResourceGroup( new SortByXValuesResourceGroup(m_xBuilder.get()) )
- , m_xChartModel( xChartModel )
+ , m_xChartModel(std::move( xChartModel ))
, m_aChartTypeDialogControllerList(0)
, m_pCurrentMainType(nullptr)
, m_nChangingCalls(0)
, m_aTimerTriggeredControllerLock( m_xChartModel )
- , m_xFT_ChooseType(m_xBuilder->weld_label("FT_CAPTION_FOR_WIZARD"))
- , m_xMainTypeList(m_xBuilder->weld_tree_view("charttype"))
- , m_xSubTypeList(new ValueSet(m_xBuilder->weld_scrolled_window("subtypewin", true)))
- , m_xSubTypeListWin(new weld::CustomWeld(*m_xBuilder, "subtype", *m_xSubTypeList))
+ , m_xFT_ChooseType(m_xBuilder->weld_label(u"FT_CAPTION_FOR_WIZARD"_ustr))
+ , m_xMainTypeList(m_xBuilder->weld_tree_view(u"charttype"_ustr))
+ , m_xSubTypeList(new ValueSet(m_xBuilder->weld_scrolled_window(u"subtypewin"_ustr, true)))
+ , m_xSubTypeListWin(new weld::CustomWeld(*m_xBuilder, u"subtype"_ustr, *m_xSubTypeList))
{
Size aSize(m_xSubTypeList->GetDrawingArea()->get_ref_device().LogicToPixel(Size(150, 50), MapMode(MapUnit::MapAppFont)));
m_xSubTypeListWin->set_size_request(aSize.Width(), aSize.Height());
@@ -74,11 +71,15 @@ ChartTypeTabPage::ChartTypeTabPage(weld::Container* pPage, weld::DialogControlle
SetPageTitle(SchResId(STR_PAGE_CHARTTYPE));
- m_xMainTypeList->connect_changed(LINK(this, ChartTypeTabPage, SelectMainTypeHdl));
+ m_xMainTypeList->connect_selection_changed(LINK(this, ChartTypeTabPage, SelectMainTypeHdl));
m_xSubTypeList->SetSelectHdl( LINK( this, ChartTypeTabPage, SelectSubTypeHdl ) );
m_xSubTypeList->SetStyle(m_xSubTypeList->GetStyle() |
WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD | WB_FLATVALUESET | WB_3DLOOK );
+ // Set number of columns in chart type selector.
+ // TODO: Ideally this would not be hard-coded, but determined
+ // programmatically based on the maximum number of chart types across all
+ // controllers.
m_xSubTypeList->SetColCount(4);
m_xSubTypeList->SetLineCount(1);
@@ -88,7 +89,7 @@ ChartTypeTabPage::ChartTypeTabPage(weld::Container* pPage, weld::DialogControlle
{
try
{
- xProps->getPropertyValue("EnableComplexChartTypes") >>= bEnableComplexChartTypes;
+ xProps->getPropertyValue(u"EnableComplexChartTypes"_ustr) >>= bEnableComplexChartTypes;
}
catch( const uno::Exception& )
{
@@ -98,7 +99,9 @@ ChartTypeTabPage::ChartTypeTabPage(weld::Container* pPage, weld::DialogControlle
m_aChartTypeDialogControllerList.push_back(std::make_unique<ColumnChartDialogController>());
m_aChartTypeDialogControllerList.push_back(std::make_unique<BarChartDialogController>());
+ m_aChartTypeDialogControllerList.push_back(std::make_unique<HistogramChartDialogController>());
m_aChartTypeDialogControllerList.push_back(std::make_unique<PieChartDialogController>());
+ m_aChartTypeDialogControllerList.push_back(std::make_unique<OfPieChartDialogController>());
m_aChartTypeDialogControllerList.push_back(std::make_unique<AreaChartDialogController>());
m_aChartTypeDialogControllerList.push_back(std::make_unique<LineChartDialogController>());
if (bEnableComplexChartTypes)
@@ -117,7 +120,7 @@ ChartTypeTabPage::ChartTypeTabPage(weld::Container* pPage, weld::DialogControlle
for (auto const& elem : m_aChartTypeDialogControllerList)
{
- m_xMainTypeList->append("", elem->getName(), elem->getImage());
+ m_xMainTypeList->append(u""_ustr, elem->getName(), elem->getImage());
elem->setChangeListener( this );
}
@@ -163,7 +166,8 @@ void ChartTypeTabPage::commitToModel( const ChartTypeParameter& rParameter )
return;
m_aTimerTriggeredControllerLock.startTimer();
- m_pCurrentMainType->commitToModel( rParameter, m_xChartModel );
+ uno::Reference< beans::XPropertySet > xTemplateProps( static_cast<cppu::OWeakObject*>(getCurrentTemplate().get()), uno::UNO_QUERY );
+ m_pCurrentMainType->commitToModel( rParameter, m_xChartModel, xTemplateProps );
}
void ChartTypeTabPage::stateChanged()
@@ -181,9 +185,9 @@ void ChartTypeTabPage::stateChanged()
commitToModel( aParameter );
//detect the new ThreeDLookScheme
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
+ rtl::Reference< Diagram > xDiagram = m_xChartModel->getFirstChartDiagram();
// tdf#124295 - select always a 3D scheme
- if (ThreeDLookScheme aThreeDLookScheme = ThreeDHelper::detectScheme(xDiagram);
+ if (ThreeDLookScheme aThreeDLookScheme = xDiagram->detectScheme();
aThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Unknown)
aParameter.eThreeDLookScheme = aThreeDLookScheme;
@@ -246,15 +250,18 @@ void ChartTypeTabPage::selectMainType()
m_pCurrentMainType->adjustParameterToMainType( aParameter );
commitToModel( aParameter );
//detect the new ThreeDLookScheme
- aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( ChartModelHelper::findDiagram( m_xChartModel ) );
+ aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Unknown;
+ rtl::Reference< Diagram > xDiagram = m_xChartModel->getFirstChartDiagram();
+ if (xDiagram)
+ aParameter.eThreeDLookScheme = m_xChartModel->getFirstChartDiagram()->detectScheme();
if (!aParameter.b3DLook
&& aParameter.eThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Realistic)
aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic;
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
try
{
- xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= aParameter.bSortByXValues;
+ if (xDiagram)
+ xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= aParameter.bSortByXValues;
}
catch ( const uno::Exception& )
{
@@ -305,9 +312,10 @@ void ChartTypeTabPage::initializePage()
if( !m_xChartModel.is() )
return;
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = m_xChartModel->getTypeManager();
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( m_xChartModel );
- DiagramHelper::tTemplateWithServiceName aTemplate =
- DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
+ rtl::Reference< Diagram > xDiagram = m_xChartModel->getFirstChartDiagram();
+ Diagram::tTemplateWithServiceName aTemplate;
+ if (xDiagram)
+ aTemplate = xDiagram->getTemplate( xChartTypeManager );
OUString aServiceName( aTemplate.sServiceName );
bool bFound = false;
@@ -326,7 +334,7 @@ void ChartTypeTabPage::initializePage()
m_pCurrentMainType = getSelectedMainType();
//set ThreeDLookScheme
- aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( xDiagram );
+ aParameter.eThreeDLookScheme = xDiagram->detectScheme();
if (!aParameter.b3DLook
&& aParameter.eThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Realistic)
aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx
index 34ed8abf2327..c01b599f58d5 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.hxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.hxx
@@ -45,7 +45,7 @@ class ChartTypeTabPage final : public ResourceChangeListener, public vcl::OWizar
{
public:
ChartTypeTabPage( weld::Container* pPage, weld::DialogController* pController
- , const rtl::Reference<::chart::ChartModel>& xChartModel
+ , rtl::Reference<::chart::ChartModel> xChartModel
, bool bShowDescription = true );
virtual ~ChartTypeTabPage() override;
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx
index 3594e3e8ffeb..0bd8f6831f27 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx
@@ -23,7 +23,7 @@ namespace chart
{
DataLabelsTabPage::DataLabelsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_DataLabel.ui", "tp_DataLabel", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_DataLabel.ui"_ustr, u"tp_DataLabel"_ustr, &rInAttrs)
, m_aDataLabelResources(m_xBuilder.get(), pController->getDialog(), rInAttrs)
{
}
diff --git a/chart2/source/controller/dialogs/tp_DataPointOption.cxx b/chart2/source/controller/dialogs/tp_DataPointOption.cxx
index 7fb9f230ed7e..c7bdebde8370 100644
--- a/chart2/source/controller/dialogs/tp_DataPointOption.cxx
+++ b/chart2/source/controller/dialogs/tp_DataPointOption.cxx
@@ -27,9 +27,9 @@ namespace chart
DataPointOptionTabPage::DataPointOptionTabPage(weld::Container* pPage,
weld::DialogController* pController,
const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_DataPointOption.ui",
- "tp_DataPointOption", &rInAttrs)
- , m_xCBHideLegendEntry(m_xBuilder->weld_check_button("CB_LEGEND_ENTRY_HIDDEN"))
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_DataPointOption.ui"_ustr,
+ u"tp_DataPointOption"_ustr, &rInAttrs)
+ , m_xCBHideLegendEntry(m_xBuilder->weld_check_button(u"CB_LEGEND_ENTRY_HIDDEN"_ustr))
{
}
@@ -53,12 +53,10 @@ bool DataPointOptionTabPage::FillItemSet(SfxItemSet* rOutAttrs)
void DataPointOptionTabPage::Reset(const SfxItemSet* rInAttrs)
{
- const SfxPoolItem* pPoolItem = nullptr;
-
- if (rInAttrs->GetItemState(SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY, true, &pPoolItem)
- == SfxItemState::SET)
+ if (const SfxBoolItem* pEntryItem
+ = rInAttrs->GetItemIfSet(SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY))
{
- bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+ bool bVal = pEntryItem->GetValue();
m_xCBHideLegendEntry->set_active(bVal);
}
}
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 45c00bfefb4c..4cc12689ebc9 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -20,36 +20,32 @@
#include "tp_DataSource.hxx"
#include <strings.hrc>
#include <ResId.hxx>
+#include <ChartType.hxx>
#include <ChartTypeTemplateProvider.hxx>
#include <ChartTypeTemplate.hxx>
#include <ChartModel.hxx>
#include <RangeSelectionHelper.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <DataSourceHelper.hxx>
+#include <LabeledDataSequence.hxx>
#include "DialogModel.hxx"
#include <o3tl/safeint.hxx>
#include <TabPageNotifiable.hxx>
-#include <com/sun/star/chart2/XChartType.hpp>
-#include <com/sun/star/chart2/XDataSeries.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/chart2/data/XDataSink.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
namespace
{
-constexpr OUStringLiteral lcl_aLabelRole( u"label" );
+constexpr OUString lcl_aLabelRole( u"label"_ustr );
void lcl_UpdateCurrentRange(weld::TreeView& rOutListBox, const OUString & rRole,
const OUString& rRange)
@@ -59,7 +55,7 @@ void lcl_UpdateCurrentRange(weld::TreeView& rOutListBox, const OUString & rRole,
{
rOutListBox.set_text(nEntry, ::chart::DialogModel::ConvertRoleFromInternalToUI(rRole), 0);
rOutListBox.set_text(nEntry, rRange, 1);
- ::chart::SeriesEntry* pEntry = reinterpret_cast<::chart::SeriesEntry*>(rOutListBox.get_id(nEntry).toInt64());
+ ::chart::SeriesEntry* pEntry = weld::fromId<::chart::SeriesEntry*>(rOutListBox.get_id(nEntry));
pEntry->m_sRole = rRole;
}
}
@@ -71,11 +67,10 @@ bool lcl_UpdateCurrentSeriesName(weld::TreeView& rOutListBox)
return false;
bool bResult = false;
- ::chart::SeriesEntry * pEntry = reinterpret_cast<::chart::SeriesEntry*>(rOutListBox.get_id(nEntry).toInt64());
+ ::chart::SeriesEntry * pEntry = weld::fromId<::chart::SeriesEntry*>(rOutListBox.get_id(nEntry));
if (pEntry->m_xDataSeries.is() && pEntry->m_xChartType.is())
{
- OUString aLabel(::chart::DataSeriesHelper::getDataSeriesLabel(
- pEntry->m_xDataSeries,
+ OUString aLabel(pEntry->m_xDataSeries->getLabelForRole(
pEntry->m_xChartType->getRoleOfSequenceForSeriesLabel()));
if (!aLabel.isEmpty())
{
@@ -93,7 +88,7 @@ OUString lcl_GetSelectedRole(const weld::TreeView& rRoleListBox, bool bUITransla
{
if (bUITranslated)
return rRoleListBox.get_text(nEntry);
- ::chart::SeriesEntry* pEntry = reinterpret_cast<::chart::SeriesEntry*>(rRoleListBox.get_id(nEntry).toInt64());
+ ::chart::SeriesEntry* pEntry = weld::fromId<::chart::SeriesEntry*>(rRoleListBox.get_id(nEntry));
return pEntry->m_sRole;
}
return OUString();
@@ -110,48 +105,36 @@ OUString lcl_GetSelectedRolesRange( const weld::TreeView& rRoleListBox )
OUString lcl_GetSequenceNameForLabel(const ::chart::SeriesEntry* pEntry)
{
- OUString aResult("values-y");
+ OUString aResult(u"values-y"_ustr);
if (pEntry && pEntry->m_xChartType.is())
aResult = pEntry->m_xChartType->getRoleOfSequenceForSeriesLabel();
return aResult;
}
-void lcl_enableRangeChoosing(bool bEnable, weld::DialogController* pDialog)
-{
- if (!pDialog)
- return;
- weld::Dialog* pDlg = pDialog->getDialog();
- pDlg->set_modal(!bEnable);
- pDlg->set_visible(!bEnable);
-}
-
void lcl_addLSequenceToDataSource(
- const Reference< chart2::data::XLabeledDataSequence > & xLSequence,
- const Reference< chart2::data::XDataSource > & xSource )
+ const uno::Reference< chart2::data::XLabeledDataSequence > & xLSequence,
+ const Reference< ::chart::DataSeries > & xSource )
{
- Reference< data::XDataSink > xSink( xSource, uno::UNO_QUERY );
- if( xSink.is())
+ if( xSource.is())
{
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aData( xSource->getDataSequences());
- aData.realloc( aData.getLength() + 1 );
- aData.getArray()[ aData.getLength() - 1 ] = xLSequence;
- xSink->setData( aData );
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aData = xSource->getDataSequences2();
+ aData.push_back( xLSequence );
+ xSource->setData( aData );
}
}
-Reference< chart2::data::XLabeledDataSequence > lcl_findLSequenceWithOnlyLabel(
- const Reference< chart2::data::XDataSource > & xDataSource )
+uno::Reference< chart2::data::XLabeledDataSequence > lcl_findLSequenceWithOnlyLabel(
+ const rtl::Reference< ::chart::DataSeries > & xDataSource )
{
- Reference< chart2::data::XLabeledDataSequence > xResult;
- const Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences( xDataSource->getDataSequences());
+ uno::Reference< chart2::data::XLabeledDataSequence > xResult;
- for( Reference< chart2::data::XLabeledDataSequence > const & labeledDataSeq : aSequences )
+ for( uno::Reference< chart2::data::XLabeledDataSequence > const & labeledDataSeq : xDataSource->getDataSequences2() )
{
// no values are set but a label exists
if( ! labeledDataSeq->getValues().is() &&
labeledDataSeq->getLabel().is())
{
- xResult.set( labeledDataSeq );
+ xResult = labeledDataSeq;
break;
}
}
@@ -168,28 +151,28 @@ DataSourceTabPage::DataSourceTabPage(weld::Container* pPage, weld::DialogControl
DialogModel & rDialogModel,
ChartTypeTemplateProvider* pTemplateProvider,
bool bHideDescription /* = false */)
- : ::vcl::OWizardPage(pPage, pController, "modules/schart/ui/tp_DataSource.ui", "tp_DataSource")
+ : ::vcl::OWizardPage(pPage, pController, u"modules/schart/ui/tp_DataSource.ui"_ustr, u"tp_DataSource"_ustr)
, m_pTemplateProvider(pTemplateProvider)
, m_rDialogModel(rDialogModel)
, m_pCurrentRangeChoosingField( nullptr )
, m_bIsDirty( false )
, m_pTabPageNotifiable(dynamic_cast<TabPageNotifiable*>(pController))
- , m_xFT_CAPTION(m_xBuilder->weld_label("FT_CAPTION_FOR_WIZARD"))
- , m_xFT_SERIES(m_xBuilder->weld_label("FT_SERIES"))
- , m_xLB_SERIES(m_xBuilder->weld_tree_view("LB_SERIES"))
- , m_xBTN_ADD(m_xBuilder->weld_button("BTN_ADD"))
- , m_xBTN_REMOVE(m_xBuilder->weld_button("BTN_REMOVE"))
- , m_xBTN_UP(m_xBuilder->weld_button("BTN_UP"))
- , m_xBTN_DOWN(m_xBuilder->weld_button("BTN_DOWN"))
- , m_xFT_ROLE(m_xBuilder->weld_label("FT_ROLE"))
- , m_xLB_ROLE(m_xBuilder->weld_tree_view("LB_ROLE"))
- , m_xFT_RANGE(m_xBuilder->weld_label("FT_RANGE"))
- , m_xEDT_RANGE(m_xBuilder->weld_entry("EDT_RANGE"))
- , m_xIMB_RANGE_MAIN(m_xBuilder->weld_button("IMB_RANGE_MAIN"))
- , m_xFT_CATEGORIES(m_xBuilder->weld_label("FT_CATEGORIES"))
- , m_xFT_DATALABELS(m_xBuilder->weld_label("FT_DATALABELS"))
- , m_xEDT_CATEGORIES(m_xBuilder->weld_entry("EDT_CATEGORIES"))
- , m_xIMB_RANGE_CAT(m_xBuilder->weld_button("IMB_RANGE_CAT"))
+ , m_xFT_CAPTION(m_xBuilder->weld_label(u"FT_CAPTION_FOR_WIZARD"_ustr))
+ , m_xFT_SERIES(m_xBuilder->weld_label(u"FT_SERIES"_ustr))
+ , m_xLB_SERIES(m_xBuilder->weld_tree_view(u"LB_SERIES"_ustr))
+ , m_xBTN_ADD(m_xBuilder->weld_button(u"BTN_ADD"_ustr))
+ , m_xBTN_REMOVE(m_xBuilder->weld_button(u"BTN_REMOVE"_ustr))
+ , m_xBTN_UP(m_xBuilder->weld_button(u"BTN_UP"_ustr))
+ , m_xBTN_DOWN(m_xBuilder->weld_button(u"BTN_DOWN"_ustr))
+ , m_xFT_ROLE(m_xBuilder->weld_label(u"FT_ROLE"_ustr))
+ , m_xLB_ROLE(m_xBuilder->weld_tree_view(u"LB_ROLE"_ustr))
+ , m_xFT_RANGE(m_xBuilder->weld_label(u"FT_RANGE"_ustr))
+ , m_xEDT_RANGE(m_xBuilder->weld_entry(u"EDT_RANGE"_ustr))
+ , m_xIMB_RANGE_MAIN(m_xBuilder->weld_button(u"IMB_RANGE_MAIN"_ustr))
+ , m_xFT_CATEGORIES(m_xBuilder->weld_label(u"FT_CATEGORIES"_ustr))
+ , m_xFT_DATALABELS(m_xBuilder->weld_label(u"FT_DATALABELS"_ustr))
+ , m_xEDT_CATEGORIES(m_xBuilder->weld_entry(u"EDT_CATEGORIES"_ustr))
+ , m_xIMB_RANGE_CAT(m_xBuilder->weld_button(u"IMB_RANGE_CAT"_ustr))
{
m_xLB_SERIES->set_size_request(m_xLB_SERIES->get_approximate_digit_width() * 25,
m_xLB_SERIES->get_height_rows(10));
@@ -201,8 +184,9 @@ DataSourceTabPage::DataSourceTabPage(weld::Container* pPage, weld::DialogControl
SetPageTitle(SchResId(STR_OBJECT_DATASERIES_PLURAL));
// set handlers
- m_xLB_SERIES->connect_changed(LINK(this, DataSourceTabPage, SeriesSelectionChangedHdl));
- m_xLB_ROLE->connect_changed(LINK(this, DataSourceTabPage, RoleSelectionChangedHdl));
+ m_xLB_SERIES->connect_selection_changed(
+ LINK(this, DataSourceTabPage, SeriesSelectionChangedHdl));
+ m_xLB_ROLE->connect_selection_changed(LINK(this, DataSourceTabPage, RoleSelectionChangedHdl));
m_xIMB_RANGE_MAIN->connect_clicked(LINK(this, DataSourceTabPage, MainRangeButtonClickedHdl));
m_xIMB_RANGE_CAT->connect_clicked(LINK(this, DataSourceTabPage, CategoriesRangeButtonClickedHdl));
@@ -233,7 +217,7 @@ void DataSourceTabPage::InsertRoleLBEntry(const OUString& rRole, const OUString&
m_aEntries.emplace_back(new SeriesEntry);
SeriesEntry* pEntry = m_aEntries.back().get();
pEntry->m_sRole = rRole;
- m_xLB_ROLE->append(OUString::number(reinterpret_cast<sal_Int64>(pEntry)),
+ m_xLB_ROLE->append(weld::toId(pEntry),
::chart::DialogModel::ConvertRoleFromInternalToUI(rRole));
m_xLB_ROLE->set_text(m_xLB_ROLE->n_children() - 1, rRange, 1);
}
@@ -327,13 +311,13 @@ void DataSourceTabPage::updateControlsFromDialogModel()
void DataSourceTabPage::fillSeriesListBox()
{
- Reference< XDataSeries > xSelected;
+ rtl::Reference< DataSeries > xSelected;
SeriesEntry* pEntry = nullptr;
int nEntry = m_xLB_SERIES->get_selected_index();
if (nEntry != -1)
{
- pEntry = reinterpret_cast<SeriesEntry*>(m_xLB_SERIES->get_id(nEntry).toInt64());
- xSelected.set(pEntry->m_xDataSeries);
+ pEntry = weld::fromId<SeriesEntry*>(m_xLB_SERIES->get_id(nEntry));
+ xSelected = pEntry->m_xDataSeries;
}
bool bHasSelectedEntry = (pEntry != nullptr);
@@ -357,7 +341,7 @@ void DataSourceTabPage::fillSeriesListBox()
OUString aResString(::chart::SchResId( STR_DATA_UNNAMED_SERIES_WITH_INDEX ));
// replace index of unnamed series
- static const OUStringLiteral aReplacementStr( u"%NUMBER" );
+ static constexpr OUString aReplacementStr( u"%NUMBER"_ustr );
sal_Int32 nIndex = aResString.indexOf( aReplacementStr );
if( nIndex != -1 )
aLabel = aResString.replaceAt(
@@ -372,9 +356,9 @@ void DataSourceTabPage::fillSeriesListBox()
m_aEntries.emplace_back(new SeriesEntry);
pEntry = m_aEntries.back().get();
- pEntry->m_xDataSeries.set(series.second.first);
- pEntry->m_xChartType.set(series.second.second);
- m_xLB_SERIES->append(OUString::number(reinterpret_cast<sal_Int64>(pEntry)), aLabel);
+ pEntry->m_xDataSeries = series.second.first;
+ pEntry->m_xChartType = series.second.second;
+ m_xLB_SERIES->append(weld::toId(pEntry), aLabel);
if (bHasSelectedEntry && series.second.first == xSelected)
nSelectedEntry = nEntry;
++nEntry;
@@ -391,7 +375,7 @@ void DataSourceTabPage::fillRoleListBox()
int nSeriesEntry = m_xLB_SERIES->get_selected_index();
SeriesEntry* pSeriesEntry = nullptr;
if (nSeriesEntry != -1)
- pSeriesEntry = reinterpret_cast<SeriesEntry*>(m_xLB_SERIES->get_id(nSeriesEntry).toInt64());
+ pSeriesEntry = weld::fromId<SeriesEntry*>(m_xLB_SERIES->get_id(nSeriesEntry));
bool bHasSelectedEntry = (pSeriesEntry != nullptr);
int nRoleIndex = m_xLB_ROLE->get_selected_index();
@@ -487,7 +471,7 @@ IMPL_LINK_NOARG(DataSourceTabPage, RoleSelectionChangedHdl, weld::TreeView&, voi
OUString aSelectedRange = lcl_GetSelectedRolesRange( *m_xLB_ROLE );
// replace role in fixed text label
- static const OUStringLiteral aReplacementStr( u"%VALUETYPE" );
+ static constexpr OUString aReplacementStr( u"%VALUETYPE"_ustr );
sal_Int32 nIndex = m_aFixedTextRange.indexOf( aReplacementStr );
if( nIndex != -1 )
{
@@ -518,7 +502,7 @@ IMPL_LINK_NOARG(DataSourceTabPage, MainRangeButtonClickedHdl, weld::Button&, voi
OUString aUIStr(SchResId(STR_DATA_SELECT_RANGE_FOR_SERIES));
// replace role
- OUString aReplacement( "%VALUETYPE" );
+ OUString aReplacement( u"%VALUETYPE"_ustr );
sal_Int32 nIndex = aUIStr.indexOf( aReplacement );
if( nIndex != -1 )
{
@@ -534,7 +518,7 @@ IMPL_LINK_NOARG(DataSourceTabPage, MainRangeButtonClickedHdl, weld::Button&, voi
m_xLB_SERIES->get_text(nEntry));
}
- lcl_enableRangeChoosing(true, m_pDialogController);
+ enableRangeChoosing(true, m_pDialogController);
m_rDialogModel.getRangeSelectionHelper()->chooseRange( aSelectedRolesRange, aUIStr, *this );
}
else
@@ -550,7 +534,7 @@ IMPL_LINK_NOARG(DataSourceTabPage, CategoriesRangeButtonClickedHdl, weld::Button
return;
OUString aStr(SchResId(m_xFT_CATEGORIES->get_visible() ? STR_DATA_SELECT_RANGE_FOR_CATEGORIES : STR_DATA_SELECT_RANGE_FOR_DATALABELS));
- lcl_enableRangeChoosing(true, m_pDialogController);
+ enableRangeChoosing(true, m_pDialogController);
m_rDialogModel.getRangeSelectionHelper()->chooseRange(
m_rDialogModel.getCategoriesRange(), aStr, *this );
}
@@ -559,23 +543,23 @@ IMPL_LINK_NOARG(DataSourceTabPage, AddButtonClickedHdl, weld::Button&, void)
{
m_rDialogModel.startControllerLockTimer();
int nEntry = m_xLB_SERIES->get_selected_index();
- Reference< XDataSeries > xSeriesToInsertAfter;
- Reference< XChartType > xChartTypeForNewSeries;
+ rtl::Reference< DataSeries > xSeriesToInsertAfter;
+ rtl::Reference< ChartType > xChartTypeForNewSeries;
if( m_pTemplateProvider )
m_rDialogModel.setTemplate( m_pTemplateProvider->getCurrentTemplate());
if (nEntry != -1)
{
- ::chart::SeriesEntry* pEntry = reinterpret_cast<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(nEntry).toInt64());
- xSeriesToInsertAfter.set(pEntry->m_xDataSeries);
- xChartTypeForNewSeries.set(pEntry->m_xChartType);
+ ::chart::SeriesEntry* pEntry = weld::fromId<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(nEntry));
+ xSeriesToInsertAfter = pEntry->m_xDataSeries;
+ xChartTypeForNewSeries = pEntry->m_xChartType;
}
else
{
- std::vector< Reference< XDataSeriesContainer > > aCntVec(
+ std::vector< rtl::Reference< ChartType > > aCntVec(
m_rDialogModel.getAllDataSeriesContainers());
if( ! aCntVec.empty())
- xChartTypeForNewSeries.set( aCntVec.front(), uno::UNO_QUERY );
+ xChartTypeForNewSeries = aCntVec.front();
}
OSL_ENSURE( xChartTypeForNewSeries.is(), "Cannot insert new series" );
@@ -602,15 +586,15 @@ IMPL_LINK_NOARG(DataSourceTabPage, RemoveButtonClickedHdl, weld::Button&, void)
if (nEntry == -1)
return;
- SeriesEntry* pEntry = reinterpret_cast<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(nEntry).toInt64());
- Reference< XDataSeries > xNewSelSeries;
+ SeriesEntry* pEntry = weld::fromId<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(nEntry));
+ rtl::Reference< DataSeries > xNewSelSeries;
SeriesEntry * pNewSelEntry = nullptr;
if (nEntry + 1 < m_xLB_SERIES->n_children())
- pNewSelEntry = reinterpret_cast<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(nEntry + 1).toInt64());
+ pNewSelEntry = weld::fromId<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(nEntry + 1));
else if (nEntry > 0)
- pNewSelEntry = reinterpret_cast<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(nEntry - 1).toInt64());
+ pNewSelEntry = weld::fromId<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(nEntry - 1));
if (pNewSelEntry)
- xNewSelSeries.set(pNewSelEntry->m_xDataSeries);
+ xNewSelSeries = pNewSelEntry->m_xDataSeries;
m_rDialogModel.deleteSeries( pEntry->m_xDataSeries, pEntry->m_xChartType );
setDirty();
@@ -623,7 +607,7 @@ IMPL_LINK_NOARG(DataSourceTabPage, RemoveButtonClickedHdl, weld::Button&, void)
{
for (int i = 0; i < m_xLB_SERIES->n_children(); ++i)
{
- pEntry = reinterpret_cast<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(i).toInt64());
+ pEntry = weld::fromId<::chart::SeriesEntry*>(m_xLB_SERIES->get_id(i));
if (pEntry->m_xDataSeries == xNewSelSeries)
{
m_xLB_SERIES->select(i);
@@ -641,7 +625,7 @@ IMPL_LINK_NOARG(DataSourceTabPage, UpButtonClickedHdl, weld::Button&, void)
int nEntry = m_xLB_SERIES->get_selected_index();
SeriesEntry* pEntry = nullptr;
if (nEntry != -1)
- pEntry = reinterpret_cast<SeriesEntry*>(m_xLB_SERIES->get_id(nEntry).toInt64());
+ pEntry = weld::fromId<SeriesEntry*>(m_xLB_SERIES->get_id(nEntry));
bool bHasSelectedEntry = (pEntry != nullptr);
@@ -661,7 +645,7 @@ IMPL_LINK_NOARG(DataSourceTabPage, DownButtonClickedHdl, weld::Button&, void)
int nEntry = m_xLB_SERIES->get_selected_index();
SeriesEntry* pEntry = nullptr;
if (nEntry != -1)
- pEntry = reinterpret_cast<SeriesEntry*>(m_xLB_SERIES->get_id(nEntry).toInt64());
+ pEntry = weld::fromId<SeriesEntry*>(m_xLB_SERIES->get_id(nEntry));
bool bHasSelectedEntry = (pEntry != nullptr);
@@ -728,7 +712,7 @@ void DataSourceTabPage::listeningFinished(
m_pCurrentRangeChoosingField = nullptr;
updateControlState();
- lcl_enableRangeChoosing(false, m_pDialogController);
+ enableRangeChoosing(false, m_pDialogController);
}
void DataSourceTabPage::disposingRangeSelection()
@@ -750,7 +734,7 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
if (bAll || (pField == m_xEDT_CATEGORIES.get()))
{
- Reference< data::XLabeledDataSequence > xLabeledSeq( m_rDialogModel.getCategories() );
+ uno::Reference< chart2::data::XLabeledDataSequence > xLabeledSeq( m_rDialogModel.getCategories() );
if( xDataProvider.is())
{
OUString aRange(m_xEDT_CATEGORIES->get_text());
@@ -759,7 +743,7 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
// create or change categories
if( !xLabeledSeq.is())
{
- xLabeledSeq.set( DataSourceHelper::createLabeledDataSequence() );
+ xLabeledSeq = DataSourceHelper::createLabeledDataSequence();
m_rDialogModel.setCategories( xLabeledSeq );
}
try
@@ -775,7 +759,7 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
else if( xLabeledSeq.is())
{
// clear existing categories
- xLabeledSeq.set(nullptr);
+ xLabeledSeq.clear();
m_rDialogModel.setCategories( xLabeledSeq );
}
}
@@ -784,7 +768,7 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
int nSeriesEntry = m_xLB_SERIES->get_selected_index();
SeriesEntry* pSeriesEntry = nullptr;
if (nSeriesEntry != -1)
- pSeriesEntry = reinterpret_cast<SeriesEntry*>(m_xLB_SERIES->get_id(nSeriesEntry).toInt64());
+ pSeriesEntry = weld::fromId<SeriesEntry*>(m_xLB_SERIES->get_id(nSeriesEntry));
bool bHasSelectedEntry = (pSeriesEntry != nullptr);
if( bHasSelectedEntry )
@@ -802,9 +786,8 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
if( bIsLabel )
aSequenceRole = aSequenceNameForLabel;
- Reference< data::XDataSource > xSource( pSeriesEntry->m_xDataSeries, uno::UNO_QUERY_THROW );
- Reference< data::XLabeledDataSequence > xLabeledSeq(
- DataSeriesHelper::getDataSequenceByRole( xSource, aSequenceRole ));
+ uno::Reference< chart2::data::XLabeledDataSequence > xLabeledSeq =
+ DataSeriesHelper::getDataSequenceByRole( pSeriesEntry->m_xDataSeries, aSequenceRole );
if( xDataProvider.is())
{
@@ -813,12 +796,12 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
if( ! xLabeledSeq.is())
{
// check if there is already an "orphan" label sequence
- xLabeledSeq.set( lcl_findLSequenceWithOnlyLabel( xSource ));
+ xLabeledSeq = lcl_findLSequenceWithOnlyLabel( pSeriesEntry->m_xDataSeries );
if( ! xLabeledSeq.is())
{
// no corresponding labeled data sequence for label found
- xLabeledSeq.set( DataSourceHelper::createLabeledDataSequence() );
- lcl_addLSequenceToDataSource( xLabeledSeq, xSource );
+ xLabeledSeq = DataSourceHelper::createLabeledDataSequence();
+ lcl_addLSequenceToDataSource( xLabeledSeq, pSeriesEntry->m_xDataSeries );
}
}
if( xLabeledSeq.is())
@@ -842,10 +825,10 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
// "$Sheet1.$A$1"
aRange = xNewSeq->getSourceRangeRepresentation();
Reference< beans::XPropertySet > xProp( xNewSeq, uno::UNO_QUERY_THROW );
- xProp->setPropertyValue( "Role" , uno::Any( OUString(lcl_aLabelRole) ));
+ xProp->setPropertyValue( u"Role"_ustr , uno::Any( lcl_aLabelRole ));
//Labels should always include hidden cells, regardless of the setting chosen
- xProp->setPropertyValue( "IncludeHiddenCells", uno::Any(true));
+ xProp->setPropertyValue( u"IncludeHiddenCells"_ustr, uno::Any(true));
xLabeledSeq->setLabel( xNewSeq );
}
}
@@ -877,15 +860,15 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
aRange = xNewSeq->getSourceRangeRepresentation();
Reference< beans::XPropertySet > xProp( xNewSeq, uno::UNO_QUERY_THROW );
- xProp->setPropertyValue( "Role" , uno::Any( aSelectedRole ));
+ xProp->setPropertyValue( u"Role"_ustr , uno::Any( aSelectedRole ));
if( !xLabeledSeq.is())
{
if( aSelectedRole == aSequenceNameForLabel )
- xLabeledSeq.set( lcl_findLSequenceWithOnlyLabel( xSource ));
+ xLabeledSeq = lcl_findLSequenceWithOnlyLabel( pSeriesEntry->m_xDataSeries );
if( ! xLabeledSeq.is())
{
- xLabeledSeq.set( DataSourceHelper::createLabeledDataSequence() );
- lcl_addLSequenceToDataSource( xLabeledSeq, xSource );
+ xLabeledSeq = DataSourceHelper::createLabeledDataSequence();
+ lcl_addLSequenceToDataSource( xLabeledSeq, pSeriesEntry->m_xDataSeries );
}
}
xLabeledSeq->setValues( xNewSeq );
diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx
index 1b6ba9862168..40219d917f9c 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.hxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.hxx
@@ -18,6 +18,9 @@
*/
#pragma once
+#include <DataSeries.hxx>
+#include <ChartType.hxx>
+
#include <vcl/wizardmachine.hxx>
#include <RangeSelectionListener.hxx>
@@ -29,8 +32,9 @@ namespace chart { class TabPageNotifiable; }
namespace chart
{
-
+class ChartType;
class ChartTypeTemplateProvider;
+class DataSeries;
class DialogModel;
class SeriesEntry
@@ -39,10 +43,10 @@ public:
OUString m_sRole;
/// the corresponding data series
- css::uno::Reference< css::chart2::XDataSeries > m_xDataSeries;
+ rtl::Reference< ::chart::DataSeries > m_xDataSeries;
/// the chart type that contains the series (via XDataSeriesContainer)
- css::uno::Reference< css::chart2::XChartType > m_xChartType;
+ rtl::Reference< ::chart::ChartType > m_xChartType;
};
class DataSourceTabPage final :
diff --git a/chart2/source/controller/dialogs/tp_DataTable.cxx b/chart2/source/controller/dialogs/tp_DataTable.cxx
new file mode 100644
index 000000000000..acf447501483
--- /dev/null
+++ b/chart2/source/controller/dialogs/tp_DataTable.cxx
@@ -0,0 +1,43 @@
+/* -*- 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 "tp_DataTable.hxx"
+
+namespace chart
+{
+DataTableTabPage::DataTableTabPage(weld::Container* pPage, weld::DialogController* pController,
+ const SfxItemSet& rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_DataTable.ui"_ustr,
+ u"DataTableTabPage"_ustr, &rInAttrs)
+ , m_aDataTablePropertiesResources(*m_xBuilder)
+{
+}
+
+DataTableTabPage::~DataTableTabPage() = default;
+
+std::unique_ptr<SfxTabPage> DataTableTabPage::Create(weld::Container* pPage,
+ weld::DialogController* pController,
+ const SfxItemSet* rAttrs)
+{
+ return std::make_unique<DataTableTabPage>(pPage, pController, *rAttrs);
+}
+
+bool DataTableTabPage::FillItemSet(SfxItemSet* pOutAttrs)
+{
+ return m_aDataTablePropertiesResources.writeToItemSet(*pOutAttrs);
+}
+
+void DataTableTabPage::Reset(const SfxItemSet* pInAttrs)
+{
+ m_aDataTablePropertiesResources.initFromItemSet(*pInAttrs);
+}
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/tp_DataTable.hxx b/chart2/source/controller/dialogs/tp_DataTable.hxx
new file mode 100644
index 000000000000..00ab64cf89ce
--- /dev/null
+++ b/chart2/source/controller/dialogs/tp_DataTable.hxx
@@ -0,0 +1,37 @@
+/* -*- 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 <sfx2/tabdlg.hxx>
+#include <res_DataTableProperties.hxx>
+
+namespace chart
+{
+/** Tab page for the data table properties */
+class DataTableTabPage : public SfxTabPage
+{
+private:
+ DataTablePropertiesResources m_aDataTablePropertiesResources;
+
+public:
+ DataTableTabPage(weld::Container* pPage, weld::DialogController* pController,
+ const SfxItemSet& rInAttrs);
+ virtual ~DataTableTabPage() override;
+
+ static std::unique_ptr<SfxTabPage>
+ Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rInAttrs);
+
+ virtual bool FillItemSet(SfxItemSet* rOutAttrs) override;
+ virtual void Reset(const SfxItemSet* rInAttrs) override;
+};
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.cxx b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
index 927bf1130a43..8c63332e5e7d 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.cxx
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
@@ -25,7 +25,7 @@ namespace chart
{
ErrorBarsTabPage::ErrorBarsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_ErrorBars.ui", "tp_ErrorBars", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_ErrorBars.ui"_ustr, u"tp_ErrorBars"_ustr, &rInAttrs)
, m_aErrorBarResources(m_xBuilder.get(), pController, rInAttrs, /* bNoneAvailable = */ false)
{
}
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
index 04697e75efc9..6c059cec7795 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
@@ -28,16 +28,15 @@ namespace chart
{
SchLegendPosTabPage::SchLegendPosTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_LegendPosition.ui", "tp_LegendPosition", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_LegendPosition.ui"_ustr, u"tp_LegendPosition"_ustr, &rInAttrs)
, m_aLegendPositionResources(*m_xBuilder)
- , m_xLbTextDirection(new TextDirectionListBox(m_xBuilder->weld_combo_box("LB_LEGEND_TEXTDIR")))
- , m_xCBLegendNoOverlay(m_xBuilder->weld_check_button("CB_NO_OVERLAY"))
+ , m_aLbTextDirection(m_xBuilder->weld_combo_box(u"LB_LEGEND_TEXTDIR"_ustr))
+ , m_xCBLegendNoOverlay(m_xBuilder->weld_check_button(u"CB_NO_OVERLAY"_ustr))
{
}
SchLegendPosTabPage::~SchLegendPosTabPage()
{
- m_xLbTextDirection.reset();
}
std::unique_ptr<SfxTabPage> SchLegendPosTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rOutAttrs)
@@ -49,8 +48,8 @@ bool SchLegendPosTabPage::FillItemSet(SfxItemSet* rOutAttrs)
{
m_aLegendPositionResources.writeToItemSet(*rOutAttrs);
- if (m_xLbTextDirection->get_active() != -1)
- rOutAttrs->Put(SvxFrameDirectionItem(m_xLbTextDirection->get_active_id(), EE_PARA_WRITINGDIR));
+ if (m_aLbTextDirection.get_active() != -1)
+ rOutAttrs->Put(SvxFrameDirectionItem(m_aLbTextDirection.get_active_id(), EE_PARA_WRITINGDIR));
if (m_xCBLegendNoOverlay->get_visible())
rOutAttrs->Put(SfxBoolItem(SCHATTR_LEGEND_NO_OVERLAY, m_xCBLegendNoOverlay->get_active()));
@@ -62,13 +61,12 @@ void SchLegendPosTabPage::Reset(const SfxItemSet* rInAttrs)
{
m_aLegendPositionResources.initFromItemSet(*rInAttrs);
- const SfxPoolItem* pPoolItem = nullptr;
- if( rInAttrs->GetItemState( EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET )
- m_xLbTextDirection->set_active_id( static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue() );
+ if( const SvxFrameDirectionItem* pDirectionItem = rInAttrs->GetItemIfSet( EE_PARA_WRITINGDIR ) )
+ m_aLbTextDirection.set_active_id( pDirectionItem->GetValue() );
- if (rInAttrs->GetItemState(SCHATTR_LEGEND_NO_OVERLAY, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pNoOverlayItem = rInAttrs->GetItemIfSet(SCHATTR_LEGEND_NO_OVERLAY))
{
- bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+ bool bVal = pNoOverlayItem->GetValue();
m_xCBLegendNoOverlay->set_active(bVal);
}
}
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.hxx b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
index 9e5f32d281a7..4534501b5209 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.hxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
@@ -21,8 +21,7 @@
#include <sfx2/tabdlg.hxx>
#include <res_LegendPosition.hxx>
-
-namespace chart { class TextDirectionListBox; }
+#include <TextDirectionListBox.hxx>
namespace chart
{
@@ -32,7 +31,7 @@ class SchLegendPosTabPage : public SfxTabPage
private:
LegendPositionResources m_aLegendPositionResources;
- std::unique_ptr<TextDirectionListBox> m_xLbTextDirection;
+ TextDirectionListBox m_aLbTextDirection;
std::unique_ptr<weld::CheckButton> m_xCBLegendNoOverlay;
public:
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
index 88116ee890e1..e9f1d1b957d7 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
@@ -29,7 +29,7 @@ namespace chart
{
SchLayoutTabPage::SchLayoutTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_ChartType.ui", "tp_ChartType", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_ChartType.ui"_ustr, u"tp_ChartType"_ustr, &rInAttrs)
{
m_pGeometryResources.reset(new BarGeometryResources(m_xBuilder.get()));
}
@@ -62,11 +62,9 @@ bool SchLayoutTabPage::FillItemSet(SfxItemSet* rOutAttrs)
void SchLayoutTabPage::Reset(const SfxItemSet* rInAttrs)
{
- const SfxPoolItem *pPoolItem = nullptr;
-
- if (rInAttrs->GetItemState(SCHATTR_STYLE_SHAPE,true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxInt32Item* pShapeItem = rInAttrs->GetItemIfSet(SCHATTR_STYLE_SHAPE))
{
- tools::Long nVal = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ tools::Long nVal = pShapeItem->GetValue();
if(m_pGeometryResources)
{
m_pGeometryResources->select(static_cast<sal_uInt16>(nVal));
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index ed4172d68110..cb646e3266be 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -28,14 +28,14 @@ namespace chart
{
PolarOptionsTabPage::PolarOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_PolarOptions.ui", "tp_PolarOptions", &rInAttrs)
- , m_xCB_Clockwise(m_xBuilder->weld_check_button("CB_CLOCKWISE"))
- , m_xFL_StartingAngle(m_xBuilder->weld_frame("frameANGLE"))
- , m_xNF_StartingAngle(m_xBuilder->weld_metric_spin_button("NF_STARTING_ANGLE", FieldUnit::DEGREE))
- , m_xFL_PlotOptions(m_xBuilder->weld_frame("framePLOT_OPTIONS"))
- , m_xCB_IncludeHiddenCells(m_xBuilder->weld_check_button("CB_INCLUDE_HIDDEN_CELLS_POLAR"))
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_PolarOptions.ui"_ustr, u"tp_PolarOptions"_ustr, &rInAttrs)
+ , m_xCB_Clockwise(m_xBuilder->weld_check_button(u"CB_CLOCKWISE"_ustr))
+ , m_xFL_StartingAngle(m_xBuilder->weld_frame(u"frameANGLE"_ustr))
+ , m_xNF_StartingAngle(m_xBuilder->weld_metric_spin_button(u"NF_STARTING_ANGLE"_ustr, FieldUnit::DEGREE))
+ , m_xFL_PlotOptions(m_xBuilder->weld_frame(u"framePLOT_OPTIONS"_ustr))
+ , m_xCB_IncludeHiddenCells(m_xBuilder->weld_check_button(u"CB_INCLUDE_HIDDEN_CELLS_POLAR"_ustr))
, m_xAngleDial(new svx::DialControl)
- , m_xAngleDialWin(new weld::CustomWeld(*m_xBuilder, "CT_ANGLE_DIAL", *m_xAngleDial))
+ , m_xAngleDialWin(new weld::CustomWeld(*m_xBuilder, u"CT_ANGLE_DIAL"_ustr, *m_xAngleDial))
{
m_xAngleDial->SetLinkedField(m_xNF_StartingAngle.get());
}
@@ -69,11 +69,9 @@ bool PolarOptionsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
void PolarOptionsTabPage::Reset(const SfxItemSet* rInAttrs)
{
- const SfxPoolItem *pPoolItem = nullptr;
-
- if (rInAttrs->GetItemState(SCHATTR_STARTING_ANGLE, true, &pPoolItem) == SfxItemState::SET)
+ if (const SdrAngleItem* pAngleItem = rInAttrs->GetItemIfSet(SCHATTR_STARTING_ANGLE))
{
- Degree100 nTmp = static_cast<const SdrAngleItem*>(pPoolItem)->GetValue();
+ Degree100 nTmp = pAngleItem->GetValue();
m_xAngleDial->SetRotation( nTmp );
}
else
@@ -81,18 +79,20 @@ void PolarOptionsTabPage::Reset(const SfxItemSet* rInAttrs)
m_xFL_StartingAngle->hide();
}
// tdf#108059 Hide clockwise orientation checkbox in OOXML-heavy environments it would be useless anyways
- if (!officecfg::Office::Compatibility::View::ClockwisePieChartDirection::get() && rInAttrs->GetItemState(SCHATTR_CLOCKWISE, true, &pPoolItem) == SfxItemState::SET)
+ const SfxBoolItem* pClockWiseItem = nullptr;
+ if (!officecfg::Office::Compatibility::View::ClockwisePieChartDirection::get() &&
+ (pClockWiseItem = rInAttrs->GetItemIfSet(SCHATTR_CLOCKWISE)))
{
- bool bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
+ bool bCheck = pClockWiseItem->GetValue();
m_xCB_Clockwise->set_active(bCheck);
}
else
{
m_xCB_Clockwise->hide();
}
- if (rInAttrs->GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pHiddenCellsItem = rInAttrs->GetItemIfSet(SCHATTR_INCLUDE_HIDDEN_CELLS))
{
- bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+ bool bVal = pHiddenCellsItem->GetValue();
m_xCB_IncludeHiddenCells->set_active(bVal);
}
else
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index eba4018052af..51ad7a809be0 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -25,7 +25,6 @@ namespace weld {
class CheckButton;
class CustomWeld;
class Frame;
- class SpinButton;
}
namespace chart
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index 05f137f5a7be..4977569e2c13 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -41,15 +41,6 @@ namespace
}
}
- void lcl_enableRangeChoosing(bool bEnable, weld::DialogController* pDialog)
- {
- if (!pDialog)
- return;
- weld::Dialog* pDlg = pDialog->getDialog();
- pDlg->set_modal(!bEnable);
- pDlg->set_visible(!bEnable);
- }
-
} // anonymous namespace
namespace chart
@@ -62,27 +53,26 @@ using ::com::sun::star::uno::Sequence;
RangeChooserTabPage::RangeChooserTabPage(weld::Container* pPage, weld::DialogController* pController, DialogModel & rDialogModel,
ChartTypeTemplateProvider* pTemplateProvider,
bool bHideDescription /* = false */)
- : OWizardPage(pPage, pController, "modules/schart/ui/tp_RangeChooser.ui", "tp_RangeChooser")
+ : OWizardPage(pPage, pController, u"modules/schart/ui/tp_RangeChooser.ui"_ustr, u"tp_RangeChooser"_ustr)
, m_nChangingControlCalls(0)
, m_bIsDirty(false)
, m_pTemplateProvider(pTemplateProvider)
, m_rDialogModel( rDialogModel )
, m_pTabPageNotifiable(dynamic_cast<TabPageNotifiable*>(pController))
- , m_xFT_Caption(m_xBuilder->weld_label("FT_CAPTION_FOR_WIZARD"))
- , m_xFT_Range(m_xBuilder->weld_label("FT_RANGE"))
- , m_xED_Range(m_xBuilder->weld_entry("ED_RANGE"))
- , m_xIB_Range(m_xBuilder->weld_button("IB_RANGE"))
- , m_xRB_Rows(m_xBuilder->weld_radio_button("RB_DATAROWS"))
- , m_xRB_Columns(m_xBuilder->weld_radio_button("RB_DATACOLS"))
- , m_xCB_FirstRowAsLabel(m_xBuilder->weld_check_button("CB_FIRST_ROW_ASLABELS"))
- , m_xCB_FirstColumnAsLabel(m_xBuilder->weld_check_button("CB_FIRST_COLUMN_ASLABELS"))
- , m_xFTTitle(m_xBuilder->weld_label("STR_PAGE_DATA_RANGE"))
- , m_xFL_TimeBased(m_xBuilder->weld_widget("separator1"))
- , m_xCB_TimeBased(m_xBuilder->weld_check_button("CB_TIME_BASED"))
- , m_xFT_TimeStart(m_xBuilder->weld_label("label1"))
- , m_xEd_TimeStart(m_xBuilder->weld_entry("ED_TIME_BASED_START"))
- , m_xFT_TimeEnd(m_xBuilder->weld_label("label2"))
- , m_xEd_TimeEnd(m_xBuilder->weld_entry("ED_TIME_BASED_END"))
+ , m_xFT_Caption(m_xBuilder->weld_label(u"FT_CAPTION_FOR_WIZARD"_ustr))
+ , m_xED_Range(m_xBuilder->weld_entry(u"ED_RANGE"_ustr))
+ , m_xIB_Range(m_xBuilder->weld_button(u"IB_RANGE"_ustr))
+ , m_xRB_Rows(m_xBuilder->weld_radio_button(u"RB_DATAROWS"_ustr))
+ , m_xRB_Columns(m_xBuilder->weld_radio_button(u"RB_DATACOLS"_ustr))
+ , m_xCB_FirstRowAsLabel(m_xBuilder->weld_check_button(u"CB_FIRST_ROW_ASLABELS"_ustr))
+ , m_xCB_FirstColumnAsLabel(m_xBuilder->weld_check_button(u"CB_FIRST_COLUMN_ASLABELS"_ustr))
+ , m_xFTTitle(m_xBuilder->weld_label(u"STR_PAGE_DATA_RANGE"_ustr))
+ , m_xFL_TimeBased(m_xBuilder->weld_widget(u"separator1"_ustr))
+ , m_xCB_TimeBased(m_xBuilder->weld_check_button(u"CB_TIME_BASED"_ustr))
+ , m_xFT_TimeStart(m_xBuilder->weld_label(u"label1"_ustr))
+ , m_xEd_TimeStart(m_xBuilder->weld_entry(u"ED_TIME_BASED_START"_ustr))
+ , m_xFT_TimeEnd(m_xBuilder->weld_label(u"label2"_ustr))
+ , m_xEd_TimeEnd(m_xBuilder->weld_entry(u"ED_TIME_BASED_END"_ustr))
{
m_xFT_Caption->set_visible(!bHideDescription);
@@ -217,7 +207,7 @@ void RangeChooserTabPage::changeDialogModelAccordingToControls()
{
aArguments.realloc( aArguments.getLength() + 1 );
aArguments.getArray()[aArguments.getLength() - 1] =
- beans::PropertyValue( "TimeBased", -1, uno::Any(bTimeBased),
+ beans::PropertyValue( u"TimeBased"_ustr, -1, uno::Any(bTimeBased),
beans::PropertyState_DIRECT_VALUE );
}
@@ -228,7 +218,7 @@ void RangeChooserTabPage::changeDialogModelAccordingToControls()
m_rDialogModel.setTemplate( m_xCurrentChartTypeTemplate );
aArguments.realloc( aArguments.getLength() + 1 );
aArguments.getArray()[aArguments.getLength() - 1] =
- beans::PropertyValue( "CellRangeRepresentation" , -1,
+ beans::PropertyValue( u"CellRangeRepresentation"_ustr , -1,
uno::Any( m_aLastValidRangeString ),
beans::PropertyState_DIRECT_VALUE );
m_rDialogModel.setData( aArguments );
@@ -338,7 +328,7 @@ IMPL_LINK_NOARG(RangeChooserTabPage, ChooseRangeHdl, weld::Button&, void)
OUString aRange = m_xED_Range->get_text();
OUString aTitle = m_xFTTitle->get_label();
- lcl_enableRangeChoosing(true, m_pDialogController);
+ enableRangeChoosing(true, m_pDialogController);
m_rDialogModel.getRangeSelectionHelper()->chooseRange( aRange, aTitle, *this );
}
@@ -362,7 +352,7 @@ void RangeChooserTabPage::listeningFinished( const OUString & rNewRange )
if( isValid())
changeDialogModelAccordingToControls();
- lcl_enableRangeChoosing(false, m_pDialogController);
+ enableRangeChoosing(false, m_pDialogController);
}
void RangeChooserTabPage::disposingRangeSelection()
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.hxx b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
index e372b3f159b1..428e8a127dd9 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.hxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
@@ -24,7 +24,6 @@
#include <vcl/wizardmachine.hxx>
namespace chart { class TabPageNotifiable; }
-namespace com::sun::star::chart2 { class XChartTypeTemplate; }
namespace chart
{
@@ -79,7 +78,6 @@ private:
TabPageNotifiable * m_pTabPageNotifiable;
std::unique_ptr<weld::Label> m_xFT_Caption;
- std::unique_ptr<weld::Label> m_xFT_Range;
std::unique_ptr<weld::Entry> m_xED_Range;
std::unique_ptr<weld::Button> m_xIB_Range;
std::unique_ptr<weld::RadioButton> m_xRB_Rows;
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index 6c7effde6707..8d7ce3d9ff58 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -26,6 +26,7 @@
#include <svx/svxids.hrc>
#include <osl/diagnose.h>
+#include <sfx2/dialoghelper.hxx>
#include <svx/chrtitem.hxx>
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
@@ -53,7 +54,7 @@ void lcl_setValue(weld::FormattedSpinButton& rFmtField, double fValue)
}
ScaleTabPage::ScaleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_Scale.ui", "tp_Scale", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_Scale.ui"_ustr, u"tp_Scale"_ustr, &rInAttrs)
, fMin(0.0)
, fMax(0.0)
, fStepMain(0.0)
@@ -66,31 +67,31 @@ ScaleTabPage::ScaleTabPage(weld::Container* pPage, weld::DialogController* pCont
, m_bAllowDateAxis(false)
, pNumFormatter(nullptr)
, m_bShowAxisOrigin(false)
- , m_xCbxReverse(m_xBuilder->weld_check_button("CBX_REVERSE"))
- , m_xCbxLogarithm(m_xBuilder->weld_check_button("CBX_LOGARITHM"))
- , m_xBxType(m_xBuilder->weld_widget("boxTYPE"))
- , m_xLB_AxisType(m_xBuilder->weld_combo_box("LB_AXIS_TYPE"))
- , m_xBxMinMax(m_xBuilder->weld_widget("gridMINMAX"))
- , m_xFmtFldMin(m_xBuilder->weld_formatted_spin_button("EDT_MIN"))
- , m_xCbxAutoMin(m_xBuilder->weld_check_button("CBX_AUTO_MIN"))
- , m_xFmtFldMax(m_xBuilder->weld_formatted_spin_button("EDT_MAX"))
- , m_xCbxAutoMax(m_xBuilder->weld_check_button("CBX_AUTO_MAX"))
- , m_xBxResolution(m_xBuilder->weld_widget("boxRESOLUTION"))
- , m_xLB_TimeResolution(m_xBuilder->weld_combo_box("LB_TIME_RESOLUTION"))
- , m_xCbx_AutoTimeResolution(m_xBuilder->weld_check_button("CBX_AUTO_TIME_RESOLUTION"))
- , m_xTxtMain(m_xBuilder->weld_label("TXT_STEP_MAIN"))
- , m_xFmtFldStepMain(m_xBuilder->weld_formatted_spin_button("EDT_STEP_MAIN"))
- , m_xMt_MainDateStep(m_xBuilder->weld_spin_button("MT_MAIN_DATE_STEP"))
- , m_xLB_MainTimeUnit(m_xBuilder->weld_combo_box("LB_MAIN_TIME_UNIT"))
- , m_xCbxAutoStepMain(m_xBuilder->weld_check_button("CBX_AUTO_STEP_MAIN"))
- , m_xTxtHelpCount(m_xBuilder->weld_label("TXT_STEP_HELP_COUNT"))
- , m_xTxtHelp(m_xBuilder->weld_label("TXT_STEP_HELP"))
- , m_xMtStepHelp(m_xBuilder->weld_spin_button("MT_STEPHELP"))
- , m_xLB_HelpTimeUnit(m_xBuilder->weld_combo_box("LB_HELP_TIME_UNIT"))
- , m_xCbxAutoStepHelp(m_xBuilder->weld_check_button("CBX_AUTO_STEP_HELP"))
- , m_xFmtFldOrigin(m_xBuilder->weld_formatted_spin_button("EDT_ORIGIN"))
- , m_xCbxAutoOrigin(m_xBuilder->weld_check_button("CBX_AUTO_ORIGIN"))
- , m_xBxOrigin(m_xBuilder->weld_widget("boxORIGIN"))
+ , m_xCbxReverse(m_xBuilder->weld_check_button(u"CBX_REVERSE"_ustr))
+ , m_xCbxLogarithm(m_xBuilder->weld_check_button(u"CBX_LOGARITHM"_ustr))
+ , m_xBxType(m_xBuilder->weld_widget(u"boxTYPE"_ustr))
+ , m_xLB_AxisType(m_xBuilder->weld_combo_box(u"LB_AXIS_TYPE"_ustr))
+ , m_xBxMinMax(m_xBuilder->weld_widget(u"gridMINMAX"_ustr))
+ , m_xFmtFldMin(m_xBuilder->weld_formatted_spin_button(u"EDT_MIN"_ustr))
+ , m_xCbxAutoMin(m_xBuilder->weld_check_button(u"CBX_AUTO_MIN"_ustr))
+ , m_xFmtFldMax(m_xBuilder->weld_formatted_spin_button(u"EDT_MAX"_ustr))
+ , m_xCbxAutoMax(m_xBuilder->weld_check_button(u"CBX_AUTO_MAX"_ustr))
+ , m_xBxResolution(m_xBuilder->weld_widget(u"boxRESOLUTION"_ustr))
+ , m_xLB_TimeResolution(m_xBuilder->weld_combo_box(u"LB_TIME_RESOLUTION"_ustr))
+ , m_xCbx_AutoTimeResolution(m_xBuilder->weld_check_button(u"CBX_AUTO_TIME_RESOLUTION"_ustr))
+ , m_xTxtMain(m_xBuilder->weld_label(u"TXT_STEP_MAIN"_ustr))
+ , m_xFmtFldStepMain(m_xBuilder->weld_formatted_spin_button(u"EDT_STEP_MAIN"_ustr))
+ , m_xMt_MainDateStep(m_xBuilder->weld_spin_button(u"MT_MAIN_DATE_STEP"_ustr))
+ , m_xLB_MainTimeUnit(m_xBuilder->weld_combo_box(u"LB_MAIN_TIME_UNIT"_ustr))
+ , m_xCbxAutoStepMain(m_xBuilder->weld_check_button(u"CBX_AUTO_STEP_MAIN"_ustr))
+ , m_xTxtHelpCount(m_xBuilder->weld_label(u"TXT_STEP_HELP_COUNT"_ustr))
+ , m_xTxtHelp(m_xBuilder->weld_label(u"TXT_STEP_HELP"_ustr))
+ , m_xMtStepHelp(m_xBuilder->weld_spin_button(u"MT_STEPHELP"_ustr))
+ , m_xLB_HelpTimeUnit(m_xBuilder->weld_combo_box(u"LB_HELP_TIME_UNIT"_ustr))
+ , m_xCbxAutoStepHelp(m_xBuilder->weld_check_button(u"CBX_AUTO_STEP_HELP"_ustr))
+ , m_xFmtFldOrigin(m_xBuilder->weld_formatted_spin_button(u"EDT_ORIGIN"_ustr))
+ , m_xCbxAutoOrigin(m_xBuilder->weld_check_button(u"CBX_AUTO_ORIGIN"_ustr))
+ , m_xBxOrigin(m_xBuilder->weld_widget(u"boxORIGIN"_ustr))
{
m_xCbxAutoMin->connect_toggled(LINK(this, ScaleTabPage, EnableValueHdl));
m_xCbxAutoMax->connect_toggled(LINK(this, ScaleTabPage, EnableValueHdl));
@@ -271,19 +272,18 @@ void ScaleTabPage::Reset(const SfxItemSet* rInAttrs)
if(!pNumFormatter)
return;
- const SfxPoolItem *pPoolItem = nullptr;
- if (rInAttrs->GetItemState(SCHATTR_AXIS_ALLOW_DATEAXIS, true, &pPoolItem) == SfxItemState::SET)
- m_bAllowDateAxis = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+ if (const SfxBoolItem* pDateAxisItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_ALLOW_DATEAXIS))
+ m_bAllowDateAxis = pDateAxisItem->GetValue();
m_nAxisType=chart2::AxisType::REALNUMBER;
- if (rInAttrs->GetItemState(SCHATTR_AXISTYPE, true, &pPoolItem) == SfxItemState::SET)
- m_nAxisType = static_cast<int>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
+ if (const SfxInt32Item* pAxisTypeItem = rInAttrs->GetItemIfSet(SCHATTR_AXISTYPE))
+ m_nAxisType = static_cast<int>(pAxisTypeItem->GetValue());
if( m_nAxisType==chart2::AxisType::DATE && !m_bAllowDateAxis )
m_nAxisType=chart2::AxisType::CATEGORY;
if( m_bAllowDateAxis )
{
bool bAutoDateAxis = false;
- if (rInAttrs->GetItemState(SCHATTR_AXIS_AUTO_DATEAXIS, true, &pPoolItem) == SfxItemState::SET)
- bAutoDateAxis = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+ if (const SfxBoolItem* pDateAxisItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_AUTO_DATEAXIS))
+ bAutoDateAxis = pDateAxisItem->GetValue();
sal_uInt16 nPos = 0;
if( m_nAxisType==chart2::AxisType::DATE )
@@ -302,74 +302,74 @@ void ScaleTabPage::Reset(const SfxItemSet* rInAttrs)
m_xCbxAutoOrigin->set_active(true);
m_xCbx_AutoTimeResolution->set_active(true);
- if (rInAttrs->GetItemState(SCHATTR_AXIS_AUTO_MIN,true,&pPoolItem) == SfxItemState::SET)
- m_xCbxAutoMin->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ if (const SfxBoolItem* pAutoMinItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_AUTO_MIN))
+ m_xCbxAutoMin->set_active(pAutoMinItem->GetValue());
- if (rInAttrs->GetItemState(SCHATTR_AXIS_MIN,true, &pPoolItem) == SfxItemState::SET)
+ if (const SvxDoubleItem* pAxisMinItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_MIN))
{
- fMin = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue();
+ fMin = pAxisMinItem->GetValue();
lcl_setValue( *m_xFmtFldMin, fMin );
m_xFmtFldMin->save_value();
}
- if (rInAttrs->GetItemState(SCHATTR_AXIS_AUTO_MAX,true, &pPoolItem) == SfxItemState::SET)
- m_xCbxAutoMax->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ if (const SfxBoolItem* pAutoMaxItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_AUTO_MAX))
+ m_xCbxAutoMax->set_active(pAutoMaxItem->GetValue());
- if (rInAttrs->GetItemState(SCHATTR_AXIS_MAX,true, &pPoolItem) == SfxItemState::SET)
+ if (const SvxDoubleItem* pAxisMaxItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_MAX))
{
- fMax = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue();
+ fMax = pAxisMaxItem->GetValue();
lcl_setValue( *m_xFmtFldMax, fMax );
m_xFmtFldMax->save_value();
}
- if (rInAttrs->GetItemState(SCHATTR_AXIS_AUTO_STEP_MAIN,true, &pPoolItem) == SfxItemState::SET)
- m_xCbxAutoStepMain->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ if (const SfxBoolItem* pAutoStepMainItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_AUTO_STEP_MAIN))
+ m_xCbxAutoStepMain->set_active(pAutoStepMainItem->GetValue());
- if (rInAttrs->GetItemState(SCHATTR_AXIS_STEP_MAIN,true, &pPoolItem) == SfxItemState::SET)
+ if (const SvxDoubleItem* pStepMainItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_STEP_MAIN))
{
- fStepMain = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue();
+ fStepMain = pStepMainItem->GetValue();
lcl_setValue( *m_xFmtFldStepMain, fStepMain );
m_xFmtFldStepMain->save_value();
m_xMt_MainDateStep->set_value( static_cast<sal_Int32>(fStepMain) );
m_xMt_MainDateStep->save_value();
}
- if (rInAttrs->GetItemState(SCHATTR_AXIS_AUTO_STEP_HELP,true, &pPoolItem) == SfxItemState::SET)
- m_xCbxAutoStepHelp->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
- if (rInAttrs->GetItemState(SCHATTR_AXIS_LOGARITHM,true, &pPoolItem) == SfxItemState::SET)
- m_xCbxLogarithm->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
- if (rInAttrs->GetItemState(SCHATTR_AXIS_REVERSE,true, &pPoolItem) == SfxItemState::SET)
- m_xCbxReverse->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
- if (rInAttrs->GetItemState(SCHATTR_AXIS_STEP_HELP,true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pAutoStepHelpItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_AUTO_STEP_HELP))
+ m_xCbxAutoStepHelp->set_active(pAutoStepHelpItem->GetValue());
+ if (const SfxBoolItem* pLogItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_LOGARITHM))
+ m_xCbxLogarithm->set_active(pLogItem->GetValue());
+ if (const SfxBoolItem* pReverseItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_REVERSE))
+ m_xCbxReverse->set_active(pReverseItem->GetValue());
+ if (const SfxInt32Item* pStepHelpItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_STEP_HELP))
{
- nStepHelp = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ nStepHelp = pStepHelpItem->GetValue();
m_xMtStepHelp->set_value( nStepHelp );
m_xMtStepHelp->save_value();
}
- if (rInAttrs->GetItemState(SCHATTR_AXIS_AUTO_ORIGIN,true, &pPoolItem) == SfxItemState::SET)
- m_xCbxAutoOrigin->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
- if (rInAttrs->GetItemState(SCHATTR_AXIS_ORIGIN,true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pOriginItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_AUTO_ORIGIN))
+ m_xCbxAutoOrigin->set_active(pOriginItem->GetValue());
+ if (const SvxDoubleItem* pOriginItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_ORIGIN))
{
- fOrigin = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue();
+ fOrigin = pOriginItem->GetValue();
lcl_setValue( *m_xFmtFldOrigin, fOrigin );
m_xFmtFldOrigin->save_value();
}
- if (rInAttrs->GetItemState(SCHATTR_AXIS_AUTO_TIME_RESOLUTION,true, &pPoolItem) == SfxItemState::SET)
- m_xCbx_AutoTimeResolution->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
- if (rInAttrs->GetItemState(SCHATTR_AXIS_TIME_RESOLUTION,true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pAutoTimeResItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_AUTO_TIME_RESOLUTION))
+ m_xCbx_AutoTimeResolution->set_active(pAutoTimeResItem->GetValue());
+ if (const SfxInt32Item* pTimeResItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_TIME_RESOLUTION))
{
- m_nTimeResolution = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ m_nTimeResolution = pTimeResItem->GetValue();
m_xLB_TimeResolution->set_active( m_nTimeResolution );
}
- if (rInAttrs->GetItemState(SCHATTR_AXIS_MAIN_TIME_UNIT,true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxInt32Item* pMainTimeUnitItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_MAIN_TIME_UNIT))
{
- m_nMainTimeUnit = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ m_nMainTimeUnit = pMainTimeUnitItem->GetValue();
m_xLB_MainTimeUnit->set_active( m_nMainTimeUnit );
}
- if (rInAttrs->GetItemState(SCHATTR_AXIS_HELP_TIME_UNIT,true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxInt32Item* pHelpTimeUnitItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_HELP_TIME_UNIT))
{
- m_nHelpTimeUnit = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ m_nHelpTimeUnit = pHelpTimeUnitItem->GetValue();
m_xLB_HelpTimeUnit->set_active( m_nHelpTimeUnit );
}
@@ -524,12 +524,12 @@ void ScaleTabPage::SetNumFormatter( SvNumberFormatter* pFormatter )
void ScaleTabPage::SetNumFormat()
{
- const SfxPoolItem *pPoolItem = nullptr;
+ const SfxUInt32Item *pNumFormatItem = GetItemSet().GetItemIfSet( SID_ATTR_NUMBERFORMAT_VALUE );
- if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, true, &pPoolItem ) != SfxItemState::SET )
+ if( !pNumFormatItem )
return;
- sal_uLong nFmt = static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
+ sal_uInt32 nFmt = pNumFormatItem->GetValue();
Formatter& rFmtFldMax = m_xFmtFldMax->GetFormatter();
rFmtFldMax.SetFormatKey(nFmt);
@@ -558,6 +558,12 @@ void ScaleTabPage::SetNumFormat()
nFmt = pNumFormatter->GetStandardFormat( SvNumFormatType::TIME, pFormat->GetLanguage() );
else
nFmt = pNumFormatter->GetStandardFormat( SvNumFormatType::TIME );
+
+ // tdf#141625 give enough space to see full date+time
+ int nWidestTime(m_xFmtFldMin->get_pixel_size(getWidestDateTime(Application::GetSettings().GetLocaleDataWrapper(), true)).Width());
+ int nWidthChars = std::ceil(nWidestTime / m_xFmtFldMin->get_approximate_digit_width()) + 1;
+ m_xFmtFldMin->set_width_chars(nWidthChars);
+ m_xFmtFldMax->set_width_chars(nWidthChars);
}
if( m_nAxisType == chart2::AxisType::DATE && ( eType != SvNumFormatType::DATE && eType != SvNumFormatType::DATETIME) )
diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx
index b90d3ef20211..928637101a67 100644
--- a/chart2/source/controller/dialogs/tp_Scale.hxx
+++ b/chart2/source/controller/dialogs/tp_Scale.hxx
@@ -21,6 +21,8 @@
#include <sfx2/tabdlg.hxx>
#include <unotools/resmgr.hxx>
+class SvNumberFormatter;
+
namespace chart
{
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
index 15976e89fea8..ee6dabc07a6f 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
@@ -31,26 +31,26 @@ namespace chart
{
SchOptionTabPage::SchOptionTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_SeriesToAxis.ui", "TP_OPTIONS", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_SeriesToAxis.ui"_ustr, u"TP_OPTIONS"_ustr, &rInAttrs)
, m_nAllSeriesAxisIndex(0)
, m_bProvidesSecondaryYAxis(true)
, m_bProvidesOverlapAndGapWidth(false)
, m_bProvidesBarConnectors(false)
- , m_xGrpAxis(m_xBuilder->weld_widget("frameGrpAxis"))
- , m_xRbtAxis1(m_xBuilder->weld_radio_button("RBT_OPT_AXIS_1"))
- , m_xRbtAxis2(m_xBuilder->weld_radio_button("RBT_OPT_AXIS_2"))
- , m_xGrpBar(m_xBuilder->weld_widget("frameSettings"))
- , m_xMTGap(m_xBuilder->weld_metric_spin_button("MT_GAP", FieldUnit::PERCENT))
- , m_xMTOverlap(m_xBuilder->weld_metric_spin_button("MT_OVERLAP", FieldUnit::PERCENT))
- , m_xCBConnect(m_xBuilder->weld_check_button("CB_CONNECTOR"))
- , m_xCBAxisSideBySide(m_xBuilder->weld_check_button("CB_BARS_SIDE_BY_SIDE"))
- , m_xGrpPlotOptions(m_xBuilder->weld_widget("frameFL_PLOT_OPTIONS"))
- , m_xGridPlotOptions(m_xBuilder->weld_widget("gridPLOT_OPTIONS"))
- , m_xRB_DontPaint(m_xBuilder->weld_radio_button("RB_DONT_PAINT"))
- , m_xRB_AssumeZero(m_xBuilder->weld_radio_button("RB_ASSUME_ZERO"))
- , m_xRB_ContinueLine(m_xBuilder->weld_radio_button("RB_CONTINUE_LINE"))
- , m_xCBIncludeHiddenCells(m_xBuilder->weld_check_button("CB_INCLUDE_HIDDEN_CELLS"))
- , m_xCBHideLegendEntry(m_xBuilder->weld_check_button("CB_LEGEND_ENTRY_HIDDEN"))
+ , m_xGrpAxis(m_xBuilder->weld_widget(u"frameGrpAxis"_ustr))
+ , m_xRbtAxis1(m_xBuilder->weld_radio_button(u"RBT_OPT_AXIS_1"_ustr))
+ , m_xRbtAxis2(m_xBuilder->weld_radio_button(u"RBT_OPT_AXIS_2"_ustr))
+ , m_xGrpBar(m_xBuilder->weld_widget(u"frameSettings"_ustr))
+ , m_xMTGap(m_xBuilder->weld_metric_spin_button(u"MT_GAP"_ustr, FieldUnit::PERCENT))
+ , m_xMTOverlap(m_xBuilder->weld_metric_spin_button(u"MT_OVERLAP"_ustr, FieldUnit::PERCENT))
+ , m_xCBConnect(m_xBuilder->weld_check_button(u"CB_CONNECTOR"_ustr))
+ , m_xCBAxisSideBySide(m_xBuilder->weld_check_button(u"CB_BARS_SIDE_BY_SIDE"_ustr))
+ , m_xGrpPlotOptions(m_xBuilder->weld_widget(u"frameFL_PLOT_OPTIONS"_ustr))
+ , m_xGridPlotOptions(m_xBuilder->weld_widget(u"gridPLOT_OPTIONS"_ustr))
+ , m_xRB_DontPaint(m_xBuilder->weld_radio_button(u"RB_DONT_PAINT"_ustr))
+ , m_xRB_AssumeZero(m_xBuilder->weld_radio_button(u"RB_ASSUME_ZERO"_ustr))
+ , m_xRB_ContinueLine(m_xBuilder->weld_radio_button(u"RB_CONTINUE_LINE"_ustr))
+ , m_xCBIncludeHiddenCells(m_xBuilder->weld_check_button(u"CB_INCLUDE_HIDDEN_CELLS"_ustr))
+ , m_xCBHideLegendEntry(m_xBuilder->weld_check_button(u"CB_LEGEND_ENTRY_HIDDEN"_ustr))
{
m_xRbtAxis1->connect_toggled(LINK(this, SchOptionTabPage, EnableHdl));
m_xRbtAxis2->connect_toggled(LINK(this, SchOptionTabPage, EnableHdl));
@@ -113,13 +113,11 @@ bool SchOptionTabPage::FillItemSet(SfxItemSet* rOutAttrs)
void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
{
- const SfxPoolItem *pPoolItem = nullptr;
-
m_xRbtAxis1->set_active(true);
m_xRbtAxis2->set_active(false);
- if (rInAttrs->GetItemState(SCHATTR_AXIS,true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxInt32Item* pAxisItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS))
{
- tools::Long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ tools::Long nVal = pAxisItem->GetValue();
if(nVal==CHART_AXIS_SECONDARY_Y)
{
m_xRbtAxis2->set_active(true);
@@ -128,34 +126,34 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
}
tools::Long nTmp;
- if (rInAttrs->GetItemState(SCHATTR_BAR_GAPWIDTH, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxInt32Item* pGapWidthItem = rInAttrs->GetItemIfSet(SCHATTR_BAR_GAPWIDTH))
{
- nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
+ nTmp = static_cast<tools::Long>(pGapWidthItem->GetValue());
m_xMTGap->set_value(nTmp, FieldUnit::PERCENT);
}
- if (rInAttrs->GetItemState(SCHATTR_BAR_OVERLAP, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxInt32Item* pOverlapItem = rInAttrs->GetItemIfSet(SCHATTR_BAR_OVERLAP))
{
- nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
+ nTmp = static_cast<tools::Long>(pOverlapItem->GetValue());
m_xMTOverlap->set_value(nTmp, FieldUnit::PERCENT);
}
- if (rInAttrs->GetItemState(SCHATTR_BAR_CONNECT, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pConnectItem = rInAttrs->GetItemIfSet(SCHATTR_BAR_CONNECT))
{
- bool bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
+ bool bCheck = pConnectItem->GetValue();
m_xCBConnect->set_active(bCheck);
}
- if (rInAttrs->GetItemState(SCHATTR_AXIS_FOR_ALL_SERIES, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxInt32Item* pAllSeriesItem = rInAttrs->GetItemIfSet(SCHATTR_AXIS_FOR_ALL_SERIES))
{
- m_nAllSeriesAxisIndex = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ m_nAllSeriesAxisIndex = pAllSeriesItem->GetValue();
m_xCBAxisSideBySide->set_sensitive(false);
}
- if (rInAttrs->GetItemState(SCHATTR_GROUP_BARS_PER_AXIS, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pPerAxisItem = rInAttrs->GetItemIfSet(SCHATTR_GROUP_BARS_PER_AXIS))
{
// model property is "group bars per axis", UI feature is the other way
// round: "show bars side by side"
- bool bCheck = ! static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
+ bool bCheck = ! pPerAxisItem->GetValue();
m_xCBAxisSideBySide->set_active( bCheck );
}
else
@@ -166,10 +164,12 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
//missing value treatment
{
std::vector< sal_Int32 > aMissingValueTreatments;
- if( rInAttrs->GetItemState(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, true, &pPoolItem) == SfxItemState::SET )
- aMissingValueTreatments = static_cast<const SfxIntegerListItem*>(pPoolItem)->GetList();
+ if (const SfxIntegerListItem* pValueTreatmentsItem = rInAttrs->GetItemIfSet(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS))
+ aMissingValueTreatments = pValueTreatmentsItem->GetList();
- if ( aMissingValueTreatments.size()>1 && rInAttrs->GetItemState(SCHATTR_MISSING_VALUE_TREATMENT,true, &pPoolItem) == SfxItemState::SET)
+ const SfxInt32Item* pMissingValueTreatmentItem;
+ if ( aMissingValueTreatments.size()>1 &&
+ (pMissingValueTreatmentItem = rInAttrs->GetItemIfSet(SCHATTR_MISSING_VALUE_TREATMENT)) )
{
m_xRB_DontPaint->set_sensitive(false);
m_xRB_AssumeZero->set_sensitive(false);
@@ -185,7 +185,7 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
m_xRB_ContinueLine->set_sensitive(true);
}
- tools::Long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ tools::Long nVal=pMissingValueTreatmentItem->GetValue();
if(nVal==css::chart::MissingValueTreatment::LEAVE_GAP)
m_xRB_DontPaint->set_active(true);
else if(nVal==css::chart::MissingValueTreatment::USE_ZERO)
@@ -200,9 +200,9 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
}
// Include hidden cells
- if (rInAttrs->GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pHiddenCellsItem = rInAttrs->GetItemIfSet(SCHATTR_INCLUDE_HIDDEN_CELLS))
{
- bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+ bool bVal = pHiddenCellsItem->GetValue();
m_xCBIncludeHiddenCells->set_active(bVal);
}
else
@@ -215,9 +215,9 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
m_xGrpPlotOptions->hide();
}
- if (rInAttrs->GetItemState(SCHATTR_HIDE_LEGEND_ENTRY, true, &pPoolItem) == SfxItemState::SET)
+ if (const SfxBoolItem* pEntryItem = rInAttrs->GetItemIfSet(SCHATTR_HIDE_LEGEND_ENTRY))
{
- bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+ bool bVal = pEntryItem->GetValue();
m_xCBHideLegendEntry->set_active(bVal);
}
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
index 6b163f3c8815..48001d4fb7b8 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
@@ -24,7 +24,6 @@ namespace weld {
class CheckButton;
class MetricSpinButton;
class RadioButton;
- class ToggleButton;
class Widget;
}
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
index ed99a9a39501..11a3795fb3cd 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
@@ -31,15 +31,14 @@ namespace chart
SchAlignmentTabPage::SchAlignmentTabPage(weld::Container* pPage, weld::DialogController* pController,
const SfxItemSet& rInAttrs, bool bWithRotation)
- : SfxTabPage(pPage, pController, "modules/schart/ui/titlerotationtabpage.ui", "TitleRotationTabPage", &rInAttrs)
- , m_xFtRotate(m_xBuilder->weld_label("degreeL"))
- , m_xNfRotate(m_xBuilder->weld_metric_spin_button("OrientDegree", FieldUnit::DEGREE))
- , m_xCbStacked(m_xBuilder->weld_check_button("stackedCB"))
- , m_xFtTextDirection(m_xBuilder->weld_label("textdirL"))
- , m_xFtABCD(m_xBuilder->weld_label("labelABCD"))
- , m_xLbTextDirection(new TextDirectionListBox(m_xBuilder->weld_combo_box("textdirLB")))
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/titlerotationtabpage.ui"_ustr, u"TitleRotationTabPage"_ustr, &rInAttrs)
+ , m_xFtRotate(m_xBuilder->weld_label(u"degreeL"_ustr))
+ , m_xNfRotate(m_xBuilder->weld_metric_spin_button(u"OrientDegree"_ustr, FieldUnit::DEGREE))
+ , m_xCbStacked(m_xBuilder->weld_check_button(u"stackedCB"_ustr))
+ , m_xFtABCD(m_xBuilder->weld_label(u"labelABCD"_ustr))
+ , m_aLbTextDirection(m_xBuilder->weld_combo_box(u"textdirLB"_ustr))
, m_xCtrlDial(new svx::DialControl)
- , m_xCtrlDialWin(new weld::CustomWeld(*m_xBuilder, "dialCtrl", *m_xCtrlDial))
+ , m_xCtrlDialWin(new weld::CustomWeld(*m_xBuilder, u"dialCtrl"_ustr, *m_xCtrlDial))
{
m_xCtrlDial->SetLinkedField(m_xNfRotate.get());
m_xCtrlDial->SetText(m_xFtABCD->get_label());
@@ -72,7 +71,6 @@ SchAlignmentTabPage::~SchAlignmentTabPage()
{
m_xCtrlDialWin.reset();
m_xCtrlDial.reset();
- m_xLbTextDirection.reset();
}
std::unique_ptr<SfxTabPage> SchAlignmentTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
@@ -96,7 +94,7 @@ bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs)
Degree100 nDegrees = bStacked ? 0_deg100 : m_xCtrlDial->GetRotation();
rOutAttrs->Put( SdrAngleItem( SCHATTR_TEXT_DEGREES, nDegrees ) );
- SvxFrameDirection aDirection( m_xLbTextDirection->get_active_id() );
+ SvxFrameDirection aDirection( m_aLbTextDirection.get_active_id() );
rOutAttrs->Put( SvxFrameDirectionItem( aDirection, EE_PARA_WRITINGDIR ) );
return true;
@@ -114,8 +112,8 @@ void SchAlignmentTabPage::Reset(const SfxItemSet* rInAttrs)
m_xCbStacked->set_active(bStacked);
StackedToggleHdl(*m_xCbStacked);
- if( rInAttrs->GetItemState(EE_PARA_WRITINGDIR, true, &pItem) == SfxItemState::SET)
- m_xLbTextDirection->set_active_id(static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue());
+ if( const SvxFrameDirectionItem* pDirectionItem = rInAttrs->GetItemIfSet(EE_PARA_WRITINGDIR) )
+ m_aLbTextDirection.set_active_id(pDirectionItem->GetValue());
}
} //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
index b303e4d3596c..559212ddf293 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.hxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
@@ -20,14 +20,12 @@
#include <sfx2/tabdlg.hxx>
#include <svx/dialcontrol.hxx>
+#include <TextDirectionListBox.hxx>
-namespace chart { class TextDirectionListBox; }
namespace weld {
class CheckButton;
class CustomWeld;
class Label;
- class SpinButton;
- class ToggleButton;
}
namespace chart
@@ -39,9 +37,8 @@ private:
std::unique_ptr<weld::Label> m_xFtRotate;
std::unique_ptr<weld::MetricSpinButton> m_xNfRotate;
std::unique_ptr<weld::CheckButton> m_xCbStacked;
- std::unique_ptr<weld::Label> m_xFtTextDirection;
std::unique_ptr<weld::Label> m_xFtABCD;
- std::unique_ptr<TextDirectionListBox> m_xLbTextDirection;
+ TextDirectionListBox m_aLbTextDirection;
std::unique_ptr<svx::DialControl> m_xCtrlDial;
std::unique_ptr<weld::CustomWeld> m_xCtrlDialWin;
diff --git a/chart2/source/controller/dialogs/tp_Trendline.cxx b/chart2/source/controller/dialogs/tp_Trendline.cxx
index fe25959bdd51..cace8a073b87 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.cxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.cxx
@@ -23,7 +23,7 @@ namespace chart
{
TrendlineTabPage::TrendlineTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
- : SfxTabPage(pPage, pController, "modules/schart/ui/tp_Trendline.ui", "TP_TRENDLINE", &rInAttrs)
+ : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_Trendline.ui"_ustr, u"TP_TRENDLINE"_ustr, &rInAttrs)
, m_aTrendlineResources(*m_xBuilder, rInAttrs)
{
}
diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
index 2719874fd66a..480bf3fe20b6 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
@@ -20,13 +20,11 @@
#include "tp_Wizard_TitlesAndObjects.hxx"
#include <res_Titles.hxx>
#include <res_LegendPosition.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
#include <Diagram.hxx>
#include <AxisHelper.hxx>
#include <ControllerLockGuard.hxx>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <utility>
namespace chart
{
@@ -34,18 +32,18 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
TitlesAndObjectsTabPage::TitlesAndObjectsTabPage(weld::Container* pPage, weld::DialogController* pController,
- const rtl::Reference<::chart::ChartModel>& xChartModel,
+ rtl::Reference<::chart::ChartModel> xChartModel,
const uno::Reference< uno::XComponentContext >& xContext )
- : OWizardPage(pPage, pController, "modules/schart/ui/wizelementspage.ui", "WizElementsPage")
+ : OWizardPage(pPage, pController, u"modules/schart/ui/wizelementspage.ui"_ustr, u"WizElementsPage"_ustr)
, m_xTitleResources(new TitleResources(*m_xBuilder, false))
, m_xLegendPositionResources(new LegendPositionResources(*m_xBuilder, xContext))
- , m_xChartModel(xChartModel)
+ , m_xChartModel(std::move(xChartModel))
, m_xCC(xContext)
, m_bCommitToModel(true)
, m_aTimerTriggeredControllerLock( m_xChartModel )
- , m_xCB_Grid_X(m_xBuilder->weld_check_button("x"))
- , m_xCB_Grid_Y(m_xBuilder->weld_check_button("y"))
- , m_xCB_Grid_Z(m_xBuilder->weld_check_button("z"))
+ , m_xCB_Grid_X(m_xBuilder->weld_check_button(u"x"_ustr))
+ , m_xCB_Grid_Y(m_xBuilder->weld_check_button(u"y"_ustr))
+ , m_xCB_Grid_Z(m_xBuilder->weld_check_button(u"z"_ustr))
{
m_xTitleResources->connect_changed( LINK( this, TitlesAndObjectsTabPage, ChangeEditHdl ));
m_xLegendPositionResources->SetChangeHdl( LINK( this, TitlesAndObjectsTabPage, ChangeHdl ));
@@ -77,7 +75,7 @@ void TitlesAndObjectsTabPage::initializePage()
//init grid checkboxes
{
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( m_xChartModel );
+ rtl::Reference< Diagram > xDiagram = m_xChartModel->getFirstChartDiagram();
uno::Sequence< sal_Bool > aPossibilityList;
uno::Sequence< sal_Bool > aExistenceList;
AxisHelper::getAxisOrGridPossibilities( aPossibilityList, xDiagram, false );
@@ -122,7 +120,7 @@ void TitlesAndObjectsTabPage::commitToModel()
//commit grid changes to model
{
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xModel );
+ rtl::Reference< Diagram > xDiagram = xModel->getFirstChartDiagram();
uno::Sequence< sal_Bool > aOldExistenceList;
AxisHelper::getAxisOrGridExistence( aOldExistenceList, xDiagram, false );
uno::Sequence< sal_Bool > aNewExistenceList(aOldExistenceList);
diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx
index f06a3e7ec589..c63c885d1d4e 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx
@@ -28,7 +28,6 @@
namespace chart { class LegendPositionResources; }
namespace chart { class TitleResources; }
-namespace com::sun::star::chart2 { class XChartDocument; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
@@ -39,7 +38,7 @@ class TitlesAndObjectsTabPage final : public vcl::OWizardPage
{
public:
TitlesAndObjectsTabPage(weld::Container* pPage, weld::DialogController* pController,
- const rtl::Reference<::chart::ChartModel>& xChartModel,
+ rtl::Reference<::chart::ChartModel> xChartModel,
const css::uno::Reference< css::uno::XComponentContext >& xContext);
virtual ~TitlesAndObjectsTabPage() override;
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 3918a296e638..74be51a5ee11 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -19,9 +19,10 @@
#include <DrawViewWrapper.hxx>
#include <chartview/DrawModelWrapper.hxx>
-#include <ConfigurationAccess.hxx>
#include <unotools/lingucfg.hxx>
+#include <unotools/syslocale.hxx>
+#include <unotools/localedatawrapper.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/langitem.hxx>
#include <svl/intitem.hxx>
@@ -35,11 +36,12 @@
#include <editeng/fhgtitem.hxx>
#include <osl/diagnose.h>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <sfx2/objsh.hxx>
+#include <sfx2/viewsh.hxx>
#include <svx/helperhittest3d.hxx>
+#include <officecfg/Office/Calc.hxx>
using namespace ::com::sun::star;
@@ -79,7 +81,6 @@ DrawViewWrapper::DrawViewWrapper(
{
SetBufferedOutputAllowed(true);
SetBufferedOverlayAllowed(true);
- SetPagePaintingAllowed(true);
// #i12587# support for shapes in chart
SdrOutliner* pOutliner = getOutliner();
@@ -89,12 +90,12 @@ DrawViewWrapper::DrawViewWrapper(
SvtLinguConfig aLinguConfig;
SvtLinguOptions aLinguOptions;
aLinguConfig.GetOptions( aLinguOptions );
- pOutlinerPool->SetPoolDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage, EE_CHAR_LANGUAGE ) );
- pOutlinerPool->SetPoolDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage_CJK, EE_CHAR_LANGUAGE_CJK ) );
- pOutlinerPool->SetPoolDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage_CTL, EE_CHAR_LANGUAGE_CTL ) );
+ pOutlinerPool->SetUserDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage, EE_CHAR_LANGUAGE ) );
+ pOutlinerPool->SetUserDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage_CJK, EE_CHAR_LANGUAGE_CJK ) );
+ pOutlinerPool->SetUserDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage_CTL, EE_CHAR_LANGUAGE_CTL ) );
// set font height without changing SdrEngineDefaults
- pOutlinerPool->SetPoolDefaultItem( SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT ) ); // 12pt
+ pOutlinerPool->SetUserDefaultItem( SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT ) ); // 12pt
}
// #i121463# Use big handles by default
@@ -122,7 +123,7 @@ void DrawViewWrapper::ReInit()
tools::Rectangle aRect(Point(0,0), aOutputSize);
SetWorkArea(aRect);
- ShowSdrPage(GetModel()->GetPage(0));
+ ShowSdrPage(GetModel().GetPage(0));
}
DrawViewWrapper::~DrawViewWrapper()
@@ -168,7 +169,7 @@ SdrObject* DrawViewWrapper::getHitObject( const Point& rPnt ) const
//3d objects need a special treatment
//because the simple PickObj method is not accurate in this case for performance reasons
- E3dObject* pE3d = dynamic_cast< E3dObject* >(pRet);
+ E3dObject* pE3d = DynCastE3dObject(pRet);
if( pE3d )
{
E3dScene* pScene(pE3d->getRootE3dSceneFromE3dObject());
@@ -211,10 +212,23 @@ void DrawViewWrapper::setMarkHandleProvider( MarkHandleProvider* pMarkHandleProv
void DrawViewWrapper::CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* /* pRedirector */)
{
- svtools::ColorConfig aColorConfig;
- Color aFillColor( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
+ Color aFillColor;
+ if (const SfxViewShell* pViewShell = SfxViewShell::Current())
+ aFillColor = pViewShell->GetColorConfigColor(svtools::DOCCOLOR);
+ else
+ {
+ svtools::ColorConfig aColorConfig;
+ aFillColor = aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor;
+ }
SetApplicationBackgroundColor(aFillColor);
+
+ SdrOutliner& rOutliner = GetModel().GetDrawOutliner();
+ Color aOldBackColor = rOutliner.GetBackgroundColor();
+ rOutliner.SetBackgroundColor(aFillColor);
+
E3dView::CompleteRedraw( pOut, rReg );
+
+ rOutliner.SetBackgroundColor(aOldBackColor);
}
SdrObject* DrawViewWrapper::getSelectedObject() const
@@ -255,8 +269,16 @@ SdrOutliner* DrawViewWrapper::getOutliner() const
SfxItemSet DrawViewWrapper::getPositionAndSizeItemSetFromMarkedObject() const
{
+ SvtSysLocale aSysLocale;
+ MeasurementSystem eSys = aSysLocale.GetLocaleData().getMeasurementSystemEnum();
+ sal_uInt16 nAttrMetric;
+ if( eSys == MeasurementSystem::Metric )
+ nAttrMetric = officecfg::Office::Calc::Layout::Other::MeasureUnit::Metric::get();
+ else
+ nAttrMetric = officecfg::Office::Calc::Layout::Other::MeasureUnit::NonMetric::get();
+
SfxItemSet aFullSet(
- GetModel()->GetItemPool(),
+ GetModel().GetItemPool(),
svl::Items<
SDRATTR_CORNER_RADIUS, SDRATTR_CORNER_RADIUS,
SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
@@ -264,7 +286,7 @@ SfxItemSet DrawViewWrapper::getPositionAndSizeItemSetFromMarkedObject() const
SID_ATTR_METRIC, SID_ATTR_METRIC>);
SfxItemSet aGeoSet( E3dView::GetGeoAttrFromMarked() );
aFullSet.Put( aGeoSet );
- aFullSet.Put( SfxUInt16Item(SID_ATTR_METRIC,static_cast< sal_uInt16 >( ConfigurationAccess::getFieldUnit())));
+ aFullSet.Put( SfxUInt16Item(SID_ATTR_METRIC, nAttrMetric) );
return aFullSet;
}
@@ -293,8 +315,8 @@ bool DrawViewWrapper::IsObjectHit( SdrObject const * pObj, const Point& rPnt )
void DrawViewWrapper::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
//prevent wrong reselection of objects
- SdrModel* pSdrModel( GetModel() );
- if( pSdrModel && pSdrModel->isLocked() )
+ SdrModel& rSdrModel = GetModel();
+ if (rSdrModel.isLocked())
return;
const SdrHint* pSdrHint = ( rHint.GetId() == SfxHintId::ThisIsAnSdrHint ? static_cast<const SdrHint*>(&rHint) : nullptr );
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index 77099c9444fe..51b163d1fccd 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -26,14 +26,13 @@
#include <com/sun/star/drawing/Direction3D.hpp>
#include <o3tl/safeint.hxx>
#include <svx/xtable.hxx>
-#include <svl/itempool.hxx>
#include <svtools/ctrltool.hxx>
#include <vcl/svapp.hxx>
#include <svx/svdobj.hxx>
#include <vcl/virdev.hxx>
#include <svx/svdview.hxx>
#include <svx/svdpage.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -110,10 +109,6 @@ SdrObjList* ViewElementListProvider::GetSymbolList() const
{
//@todo use mutex
- //get shape factory
- uno::Reference<lang::XMultiServiceFactory> xShapeFactory(
- m_pDrawModelWrapper->getShapeFactory());
-
//get hidden draw page (target):
rtl::Reference<SvxDrawPage> xTarget = m_pDrawModelWrapper->getHiddenDrawPage();
@@ -143,7 +138,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
nStandardSymbol*=-1;
if( o3tl::make_unsigned(nStandardSymbol) >= pSymbolList->GetObjCount() )
nStandardSymbol %= pSymbolList->GetObjCount();
- SdrObject* pObj = pSymbolList->GetObj(nStandardSymbol);
+ rtl::Reference<SdrObject> pObj = pSymbolList->GetObj(nStandardSymbol);
ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
@@ -151,7 +146,6 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
std::unique_ptr<SdrModel> pModel(
new SdrModel());
- pModel->GetItemPool().FreezeIdRanges();
rtl::Reference<SdrPage> pPage = new SdrPage( *pModel, false );
pPage->SetSize(Size(1000,1000));
pModel->InsertPage( pPage.get(), 0 );
@@ -162,8 +156,8 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
// directly clone to target SdrModel
pObj = pObj->CloneSdrObject(*pModel);
- pPage->NbcInsertObject(pObj);
- aView.MarkObj(pObj,pPageView);
+ pPage->NbcInsertObject(pObj.get());
+ aView.MarkObj(pObj.get(),pPageView);
if( pSymbolShapeProperties )
pObj->SetMergedItemSet(*pSymbolShapeProperties);
@@ -176,7 +170,9 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
aView.UnmarkAll();
pObj=pPage->RemoveObject(0);
- SdrObject::Free( pObj );
+ // these need to die before the associated SdrModel
+ pObj.clear();
+ pPage.clear();
return aGraph;
}
diff --git a/chart2/source/controller/inc/AccessibleBase.hxx b/chart2/source/controller/inc/AccessibleBase.hxx
index 4bd51c342678..011bdfa48b88 100644
--- a/chart2/source/controller/inc/AccessibleBase.hxx
+++ b/chart2/source/controller/inc/AccessibleBase.hxx
@@ -23,24 +23,18 @@
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
-#include <comphelper/accessibleeventnotifier.hxx>
+#include <comphelper/OAccessible.hxx>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
-#include <rtl/ref.hxx>
#include <tools/color.hxx>
#include <unotools/weakref.hxx>
+#include <vcl/window.hxx>
#include <map>
#include <vector>
#include <memory>
namespace com::sun::star::awt { class XWindow; }
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::view { class XSelectionSupplier; }
-namespace utl { class AccessibleStateSetHelper; }
class SdrView;
@@ -54,7 +48,9 @@ namespace chart
{
class AccessibleBase;
+class ChartView;
class ObjectHierarchy;
+class ChartController;
typedef ObjectIdentifier AccessibleUniqueId;
@@ -63,9 +59,9 @@ struct AccessibleElementInfo
AccessibleUniqueId m_aOID;
unotools::WeakReference< ::chart::ChartModel > m_xChartDocument;
- css::uno::WeakReference< css::view::XSelectionSupplier > m_xSelectionSupplier;
- css::uno::WeakReference< css::uno::XInterface > m_xView;
- css::uno::WeakReference< css::awt::XWindow > m_xWindow;
+ unotools::WeakReference< ::chart::ChartController > m_xChartController;
+ unotools::WeakReference< ::chart::ChartView > m_xView;
+ VclPtr<vcl::Window> m_pWindow;
std::shared_ptr< ObjectHierarchy > m_spObjectHierarchy;
@@ -74,23 +70,9 @@ struct AccessibleElementInfo
::accessibility::IAccessibleViewForwarder* m_pViewForwarder;
};
-namespace impl
-{
-typedef ::cppu::WeakComponentImplHelper<
- css::accessibility::XAccessible,
- css::accessibility::XAccessibleContext,
- css::accessibility::XAccessibleComponent,
- css::accessibility::XAccessibleEventBroadcaster,
- css::lang::XServiceInfo,
- css::lang::XEventListener
- > AccessibleBase_Base;
-}
-
/** Base class for all Chart Accessibility objects
*/
-class AccessibleBase :
- public cppu::BaseMutex,
- public impl::AccessibleBase_Base
+class AccessibleBase : public comphelper::OAccessible
{
public:
enum class EventType
@@ -99,7 +81,7 @@ public:
LOST_SELECTION
};
- AccessibleBase( const AccessibleElementInfo & rAccInfo,
+ AccessibleBase( AccessibleElementInfo aAccInfo,
bool bMayHaveChildren,
bool bAlwaysTransparent );
virtual ~AccessibleBase() override;
@@ -108,14 +90,6 @@ protected:
// for all calls to protected methods it is assumed that the mutex is locked
// unless calls outside via UNO, e.g. event notification, are done
- /** @param bThrowException if true, a DisposedException is thrown if the
- object is already disposed
- @return true, if the component is already disposed and bThrowException is false,
- false otherwise
- @throws css::lang::DisposedException
- */
- bool CheckDisposeState( bool bThrowException = true ) const;
-
/** Events coming from the core have to be processed in this methods. The
default implementation returns false, which indicates that the object is
not interested in the event. To react on events you have to implement
@@ -135,14 +109,14 @@ protected:
@throws css::uno::RuntimeException
*/
- void AddState( sal_Int16 aState );
+ void AddState( sal_Int64 aState );
/** Removes a state from the set if the set contains the state, otherwise
nothing is done.
@throws css::uno::RuntimeException
*/
- void RemoveState( sal_Int16 aState );
+ void RemoveState( sal_Int64 aState );
/** has to be overridden by derived classes that support child elements.
With this method a rescan is initiated that should result in a correct
@@ -183,17 +157,6 @@ protected:
*/
virtual css::awt::Point GetUpperLeftOnScreen() const;
- /** This method creates an AccessibleEventObject and sends it to all
- listeners that are currently listening to this object
-
- If bSendGlobally is true, the event is also broadcast via
- vcl::unohelper::NotifyAccessibleStateEventGlobally()
- */
- void BroadcastAccEvent( sal_Int16 nId,
- const css::uno::Any & rNew,
- const css::uno::Any & rOld,
- bool bSendGlobally = false ) const;
-
/** Removes all children from the internal lists and broadcasts child remove
events.
@@ -209,14 +172,14 @@ protected:
@throws css::uno::RuntimeException
*/
virtual css::uno::Reference< css::accessibility::XAccessible >
- ImplGetAccessibleChildById( sal_Int32 i ) const;
+ ImplGetAccessibleChildById( sal_Int64 i ) const;
/** Is called from getAccessibleChildCount(). Before this method is called,
an update of children is done if necessary.
@throws css::uno::RuntimeException
*/
- virtual sal_Int32 ImplGetAccessibleChildCount() const;
+ virtual sal_Int64 ImplGetAccessibleChildCount() const;
const AccessibleElementInfo& GetInfo() const { return m_aAccInfo;}
void SetInfo( const AccessibleElementInfo & rNewInfo );
@@ -225,16 +188,13 @@ protected:
// ________ WeakComponentImplHelper (XComponent::dispose) ________
virtual void SAL_CALL disposing() override;
- // ________ XAccessible ________
- virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override;
-
// ________ XAccessibleContext ________
- virtual sal_Int32 SAL_CALL getAccessibleChildCount() override;
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
- getAccessibleChild( sal_Int32 i ) override;
+ getAccessibleChild( sal_Int64 i ) override;
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
getAccessibleParent() override;
- virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override;
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
/// @return AccessibleRole.SHAPE
virtual sal_Int16 SAL_CALL getAccessibleRole() override;
// has to be implemented by derived classes
@@ -242,43 +202,22 @@ protected:
// throw (css::uno::RuntimeException);
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL
getAccessibleRelationSet() override;
- virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL
- getAccessibleStateSet() override;
+ virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
virtual css::lang::Locale SAL_CALL getLocale() override;
// has to be implemented by derived classes
// virtual OUString SAL_CALL getAccessibleDescription()
// throw (css::uno::RuntimeException);
+ // OAccessible
+ virtual css::awt::Rectangle implGetBounds() override;
+
// ________ XAccessibleComponent ________
- virtual sal_Bool SAL_CALL containsPoint(
- const css::awt::Point& aPoint ) override;
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
- // has to be defined in derived classes
- virtual css::awt::Rectangle SAL_CALL getBounds() override;
- virtual css::awt::Point SAL_CALL getLocation() override;
- virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
- virtual css::awt::Size SAL_CALL getSize() override;
virtual void SAL_CALL grabFocus() override;
virtual sal_Int32 SAL_CALL getForeground() override;
virtual sal_Int32 SAL_CALL getBackground() override;
- // ________ XServiceInfo ________
- virtual OUString SAL_CALL getImplementationName() override;
- virtual sal_Bool SAL_CALL supportsService(
- const OUString& ServiceName ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
-
- // ________ XEventListener ________
- virtual void SAL_CALL disposing(
- const css::lang::EventObject& Source ) override;
-
- // ________ XAccessibleEventBroadcaster ________
- virtual void SAL_CALL addAccessibleEventListener(
- const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override;
- virtual void SAL_CALL removeAccessibleEventListener(
- const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override;
-
private:
enum eColorType
{
@@ -288,28 +227,20 @@ private:
Color getColor( eColorType eColType );
private:
- /** type of the vector containing the accessible children
- */
- typedef std::vector< css::uno::Reference< css::accessibility::XAccessible > > ChildListVectorType;
/** type of the hash containing a vector index for every AccessibleUniqueId
of the object in the child list
*/
- typedef std::map< ObjectIdentifier, css::uno::Reference< css::accessibility::XAccessible > > ChildOIDMap;
+ typedef std::map<ObjectIdentifier, rtl::Reference<AccessibleBase>> ChildOIDMap;
- bool m_bIsDisposed;
const bool m_bMayHaveChildren;
bool m_bChildrenInitialized;
- ChildListVectorType m_aChildList;
+ std::vector<rtl::Reference<AccessibleBase>> m_aChildList;
ChildOIDMap m_aChildOIDMap;
- ::comphelper::AccessibleEventNotifier::TClientId m_nEventNotifierId;
-
- /** Implementation helper for getAccessibleStateSet()
-
- Note: This member must come before m_aStateSet!
+ /** for getAccessibleStateSet()
*/
- rtl::Reference<::utl::AccessibleStateSetHelper> m_xStateSetHelper;
+ sal_Int64 m_nStateSet;
AccessibleElementInfo m_aAccInfo;
const bool m_bAlwaysTransparent;
@@ -317,10 +248,8 @@ private:
state is checked.
This variable is monitored by the solar mutex!
-
- Note: declared volatile to enable double-check-locking
*/
- volatile bool m_bStateSetInitialized;
+ bool m_bStateSetInitialized;
};
} // namespace chart
diff --git a/chart2/source/controller/inc/AccessibleChartView.hxx b/chart2/source/controller/inc/AccessibleChartView.hxx
index eb3367b205d6..9a973f80843a 100644
--- a/chart2/source/controller/inc/AccessibleChartView.hxx
+++ b/chart2/source/controller/inc/AccessibleChartView.hxx
@@ -19,6 +19,7 @@
#pragma once
#include "AccessibleBase.hxx"
+#include "ChartWindow.hxx"
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/lang/XInitialization.hpp>
@@ -27,9 +28,6 @@
#include <memory>
namespace com::sun::star::accessibility { class XAccessible; }
-namespace com::sun::star::awt { class XWindow; }
-namespace com::sun::star::frame { class XModel; }
-namespace com::sun::star::view { class XSelectionSupplier; }
namespace accessibility
{
@@ -38,37 +36,32 @@ class IAccessibleViewForwarder;
namespace chart
{
+class ChartView;
-namespace impl
-{
-typedef ::cppu::ImplInheritanceHelper<
- ::chart::AccessibleBase,
- css::lang::XInitialization,
- css::view::XSelectionChangeListener >
- AccessibleChartView_Base;
-}
-
-class AccessibleChartView final :
- public impl::AccessibleChartView_Base
+class AccessibleChartView final
+ : public cppu::ImplInheritanceHelper<chart::AccessibleBase, css::view::XSelectionChangeListener>
{
public:
- AccessibleChartView(SdrView* pView );
+ AccessibleChartView( SdrView* pView );
virtual ~AccessibleChartView() override;
AccessibleChartView() = delete;
- // ____ WeakComponentHelper (called from XComponent::dispose()) ____
- using AccessibleBase::disposing;
+ virtual void SAL_CALL disposing() override;
- // ____ lang::XInitialization ____
// 0: view::XSelectionSupplier offers notifications for selection changes and access to the selection itself
// 1: frame::XModel representing the chart model - offers access to object data
// 2: lang::XInterface representing the normal chart view - offers access to some extra object data
// 3: accessibility::XAccessible representing the parent accessible
- // 4: awt::XWindow representing the view's window (is a vcl Window)
+ // 4: ChartWindow representing the view's window
// all arguments are only valid until next initialization - don't keep them longer
- virtual void SAL_CALL initialize(
- const css::uno::Sequence< css::uno::Any >& aArguments ) override;
+ void initialize( ChartController& rChartController,
+ const rtl::Reference<::chart::ChartModel>& xChartModel,
+ const rtl::Reference<::chart::ChartView>& xChartView,
+ const css::uno::Reference< css::accessibility::XAccessible >& xParent,
+ ChartWindow* pNewChartWindow);
+ // used to disconnect from view
+ void initialize();
// ____ view::XSelectionChangeListener ____
virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
@@ -79,13 +72,12 @@ public:
// ________ XAccessibleContext ________
virtual OUString SAL_CALL getAccessibleDescription() override;
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override;
- virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override;
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
virtual OUString SAL_CALL getAccessibleName() override;
virtual sal_Int16 SAL_CALL getAccessibleRole() override;
- // ________ XAccessibleComponent ________
- virtual css::awt::Rectangle SAL_CALL getBounds() override;
- virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
+ // OAccessible
+ virtual css::awt::Rectangle implGetBounds() override;
protected:
// ________ AccessibleChartElement ________
@@ -101,10 +93,10 @@ private: // methods
css::awt::Rectangle GetWindowPosSize() const;
private: // members
- css::uno::WeakReference< css::view::XSelectionSupplier > m_xSelectionSupplier;
- unotools::WeakReference<::chart::ChartModel> m_xChartModel;
- css::uno::WeakReference< css::uno::XInterface > m_xChartView;
- css::uno::WeakReference< css::awt::XWindow > m_xWindow;
+ unotools::WeakReference< ::chart::ChartController > m_xChartController;
+ unotools::WeakReference< ::chart::ChartModel > m_xChartModel;
+ unotools::WeakReference< ChartView > m_xChartView;
+ VclPtr<ChartWindow> m_pChartWindow;
css::uno::WeakReference< css::accessibility::XAccessible > m_xParent;
std::shared_ptr< ObjectHierarchy > m_spObjectHierarchy;
diff --git a/chart2/source/controller/inc/AccessibleTextHelper.hxx b/chart2/source/controller/inc/AccessibleTextHelper.hxx
index 075fbf0f9709..ccdf1ed6bd61 100644
--- a/chart2/source/controller/inc/AccessibleTextHelper.hxx
+++ b/chart2/source/controller/inc/AccessibleTextHelper.hxx
@@ -18,16 +18,13 @@
*/
#pragma once
-#include <memory>
+#include <comphelper/OAccessible.hxx>
#include <comphelper/compbase.hxx>
-#include <com/sun/star/lang/XInitialization.hpp>
+#include <svx/AccessibleTextHelper.hxx>
+#include <vcl/window.hxx>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
-// forward declaration of helper class from svx
-namespace accessibility
-{
-class AccessibleTextHelper;
-}
namespace chart
{
@@ -37,7 +34,6 @@ class DrawViewWrapper;
namespace impl
{
typedef comphelper::WeakComponentImplHelper<
- css::lang::XInitialization,
css::accessibility::XAccessibleContext >
AccessibleTextHelper_Base;
}
@@ -49,7 +45,6 @@ public:
explicit AccessibleTextHelper( DrawViewWrapper * pDrawViewWrapper );
virtual ~AccessibleTextHelper() override;
- // ____ XInitialization ____
/** Must be called at least once for this helper class to work.
mandatory parameter 0: type string. This is the CID that is used to find
@@ -59,27 +54,28 @@ public:
mandatory parameter 1: type XAccessible. Is used as EventSource for the
::accessibility::AccessibleTextHelper (svx)
- mandatory parameter 2: type awt::XWindow. The Window that shows the
+ mandatory parameter 2: type vcl::Window. The Window that shows the
text currently.
*/
- virtual void SAL_CALL initialize(
- const css::uno::Sequence< css::uno::Any >& aArguments ) override;
+ void initialize(const OUString& aCID,
+ const rtl::Reference<comphelper::OAccessible>& rEventSource,
+ vcl::Window* pWindow);
// ____ XAccessibleContext ____
- virtual ::sal_Int32 SAL_CALL getAccessibleChildCount() override;
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(
- ::sal_Int32 i ) override;
+ sal_Int64 i ) override;
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override;
- virtual ::sal_Int32 SAL_CALL getAccessibleIndexInParent() override;
+ virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
virtual ::sal_Int16 SAL_CALL getAccessibleRole() override;
virtual OUString SAL_CALL getAccessibleDescription() override;
virtual OUString SAL_CALL getAccessibleName() override;
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override;
- virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override;
+ virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
virtual css::lang::Locale SAL_CALL getLocale() override;
private:
- std::unique_ptr<::accessibility::AccessibleTextHelper> m_pTextHelper;
+ std::optional<::accessibility::AccessibleTextHelper> m_oTextHelper;
DrawViewWrapper * m_pDrawViewWrapper;
};
diff --git a/chart2/source/controller/inc/AxisItemConverter.hxx b/chart2/source/controller/inc/AxisItemConverter.hxx
index cbb75d2a1db6..c14ef82bd595 100644
--- a/chart2/source/controller/inc/AxisItemConverter.hxx
+++ b/chart2/source/controller/inc/AxisItemConverter.hxx
@@ -19,14 +19,16 @@
#pragma once
#include "ItemConverter.hxx"
+#include <com/sun/star/awt/Size.hpp>
#include <rtl/ref.hxx>
+#include <optional>
#include <vector>
-namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::chart2 { class XAxis; }
namespace com::sun::star::chart2 { class XChartDocument; }
+namespace chart { class Axis; }
namespace chart { struct ExplicitIncrementData; }
namespace chart { struct ExplicitScaleData; }
namespace chart { class ChartModel; }
@@ -44,7 +46,7 @@ public:
const rtl::Reference<::chart::ChartModel> & xChartDoc,
ExplicitScaleData const * pScale,
ExplicitIncrementData const * pIncrement,
- const css::awt::Size* pRefSize );
+ const std::optional<css::awt::Size>& pRefSize );
virtual ~AxisItemConverter() override;
@@ -60,8 +62,7 @@ protected:
private:
std::vector< std::unique_ptr<ItemConverter> > m_aConverters;
- css::uno::Reference<
- css::chart2::XAxis > m_xAxis;
+ rtl::Reference<::chart::Axis> m_xAxis;
rtl::Reference<::chart::ChartModel>m_xChartDoc;
diff --git a/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx b/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx
index 96138e237230..65ff58ea45ab 100644
--- a/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx
+++ b/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx
@@ -35,8 +35,8 @@ public:
CharacterPropertyItemConverter(
const css::uno::Reference<css::beans::XPropertySet>& rPropertySet,
SfxItemPool& rItemPool,
- const css::awt::Size* pRefSize,
- const OUString & rRefSizePropertyName,
+ const std::optional<css::awt::Size>& pRefSize,
+ OUString aRefSizePropertyName,
const css::uno::Reference<css::beans::XPropertySet>& rRefSizePropSet = css::uno::Reference<css::beans::XPropertySet>() );
virtual ~CharacterPropertyItemConverter() override;
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
index d50800fd67ad..5a33adb1e64e 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -19,6 +19,8 @@
#pragma once
#include <LifeTime.hxx>
+#include <ReferenceSizeProvider.hxx>
+#include "AccessibleChartView.hxx"
#include "CommandDispatchContainer.hxx"
#include "SelectionHelper.hxx"
@@ -34,16 +36,14 @@
#include <com/sun/star/util/XModeChangeListener.hpp>
#include <com/sun/star/util/XCloseListener.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
-#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/frame/XLayoutManagerListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <memory>
#include <string_view>
namespace com::sun::star::accessibility { class XAccessible; }
-namespace com::sun::star::accessibility { class XAccessibleContext; }
namespace com::sun::star::awt { class XFocusListener; }
namespace com::sun::star::awt { class XKeyListener; }
namespace com::sun::star::awt { class XMouseListener; }
@@ -56,12 +56,9 @@ namespace com::sun::star::document { class XUndoManager; }
namespace com::sun::star::frame { class XDispatch; }
namespace com::sun::star::frame { class XLayoutManagerEventBroadcaster; }
namespace com::sun::star::graphic { class XGraphic; }
-namespace com::sun::star::lang { class XInitialization; }
namespace com::sun::star::uno { class XComponentContext; }
-namespace com::sun::star::util { class XCloseable; }
namespace com::sun::star::view { class XSelectionSupplier; }
-
class SdrModel;
namespace svt
@@ -83,26 +80,25 @@ namespace chart
{
class UndoGuard;
+class ChartView;
class ChartWindow;
class DrawModelWrapper;
class DrawViewWrapper;
-class ReferenceSizeProvider;
class ViewElementListProvider;
class Diagram;
+class AccessibleTextHelper;
enum ChartDrawMode { CHARTDRAW_INSERT, CHARTDRAW_SELECT };
class ChartController final : public ::cppu::WeakImplHelper <
- css::frame::XController //comprehends XComponent (required interface)
+ css::frame::XController2 //comprehends XComponent (css::frame::XController is required interface)
,css::frame::XDispatchProvider //(required interface)
,css::view::XSelectionSupplier //(optional interface)
,css::ui::XContextMenuInterception //(optional interface)
,css::util::XCloseListener //(needed for communication with XModel)
- ,css::lang::XServiceInfo
,css::frame::XDispatch
,css::awt::XWindow //this is the Window Controller part of this Controller, that will be given to a Frame via setComponent
- ,css::lang::XMultiServiceFactory
,css::util::XModifyListener
,css::util::XModeChangeListener
,css::frame::XLayoutManagerListener
@@ -110,16 +106,11 @@ class ChartController final : public ::cppu::WeakImplHelper <
{
public:
ChartController() = delete;
- explicit ChartController(css::uno::Reference< css::uno::XComponentContext > const & xContext);
+ explicit ChartController(css::uno::Reference< css::uno::XComponentContext > xContext);
virtual ~ChartController() override;
OUString GetContextName();
- // css::lang::XServiceInfo
- virtual OUString SAL_CALL getImplementationName() override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
-
// css::frame::XController (required interface)
virtual void SAL_CALL
attachFrame( const css::uno::Reference< css::frame::XFrame > & xFrame ) override;
@@ -142,6 +133,12 @@ public:
virtual sal_Bool SAL_CALL
suspend( sal_Bool bSuspend ) override;
+ // css::frame::XController2
+ virtual css::uno::Reference<css::awt::XWindow> SAL_CALL getComponentWindow() override;
+ virtual OUString SAL_CALL getViewControllerName() override;
+ virtual css::uno::Sequence<css::beans::PropertyValue> SAL_CALL getCreationArguments() override;
+ virtual css::uno::Reference<css::ui::XSidebarProvider> SAL_CALL getSidebar() override;
+
// css::lang::XComponent (base of XController)
virtual void SAL_CALL
dispose() override;
@@ -262,16 +259,6 @@ public:
virtual void SAL_CALL
removePaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
- // css::lang XMultiServiceFactory
- virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
- createInstance( const OUString& aServiceSpecifier ) override;
- virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
- createInstanceWithArguments( const OUString& ServiceSpecifier,
- const css::uno::Sequence<
- css::uno::Any >& Arguments ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL
- getAvailableServiceNames() override;
-
// css::util::XModifyListener
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
@@ -316,13 +303,23 @@ public:
::Point aAtLogicPosition, bool bIsBalloonHelp,
OUString & rOutQuickHelpText, css::awt::Rectangle & rOutEqualRect );
- css::uno::Reference< css::accessibility::XAccessible > CreateAccessible();
+ rtl::Reference<AccessibleChartView> CreateAccessible();
+
+ /** Creates a helper accessibility class that must be initialized via initialize(). For
+ parameters see
+
+ The returned object should not be used directly. Instead a proxy object
+ should use this helper to retrieve its children and add them to its own
+ children.
+ */
+ rtl::Reference< ::chart::AccessibleTextHelper > createAccessibleTextContext();
static bool isObjectDeleteable( const css::uno::Any& rSelection );
void setDrawMode( ChartDrawMode eMode ) { m_eDrawMode = eMode; }
bool isShapeContext() const;
+ bool IsTextEdit() const;
ViewElementListProvider getViewElementListProvider();
DrawModelWrapper* GetDrawModelWrapper();
@@ -335,16 +332,18 @@ public:
void NotifyUndoActionHdl( std::unique_ptr<SdrUndoAction> );
- css::uno::Reference<css::uno::XInterface> const & getChartView() const;
+ rtl::Reference<::chart::ChartView> const & getChartView() const { return m_xChartView; }
rtl::Reference<::chart::ChartModel> getChartModel();
rtl::Reference<::chart::Diagram> getFirstDiagram();
+ const Selection& getSelectionMember() const { return m_aSelection; }
+
private:
class TheModel : public salhelper::SimpleReferenceObject
{
public:
- explicit TheModel( const rtl::Reference<::chart::ChartModel> & xModel );
+ explicit TheModel( rtl::Reference<::chart::ChartModel> xModel );
virtual ~TheModel() override;
@@ -389,7 +388,7 @@ private:
//view
css::uno::Reference<css::awt::XWindow> m_xViewWindow;
- css::uno::Reference<css::uno::XInterface> m_xChartView;
+ rtl::Reference<::chart::ChartView> m_xChartView;
std::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper;
std::unique_ptr<DrawViewWrapper> m_pDrawViewWrapper;
@@ -420,7 +419,7 @@ private:
rtl::Reference<svx::sidebar::SelectionChangeHandler> mpSelectionChangeHandler;
bool impl_isDisposedOrSuspended() const;
- std::unique_ptr<ReferenceSizeProvider> impl_createReferenceSizeProvider();
+ ReferenceSizeProvider impl_createReferenceSizeProvider();
void impl_adaptDataSeriesAutoResize();
void impl_createDrawViewController();
@@ -430,7 +429,7 @@ private:
void executeDispatch_ObjectProperties();
void executeDispatch_FormatObject( std::u16string_view rDispatchCommand );
void executeDlg_ObjectProperties( const OUString& rObjectCID );
- bool executeDlg_ObjectProperties_withoutUndoGuard( const OUString& rObjectCID, bool bSuccessOnUnchanged );
+ void executeDlg_ObjectProperties_withUndoGuard( std::shared_ptr<UndoGuard> aUndoGuard, const OUString& rObjectCID, bool bSuccessOnUnchanged );
void executeDispatch_ChartType();
@@ -441,6 +440,10 @@ private:
void executeDispatch_InsertAxes();
void executeDispatch_InsertGrid();
+ void executeDispatch_InsertDataTable();
+ void executeDispatch_DeleteDataTable();
+ void executeDispatch_OpenInsertDataTableDialog();
+
void executeDispatch_InsertMenu_DataLabels();
void executeDispatch_InsertMenu_Trendlines();
void executeDispatch_InsertMenu_MeanValues();
@@ -480,6 +483,8 @@ private:
void executeDispatch_MoveSeries( bool bForward );
bool EndTextEdit();
+ css::uno::Sequence< css::uno::Reference<css::chart2::XFormattedString >> GetFormattedTitle(
+ const EditTextObject& aEdit, const css::uno::Reference< css::drawing::XShape >& xShape );
void executeDispatch_View3D();
void executeDispatch_PositionAndSize( const ::css::uno::Sequence< ::css::beans::PropertyValue >* pArgs = nullptr );
@@ -489,6 +494,40 @@ private:
void executeDispatch_NewArrangement();
void executeDispatch_ScaleText();
+ static void executeDispatch_FontBold(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+ static void executeDispatch_FontName(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs);
+ static void executeDispatch_FontHeight(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs);
+ static void executeDispatch_FontItalic(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+ static void executeDispatch_FontUnderline(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs);
+ static void executeDispatch_FontStrikeout(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+ static void executeDispatch_FontShadowed(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+ static void executeDispatch_FontColor(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs);
+ static void executeDispatch_FontGrow(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+ static void executeDispatch_FontShrink(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+ static void executeDispatch_FontReset(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+ static void executeDispatch_FontSpacing(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs);
+ static void executeDispatch_FontSuperScript(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+ static void executeDispatch_FontSubScript(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties);
+
void executeDispatch_Paste();
void executeDispatch_Copy();
void executeDispatch_Cut();
@@ -499,18 +538,18 @@ private:
void executeDispatch_LOKSetTextSelection(int nType, int nX, int nY);
void executeDispatch_LOKPieSegmentDragging(int nOffset);
- void executeDispatch_FillColor(sal_uInt32 nColor);
- void executeDispatch_FillGradient(OUString sJSONGradient);
- void executeDispatch_LineColor(sal_uInt32 nColor);
- void executeDispatch_LineWidth(sal_uInt32 nWidth);
+ void executeDispatch_FillColor(const css::uno::Any& rColor);
+ void executeDispatch_FillGradient(std::u16string_view sJSONGradient);
+ void executeDispatch_LineColor(const css::uno::Any& rColor);
+ void executeDispatch_LineWidth(const css::uno::Any& rWidth);
- void sendPopupRequest(OUString const & rCID, tools::Rectangle aRectangle);
+ void sendPopupRequest(std::u16string_view rCID, tools::Rectangle aRectangle);
void impl_ShapeControllerDispatch( const css::util::URL& rURL,
const css::uno::Sequence< css::beans::PropertyValue >& rArgs );
DECL_LINK( DoubleClickWaitingHdl, Timer*, void );
- void execute_DoubleClick( const Point* pMousePixel );
+ void execute_DoubleClick( const Point* pMousePixel, bool &bEditText );
void startDoubleClickWaiting();
void stopDoubleClickWaiting();
@@ -518,7 +557,7 @@ private:
void impl_notifySelectionChangeListeners();
void impl_invalidateAccessible();
void impl_initializeAccessible();
- void impl_initializeAccessible( const css::uno::Reference< css::lang::XInitialization >& xInit );
+ void impl_initializeAccessible( AccessibleChartView& xInit );
//sets the model member to null if it equals the parameter
//returns true if successful
@@ -532,19 +571,9 @@ private:
/// @return </sal_True>, if resize/move was successful
bool impl_moveOrResizeObject(
const OUString & rCID, eMoveOrResizeType eType, double fAmountLogicX, double fAmountLogicY );
- bool impl_DragDataPoint( const OUString & rCID, double fOffset );
-
- static const o3tl::sorted_vector< OUString >& impl_getAvailableCommands();
-
- /** Creates a helper accessibility class that must be initialized via XInitialization. For
- parameters see
+ bool impl_DragDataPoint( std::u16string_view rCID, double fOffset );
- The returned object should not be used directly. Instead a proxy object
- should use this helper to retrieve its children and add them to its own
- children.
- */
- css::uno::Reference< css::accessibility::XAccessibleContext >
- impl_createAccessibleTextContext();
+ static const o3tl::sorted_vector< std::u16string_view >& impl_getAvailableCommands();
void impl_PasteGraphic( css::uno::Reference< css::graphic::XGraphic > const & xGraphic,
const ::Point & aPosition );
diff --git a/chart2/source/controller/inc/ChartDocumentWrapper.hxx b/chart2/source/controller/inc/ChartDocumentWrapper.hxx
index 04f76d705b6b..5957a7e2942f 100644
--- a/chart2/source/controller/inc/ChartDocumentWrapper.hxx
+++ b/chart2/source/controller/inc/ChartDocumentWrapper.hxx
@@ -36,7 +36,9 @@ namespace chart { class ChartView; }
namespace chart::wrapper
{
-
+class DiagramWrapper;
+class LegendWrapper;
+class TitleWrapper;
class Chart2ModelContact;
class ChartDocumentWrapper_Base : public ::cppu::ImplInheritanceHelper
@@ -76,8 +78,6 @@ public:
/// @throws css::uno::RuntimeException
rtl::Reference<SvxDrawPage> impl_getDrawPage() const;
-protected:
-
// ____ chart::XChartDocument ____
virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getTitle() override;
virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getSubTitle() override;
@@ -139,6 +139,10 @@ protected:
virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties() override;
virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override;
+ // ____ XPropertySet ____
+ virtual void SAL_CALL setPropertyValue(const OUString& rPropertyName,
+ const css::uno::Any& rValue) override;
+
private: //methods
void impl_resetAddIn();
@@ -147,11 +151,11 @@ private: //member
css::uno::Reference< css::uno::XInterface > m_xDelegator;
- css::uno::Reference< css::drawing::XShape > m_xTitle;
- css::uno::Reference< css::drawing::XShape > m_xSubTitle;
- css::uno::Reference< css::drawing::XShape > m_xLegend;
+ rtl::Reference< TitleWrapper > m_xTitle;
+ rtl::Reference< TitleWrapper > m_xSubTitle;
+ rtl::Reference< LegendWrapper > m_xLegend;
css::uno::Reference< css::chart::XChartData > m_xChartData;
- css::uno::Reference< css::chart::XDiagram > m_xDiagram;
+ rtl::Reference< DiagramWrapper > m_xDiagram;
css::uno::Reference< css::beans::XPropertySet > m_xArea;
css::uno::Reference< css::util::XRefreshable > m_xAddIn;
diff --git a/chart2/source/controller/inc/ChartWindow.hxx b/chart2/source/controller/inc/ChartWindow.hxx
index 4ab65ddd959e..918805cb3a8a 100644
--- a/chart2/source/controller/inc/ChartWindow.hxx
+++ b/chart2/source/controller/inc/ChartWindow.hxx
@@ -53,15 +53,8 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
virtual void RequestHelp( const HelpEvent& rHEvt ) override;
- /// For LibreOfficeKit, we need to route these to the mouse events.
- virtual void LogicMouseButtonDown(const MouseEvent&) override;
- virtual void LogicMouseButtonUp(const MouseEvent&) override;
- virtual void LogicMouseMove(const MouseEvent&) override;
-
void ForceInvalidate();
- virtual void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE ) override;
- virtual void Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE ) override;
- virtual void Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags = InvalidateFlags::NONE ) override;
+ virtual void ImplInvalidate( const vcl::Region* rRegion, InvalidateFlags nFlags ) override;
/// Notify the LOK client about an invalidated area.
virtual void LogicInvalidate( const tools::Rectangle* pRectangle ) override;
diff --git a/chart2/source/controller/main/CommandDispatch.hxx b/chart2/source/controller/inc/CommandDispatch.hxx
index 16e0b5ab72bc..feb1c2183af5 100644
--- a/chart2/source/controller/main/CommandDispatch.hxx
+++ b/chart2/source/controller/inc/CommandDispatch.hxx
@@ -18,14 +18,12 @@
*/
#pragma once
-#include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/compbase.hxx>
-#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/compbase.hxx>
+#include <comphelper/interfacecontainer4.hxx>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
#include <map>
-#include <memory>
namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::util { class XURLTransformer; }
@@ -35,7 +33,7 @@ namespace chart
namespace impl
{
-typedef ::cppu::WeakComponentImplHelper<
+typedef ::comphelper::WeakComponentImplHelper<
css::frame::XDispatch,
css::util::XModifyListener >
CommandDispatch_Base;
@@ -43,9 +41,7 @@ typedef ::cppu::WeakComponentImplHelper<
/** This is the base class for an XDispatch.
*/
-class CommandDispatch :
- public cppu::BaseMutex,
- public impl::CommandDispatch_Base
+class CommandDispatch : public impl::CommandDispatch_Base
{
public:
explicit CommandDispatch( const css::uno::Reference< css::uno::XComponentContext > & xContext );
@@ -107,7 +103,7 @@ protected:
// ____ WeakComponentImplHelperBase ____
/// is called when this is disposed
- virtual void SAL_CALL disposing() override;
+ virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
// ____ XModifyListener ____
virtual void SAL_CALL modified(
@@ -121,7 +117,7 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
- typedef std::map< OUString, std::unique_ptr<::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener>> >
+ typedef std::map< OUString, ::comphelper::OInterfaceContainerHelper4<css::frame::XStatusListener> >
tListenerMap;
tListenerMap m_aListeners;
diff --git a/chart2/source/controller/inc/CommandDispatchContainer.hxx b/chart2/source/controller/inc/CommandDispatchContainer.hxx
index ae95313c0f20..e9f8ed072073 100644
--- a/chart2/source/controller/inc/CommandDispatchContainer.hxx
+++ b/chart2/source/controller/inc/CommandDispatchContainer.hxx
@@ -21,12 +21,13 @@
#include <unotools/weakref.hxx>
#include <o3tl/sorted_vector.hxx>
+#include "ControllerCommandDispatch.hxx"
+
#include <map>
#include <vector>
namespace com::sun::star::frame { class XController; }
namespace com::sun::star::frame { class XDispatch; }
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::frame { struct DispatchDescriptor; }
namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::util { struct URL; }
@@ -71,6 +72,7 @@ public:
// itself)
explicit CommandDispatchContainer(
const css::uno::Reference< css::uno::XComponentContext > & xContext );
+ ~CommandDispatchContainer();
void setModel(
const rtl::Reference<::chart::ChartModel> & xModel );
@@ -79,8 +81,8 @@ public:
rChartCommands
*/
void setChartDispatch(
- const css::uno::Reference< css::frame::XDispatch >& rChartDispatch,
- o3tl::sorted_vector< OUString > && rChartCommands );
+ const rtl::Reference< ControllerCommandDispatch >& rChartDispatch,
+ const o3tl::sorted_vector< std::u16string_view > & rChartCommands );
/** Returns the dispatch that is able to do the command given in rURL, if
implemented here. If the URL is not implemented here, it should be
@@ -102,7 +104,7 @@ public:
const css::uno::Reference< css::frame::XController > & xChartController,
const css::util::URL & rURL );
- const css::uno::Reference< css::frame::XDispatch > & getChartDispatcher() const { return m_xChartDispatcher; }
+ const ControllerCommandDispatch* getChartDispatcher() const { return m_xChartDispatcher.get(); }
void setDrawCommandDispatch( DrawCommandDispatch* pDispatch );
DrawCommandDispatch* getDrawCommandDispatch() { return m_pDrawCommandDispatch; }
@@ -124,8 +126,8 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
unotools::WeakReference< ::chart::ChartModel > m_xModel;
- css::uno::Reference< css::frame::XDispatch > m_xChartDispatcher;
- o3tl::sorted_vector< OUString > m_aChartCommands;
+ rtl::Reference<ControllerCommandDispatch> m_xChartDispatcher;
+ o3tl::sorted_vector<std::u16string_view> m_aAdditionalChartCommands;
DrawCommandDispatch* m_pDrawCommandDispatch;
ShapeController* m_pShapeController;
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.hxx b/chart2/source/controller/inc/ControllerCommandDispatch.hxx
index 38b00c48d8f0..f4ca42525ea8 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.hxx
+++ b/chart2/source/controller/inc/ControllerCommandDispatch.hxx
@@ -64,7 +64,8 @@ public:
// late initialisation, especially for adding as listener
virtual void initialize() override;
- bool commandAvailable( const OUString & rCommand );
+ bool commandAvailable(const OUString& rCommand) const;
+ bool commandHandled(const OUString& rCommand) const;
protected:
// ____ XDispatch ____
@@ -74,7 +75,7 @@ protected:
// ____ WeakComponentImplHelperBase ____
/// is called when this is disposed
- virtual void SAL_CALL disposing() override;
+ virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
// ____ XEventListener (base of XModifyListener) ____
virtual void SAL_CALL disposing(
diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx
index 1cba4854d890..5d75b3057cfd 100644
--- a/chart2/source/controller/inc/DataPointItemConverter.hxx
+++ b/chart2/source/controller/inc/DataPointItemConverter.hxx
@@ -20,18 +20,19 @@
#include "ItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
+#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/uno/Sequence.h>
#include <tools/color.hxx>
#include <rtl/ref.hxx>
-
+#include <optional>
#include <vector>
-namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::chart2 { class XDataSeries; }
namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart { class ChartModel; }
+namespace chart { class DataSeries; }
class SdrModel;
namespace chart::wrapper {
@@ -43,12 +44,11 @@ public:
const rtl::Reference<::chart::ChartModel>& xChartModel,
const css::uno::Reference<css::uno::XComponentContext>& xContext,
const css::uno::Reference<css::beans::XPropertySet>& rPropertySet,
- const css::uno::Reference<css::chart2::XDataSeries>& xSeries,
+ const rtl::Reference<::chart::DataSeries>& xSeries,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory,
GraphicObjectType eMapTo,
- const css::awt::Size* pRefSize = nullptr,
+ const std::optional<css::awt::Size>& pRefSize = std::nullopt,
bool bDataSeries = false,
bool bUseSpecialFillColor = false,
sal_Int32 nSpecialFillColor = 0,
@@ -81,7 +81,7 @@ private:
bool m_bForbidPercentValue;
bool m_bHideLegendEntry;
sal_Int32 m_nPointIndex;
- css::uno::Reference<css::chart2::XDataSeries> m_xSeries;
+ rtl::Reference<::chart::DataSeries> m_xSeries;
};
}
diff --git a/chart2/source/controller/inc/DataTableItemConverter.hxx b/chart2/source/controller/inc/DataTableItemConverter.hxx
new file mode 100644
index 000000000000..f3809632f8a5
--- /dev/null
+++ b/chart2/source/controller/inc/DataTableItemConverter.hxx
@@ -0,0 +1,56 @@
+/* -*- 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 "ItemConverter.hxx"
+#include <rtl/ref.hxx>
+#include <vector>
+
+namespace com::sun::star::awt
+{
+struct Size;
+}
+namespace com::sun::star::beans
+{
+class XPropertySet;
+}
+namespace chart
+{
+class ChartModel;
+}
+
+class SdrModel;
+
+namespace chart::wrapper
+{
+/** Convert data table properties to and from ItemSet and UNO PropertySet */
+class DataTableItemConverter final : public ItemConverter
+{
+public:
+ DataTableItemConverter(const css::uno::Reference<css::beans::XPropertySet>& rPropertySet,
+ SfxItemPool& rItemPool, SdrModel& rDrawModel,
+ const rtl::Reference<::chart::ChartModel>& xChartDoc);
+
+ virtual ~DataTableItemConverter() override;
+
+ virtual void FillItemSet(SfxItemSet& rOutItemSet) const override;
+ virtual bool ApplyItemSet(const SfxItemSet& rItemSet) override;
+
+protected:
+ virtual const WhichRangesContainer& GetWhichPairs() const override;
+ virtual bool GetItemProperty(tWhichIdType nWhichId,
+ tPropertyNameWithMemberId& rOutProperty) const override;
+
+private:
+ std::vector<std::unique_ptr<ItemConverter>> m_aConverters;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/inc/ErrorBarItemConverter.hxx b/chart2/source/controller/inc/ErrorBarItemConverter.hxx
index 997bda7d269e..50b2fbe3f73b 100644
--- a/chart2/source/controller/inc/ErrorBarItemConverter.hxx
+++ b/chart2/source/controller/inc/ErrorBarItemConverter.hxx
@@ -20,11 +20,13 @@
#pragma once
#include "ItemConverter.hxx"
+#include <rtl/ref.hxx>
namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
class SdrModel;
+namespace chart { class ChartModel; }
namespace chart::wrapper
{
@@ -33,11 +35,10 @@ class ErrorBarItemConverter final : public ItemConverter
{
public:
ErrorBarItemConverter(
- const css::uno::Reference< css::frame::XModel > & xChartModel,
+ const rtl::Reference< ChartModel > & xChartModel,
const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
- SdrModel& rDrawModel,
- const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory );
+ SdrModel& rDrawModel );
virtual ~ErrorBarItemConverter() override;
virtual void FillItemSet( SfxItemSet & rOutItemSet ) const override;
diff --git a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx
index 234e50751ab6..afb9dd0a0c40 100644
--- a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx
+++ b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx
@@ -20,10 +20,14 @@
#include "ItemConverter.hxx"
+#include <rtl/ref.hxx>
+
namespace com::sun::star::lang { class XMultiServiceFactory; }
class SdrModel;
+namespace chart { class ChartModel; }
+
namespace chart::wrapper
{
@@ -42,7 +46,7 @@ public:
const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
+ rtl::Reference< ChartModel > xChartModel,
GraphicObjectType eObjectType );
virtual ~GraphicPropertyItemConverter() override;
@@ -56,7 +60,7 @@ protected:
private:
GraphicObjectType m_GraphicObjectType;
SdrModel & m_rDrawModel;
- css::uno::Reference< css::lang::XMultiServiceFactory > m_xNamedPropertyTableFactory;
+ rtl::Reference<ChartModel> m_xChartModel;
};
} // namespace chart::wrapper
diff --git a/chart2/source/controller/inc/ItemConverter.hxx b/chart2/source/controller/inc/ItemConverter.hxx
index 865268a3abf9..031a633c22d8 100644
--- a/chart2/source/controller/inc/ItemConverter.hxx
+++ b/chart2/source/controller/inc/ItemConverter.hxx
@@ -73,7 +73,7 @@ public:
reading/writing converted items
*/
ItemConverter(
- const css::uno::Reference< css::beans::XPropertySet > & rPropertySet ,
+ css::uno::Reference< css::beans::XPropertySet > xPropertySet ,
SfxItemPool& rItemPool );
virtual ~ItemConverter() override;
diff --git a/chart2/source/controller/inc/LegendItemConverter.hxx b/chart2/source/controller/inc/LegendItemConverter.hxx
index 3e9315acc20d..4d3d8fd87e59 100644
--- a/chart2/source/controller/inc/LegendItemConverter.hxx
+++ b/chart2/source/controller/inc/LegendItemConverter.hxx
@@ -19,13 +19,15 @@
#pragma once
#include "ItemConverter.hxx"
-
+#include <com/sun/star/awt/Size.hpp>
+#include <rtl/ref.hxx>
+#include <optional>
#include <vector>
-namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
class SdrModel;
+namespace chart { class ChartModel; }
namespace chart::wrapper
{
@@ -37,8 +39,8 @@ public:
const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
- const css::awt::Size* pRefSize );
+ const rtl::Reference< ChartModel > & xChartModel,
+ const std::optional<css::awt::Size>& pRefSize );
virtual ~LegendItemConverter() override;
diff --git a/chart2/source/controller/inc/MultipleChartConverters.hxx b/chart2/source/controller/inc/MultipleChartConverters.hxx
index 4fe1bb1de066..ce24aba49309 100644
--- a/chart2/source/controller/inc/MultipleChartConverters.hxx
+++ b/chart2/source/controller/inc/MultipleChartConverters.hxx
@@ -19,10 +19,10 @@
#pragma once
#include "MultipleItemConverter.hxx"
+#include <com/sun/star/awt/Size.hpp>
#include <rtl/ref.hxx>
+#include <optional>
-namespace com::sun::star::awt { struct Size; }
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace chart { class ChartModel; }
class SdrModel;
@@ -36,7 +36,7 @@ public:
const rtl::Reference<::chart::ChartModel> & xChartModel,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const css::awt::Size* pRefSize );
+ const std::optional<css::awt::Size>& pRefSize );
virtual ~AllAxisItemConverter() override;
@@ -50,8 +50,7 @@ public:
AllGridItemConverter(
const rtl::Reference<::chart::ChartModel>& xChartModel,
SfxItemPool& rItemPool,
- SdrModel& rDrawModel,
- const css::uno::Reference<css::lang::XMultiServiceFactory> & xNamedPropertyContainerFactory );
+ SdrModel& rDrawModel );
virtual ~AllGridItemConverter() override;
protected:
@@ -64,8 +63,7 @@ public:
AllDataLabelItemConverter(
const rtl::Reference<::chart::ChartModel>& xChartModel,
SfxItemPool& rItemPool,
- SdrModel& rDrawModel,
- const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory );
+ SdrModel& rDrawModel );
virtual ~AllDataLabelItemConverter() override;
@@ -78,8 +76,7 @@ class AllTitleItemConverter final : public MultipleItemConverter
public:
AllTitleItemConverter(
const rtl::Reference<::chart::ChartModel>& xChartModel,
- SfxItemPool& rItemPool, SdrModel& rDrawModel,
- const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory );
+ SfxItemPool& rItemPool, SdrModel& rDrawModel );
virtual ~AllTitleItemConverter() override;
diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx b/chart2/source/controller/inc/ObjectHierarchy.hxx
index d8f7747e8bc6..e034d218fb27 100644
--- a/chart2/source/controller/inc/ObjectHierarchy.hxx
+++ b/chart2/source/controller/inc/ObjectHierarchy.hxx
@@ -18,17 +18,17 @@
*/
#pragma once
+#include <ChartModel.hxx>
#include <ObjectIdentifier.hxx>
#include <map>
#include <vector>
namespace com::sun::star::awt { struct KeyEvent; }
-namespace com::sun::star::chart2 { class XChartDocument; }
namespace chart
{
-class ExplicitValueProvider;
+class ChartView;
class ObjectHierarchy
{
@@ -42,7 +42,7 @@ public:
*/
explicit ObjectHierarchy(
const rtl::Reference<::chart::ChartModel> & xChartDocument,
- ExplicitValueProvider * pExplicitValueProvider,
+ ChartView * pExplicitValueProvider,
bool bFlattenDiagram = false,
bool bOrderingForElementSelector = false );
~ObjectHierarchy();
@@ -51,11 +51,10 @@ public:
static bool isRootNode( const ObjectIdentifier& rOID );
/// equal to getChildren( getRootNodeOID())
- const tChildContainer & getTopLevelChildren() const;
- bool hasChildren( const ObjectIdentifier& rParent ) const;
- const tChildContainer & getChildren( const ObjectIdentifier& rParent ) const;
-
- const tChildContainer & getSiblings( const ObjectIdentifier& rNode ) const;
+ const tChildContainer& getTopLevelChildren() const;
+ bool hasChildren(const ObjectIdentifier& rParent) const;
+ const tChildContainer& getChildren(const ObjectIdentifier& rParent) const;
+ const tChildContainer& getSiblings(const ObjectIdentifier& rNode) const;
/// The result is empty, if the node cannot be found in the tree
ObjectIdentifier getParent( const ObjectIdentifier& rNode ) const;
@@ -65,32 +64,31 @@ public:
private:
void createTree( const rtl::Reference<::chart::ChartModel> & xChartDocument );
void createAxesTree(
- ObjectHierarchy::tChildContainer & rContainer,
+ tChildContainer & rContainer,
const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
void createDiagramTree(
- ObjectHierarchy::tChildContainer& rContainer,
+ tChildContainer& rContainer,
const rtl::Reference<::chart::ChartModel>& xChartDoc,
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ const rtl::Reference< ::chart::Diagram >& xDiagram );
void createDataSeriesTree(
- ObjectHierarchy::tChildContainer & rOutDiagramSubContainer,
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+ tChildContainer & rOutDiagramSubContainer,
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
static void createWallAndFloor(
- ObjectHierarchy::tChildContainer & rContainer,
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+ tChildContainer & rContainer,
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
void createLegendTree(
- ObjectHierarchy::tChildContainer & rContainer,
+ tChildContainer & rContainer,
const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
- void createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer );
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
+ void createAdditionalShapesTree(tChildContainer& rContainer);
ObjectIdentifier getParentImpl(
const ObjectIdentifier& rParentOID,
const ObjectIdentifier& rOID ) const;
- typedef std::map< ObjectIdentifier, ObjectHierarchy::tChildContainer >
- tChildMap;
+ typedef std::map<ObjectIdentifier, tChildContainer> tChildMap;
tChildMap m_aChildMap;
- ExplicitValueProvider* m_pExplicitValueProvider;
+ ChartView* m_pExplicitValueProvider;
bool m_bFlattenDiagram;
bool m_bOrderingForElementSelector;
};
@@ -98,9 +96,9 @@ private:
class ObjectKeyNavigation
{
public:
- explicit ObjectKeyNavigation( const ObjectIdentifier & rCurrentOID,
- const rtl::Reference<::chart::ChartModel> & xChartDocument,
- ExplicitValueProvider * pExplicitValueProvider );
+ explicit ObjectKeyNavigation( ObjectIdentifier aCurrentOID,
+ rtl::Reference<::chart::ChartModel> xChartDocument,
+ ChartView * pExplicitValueProvider );
bool handleKeyEvent( const css::awt::KeyEvent & rEvent );
const ObjectIdentifier& getCurrentSelection() const { return m_aCurrentOID;}
@@ -118,7 +116,7 @@ private:
ObjectIdentifier m_aCurrentOID;
rtl::Reference<::chart::ChartModel> m_xChartDocument;
- ExplicitValueProvider * m_pExplicitValueProvider;
+ ChartView * m_pExplicitValueProvider;
};
} // namespace chart
diff --git a/chart2/source/controller/inc/ObjectNameProvider.hxx b/chart2/source/controller/inc/ObjectNameProvider.hxx
index 276e58977d35..7035ba916081 100644
--- a/chart2/source/controller/inc/ObjectNameProvider.hxx
+++ b/chart2/source/controller/inc/ObjectNameProvider.hxx
@@ -22,9 +22,6 @@
#include <ObjectIdentifier.hxx>
#include <TitleHelper.hxx>
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::frame { class XModel; }
-
namespace chart
{
@@ -35,33 +32,33 @@ class ObjectNameProvider
{
public:
static OUString getName( ObjectType eObjectType, bool bPlural=false );
- static OUString getAxisName( const OUString& rObjectCID
+ static OUString getAxisName( std::u16string_view rObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel );
- static OUString getGridName( const OUString& rObjectCID
+ static OUString getGridName( std::u16string_view rObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel );
- static OUString getTitleName( const OUString& rObjectCID
+ static OUString getTitleName( std::u16string_view rObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel );
static OUString getTitleNameByType( TitleHelper::eTitleType eType );
static OUString getNameForCID(
- const OUString& rObjectCID,
+ std::u16string_view rObjectCID,
const rtl::Reference<::chart::ChartModel>& xChartDocument );
static OUString getName_ObjectForSeries(
ObjectType eObjectType,
- const OUString& rSeriesCID,
+ std::u16string_view rSeriesCID,
const rtl::Reference<::chart::ChartModel>& xChartDocument );
static OUString getName_ObjectForAllSeries( ObjectType eObjectType );
/** Provides help texts for the various chart elements.
The parameter rObjectCID has to be a ClassifiedIdentifier - see class ObjectIdentifier.
*/
- static OUString getHelpText( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose=false );
+ static OUString getHelpText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose=false );
/** This is used for showing the currently selected object in the status bar
(command "Context")
*/
- static OUString getSelectedObjectText( const OUString & rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument );
+ static OUString getSelectedObjectText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument );
};
} //namespace chart
diff --git a/chart2/source/controller/inc/PositionAndSizeHelper.hxx b/chart2/source/controller/inc/PositionAndSizeHelper.hxx
index f70ccf302f6d..a8e25e33963e 100644
--- a/chart2/source/controller/inc/PositionAndSizeHelper.hxx
+++ b/chart2/source/controller/inc/PositionAndSizeHelper.hxx
@@ -21,7 +21,6 @@
#include <ObjectIdentifier.hxx>
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::awt { struct Rectangle; }
namespace chart
@@ -36,7 +35,7 @@ public:
, const css::awt::Rectangle& rOldPositionAndSize
, const css::awt::Rectangle& rPageRectangle );
- static bool moveObject( const OUString& rObjectCID
+ static bool moveObject( std::u16string_view rObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel
, const css::awt::Rectangle& rNewPositionAndSize
, const css::awt::Rectangle& rOldPositionAndSize
diff --git a/chart2/source/controller/inc/RegressionCurveItemConverter.hxx b/chart2/source/controller/inc/RegressionCurveItemConverter.hxx
index 63c296a3e3b1..3849a2179387 100644
--- a/chart2/source/controller/inc/RegressionCurveItemConverter.hxx
+++ b/chart2/source/controller/inc/RegressionCurveItemConverter.hxx
@@ -19,10 +19,10 @@
#pragma once
#include "ItemConverter.hxx"
+#include <rtl/ref.hxx>
-namespace com::sun::star::chart2 { class XRegressionCurveContainer; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
-
+namespace chart { class DataSeries; }
class SdrModel;
namespace chart::wrapper
@@ -33,10 +33,10 @@ class RegressionCurveItemConverter final : public ItemConverter
public:
RegressionCurveItemConverter(
const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
- const css::uno::Reference< css::chart2::XRegressionCurveContainer > & xRegCurveCnt,
+ rtl::Reference< ::chart::DataSeries > xRegCurveCnt,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory );
+ const rtl::Reference< ChartModel > & xChartModel );
virtual ~RegressionCurveItemConverter() override;
virtual void FillItemSet( SfxItemSet & rOutItemSet ) const override;
@@ -51,7 +51,7 @@ protected:
private:
std::shared_ptr< ItemConverter > m_spGraphicConverter;
- css::uno::Reference< css::chart2::XRegressionCurveContainer > m_xCurveContainer;
+ rtl::Reference< ::chart::DataSeries > m_xCurveContainer;
};
} // namespace chart::wrapper
diff --git a/chart2/source/controller/inc/RegressionEquationItemConverter.hxx b/chart2/source/controller/inc/RegressionEquationItemConverter.hxx
index 0b32e4b9ed7c..e0b0bac2bae9 100644
--- a/chart2/source/controller/inc/RegressionEquationItemConverter.hxx
+++ b/chart2/source/controller/inc/RegressionEquationItemConverter.hxx
@@ -19,14 +19,16 @@
#pragma once
#include "ItemConverter.hxx"
-
+#include <com/sun/star/awt/Size.hpp>
+#include <rtl/ref.hxx>
+#include <optional>
#include <vector>
-namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
class SdrModel;
+namespace chart { class ChartModel; }
namespace chart::wrapper {
@@ -37,8 +39,8 @@ public:
const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
- const css::awt::Size* pRefSize );
+ const rtl::Reference< ChartModel > & xChartModel,
+ const std::optional<css::awt::Size>& pRefSize );
virtual ~RegressionEquationItemConverter() override;
diff --git a/chart2/source/controller/inc/SelectionHelper.hxx b/chart2/source/controller/inc/SelectionHelper.hxx
index ae241d61ab42..f468f974d6db 100644
--- a/chart2/source/controller/inc/SelectionHelper.hxx
+++ b/chart2/source/controller/inc/SelectionHelper.hxx
@@ -39,6 +39,7 @@ public: //methods
bool isResizeableObjectSelected() const;
bool isRotateableObjectSelected( const rtl::Reference<::chart::ChartModel>& xChartModel ) const;
+ bool isTitleObjectSelected() const;
bool isDragableObjectSelected() const;
bool isAdditionalShapeSelected() const;
@@ -92,11 +93,11 @@ public:
DrawViewWrapper const & rDrawViewWrapper,
bool bGetDiagramInsteadOf_Wall=false );
- static bool isRotateableObject( const OUString& rCID
+ static bool isRotateableObject( std::u16string_view rCID
, const rtl::Reference<::chart::ChartModel>& xChartModel );
explicit SelectionHelper( SdrObject* pSelectedObj );
- virtual ~SelectionHelper();
+ ~SelectionHelper();
//MarkHandleProvider:
virtual bool getMarkHandles( SdrHdlList& rHdlList ) override;
diff --git a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
index c658b08fa7dc..febccf806ccb 100644
--- a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
+++ b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
@@ -22,10 +22,10 @@
#include <com/sun/star/uno/Sequence.h>
#include <rtl/ref.hxx>
-namespace com::sun::star::chart2 { class XCoordinateSystem; }
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart { class ChartModel; }
+namespace chart { class BaseCoordinateSystem; }
+namespace chart { class DataSeries; }
namespace chart::wrapper
{
@@ -35,8 +35,8 @@ class SeriesOptionsItemConverter final : public ItemConverter
public:
SeriesOptionsItemConverter(
const rtl::Reference<::chart::ChartModel> & xChartModel,
- const css::uno::Reference< css::uno::XComponentContext > & xContext,
- const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
+ css::uno::Reference< css::uno::XComponentContext > xContext,
+ const rtl::Reference<::chart::DataSeries> & rPropertySet,
SfxItemPool& rItemPool );
virtual ~SeriesOptionsItemConverter() override;
@@ -66,7 +66,7 @@ private:
sal_Int32 m_nStartingAngle;
bool m_bClockwise;
- css::uno::Reference< css::chart2::XCoordinateSystem > m_xCooSys;
+ rtl::Reference< ::chart::BaseCoordinateSystem > m_xCooSys;
css::uno::Sequence< sal_Int32 > m_aSupportedMissingValueTreatments;
sal_Int32 m_nMissingValueTreatment;
diff --git a/chart2/source/controller/inc/ShapeController.h b/chart2/source/controller/inc/ShapeController.h
deleted file mode 100644
index 392c28d2fe4c..000000000000
--- a/chart2/source/controller/inc/ShapeController.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- 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 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 .
- */
-#ifndef CHART_SHAPECONTROLLER_H
-#define CHART_SHAPECONTROLLER_H
-
-//Command Ids:
-#define COMMAND_ID_FORMAT_LINE 1
-#define COMMAND_ID_FORMAT_AREA 2
-#define COMMAND_ID_TEXT_ATTRIBUTES 3
-#define COMMAND_ID_TRANSFORM_DIALOG 4
-#define COMMAND_ID_OBJECT_TITLE_DESCRIPTION 5
-#define COMMAND_ID_RENAME_OBJECT 6
-#define COMMAND_ID_BRING_TO_FRONT 8
-#define COMMAND_ID_FORWARD 9
-#define COMMAND_ID_BACKWARD 10
-#define COMMAND_ID_SEND_TO_BACK 11
-#define COMMAND_ID_FONT_DIALOG 15
-#define COMMAND_ID_PARAGRAPH_DIALOG 16
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/inc/StatisticsItemConverter.hxx b/chart2/source/controller/inc/StatisticsItemConverter.hxx
index b82c1c230ae8..7868a9014f7c 100644
--- a/chart2/source/controller/inc/StatisticsItemConverter.hxx
+++ b/chart2/source/controller/inc/StatisticsItemConverter.hxx
@@ -21,7 +21,6 @@
#include "ItemConverter.hxx"
#include <rtl/ref.hxx>
-namespace com::sun::star::frame { class XModel; }
namespace chart { class ChartModel; }
namespace chart::wrapper
@@ -31,7 +30,7 @@ class StatisticsItemConverter final : public ItemConverter
{
public:
StatisticsItemConverter(
- const rtl::Reference<::chart::ChartModel> & xChartModel,
+ rtl::Reference<::chart::ChartModel> xChartModel,
const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool );
virtual ~StatisticsItemConverter() override;
diff --git a/chart2/source/controller/inc/TabPageNotifiable.hxx b/chart2/source/controller/inc/TabPageNotifiable.hxx
index 440cda2de9aa..16450f28f781 100644
--- a/chart2/source/controller/inc/TabPageNotifiable.hxx
+++ b/chart2/source/controller/inc/TabPageNotifiable.hxx
@@ -18,16 +18,13 @@
*/
#pragma once
-// color to use as foreground for an invalid range
-#define RANGE_SELECTION_INVALID_RANGE_FOREGROUND_COLOR COL_WHITE
-// color to use as background for an invalid range
-#define RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR Color(0xff6563)
+#include <sal/types.h>
class BuilderPage;
namespace chart
{
-class TabPageNotifiable
+class SAL_LOPLUGIN_ANNOTATE("crosscast") TabPageNotifiable
{
public:
virtual void setInvalidPage(BuilderPage* pTabPage) = 0;
diff --git a/chart2/source/controller/inc/TextLabelItemConverter.hxx b/chart2/source/controller/inc/TextLabelItemConverter.hxx
index d44138332798..cb5406cf6a01 100644
--- a/chart2/source/controller/inc/TextLabelItemConverter.hxx
+++ b/chart2/source/controller/inc/TextLabelItemConverter.hxx
@@ -20,14 +20,16 @@
#include "ItemConverter.hxx"
+#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/uno/Sequence.h>
#include <rtl/ref.hxx>
+#include <optional>
#include <vector>
-namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::chart2 { class XDataSeries; }
namespace com::sun::star::frame { class XModel; }
namespace chart { class ChartModel; }
+namespace chart { class DataSeries; }
namespace chart::wrapper {
@@ -37,9 +39,9 @@ public:
TextLabelItemConverter(
const rtl::Reference<::chart::ChartModel>& xChartModel,
const css::uno::Reference<css::beans::XPropertySet>& rPropertySet,
- const css::uno::Reference<css::chart2::XDataSeries>& xSeries,
+ const rtl::Reference<::chart::DataSeries>& xSeries,
SfxItemPool& rItemPool,
- const css::awt::Size* pRefSize,
+ const std::optional<css::awt::Size>& pRefSize,
bool bDataSeries,
sal_Int32 nNumberFormat,
sal_Int32 nPercentNumberFormat );
@@ -65,7 +67,7 @@ private:
bool mbDataSeries:1;
bool mbForbidPercentValue:1;
- css::uno::Reference<css::chart2::XDataSeries> m_xSeries;
+ rtl::Reference<::chart::DataSeries> m_xSeries;
};
}
diff --git a/chart2/source/controller/inc/TitleDialogData.hxx b/chart2/source/controller/inc/TitleDialogData.hxx
index 5f398f34a1f0..862eb8ad6193 100644
--- a/chart2/source/controller/inc/TitleDialogData.hxx
+++ b/chart2/source/controller/inc/TitleDialogData.hxx
@@ -19,11 +19,9 @@
#pragma once
#include <ReferenceSizeProvider.hxx>
-#include <memory>
#include <com/sun/star/uno/Sequence.hxx>
#include <rtl/ref.hxx>
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
@@ -35,9 +33,9 @@ struct TitleDialogData
css::uno::Sequence< sal_Bool > aPossibilityList;
css::uno::Sequence< sal_Bool > aExistenceList;
css::uno::Sequence< OUString > aTextList;
- std::unique_ptr< ReferenceSizeProvider > apReferenceSizeProvider;
+ std::optional< ReferenceSizeProvider > apReferenceSizeProvider;
- TitleDialogData(std::unique_ptr<ReferenceSizeProvider> pReferenzeSizeProvider = nullptr);
+ TitleDialogData(std::optional<ReferenceSizeProvider> pReferenzeSizeProvider = std::nullopt);
void readFromModel( const rtl::Reference<::chart::ChartModel>& xChartModel );
/* return true if anything has changed;
@@ -45,7 +43,7 @@ struct TitleDialogData
*/
bool writeDifferenceToModel( const rtl::Reference<::chart::ChartModel>& xChartModel
, const css::uno::Reference< css::uno::XComponentContext >& xContext
- , TitleDialogData* pOldState=nullptr );
+ , const TitleDialogData* pOldState=nullptr );
};
} //namespace chart
diff --git a/chart2/source/controller/inc/TitleItemConverter.hxx b/chart2/source/controller/inc/TitleItemConverter.hxx
index 5a2686d62814..917db7ef9cb6 100644
--- a/chart2/source/controller/inc/TitleItemConverter.hxx
+++ b/chart2/source/controller/inc/TitleItemConverter.hxx
@@ -20,12 +20,15 @@
#include "ItemConverter.hxx"
+#include <com/sun/star/awt/Size.hpp>
+#include <rtl/ref.hxx>
+#include <optional>
#include <vector>
-namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
class SdrModel;
+namespace chart { class ChartModel; }
namespace chart::wrapper {
@@ -35,8 +38,8 @@ public:
TitleItemConverter(
const css::uno::Reference<css::beans::XPropertySet>& rPropertySet,
SfxItemPool& rItemPool, SdrModel& rDrawModel,
- const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory,
- const css::awt::Size* pRefSize );
+ const rtl::Reference<ChartModel>& xChartModel,
+ const std::optional<css::awt::Size>& pRefSize );
virtual ~TitleItemConverter() override;
diff --git a/chart2/source/controller/inc/dlg_ChartType.hxx b/chart2/source/controller/inc/dlg_ChartType.hxx
index 7520869e86c4..427369e9a88e 100644
--- a/chart2/source/controller/inc/dlg_ChartType.hxx
+++ b/chart2/source/controller/inc/dlg_ChartType.hxx
@@ -21,11 +21,6 @@
#include <vcl/weld.hxx>
#include <rtl/ref.hxx>
-namespace com::sun::star::frame
-{
-class XModel;
-}
-
namespace chart
{
class ChartModel;
@@ -34,7 +29,7 @@ class ChartTypeTabPage;
class ChartTypeDialog final : public weld::GenericDialogController
{
public:
- ChartTypeDialog(weld::Window* pWindow, const rtl::Reference<::chart::ChartModel>& xChartModel);
+ ChartTypeDialog(weld::Window* pWindow, rtl::Reference<::chart::ChartModel> xChartModel);
virtual ~ChartTypeDialog() override;
private:
diff --git a/chart2/source/controller/inc/dlg_ChartType_UNO.hxx b/chart2/source/controller/inc/dlg_ChartType_UNO.hxx
index 4566ec75142d..ca79b25367de 100644
--- a/chart2/source/controller/inc/dlg_ChartType_UNO.hxx
+++ b/chart2/source/controller/inc/dlg_ChartType_UNO.hxx
@@ -22,7 +22,6 @@
#include <comphelper/proparrhlp.hxx>
#include <svtools/genericunodialog.hxx>
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::beans { class XPropertySetInfo; }
namespace chart
diff --git a/chart2/source/controller/inc/dlg_CreationWizard.hxx b/chart2/source/controller/inc/dlg_CreationWizard.hxx
index a0fcc9dae6f9..152545d0bfce 100644
--- a/chart2/source/controller/inc/dlg_CreationWizard.hxx
+++ b/chart2/source/controller/inc/dlg_CreationWizard.hxx
@@ -19,25 +19,20 @@
#pragma once
-#include "TimerTriggeredControllerLock.hxx"
+#include <TimerTriggeredControllerLock.hxx>
#include "TabPageNotifiable.hxx"
#include <rtl/ref.hxx>
-#include <vcl/roadmapwizard.hxx>
+#include <vcl/roadmapwizardmachine.hxx>
#include <memory>
-namespace com::sun::star::chart2
-{
-class XChartDocument;
-}
namespace com::sun::star::uno
{
class XComponentContext;
}
using vcl::WizardTypes::WizardState;
-using vcl::WizardTypes::CommitPageReason;
namespace chart
{
@@ -49,7 +44,7 @@ class CreationWizard final : public vcl::RoadmapWizardMachine, public TabPageNot
{
public:
CreationWizard(weld::Window* pParent, const rtl::Reference<::chart::ChartModel>& xChartModel,
- const css::uno::Reference<css::uno::XComponentContext>& xContext);
+ css::uno::Reference<css::uno::XComponentContext> xContext);
CreationWizard() = delete;
virtual ~CreationWizard() override;
diff --git a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
index 7e1792f087f1..68dbe78432da 100644
--- a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
+++ b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
@@ -33,11 +33,8 @@
#include <tools/link.hxx>
namespace com::sun::star::awt { class XWindow; }
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::uno { class XComponentContext; }
-class VclWindowEvent;
-
namespace chart
{
class ChartModel;
@@ -53,7 +50,7 @@ class CreationWizardUnoDlg final : public cppu::BaseMutex
public:
CreationWizardUnoDlg() = delete;
- CreationWizardUnoDlg( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ CreationWizardUnoDlg( css::uno::Reference< css::uno::XComponentContext > xContext );
virtual ~CreationWizardUnoDlg() override;
// XInterface
diff --git a/chart2/source/controller/inc/dlg_DataEditor.hxx b/chart2/source/controller/inc/dlg_DataEditor.hxx
index 5156e0831b45..f7e335ac36fa 100644
--- a/chart2/source/controller/inc/dlg_DataEditor.hxx
+++ b/chart2/source/controller/inc/dlg_DataEditor.hxx
@@ -23,13 +23,6 @@
#include <rtl/ref.hxx>
namespace com::sun::star::uno { class XComponentContext; }
-namespace comphelper { template <class Tp, class Arg> class mem_fun1_t; }
-
-namespace com::sun::star {
- namespace chart2 {
- class XChartDocument;
- }
-}
namespace chart
{
@@ -40,7 +33,7 @@ class DataEditor final : public weld::GenericDialogController
{
public:
DataEditor(weld::Window* pParent,
- const rtl::Reference<::chart::ChartModel> & xChartDoc,
+ rtl::Reference<::chart::ChartModel> xChartDoc,
const css::uno::Reference<css::uno::XComponentContext> & xContext);
virtual ~DataEditor() override;
@@ -63,7 +56,7 @@ private:
VclPtr<DataBrowser> m_xBrwData;
/// handles actions of the toolbox
- DECL_LINK( ToolboxHdl, const OString&, void );
+ DECL_LINK( ToolboxHdl, const OUString&, void );
/// is called, if the cursor of the table has moved
DECL_LINK( BrowserCursorMovedHdl, DataBrowser*, void);
};
diff --git a/chart2/source/controller/inc/dlg_DataSource.hxx b/chart2/source/controller/inc/dlg_DataSource.hxx
index 97eb659c7052..9da88e8de0ba 100644
--- a/chart2/source/controller/inc/dlg_DataSource.hxx
+++ b/chart2/source/controller/inc/dlg_DataSource.hxx
@@ -22,8 +22,6 @@
#include <vcl/weld.hxx>
#include <memory>
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::uno { class XComponentContext; }
class BuilderPage;
namespace chart
@@ -41,20 +39,18 @@ class DataSourceDialog final :
public:
explicit DataSourceDialog(
weld::Window * pParent,
- const rtl::Reference<::chart::ChartModel> & xChartDocument,
- const css::uno::Reference< css::uno::XComponentContext > & xContext );
+ const rtl::Reference<::chart::ChartModel> & xChartDocument );
virtual ~DataSourceDialog() override;
- // from GenericDialogController base
- virtual short run() override;
-
// TabPageNotifiable
virtual void setInvalidPage( BuilderPage * pTabPage ) override;
virtual void setValidPage( BuilderPage * pTabPage ) override;
private:
- DECL_LINK(ActivatePageHdl, const OString&, void);
- DECL_LINK(DeactivatePageHdl, const OString&, bool);
+ DECL_LINK(ActivatePageHdl, const OUString&, void);
+ DECL_LINK(DeactivatePageHdl, const OUString&, bool);
+ DECL_LINK(OkHdl, weld::Button&, void);
+ void commitPages();
std::unique_ptr< ChartTypeTemplateProvider > m_apDocTemplateProvider;
std::unique_ptr< DialogModel > m_apDialogModel;
diff --git a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
index b69ab70f64f3..2b265c7d6541 100644
--- a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
+++ b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
@@ -38,7 +38,6 @@ struct InsertAxisOrGridDialogData
\************************************************************************/
class SchAxisDlg : public weld::GenericDialogController
{
-protected:
std::unique_ptr<weld::CheckButton> m_xCbPrimaryX;
std::unique_ptr<weld::CheckButton> m_xCbPrimaryY;
std::unique_ptr<weld::CheckButton> m_xCbPrimaryZ;
diff --git a/chart2/source/controller/inc/dlg_InsertDataTable.hxx b/chart2/source/controller/inc/dlg_InsertDataTable.hxx
new file mode 100644
index 000000000000..cd77099864c4
--- /dev/null
+++ b/chart2/source/controller/inc/dlg_InsertDataTable.hxx
@@ -0,0 +1,52 @@
+/* -*- 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 <vcl/weld.hxx>
+#include "res_DataTableProperties.hxx"
+
+namespace chart
+{
+/** The data table properties (data) used by the dialog */
+struct DataTableDialogData
+{
+ bool mbShow = true;
+ bool mbHorizontalBorders = false;
+ bool mbVerticalBorders = false;
+ bool mbOutline = false;
+ bool mbKeys = false;
+};
+
+/** The dialog to change the data table specific properties */
+class InsertDataTableDialog final : public weld::GenericDialogController
+{
+private:
+ DataTablePropertiesResources m_aDataTablePropertiesResources;
+ std::unique_ptr<weld::CheckButton> m_xCbShowDataTable;
+
+ DataTableDialogData m_aData;
+
+ DECL_LINK(ShowDataTableToggle, weld::Toggleable&, void);
+
+ void changeEnabled();
+
+public:
+ InsertDataTableDialog(weld::Window* pParent);
+
+ /** Set the initial state of the data table properties */
+ void init(DataTableDialogData const& rData);
+
+ /** Get the state of the data table properties from the dialog */
+ DataTableDialogData& getDataTableDialogData();
+};
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx
index e68036153c10..cdadc18c3f09 100644
--- a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx
+++ b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx
@@ -24,13 +24,10 @@
#include "res_ErrorBar.hxx"
-namespace com::sun::star::frame
-{
-class XModel;
-}
-
namespace chart
{
+class ChartView;
+
class InsertErrorBarsDialog final : public weld::GenericDialogController
{
public:
@@ -40,10 +37,10 @@ public:
void SetAxisMinorStepWidthForErrorBarDecimals(double fMinorStepWidth);
- static double getAxisMinorStepWidthForErrorBarDecimals(
- const rtl::Reference<::chart::ChartModel>& xChartModel,
- const css::uno::Reference<css::uno::XInterface>& xChartView,
- const OUString& rSelectedObjectCID);
+ static double
+ getAxisMinorStepWidthForErrorBarDecimals(const rtl::Reference<::chart::ChartModel>& xChartModel,
+ const rtl::Reference<::chart::ChartView>& xChartView,
+ std::u16string_view rSelectedObjectCID);
void FillItemSet(SfxItemSet& rOutAttrs);
diff --git a/chart2/source/controller/inc/dlg_InsertLegend.hxx b/chart2/source/controller/inc/dlg_InsertLegend.hxx
index 0e2cccc3809a..265f486f4a80 100644
--- a/chart2/source/controller/inc/dlg_InsertLegend.hxx
+++ b/chart2/source/controller/inc/dlg_InsertLegend.hxx
@@ -25,7 +25,6 @@
#include "res_LegendPosition.hxx"
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
index 238ccc83b42f..f16aee1e611b 100644
--- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx
+++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
@@ -20,9 +20,11 @@
#include <ObjectIdentifier.hxx>
#include <sfx2/tabdlg.hxx>
+#include <vcl/graph.hxx>
+
+class SvNumberFormatter;
namespace com::sun::star::util { class XNumberFormatsSupplier; }
-class Graphic;
namespace chart
{
@@ -30,7 +32,7 @@ namespace chart
class ObjectPropertiesDialogParameter final
{
public:
- ObjectPropertiesDialogParameter( const OUString& rObjectCID );
+ ObjectPropertiesDialogParameter( OUString aObjectCID );
~ObjectPropertiesDialogParameter();
void init( const rtl::Reference<::chart::ChartModel>& xModel );
@@ -115,14 +117,14 @@ private:
SvNumberFormatter* m_pNumberFormatter;
std::optional<SfxItemSet> m_oSymbolShapeProperties;
- std::unique_ptr<Graphic> m_pAutoSymbolGraphic;
+ std::optional<Graphic> m_oAutoSymbolGraphic;
double m_fAxisMinorStepWidthForErrorBarDecimals;
bool m_bOKPressed;
DECL_LINK(OKPressed, weld::Button&, void);
- virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
+ virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override;
public:
SchAttribTabDlg(weld::Window* pParent, const SfxItemSet* pAttr,
@@ -133,7 +135,7 @@ public:
//pSymbolShapeProperties: Properties to be set on the symbollist shapes
//pAutoSymbolGraphic: Graphic to be shown if AutoSymbol gets selected
- void setSymbolInformation( SfxItemSet&& rSymbolShapeProperties, std::unique_ptr<Graphic> pAutoSymbolGraphic );
+ void setSymbolInformation( SfxItemSet&& rSymbolShapeProperties, std::optional<Graphic> oAutoSymbolGraphic );
void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
diff --git a/chart2/source/controller/inc/dlg_ShapeFont.hxx b/chart2/source/controller/inc/dlg_ShapeFont.hxx
index 6998ba47094b..cfeb002fb92d 100644
--- a/chart2/source/controller/inc/dlg_ShapeFont.hxx
+++ b/chart2/source/controller/inc/dlg_ShapeFont.hxx
@@ -33,7 +33,7 @@ public:
const ViewElementListProvider* pViewElementListProvider);
private:
- virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
+ virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override;
const ViewElementListProvider* m_pViewElementListProvider;
};
diff --git a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
index 9d4d7496d64d..15d0c014d848 100644
--- a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
+++ b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
@@ -30,7 +30,7 @@ public:
ShapeParagraphDialog(weld::Window* pParent, const SfxItemSet* pAttr);
private:
- virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
+ virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override;
};
} // namespace chart
diff --git a/chart2/source/controller/inc/dlg_View3D.hxx b/chart2/source/controller/inc/dlg_View3D.hxx
index c165e828535e..1fda6745fbe1 100644
--- a/chart2/source/controller/inc/dlg_View3D.hxx
+++ b/chart2/source/controller/inc/dlg_View3D.hxx
@@ -21,11 +21,6 @@
#include <vcl/weld.hxx>
#include <ControllerLockGuard.hxx>
-namespace com::sun::star::frame
-{
-class XModel;
-}
-
namespace chart
{
class ThreeD_SceneGeometry_TabPage;
@@ -41,7 +36,7 @@ public:
virtual short run() override;
private:
- DECL_LINK(ActivatePageHdl, const OString&, void);
+ DECL_LINK(ActivatePageHdl, const OUString&, void);
ControllerLockHelper m_aControllerLocker;
diff --git a/chart2/source/controller/inc/helpids.h b/chart2/source/controller/inc/helpids.h
index 69a23771c8dd..775ec1489b42 100644
--- a/chart2/source/controller/inc/helpids.h
+++ b/chart2/source/controller/inc/helpids.h
@@ -19,14 +19,14 @@
#pragma once
-#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
-inline constexpr OStringLiteral HID_SCH_WIN_DOCUMENT = "CHART2_HID_SCH_WIN_DOCUMENT";
-inline constexpr OStringLiteral HID_SCH_ERROR_BARS_FROM_DATA = "CHART2_SCH_ERROR_BARS_FROM_DATA";
+inline constexpr OUString HID_SCH_WIN_DOCUMENT = u"CHART2_HID_SCH_WIN_DOCUMENT"_ustr;
+inline constexpr OUString HID_SCH_ERROR_BARS_FROM_DATA = u"CHART2_SCH_ERROR_BARS_FROM_DATA"_ustr;
-inline constexpr OStringLiteral HID_SCH_WIZARD_ROADMAP = "CHART2_HID_SCH_WIZARD_ROADMAP";
-inline constexpr OStringLiteral HID_SCH_DATA_SERIES_LABEL = "CHART2_HID_SCH_DATA_SERIES_LABEL";
+inline constexpr OUString HID_SCH_WIZARD_ROADMAP = u"CHART2_HID_SCH_WIZARD_ROADMAP"_ustr;
+inline constexpr OUString HID_SCH_DATA_SERIES_LABEL = u"CHART2_HID_SCH_DATA_SERIES_LABEL"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/inc/res_DataTableProperties.hxx b/chart2/source/controller/inc/res_DataTableProperties.hxx
new file mode 100644
index 000000000000..4b2aaa4f2ef7
--- /dev/null
+++ b/chart2/source/controller/inc/res_DataTableProperties.hxx
@@ -0,0 +1,48 @@
+/* -*- 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 <svl/itemset.hxx>
+#include <vcl/weld.hxx>
+
+namespace chart
+{
+/** The shared UI elements for the data table properties */
+class DataTablePropertiesResources final
+{
+private:
+ std::unique_ptr<weld::CheckButton> m_xCbHorizontalBorder;
+ std::unique_ptr<weld::CheckButton> m_xCbVerticalBorder;
+ std::unique_ptr<weld::CheckButton> m_xCbOutilne;
+ std::unique_ptr<weld::CheckButton> m_xCbKeys;
+
+public:
+ DataTablePropertiesResources(weld::Builder& rBuilder);
+
+ void initFromItemSet(SfxItemSet const& rInAttrs);
+ bool writeToItemSet(SfxItemSet& rOutAttrs) const;
+ void setChecksSensitive(bool bSensitive);
+
+ bool getHorizontalBorder() { return m_xCbHorizontalBorder->get_active(); }
+ void setHorizontalBorder(bool bActive) { m_xCbHorizontalBorder->set_active(bActive); }
+
+ bool getVerticalBorder() { return m_xCbVerticalBorder->get_active(); }
+ void setVerticalBorder(bool bActive) { m_xCbVerticalBorder->set_active(bActive); }
+
+ bool getOutline() { return m_xCbOutilne->get_active(); }
+ void setOutline(bool bActive) { m_xCbOutilne->set_active(bActive); }
+
+ bool getKeys() { return m_xCbKeys->get_active(); }
+ void setKeys(bool bActive) { m_xCbKeys->set_active(bActive); }
+};
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx
index c3521d5ba087..4fcd21226261 100644
--- a/chart2/source/controller/inc/res_ErrorBar.hxx
+++ b/chart2/source/controller/inc/res_ErrorBar.hxx
@@ -22,10 +22,9 @@
#include <tools/link.hxx>
#include <svl/itemset.hxx>
#include <svx/chrtitem.hxx>
-#include "RangeSelectionListener.hxx"
+#include <RangeSelectionListener.hxx>
#include <rtl/ref.hxx>
-namespace com::sun::star::chart2 { class XChartDocument; }
namespace weld { class Builder; }
namespace weld { class Button; }
namespace weld { class CheckButton; }
@@ -56,7 +55,7 @@ public:
ErrorBarResources(
weld::Builder* pParent, weld::DialogController* pControllerDialog, const SfxItemSet& rInAttrs, bool bNoneAvailable, chart::ErrorBarResources::tErrorBarType eType = ERROR_BAR_Y);
- virtual ~ErrorBarResources();
+ ~ErrorBarResources();
void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
void SetErrorBarType( tErrorBarType eNewType );
diff --git a/chart2/source/controller/inc/res_LegendPosition.hxx b/chart2/source/controller/inc/res_LegendPosition.hxx
index d34c28cdd79c..32f065642051 100644
--- a/chart2/source/controller/inc/res_LegendPosition.hxx
+++ b/chart2/source/controller/inc/res_LegendPosition.hxx
@@ -22,7 +22,6 @@
#include <tools/link.hxx>
#include <rtl/ref.hxx>
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::uno { class XComponentContext; }
namespace weld { class Builder; }
namespace weld { class CheckButton; }
@@ -40,8 +39,8 @@ public:
//constructor without Display checkbox
LegendPositionResources(weld::Builder& rBuilder);
//constructor inclusive Display checkbox
- LegendPositionResources(weld::Builder& rBuilder, const css::uno::Reference<
- css::uno::XComponentContext>& xCC );
+ LegendPositionResources(weld::Builder& rBuilder, css::uno::Reference<
+ css::uno::XComponentContext> xCC );
~LegendPositionResources();
void writeToResources( const rtl::Reference<::chart::ChartModel>& xChartModel );
@@ -57,6 +56,7 @@ public:
private:
void impl_setRadioButtonToggleHdl();
+ void PositionEnable();
private:
css::uno::Reference< css::uno::XComponentContext> m_xCC;
diff --git a/chart2/source/controller/inc/uiobject.hxx b/chart2/source/controller/inc/uiobject.hxx
index b40fffb4451b..6de63f5d3fdf 100644
--- a/chart2/source/controller/inc/uiobject.hxx
+++ b/chart2/source/controller/inc/uiobject.hxx
@@ -19,7 +19,7 @@ class ChartUIObject final : public UIObject
public:
ChartUIObject(const VclPtr<chart::ChartWindow>& xChartWindow,
- const OUString& rCID);
+ OUString aCID);
StringMap get_state() override;
@@ -32,6 +32,8 @@ public:
virtual OUString get_type() const override;
+ virtual bool equals(const UIObject& rOther) const override;
+
private:
OUString maCID;
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index cb53acb3a873..a5880942aad9 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -23,16 +23,17 @@
#include <GraphicPropertyItemConverter.hxx>
#include <chartview/ChartSfxItemIds.hxx>
#include <chartview/ExplicitScaleValues.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
#include "SchWhichPairs.hxx"
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <CommonConverters.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <Diagram.hxx>
#include <unonames.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <ChartView.hxx>
#include <memory>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
@@ -40,10 +41,8 @@
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/TimeInterval.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/AxisOrientation.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <osl/diagnose.h>
#include <o3tl/any.hxx>
@@ -85,7 +84,7 @@ AxisItemConverter::AxisItemConverter(
const rtl::Reference<::chart::ChartModel> & xChartDoc,
::chart::ExplicitScaleData const * pScale /* = NULL */,
::chart::ExplicitIncrementData const * pIncrement /* = NULL */,
- const awt::Size* pRefSize ) :
+ const std::optional<awt::Size>& pRefSize ) :
ItemConverter( rPropertySet, rItemPool ),
m_xChartDoc( xChartDoc )
{
@@ -99,10 +98,10 @@ AxisItemConverter::AxisItemConverter(
xChartDoc,
GraphicObjectType::LineProperties ));
m_aConverters.emplace_back(
- new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize"));
+ new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, u"ReferencePageSize"_ustr));
- m_xAxis.set( Reference< chart2::XAxis >( rPropertySet, uno::UNO_QUERY ) );
- OSL_ASSERT( m_xAxis.is());
+ m_xAxis = dynamic_cast<::chart::Axis*>(rPropertySet.get());
+ assert(m_xAxis);
}
AxisItemConverter::~AxisItemConverter()
@@ -162,57 +161,57 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
if( !m_xAxis.is() )
return;
- const chart2::ScaleData& rScale( m_xAxis->getScaleData() );
- const chart2::IncrementData& rIncrement( rScale.IncrementData );
- const uno::Sequence< chart2::SubIncrement >& rSubIncrements( rScale.IncrementData.SubIncrements );
- const TimeIncrement& rTimeIncrement( rScale.TimeIncrement );
- bool bDateAxis = (rScale.AxisType == chart2::AxisType::DATE);
+ const chart2::ScaleData aScale( m_xAxis->getScaleData() );
+ const chart2::IncrementData& rIncrement( aScale.IncrementData );
+ const uno::Sequence< chart2::SubIncrement >& rSubIncrements( aScale.IncrementData.SubIncrements );
+ const TimeIncrement& rTimeIncrement( aScale.TimeIncrement );
+ bool bDateAxis = (aScale.AxisType == chart2::AxisType::DATE);
if( m_pExplicitScale )
bDateAxis = (m_pExplicitScale->AxisType == chart2::AxisType::DATE);
switch( nWhichId )
{
case SCHATTR_AXIS_AUTO_MAX:
- rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Maximum) ) );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Maximum) ) );
break;
case SCHATTR_AXIS_MAX:
{
double fMax = 10.0;
- if( rScale.Maximum >>= fMax )
- rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) );
+ if( aScale.Maximum >>= fMax )
+ rOutItemSet.Put( SvxDoubleItem( fMax, SCHATTR_AXIS_MAX ) );
else
{
if( m_pExplicitScale )
fMax = m_pExplicitScale->Maximum;
- rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) );
+ rOutItemSet.Put( SvxDoubleItem( fMax, SCHATTR_AXIS_MAX ) );
}
}
break;
case SCHATTR_AXIS_AUTO_MIN:
- rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Minimum) ) );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Minimum) ) );
break;
case SCHATTR_AXIS_MIN:
{
double fMin = 0.0;
- if( rScale.Minimum >>= fMin )
- rOutItemSet.Put( SvxDoubleItem( fMin, nWhichId ) );
+ if( aScale.Minimum >>= fMin )
+ rOutItemSet.Put( SvxDoubleItem( fMin, SCHATTR_AXIS_MIN ) );
else if( m_pExplicitScale )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, SCHATTR_AXIS_MIN ));
}
break;
case SCHATTR_AXIS_LOGARITHM:
{
- bool bValue = AxisHelper::isLogarithmic( rScale.Scaling );
+ bool bValue = AxisHelper::isLogarithmic( aScale.Scaling );
rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
}
break;
case SCHATTR_AXIS_REVERSE:
- rOutItemSet.Put( SfxBoolItem( nWhichId, (rScale.Orientation == AxisOrientation_REVERSE) ));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, (aScale.Orientation == AxisOrientation_REVERSE) ));
break;
// Increment
@@ -238,17 +237,17 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
{
TimeInterval aTimeInterval;
if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval )
- rOutItemSet.Put( SvxDoubleItem(aTimeInterval.Number, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem(aTimeInterval.Number, SCHATTR_AXIS_STEP_MAIN ));
else if( m_pExplicitIncrement )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->MajorTimeInterval.Number, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->MajorTimeInterval.Number, SCHATTR_AXIS_STEP_MAIN ));
}
else
{
double fDistance = 1.0;
if( rIncrement.Distance >>= fDistance )
- rOutItemSet.Put( SvxDoubleItem(fDistance, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem(fDistance, SCHATTR_AXIS_STEP_MAIN ));
else if( m_pExplicitIncrement )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, SCHATTR_AXIS_STEP_MAIN ));
}
break;
@@ -307,7 +306,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
break;
case SCHATTR_AXIS_TIME_RESOLUTION:
{
- tools::Long nTimeResolution=0;
+ sal_Int32 nTimeResolution=0;
if( rTimeIncrement.TimeResolution >>= nTimeResolution )
rOutItemSet.Put( SfxInt32Item( nWhichId, nTimeResolution ) );
else if( m_pExplicitScale )
@@ -317,26 +316,26 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
case SCHATTR_AXIS_AUTO_ORIGIN:
{
- rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(rScale.Origin) )));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(aScale.Origin) )));
}
break;
case SCHATTR_AXIS_ORIGIN:
{
double fOrigin = 0.0;
- if( !(rScale.Origin >>= fOrigin) )
+ if( !(aScale.Origin >>= fOrigin) )
{
if( m_pExplicitScale )
fOrigin = m_pExplicitScale->Origin;
}
- rOutItemSet.Put( SvxDoubleItem( fOrigin, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( fOrigin, SCHATTR_AXIS_ORIGIN ));
}
break;
case SCHATTR_AXIS_POSITION:
{
css::chart::ChartAxisPosition eAxisPos( css::chart::ChartAxisPosition_ZERO );
- GetPropertySet()->getPropertyValue( "CrossoverPosition" ) >>= eAxisPos;
+ GetPropertySet()->getPropertyValue( u"CrossoverPosition"_ustr ) >>= eAxisPos;
rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast<sal_Int32>(eAxisPos) ) );
}
break;
@@ -344,8 +343,8 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
case SCHATTR_AXIS_POSITION_VALUE:
{
double fValue = 0.0;
- if( GetPropertySet()->getPropertyValue( "CrossoverValue" ) >>= fValue )
- rOutItemSet.Put( SvxDoubleItem( fValue, nWhichId ) );
+ if( GetPropertySet()->getPropertyValue( u"CrossoverValue"_ustr ) >>= fValue )
+ rOutItemSet.Put( SvxDoubleItem( fValue, SCHATTR_AXIS_POSITION_VALUE ) );
}
break;
@@ -355,11 +354,11 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
//necessary tp display the crossing value with an appropriate format
rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis(
- m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
+ m_xAxis, m_xChartDoc->getFirstChartDiagram() ) );
- Reference< chart2::XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys ) );
+ rtl::Reference< Axis > xCrossingMainAxis = AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys );
- sal_Int32 nFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
+ sal_Int32 nFormatKey = ChartView::getExplicitNumberFormatKeyForAxis(
xCrossingMainAxis, xCooSys, m_xChartDoc);
rOutItemSet.Put( SfxUInt32Item( nWhichId, nFormatKey ));
@@ -367,13 +366,13 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
break;
case SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION:
- rOutItemSet.Put(SfxBoolItem(nWhichId, rScale.ShiftedCategoryPosition));
+ rOutItemSet.Put(SfxBoolItem(nWhichId, aScale.ShiftedCategoryPosition));
break;
case SCHATTR_AXIS_LABEL_POSITION:
{
css::chart::ChartAxisLabelPosition ePos( css::chart::ChartAxisLabelPosition_NEAR_AXIS );
- GetPropertySet()->getPropertyValue( "LabelPosition" ) >>= ePos;
+ GetPropertySet()->getPropertyValue( u"LabelPosition"_ustr ) >>= ePos;
rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast<sal_Int32>(ePos) ) );
}
break;
@@ -381,7 +380,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
case SCHATTR_AXIS_MARK_POSITION:
{
css::chart::ChartAxisMarkPosition ePos( css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
- GetPropertySet()->getPropertyValue( "MarkPosition" ) >>= ePos;
+ GetPropertySet()->getPropertyValue( u"MarkPosition"_ustr ) >>= ePos;
rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast<sal_Int32>(ePos) ) );
}
break;
@@ -391,9 +390,9 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
// convert double to int (times 100)
double fVal = 0;
- if( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fVal )
+ if( GetPropertySet()->getPropertyValue( u"TextRotation"_ustr ) >>= fVal )
{
- rOutItemSet.Put( SdrAngleItem( nWhichId, Degree100(static_cast< sal_Int32 >(
+ rOutItemSet.Put( SdrAngleItem( SCHATTR_TEXT_DEGREES, Degree100(static_cast< sal_Int32 >(
::rtl::math::round( fVal * 100.0 )) ) ));
}
}
@@ -403,11 +402,11 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
{
if( m_pExplicitScale )
{
- Reference< chart2::XCoordinateSystem > xCooSys(
+ rtl::Reference< BaseCoordinateSystem > xCooSys(
AxisHelper::getCoordinateSystemOfAxis(
- m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
+ m_xAxis, m_xChartDoc->getFirstChartDiagram() ) );
- sal_Int32 nFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
+ sal_Int32 nFormatKey = ChartView::getExplicitNumberFormatKeyForAxis(
m_xAxis, xCooSys, m_xChartDoc);
rOutItemSet.Put( SfxUInt32Item( nWhichId, nFormatKey ));
@@ -424,20 +423,21 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
break;
case SCHATTR_AXISTYPE:
- rOutItemSet.Put( SfxInt32Item( nWhichId, rScale.AxisType ));
+ rOutItemSet.Put( SfxInt32Item( nWhichId, aScale.AxisType ));
break;
case SCHATTR_AXIS_AUTO_DATEAXIS:
- rOutItemSet.Put( SfxBoolItem( nWhichId, rScale.AutoDateAxis ));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, aScale.AutoDateAxis ));
break;
case SCHATTR_AXIS_ALLOW_DATEAXIS:
{
- Reference< chart2::XCoordinateSystem > xCooSys(
- AxisHelper::getCoordinateSystemOfAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys(
+ AxisHelper::getCoordinateSystemOfAxis( m_xAxis, m_xChartDoc->getFirstChartDiagram() ) );
sal_Int32 nDimensionIndex=0; sal_Int32 nAxisIndex=0;
AxisHelper::getIndicesForAxis(m_xAxis, xCooSys, nDimensionIndex, nAxisIndex );
- bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), nDimensionIndex );
+ auto xChartType = AxisHelper::getChartTypeByIndex(xCooSys, 0);
+ bool bChartTypeAllowsDateAxis = xChartType.is() ? xChartType->isSupportingDateAxis(nDimensionIndex) : true;
rOutItemSet.Put( SfxBoolItem( nWhichId, bChartTypeAllowsDateAxis ));
}
break;
@@ -715,24 +715,24 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
if( !AxisHelper::isAxisPositioningEnabled() )
{
//keep old and new settings for axis positioning in sync somehow
- Reference< chart2::XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis(
- m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis(
+ m_xAxis, m_xChartDoc->getFirstChartDiagram() ) );
sal_Int32 nDimensionIndex=0;
sal_Int32 nAxisIndex=0;
if( AxisHelper::getIndicesForAxis( m_xAxis, xCooSys, nDimensionIndex, nAxisIndex ) && nAxisIndex==0 )
{
- Reference< beans::XPropertySet > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys ), uno::UNO_QUERY );
+ rtl::Reference< Axis > xCrossingMainAxis = AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys );
if( xCrossingMainAxis.is() )
{
double fValue = 0.0;
if( aValue >>= fValue )
{
- xCrossingMainAxis->setPropertyValue( "CrossoverPosition" , uno::Any( css::chart::ChartAxisPosition_VALUE ));
- xCrossingMainAxis->setPropertyValue( "CrossoverValue" , uno::Any( fValue ));
+ xCrossingMainAxis->setPropertyValue( u"CrossoverPosition"_ustr , uno::Any( css::chart::ChartAxisPosition_VALUE ));
+ xCrossingMainAxis->setPropertyValue( u"CrossoverValue"_ustr , uno::Any( fValue ));
}
else
- xCrossingMainAxis->setPropertyValue( "CrossoverPosition" , uno::Any( css::chart::ChartAxisPosition_START ));
+ xCrossingMainAxis->setPropertyValue( u"CrossoverPosition"_ustr , uno::Any( css::chart::ChartAxisPosition_START ));
}
}
}
@@ -747,21 +747,22 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
static_cast<css::chart::ChartAxisPosition>(static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue());
css::chart::ChartAxisPosition eOldAxisPos( css::chart::ChartAxisPosition_ZERO );
- bool bPropExisted = ( GetPropertySet()->getPropertyValue( "CrossoverPosition" ) >>= eOldAxisPos );
+ bool bPropExisted = ( GetPropertySet()->getPropertyValue( u"CrossoverPosition"_ustr ) >>= eOldAxisPos );
if( !bPropExisted || ( eOldAxisPos != eAxisPos ))
{
- GetPropertySet()->setPropertyValue( "CrossoverPosition" , uno::Any( eAxisPos ));
+ GetPropertySet()->setPropertyValue( u"CrossoverPosition"_ustr , uno::Any( eAxisPos ));
bChangedOtherwise = true;
//move the parallel axes to the other side if necessary
if( eAxisPos==css::chart::ChartAxisPosition_START || eAxisPos==css::chart::ChartAxisPosition_END )
{
- Reference< beans::XPropertySet > xParallelAxis( AxisHelper::getParallelAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ), uno::UNO_QUERY );
+ rtl::Reference<Diagram> xDiagram = m_xChartDoc->getFirstChartDiagram();
+ rtl::Reference< Axis > xParallelAxis = AxisHelper::getParallelAxis( m_xAxis, xDiagram );
if( xParallelAxis.is() )
{
css::chart::ChartAxisPosition eOtherPos;
- if( xParallelAxis->getPropertyValue( "CrossoverPosition" ) >>= eOtherPos )
+ if( xParallelAxis->getPropertyValue( u"CrossoverPosition"_ustr ) >>= eOtherPos )
{
if( eOtherPos == eAxisPos )
{
@@ -769,7 +770,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
(eAxisPos==css::chart::ChartAxisPosition_START)
? css::chart::ChartAxisPosition_END
: css::chart::ChartAxisPosition_START;
- xParallelAxis->setPropertyValue( "CrossoverPosition" , uno::Any( eOppositePos ));
+ xParallelAxis->setPropertyValue( u"CrossoverPosition"_ustr , uno::Any( eOppositePos ));
}
}
}
@@ -783,23 +784,23 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
double fValue = static_cast< const SvxDoubleItem & >( rItemSet.Get( nWhichId )).GetValue();
double fOldValue = 0.0;
- bool bPropExisted = ( GetPropertySet()->getPropertyValue( "CrossoverValue" ) >>= fOldValue );
+ bool bPropExisted = ( GetPropertySet()->getPropertyValue( u"CrossoverValue"_ustr ) >>= fOldValue );
if( !bPropExisted || ( fOldValue != fValue ))
{
- GetPropertySet()->setPropertyValue( "CrossoverValue" , uno::Any( fValue ));
+ GetPropertySet()->setPropertyValue( u"CrossoverValue"_ustr , uno::Any( fValue ));
bChangedOtherwise = true;
//keep old and new settings for axis positioning in sync somehow
{
- Reference< chart2::XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis(
- m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis(
+ m_xAxis, m_xChartDoc->getFirstChartDiagram() ) );
sal_Int32 nDimensionIndex=0;
sal_Int32 nAxisIndex=0;
if( AxisHelper::getIndicesForAxis( m_xAxis, xCooSys, nDimensionIndex, nAxisIndex ) && nAxisIndex==0 )
{
- Reference< chart2::XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys ) );
+ rtl::Reference< Axis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( m_xAxis, xCooSys ) );
if( xCrossingMainAxis.is() )
{
ScaleData aCrossingScale( xCrossingMainAxis->getScaleData() );
@@ -830,21 +831,22 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
static_cast<css::chart::ChartAxisLabelPosition>(static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue());
css::chart::ChartAxisLabelPosition eOldPos( css::chart::ChartAxisLabelPosition_NEAR_AXIS );
- bool bPropExisted = ( GetPropertySet()->getPropertyValue( "LabelPosition" ) >>= eOldPos );
+ bool bPropExisted = ( GetPropertySet()->getPropertyValue( u"LabelPosition"_ustr ) >>= eOldPos );
if( !bPropExisted || ( eOldPos != ePos ))
{
- GetPropertySet()->setPropertyValue( "LabelPosition" , uno::Any( ePos ));
+ GetPropertySet()->setPropertyValue( u"LabelPosition"_ustr , uno::Any( ePos ));
bChangedOtherwise = true;
//move the parallel axes to the other side if necessary
if( ePos==css::chart::ChartAxisLabelPosition_OUTSIDE_START || ePos==css::chart::ChartAxisLabelPosition_OUTSIDE_END )
{
- Reference< beans::XPropertySet > xParallelAxis( AxisHelper::getParallelAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ), uno::UNO_QUERY );
+ rtl::Reference<Diagram> xDiagram = m_xChartDoc->getFirstChartDiagram();
+ rtl::Reference< Axis > xParallelAxis = AxisHelper::getParallelAxis( m_xAxis, xDiagram );
if( xParallelAxis.is() )
{
css::chart::ChartAxisLabelPosition eOtherPos;
- if( xParallelAxis->getPropertyValue( "LabelPosition" ) >>= eOtherPos )
+ if( xParallelAxis->getPropertyValue( u"LabelPosition"_ustr ) >>= eOtherPos )
{
if( eOtherPos == ePos )
{
@@ -852,7 +854,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
(ePos==css::chart::ChartAxisLabelPosition_OUTSIDE_START)
? css::chart::ChartAxisLabelPosition_OUTSIDE_END
: css::chart::ChartAxisLabelPosition_OUTSIDE_START;
- xParallelAxis->setPropertyValue( "LabelPosition" , uno::Any( eOppositePos ));
+ xParallelAxis->setPropertyValue( u"LabelPosition"_ustr , uno::Any( eOppositePos ));
}
}
}
@@ -867,11 +869,11 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
static_cast<css::chart::ChartAxisMarkPosition>(static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue());
css::chart::ChartAxisMarkPosition eOldPos( css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
- bool bPropExisted = ( GetPropertySet()->getPropertyValue( "MarkPosition" ) >>= eOldPos );
+ bool bPropExisted = ( GetPropertySet()->getPropertyValue( u"MarkPosition"_ustr ) >>= eOldPos );
if( !bPropExisted || ( eOldPos != ePos ))
{
- GetPropertySet()->setPropertyValue( "MarkPosition" , uno::Any( ePos ));
+ GetPropertySet()->setPropertyValue( u"MarkPosition"_ustr , uno::Any( ePos ));
bChangedOtherwise = true;
}
}
@@ -882,11 +884,11 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
double fVal = toDegrees(rItemSet.Get(SCHATTR_TEXT_DEGREES).GetValue());
double fOldVal = 0.0;
bool bPropExisted =
- ( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fOldVal );
+ ( GetPropertySet()->getPropertyValue( u"TextRotation"_ustr ) >>= fOldVal );
if( ! bPropExisted || fOldVal != fVal )
{
- GetPropertySet()->setPropertyValue( "TextRotation" , uno::Any( fVal ));
+ GetPropertySet()->setPropertyValue( u"TextRotation"_ustr , uno::Any( fVal ));
bChangedOtherwise = true;
}
}
@@ -897,8 +899,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
if( m_pExplicitScale )
{
bool bUseSourceFormat =
- static_cast< const SfxBoolItem & >(
- rItemSet.Get( SID_ATTR_NUMBERFORMAT_SOURCE )).GetValue();
+ rItemSet.Get( SID_ATTR_NUMBERFORMAT_SOURCE ).GetValue();
if( ! bUseSourceFormat )
{
@@ -940,11 +941,11 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
}
else
{
- Reference< chart2::XCoordinateSystem > xCooSys(
- AxisHelper::getCoordinateSystemOfAxis(
- m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys =
+ AxisHelper::getCoordinateSystemOfAxis(
+ m_xAxis, m_xChartDoc->getFirstChartDiagram() );
- sal_Int32 nFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
+ sal_Int32 nFormatKey = ChartView::getExplicitNumberFormatKeyForAxis(
m_xAxis, xCooSys, m_xChartDoc);
aValue <<= nFormatKey;
diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
index 5345f9168ca3..a924d6db1803 100644
--- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
@@ -33,7 +33,8 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart2/XFormattedString.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
@@ -73,11 +74,11 @@ CharacterPropertyItemConverter::CharacterPropertyItemConverter(
CharacterPropertyItemConverter::CharacterPropertyItemConverter(
const uno::Reference< beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
- const awt::Size* pRefSize,
- const OUString & rRefSizePropertyName,
+ const std::optional<awt::Size>& pRefSize,
+ OUString aRefSizePropertyName,
const uno::Reference< beans::XPropertySet > & rRefSizePropSet ) :
ItemConverter( rPropertySet, rItemPool ),
- m_aRefSizePropertyName( rRefSizePropertyName ),
+ m_aRefSizePropertyName(std::move( aRefSizePropertyName )),
m_xRefSizePropSet( rRefSizePropSet.is() ? rRefSizePropSet : rPropertySet )
{
if (pRefSize)
@@ -141,21 +142,21 @@ void CharacterPropertyItemConverter::FillSpecialItem(
SvxUnderlineItem aItem(LINESTYLE_NONE, EE_CHAR_UNDERLINE);
bool bModified = false;
- uno::Any aValue( GetPropertySet()->getPropertyValue( "CharUnderline" ));
+ uno::Any aValue( GetPropertySet()->getPropertyValue( u"CharUnderline"_ustr ));
if( aValue.hasValue())
{
aItem.PutValue( aValue, MID_TL_STYLE );
bModified = true;
}
- aValue = GetPropertySet()->getPropertyValue( "CharUnderlineHasColor" );
+ aValue = GetPropertySet()->getPropertyValue( u"CharUnderlineHasColor"_ustr );
if( aValue.hasValue() && *o3tl::doAccess<bool>(aValue) )
{
aItem.PutValue( aValue, MID_TL_HASCOLOR );
bModified = true;
}
- aValue = GetPropertySet()->getPropertyValue( "CharUnderlineColor" );
+ aValue = GetPropertySet()->getPropertyValue( u"CharUnderlineColor"_ustr );
if( aValue.hasValue())
{
aItem.PutValue( aValue, MID_TL_COLOR );
@@ -172,21 +173,21 @@ void CharacterPropertyItemConverter::FillSpecialItem(
SvxOverlineItem aItem( LINESTYLE_NONE, EE_CHAR_OVERLINE );
bool bModified = false;
- uno::Any aValue( GetPropertySet()->getPropertyValue( "CharOverline" ) );
+ uno::Any aValue( GetPropertySet()->getPropertyValue( u"CharOverline"_ustr ) );
if ( aValue.hasValue() )
{
aItem.PutValue( aValue, MID_TL_STYLE );
bModified = true;
}
- aValue = GetPropertySet()->getPropertyValue( "CharOverlineHasColor" );
+ aValue = GetPropertySet()->getPropertyValue( u"CharOverlineHasColor"_ustr );
if ( aValue.hasValue() && *o3tl::doAccess<bool>(aValue) )
{
aItem.PutValue( aValue, MID_TL_HASCOLOR );
bModified = true;
}
- aValue = GetPropertySet()->getPropertyValue( "CharOverlineColor" );
+ aValue = GetPropertySet()->getPropertyValue( u"CharOverlineColor"_ustr );
if ( aValue.hasValue() )
{
aItem.PutValue( aValue, MID_TL_COLOR );
@@ -376,27 +377,27 @@ bool CharacterPropertyItemConverter::ApplySpecialItem(
if( rItem.QueryValue( aValue, MID_TL_STYLE ))
{
- if( aValue != GetPropertySet()->getPropertyValue( "CharUnderline" ))
+ if( aValue != GetPropertySet()->getPropertyValue( u"CharUnderline"_ustr ))
{
- GetPropertySet()->setPropertyValue( "CharUnderline" , aValue );
+ GetPropertySet()->setPropertyValue( u"CharUnderline"_ustr , aValue );
bChanged = true;
}
}
if( rItem.QueryValue( aValue, MID_TL_COLOR ))
{
- if( aValue != GetPropertySet()->getPropertyValue( "CharUnderlineColor" ))
+ if( aValue != GetPropertySet()->getPropertyValue( u"CharUnderlineColor"_ustr ))
{
- GetPropertySet()->setPropertyValue( "CharUnderlineColor" , aValue );
+ GetPropertySet()->setPropertyValue( u"CharUnderlineColor"_ustr , aValue );
bChanged = true;
}
}
if( rItem.QueryValue( aValue, MID_TL_HASCOLOR ))
{
- if( aValue != GetPropertySet()->getPropertyValue( "CharUnderlineHasColor" ))
+ if( aValue != GetPropertySet()->getPropertyValue( u"CharUnderlineHasColor"_ustr ))
{
- GetPropertySet()->setPropertyValue( "CharUnderlineHasColor" , aValue );
+ GetPropertySet()->setPropertyValue( u"CharUnderlineHasColor"_ustr , aValue );
bChanged = true;
}
}
@@ -409,27 +410,27 @@ bool CharacterPropertyItemConverter::ApplySpecialItem(
if ( rItem.QueryValue( aValue, MID_TL_STYLE ) )
{
- if ( aValue != GetPropertySet()->getPropertyValue( "CharOverline" ) )
+ if ( aValue != GetPropertySet()->getPropertyValue( u"CharOverline"_ustr ) )
{
- GetPropertySet()->setPropertyValue( "CharOverline" , aValue );
+ GetPropertySet()->setPropertyValue( u"CharOverline"_ustr , aValue );
bChanged = true;
}
}
if ( rItem.QueryValue( aValue, MID_TL_COLOR ) )
{
- if ( aValue != GetPropertySet()->getPropertyValue( "CharOverlineColor" ) )
+ if ( aValue != GetPropertySet()->getPropertyValue( u"CharOverlineColor"_ustr ) )
{
- GetPropertySet()->setPropertyValue( "CharOverlineColor" , aValue );
+ GetPropertySet()->setPropertyValue( u"CharOverlineColor"_ustr , aValue );
bChanged = true;
}
}
if ( rItem.QueryValue( aValue, MID_TL_HASCOLOR ) )
{
- if ( aValue != GetPropertySet()->getPropertyValue( "CharOverlineHasColor" ) )
+ if ( aValue != GetPropertySet()->getPropertyValue( u"CharOverlineHasColor"_ustr ) )
{
- GetPropertySet()->setPropertyValue( "CharOverlineHasColor" , aValue );
+ GetPropertySet()->setPropertyValue( u"CharOverlineHasColor"_ustr , aValue );
bChanged = true;
}
}
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 264bdf92af3b..aa8f21231120 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -25,11 +25,12 @@
#include <CharacterPropertyItemConverter.hxx>
#include <StatisticsItemConverter.hxx>
#include <SeriesOptionsItemConverter.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <DataSeriesProperties.hxx>
#include <Diagram.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <unonames.hxx>
@@ -39,7 +40,6 @@
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <comphelper/sequence.hxx>
#include <svx/xflclit.hxx>
@@ -50,7 +50,7 @@
#include <editeng/brushitem.hxx>
#include <svl/ilstitem.hxx>
#include <svx/sdangitm.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/graph.hxx>
#include <rtl/math.hxx>
@@ -60,6 +60,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Reference;
namespace chart::wrapper {
@@ -105,7 +106,7 @@ bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSe
bool bChanged = false;
if( !xPropertySet.is() )
return bChanged;
- OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_VALUE) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" );
+ OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_VALUE) ? CHART_UNONAME_NUMFMT : u"PercentageNumberFormat"_ustr;
sal_uInt16 nSourceWhich = (nWhichId==SID_ATTR_NUMBERFORMAT_VALUE) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE;
if( rItemSet.GetItemState( nSourceWhich ) != SfxItemState::SET )
@@ -131,11 +132,11 @@ bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSe
uno::Any aOldValue( xPropertySet->getPropertyValue(aPropertyName) );
if( bOverwriteAttributedDataPointsAlso )
{
- Reference< chart2::XDataSeries > xSeries( xPropertySet, uno::UNO_QUERY);
+ rtl::Reference< DataSeries > xSeries( dynamic_cast<DataSeries*>(xPropertySet.get()) );
if( aValue != aOldValue ||
- ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, aPropertyName, aOldValue ) )
+ xSeries->hasAttributedDataPointDifferentValue( aPropertyName, aOldValue ) )
{
- ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, aPropertyName, aValue );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( aPropertyName, aValue );
bChanged = true;
}
}
@@ -152,7 +153,7 @@ bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxIte
bool bChanged = false;
if( !xPropertySet.is() )
return bChanged;
- OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_SOURCE) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" );
+ OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_SOURCE) ? CHART_UNONAME_NUMFMT : u"PercentageNumberFormat"_ustr;
sal_uInt16 nFormatWhich = (nWhichId==SID_ATTR_NUMBERFORMAT_SOURCE) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE;
if( rItemSet.GetItemState( nWhichId ) != SfxItemState::SET )
@@ -179,11 +180,11 @@ bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxIte
uno::Any aOldValue( xPropertySet->getPropertyValue(aPropertyName) );
if( bOverwriteAttributedDataPointsAlso )
{
- Reference< chart2::XDataSeries > xSeries( xPropertySet, uno::UNO_QUERY);
+ rtl::Reference< DataSeries > xSeries( dynamic_cast<DataSeries*>(xPropertySet.get()) );
if( aNewValue != aOldValue ||
- ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, aPropertyName, aOldValue ) )
+ xSeries->hasAttributedDataPointDifferentValue( aPropertyName, aOldValue ) )
{
- ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, aPropertyName, aNewValue );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( aPropertyName, aNewValue );
bChanged = true;
}
}
@@ -202,12 +203,11 @@ DataPointItemConverter::DataPointItemConverter(
const rtl::Reference<::chart::ChartModel> & xChartModel,
const uno::Reference< uno::XComponentContext > & xContext,
const uno::Reference< beans::XPropertySet > & rPropertySet,
- const uno::Reference< XDataSeries > & xSeries,
+ const rtl::Reference< DataSeries > & xSeries,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const uno::Reference<lang::XMultiServiceFactory>& xNamedPropertyContainerFactory,
GraphicObjectType eMapTo,
- const awt::Size* pRefSize,
+ const std::optional<awt::Size>& pRefSize,
bool bDataSeries,
bool bUseSpecialFillColor,
sal_Int32 nSpecialFillColor,
@@ -228,30 +228,32 @@ DataPointItemConverter::DataPointItemConverter(
m_xSeries(xSeries)
{
m_aConverters.emplace_back( new GraphicPropertyItemConverter(
- rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, eMapTo ));
- m_aConverters.emplace_back( new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize"));
+ rPropertySet, rItemPool, rDrawModel, xChartModel, eMapTo ));
+ m_aConverters.emplace_back( new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, u"ReferencePageSize"_ustr));
if( bDataSeries )
{
+ assert(dynamic_cast<DataSeries*>(rPropertySet.get()));
m_aConverters.emplace_back( new StatisticsItemConverter( xChartModel, rPropertySet, rItemPool ));
- m_aConverters.emplace_back( new SeriesOptionsItemConverter( xChartModel, xContext, rPropertySet, rItemPool ));
+ m_aConverters.emplace_back( new SeriesOptionsItemConverter( xChartModel, xContext,
+ dynamic_cast<DataSeries*>(rPropertySet.get()), rItemPool ));
}
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
- uno::Reference< XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xSeries ) );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeOfSeries( xSeries ) );
bool bFound = false;
bool bAmbiguous = false;
- bool bSwapXAndY = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
+ bool bSwapXAndY = xDiagram->getVertical( bFound, bAmbiguous );
m_aAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements( xChartType, bSwapXAndY, xSeries );
- m_bForbidPercentValue = ChartTypeHelper::getAxisType( xChartType, 0 ) != AxisType::CATEGORY;
+ m_bForbidPercentValue = xChartType.is() ? xChartType->getAxisType(0) != AxisType::CATEGORY : false;
if (bDataSeries)
return;
- uno::Reference<beans::XPropertySet> xSeriesProp(xSeries, uno::UNO_QUERY);
uno::Sequence<sal_Int32> deletedLegendEntriesSeq;
- xSeriesProp->getPropertyValue("DeletedLegendEntries") >>= deletedLegendEntriesSeq;
- for (const auto& deletedLegendEntry : std::as_const(deletedLegendEntriesSeq))
+ // "DeletedLegendEntries"
+ xSeries->getFastPropertyValue(PROP_DATASERIES_DELETED_LEGEND_ENTRIES) >>= deletedLegendEntriesSeq;
+ for (const auto& deletedLegendEntry : deletedLegendEntriesSeq)
{
if (nPointIndex == deletedLegendEntry)
{
@@ -338,12 +340,12 @@ bool DataPointItemConverter::ApplySpecialItem(
rValue = rItem.GetValue();
if( m_bOverwriteLabelsForAttributedDataPointsAlso )
{
- Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get()));
if( bOldValue != bool(rValue) ||
- DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, CHART_UNONAME_LABEL , aOldValue ) )
+ xSeries->hasAttributedDataPointDifferentValue( CHART_UNONAME_LABEL , aOldValue ) )
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_LABEL , uno::Any( aLabel ) );
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any() );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( CHART_UNONAME_LABEL , uno::Any( aLabel ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any() );
bChanged = true;
}
}
@@ -376,20 +378,20 @@ bool DataPointItemConverter::ApplySpecialItem(
try
{
OUString aOldValue;
- GetPropertySet()->getPropertyValue( "LabelSeparator" ) >>= aOldValue;
+ GetPropertySet()->getPropertyValue( u"LabelSeparator"_ustr ) >>= aOldValue;
if( m_bOverwriteLabelsForAttributedDataPointsAlso )
{
- Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get()));
if( aOldValue != aNewValue ||
- DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, "LabelSeparator" , uno::Any( aOldValue ) ) )
+ xSeries->hasAttributedDataPointDifferentValue( u"LabelSeparator"_ustr , uno::Any( aOldValue ) ) )
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "LabelSeparator" , uno::Any( aNewValue ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"LabelSeparator"_ustr , uno::Any( aNewValue ) );
bChanged = true;
}
}
else if( aOldValue != aNewValue )
{
- GetPropertySet()->setPropertyValue( "LabelSeparator" , uno::Any( aNewValue ));
+ GetPropertySet()->setPropertyValue( u"LabelSeparator"_ustr , uno::Any( aNewValue ));
bChanged = true;
}
}
@@ -407,20 +409,20 @@ bool DataPointItemConverter::ApplySpecialItem(
{
bool bNew = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue();
bool bOld = false;
- GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bOld;
+ GetPropertySet()->getPropertyValue( u"TextWordWrap"_ustr ) >>= bOld;
if( m_bOverwriteLabelsForAttributedDataPointsAlso )
{
- Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get()));
if( bOld!=bNew ||
- DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, "TextWordWrap", uno::Any( bOld ) ) )
+ xSeries->hasAttributedDataPointDifferentValue( u"TextWordWrap"_ustr, uno::Any( bOld ) ) )
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "TextWordWrap", uno::Any( bNew ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"TextWordWrap"_ustr, uno::Any( bNew ) );
bChanged = true;
}
}
else if( bOld!=bNew )
{
- GetPropertySet()->setPropertyValue( "TextWordWrap", uno::Any( bNew ));
+ GetPropertySet()->setPropertyValue( u"TextWordWrap"_ustr, uno::Any( bNew ));
bChanged = true;
}
}
@@ -439,21 +441,22 @@ bool DataPointItemConverter::ApplySpecialItem(
sal_Int32 nNew = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
sal_Int32 nOld = -1;
RelativePosition aCustomLabelPosition;
- GetPropertySet()->getPropertyValue("LabelPlacement") >>= nOld;
+ GetPropertySet()->getPropertyValue(u"LabelPlacement"_ustr) >>= nOld;
if( m_bOverwriteLabelsForAttributedDataPointsAlso )
{
- Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get()));
if( nOld!=nNew ||
- DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, "LabelPlacement" , uno::Any( nOld ) ) )
+ xSeries->hasAttributedDataPointDifferentValue( u"LabelPlacement"_ustr , uno::Any( nOld ) ) )
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "LabelPlacement" , uno::Any( nNew ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"LabelPlacement"_ustr , uno::Any( nNew ) );
bChanged = true;
}
}
- else if( nOld!=nNew || (GetPropertySet()->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition) )
+ else if( nOld!=nNew || (GetPropertySet()->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition) )
{
- GetPropertySet()->setPropertyValue("LabelPlacement", uno::Any(nNew));
- GetPropertySet()->setPropertyValue("CustomLabelPosition", uno::Any());
+ GetPropertySet()->setPropertyValue(u"LabelPlacement"_ustr, uno::Any(nNew));
+ GetPropertySet()->setPropertyValue(u"CustomLabelPosition"_ustr, uno::Any());
+ GetPropertySet()->setPropertyValue(u"CustomLabelSize"_ustr, uno::Any());
bChanged = true;
}
}
@@ -471,7 +474,7 @@ bool DataPointItemConverter::ApplySpecialItem(
rItemSet.Get( nWhichId )).GetValue();
chart2::Symbol aSymbol;
- GetPropertySet()->getPropertyValue( "Symbol" ) >>= aSymbol;
+ GetPropertySet()->getPropertyValue( u"Symbol"_ustr ) >>= aSymbol;
sal_Int32 nOldStyle = lcl_getSymbolStyleForSymbol( aSymbol );
if( nStyle != nOldStyle )
@@ -498,9 +501,9 @@ bool DataPointItemConverter::ApplySpecialItem(
}
if( bDeleteSymbol )
- GetPropertySet()->setPropertyValue( "Symbol" , uno::Any());
+ GetPropertySet()->setPropertyValue( u"Symbol"_ustr , uno::Any());
else
- GetPropertySet()->setPropertyValue( "Symbol" , uno::Any( aSymbol ));
+ GetPropertySet()->setPropertyValue( u"Symbol"_ustr , uno::Any( aSymbol ));
bChanged = true;
}
}
@@ -512,14 +515,14 @@ bool DataPointItemConverter::ApplySpecialItem(
rItemSet.Get( nWhichId )).GetSize();
chart2::Symbol aSymbol;
- GetPropertySet()->getPropertyValue( "Symbol" ) >>= aSymbol;
+ GetPropertySet()->getPropertyValue( u"Symbol"_ustr ) >>= aSymbol;
if( aSize.getWidth() != aSymbol.Size.Width ||
aSize.getHeight() != aSymbol.Size.Height )
{
aSymbol.Size.Width = aSize.getWidth();
aSymbol.Size.Height = aSize.getHeight();
- GetPropertySet()->setPropertyValue( "Symbol" , uno::Any( aSymbol ));
+ GetPropertySet()->setPropertyValue( u"Symbol"_ustr , uno::Any( aSymbol ));
bChanged = true;
}
}
@@ -538,11 +541,11 @@ bool DataPointItemConverter::ApplySpecialItem(
{
aXGraphicAny <<= xGraphic;
chart2::Symbol aSymbol;
- GetPropertySet()->getPropertyValue( "Symbol" ) >>= aSymbol;
+ GetPropertySet()->getPropertyValue( u"Symbol"_ustr ) >>= aSymbol;
if( aSymbol.Graphic != xGraphic )
{
- aSymbol.Graphic = xGraphic;
- GetPropertySet()->setPropertyValue( "Symbol" , uno::Any( aSymbol ));
+ aSymbol.Graphic = std::move(xGraphic);
+ GetPropertySet()->setPropertyValue( u"Symbol"_ustr , uno::Any( aSymbol ));
bChanged = true;
}
}
@@ -555,11 +558,11 @@ bool DataPointItemConverter::ApplySpecialItem(
double fValue = toDegrees(rItemSet.Get(SCHATTR_TEXT_DEGREES).GetValue());
double fOldValue = 0.0;
bool bPropExisted =
- ( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fOldValue );
+ ( GetPropertySet()->getPropertyValue( u"TextRotation"_ustr ) >>= fOldValue );
if( ! bPropExisted || fOldValue != fValue )
{
- GetPropertySet()->setPropertyValue( "TextRotation" , uno::Any( fValue ));
+ GetPropertySet()->setPropertyValue( u"TextRotation"_ustr , uno::Any( fValue ));
bChanged = true;
}
}
@@ -571,17 +574,18 @@ bool DataPointItemConverter::ApplySpecialItem(
if (bHideLegendEntry != m_bHideLegendEntry)
{
uno::Sequence<sal_Int32> deletedLegendEntriesSeq;
- Reference<beans::XPropertySet> xSeriesProp(m_xSeries, uno::UNO_QUERY);
- xSeriesProp->getPropertyValue("DeletedLegendEntries") >>= deletedLegendEntriesSeq;
+ // "DeletedLegendEntries"
+ m_xSeries->getFastPropertyValue(PROP_DATASERIES_DELETED_LEGEND_ENTRIES) >>= deletedLegendEntriesSeq;
std::vector<sal_Int32> deletedLegendEntries;
- for (const auto& deletedLegendEntry : std::as_const(deletedLegendEntriesSeq))
+ for (const auto& deletedLegendEntry : deletedLegendEntriesSeq)
{
if (bHideLegendEntry || m_nPointIndex != deletedLegendEntry)
deletedLegendEntries.push_back(deletedLegendEntry);
}
if (bHideLegendEntry)
deletedLegendEntries.push_back(m_nPointIndex);
- xSeriesProp->setPropertyValue("DeletedLegendEntries", uno::makeAny(comphelper::containerToSequence(deletedLegendEntries)));
+ // "DeletedLegendEntries"
+ m_xSeries->setFastPropertyValue(PROP_DATASERIES_DELETED_LEGEND_ENTRIES, uno::Any(comphelper::containerToSequence(deletedLegendEntries)));
}
}
break;
@@ -592,10 +596,9 @@ bool DataPointItemConverter::ApplySpecialItem(
{
bool bNew = static_cast<const SfxBoolItem&>(rItemSet.Get(nWhichId)).GetValue();
bool bOld = true;
- Reference<beans::XPropertySet> xSeriesProp(m_xSeries, uno::UNO_QUERY);
- if( (xSeriesProp->getPropertyValue("ShowCustomLeaderLines") >>= bOld) && bOld != bNew )
+ if( (m_xSeries->getFastPropertyValue(PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES) >>= bOld) && bOld != bNew )
{
- xSeriesProp->setPropertyValue("ShowCustomLeaderLines", uno::Any(bNew));
+ m_xSeries->setFastPropertyValue(PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES, uno::Any(bNew));
bChanged = true;
}
}
@@ -631,13 +634,13 @@ void DataPointItemConverter::FillSpecialItem(
rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
- if( m_bOverwriteLabelsForAttributedDataPointsAlso )
+ DataSeries* pDataSeries = m_bOverwriteLabelsForAttributedDataPointsAlso
+ ? dynamic_cast<DataSeries*>(GetPropertySet().get())
+ : nullptr;
+ if (pDataSeries && pDataSeries->hasAttributedDataPointDifferentValue(
+ CHART_UNONAME_LABEL, uno::Any(aLabel)))
{
- if( DataSeriesHelper::hasAttributedDataPointDifferentValue(
- Reference< chart2::XDataSeries >( GetPropertySet(), uno::UNO_QUERY), CHART_UNONAME_LABEL , uno::Any(aLabel) ) )
- {
- rOutItemSet.InvalidateItem(nWhichId);
- }
+ rOutItemSet.InvalidateItem(nWhichId);
}
}
}
@@ -655,7 +658,7 @@ void DataPointItemConverter::FillSpecialItem(
case SCHATTR_PERCENT_NUMBERFORMAT_VALUE:
{
sal_Int32 nKey = 0;
- if( !(GetPropertySet()->getPropertyValue( "PercentageNumberFormat" ) >>= nKey) )
+ if( !(GetPropertySet()->getPropertyValue( u"PercentageNumberFormat"_ustr ) >>= nKey) )
nKey = m_nPercentNumberFormat;
rOutItemSet.Put( SfxUInt32Item( nWhichId, nKey ));
}
@@ -687,7 +690,7 @@ void DataPointItemConverter::FillSpecialItem(
{
TOOLS_WARN_EXCEPTION("chart2", "");
}
- bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue( "PercentageNumberFormat" ).hasValue() && !bUseSourceFormat;
+ bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue( u"PercentageNumberFormat"_ustr ).hasValue() && !bUseSourceFormat;
rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
}
break;
@@ -697,7 +700,7 @@ void DataPointItemConverter::FillSpecialItem(
try
{
OUString aValue;
- GetPropertySet()->getPropertyValue( "LabelSeparator" ) >>= aValue;
+ GetPropertySet()->getPropertyValue( u"LabelSeparator"_ustr ) >>= aValue;
rOutItemSet.Put( SfxStringItem( nWhichId, aValue ));
}
catch( const uno::Exception& )
@@ -712,7 +715,7 @@ void DataPointItemConverter::FillSpecialItem(
try
{
bool bValue = false;
- GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bValue;
+ GetPropertySet()->getPropertyValue( u"TextWordWrap"_ustr ) >>= bValue;
rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
}
catch( const uno::Exception& )
@@ -728,9 +731,9 @@ void DataPointItemConverter::FillSpecialItem(
{
sal_Int32 nPlacement=0;
RelativePosition aCustomLabelPosition;
- if( !m_bOverwriteLabelsForAttributedDataPointsAlso && (GetPropertySet()->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition) )
+ if( !m_bOverwriteLabelsForAttributedDataPointsAlso && (GetPropertySet()->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition) )
rOutItemSet.Put(SfxInt32Item(nWhichId, css::chart::DataLabelPlacement::CUSTOM));
- else if( GetPropertySet()->getPropertyValue( "LabelPlacement" ) >>= nPlacement )
+ else if( GetPropertySet()->getPropertyValue( u"LabelPlacement"_ustr ) >>= nPlacement )
rOutItemSet.Put( SfxInt32Item( nWhichId, nPlacement ));
else if( m_aAvailableLabelPlacements.hasElements() )
rOutItemSet.Put( SfxInt32Item( nWhichId, m_aAvailableLabelPlacements[0] ));
@@ -759,8 +762,7 @@ void DataPointItemConverter::FillSpecialItem(
try
{
bool bValue = true;
- Reference<beans::XPropertySet> xSeriesProp(m_xSeries, uno::UNO_QUERY);
- if( xSeriesProp->getPropertyValue( "ShowCustomLeaderLines" ) >>= bValue )
+ if( m_xSeries->getFastPropertyValue( PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES ) >>= bValue )
rOutItemSet.Put(SfxBoolItem(nWhichId, bValue));
}
catch (const uno::Exception&)
@@ -773,7 +775,7 @@ void DataPointItemConverter::FillSpecialItem(
case SCHATTR_STYLE_SYMBOL:
{
chart2::Symbol aSymbol;
- if( GetPropertySet()->getPropertyValue( "Symbol" ) >>= aSymbol )
+ if( GetPropertySet()->getPropertyValue( u"Symbol"_ustr ) >>= aSymbol )
rOutItemSet.Put( SfxInt32Item( nWhichId, lcl_getSymbolStyleForSymbol( aSymbol ) ));
}
break;
@@ -781,7 +783,7 @@ void DataPointItemConverter::FillSpecialItem(
case SCHATTR_SYMBOL_SIZE:
{
chart2::Symbol aSymbol;
- if( GetPropertySet()->getPropertyValue( "Symbol" ) >>= aSymbol )
+ if( GetPropertySet()->getPropertyValue( u"Symbol"_ustr ) >>= aSymbol )
rOutItemSet.Put(
SvxSizeItem( nWhichId, Size( aSymbol.Size.Width, aSymbol.Size.Height ) ));
}
@@ -790,7 +792,7 @@ void DataPointItemConverter::FillSpecialItem(
case SCHATTR_SYMBOL_BRUSH:
{
chart2::Symbol aSymbol;
- if(( GetPropertySet()->getPropertyValue( "Symbol" ) >>= aSymbol )
+ if(( GetPropertySet()->getPropertyValue( u"Symbol"_ustr ) >>= aSymbol )
&& aSymbol.Graphic.is() )
{
rOutItemSet.Put( SvxBrushItem( Graphic( aSymbol.Graphic ), GPOS_MM, SCHATTR_SYMBOL_BRUSH ));
@@ -802,9 +804,9 @@ void DataPointItemConverter::FillSpecialItem(
{
double fValue = 0;
- if( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fValue )
+ if( GetPropertySet()->getPropertyValue( u"TextRotation"_ustr ) >>= fValue )
{
- rOutItemSet.Put( SdrAngleItem( nWhichId, Degree100(static_cast< sal_Int32 >(
+ rOutItemSet.Put( SdrAngleItem( SCHATTR_TEXT_DEGREES, Degree100(static_cast< sal_Int32 >(
::rtl::math::round( fValue * 100.0 ) ) )));
}
}
diff --git a/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx
new file mode 100644
index 000000000000..e152bf298dfc
--- /dev/null
+++ b/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx
@@ -0,0 +1,92 @@
+/* -*- 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 <DataTableItemConverter.hxx>
+#include <ItemPropertyMap.hxx>
+#include <CharacterPropertyItemConverter.hxx>
+#include <GraphicPropertyItemConverter.hxx>
+#include <chartview/ChartSfxItemIds.hxx>
+#include "SchWhichPairs.hxx"
+#include <ChartModel.hxx>
+#include <memory>
+
+using namespace css;
+
+namespace chart::wrapper
+{
+namespace
+{
+ItemPropertyMapType& lclDataTablePropertyMap()
+{
+ static ItemPropertyMapType aPropertyMap{
+ { SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, { "HBorder", 0 } },
+ { SCHATTR_DATA_TABLE_VERTICAL_BORDER, { "VBorder", 0 } },
+ { SCHATTR_DATA_TABLE_OUTLINE, { "Outline", 0 } },
+ { SCHATTR_DATA_TABLE_KEYS, { "Keys", 0 } },
+ };
+ return aPropertyMap;
+};
+}
+
+DataTableItemConverter::DataTableItemConverter(
+ const uno::Reference<beans::XPropertySet>& rPropertySet, SfxItemPool& rItemPool,
+ SdrModel& rDrawModel, const rtl::Reference<::chart::ChartModel>& xChartDoc)
+ : ItemConverter(rPropertySet, rItemPool)
+{
+ m_aConverters.emplace_back(new GraphicPropertyItemConverter(
+ rPropertySet, rItemPool, rDrawModel, xChartDoc, GraphicObjectType::LineProperties));
+ m_aConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool));
+}
+
+DataTableItemConverter::~DataTableItemConverter() = default;
+
+void DataTableItemConverter::FillItemSet(SfxItemSet& rOutItemSet) const
+{
+ for (const auto& pConv : m_aConverters)
+ {
+ pConv->FillItemSet(rOutItemSet);
+ }
+
+ // own items
+ ItemConverter::FillItemSet(rOutItemSet);
+}
+
+bool DataTableItemConverter::ApplyItemSet(const SfxItemSet& rItemSet)
+{
+ bool bResult = false;
+
+ for (const auto& pConv : m_aConverters)
+ {
+ bResult = pConv->ApplyItemSet(rItemSet) || bResult;
+ }
+
+ // own items
+ return ItemConverter::ApplyItemSet(rItemSet) || bResult;
+}
+
+const WhichRangesContainer& DataTableItemConverter::GetWhichPairs() const
+{
+ return nDataTableWhichPairs;
+}
+
+bool DataTableItemConverter::GetItemProperty(tWhichIdType nWhichId,
+ tPropertyNameWithMemberId& rOutProperty) const
+{
+ ItemPropertyMapType& rMap(lclDataTablePropertyMap());
+ auto aIt = rMap.find(nWhichId);
+ if (aIt == rMap.cend())
+ return false;
+
+ rOutProperty = (*aIt).second;
+
+ return true;
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
index 89c4e8cc212a..f97ae631ee02 100644
--- a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
@@ -22,6 +22,7 @@
#include <StatisticsHelper.hxx>
#include <GraphicPropertyItemConverter.hxx>
+#include <ChartModel.hxx>
#include <svl/stritem.hxx>
#include <svx/chrtitem.hxx>
@@ -30,7 +31,8 @@
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
@@ -45,8 +47,8 @@ void lcl_getErrorValues( const uno::Reference< beans::XPropertySet > & xErrorBar
try
{
- xErrorBarProp->getPropertyValue( "PositiveError" ) >>= rOutPosError;
- xErrorBarProp->getPropertyValue( "NegativeError" ) >>= rOutNegError;
+ xErrorBarProp->getPropertyValue( u"PositiveError"_ustr ) >>= rOutPosError;
+ xErrorBarProp->getPropertyValue( u"NegativeError"_ustr ) >>= rOutNegError;
}
catch( const uno::Exception & )
{
@@ -63,8 +65,8 @@ void lcl_getErrorIndicatorValues(
try
{
- xErrorBarProp->getPropertyValue( "ShowPositiveError" ) >>= rOutShowPosError;
- xErrorBarProp->getPropertyValue( "ShowNegativeError" ) >>= rOutShowNegError;
+ xErrorBarProp->getPropertyValue( u"ShowPositiveError"_ustr ) >>= rOutShowPosError;
+ xErrorBarProp->getPropertyValue( u"ShowNegativeError"_ustr ) >>= rOutShowNegError;
}
catch( const uno::Exception & )
{
@@ -78,17 +80,16 @@ namespace chart::wrapper
{
ErrorBarItemConverter::ErrorBarItemConverter(
- const uno::Reference< frame::XModel > & xModel,
+ const rtl::Reference< ChartModel > & xChartModel,
const uno::Reference< beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
- SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory ) :
+ SdrModel& rDrawModel ) :
ItemConverter( rPropertySet, rItemPool ),
m_spGraphicConverter( std::make_shared<GraphicPropertyItemConverter>(
rPropertySet, rItemPool, rDrawModel,
- xNamedPropertyContainerFactory,
+ xChartModel,
GraphicObjectType::LineProperties )),
- m_xModel( xModel )
+ m_xModel(xChartModel)
{}
ErrorBarItemConverter::~ErrorBarItemConverter()
@@ -169,7 +170,7 @@ bool ErrorBarItemConverter::ApplySpecialItem(
nStyle = css::chart::ErrorBarStyle::FROM_DATA; break;
}
- xErrorBarProp->setPropertyValue( "ErrorBarStyle" , uno::Any( nStyle ));
+ xErrorBarProp->setPropertyValue( u"ErrorBarStyle"_ustr , uno::Any( nStyle ));
bChanged = true;
}
}
@@ -190,8 +191,8 @@ bool ErrorBarItemConverter::ApplySpecialItem(
if( ! ( ::rtl::math::approxEqual( fPos, fValue ) &&
::rtl::math::approxEqual( fNeg, fValue )))
{
- xErrorBarProp->setPropertyValue( "PositiveError" , uno::Any( fValue ));
- xErrorBarProp->setPropertyValue( "NegativeError" , uno::Any( fValue ));
+ xErrorBarProp->setPropertyValue( u"PositiveError"_ustr , uno::Any( fValue ));
+ xErrorBarProp->setPropertyValue( u"NegativeError"_ustr , uno::Any( fValue ));
bChanged = true;
}
}
@@ -207,7 +208,7 @@ bool ErrorBarItemConverter::ApplySpecialItem(
if( ! ::rtl::math::approxEqual( fPos, fValue ))
{
- GetPropertySet()->setPropertyValue( "PositiveError" , uno::Any( fValue ));
+ GetPropertySet()->setPropertyValue( u"PositiveError"_ustr , uno::Any( fValue ));
bChanged = true;
}
}
@@ -225,7 +226,7 @@ bool ErrorBarItemConverter::ApplySpecialItem(
if( ! ::rtl::math::approxEqual( fNeg, fValue ))
{
- xErrorBarProp->setPropertyValue( "NegativeError" , uno::Any( fValue ));
+ xErrorBarProp->setPropertyValue( u"NegativeError"_ustr , uno::Any( fValue ));
bChanged = true;
}
}
@@ -248,8 +249,8 @@ bool ErrorBarItemConverter::ApplySpecialItem(
if( bShowPos != bNewIndPos ||
bShowNeg != bNewIndNeg )
{
- xErrorBarProp->setPropertyValue( "ShowPositiveError" , uno::Any( bNewIndPos ));
- xErrorBarProp->setPropertyValue( "ShowNegativeError" , uno::Any( bNewIndNeg ));
+ xErrorBarProp->setPropertyValue( u"ShowPositiveError"_ustr , uno::Any( bNewIndPos ));
+ xErrorBarProp->setPropertyValue( u"ShowNegativeError"_ustr , uno::Any( bNewIndNeg ));
bChanged = true;
}
}
@@ -326,7 +327,7 @@ void ErrorBarItemConverter::FillSpecialItem(
uno::Reference< beans::XPropertySet > xErrorBarProp( GetPropertySet());
sal_Int32 nStyle = 0;
- if( xErrorBarProp->getPropertyValue( "ErrorBarStyle" ) >>= nStyle )
+ if( xErrorBarProp->getPropertyValue( u"ErrorBarStyle"_ustr ) >>= nStyle )
{
switch( nStyle )
{
@@ -346,6 +347,8 @@ void ErrorBarItemConverter::FillSpecialItem(
eErrorKind = SvxChartKindError::StdError; break;
case css::chart::ErrorBarStyle::FROM_DATA:
eErrorKind = SvxChartKindError::Range; break;
+ default:
+ eErrorKind = SvxChartKindError::NONE; break;
}
}
rOutItemSet.Put( SvxChartKindErrorItem( eErrorKind, SCHATTR_STAT_KIND_ERROR ));
@@ -356,7 +359,7 @@ void ErrorBarItemConverter::FillSpecialItem(
{
double fPos(0.0), fNeg(0.0);
lcl_getErrorValues( GetPropertySet(), fPos, fNeg );
- rOutItemSet.Put( SvxDoubleItem( ( fPos + fNeg ) / 2.0, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( ( fPos + fNeg ) / 2.0, SCHATTR_STAT_PERCENT ));
}
break;
@@ -364,7 +367,7 @@ void ErrorBarItemConverter::FillSpecialItem(
{
double fPos(0.0), fNeg(0.0);
lcl_getErrorValues( GetPropertySet(), fPos, fNeg );
- rOutItemSet.Put( SvxDoubleItem( ( fPos + fNeg ) / 2.0, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( ( fPos + fNeg ) / 2.0, SCHATTR_STAT_BIGERROR ));
}
break;
@@ -372,7 +375,7 @@ void ErrorBarItemConverter::FillSpecialItem(
{
double fPos(0.0), fNeg(0.0);
lcl_getErrorValues( GetPropertySet(), fPos, fNeg );
- rOutItemSet.Put( SvxDoubleItem( fPos, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( fPos, SCHATTR_STAT_CONSTPLUS ));
}
break;
@@ -380,7 +383,7 @@ void ErrorBarItemConverter::FillSpecialItem(
{
double fPos(0.0), fNeg(0.0);
lcl_getErrorValues( GetPropertySet(), fPos, fNeg );
- rOutItemSet.Put( SvxDoubleItem( fNeg, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( fNeg, SCHATTR_STAT_CONSTMINUS ));
}
break;
diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
index e265e4198180..301abe03397c 100644
--- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
@@ -19,10 +19,12 @@
#include <GraphicPropertyItemConverter.hxx>
#include "SchWhichPairs.hxx"
+#include <ChartModel.hxx>
#include <ItemPropertyMap.hxx>
#include <PropertyHelper.hxx>
#include <CommonConverters.hxx>
#include <editeng/memberids.h>
+#include <svx/chrtitem.hxx>
#include <svx/unomid.hxx>
#include <svx/xflbmtit.hxx>
#include <svx/xflbstit.hxx>
@@ -39,7 +41,8 @@
#include <com/sun/star/drawing/BitmapMode.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
@@ -137,13 +140,14 @@ GraphicPropertyItemConverter::GraphicPropertyItemConverter(
beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
+ rtl::Reference< ChartModel > xChartModel,
GraphicObjectType eObjectType /* = FILL_PROPERTIES */ ) :
ItemConverter( rPropertySet, rItemPool ),
m_GraphicObjectType( eObjectType ),
m_rDrawModel( rDrawModel ),
- m_xNamedPropertyTableFactory( xNamedPropertyContainerFactory )
-{}
+ m_xChartModel(std::move( xChartModel ))
+{
+}
GraphicPropertyItemConverter::~GraphicPropertyItemConverter()
{}
@@ -167,6 +171,11 @@ const WhichRangesContainer& GraphicPropertyItemConverter::GetWhichPairs() const
bool GraphicPropertyItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const
{
+ if (nWhichId == SCHATTR_COLOR_PALETTE)
+ {
+ return false;
+ }
+
ItemPropertyMapType::const_iterator aEndIt;
ItemPropertyMapType::const_iterator aIt;
@@ -216,7 +225,7 @@ void GraphicPropertyItemConverter::FillSpecialItem(
case XATTR_FILLBMP_STRETCH:
{
drawing::BitmapMode aMode = drawing::BitmapMode_REPEAT;
- if( GetPropertySet()->getPropertyValue( "FillBitmapMode" ) >>= aMode )
+ if( GetPropertySet()->getPropertyValue( u"FillBitmapMode"_ustr ) >>= aMode )
{
rOutItemSet.Put( XFillBmpTileItem( aMode == drawing::BitmapMode_REPEAT ));
rOutItemSet.Put( XFillBmpStretchItem( aMode == drawing::BitmapMode_STRETCH ));
@@ -231,8 +240,8 @@ void GraphicPropertyItemConverter::FillSpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "TransparencyGradientName" )
- : OUString( "FillTransparenceGradientName" );
+ ? u"TransparencyGradientName"_ustr
+ : u"FillTransparenceGradientName"_ustr;
uno::Any aValue( GetPropertySet()->getPropertyValue( aPropName ));
if( aValue.hasValue())
@@ -241,7 +250,7 @@ void GraphicPropertyItemConverter::FillSpecialItem(
aItem.PutValue( aValue, MID_NAME );
lcl_SetContentForNamedProperty(
- m_xNamedPropertyTableFactory, "com.sun.star.drawing.TransparencyGradientTable" ,
+ m_xChartModel, u"com.sun.star.drawing.TransparencyGradientTable"_ustr ,
aItem, MID_FILLGRADIENT );
// this is important to enable the item
@@ -266,8 +275,8 @@ void GraphicPropertyItemConverter::FillSpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "GradientStepCount" )
- : OUString( "FillGradientStepCount" );
+ ? u"GradientStepCount"_ustr
+ : u"FillGradientStepCount"_ustr;
uno::Any aValue( GetPropertySet()->getPropertyValue( aPropName ) );
if( hasLongOrShortValue(aValue) )
@@ -282,19 +291,19 @@ void GraphicPropertyItemConverter::FillSpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "BorderDashName" )
- : OUString( "LineDashName" );
+ ? u"BorderDashName"_ustr
+ : u"LineDashName"_ustr;
XLineDashItem aItem;
aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), MID_NAME );
lcl_SetContentForNamedProperty(
- m_xNamedPropertyTableFactory, "com.sun.star.drawing.DashTable" ,
+ m_xChartModel, u"com.sun.star.drawing.DashTable"_ustr ,
aItem, MID_LINEDASH );
// translate model name to UI-name for predefined entries, so
// that the correct entry is chosen in the list of UI-names
- std::unique_ptr<XLineDashItem> pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel );
+ std::unique_ptr<XLineDashItem> pItemToPut = aItem.checkForUniqueItem( m_rDrawModel );
if(pItemToPut)
rOutItemSet.Put( std::move(pItemToPut) );
@@ -308,19 +317,19 @@ void GraphicPropertyItemConverter::FillSpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "GradientName" )
- : OUString( "FillGradientName" );
+ ? u"GradientName"_ustr
+ : u"FillGradientName"_ustr;
XFillGradientItem aItem;
aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), MID_NAME );
lcl_SetContentForNamedProperty(
- m_xNamedPropertyTableFactory, "com.sun.star.drawing.GradientTable" ,
+ m_xChartModel, u"com.sun.star.drawing.GradientTable"_ustr ,
aItem, MID_FILLGRADIENT );
// translate model name to UI-name for predefined entries, so
// that the correct entry is chosen in the list of UI-names
- std::unique_ptr<XFillGradientItem> pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel );
+ std::unique_ptr<XFillGradientItem> pItemToPut = aItem.checkForUniqueItem( m_rDrawModel );
if(pItemToPut)
rOutItemSet.Put(std::move(pItemToPut) );
@@ -334,19 +343,19 @@ void GraphicPropertyItemConverter::FillSpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "HatchName" )
- : OUString( "FillHatchName" );
+ ? u"HatchName"_ustr
+ : u"FillHatchName"_ustr;
XFillHatchItem aItem;
aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), MID_NAME );
lcl_SetContentForNamedProperty(
- m_xNamedPropertyTableFactory, "com.sun.star.drawing.HatchTable" ,
+ m_xChartModel, u"com.sun.star.drawing.HatchTable"_ustr ,
aItem, MID_FILLHATCH );
// translate model name to UI-name for predefined entries, so
// that the correct entry is chosen in the list of UI-names
- std::unique_ptr<XFillHatchItem> pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel );
+ std::unique_ptr<XFillHatchItem> pItemToPut = aItem.checkForUniqueItem( m_rDrawModel );
if(pItemToPut)
rOutItemSet.Put( std::move(pItemToPut) );
@@ -359,15 +368,15 @@ void GraphicPropertyItemConverter::FillSpecialItem(
if( lcl_supportsFillProperties( m_GraphicObjectType ))
{
XFillBitmapItem aItem;
- aItem.PutValue( GetPropertySet()->getPropertyValue( "FillBitmapName" ), MID_NAME );
+ aItem.PutValue( GetPropertySet()->getPropertyValue( u"FillBitmapName"_ustr ), MID_NAME );
lcl_SetContentForNamedProperty(
- m_xNamedPropertyTableFactory, "com.sun.star.drawing.BitmapTable" ,
+ m_xChartModel, u"com.sun.star.drawing.BitmapTable"_ustr ,
aItem, MID_BITMAP );
// translate model name to UI-name for predefined entries, so
// that the correct entry is chosen in the list of UI-names
- std::unique_ptr<XFillBitmapItem> pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel );
+ std::unique_ptr<XFillBitmapItem> pItemToPut = aItem.checkForUniqueItem( m_rDrawModel );
if(pItemToPut)
rOutItemSet.Put( std::move(pItemToPut) );
@@ -382,10 +391,10 @@ void GraphicPropertyItemConverter::FillSpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "BorderTransparency" )
+ ? u"BorderTransparency"_ustr
: (m_GraphicObjectType == GraphicObjectType::LineDataPoint)
- ? OUString( "Transparency" )
- : OUString( "LineTransparence" );
+ ? u"Transparency"_ustr
+ : u"LineTransparence"_ustr;
XLineTransparenceItem aItem;
aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), 0 );
@@ -401,8 +410,8 @@ void GraphicPropertyItemConverter::FillSpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "Transparency" )
- : OUString( "FillTransparence" );
+ ? u"Transparency"_ustr
+ : u"FillTransparence"_ustr;
XFillTransparenceItem aItem;
aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ), 0 );
@@ -425,7 +434,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
case XATTR_FILLBMP_STRETCH:
if( lcl_supportsFillProperties( m_GraphicObjectType ))
{
- static const OUStringLiteral aModePropName(u"FillBitmapMode");
+ static constexpr OUString aModePropName(u"FillBitmapMode"_ustr);
bool bStretched = rItemSet.Get( XATTR_FILLBMP_STRETCH ).GetValue();
drawing::BitmapMode aMode =
(bStretched ? drawing::BitmapMode_STRETCH : drawing::BitmapMode_NO_REPEAT);
@@ -447,7 +456,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
case XATTR_FILLBMP_TILE:
if( lcl_supportsFillProperties( m_GraphicObjectType ))
{
- static const OUStringLiteral aModePropName(u"FillBitmapMode");
+ static constexpr OUString aModePropName(u"FillBitmapMode"_ustr);
bool bTiled = rItemSet.Get( XATTR_FILLBMP_TILE ).GetValue();
drawing::BitmapMode aMode =
(bTiled ? drawing::BitmapMode_REPEAT : drawing::BitmapMode_NO_REPEAT);
@@ -468,8 +477,8 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "TransparencyGradientName" )
- : OUString( "FillTransparenceGradientName" );
+ ? u"TransparencyGradientName"_ustr
+ : u"FillTransparenceGradientName"_ustr;
const XFillFloatTransparenceItem & rItem =
static_cast< const XFillFloatTransparenceItem & >(
@@ -485,7 +494,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
OUString aPreferredName;
aValue >>= aPreferredName;
aValue <<= PropertyHelper::addTransparencyGradientUniqueNameToTable(
- aGradient, m_xNamedPropertyTableFactory, aPreferredName );
+ aGradient, m_xChartModel, aPreferredName );
if( aValue != GetPropertySet()->getPropertyValue( aPropName ))
{
@@ -519,8 +528,8 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "GradientStepCount" )
- : OUString( "FillGradientStepCount" );
+ ? u"GradientStepCount"_ustr
+ : u"FillGradientStepCount"_ustr;
sal_Int16 nStepCount = static_cast< const XGradientStepCountItem & >(
rItemSet.Get( nWhichId )).GetValue();
@@ -539,8 +548,8 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "BorderDashName" )
- : OUString( "LineDashName" );
+ ? u"BorderDashName"_ustr
+ : u"LineDashName"_ustr;
const XLineDashItem & rItem =
static_cast< const XLineDashItem & >(
@@ -556,7 +565,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
OUString aPreferredName;
aValue >>= aPreferredName;
aValue <<= PropertyHelper::addLineDashUniqueNameToTable(
- aLineDash, m_xNamedPropertyTableFactory, aPreferredName );
+ aLineDash, m_xChartModel, aPreferredName );
GetPropertySet()->setPropertyValue( aPropName, aValue );
bChanged = true;
@@ -571,8 +580,8 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "GradientName" )
- : OUString( "FillGradientName" );
+ ? u"GradientName"_ustr
+ : u"FillGradientName"_ustr;
const XFillGradientItem & rItem =
static_cast< const XFillGradientItem & >(
@@ -588,7 +597,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
OUString aPreferredName;
aValue >>= aPreferredName;
aValue <<= PropertyHelper::addGradientUniqueNameToTable(
- aGradient, m_xNamedPropertyTableFactory, aPreferredName );
+ aGradient, m_xChartModel, aPreferredName );
GetPropertySet()->setPropertyValue( aPropName, aValue );
bChanged = true;
@@ -604,8 +613,8 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "HatchName" )
- : OUString( "FillHatchName" );
+ ? u"HatchName"_ustr
+ : u"FillHatchName"_ustr;
const XFillHatchItem & rItem =
static_cast< const XFillHatchItem & >(
@@ -621,7 +630,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
OUString aPreferredName;
aValue >>= aPreferredName;
aValue <<= PropertyHelper::addHatchUniqueNameToTable(
- aHatch, m_xNamedPropertyTableFactory, aPreferredName );
+ aHatch, m_xChartModel, aPreferredName );
GetPropertySet()->setPropertyValue( aPropName, aValue );
bChanged = true;
@@ -641,7 +650,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
if( rItem.QueryValue( aValue, MID_NAME ))
{
- if( aValue != GetPropertySet()->getPropertyValue( "FillBitmapName" ))
+ if( aValue != GetPropertySet()->getPropertyValue( u"FillBitmapName"_ustr ))
{
// add Bitmap to list
uno::Any aBitmap;
@@ -649,9 +658,9 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
OUString aPreferredName;
aValue >>= aPreferredName;
aValue <<= PropertyHelper::addBitmapUniqueNameToTable(
- aBitmap, m_xNamedPropertyTableFactory, aPreferredName );
+ aBitmap, m_xChartModel, aPreferredName );
- GetPropertySet()->setPropertyValue( "FillBitmapName" , aValue );
+ GetPropertySet()->setPropertyValue( u"FillBitmapName"_ustr , aValue );
bChanged = true;
}
}
@@ -665,10 +674,10 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "BorderTransparency" )
+ ? u"BorderTransparency"_ustr
: (m_GraphicObjectType == GraphicObjectType::LineDataPoint)
- ? OUString( "Transparency" )
- : OUString( "LineTransparence" );
+ ? u"Transparency"_ustr
+ : u"LineTransparence"_ustr;
const XLineTransparenceItem & rItem =
static_cast< const XLineTransparenceItem & >(
@@ -704,8 +713,8 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
{
OUString aPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "Transparency" )
- : OUString( "FillTransparence" );
+ ? u"Transparency"_ustr
+ : u"FillTransparence"_ustr;
const XFillTransparenceItem & rItem =
static_cast< const XFillTransparenceItem & >(
@@ -727,8 +736,8 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
// if linear or no transparence is set, delete the gradient
OUString aTransGradPropName =
(m_GraphicObjectType == GraphicObjectType::FilledDataPoint)
- ? OUString( "TransparencyGradientName" )
- : OUString( "FillTransparenceGradientName" );
+ ? u"TransparencyGradientName"_ustr
+ : u"FillTransparenceGradientName"_ustr;
GetPropertySet()->setPropertyValue(
aTransGradPropName, uno::Any( OUString() ));
@@ -741,6 +750,15 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
}
}
break;
+ case SCHATTR_COLOR_PALETTE:
+ {
+ const auto& rItem = static_cast<const SvxChartColorPaletteItem&>(rItemSet.Get(nWhichId));
+ m_xChartModel->setColorPalette(rItem.GetType(), rItem.GetIndex());
+ const auto oColorPalette = m_xChartModel->getCurrentColorPalette();
+ if (oColorPalette)
+ m_xChartModel->applyColorPaletteToDataSeries(*oColorPalette);
+ }
+ break;
}
return bChanged;
diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
index e90fad016cfd..1a4eebf91127 100644
--- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
@@ -25,17 +25,19 @@
#include <svl/itemiter.hxx>
#include <svl/whiter.hxx>
#include <svx/svxids.hrc>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
+#include <utility>
+#include <chartview/ChartSfxItemIds.hxx>
using namespace ::com::sun::star;
namespace chart::wrapper {
ItemConverter::ItemConverter(
- const uno::Reference< beans::XPropertySet > & rPropertySet,
+ uno::Reference< beans::XPropertySet > xPropertySet,
SfxItemPool& rItemPool ) :
- m_xPropertySet( rPropertySet ),
+ m_xPropertySet(std::move( xPropertySet )),
m_rItemPool( rItemPool )
{
resetPropertySet( m_xPropertySet );
@@ -94,7 +96,7 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
if( GetItemProperty( nWhich, aProperty ))
{
// put the Property into the itemset
- std::unique_ptr<SfxPoolItem> pItem(rPool.GetDefaultItem( nWhich ).Clone());
+ std::unique_ptr<SfxPoolItem> pItem(rPool.GetUserOrPoolDefaultItem( nWhich ).Clone());
if( pItem )
{
@@ -155,9 +157,31 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
tPropertyNameWithMemberId aProperty;
uno::Any aValue;
+ // tdf#165491 the Item with WhichID SCHATTR_STAT_KIND_ERROR *has* to
+ // be handled 1st since it sets additional information about the
+ // ErrorBarStyle at uno::Reference< beans::XPropertySet > xErrorBarProp
+ // that the processing of the *other* Items already need access to,
+ // see 'case SCHATTR_STAT_KIND_ERROR' in
+ // StatisticsItemConverter::ApplySpecialItem. This worked before the
+ // change of SfxItemSet to use a std::unordered_set since the order
+ // of Items was fix and - since SCHATTR_STAT_KIND_ERROR had the
+ // lowest WhichID - was handled 1st. Not sure if that was by purpose
+ // and it was known that this was necessary - there are no comments
+ // hinting to that. In general it is bad style to rely on the 'order'
+ // of Items being processed - there is no order defined in general.
+ {
+ const SfxPoolItem* pItem(nullptr);
+ if (SfxItemState::SET == rItemSet.GetItemState(SCHATTR_STAT_KIND_ERROR, false, &pItem))
+ if(!GetItemProperty(pItem->Which(), aProperty))
+ bItemsChanged = ApplySpecialItem(pItem->Which(), rItemSet);
+ }
+
for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
{
- if( rItemSet.GetItemState( pItem->Which(), false ) == SfxItemState::SET )
+ if (SCHATTR_STAT_KIND_ERROR == pItem->Which())
+ continue;
+
+ if( aIter.GetItemState( false ) == SfxItemState::SET )
{
if( GetItemProperty( pItem->Which(), aProperty ))
{
@@ -198,7 +222,8 @@ void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItem
while (nWhich)
{
- if ((rSourceSet.GetItemState(nWhich, true, &pPoolItem) == SfxItemState::SET) &&
+ SfxItemState nSourceItemState = aIter.GetItemState(true, &pPoolItem);
+ if ((nSourceItemState == SfxItemState::SET) &&
(rDestSet.GetItemState(nWhich, true, &pPoolItem) == SfxItemState::SET))
{
if (rSourceSet.Get(nWhich) != rDestSet.Get(nWhich))
@@ -209,7 +234,7 @@ void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItem
}
}
}
- else if( rSourceSet.GetItemState(nWhich, true, &pPoolItem) == SfxItemState::DONTCARE )
+ else if( nSourceItemState == SfxItemState::INVALID )
rDestSet.InvalidateItem(nWhich);
nWhich = aIter.NextWhich ();
diff --git a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
index 081e8ebbd390..e58dbc544f37 100644
--- a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
@@ -21,13 +21,14 @@
#include "SchWhichPairs.hxx"
#include <GraphicPropertyItemConverter.hxx>
#include <CharacterPropertyItemConverter.hxx>
+#include <ChartModel.hxx>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <memory>
@@ -40,16 +41,16 @@ LegendItemConverter::LegendItemConverter(
const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
- const awt::Size* pRefSize ) :
+ const rtl::Reference< ChartModel > & xChartModel,
+ const std::optional<awt::Size>& pRefSize ) :
ItemConverter( rPropertySet, rItemPool )
{
m_aConverters.emplace_back( new GraphicPropertyItemConverter(
- rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory,
+ rPropertySet, rItemPool, rDrawModel, xChartModel,
GraphicObjectType::LineAndFillProperties ));
m_aConverters.emplace_back( new CharacterPropertyItemConverter(
rPropertySet, rItemPool, pRefSize,
- "ReferencePageSize" ));
+ u"ReferencePageSize"_ustr ));
}
LegendItemConverter::~LegendItemConverter()
@@ -96,15 +97,14 @@ bool LegendItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSe
{
case SCHATTR_LEGEND_SHOW:
{
- const SfxPoolItem* pPoolItem = nullptr;
- if( rInItemSet.GetItemState( SCHATTR_LEGEND_SHOW, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxBoolItem* pShowItem = rInItemSet.GetItemIfSet( SCHATTR_LEGEND_SHOW ) )
{
- bool bShow = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
+ bool bShow = pShowItem->GetValue();
bool bWasShown = true;
- if( ! (GetPropertySet()->getPropertyValue( "Show" ) >>= bWasShown) ||
+ if( ! (GetPropertySet()->getPropertyValue( u"Show"_ustr ) >>= bWasShown) ||
( bWasShown != bShow ))
{
- GetPropertySet()->setPropertyValue( "Show" , uno::Any( bShow ));
+ GetPropertySet()->setPropertyValue( u"Show"_ustr , uno::Any( bShow ));
bChanged = true;
}
}
@@ -113,10 +113,9 @@ bool LegendItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSe
break;
case SCHATTR_LEGEND_POS:
{
- const SfxPoolItem* pPoolItem = nullptr;
- if( rInItemSet.GetItemState( SCHATTR_LEGEND_POS, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SfxInt32Item* pPosItem = rInItemSet.GetItemIfSet( SCHATTR_LEGEND_POS ) )
{
- chart2::LegendPosition eNewPos = static_cast<chart2::LegendPosition>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
+ chart2::LegendPosition eNewPos = static_cast<chart2::LegendPosition>(pPosItem->GetValue());
css::chart::ChartLegendExpansion eExpansion = css::chart::ChartLegendExpansion_HIGH;
switch( eNewPos )
@@ -136,12 +135,12 @@ bool LegendItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSe
try
{
chart2::LegendPosition eOldPos;
- if( ! ( GetPropertySet()->getPropertyValue( "AnchorPosition" ) >>= eOldPos ) ||
+ if( ! ( GetPropertySet()->getPropertyValue( u"AnchorPosition"_ustr ) >>= eOldPos ) ||
( eOldPos != eNewPos ))
{
- GetPropertySet()->setPropertyValue( "AnchorPosition" , uno::Any( eNewPos ));
- GetPropertySet()->setPropertyValue( "Expansion" , uno::Any( eExpansion ));
- GetPropertySet()->setPropertyValue( "RelativePosition" , uno::Any());
+ GetPropertySet()->setPropertyValue( u"AnchorPosition"_ustr , uno::Any( eNewPos ));
+ GetPropertySet()->setPropertyValue( u"Expansion"_ustr , uno::Any( eExpansion ));
+ GetPropertySet()->setPropertyValue( u"RelativePosition"_ustr , uno::Any());
bChanged = true;
}
}
@@ -154,15 +153,14 @@ bool LegendItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSe
break;
case SCHATTR_LEGEND_NO_OVERLAY:
{
- const SfxPoolItem* pPoolItem = nullptr;
- if(rInItemSet.GetItemState(SCHATTR_LEGEND_NO_OVERLAY, true, &pPoolItem) == SfxItemState::SET)
+ if(const SfxBoolItem* pNoOverlayItem = rInItemSet.GetItemIfSet(SCHATTR_LEGEND_NO_OVERLAY))
{
- bool bOverlay = !static_cast<const SfxBoolItem *>(pPoolItem)->GetValue();
+ bool bOverlay = !pNoOverlayItem->GetValue();
bool bOldOverlay = false;
- if(!(GetPropertySet()->getPropertyValue("Overlay") >>= bOldOverlay) ||
+ if(!(GetPropertySet()->getPropertyValue(u"Overlay"_ustr) >>= bOldOverlay) ||
(bOldOverlay != bOverlay))
{
- GetPropertySet()->setPropertyValue("Overlay", uno::Any(bOverlay));
+ GetPropertySet()->setPropertyValue(u"Overlay"_ustr, uno::Any(bOverlay));
bChanged = true;
}
}
@@ -182,21 +180,21 @@ void LegendItemConverter::FillSpecialItem(
case SCHATTR_LEGEND_SHOW:
{
bool bShow = true;
- GetPropertySet()->getPropertyValue( "Show" ) >>= bShow;
+ GetPropertySet()->getPropertyValue( u"Show"_ustr ) >>= bShow;
rOutItemSet.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, bShow) );
}
break;
case SCHATTR_LEGEND_POS:
{
chart2::LegendPosition eLegendPos( chart2::LegendPosition_LINE_END );
- GetPropertySet()->getPropertyValue( "AnchorPosition" ) >>= eLegendPos;
+ GetPropertySet()->getPropertyValue( u"AnchorPosition"_ustr ) >>= eLegendPos;
rOutItemSet.Put( SfxInt32Item(SCHATTR_LEGEND_POS, static_cast<sal_Int32>(eLegendPos) ) );
}
break;
case SCHATTR_LEGEND_NO_OVERLAY:
{
bool bOverlay = false;
- GetPropertySet()->getPropertyValue("Overlay") >>= bOverlay;
+ GetPropertySet()->getPropertyValue(u"Overlay"_ustr) >>= bOverlay;
rOutItemSet.Put(SfxBoolItem(SCHATTR_LEGEND_NO_OVERLAY, !bOverlay));
}
break;
diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
index 7c67ef59c139..a6dbf6d2faac 100644
--- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
+++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
@@ -24,23 +24,19 @@
#include <StatisticsItemConverter.hxx>
#include <GraphicPropertyItemConverter.hxx>
#include <DataPointItemConverter.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
#include <Diagram.hxx>
+#include <DataSeries.hxx>
+#include <GridProperties.hxx>
#include <TitleHelper.hxx>
#include <TitleItemConverter.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XDataSeries.hpp>
-#include <com/sun/star/chart2/XTitle.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/chart2/XAxis.hpp>
+#include <ChartView.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
namespace chart::wrapper {
@@ -48,16 +44,16 @@ AllAxisItemConverter::AllAxisItemConverter(
const rtl::Reference<::chart::ChartModel> & xChartModel,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const awt::Size* pRefSize )
+ const std::optional<awt::Size>& pRefSize )
: MultipleItemConverter( rItemPool )
{
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
- const Sequence< Reference< XAxis > > aElementList( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( Reference< XAxis > const & axis : aElementList )
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
+ const std::vector< rtl::Reference< Axis > > aElementList = AxisHelper::getAllAxesOfDiagram( xDiagram );
+ for( rtl::Reference< Axis > const & axis : aElementList )
{
- uno::Reference< beans::XPropertySet > xObjectProperties(axis, uno::UNO_QUERY);
m_aConverters.emplace_back( new ::chart::wrapper::AxisItemConverter(
- xObjectProperties, rItemPool, rDrawModel,
+ uno::Reference< beans::XPropertySet >(axis),
+ rItemPool, rDrawModel,
xChartModel, nullptr, nullptr,
pRefSize));
}
@@ -76,16 +72,15 @@ const WhichRangesContainer& AllAxisItemConverter::GetWhichPairs() const
AllGridItemConverter::AllGridItemConverter(
const rtl::Reference<::chart::ChartModel> & xChartModel,
SfxItemPool& rItemPool,
- SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory )
+ SdrModel& rDrawModel )
: MultipleItemConverter( rItemPool )
{
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
- const Sequence< Reference< beans::XPropertySet > > aElementList( AxisHelper::getAllGrids( xDiagram ) );
- for( Reference< beans::XPropertySet > const & xObjectProperties : aElementList )
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
+ std::vector< rtl::Reference< GridProperties > > aElementList( AxisHelper::getAllGrids( xDiagram ) );
+ for( rtl::Reference< GridProperties > const & xObjectProperties : aElementList )
{
m_aConverters.emplace_back( new ::chart::wrapper::GraphicPropertyItemConverter(
- xObjectProperties, rItemPool, rDrawModel, xNamedPropertyContainerFactory,
+ xObjectProperties, rItemPool, rDrawModel, xChartModel,
::chart::wrapper::GraphicObjectType::LineProperties ) );
}
}
@@ -103,27 +98,25 @@ const WhichRangesContainer& AllGridItemConverter::GetWhichPairs() const
AllDataLabelItemConverter::AllDataLabelItemConverter(
const rtl::Reference<::chart::ChartModel> & xChartModel,
SfxItemPool& rItemPool,
- SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory )
+ SdrModel& rDrawModel )
: MultipleItemConverter( rItemPool )
{
- std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
- ::chart::ChartModelHelper::getDataSeries( xChartModel ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesList =
+ xChartModel->getDataSeries();
for (auto const& series : aSeriesList)
{
- uno::Reference< beans::XPropertySet > xObjectProperties(series, uno::UNO_QUERY);
uno::Reference< uno::XComponentContext> xContext;//do not need Context for label properties
- sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties );
- sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
- xObjectProperties,xChartModel);
+ sal_Int32 nNumberFormat = series->getExplicitNumberFormatKeyForDataLabel();
+ sal_Int32 nPercentNumberFormat=ChartView::getExplicitPercentageNumberFormatKeyForDataLabel(
+ series,xChartModel);
m_aConverters.emplace_back(
new ::chart::wrapper::DataPointItemConverter(
- xChartModel, xContext, xObjectProperties, series, rItemPool, rDrawModel,
- xNamedPropertyContainerFactory, GraphicObjectType::FilledDataPoint,
- nullptr, true, false, 0, true, nNumberFormat, nPercentNumberFormat));
+ xChartModel, xContext, series, series, rItemPool, rDrawModel,
+ GraphicObjectType::FilledDataPoint,
+ std::nullopt, true, false, 0, true, nNumberFormat, nPercentNumberFormat));
}
}
@@ -140,19 +133,18 @@ const WhichRangesContainer& AllDataLabelItemConverter::GetWhichPairs() const
AllTitleItemConverter::AllTitleItemConverter(
const rtl::Reference<::chart::ChartModel> & xChartModel,
SfxItemPool& rItemPool,
- SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory )
+ SdrModel& rDrawModel )
: MultipleItemConverter( rItemPool )
{
for(sal_Int32 nTitle = TitleHelper::TITLE_BEGIN; nTitle < TitleHelper::NORMAL_TITLE_END; nTitle++ )
{
- uno::Reference< chart2::XTitle > xTitle( TitleHelper::getTitle( TitleHelper::eTitleType(nTitle), xChartModel ) );
+ rtl::Reference< Title > xTitle( TitleHelper::getTitle( TitleHelper::eTitleType(nTitle), xChartModel ) );
if(!xTitle.is())
continue;
- uno::Reference< beans::XPropertySet > xObjectProperties( xTitle, uno::UNO_QUERY);
m_aConverters.emplace_back(
new ::chart::wrapper::TitleItemConverter(
- xObjectProperties, rItemPool, rDrawModel, xNamedPropertyContainerFactory, nullptr));
+ uno::Reference< beans::XPropertySet >( xTitle ),
+ rItemPool, rDrawModel, xChartModel, std::nullopt));
}
}
@@ -171,14 +163,13 @@ AllSeriesStatisticsConverter::AllSeriesStatisticsConverter(
SfxItemPool& rItemPool )
: MultipleItemConverter( rItemPool )
{
- std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
- ::chart::ChartModelHelper::getDataSeries( xChartModel ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesList =
+ xChartModel->getDataSeries();
for (auto const& series : aSeriesList)
{
- uno::Reference< beans::XPropertySet > xObjectProperties(series, uno::UNO_QUERY);
m_aConverters.emplace_back( new ::chart::wrapper::StatisticsItemConverter(
- xChartModel, xObjectProperties, rItemPool ));
+ xChartModel, series, rItemPool ));
}
}
diff --git a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
index f98ec6375f3b..721f1247f439 100644
--- a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
@@ -18,9 +18,12 @@
*/
#include <RegressionCurveHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include <RegressionCurveItemConverter.hxx>
#include "SchWhichPairs.hxx"
#include <GraphicPropertyItemConverter.hxx>
+#include <DataSeries.hxx>
+#include <ChartModel.hxx>
#include <com/sun/star/chart2/XRegressionCurve.hpp>
#include <osl/diagnose.h>
@@ -28,6 +31,7 @@
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
+#include <utility>
using namespace ::com::sun::star;
@@ -65,12 +69,12 @@ void lclConvertToItemSet(SfxItemSet& rItemSet, sal_uInt16 nWhichId, const uno::R
}
}
-void lclConvertToItemSetDouble(SfxItemSet& rItemSet, sal_uInt16 nWhichId, const uno::Reference<beans::XPropertySet>& xProperties, const OUString& aPropertyID)
+void lclConvertToItemSetDouble(SfxItemSet& rItemSet, TypedWhichId<SvxDoubleItem> nWhichId, const uno::Reference<beans::XPropertySet>& xProperties, const OUString& aPropertyID)
{
OSL_ASSERT(xProperties.is());
if( xProperties.is() )
{
- double aValue = static_cast<const SvxDoubleItem&>(rItemSet.Get( nWhichId )).GetValue();
+ double aValue = rItemSet.Get( nWhichId ).GetValue();
if(xProperties->getPropertyValue( aPropertyID ) >>= aValue)
{
rItemSet.Put(SvxDoubleItem( aValue, nWhichId ));
@@ -85,16 +89,16 @@ namespace chart::wrapper
RegressionCurveItemConverter::RegressionCurveItemConverter(
const uno::Reference< beans::XPropertySet >& rPropertySet,
- const uno::Reference< chart2::XRegressionCurveContainer >& xContainer,
+ rtl::Reference< DataSeries > xContainer,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory ) :
+ const rtl::Reference< ChartModel > & xChartModel ) :
ItemConverter( rPropertySet, rItemPool ),
m_spGraphicConverter( std::make_shared<GraphicPropertyItemConverter>(
rPropertySet, rItemPool, rDrawModel,
- xNamedPropertyContainerFactory,
+ xChartModel,
GraphicObjectType::LineProperties )),
- m_xCurveContainer( xContainer )
+ m_xCurveContainer(std::move( xContainer ))
{}
RegressionCurveItemConverter::~RegressionCurveItemConverter()
@@ -166,84 +170,84 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
case SCHATTR_REGRESSION_DEGREE:
{
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, "PolynomialDegree");
+ bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, u"PolynomialDegree"_ustr);
}
break;
case SCHATTR_REGRESSION_PERIOD:
{
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, "MovingAveragePeriod");
+ bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, u"MovingAveragePeriod"_ustr);
}
break;
case SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD:
{
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, "ExtrapolateForward");
+ bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, u"ExtrapolateForward"_ustr);
}
break;
case SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD:
{
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, "ExtrapolateBackward");
+ bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, u"ExtrapolateBackward"_ustr);
}
break;
case SCHATTR_REGRESSION_SET_INTERCEPT:
{
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xProperties, "ForceIntercept");
+ bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xProperties, u"ForceIntercept"_ustr);
}
break;
case SCHATTR_REGRESSION_INTERCEPT_VALUE:
{
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, "InterceptValue");
+ bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, u"InterceptValue"_ustr);
}
break;
case SCHATTR_REGRESSION_CURVE_NAME:
{
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xProperties, "CurveName");
+ bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xProperties, u"CurveName"_ustr);
}
break;
case SCHATTR_REGRESSION_MOVING_TYPE:
{
uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, "MovingAverageType");
+ bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, u"MovingAverageType"_ustr);
}
break;
case SCHATTR_REGRESSION_SHOW_EQUATION:
{
uno::Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties());
- bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, "ShowEquation");
+ bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, u"ShowEquation"_ustr);
}
break;
case SCHATTR_REGRESSION_XNAME:
{
uno::Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties());
- bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xEqProp, "XName");
+ bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xEqProp, u"XName"_ustr);
}
break;
case SCHATTR_REGRESSION_YNAME:
{
uno::Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties());
- bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xEqProp, "YName");
+ bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xEqProp, u"YName"_ustr);
}
break;
case SCHATTR_REGRESSION_SHOW_COEFF:
{
uno::Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties());
- bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, "ShowCorrelationCoefficient");
+ bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, u"ShowCorrelationCoefficient"_ustr);
}
break;
@@ -271,73 +275,73 @@ void RegressionCurveItemConverter::FillSpecialItem(sal_uInt16 nWhichId, SfxItemS
case SCHATTR_REGRESSION_DEGREE:
{
- lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, "PolynomialDegree");
+ lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, u"PolynomialDegree"_ustr);
}
break;
case SCHATTR_REGRESSION_PERIOD:
{
- lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, "MovingAveragePeriod");
+ lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, u"MovingAveragePeriod"_ustr);
}
break;
case SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD:
{
- lclConvertToItemSetDouble(rOutItemSet, nWhichId, xProperties, "ExtrapolateForward");
+ lclConvertToItemSetDouble(rOutItemSet, SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD, xProperties, u"ExtrapolateForward"_ustr);
}
break;
case SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD:
{
- lclConvertToItemSetDouble(rOutItemSet, nWhichId, xProperties, "ExtrapolateBackward");
+ lclConvertToItemSetDouble(rOutItemSet, SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD, xProperties, u"ExtrapolateBackward"_ustr);
}
break;
case SCHATTR_REGRESSION_SET_INTERCEPT:
{
- lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xProperties, "ForceIntercept");
+ lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xProperties, u"ForceIntercept"_ustr);
}
break;
case SCHATTR_REGRESSION_INTERCEPT_VALUE:
{
- lclConvertToItemSetDouble(rOutItemSet, nWhichId, xProperties, "InterceptValue");
+ lclConvertToItemSetDouble(rOutItemSet, SCHATTR_REGRESSION_INTERCEPT_VALUE, xProperties, u"InterceptValue"_ustr);
}
break;
case SCHATTR_REGRESSION_CURVE_NAME:
{
- lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xProperties, "CurveName");
+ lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xProperties, u"CurveName"_ustr);
}
break;
case SCHATTR_REGRESSION_MOVING_TYPE:
{
- lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, "MovingAverageType");
+ lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, u"MovingAverageType"_ustr);
}
break;
case SCHATTR_REGRESSION_SHOW_EQUATION:
{
- lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), "ShowEquation");
+ lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), u"ShowEquation"_ustr);
}
break;
case SCHATTR_REGRESSION_XNAME:
{
- lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), "XName");
+ lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), u"XName"_ustr);
}
break;
case SCHATTR_REGRESSION_YNAME:
{
- lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), "YName");
+ lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), u"YName"_ustr);
}
break;
case SCHATTR_REGRESSION_SHOW_COEFF:
{
- lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), "ShowCorrelationCoefficient");
+ lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xCurve->getEquationProperties(), u"ShowCorrelationCoefficient"_ustr);
}
break;
}
diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
index 22fc379b2a2c..5487d8d2e757 100644
--- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
@@ -22,6 +22,7 @@
#include <ItemPropertyMap.hxx>
#include <GraphicPropertyItemConverter.hxx>
#include <CharacterPropertyItemConverter.hxx>
+#include <ChartModel.hxx>
#include <unonames.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -48,17 +49,17 @@ RegressionEquationItemConverter::RegressionEquationItemConverter(
const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
- const awt::Size* pRefSize ) :
+ const rtl::Reference< ChartModel > & xChartModel,
+ const std::optional<awt::Size>& pRefSize ) :
ItemConverter( rPropertySet, rItemPool )
{
m_aConverters.emplace_back( new GraphicPropertyItemConverter(
rPropertySet, rItemPool, rDrawModel,
- xNamedPropertyContainerFactory,
+ xChartModel,
GraphicObjectType::LineAndFillProperties ));
m_aConverters.emplace_back(
- new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize"));
+ new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, u"ReferencePageSize"_ustr));
}
RegressionEquationItemConverter::~RegressionEquationItemConverter()
diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
index 3c1387009afd..8216c4b32337 100644
--- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
+++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
@@ -59,6 +59,7 @@ const WhichRangesContainer nGridWhichPairs(svl::Items<
const WhichRangesContainer nLegendWhichPairs(svl::Items<
SCHATTR_LEGEND_START, SCHATTR_LEGEND_END, // 3 - 3 sch/schattr.hxx
+ SCHATTR_COLOR_PALETTE_START, SCHATTR_COLOR_PALETTE_END, // 107 - 107
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx
SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx
@@ -121,6 +122,7 @@ const WhichRangesContainer nRowWhichPairs(svl::Items<
SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY, SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY,
SCHATTR_BAR_OVERLAP,SCHATTR_BAR_CONNECT, /* 98 - 100 (incl. SCHATTR_GAPWIDTH) */
SCHATTR_GROUP_BARS_PER_AXIS,SCHATTR_AXIS_FOR_ALL_SERIES,
+ SCHATTR_COLOR_PALETTE_START, SCHATTR_COLOR_PALETTE_END, // 107 - 107
XATTR_LINE_FIRST, XATTR_LINE_LAST, /* 1000 - 1016 svx/xdef.hxx */
XATTR_FILL_FIRST, XATTR_FILL_LAST, /* 1018 - 1046 svx/xdef.hxx */
SDRATTR_3D_FIRST, SDRATTR_3D_LAST, /* 1244 - 1334 svx/svddef.hxx */
@@ -152,6 +154,7 @@ const WhichRangesContainer nLinePropertyWhichPairs(svl::Items<
>);
const WhichRangesContainer nLineAndFillPropertyWhichPairs(svl::Items<
+ SCHATTR_COLOR_PALETTE_START, SCHATTR_COLOR_PALETTE_END, // 107 - 107
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx
SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST // 1067 - 1078 svx/svddef.hxx
@@ -171,4 +174,11 @@ const WhichRangesContainer nRegEquationWhichPairs(svl::Items<
SID_CHAR_DLG_PREVIEW_STRING, SID_CHAR_DLG_PREVIEW_STRING // Characters
>);
+const WhichRangesContainer nDataTableWhichPairs(svl::Items<
+ SCHATTR_DATA_TABLE_START, SCHATTR_DATA_TABLE_END,
+ XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
+ XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx
+ EE_ITEMS_START, EE_ITEMS_END
+>);
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index 4d035c061b6c..96c27372090a 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -20,7 +20,8 @@
#include <SeriesOptionsItemConverter.hxx>
#include "SchWhichPairs.hxx"
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <DiagramHelper.hxx>
#include <Diagram.hxx>
@@ -29,13 +30,12 @@
#include <ChartModel.hxx>
#include <BaseCoordinateSystem.hxx>
-#include <com/sun/star/chart2/XDataSeries.hpp>
-
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
#include <svl/ilstitem.hxx>
#include <svx/sdangitm.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -45,12 +45,12 @@ namespace chart::wrapper
SeriesOptionsItemConverter::SeriesOptionsItemConverter(
const rtl::Reference<::chart::ChartModel>& xChartModel
- , const uno::Reference< uno::XComponentContext > & xContext
- , const uno::Reference< beans::XPropertySet >& xPropertySet
+ , uno::Reference< uno::XComponentContext > xContext
+ , const rtl::Reference< ::chart::DataSeries >& xDataSeries
, SfxItemPool& rItemPool )
- : ItemConverter( xPropertySet, rItemPool )
+ : ItemConverter( xDataSeries, rItemPool )
, m_xChartModel(xChartModel)
- , m_xCC(xContext)
+ , m_xCC(std::move(xContext))
, m_bAttachToMainAxis(true)
, m_bSupportingOverlapAndGapWidthProperties(false)
, m_bSupportingBarConnectors(false)
@@ -69,39 +69,37 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
{
try
{
- uno::Reference< XDataSeries > xDataSeries( xPropertySet, uno::UNO_QUERY );
-
- m_bAttachToMainAxis = DiagramHelper::isSeriesAttachedToMainAxis( xDataSeries );
+ m_bAttachToMainAxis = xDataSeries->isAttachedToMainAxis();
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
- uno::Reference< XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xDataSeries ) );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeOfSeries( xDataSeries ) );
m_xCooSys = DataSeriesHelper::getCoordinateSystemOfSeries( xDataSeries, xDiagram );
if( m_xCooSys.is() )
{
- uno::Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 1, 0, m_xCooSys ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 1, 0, m_xCooSys );
chart2::ScaleData aScale( xAxis->getScaleData() );
m_bClockwise = (aScale.Orientation == chart2::AxisOrientation_REVERSE);
}
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
- m_bSupportingOverlapAndGapWidthProperties = ChartTypeHelper::isSupportingOverlapAndGapWidthProperties( xChartType, nDimensionCount );
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
+ m_bSupportingOverlapAndGapWidthProperties = xChartType.is() ?
+ xChartType->isSupportingOverlapAndGapWidthProperties(nDimensionCount) : false;
if( m_bSupportingOverlapAndGapWidthProperties )
{
- sal_Int32 nAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
+ sal_Int32 nAxisIndex = xDataSeries->getAttachedAxisIndex();
uno::Sequence< sal_Int32 > aBarPositionSequence;
- uno::Reference< beans::XPropertySet > xChartTypeProps( xChartType, uno::UNO_QUERY );
- if( xChartTypeProps.is() )
+ if( xChartType.is() )
{
- if( xChartTypeProps->getPropertyValue( "OverlapSequence" ) >>= aBarPositionSequence )
+ if( xChartType->getPropertyValue( u"OverlapSequence"_ustr ) >>= aBarPositionSequence )
{
if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() )
m_nBarOverlap = aBarPositionSequence[nAxisIndex];
}
- if( xChartTypeProps->getPropertyValue( "GapwidthSequence" ) >>= aBarPositionSequence )
+ if( xChartType->getPropertyValue( u"GapwidthSequence"_ustr ) >>= aBarPositionSequence )
{
if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() )
m_nGapWidth = aBarPositionSequence[nAxisIndex];
@@ -109,27 +107,26 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
}
}
- m_bSupportingBarConnectors = ChartTypeHelper::isSupportingBarConnectors( xChartType, nDimensionCount );
+ m_bSupportingBarConnectors = xChartType.is() ? xChartType->isSupportingBarConnectors(nDimensionCount) : false;
if( m_bSupportingBarConnectors && xDiagram.is() )
{
- xDiagram->getPropertyValue( "ConnectBars" ) >>= m_bConnectBars;
+ xDiagram->getPropertyValue( u"ConnectBars"_ustr ) >>= m_bConnectBars;
}
- m_bSupportingAxisSideBySide = ChartTypeHelper::isSupportingAxisSideBySide( xChartType, nDimensionCount );
+ m_bSupportingAxisSideBySide = xChartType.is() ? xChartType->isSupportingAxisSideBySide(nDimensionCount) : false;
if( m_bSupportingAxisSideBySide && xDiagram.is() )
{
- xDiagram->getPropertyValue( "GroupBarsPerAxis" ) >>= m_bGroupBarsPerAxis;
+ xDiagram->getPropertyValue( u"GroupBarsPerAxis"_ustr ) >>= m_bGroupBarsPerAxis;
}
- m_bSupportingStartingAngle = ChartTypeHelper::isSupportingStartingAngle( xChartType );
+ m_bSupportingStartingAngle = xChartType.is() ? xChartType->isSupportingStartingAngle() : false;
if( m_bSupportingStartingAngle )
{
- xDiagram->getPropertyValue( "StartingAngle" ) >>= m_nStartingAngle;
+ xDiagram->getPropertyValue( u"StartingAngle"_ustr ) >>= m_nStartingAngle;
}
m_aSupportedMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType );
- m_nMissingValueTreatment = DiagramHelper::getCorrectedMissingValueTreatment(
- ChartModelHelper::findDiagram(m_xChartModel), xChartType );
+ m_nMissingValueTreatment = xDiagram->getCorrectedMissingValueTreatment( xChartType );
uno::Reference< beans::XPropertySet > xProp( m_xChartModel->getDataProvider(), uno::UNO_QUERY );
if( xProp.is() )
@@ -137,17 +134,17 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
try
{
//test whether the data provider offers this property
- xProp->getPropertyValue( "IncludeHiddenCells" );
+ xProp->getPropertyValue( u"IncludeHiddenCells"_ustr );
//if not exception is thrown the property is offered
m_bSupportingPlottingOfHiddenCells = true;
- xDiagram->getPropertyValue( "IncludeHiddenCells" ) >>= m_bIncludeHiddenCells;
+ xDiagram->getPropertyValue( u"IncludeHiddenCells"_ustr ) >>= m_bIncludeHiddenCells;
}
catch( const beans::UnknownPropertyException& )
{
}
}
- m_bHideLegendEntry = !xPropertySet->getPropertyValue("ShowLegendEntry").get<bool>();
+ m_bHideLegendEntry = !xDataSeries->getPropertyValue(u"ShowLegendEntry"_ustr).get<bool>();
}
catch( const uno::Exception & )
{
@@ -183,8 +180,9 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
if( bAttachToMainAxis != m_bAttachToMainAxis )
{
//change model:
- bChanged = DiagramHelper::attachSeriesToAxis( bAttachToMainAxis, uno::Reference< XDataSeries >::query( GetPropertySet() )
- , ChartModelHelper::findDiagram(m_xChartModel), m_xCC );
+ rtl::Reference<DataSeries> xDataSeries = dynamic_cast<DataSeries*>( GetPropertySet().get() );
+ bChanged = m_xChartModel->getFirstChartDiagram()->attachSeriesToAxis( bAttachToMainAxis, xDataSeries
+ , m_xCC );
if( bChanged )
m_bAttachToMainAxis = bAttachToMainAxis;
@@ -200,34 +198,31 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
sal_Int32& rBarPosition = ( nWhichId == SCHATTR_BAR_OVERLAP ) ? m_nBarOverlap : m_nGapWidth;
rBarPosition = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
- OUString aPropName("GapwidthSequence" );
+ OUString aPropName(u"GapwidthSequence"_ustr );
if( nWhichId == SCHATTR_BAR_OVERLAP )
aPropName = "OverlapSequence";
- uno::Reference< XDataSeries > xDataSeries( GetPropertySet(), uno::UNO_QUERY );
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram(m_xChartModel) );
- uno::Reference< beans::XPropertySet > xChartTypeProps( DiagramHelper::getChartTypeOfSeries( xDiagram , xDataSeries ), uno::UNO_QUERY );
- if( xChartTypeProps.is() )
+ rtl::Reference< DataSeries > xDataSeries( dynamic_cast<DataSeries*>(GetPropertySet().get()) );
+ rtl::Reference< Diagram > xDiagram( m_xChartModel->getFirstChartDiagram() );
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeOfSeries( xDataSeries ) );
+ if( xChartType.is() )
{
- sal_Int32 nAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
+ sal_Int32 nAxisIndex = xDataSeries->getAttachedAxisIndex();
uno::Sequence< sal_Int32 > aBarPositionSequence;
- if( xChartTypeProps.is() )
+ if( xChartType->getPropertyValue( aPropName ) >>= aBarPositionSequence )
{
- if( xChartTypeProps->getPropertyValue( aPropName ) >>= aBarPositionSequence )
+ bool bGroupBarsPerAxis = rItemSet.Get( SCHATTR_GROUP_BARS_PER_AXIS ).GetValue();
+ if(!bGroupBarsPerAxis)
{
- bool bGroupBarsPerAxis = rItemSet.Get( SCHATTR_GROUP_BARS_PER_AXIS ).GetValue();
- if(!bGroupBarsPerAxis)
- {
- //set the same value for all axes
- for( auto & pos : asNonConstRange(aBarPositionSequence) )
- pos = rBarPosition;
- }
- else if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() )
- aBarPositionSequence.getArray()[nAxisIndex] = rBarPosition;
-
- xChartTypeProps->setPropertyValue( aPropName, uno::Any(aBarPositionSequence) );
- bChanged = true;
+ //set the same value for all axes
+ for( auto & pos : asNonConstRange(aBarPositionSequence) )
+ pos = rBarPosition;
}
+ else if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() )
+ aBarPositionSequence.getArray()[nAxisIndex] = rBarPosition;
+
+ xChartType->setPropertyValue( aPropName, uno::Any(aBarPositionSequence) );
+ bChanged = true;
}
}
}
@@ -241,12 +236,12 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
if( m_bSupportingBarConnectors )
{
bool bOldConnectBars = false;
- rtl::Reference< Diagram > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY );
+ rtl::Reference< Diagram > xDiagramProperties( m_xChartModel->getFirstChartDiagram() );
if( xDiagramProperties.is() &&
- (xDiagramProperties->getPropertyValue( "ConnectBars" ) >>= bOldConnectBars) &&
+ (xDiagramProperties->getPropertyValue( u"ConnectBars"_ustr ) >>= bOldConnectBars) &&
bOldConnectBars != m_bConnectBars )
{
- xDiagramProperties->setPropertyValue( "ConnectBars" , uno::Any(m_bConnectBars) );
+ xDiagramProperties->setPropertyValue( u"ConnectBars"_ustr , uno::Any(m_bConnectBars) );
bChanged = true;
}
}
@@ -260,12 +255,12 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
if( m_bSupportingAxisSideBySide )
{
bool bOldGroupBarsPerAxis = true;
- rtl::Reference< Diagram > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY );
+ rtl::Reference< Diagram > xDiagramProperties( m_xChartModel->getFirstChartDiagram() );
if( xDiagramProperties.is() &&
- (xDiagramProperties->getPropertyValue( "GroupBarsPerAxis" ) >>= bOldGroupBarsPerAxis) &&
+ (xDiagramProperties->getPropertyValue( u"GroupBarsPerAxis"_ustr ) >>= bOldGroupBarsPerAxis) &&
bOldGroupBarsPerAxis != m_bGroupBarsPerAxis )
{
- xDiagramProperties->setPropertyValue( "GroupBarsPerAxis" , uno::Any(m_bGroupBarsPerAxis) );
+ xDiagramProperties->setPropertyValue( u"GroupBarsPerAxis"_ustr , uno::Any(m_bGroupBarsPerAxis) );
bChanged = true;
}
}
@@ -277,10 +272,10 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
if( m_bSupportingStartingAngle )
{
m_nStartingAngle = static_cast< const SdrAngleItem & >( rItemSet.Get( nWhichId )).GetValue().get() / 100;
- rtl::Reference< Diagram > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY );
+ rtl::Reference< Diagram > xDiagramProperties( m_xChartModel->getFirstChartDiagram() );
if( xDiagramProperties.is() )
{
- xDiagramProperties->setPropertyValue( "StartingAngle" , uno::Any(m_nStartingAngle) );
+ xDiagramProperties->setPropertyValue( u"StartingAngle"_ustr , uno::Any(m_nStartingAngle) );
bChanged = true;
}
}
@@ -293,7 +288,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
rItemSet.Get( nWhichId )).GetValue();
if( m_xCooSys.is() )
{
- uno::Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 1, 0, m_xCooSys ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 1, 0, m_xCooSys );
if( xAxis.is() )
{
chart2::ScaleData aScaleData( xAxis->getScaleData() );
@@ -314,10 +309,10 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
{
try
{
- rtl::Reference< Diagram > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY );
+ rtl::Reference< Diagram > xDiagramProperties( m_xChartModel->getFirstChartDiagram() );
if( xDiagramProperties.is() )
{
- xDiagramProperties->setPropertyValue( "MissingValueTreatment" , uno::Any( nNew ));
+ xDiagramProperties->setPropertyValue( u"MissingValueTreatment"_ustr , uno::Any( nNew ));
bChanged = true;
}
}
@@ -337,7 +332,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
if (bIncludeHiddenCells != m_bIncludeHiddenCells)
{
if (m_xChartModel)
- bChanged = ChartModelHelper::setIncludeHiddenCells( bIncludeHiddenCells, *m_xChartModel );
+ bChanged = m_xChartModel->setIncludeHiddenCells( bIncludeHiddenCells );
}
}
}
@@ -347,7 +342,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
bool bHideLegendEntry = static_cast<const SfxBoolItem &>(rItemSet.Get(nWhichId)).GetValue();
if (bHideLegendEntry != m_bHideLegendEntry)
{
- GetPropertySet()->setPropertyValue("ShowLegendEntry", css::uno::makeAny(!bHideLegendEntry));
+ GetPropertySet()->setPropertyValue(u"ShowLegendEntry"_ustr, css::uno::Any(!bHideLegendEntry));
}
}
break;
@@ -397,7 +392,7 @@ void SeriesOptionsItemConverter::FillSpecialItem(
case SCHATTR_STARTING_ANGLE:
{
if( m_bSupportingStartingAngle )
- rOutItemSet.Put( SdrAngleItem(nWhichId, Degree100(m_nStartingAngle*100)) );
+ rOutItemSet.Put( SdrAngleItem(SCHATTR_STARTING_ANGLE, Degree100(m_nStartingAngle*100)) );
break;
}
case SCHATTR_CLOCKWISE:
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index a900466b85b8..99816e894396 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -20,6 +20,7 @@
#include <StatisticsItemConverter.hxx>
#include "SchWhichPairs.hxx"
#include <RegressionCurveHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include <ErrorBar.hxx>
#include <StatisticsHelper.hxx>
#include <ChartModel.hxx>
@@ -31,10 +32,10 @@
#include <rtl/math.hxx>
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
@@ -49,7 +50,7 @@ uno::Reference< beans::XPropertySet > lcl_GetErrorBar(
if( xProp.is())
try
{
- ( xProp->getPropertyValue( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X) ) >>= xResult );
+ ( xProp->getPropertyValue( bYError ? CHART_UNONAME_ERRORBAR_Y : CHART_UNONAME_ERRORBAR_X ) >>= xResult );
}
catch( const uno::Exception & )
{
@@ -72,8 +73,8 @@ void lcl_getErrorValues( const uno::Reference< beans::XPropertySet > & xErrorBar
try
{
- xErrorBarProp->getPropertyValue( "PositiveError" ) >>= rOutPosError;
- xErrorBarProp->getPropertyValue( "NegativeError" ) >>= rOutNegError;
+ xErrorBarProp->getPropertyValue( u"PositiveError"_ustr ) >>= rOutPosError;
+ xErrorBarProp->getPropertyValue( u"NegativeError"_ustr ) >>= rOutNegError;
}
catch( const uno::Exception & )
{
@@ -90,8 +91,8 @@ void lcl_getErrorIndicatorValues(
try
{
- xErrorBarProp->getPropertyValue( "ShowPositiveError" ) >>= rOutShowPosError;
- xErrorBarProp->getPropertyValue( "ShowNegativeError" ) >>= rOutShowNegError;
+ xErrorBarProp->getPropertyValue( u"ShowPositiveError"_ustr ) >>= rOutShowPosError;
+ xErrorBarProp->getPropertyValue( u"ShowNegativeError"_ustr ) >>= rOutShowNegError;
}
catch( const uno::Exception & )
{
@@ -107,10 +108,9 @@ uno::Reference< beans::XPropertySet > lcl_getEquationProperties(
// ensure that a trendline is on
if( pItemSet )
{
- const SfxPoolItem *pPoolItem = nullptr;
- if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SvxChartRegressItem* pRegressionItem = pItemSet->GetItemIfSet( SCHATTR_REGRESSION_TYPE ) )
{
- SvxChartRegress eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue();
+ SvxChartRegress eRegress = pRegressionItem->GetValue();
bEquationExists = ( eRegress != SvxChartRegress::NONE );
}
}
@@ -118,8 +118,8 @@ uno::Reference< beans::XPropertySet > lcl_getEquationProperties(
if( bEquationExists )
{
uno::Reference< chart2::XRegressionCurveContainer > xRegCnt( xSeriesPropSet, uno::UNO_QUERY );
- uno::Reference< chart2::XRegressionCurve > xCurve(
- ::chart::RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCnt ));
+ rtl::Reference< ::chart::RegressionCurveModel > xCurve =
+ ::chart::RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCnt );
if( xCurve.is())
{
return xCurve->getEquationProperties();
@@ -137,10 +137,9 @@ uno::Reference< beans::XPropertySet > lcl_getCurveProperties(
// ensure that a trendline is on
if( pItemSet )
{
- const SfxPoolItem *pPoolItem = nullptr;
- if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SvxChartRegressItem* pRegressionItem = pItemSet->GetItemIfSet( SCHATTR_REGRESSION_TYPE ) )
{
- SvxChartRegress eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue();
+ SvxChartRegress eRegress = pRegressionItem->GetValue();
bExists = ( eRegress != SvxChartRegress::NONE );
}
}
@@ -148,13 +147,10 @@ uno::Reference< beans::XPropertySet > lcl_getCurveProperties(
if( bExists )
{
uno::Reference< chart2::XRegressionCurveContainer > xRegCnt( xSeriesPropSet, uno::UNO_QUERY );
- uno::Reference< chart2::XRegressionCurve > xCurve(
+ rtl::Reference< ::chart::RegressionCurveModel > xCurve(
::chart::RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCnt ));
if( xCurve.is())
- {
- uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- return xProperties;
- }
+ return xCurve;
}
return uno::Reference< beans::XPropertySet >();
@@ -192,12 +188,12 @@ void lclConvertToItemSet(SfxItemSet& rItemSet, sal_uInt16 nWhichId, const uno::R
}
}
-void lclConvertToItemSetDouble(SfxItemSet& rItemSet, sal_uInt16 nWhichId, const uno::Reference<beans::XPropertySet>& xProperties, const OUString& aPropertyID)
+void lclConvertToItemSetDouble(SfxItemSet& rItemSet, TypedWhichId<SvxDoubleItem> nWhichId, const uno::Reference<beans::XPropertySet>& xProperties, const OUString& aPropertyID)
{
OSL_ASSERT(xProperties.is());
if( xProperties.is() )
{
- double aValue = static_cast<const SvxDoubleItem&>(rItemSet.Get( nWhichId )).GetValue();
+ double aValue = rItemSet.Get( nWhichId ).GetValue();
if(xProperties->getPropertyValue( aPropertyID ) >>= aValue)
{
rItemSet.Put(SvxDoubleItem( aValue, nWhichId ));
@@ -211,11 +207,11 @@ namespace chart::wrapper
{
StatisticsItemConverter::StatisticsItemConverter(
- const rtl::Reference<::chart::ChartModel> & xModel,
+ rtl::Reference<::chart::ChartModel> xModel,
const uno::Reference< beans::XPropertySet > & rPropertySet,
SfxItemPool& rItemPool ) :
ItemConverter( rPropertySet, rItemPool ),
- m_xModel( xModel )
+ m_xModel(std::move( xModel ))
{
}
@@ -309,11 +305,11 @@ bool StatisticsItemConverter::ApplySpecialItem(
if( !xErrorBarProp.is() )
{
xErrorBarProp = lcl_GetDefaultErrorBar();
- GetPropertySet()->setPropertyValue( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X),
+ GetPropertySet()->setPropertyValue( bYError ? CHART_UNONAME_ERRORBAR_Y : CHART_UNONAME_ERRORBAR_X,
uno::Any( xErrorBarProp ));
}
- xErrorBarProp->setPropertyValue( "ErrorBarStyle" , uno::Any( nStyle ));
+ xErrorBarProp->setPropertyValue( u"ErrorBarStyle"_ustr , uno::Any( nStyle ));
bChanged = true;
}
}
@@ -340,8 +336,8 @@ bool StatisticsItemConverter::ApplySpecialItem(
! ( ::rtl::math::approxEqual( fPos, fValue ) &&
::rtl::math::approxEqual( fNeg, fValue )))
{
- xErrorBarProp->setPropertyValue( "PositiveError" , uno::Any( fValue ));
- xErrorBarProp->setPropertyValue( "NegativeError" , uno::Any( fValue ));
+ xErrorBarProp->setPropertyValue( u"PositiveError"_ustr , uno::Any( fValue ));
+ xErrorBarProp->setPropertyValue( u"NegativeError"_ustr , uno::Any( fValue ));
bChanged = true;
}
}
@@ -365,7 +361,7 @@ bool StatisticsItemConverter::ApplySpecialItem(
if( bOldHasErrorBar &&
! ::rtl::math::approxEqual( fPos, fValue ))
{
- xErrorBarProp->setPropertyValue( "PositiveError" , uno::Any( fValue ));
+ xErrorBarProp->setPropertyValue( u"PositiveError"_ustr , uno::Any( fValue ));
bChanged = true;
}
}
@@ -388,7 +384,7 @@ bool StatisticsItemConverter::ApplySpecialItem(
if( bOldHasErrorBar &&
! ::rtl::math::approxEqual( fNeg, fValue ))
{
- xErrorBarProp->setPropertyValue( "NegativeError" , uno::Any( fValue ));
+ xErrorBarProp->setPropertyValue( u"NegativeError"_ustr , uno::Any( fValue ));
bChanged = true;
}
}
@@ -436,84 +432,84 @@ bool StatisticsItemConverter::ApplySpecialItem(
case SCHATTR_REGRESSION_DEGREE:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, "PolynomialDegree");
+ bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, u"PolynomialDegree"_ustr);
}
break;
case SCHATTR_REGRESSION_PERIOD:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, "MovingAveragePeriod");
+ bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, u"MovingAveragePeriod"_ustr);
}
break;
case SCHATTR_REGRESSION_MOVING_TYPE:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, "MovingAverageType");
+ bChanged = lclConvertToPropertySet<sal_Int32, SfxInt32Item>(rItemSet, nWhichId, xProperties, u"MovingAverageType"_ustr);
}
break;
case SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, "ExtrapolateForward");
+ bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, u"ExtrapolateForward"_ustr);
}
break;
case SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, "ExtrapolateBackward");
+ bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, u"ExtrapolateBackward"_ustr);
}
break;
case SCHATTR_REGRESSION_SET_INTERCEPT:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xProperties, "ForceIntercept");
+ bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xProperties, u"ForceIntercept"_ustr);
}
break;
case SCHATTR_REGRESSION_INTERCEPT_VALUE:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, "InterceptValue");
+ bChanged = lclConvertToPropertySet<double, SvxDoubleItem>(rItemSet, nWhichId, xProperties, u"InterceptValue"_ustr);
}
break;
case SCHATTR_REGRESSION_CURVE_NAME:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xProperties, "CurveName");
+ bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xProperties, u"CurveName"_ustr);
}
break;
case SCHATTR_REGRESSION_SHOW_EQUATION:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, "ShowEquation");
+ bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, u"ShowEquation"_ustr);
}
break;
case SCHATTR_REGRESSION_XNAME:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xEqProp, "XName");
+ bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xEqProp, u"XName"_ustr);
}
break;
case SCHATTR_REGRESSION_YNAME:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xEqProp, "YName");
+ bChanged = lclConvertToPropertySet<OUString, SfxStringItem>(rItemSet, nWhichId, xEqProp, u"YName"_ustr);
}
break;
case SCHATTR_REGRESSION_SHOW_COEFF:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), &rItemSet ));
- bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, "ShowCorrelationCoefficient");
+ bChanged = lclConvertToPropertySet<bool, SfxBoolItem>(rItemSet, nWhichId, xEqProp, u"ShowCorrelationCoefficient"_ustr);
}
break;
@@ -539,8 +535,8 @@ bool StatisticsItemConverter::ApplySpecialItem(
( bShowPos != bNewIndPos ||
bShowNeg != bNewIndNeg ))
{
- xErrorBarProp->setPropertyValue( "ShowPositiveError" , uno::Any( bNewIndPos ));
- xErrorBarProp->setPropertyValue( "ShowNegativeError" , uno::Any( bNewIndNeg ));
+ xErrorBarProp->setPropertyValue( u"ShowPositiveError"_ustr , uno::Any( bNewIndPos ));
+ xErrorBarProp->setPropertyValue( u"ShowNegativeError"_ustr , uno::Any( bNewIndNeg ));
bChanged = true;
}
}
@@ -627,7 +623,7 @@ void StatisticsItemConverter::FillSpecialItem(
if( xErrorBarProp.is() )
{
sal_Int32 nStyle = 0;
- if( xErrorBarProp->getPropertyValue( "ErrorBarStyle" ) >>= nStyle )
+ if( xErrorBarProp->getPropertyValue( u"ErrorBarStyle"_ustr ) >>= nStyle )
{
switch( nStyle )
{
@@ -663,7 +659,7 @@ void StatisticsItemConverter::FillSpecialItem(
{
double fPos(0.0), fNeg(0.0);
lcl_getErrorValues( xErrorBarProp, fPos, fNeg );
- rOutItemSet.Put( SvxDoubleItem( ( fPos + fNeg ) / 2.0, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( ( fPos + fNeg ) / 2.0, SCHATTR_STAT_PERCENT ));
}
}
break;
@@ -677,7 +673,7 @@ void StatisticsItemConverter::FillSpecialItem(
{
double fPos(0.0), fNeg(0.0);
lcl_getErrorValues( xErrorBarProp, fPos, fNeg );
- rOutItemSet.Put( SvxDoubleItem( ( fPos + fNeg ) / 2.0, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( ( fPos + fNeg ) / 2.0, SCHATTR_STAT_BIGERROR ));
}
}
break;
@@ -691,7 +687,7 @@ void StatisticsItemConverter::FillSpecialItem(
{
double fPos(0.0), fNeg(0.0);
lcl_getErrorValues( xErrorBarProp, fPos, fNeg );
- rOutItemSet.Put( SvxDoubleItem( fPos, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( fPos, SCHATTR_STAT_CONSTPLUS ));
}
}
break;
@@ -705,7 +701,7 @@ void StatisticsItemConverter::FillSpecialItem(
{
double fPos(0.0), fNeg(0.0);
lcl_getErrorValues( xErrorBarProp, fPos, fNeg );
- rOutItemSet.Put( SvxDoubleItem( fNeg, nWhichId ));
+ rOutItemSet.Put( SvxDoubleItem( fNeg, SCHATTR_STAT_CONSTMINUS ));
}
}
break;
@@ -724,84 +720,84 @@ void StatisticsItemConverter::FillSpecialItem(
{
uno::Reference<beans::XPropertySet> xProperties( lcl_getCurveProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, "PolynomialDegree");
+ lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, u"PolynomialDegree"_ustr);
}
break;
case SCHATTR_REGRESSION_PERIOD:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, "MovingAveragePeriod");
+ lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, u"MovingAveragePeriod"_ustr);
}
break;
case SCHATTR_REGRESSION_MOVING_TYPE:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, "MovingAverageType");
+ lclConvertToItemSet<sal_Int32, SfxInt32Item>(rOutItemSet, nWhichId, xProperties, u"MovingAverageType"_ustr);
}
break;
case SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSetDouble(rOutItemSet, nWhichId, xProperties, "ExtrapolateForward");
+ lclConvertToItemSetDouble(rOutItemSet, SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD, xProperties, u"ExtrapolateForward"_ustr);
}
break;
case SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSetDouble(rOutItemSet, nWhichId, xProperties, "ExtrapolateBackward");
+ lclConvertToItemSetDouble(rOutItemSet, SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD, xProperties, u"ExtrapolateBackward"_ustr);
}
break;
case SCHATTR_REGRESSION_SET_INTERCEPT:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xProperties, "ForceIntercept");
+ lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xProperties, u"ForceIntercept"_ustr);
}
break;
case SCHATTR_REGRESSION_INTERCEPT_VALUE:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSetDouble(rOutItemSet, nWhichId, xProperties, "InterceptValue");
+ lclConvertToItemSetDouble(rOutItemSet, SCHATTR_REGRESSION_INTERCEPT_VALUE, xProperties, u"InterceptValue"_ustr);
}
break;
case SCHATTR_REGRESSION_CURVE_NAME:
{
uno::Reference< beans::XPropertySet > xProperties( lcl_getCurveProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xProperties, "CurveName");
+ lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xProperties, u"CurveName"_ustr);
}
break;
case SCHATTR_REGRESSION_SHOW_EQUATION:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xEqProp, "ShowEquation");
+ lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xEqProp, u"ShowEquation"_ustr);
}
break;
case SCHATTR_REGRESSION_XNAME:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xEqProp, "XName");
+ lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xEqProp, u"XName"_ustr);
}
break;
case SCHATTR_REGRESSION_YNAME:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xEqProp, "YName");
+ lclConvertToItemSet<OUString, SfxStringItem>(rOutItemSet, nWhichId, xEqProp, u"YName"_ustr);
}
break;
case SCHATTR_REGRESSION_SHOW_COEFF:
{
uno::Reference< beans::XPropertySet > xEqProp( lcl_getEquationProperties( GetPropertySet(), nullptr ));
- lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xEqProp, "ShowCorrelationCoefficient");
+ lclConvertToItemSet<bool, SfxBoolItem>(rOutItemSet, nWhichId, xEqProp, u"ShowCorrelationCoefficient"_ustr);
}
break;
diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
index 36a0686e95f7..de12adcc9739 100644
--- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
@@ -20,10 +20,11 @@
#include <TextLabelItemConverter.hxx>
#include <CharacterPropertyItemConverter.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <DataSeriesProperties.hxx>
#include <Diagram.hxx>
#include <ItemPropertyMap.hxx>
#include "SchWhichPairs.hxx"
@@ -37,7 +38,7 @@
#include <svl/stritem.hxx>
#include <svx/tabline.hxx>
#include <svx/sdangitm.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/graph.hxx>
#include <rtl/math.hxx>
@@ -46,12 +47,12 @@
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <memory>
using namespace com::sun::star;
using namespace com::sun::star::chart2;
using com::sun::star::uno::Reference;
+using namespace ::chart::DataSeriesProperties;
namespace chart::wrapper {
@@ -100,7 +101,7 @@ bool numberFormatFromItemToPropertySet(
if (!xPropertySet.is())
return bChanged;
- OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat");
+ OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? CHART_UNONAME_NUMFMT : u"PercentageNumberFormat"_ustr;
sal_uInt16 nSourceWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE;
if (rItemSet.GetItemState(nSourceWhich) != SfxItemState::SET)
@@ -125,11 +126,11 @@ bool numberFormatFromItemToPropertySet(
uno::Any aOldValue = xPropertySet->getPropertyValue(aPropertyName);
if (bOverwriteDataPoints)
{
- Reference<chart2::XDataSeries> xSeries(xPropertySet, uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries( dynamic_cast<DataSeries*>(xPropertySet.get()) );
if (aValue != aOldValue ||
- ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, aPropertyName, aOldValue))
+ xSeries->hasAttributedDataPointDifferentValue(aPropertyName, aOldValue))
{
- ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, aPropertyName, aValue);
+ xSeries->setPropertyAlsoToAllAttributedDataPoints(aPropertyName, aValue);
bChanged = true;
}
}
@@ -148,7 +149,7 @@ bool useSourceFormatFromItemToPropertySet(
bool bChanged = false;
if (!xPropertySet.is())
return bChanged;
- OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat");
+ OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? CHART_UNONAME_NUMFMT : u"PercentageNumberFormat"_ustr;
sal_uInt16 nFormatWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE;
if (rItemSet.GetItemState(nWhichId) != SfxItemState::SET)
@@ -175,11 +176,11 @@ bool useSourceFormatFromItemToPropertySet(
uno::Any aOldValue(xPropertySet->getPropertyValue(aPropertyName));
if (bOverwriteDataPoints)
{
- Reference<chart2::XDataSeries> xSeries(xPropertySet, uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(xPropertySet.get()));
if (aNewValue != aOldValue ||
- ::chart::DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, aPropertyName, aOldValue))
+ xSeries->hasAttributedDataPointDifferentValue(aPropertyName, aOldValue))
{
- ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, aPropertyName, aNewValue);
+ xSeries->setPropertyAlsoToAllAttributedDataPoints(aPropertyName, aNewValue);
bChanged = true;
}
}
@@ -197,8 +198,8 @@ bool useSourceFormatFromItemToPropertySet(
TextLabelItemConverter::TextLabelItemConverter(
const rtl::Reference<::chart::ChartModel>& xChartModel,
const uno::Reference<beans::XPropertySet>& rPropertySet,
- const uno::Reference<XDataSeries>& xSeries,
- SfxItemPool& rItemPool, const awt::Size* pRefSize,
+ const rtl::Reference<DataSeries>& xSeries,
+ SfxItemPool& rItemPool, const std::optional<awt::Size>& pRefSize,
bool bDataSeries, sal_Int32 nNumberFormat, sal_Int32 nPercentNumberFormat ) :
ItemConverter(rPropertySet, rItemPool),
mnNumberFormat(nNumberFormat),
@@ -207,16 +208,16 @@ TextLabelItemConverter::TextLabelItemConverter(
mbForbidPercentValue(true),
m_xSeries(xSeries)
{
- maConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize"));
+ maConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, u"ReferencePageSize"_ustr));
- rtl::Reference< Diagram > xDiagram(ChartModelHelper::findDiagram(xChartModel));
- uno::Reference<XChartType> xChartType(DiagramHelper::getChartTypeOfSeries(xDiagram, xSeries));
+ rtl::Reference< Diagram > xDiagram(xChartModel->getFirstChartDiagram());
+ rtl::Reference< ChartType > xChartType(xDiagram->getChartTypeOfSeries(xSeries));
bool bFound = false;
bool bAmbiguous = false;
- bool bSwapXAndY = DiagramHelper::getVertical(xDiagram, bFound, bAmbiguous);
+ bool bSwapXAndY = xDiagram->getVertical(bFound, bAmbiguous);
maAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements(xChartType, bSwapXAndY, xSeries);
- mbForbidPercentValue = ChartTypeHelper::getAxisType(xChartType, 0) != AxisType::CATEGORY;
+ mbForbidPercentValue = xChartType.is() ? xChartType->getAxisType(0) != AxisType::CATEGORY : false;
}
TextLabelItemConverter::~TextLabelItemConverter()
@@ -287,12 +288,12 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
rValue = rItem.GetValue();
if (mbDataSeries)
{
- Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get()));
if (bOldValue != bool(rValue) ||
- DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, CHART_UNONAME_LABEL, aOldValue))
+ xSeries->hasAttributedDataPointDifferentValue(CHART_UNONAME_LABEL, aOldValue))
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, CHART_UNONAME_LABEL, uno::Any(aLabel));
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
+ xSeries->setPropertyAlsoToAllAttributedDataPoints(CHART_UNONAME_LABEL, uno::Any(aLabel));
+ xSeries->setPropertyAlsoToAllAttributedDataPoints(CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
bChanged = true;
}
}
@@ -322,20 +323,20 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
try
{
OUString aOldValue;
- GetPropertySet()->getPropertyValue("LabelSeparator") >>= aOldValue;
+ GetPropertySet()->getPropertyValue(u"LabelSeparator"_ustr) >>= aOldValue;
if (mbDataSeries)
{
- Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get()));
if (aOldValue != aNewValue ||
- DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, "LabelSeparator", uno::Any(aOldValue)))
+ xSeries->hasAttributedDataPointDifferentValue(u"LabelSeparator"_ustr, uno::Any(aOldValue)))
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, "LabelSeparator", uno::Any(aNewValue));
+ xSeries->setPropertyAlsoToAllAttributedDataPoints(u"LabelSeparator"_ustr, uno::Any(aNewValue));
bChanged = true;
}
}
else if (aOldValue != aNewValue)
{
- GetPropertySet()->setPropertyValue("LabelSeparator", uno::Any(aNewValue));
+ GetPropertySet()->setPropertyValue(u"LabelSeparator"_ustr, uno::Any(aNewValue));
bChanged = true;
}
}
@@ -352,20 +353,20 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
{
bool bNew = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue();
bool bOld = false;
- GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bOld;
+ GetPropertySet()->getPropertyValue( u"TextWordWrap"_ustr ) >>= bOld;
if( mbDataSeries )
{
- Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
+ rtl::Reference< DataSeries > xSeries( dynamic_cast<DataSeries*>(GetPropertySet().get()) );
if( bOld!=bNew ||
- DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, "TextWordWrap", uno::Any( bOld ) ) )
+ xSeries->hasAttributedDataPointDifferentValue( u"TextWordWrap"_ustr, uno::Any( bOld ) ) )
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "TextWordWrap", uno::Any( bNew ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"TextWordWrap"_ustr, uno::Any( bNew ) );
bChanged = true;
}
}
else if( bOld!=bNew )
{
- GetPropertySet()->setPropertyValue( "TextWordWrap", uno::Any( bNew ));
+ GetPropertySet()->setPropertyValue( u"TextWordWrap"_ustr, uno::Any( bNew ));
bChanged = true;
}
}
@@ -382,21 +383,22 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
sal_Int32 nNew = static_cast<const SfxInt32Item&>(rItemSet.Get(nWhichId)).GetValue();
sal_Int32 nOld = -1;
RelativePosition aCustomLabelPosition;
- GetPropertySet()->getPropertyValue("LabelPlacement") >>= nOld;
+ GetPropertySet()->getPropertyValue(u"LabelPlacement"_ustr) >>= nOld;
if (mbDataSeries)
{
- Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY);
+ rtl::Reference<DataSeries> xSeries(dynamic_cast<DataSeries*>(GetPropertySet().get()));
if (nOld != nNew ||
- DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, "LabelPlacement", uno::Any(nOld)))
+ xSeries->hasAttributedDataPointDifferentValue(u"LabelPlacement"_ustr, uno::Any(nOld)))
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, "LabelPlacement", uno::Any(nNew));
+ xSeries->setPropertyAlsoToAllAttributedDataPoints(u"LabelPlacement"_ustr, uno::Any(nNew));
bChanged = true;
}
}
- else if (nOld != nNew || (GetPropertySet()->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition))
+ else if (nOld != nNew || (GetPropertySet()->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition))
{
- GetPropertySet()->setPropertyValue("LabelPlacement", uno::Any(nNew));
- GetPropertySet()->setPropertyValue("CustomLabelPosition", uno::Any());
+ GetPropertySet()->setPropertyValue(u"LabelPlacement"_ustr, uno::Any(nNew));
+ GetPropertySet()->setPropertyValue(u"CustomLabelPosition"_ustr, uno::Any());
+ GetPropertySet()->setPropertyValue(u"CustomLabelSize"_ustr, uno::Any());
bChanged = true;
}
}
@@ -413,7 +415,7 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
rItemSet.Get(nWhichId)).GetValue();
chart2::Symbol aSymbol;
- GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol;
+ GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol;
sal_Int32 nOldStyle = getSymbolStyleForSymbol(aSymbol);
if (nStyle != nOldStyle)
@@ -440,9 +442,9 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
}
if (bDeleteSymbol)
- GetPropertySet()->setPropertyValue("Symbol", uno::Any());
+ GetPropertySet()->setPropertyValue(u"Symbol"_ustr, uno::Any());
else
- GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol));
+ GetPropertySet()->setPropertyValue(u"Symbol"_ustr, uno::Any(aSymbol));
bChanged = true;
}
}
@@ -453,14 +455,14 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
rItemSet.Get(nWhichId)).GetSize();
chart2::Symbol aSymbol;
- GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol;
+ GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol;
if (aSize.getWidth() != aSymbol.Size.Width ||
aSize.getHeight() != aSymbol.Size.Height)
{
aSymbol.Size.Width = aSize.getWidth();
aSymbol.Size.Height = aSize.getHeight();
- GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol));
+ GetPropertySet()->setPropertyValue(u"Symbol"_ustr, uno::Any(aSymbol));
bChanged = true;
}
}
@@ -478,11 +480,11 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
{
aXGraphicAny <<= xGraphic;
chart2::Symbol aSymbol;
- GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol;
+ GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol;
if (aSymbol.Graphic != xGraphic)
{
- aSymbol.Graphic = xGraphic;
- GetPropertySet()->setPropertyValue("Symbol", uno::Any(aSymbol));
+ aSymbol.Graphic = std::move(xGraphic);
+ GetPropertySet()->setPropertyValue(u"Symbol"_ustr, uno::Any(aSymbol));
bChanged = true;
}
}
@@ -496,11 +498,11 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
rItemSet.Get(nWhichId)).GetValue().get()) / 100.0;
double fOldValue = 0.0;
bool bPropExisted =
- (GetPropertySet()->getPropertyValue("TextRotation") >>= fOldValue);
+ (GetPropertySet()->getPropertyValue(u"TextRotation"_ustr) >>= fOldValue);
if (!bPropExisted || fOldValue != fValue)
{
- GetPropertySet()->setPropertyValue("TextRotation", uno::Any(fValue));
+ GetPropertySet()->setPropertyValue(u"TextRotation"_ustr, uno::Any(fValue));
bChanged = true;
}
}
@@ -511,10 +513,9 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
{
bool bNew = static_cast<const SfxBoolItem&>(rItemSet.Get(nWhichId)).GetValue();
bool bOld = true;
- Reference<beans::XPropertySet> xSeriesProp(m_xSeries, uno::UNO_QUERY);
- if( (xSeriesProp->getPropertyValue("ShowCustomLeaderLines") >>= bOld) && bOld != bNew )
+ if( (m_xSeries->getFastPropertyValue(PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES) >>= bOld) && bOld != bNew )
{
- xSeriesProp->setPropertyValue("ShowCustomLeaderLines", uno::Any(bNew));
+ m_xSeries->setFastPropertyValue(PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES, uno::Any(bNew));
bChanged = true;
}
}
@@ -549,13 +550,13 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
rOutItemSet.Put(SfxBoolItem(nWhichId, bValue));
- if (mbDataSeries)
+ DataSeries* pDataSeries = mbDataSeries
+ ? dynamic_cast<DataSeries*>(GetPropertySet().get())
+ : nullptr;
+ if (pDataSeries && pDataSeries->hasAttributedDataPointDifferentValue(
+ CHART_UNONAME_LABEL, uno::Any(aLabel)))
{
- if (DataSeriesHelper::hasAttributedDataPointDifferentValue(
- Reference<chart2::XDataSeries>(GetPropertySet(), uno::UNO_QUERY), CHART_UNONAME_LABEL, uno::Any(aLabel)))
- {
- rOutItemSet.InvalidateItem(nWhichId);
- }
+ rOutItemSet.InvalidateItem(nWhichId);
}
}
}
@@ -571,7 +572,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
case SCHATTR_PERCENT_NUMBERFORMAT_VALUE:
{
sal_Int32 nKey = 0;
- if (!(GetPropertySet()->getPropertyValue("PercentageNumberFormat") >>= nKey))
+ if (!(GetPropertySet()->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= nKey))
nKey = mnPercentNumberFormat;
rOutItemSet.Put(SfxUInt32Item(nWhichId, nKey));
}
@@ -602,7 +603,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
{
TOOLS_WARN_EXCEPTION("chart2", "");
}
- bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue("PercentageNumberFormat").hasValue() && !bUseSourceFormat;
+ bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(u"PercentageNumberFormat"_ustr).hasValue() && !bUseSourceFormat;
rOutItemSet.Put(SfxBoolItem(nWhichId, !bNumberFormatIsSet));
}
break;
@@ -611,7 +612,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
try
{
OUString aValue;
- GetPropertySet()->getPropertyValue("LabelSeparator") >>= aValue;
+ GetPropertySet()->getPropertyValue(u"LabelSeparator"_ustr) >>= aValue;
rOutItemSet.Put(SfxStringItem(nWhichId, aValue));
}
catch (const uno::Exception&)
@@ -625,7 +626,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
try
{
bool bValue = false;
- GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bValue;
+ GetPropertySet()->getPropertyValue( u"TextWordWrap"_ustr ) >>= bValue;
rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
}
catch( const uno::Exception& )
@@ -640,9 +641,9 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
{
sal_Int32 nPlacement = 0;
RelativePosition aCustomLabelPosition;
- if (!mbDataSeries && (GetPropertySet()->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition))
+ if (!mbDataSeries && (GetPropertySet()->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition))
rOutItemSet.Put(SfxInt32Item(nWhichId, css::chart::DataLabelPlacement::CUSTOM));
- else if (GetPropertySet()->getPropertyValue("LabelPlacement") >>= nPlacement)
+ else if (GetPropertySet()->getPropertyValue(u"LabelPlacement"_ustr) >>= nPlacement)
rOutItemSet.Put(SfxInt32Item(nWhichId, nPlacement));
else if (maAvailableLabelPlacements.hasElements())
rOutItemSet.Put(SfxInt32Item(nWhichId, maAvailableLabelPlacements[0]));
@@ -668,8 +669,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
try
{
bool bValue = true;
- Reference<beans::XPropertySet> xSeriesProp(m_xSeries, uno::UNO_QUERY);
- if( xSeriesProp->getPropertyValue( "ShowCustomLeaderLines" ) >>= bValue )
+ if( m_xSeries->getFastPropertyValue( PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES ) >>= bValue )
rOutItemSet.Put(SfxBoolItem(nWhichId, bValue));
}
catch (const uno::Exception&)
@@ -681,14 +681,14 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
case SCHATTR_STYLE_SYMBOL:
{
chart2::Symbol aSymbol;
- if (GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol)
+ if (GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol)
rOutItemSet.Put(SfxInt32Item(nWhichId, getSymbolStyleForSymbol(aSymbol)));
}
break;
case SCHATTR_SYMBOL_SIZE:
{
chart2::Symbol aSymbol;
- if (GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol)
+ if (GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol)
rOutItemSet.Put(
SvxSizeItem(nWhichId, Size(aSymbol.Size.Width, aSymbol.Size.Height)));
}
@@ -696,7 +696,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
case SCHATTR_SYMBOL_BRUSH:
{
chart2::Symbol aSymbol;
- if ((GetPropertySet()->getPropertyValue("Symbol") >>= aSymbol)
+ if ((GetPropertySet()->getPropertyValue(u"Symbol"_ustr) >>= aSymbol)
&& aSymbol.Graphic.is())
{
rOutItemSet.Put(
@@ -708,10 +708,10 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r
{
double fValue = 0;
- if (GetPropertySet()->getPropertyValue("TextRotation") >>= fValue)
+ if (GetPropertySet()->getPropertyValue(u"TextRotation"_ustr) >>= fValue)
{
rOutItemSet.Put(
- SdrAngleItem(nWhichId, Degree100(static_cast<sal_Int32>(rtl::math::round(fValue * 100.0)))));
+ SdrAngleItem(SCHATTR_TEXT_DEGREES, Degree100(static_cast<sal_Int32>(rtl::math::round(fValue * 100.0)))));
}
}
break;
diff --git a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
index 605eb07b4692..23341ac287bd 100644
--- a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
@@ -23,6 +23,7 @@
#include <GraphicPropertyItemConverter.hxx>
#include <CharacterPropertyItemConverter.hxx>
#include <MultipleItemConverter.hxx>
+#include <ChartModel.hxx>
#include <svx/sdangitm.hxx>
#include <rtl/math.hxx>
@@ -50,7 +51,7 @@ public:
FormattedStringsConverter(
const uno::Sequence< uno::Reference< chart2::XFormattedString > > & aStrings,
SfxItemPool & rItemPool,
- const awt::Size* pRefSize,
+ const std::optional<awt::Size>& pRefSize,
const uno::Reference< beans::XPropertySet > & xParentProp );
protected:
@@ -62,7 +63,7 @@ protected:
FormattedStringsConverter::FormattedStringsConverter(
const uno::Sequence< uno::Reference< chart2::XFormattedString > > & aStrings,
SfxItemPool & rItemPool,
- const awt::Size* pRefSize,
+ const std::optional<awt::Size>& pRefSize,
const uno::Reference< beans::XPropertySet > & xParentProp ) :
MultipleItemConverter( rItemPool )
{
@@ -75,7 +76,7 @@ FormattedStringsConverter::FormattedStringsConverter(
if( bHasRefSize )
m_aConverters.emplace_back(
new CharacterPropertyItemConverter(
- xProp, rItemPool, pRefSize, "ReferencePageSize", xParentProp));
+ xProp, rItemPool, pRefSize, u"ReferencePageSize"_ustr, xParentProp));
else
m_aConverters.emplace_back( new CharacterPropertyItemConverter( xProp, rItemPool ));
}
@@ -91,13 +92,13 @@ TitleItemConverter::TitleItemConverter(
const uno::Reference<beans::XPropertySet> & rPropertySet,
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
- const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
- const awt::Size* pRefSize ) :
+ const rtl::Reference< ChartModel > & xChartModel,
+ const std::optional<awt::Size>& pRefSize ) :
ItemConverter( rPropertySet, rItemPool )
{
m_aConverters.emplace_back( new GraphicPropertyItemConverter(
rPropertySet, rItemPool, rDrawModel,
- xNamedPropertyContainerFactory,
+ xChartModel,
GraphicObjectType::LineAndFillProperties ));
// CharacterProperties are not at the title but at its contained XFormattedString objects
@@ -171,11 +172,11 @@ bool TitleItemConverter::ApplySpecialItem(
rItemSet.Get( nWhichId )).GetValue().get()) / 100.0;
double fOldVal = 0.0;
bool bPropExisted =
- ( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fOldVal );
+ ( GetPropertySet()->getPropertyValue( u"TextRotation"_ustr ) >>= fOldVal );
if( ! bPropExisted || fOldVal != fVal )
{
- GetPropertySet()->setPropertyValue( "TextRotation" , uno::Any( fVal ));
+ GetPropertySet()->setPropertyValue( u"TextRotation"_ustr , uno::Any( fVal ));
bChanged = true;
}
}
@@ -195,9 +196,9 @@ void TitleItemConverter::FillSpecialItem(
// convert double to int (times 100)
double fVal = 0;
- if( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fVal )
+ if( GetPropertySet()->getPropertyValue( u"TextRotation"_ustr ) >>= fVal )
{
- rOutItemSet.Put( SdrAngleItem( nWhichId, Degree100(static_cast< sal_Int32 >(
+ rOutItemSet.Put( SdrAngleItem( SCHATTR_TEXT_DEGREES, Degree100(static_cast< sal_Int32 >(
::rtl::math::round( fVal * 100.0 ) ) )));
}
}
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 5a25f761e896..02321610fe93 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -22,22 +22,22 @@
#include <config_wasm_strip.h>
#include <ChartController.hxx>
+#include <ChartView.hxx>
#include <servicenames.hxx>
#include <ResId.hxx>
#include <dlg_DataSource.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
-#include "ControllerCommandDispatch.hxx"
+#include <ChartType.hxx>
+#include <ControllerCommandDispatch.hxx>
+#include <DataSeries.hxx>
#include <Diagram.hxx>
#include <strings.hrc>
-#include <chartview/ExplicitValueProvider.hxx>
#include <ChartViewHelper.hxx>
#include <ChartWindow.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include <DrawViewWrapper.hxx>
#include <ObjectIdentifier.hxx>
-#include <DiagramHelper.hxx>
#include <ControllerLockGuard.hxx>
#include "UndoGuard.hxx"
#include "ChartDropTargetHelper.hxx"
@@ -51,42 +51,38 @@
#include "UndoActions.hxx"
#include <ViewElementListProvider.hxx>
-#include <cppuhelper/supportsservice.hxx>
-#include <comphelper/servicehelper.hxx>
+#include <comphelper/dispatchcommand.hxx>
#include <BaseCoordinateSystem.hxx>
-#include <com/sun/star/awt/XWindowPeer.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/util/CloseVetoException.hpp>
-#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/frame/LayoutManagerEvents.hpp>
#include <com/sun/star/frame/XLayoutManagerEventBroadcaster.hpp>
-#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <com/sun/star/ui/XSidebar.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDataProviderAccess.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <sal/log.hxx>
#include <tools/debug.hxx>
#include <svx/sidebar/SelectionChangeHandler.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <osl/mutex.hxx>
+#include <comphelper/lok.hxx>
#include <sfx2/sidebar/SidebarController.hxx>
-
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
// this is needed to properly destroy the unique_ptr to the AcceleratorExecute
// object in the DTOR
#include <svtools/acceleratorexecute.hxx>
#include <svx/ActionDescriptionProvider.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+
+#include <editeng/fontitem.hxx>
// enable the following define to let the controller listen to model changes and
// react on this by rebuilding the view
@@ -101,10 +97,10 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-ChartController::ChartController(uno::Reference<uno::XComponentContext> const & xContext) :
+ChartController::ChartController(uno::Reference<uno::XComponentContext> xContext) :
m_aLifeTimeManager( nullptr ),
m_bSuspended( false ),
- m_xCC(xContext),
+ m_xCC(std::move(xContext)),
m_aModel( nullptr, m_aModelMutex ),
m_eDragMode(SdrDragMode::Move),
m_aDoubleClickTimer("chart2 ChartController m_aDoubleClickTimer"),
@@ -127,8 +123,8 @@ ChartController::~ChartController()
stopDoubleClickWaiting();
}
-ChartController::TheModel::TheModel( const rtl::Reference<::chart::ChartModel> & xModel ) :
- m_xModel( xModel ),
+ChartController::TheModel::TheModel( rtl::Reference<::chart::ChartModel> xModel ) :
+ m_xModel(std::move( xModel )),
m_bOwnership( true )
{
}
@@ -231,20 +227,17 @@ bool ChartController::TheModelRef::is() const
namespace {
-css::uno::Reference<css::chart2::XChartType> getChartType(
- const rtl::Reference<ChartModel>& xChartDoc)
+rtl::Reference<ChartType> getChartType(const rtl::Reference<ChartModel>& xChartDoc)
{
rtl::Reference<Diagram > xDiagram = xChartDoc->getFirstChartDiagram();
if (!xDiagram.is())
- return css::uno::Reference<css::chart2::XChartType>();
+ return nullptr;
const std::vector< rtl::Reference< BaseCoordinateSystem > > xCooSysSequence( xDiagram->getBaseCoordinateSystems());
if (xCooSysSequence.empty())
- return css::uno::Reference<css::chart2::XChartType>();
-
- Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xCooSysSequence[0]->getChartTypes() );
+ return nullptr;
- return xChartTypeSequence[0];
+ return xCooSysSequence[0]->getChartTypes2()[0];
}
}
@@ -256,42 +249,49 @@ OUString ChartController::GetContextName()
uno::Any aAny = getSelection();
if (!aAny.hasValue())
- return "Chart";
+ return u"Chart"_ustr;
OUString aCID;
aAny >>= aCID;
if (aCID.isEmpty())
- return "Chart";
+ return u"Chart"_ustr;
ObjectType eObjectID = ObjectIdentifier::getObjectType(aCID);
switch (eObjectID)
{
case OBJECTTYPE_DATA_SERIES:
- return "Series";
+ return u"Series"_ustr;
case OBJECTTYPE_DATA_ERRORS_X:
case OBJECTTYPE_DATA_ERRORS_Y:
case OBJECTTYPE_DATA_ERRORS_Z:
- return "ErrorBar";
+ return u"ErrorBar"_ustr;
case OBJECTTYPE_AXIS:
- return "Axis";
+ return u"Axis"_ustr;
case OBJECTTYPE_GRID:
- return "Grid";
+ return u"Grid"_ustr;
case OBJECTTYPE_DIAGRAM:
{
- css::uno::Reference<css::chart2::XChartType> xChartType = getChartType(getChartModel());
+ rtl::Reference<ChartType> xChartType = getChartType(getChartModel());
if (xChartType.is() && xChartType->getChartType() == "com.sun.star.chart2.PieChartType")
- return "ChartElements";
+ return u"ChartElements"_ustr;
break;
}
case OBJECTTYPE_DATA_CURVE:
case OBJECTTYPE_DATA_AVERAGE_LINE:
- return "Trendline";
+ return u"Trendline"_ustr;
+ case OBJECTTYPE_TITLE:
+ return u"ChartTitle"_ustr;
+ case OBJECTTYPE_LEGEND:
+ return u"ChartLegend"_ustr;
+ case OBJECTTYPE_DATA_LABEL:
+ case OBJECTTYPE_DATA_LABELS:
+ return u"ChartLabel"_ustr;
default:
break;
}
- return "Chart";
+ return u"Chart"_ustr;
}
// private methods
@@ -309,27 +309,6 @@ bool ChartController::impl_isDisposedOrSuspended() const
return false;
}
-// lang::XServiceInfo
-
-OUString SAL_CALL ChartController::getImplementationName()
-{
- return CHART_CONTROLLER_SERVICE_IMPLEMENTATION_NAME;
-}
-
-sal_Bool SAL_CALL ChartController::supportsService( const OUString& rServiceName )
-{
- return cppu::supportsService(this, rServiceName);
-}
-
-css::uno::Sequence< OUString > SAL_CALL ChartController::getSupportedServiceNames()
-{
- return {
- CHART_CONTROLLER_SERVICE_NAME,
- "com.sun.star.frame.Controller"
- //// @todo : add additional services if you support any further
- };
-}
-
namespace {
uno::Reference<ui::XSidebar> getSidebarFromModel(const uno::Reference<frame::XModel>& xModel)
@@ -365,19 +344,6 @@ void SAL_CALL ChartController::attachFrame(
if( impl_isDisposedOrSuspended() ) //@todo? allow attaching the frame while suspended?
return; //behave passive if already disposed or suspended
- mpSelectionChangeHandler->Connect();
-
- uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getModel());
- if (xSidebar.is())
- {
- auto pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get());
- assert(pSidebar);
- sfx2::sidebar::SidebarController::registerSidebarForFrame(pSidebar, this);
- pSidebar->updateModel(getModel());
- css::lang::EventObject aEvent;
- mpSelectionChangeHandler->selectionChanged(aEvent);
- }
-
if(m_xFrame.is()) //what happens, if we do have a Frame already??
{
//@todo? throw exception?
@@ -388,6 +354,20 @@ void SAL_CALL ChartController::attachFrame(
//--attach frame
m_xFrame = xFrame; //the frameloader is responsible to call xFrame->setComponent
+ // Only notify after setting the frame, otherwise notification will fail
+ mpSelectionChangeHandler->Connect();
+
+ uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getChartModel());
+ if (xSidebar.is())
+ {
+ auto pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get());
+ assert(pSidebar);
+ pSidebar->registerSidebarForFrame(this);
+ pSidebar->updateModel(getChartModel());
+ css::lang::EventObject aEvent;
+ mpSelectionChangeHandler->selectionChanged(aEvent);
+ }
+
//add as disposelistener to the frame (due to persistent reference) ??...:
//the frame is considered to be owner of this controller and will live longer than we do
@@ -429,23 +409,23 @@ void SAL_CALL ChartController::attachFrame(
try
{
uno::Reference< css::frame::XLayoutManager > xLayoutManager;
- xPropSet->getPropertyValue( "LayoutManager" ) >>= xLayoutManager;
+ xPropSet->getPropertyValue( u"LayoutManager"_ustr ) >>= xLayoutManager;
if ( xLayoutManager.is() )
{
xLayoutManager->lock();
- xLayoutManager->requestElement( "private:resource/menubar/menubar" );
+ xLayoutManager->requestElement( u"private:resource/menubar/menubar"_ustr );
//@todo: createElement should become unnecessary, remove when #i79198# is fixed
- xLayoutManager->createElement( "private:resource/toolbar/standardbar" );
- xLayoutManager->requestElement( "private:resource/toolbar/standardbar" );
+ xLayoutManager->createElement( u"private:resource/toolbar/standardbar"_ustr );
+ xLayoutManager->requestElement( u"private:resource/toolbar/standardbar"_ustr );
//@todo: createElement should become unnecessary, remove when #i79198# is fixed
- xLayoutManager->createElement( "private:resource/toolbar/toolbar" );
- xLayoutManager->requestElement( "private:resource/toolbar/toolbar" );
+ xLayoutManager->createElement( u"private:resource/toolbar/toolbar"_ustr );
+ xLayoutManager->requestElement( u"private:resource/toolbar/toolbar"_ustr );
// #i12587# support for shapes in chart
- xLayoutManager->createElement( "private:resource/toolbar/drawbar" );
- xLayoutManager->requestElement( "private:resource/toolbar/drawbar" );
+ xLayoutManager->createElement( u"private:resource/toolbar/drawbar"_ustr );
+ xLayoutManager->requestElement( u"private:resource/toolbar/drawbar"_ustr );
- xLayoutManager->requestElement( "private:resource/statusbar/statusbar" );
+ xLayoutManager->requestElement( u"private:resource/statusbar/statusbar"_ustr );
xLayoutManager->unlock();
// add as listener to get notified when
@@ -508,14 +488,11 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
if( m_aSelection.hasSelection() )
this->impl_selectObjectAndNotiy();
else
- ChartModelHelper::triggerRangeHighlighting( getChartModel() );
+ getChartModel()->triggerRangeHighlighting();
impl_initializeAccessible();
- {
- if( pChartWindow )
- pChartWindow->Invalidate();
- }
+ pChartWindow->Invalidate();
}
m_bConnectingToView = false;
@@ -546,9 +523,8 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
//--handle relations to the old model if any
if( aOldModelRef.is() )
{
- uno::Reference< util::XModeChangeBroadcaster > xViewBroadcaster( m_xChartView, uno::UNO_QUERY );
- if( xViewBroadcaster.is() )
- xViewBroadcaster->removeModeChangeListener(this);
+ if( m_xChartView.is() )
+ m_xChartView->removeModeChangeListener(this);
m_pDrawModelWrapper.reset();
aOldModelRef->removeListener( this );
@@ -568,9 +544,9 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
pDispatch->initialize();
// the dispatch container will return "this" for all commands returned by
- // impl_getAvailableCommands(). That means, for those commands dispatch()
- // is called here at the ChartController.
- m_aDispatchContainer.setChartDispatch( pDispatch, o3tl::sorted_vector(impl_getAvailableCommands()) );
+ // impl_getAvailableCommands(), and also for which ControllerCommandDispatch::commandHandled()
+ // gives true. That means, for those commands dispatch() is called here at the ChartController.
+ m_aDispatchContainer.setChartDispatch( pDispatch, impl_getAvailableCommands() );
rtl::Reference<DrawCommandDispatch> pDrawDispatch = new DrawCommandDispatch( m_xCC, this );
pDrawDispatch->initialize();
@@ -590,14 +566,12 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
// select chart area per default:
// select( uno::Any( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ) );
- uno::Reference< lang::XMultiServiceFactory > xFact( getModel(), uno::UNO_QUERY );
+ rtl::Reference< ChartModel > xFact = getChartModel();
if( xFact.is())
{
- m_xChartView = xFact->createInstance( CHART_VIEW_SERVICE_NAME );
+ m_xChartView = xFact->createChartView();
GetDrawModelWrapper();
- uno::Reference< util::XModeChangeBroadcaster > xViewBroadcaster( m_xChartView, uno::UNO_QUERY );
- if( xViewBroadcaster.is() )
- xViewBroadcaster->addModeChangeListener(this);
+ m_xChartView->addModeChangeListener(this);
}
//the frameloader is responsible to call xModel->connectController
@@ -608,8 +582,7 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
pChartWindow->Invalidate();
}
- uno::Reference< document::XUndoManagerSupplier > xSuppUndo( getModel(), uno::UNO_QUERY_THROW );
- m_xUndoManager.set( xSuppUndo->getUndoManager(), uno::UNO_SET_THROW );
+ m_xUndoManager.set( getChartModel()->getUndoManager(), uno::UNO_SET_THROW );
return true;
}
@@ -642,7 +615,7 @@ rtl::Reference<::chart::ChartModel> ChartController::getChartModel()
rtl::Reference<::chart::Diagram> ChartController::getFirstDiagram()
{
- return ChartModelHelper::findDiagram( getChartModel() );
+ return getChartModel()->getFirstChartDiagram();
}
uno::Any SAL_CALL ChartController::getViewData()
@@ -698,6 +671,24 @@ sal_Bool SAL_CALL ChartController::suspend( sal_Bool bSuspend )
return true;
}
+// css::frame::XController2
+
+css::uno::Reference<css::awt::XWindow> SAL_CALL ChartController::getComponentWindow()
+{
+ // it is a special characteristic of ChartController
+ // that it simultaneously provides the XWindow functionality
+ return this;
+}
+
+OUString SAL_CALL ChartController::getViewControllerName() { return {}; }
+
+css::uno::Sequence<css::beans::PropertyValue> SAL_CALL ChartController::getCreationArguments()
+{
+ return {};
+}
+
+css::uno::Reference<css::ui::XSidebarProvider> SAL_CALL ChartController::getSidebar() { return {}; }
+
void ChartController::impl_createDrawViewController()
{
SolarMutexGuard aGuard;
@@ -705,8 +696,21 @@ void ChartController::impl_createDrawViewController()
{
if( m_pDrawModelWrapper )
{
+ bool bLokCalcGlobalRTL = false;
+ if(comphelper::LibreOfficeKit::isActive() && AllSettings::GetLayoutRTL())
+ {
+ rtl::Reference< ChartModel > xChartModel = getChartModel();
+ if (xChartModel.is())
+ {
+ uno::Reference<css::sheet::XSpreadsheetDocument> xSSDoc(xChartModel->getParent(), uno::UNO_QUERY);
+ if (xSSDoc.is())
+ bLokCalcGlobalRTL = true;
+ }
+ }
+
m_pDrawViewWrapper.reset( new DrawViewWrapper(m_pDrawModelWrapper->getSdrModel(),GetChartWindow()->GetOutDev()) );
- m_pDrawViewWrapper->attachParentReferenceDevice( getModel() );
+ m_pDrawViewWrapper->SetNegativeX(bLokCalcGlobalRTL);
+ m_pDrawViewWrapper->attachParentReferenceDevice( getChartModel() );
}
}
}
@@ -733,10 +737,10 @@ void SAL_CALL ChartController::dispose()
if (getModel().is())
{
- uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getModel());
+ uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getChartModel());
if (sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()))
{
- sfx2::sidebar::SidebarController::unregisterSidebarForFrame(pSidebar, this);
+ pSidebar->unregisterSidebarForFrame(this);
}
}
@@ -759,7 +763,7 @@ void SAL_CALL ChartController::dispose()
if( m_aModel.is())
{
uno::Reference< view::XSelectionChangeListener > xSelectionChangeListener;
- uno::Reference< chart2::data::XDataReceiver > xDataReceiver( getModel(), uno::UNO_QUERY );
+ rtl::Reference< ChartModel > xDataReceiver = getChartModel();
if( xDataReceiver.is() )
xSelectionChangeListener.set( xDataReceiver->getRangeHighlighter(), uno::UNO_QUERY );
if( xSelectionChangeListener.is() )
@@ -772,9 +776,8 @@ void SAL_CALL ChartController::dispose()
//--release all resources and references
{
- uno::Reference< util::XModeChangeBroadcaster > xViewBroadcaster( m_xChartView, uno::UNO_QUERY );
- if( xViewBroadcaster.is() )
- xViewBroadcaster->removeModeChangeListener(this);
+ if( m_xChartView.is() )
+ m_xChartView->removeModeChangeListener(this);
impl_invalidateAccessible();
SolarMutexGuard aSolarGuard;
@@ -793,7 +796,7 @@ void SAL_CALL ChartController::dispose()
if( m_xLayoutManagerEventBroadcaster.is())
{
m_xLayoutManagerEventBroadcaster->removeLayoutManagerEventListener( this );
- m_xLayoutManagerEventBroadcaster.set( nullptr );
+ m_xLayoutManagerEventBroadcaster.clear();
}
m_xFrame.clear();
@@ -804,7 +807,7 @@ void SAL_CALL ChartController::dispose()
if( aModelRef.is())
{
- uno::Reference< frame::XModel > xModel( aModelRef->getModel() );
+ rtl::Reference< ChartModel > xModel( aModelRef->getModel() );
if(xModel.is())
xModel->disconnectController( uno::Reference< frame::XController >( this ));
@@ -839,12 +842,12 @@ void SAL_CALL ChartController::dispose()
void SAL_CALL ChartController::addEventListener(
const uno::Reference<lang::XEventListener>& xListener )
{
- SolarMutexGuard aGuard;
if( impl_isDisposedOrSuspended() )//@todo? allow adding of listeners in suspend mode?
return; //behave passive if already disposed or suspended
//--add listener
- m_aLifeTimeManager.m_aListenerContainer.addInterface( cppu::UnoType<lang::XEventListener>::get(), xListener );
+ std::unique_lock aGuard2(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aEventListeners.addInterface( aGuard2, xListener );
}
void SAL_CALL ChartController::removeEventListener(
@@ -855,7 +858,8 @@ void SAL_CALL ChartController::removeEventListener(
return; //behave passive if already disposed or suspended
//--remove listener
- m_aLifeTimeManager.m_aListenerContainer.removeInterface( cppu::UnoType<lang::XEventListener>::get(), xListener );
+ std::unique_lock aGuard2(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aEventListeners.removeInterface( aGuard2, xListener );
}
// util::XCloseListener
@@ -936,7 +940,7 @@ void SAL_CALL ChartController::disposing(
if( !impl_releaseThisModel( rSource.Source ))
{
if( rSource.Source == m_xLayoutManagerEventBroadcaster )
- m_xLayoutManagerEventBroadcaster.set( nullptr );
+ m_xLayoutManagerEventBroadcaster.clear();
}
}
@@ -950,8 +954,8 @@ void SAL_CALL ChartController::layoutEvent(
Reference< frame::XLayoutManager > xLM( aSource.Source, uno::UNO_QUERY );
if( xLM.is())
{
- xLM->createElement( "private:resource/statusbar/statusbar" );
- xLM->requestElement( "private:resource/statusbar/statusbar" );
+ xLM->createElement( u"private:resource/statusbar/statusbar"_ustr );
+ xLM->requestElement( u"private:resource/statusbar/statusbar"_ustr );
}
}
}
@@ -1024,7 +1028,7 @@ uno::Reference<frame::XDispatch> SAL_CALL
if ( !m_aLifeTimeManager.impl_isDisposed() && getModel().is() )
{
- if( !rTargetFrameName.isEmpty() && rTargetFrameName == "_self" )
+ if (rTargetFrameName.isEmpty() || rTargetFrameName == "_self")
return m_aDispatchContainer.getDispatchForURL( rURL );
}
return uno::Reference< frame::XDispatch > ();
@@ -1089,33 +1093,21 @@ void SAL_CALL ChartController::dispatch(
else if(aCommand == "FillColor")
{
if (rArgs.getLength() > 0)
- {
- sal_uInt32 nColor;
- if (rArgs[0].Value >>= nColor)
- this->executeDispatch_FillColor(nColor);
- }
+ executeDispatch_FillColor(rArgs[0].Value);
}
else if(aCommand == "XLineColor")
{
if (rArgs.getLength() > 0)
- {
- sal_Int32 nColor = -1;
- rArgs[0].Value >>= nColor;
- this->executeDispatch_LineColor(nColor);
- }
+ executeDispatch_LineColor(rArgs[0].Value);
}
else if(aCommand == "LineWidth")
{
if (rArgs.getLength() > 0)
- {
- sal_Int32 nWidth = -1;
- rArgs[0].Value >>= nWidth;
- this->executeDispatch_LineWidth(nWidth);
- }
+ executeDispatch_LineWidth(rArgs[0].Value);
}
else if(aCommand.startsWith("FillGradient"))
{
- this->executeDispatch_FillGradient(aCommand.copy(aCommand.indexOf('=') + 1));
+ this->executeDispatch_FillGradient(aCommand.subView(aCommand.indexOf('=') + 1));
}
else if(aCommand == "Paste")
this->executeDispatch_Paste();
@@ -1127,7 +1119,7 @@ void SAL_CALL ChartController::dispatch(
this->executeDispatch_SourceData();
else if(aCommand == "Update" ) //Update Chart
{
- ChartViewHelper::setViewToDirtyState( getModel() );
+ ChartViewHelper::setViewToDirtyState( getChartModel() );
SolarMutexGuard aGuard;
auto pChartWindow(GetChartWindow());
if( pChartWindow )
@@ -1160,6 +1152,8 @@ void SAL_CALL ChartController::dispatch(
this->executeDispatch_InsertErrorBars(false);
else if( aCommand == "InsertMenuYErrorBars" )
this->executeDispatch_InsertErrorBars(true);
+ else if( aCommand == "InsertMenuDataTable" )
+ this->executeDispatch_OpenInsertDataTableDialog();
else if( aCommand == "InsertSymbol" )
this->executeDispatch_InsertSpecialCharacter();
else if( aCommand == "InsertTrendline" )
@@ -1214,6 +1208,10 @@ void SAL_CALL ChartController::dispatch(
this->executeDispatch_DeleteMajorGrid();
else if( aCommand == "DeleteMinorGrid" )
this->executeDispatch_DeleteMinorGrid();
+ else if( aCommand == "InsertDataTable" )
+ this->executeDispatch_InsertDataTable();
+ else if( aCommand == "DeleteDataTable" )
+ this->executeDispatch_DeleteDataTable();
//format objects
else if( aCommand == "FormatSelection" )
this->executeDispatch_ObjectProperties();
@@ -1228,7 +1226,9 @@ void SAL_CALL ChartController::dispatch(
this->executeDispatch_PositionAndSize();
}
}
- else if( lcl_isFormatObjectCommand(aCommand) )
+ else if ( aCommand == "FontDialog" )
+ this->impl_ShapeControllerDispatch(rURL, rArgs);
+ else if (lcl_isFormatObjectCommand(aCommand))
this->executeDispatch_FormatObject(rURL.Path);
//more format
else if( aCommand == "DiagramType" )
@@ -1267,31 +1267,129 @@ void SAL_CALL ChartController::dispatch(
this->executeDispatch_ToggleGridVertical();
else if( aCommand == "ScaleText" )
this->executeDispatch_ScaleText();
- else if( aCommand == "StatusBarVisible" )
+ else if( aCommand == "Bold" || aCommand == "CharFontName" || aCommand == "FontHeight"
+ || aCommand == "Italic" || aCommand == "Underline" || aCommand == "Strikeout"
+ || aCommand == "Shadowed" || aCommand == "Color" || aCommand == "FontColor"
+ || aCommand == "Grow" || aCommand == "Shrink" || aCommand == "ResetAttributes"
+ || aCommand == "SuperScript" || aCommand == "SubScript"
+ || aCommand == "Spacing"
+ )
{
- // workaround: this should not be necessary.
- uno::Reference< beans::XPropertySet > xPropSet( m_xFrame, uno::UNO_QUERY );
- if( xPropSet.is() )
+ try
{
- uno::Reference< css::frame::XLayoutManager > xLayoutManager;
- xPropSet->getPropertyValue( "LayoutManager" ) >>= xLayoutManager;
- if ( xLayoutManager.is() )
+ OUString aCID(m_aSelection.getSelectedCID());
+ rtl::Reference<::chart::ChartModel> xChartModel = getChartModel();
+ if (xChartModel.is())
{
- bool bIsVisible( xLayoutManager->isElementVisible( "private:resource/statusbar/statusbar" ));
- if( bIsVisible )
+ // if the selected is title... we should get the text properties instead...
+ // or the selected text properties
+ std::vector<Reference<beans::XPropertySet>> xProperties;
+ xProperties.emplace(xProperties.end(),
+ ObjectIdentifier::getObjectPropertySet(aCID, xChartModel));
+
+ if (ObjectIdentifier::getObjectType(aCID) == OBJECTTYPE_TITLE)
+ {
+ Reference<chart2::XTitle> xTitle(xProperties[0], uno::UNO_QUERY);
+ if (xTitle.is())
+ {
+ OutlinerView* pOutlinerView = nullptr;
+ if (m_pDrawViewWrapper)
+ {
+ pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
+ }
+ // if the Title is not in edit mode
+ if (!pOutlinerView)
+ {
+ const Sequence<Reference<chart2::XFormattedString>> aStrings(
+ xTitle->getText());
+ xProperties.pop_back();
+ for (int i = 0; i < aStrings.getLength(); i++)
+ {
+ Reference<beans::XPropertySet> xTitlePropSet(aStrings[i],
+ uno::UNO_QUERY);
+ xProperties.push_back(xTitlePropSet);
+ }
+ }
+ // Todo: implement the edit mode case here.
+ // the edited text attributes are a bit different from the properties
+ // SfxItemSet aItemSet = pOutlinerView->GetAttribs();
+ }
+ }
+ bool bAllPropertiesExist = (xProperties.size() > 0);
+ for (std::size_t i = 0; i < xProperties.size(); i++)
{
- xLayoutManager->hideElement( "private:resource/statusbar/statusbar" );
- xLayoutManager->destroyElement( "private:resource/statusbar/statusbar" );
+ if (!xProperties[i].is())
+ bAllPropertiesExist = false;
}
- else
+ if (bAllPropertiesExist)
{
- xLayoutManager->createElement( "private:resource/statusbar/statusbar" );
- xLayoutManager->showElement( "private:resource/statusbar/statusbar" );
+ if (aCommand == "Bold")
+ {
+ executeDispatch_FontBold(xProperties);
+ }
+ else if (aCommand == "CharFontName")
+ {
+ executeDispatch_FontName(xProperties, rArgs);
+ }
+ else if (aCommand == "FontHeight")
+ {
+ executeDispatch_FontHeight(xProperties, rArgs);
+ }
+ else if (aCommand == "Italic")
+ {
+ executeDispatch_FontItalic(xProperties);
+ }
+ else if (aCommand == "Underline")
+ {
+ executeDispatch_FontUnderline(xProperties, rArgs);
+ }
+ else if (aCommand == "Strikeout")
+ {
+ executeDispatch_FontStrikeout(xProperties);
+ }
+ else if (aCommand == "Shadowed")
+ {
+ executeDispatch_FontShadowed(xProperties);
+ }
+ else if (aCommand == "Color" || aCommand == "FontColor")
+ {
+ executeDispatch_FontColor(xProperties, rArgs);
+ }
+ else if (aCommand == "Grow")
+ {
+ executeDispatch_FontGrow(xProperties);
+ }
+ else if (aCommand == "Shrink")
+ {
+ executeDispatch_FontShrink(xProperties);
+ }
+ else if (aCommand == "ResetAttributes")
+ {
+ executeDispatch_FontReset(xProperties);
+ }
+ else if (aCommand == "Spacing")
+ {
+ executeDispatch_FontSpacing(xProperties, rArgs);
+ }
+ else if (aCommand == "SuperScript")
+ {
+ executeDispatch_FontSuperScript(xProperties);
+ }
+ else if (aCommand == "SubScript")
+ {
+ executeDispatch_FontSubScript(xProperties);
+ }
}
- // @todo: update menu state (checkmark next to "Statusbar").
}
}
+ catch (const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
}
+ else if( aCommand == "ChangeTheme" )
+ comphelper::dispatchCommand(u".uno:ChangeTheme"_ustr, getFrame(), rArgs);
}
void SAL_CALL ChartController::addStatusListener(
@@ -1326,17 +1424,19 @@ void SAL_CALL ChartController::releaseContextMenuInterceptor(
void ChartController::executeDispatch_ChartType()
{
- UndoLiveUpdateGuard aUndoGuard(
- SchResId( STR_ACTION_EDIT_CHARTTYPE ), m_xUndoManager );
+ auto xUndoGuard = std::make_shared<UndoLiveUpdateGuard>(SchResId(STR_ACTION_EDIT_CHARTTYPE),
+ m_xUndoManager);
SolarMutexGuard aSolarGuard;
//prepare and open dialog
- ChartTypeDialog aDlg(GetChartFrame(), getChartModel());
- if (aDlg.run() == RET_OK)
- {
- impl_adaptDataSeriesAutoResize();
- aUndoGuard.commit();
- }
+ auto aDlg = std::make_shared<ChartTypeDialog>(GetChartFrame(), getChartModel());
+ weld::DialogController::runAsync(aDlg, [this, xUndoGuard=std::move(xUndoGuard)](int nResult) {
+ if (nResult == RET_OK)
+ {
+ impl_adaptDataSeriesAutoResize();
+ xUndoGuard->commit();
+ }
+ });
}
void ChartController::executeDispatch_SourceData()
@@ -1353,7 +1453,7 @@ void ChartController::executeDispatch_SourceData()
if ( rModel.hasInternalDataProvider() )
{
// Check if we will able to create data provider later
- css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc(
+ css::uno::Reference< css::chart2::XDataProviderAccess > xCreatorDoc(
rModel.getParent(), uno::UNO_QUERY);
if (!xCreatorDoc.is())
return;
@@ -1378,17 +1478,17 @@ void ChartController::executeDispatch_SourceData()
rModel.attachDataProvider(xDataProvider);
}
}
-
- UndoLiveUpdateGuard aUndoGuard(
- SchResId(STR_ACTION_EDIT_DATA_RANGES), m_xUndoManager);
-
+ auto xUndoGuard = std::make_shared<UndoLiveUpdateGuard>(SchResId(STR_ACTION_EDIT_DATA_RANGES),
+ m_xUndoManager);
SolarMutexGuard aSolarGuard;
- ::chart::DataSourceDialog aDlg(GetChartFrame(), xChartDoc, m_xCC);
- if (aDlg.run() == RET_OK)
- {
- impl_adaptDataSeriesAutoResize();
- aUndoGuard.commit();
- }
+ auto aDlg = std::make_shared<DataSourceDialog>(GetChartFrame(), xChartDoc);
+ weld::DialogController::runAsync(aDlg, [this, xUndoGuard=std::move(xUndoGuard)](int nResult) {
+ if (nResult == RET_OK)
+ {
+ impl_adaptDataSeriesAutoResize();
+ xUndoGuard->commit();
+ }
+ });
}
void ChartController::executeDispatch_MoveSeries( bool bForward )
@@ -1397,8 +1497,8 @@ void ChartController::executeDispatch_MoveSeries( bool bForward )
//get selected series
OUString aObjectCID(m_aSelection.getSelectedCID());
- uno::Reference< XDataSeries > xGivenDataSeries( ObjectIdentifier::getDataSeriesForCID( //yyy todo also legend entries and labels?
- aObjectCID, getChartModel() ) );
+ rtl::Reference< DataSeries > xGivenDataSeries = ObjectIdentifier::getDataSeriesForCID( //yyy todo also legend entries and labels?
+ aObjectCID, getChartModel() );
UndoGuardWithSelection aUndoGuard(
ActionDescriptionProvider::createDescription(
@@ -1406,7 +1506,7 @@ void ChartController::executeDispatch_MoveSeries( bool bForward )
SchResId(STR_OBJECT_DATASERIES)),
m_xUndoManager );
- bool bChanged = DiagramHelper::moveSeries( getFirstDiagram(), xGivenDataSeries, bForward );
+ bool bChanged = getFirstDiagram()->moveSeries( xGivenDataSeries, bForward );
if( bChanged )
{
m_aSelection.setSelection( ObjectIdentifier::getMovedSeriesCID( aObjectCID, bForward ) );
@@ -1414,38 +1514,6 @@ void ChartController::executeDispatch_MoveSeries( bool bForward )
}
}
-// ____ XMultiServiceFactory ____
-uno::Reference< uno::XInterface > SAL_CALL
- ChartController::createInstance( const OUString& aServiceSpecifier )
-{
- uno::Reference< uno::XInterface > xResult;
-
-#if !ENABLE_WASM_STRIP_ACCESSIBILITY
- if( aServiceSpecifier == CHART_ACCESSIBLE_TEXT_SERVICE_NAME )
- xResult.set( impl_createAccessibleTextContext());
-#else
- (void)aServiceSpecifier;
-#endif
-
- return xResult;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL
- ChartController::createInstanceWithArguments(
- const OUString& ServiceSpecifier,
- const uno::Sequence< uno::Any >& /* Arguments */ )
-{
- // ignore Arguments
- return createInstance( ServiceSpecifier );
-}
-
-uno::Sequence< OUString > SAL_CALL
- ChartController::getAvailableServiceNames()
-{
- uno::Sequence< OUString > aServiceNames { CHART_ACCESSIBLE_TEXT_SERVICE_NAME };
- return aServiceNames;
-}
-
// ____ XModifyListener ____
void SAL_CALL ChartController::modified(
const lang::EventObject& /* aEvent */ )
@@ -1465,7 +1533,7 @@ void ChartController::NotifyUndoActionHdl( std::unique_ptr<SdrUndoAction> pUndoA
try
{
- const Reference< document::XUndoManagerSupplier > xSuppUndo( getModel(), uno::UNO_QUERY_THROW );
+ rtl::Reference< ChartModel > xSuppUndo = getChartModel();
const Reference< document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), uno::UNO_SET_THROW );
const Reference< document::XUndoAction > xAction( new impl::ShapeUndoElement( std::move(pUndoAction) ) );
xUndoManager->addUndoAction( xAction );
@@ -1480,9 +1548,8 @@ DrawModelWrapper* ChartController::GetDrawModelWrapper()
{
if( !m_pDrawModelWrapper )
{
- ExplicitValueProvider* pProvider = comphelper::getFromUnoTunnel<ExplicitValueProvider>( m_xChartView );
- if( pProvider )
- m_pDrawModelWrapper = pProvider->getDrawModelWrapper();
+ if( m_xChartView )
+ m_pDrawModelWrapper = m_xChartView->getDrawModelWrapper();
if ( m_pDrawModelWrapper )
{
m_pDrawModelWrapper->getSdrModel().SetNotifyUndoActionHdl(
@@ -1536,130 +1603,73 @@ void ChartController::SetAndApplySelection(const Reference<drawing::XShape>& rxS
}
}
-
-
-uno::Reference< XAccessible > ChartController::CreateAccessible()
+rtl::Reference<AccessibleChartView> ChartController::CreateAccessible()
{
#if !ENABLE_WASM_STRIP_ACCESSIBILITY
- uno::Reference< XAccessible > xResult = new AccessibleChartView( GetDrawViewWrapper() );
- impl_initializeAccessible( uno::Reference< lang::XInitialization >( xResult, uno::UNO_QUERY ) );
+ rtl::Reference< AccessibleChartView > xResult = new AccessibleChartView( GetDrawViewWrapper() );
+ impl_initializeAccessible( *xResult );
return xResult;
#else
- return uno::Reference< XAccessible >();
+ return {};
#endif
}
void ChartController::impl_invalidateAccessible()
{
+#if !ENABLE_WASM_STRIP_ACCESSIBILITY
SolarMutexGuard aGuard;
auto pChartWindow(GetChartWindow());
if( pChartWindow )
{
- Reference< lang::XInitialization > xInit( pChartWindow->GetAccessible(false), uno::UNO_QUERY );
- if(xInit.is())
+ Reference<XAccessible> xAccessible = pChartWindow->GetAccessible(false);
+ if (xAccessible.is())
{
- uno::Sequence< uno::Any > aArguments(3);//empty arguments -> invalid accessible
- xInit->initialize(aArguments);
+ //empty arguments -> invalid accessible
+ dynamic_cast<AccessibleChartView&>(*xAccessible).initialize();
}
}
+#endif
}
void ChartController::impl_initializeAccessible()
{
+#if !ENABLE_WASM_STRIP_ACCESSIBILITY
SolarMutexGuard aGuard;
auto pChartWindow(GetChartWindow());
- if( pChartWindow )
- this->impl_initializeAccessible( Reference< lang::XInitialization >( pChartWindow->GetAccessible(false), uno::UNO_QUERY ) );
+ if( !pChartWindow )
+ return;
+ Reference<XAccessible> xInit = pChartWindow->GetAccessible(false);
+ if(xInit.is())
+ impl_initializeAccessible( dynamic_cast<AccessibleChartView&>(*xInit) );
+#endif
}
-void ChartController::impl_initializeAccessible( const uno::Reference< lang::XInitialization >& xInit )
+#if !ENABLE_WASM_STRIP_ACCESSIBILITY
+void ChartController::impl_initializeAccessible( AccessibleChartView& rAccChartView )
{
- if(!xInit.is())
- return;
+ SolarMutexGuard aGuard;
uno::Reference< XAccessible > xParent;
- {
- SolarMutexGuard aGuard;
- auto pChartWindow(GetChartWindow());
- if( pChartWindow )
- {
- vcl::Window* pParentWin( pChartWindow->GetAccessibleParentWindow());
- if( pParentWin )
- xParent.set( pParentWin->GetAccessible());
- }
- }
- uno::Sequence< uno::Any > aArguments{ uno::Any(uno::Reference<view::XSelectionSupplier>(this)),
- uno::Any(getModel()),
- uno::Any(m_xChartView),
- uno::Any(xParent),
- uno::Any(m_xViewWindow) };
- xInit->initialize(aArguments);
+ ChartWindow* pChartWindow = GetChartWindow();
+ if( pChartWindow )
+ xParent.set(pChartWindow->GetAccessibleParent());
+
+ rAccChartView.initialize(*this, getChartModel(), m_xChartView, xParent, pChartWindow);
}
+#else
+void ChartController::impl_initializeAccessible( AccessibleChartView& /* rAccChartView */) {}
+#endif
-const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommands()
+const o3tl::sorted_vector< std::u16string_view >& ChartController::impl_getAvailableCommands()
{
- static const o3tl::sorted_vector< OUString > s_AvailableCommands {
+ static const o3tl::sorted_vector< std::u16string_view > s_AvailableCommands {
// commands for container forward
- "AddDirect", "NewDoc", "Open",
- "Save", "SaveAs", "SendMail",
- "EditDoc", "ExportDirectToPDF", "PrintDefault",
-
- // own commands
- "Cut", "Copy", "Paste",
- "DataRanges", "DiagramData",
- // insert objects
- "InsertMenuTitles", "InsertTitles",
- "InsertMenuLegend", "InsertLegend", "DeleteLegend",
- "InsertMenuDataLabels",
- "InsertMenuAxes", "InsertRemoveAxes", "InsertMenuGrids",
- "InsertSymbol",
- "InsertTrendlineEquation", "InsertTrendlineEquationAndR2",
- "InsertR2Value", "DeleteR2Value",
- "InsertMenuTrendlines", "InsertTrendline",
- "InsertMenuMeanValues", "InsertMeanValue",
- "InsertMenuXErrorBars", "InsertXErrorBars",
- "InsertMenuYErrorBars", "InsertYErrorBars",
- "InsertDataLabels", "InsertDataLabel",
- "DeleteTrendline", "DeleteMeanValue", "DeleteTrendlineEquation",
- "DeleteXErrorBars", "DeleteYErrorBars",
- "DeleteDataLabels", "DeleteDataLabel",
- //format objects
- "FormatSelection", "TransformDialog",
- "DiagramType", "View3D",
- "Forward", "Backward",
- "MainTitle", "SubTitle",
- "XTitle", "YTitle", "ZTitle",
- "SecondaryXTitle", "SecondaryYTitle",
- "AllTitles", "Legend",
- "DiagramAxisX", "DiagramAxisY", "DiagramAxisZ",
- "DiagramAxisA", "DiagramAxisB", "DiagramAxisAll",
- "DiagramGridXMain", "DiagramGridYMain", "DiagramGridZMain",
- "DiagramGridXHelp", "DiagramGridYHelp", "DiagramGridZHelp",
- "DiagramGridAll",
- "DiagramWall", "DiagramFloor", "DiagramArea",
-
- //context menu - format objects entries
- "FormatWall", "FormatFloor", "FormatChartArea",
- "FormatLegend",
-
- "FormatAxis", "FormatTitle",
- "FormatDataSeries", "FormatDataPoint",
- "ResetAllDataPoints", "ResetDataPoint",
- "FormatDataLabels", "FormatDataLabel",
- "FormatMeanValue", "FormatTrendline", "FormatTrendlineEquation",
- "FormatXErrorBars", "FormatYErrorBars",
- "FormatStockLoss", "FormatStockGain",
-
- "FormatMajorGrid", "InsertMajorGrid", "DeleteMajorGrid",
- "FormatMinorGrid", "InsertMinorGrid", "DeleteMinorGrid",
- "InsertAxis", "DeleteAxis", "InsertAxisTitle",
+ u"AddDirect", u"NewDoc", u"Open",
+ u"Save", u"SaveAs", u"SendMail",
+ u"EditDoc", u"ExportDirectToPDF", u"PrintDefault",
// toolbar commands
- "ToggleGridHorizontal", "ToggleGridVertical", "ToggleLegend", "ScaleText",
- "NewArrangement", "Update",
- "DefaultColors", "BarWidth", "NumberOfLines",
- "ArrangeRow",
- "StatusBarVisible",
- "ChartElementSelector"};
+ u"ChartElementSelector",
+ };
return s_AvailableCommands;
}
@@ -1670,11 +1680,4 @@ ViewElementListProvider ChartController::getViewElementListProvider()
} //namespace chart
-extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
-com_sun_star_comp_chart2_ChartController_get_implementation(css::uno::XComponentContext *context,
- css::uno::Sequence<css::uno::Any> const &)
-{
- return cppu::acquire(new chart::ChartController(context));
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx
index 4f0a979956b0..1e0c8c3dc96f 100644
--- a/chart2/source/controller/main/ChartController_EditData.cxx
+++ b/chart2/source/controller/main/ChartController_EditData.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <ChartWindow.hxx>
#include <ChartController.hxx>
#include <ChartModel.hxx>
@@ -27,19 +26,15 @@
#include <strings.hrc>
#include <vcl/svapp.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
using namespace ::com::sun::star;
-using ::com::sun::star::uno::Reference;
-
namespace chart
{
void ChartController::executeDispatch_EditData()
{
- rtl::Reference<::chart::ChartModel> xChartDoc( getChartModel(), uno::UNO_QUERY );
- if (xChartDoc.is())
+ if (rtl::Reference<::chart::ChartModel> xChartDoc = getChartModel())
{
SolarMutexGuard aSolarGuard;
UndoLiveUpdateGuardWithData aUndoGuard(
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index b14a788f2140..5b930ee7190c 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -25,14 +25,15 @@
#include <dlg_InsertLegend.hxx>
#include <dlg_InsertErrorBars.hxx>
#include <dlg_InsertTitle.hxx>
+#include <dlg_InsertDataTable.hxx>
#include <dlg_ObjectProperties.hxx>
-#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <TitleHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <DataSeries.hxx>
#include <Diagram.hxx>
+#include <GridProperties.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include <chartview/ChartSfxItemIds.hxx>
#include <NumberFormatterWrapper.hxx>
@@ -50,33 +51,32 @@
#include <ErrorBarItemConverter.hxx>
#include <DataSeriesHelper.hxx>
#include <ObjectNameProvider.hxx>
+#include <Legend.hxx>
#include <LegendHelper.hxx>
+#include <DataTable.hxx>
+#include <RegressionCurveModel.hxx>
#include <com/sun/star/chart2/XRegressionCurve.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <svx/ActionDescriptionProvider.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
namespace
{
-void lcl_InsertMeanValueLine( const uno::Reference< chart2::XDataSeries > & xSeries )
+void lcl_InsertMeanValueLine( const rtl::Reference< ::chart::DataSeries > & xSeries )
{
- uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
- xSeries, uno::UNO_QUERY );
- if( xRegCurveCnt.is())
+ if( xSeries.is())
{
::chart::RegressionCurveHelper::addMeanValueLine(
- xRegCurveCnt, uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ));
+ xSeries, xSeries);
}
}
@@ -87,35 +87,37 @@ namespace chart
void ChartController::executeDispatch_InsertAxes()
{
- UndoGuard aUndoGuard(
+ auto xUndoGuard = std::make_shared<UndoGuard>(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_AXES )),
m_xUndoManager );
try
{
- InsertAxisOrGridDialogData aDialogInput;
+ auto xDialogInput = std::make_shared<InsertAxisOrGridDialogData>();
rtl::Reference< Diagram > xDiagram = getFirstDiagram();
- AxisHelper::getAxisOrGridExistence( aDialogInput.aExistenceList, xDiagram );
- AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram );
+ AxisHelper::getAxisOrGridExistence( xDialogInput->aExistenceList, xDiagram );
+ AxisHelper::getAxisOrGridPossibilities( xDialogInput->aPossibilityList, xDiagram );
SolarMutexGuard aGuard;
- SchAxisDlg aDlg(GetChartFrame(), aDialogInput);
- if (aDlg.run() == RET_OK)
- {
- // lock controllers till end of block
- ControllerLockGuardUNO aCLGuard( getChartModel() );
+ auto aDlg = std::make_shared<SchAxisDlg>(GetChartFrame(), *xDialogInput);
+ weld::DialogController::runAsync(aDlg, [this, aDlg, xDialogInput=std::move(xDialogInput),
+ xUndoGuard=std::move(xUndoGuard)](int nResult) {
+ if ( nResult == RET_OK )
+ {
+ // lock controllers till end of block
+ ControllerLockGuardUNO aCLGuard( getChartModel() );
- InsertAxisOrGridDialogData aDialogOutput;
- aDlg.getResult(aDialogOutput);
- std::unique_ptr< ReferenceSizeProvider > pRefSizeProvider(
- impl_createReferenceSizeProvider());
- bool bChanged = AxisHelper::changeVisibilityOfAxes( xDiagram
- , aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC
- , pRefSizeProvider.get() );
- if( bChanged )
- aUndoGuard.commit();
- }
+ InsertAxisOrGridDialogData aDialogOutput;
+ aDlg->getResult(aDialogOutput);
+ ReferenceSizeProvider aRefSizeProvider(impl_createReferenceSizeProvider());
+ bool bChanged = AxisHelper::changeVisibilityOfAxes( getFirstDiagram()
+ , xDialogInput->aExistenceList, aDialogOutput.aExistenceList, m_xCC
+ , &aRefSizeProvider );
+ if( bChanged )
+ xUndoGuard->commit();
+ }
+ });
}
catch(const uno::RuntimeException&)
{
@@ -157,30 +159,146 @@ void ChartController::executeDispatch_InsertGrid()
}
}
+void ChartController::executeDispatch_OpenInsertDataTableDialog()
+{
+ SolarMutexGuard aGuard;
+
+ auto aUndoDescription = ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Insert, SchResId(STR_DATA_TABLE));
+ UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
+
+ rtl::Reference<Diagram> xDiagram = getFirstDiagram();
+
+ InsertDataTableDialog aDialog(GetChartFrame());
+ {
+ // init values
+ DataTableDialogData aData;
+ auto xDataTable = xDiagram->getDataTable();
+ aData.mbShow = xDataTable.is();
+ if (xDataTable.is())
+ {
+ uno::Reference<beans::XPropertySet> xProperties(xDataTable, uno::UNO_QUERY);
+
+ uno::Any aAny = xProperties->getPropertyValue(u"HBorder"_ustr);
+ if (aAny.has<bool>())
+ aData.mbHorizontalBorders = aAny.get<bool>();
+
+ aAny = xProperties->getPropertyValue(u"VBorder"_ustr);
+ if (aAny.has<bool>())
+ aData.mbVerticalBorders = aAny.get<bool>();
+
+ aAny = xProperties->getPropertyValue(u"Outline"_ustr);
+ if (aAny.has<bool>())
+ aData.mbOutline = aAny.get<bool>();
+
+ aAny = xProperties->getPropertyValue(u"Keys"_ustr);
+ if (aAny.has<bool>())
+ aData.mbKeys = aAny.get<bool>();
+ }
+ aDialog.init(aData);
+ }
+
+ // show the dialog
+ if (aDialog.run() == RET_OK)
+ {
+ bool bChanged = false;
+
+ auto& rDialogData = aDialog.getDataTableDialogData();
+ auto xDataTable = xDiagram->getDataTable();
+ if (!rDialogData.mbShow && xDataTable.is())
+ {
+ xDiagram->setDataTable(uno::Reference<chart2::XDataTable>());
+ bChanged = true;
+ }
+ else if (rDialogData.mbShow && !xDataTable.is())
+ {
+ uno::Reference<chart2::XDataTable> xNewDataTable(new DataTable);
+ if (xNewDataTable.is())
+ {
+ xDiagram->setDataTable(xNewDataTable);
+ bChanged = true;
+ }
+ }
+
+ // Set the properties
+ xDataTable = xDiagram->getDataTable();
+ if (rDialogData.mbShow && xDataTable.is())
+ {
+ uno::Reference<beans::XPropertySet> xProperties(xDataTable, uno::UNO_QUERY);
+ xProperties->setPropertyValue(u"HBorder"_ustr , uno::Any(rDialogData.mbHorizontalBorders));
+ xProperties->setPropertyValue(u"VBorder"_ustr , uno::Any(rDialogData.mbVerticalBorders));
+ xProperties->setPropertyValue(u"Outline"_ustr , uno::Any(rDialogData.mbOutline));
+ xProperties->setPropertyValue(u"Keys"_ustr , uno::Any(rDialogData.mbKeys));
+ bChanged = true;
+ }
+
+ if (bChanged)
+ aUndoGuard.commit();
+ }
+}
+
+/** Create and insert a data table to the chart */
+void ChartController::executeDispatch_InsertDataTable()
+{
+ auto aUndoDescription = ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Insert, SchResId(STR_DATA_TABLE));
+ UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
+
+
+ rtl::Reference<Diagram> xDiagram = getFirstDiagram();
+ auto xDataTable = xDiagram->getDataTable();
+ if (!xDataTable.is())
+ {
+ uno::Reference<chart2::XDataTable> xNewDataTable(new DataTable);
+ if (xNewDataTable.is())
+ {
+ xDiagram->setDataTable(xNewDataTable);
+ aUndoGuard.commit();
+ }
+ }
+}
+
+/** Delete a data table from the chart */
+void ChartController::executeDispatch_DeleteDataTable()
+{
+ auto aUndoDescription = ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Delete, SchResId(STR_DATA_TABLE));
+ UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
+
+ rtl::Reference<Diagram> xDiagram = getFirstDiagram();
+ auto xDataTable = xDiagram->getDataTable();
+ if (xDataTable.is())
+ {
+ // insert a empty data table reference
+ xDiagram->setDataTable(uno::Reference<chart2::XDataTable>());
+ aUndoGuard.commit();
+ }
+}
+
void ChartController::executeDispatch_InsertTitles()
{
- UndoGuard aUndoGuard(
+ auto xUndoGuard = std::make_shared<UndoGuard>(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_TITLES )),
m_xUndoManager );
try
{
- TitleDialogData aDialogInput;
- aDialogInput.readFromModel( getChartModel() );
+ auto xDialogInput = std::make_shared<TitleDialogData>();
+ xDialogInput->readFromModel( getChartModel() );
SolarMutexGuard aGuard;
- SchTitleDlg aDlg(GetChartFrame(), aDialogInput);
- if (aDlg.run() == RET_OK)
- {
- // lock controllers till end of block
- ControllerLockGuardUNO aCLGuard( getChartModel() );
- TitleDialogData aDialogOutput(impl_createReferenceSizeProvider());
- aDlg.getResult(aDialogOutput);
- bool bChanged = aDialogOutput.writeDifferenceToModel( getChartModel(), m_xCC, &aDialogInput );
- if( bChanged )
- aUndoGuard.commit();
- }
+ auto aDlg = std::make_shared<SchTitleDlg>(GetChartFrame(), *xDialogInput);
+ weld::DialogController::runAsync(aDlg, [this, aDlg, xDialogInput=std::move(xDialogInput),
+ xUndoGuard=std::move(xUndoGuard)](int nResult){
+ if ( nResult == RET_OK )
+ {
+ // lock controllers till end of block
+ ControllerLockGuardUNO aCLGuard( getChartModel() );
+ TitleDialogData aDialogOutput( impl_createReferenceSizeProvider() );
+ aDlg->getResult( aDialogOutput );
+ bool bChanged = aDialogOutput.writeDifferenceToModel( getChartModel(), m_xCC, xDialogInput.get() );
+ if( bChanged )
+ xUndoGuard->commit();
+ }
+ });
}
catch(const uno::RuntimeException&)
{
@@ -195,8 +313,7 @@ void ChartController::executeDispatch_DeleteLegend()
ActionDescriptionProvider::ActionType::Delete, SchResId( STR_OBJECT_LEGEND )),
m_xUndoManager );
- ChartModel& rModel = dynamic_cast<ChartModel&>(*getModel());
- LegendHelper::hideLegend(rModel);
+ LegendHelper::hideLegend(*getChartModel());
aUndoGuard.commit();
}
@@ -207,8 +324,7 @@ void ChartController::executeDispatch_InsertLegend()
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_LEGEND )),
m_xUndoManager );
- ChartModel& rModel = dynamic_cast<ChartModel&>(*getModel());
- LegendHelper::showLegend(rModel, m_xCC);
+ LegendHelper::showLegend(*getChartModel(), m_xCC);
aUndoGuard.commit();
}
@@ -241,36 +357,32 @@ void ChartController::executeDispatch_OpenLegendDialog()
void ChartController::executeDispatch_InsertMenu_DataLabels()
{
- UndoGuard aUndoGuard(
+ std::shared_ptr<UndoGuard> aUndoGuard = std::make_shared<UndoGuard>(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_DATALABELS )),
m_xUndoManager );
//if a series is selected insert labels for that series only:
- uno::Reference< chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel());
if( xSeries.is() )
{
// add labels
- DataSeriesHelper::insertDataLabelsToSeriesAndAllPoints( xSeries );
+ xSeries->insertDataLabelsToSeriesAndAllPoints();
OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) + "=" );
OUString aObjectCID = ObjectIdentifier::createClassifiedIdentifierForParticles(
ObjectIdentifier::getSeriesParticleFromCID(m_aSelection.getSelectedCID()), aChildParticle );
- bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, true );
- if( bSuccess )
- aUndoGuard.commit();
+ ChartController::executeDlg_ObjectProperties_withUndoGuard( aUndoGuard, aObjectCID, true );
return;
}
-
try
{
wrapper::AllDataLabelItemConverter aItemConverter(
getChartModel(),
m_pDrawModelWrapper->GetItemPool(),
- m_pDrawModelWrapper->getSdrModel(),
- uno::Reference< lang::XMultiServiceFactory >( getModel(), uno::UNO_QUERY ));
+ m_pDrawModelWrapper->getSdrModel() );
SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
aItemConverter.FillItemSet( aItemSet );
@@ -278,8 +390,7 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
SolarMutexGuard aGuard;
//get number formatter
- uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( getModel(), uno::UNO_QUERY );
- NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
+ NumberFormatterWrapper aNumberFormatterWrapper( getChartModel() );
SvNumberFormatter* pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
DataLabelsDialog aDlg(GetChartFrame(), aItemSet, pNumberFormatter);
@@ -292,7 +403,7 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
ControllerLockGuardUNO aCLGuard( getChartModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
- aUndoGuard.commit();
+ aUndoGuard->commit();
}
}
catch(const uno::RuntimeException&)
@@ -319,17 +430,17 @@ void ChartController::executeDispatch_InsertMenu_MeanValues()
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_AVERAGE_LINE )),
m_xUndoManager );
- uno::Reference< chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xSeries.is() )
{
//if a series is selected insert mean value only for that series:
lcl_InsertMeanValueLine( xSeries );
}
- else
+ else if (rtl::Reference<Diagram> xDiagram = getFirstDiagram())
{
- std::vector< uno::Reference< chart2::XDataSeries > > aSeries(
- DiagramHelper::getDataSeriesFromDiagram( getFirstDiagram()));
+ std::vector< rtl::Reference< DataSeries > > aSeries =
+ xDiagram->getDataSeries();
for( const auto& xSrs : aSeries )
lcl_InsertMeanValueLine( xSrs );
@@ -341,7 +452,7 @@ void ChartController::executeDispatch_InsertMenu_Trendlines()
{
OUString aCID = m_aSelection.getSelectedCID();
- uno::Reference< chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID( aCID, getChartModel() );
if( !xSeries.is() )
@@ -352,35 +463,33 @@ void ChartController::executeDispatch_InsertMenu_Trendlines()
void ChartController::executeDispatch_InsertTrendline()
{
- uno::Reference< chart2::XRegressionCurveContainer > xRegressionCurveContainer(
- ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel()), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xRegressionCurveContainer =
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel());
if( !xRegressionCurveContainer.is() )
return;
- UndoLiveUpdateGuard aUndoGuard(
+ auto xUndoGuard = std::make_shared<UndoLiveUpdateGuard>(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_CURVE )),
m_xUndoManager );
- uno::Reference< chart2::XRegressionCurve > xCurve =
+ rtl::Reference< RegressionCurveModel > xCurve =
RegressionCurveHelper::addRegressionCurve(
SvxChartRegress::Linear,
xRegressionCurveContainer );
- uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
-
- if( !xProperties.is())
+ if( !xCurve.is())
return;
- wrapper::RegressionCurveItemConverter aItemConverter(
- xProperties, xRegressionCurveContainer, m_pDrawModelWrapper->getSdrModel().GetItemPool(),
+ auto aItemConverter = std::make_shared<wrapper::RegressionCurveItemConverter>(
+ xCurve, xRegressionCurveContainer, m_pDrawModelWrapper->getSdrModel().GetItemPool(),
m_pDrawModelWrapper->getSdrModel(),
- uno::Reference< lang::XMultiServiceFactory >( getModel(), uno::UNO_QUERY ));
+ getChartModel() );
// open dialog
- SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
- aItemConverter.FillItemSet( aItemSet );
+ SfxItemSet aItemSet = aItemConverter->CreateEmptyItemSet();
+ aItemConverter->FillItemSet( aItemSet );
ObjectPropertiesDialogParameter aDialogParameter(
ObjectIdentifier::createDataCurveCID(
ObjectIdentifier::getSeriesParticleFromCID( m_aSelection.getSelectedCID()),
@@ -388,24 +497,24 @@ void ChartController::executeDispatch_InsertTrendline()
aDialogParameter.init( getChartModel() );
ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
SolarMutexGuard aGuard;
- SchAttribTabDlg aDialog(
- GetChartFrame(), &aItemSet, &aDialogParameter,
- &aViewElementListProvider,
- uno::Reference< util::XNumberFormatsSupplier >(
- getModel(), uno::UNO_QUERY ) );
+ auto aDialog = std::make_shared<SchAttribTabDlg>(GetChartFrame(), &aItemSet, &aDialogParameter,
+ &aViewElementListProvider, getChartModel());
// note: when a user pressed "OK" but didn't change any settings in the
// dialog, the SfxTabDialog returns "Cancel"
- if( aDialog.run() == RET_OK || aDialog.DialogWasClosedWithOK())
- {
- const SfxItemSet* pOutItemSet = aDialog.GetOutputItemSet();
- if( pOutItemSet )
+ SfxTabDialogController::runAsync(aDialog, [this, aDialog, aItemConverter = std::move(aItemConverter),
+ xUndoGuard=std::move(xUndoGuard)](int nResult) {
+ if ( nResult == RET_OK || aDialog->DialogWasClosedWithOK() )
{
- ControllerLockGuardUNO aCLGuard( getChartModel() );
- aItemConverter.ApplyItemSet( *pOutItemSet );
+ const SfxItemSet* pOutItemSet = aDialog->GetOutputItemSet();
+ if( pOutItemSet )
+ {
+ ControllerLockGuardUNO aCLGuard( getChartModel() );
+ aItemConverter->ApplyItemSet( *pOutItemSet );
+ }
+ xUndoGuard->commit();
}
- aUndoGuard.commit();
- }
+ });
}
void ChartController::executeDispatch_InsertErrorBars( bool bYError )
@@ -413,12 +522,12 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
ObjectType objType = bYError ? OBJECTTYPE_DATA_ERRORS_Y : OBJECTTYPE_DATA_ERRORS_X;
//if a series is selected insert error bars for that series only:
- uno::Reference< chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xSeries.is())
{
- UndoLiveUpdateGuard aUndoGuard(
+ auto xUndoGuard = std::make_shared<UndoLiveUpdateGuard>(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert,
SchResId( bYError ? STR_OBJECT_ERROR_BARS_Y : STR_OBJECT_ERROR_BARS_X )),
@@ -431,47 +540,48 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
bYError));
// get an appropriate item converter
- wrapper::ErrorBarItemConverter aItemConverter(
- getModel(), xErrorBarProp, m_pDrawModelWrapper->getSdrModel().GetItemPool(),
- m_pDrawModelWrapper->getSdrModel(),
- uno::Reference< lang::XMultiServiceFactory >( getModel(), uno::UNO_QUERY ));
+ auto aItemConverter = std::make_shared<wrapper::ErrorBarItemConverter> (
+ getChartModel(), xErrorBarProp, m_pDrawModelWrapper->getSdrModel().GetItemPool(),
+ m_pDrawModelWrapper->getSdrModel() );
// open dialog
- SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
+ SfxItemSet aItemSet = aItemConverter->CreateEmptyItemSet();
aItemSet.Put(SfxBoolItem(SCHATTR_STAT_ERRORBAR_TYPE,bYError));
- aItemConverter.FillItemSet( aItemSet );
+ aItemConverter->FillItemSet( aItemSet );
ObjectPropertiesDialogParameter aDialogParameter(
ObjectIdentifier::createClassifiedIdentifierWithParent(
objType, u"", m_aSelection.getSelectedCID()));
aDialogParameter.init( getChartModel() );
ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
SolarMutexGuard aGuard;
- SchAttribTabDlg aDlg(
+ auto aDlg = std::make_shared<SchAttribTabDlg>(
GetChartFrame(), &aItemSet, &aDialogParameter,
&aViewElementListProvider,
- uno::Reference< util::XNumberFormatsSupplier >(
- getModel(), uno::UNO_QUERY ) );
- aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
+ getChartModel() );
+ aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getChartModel(),
m_xChartView, m_aSelection.getSelectedCID()));
// note: when a user pressed "OK" but didn't change any settings in the
// dialog, the SfxTabDialog returns "Cancel"
- if (aDlg.run() == RET_OK || aDlg.DialogWasClosedWithOK())
- {
- const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
- if( pOutItemSet )
+ SfxTabDialogController::runAsync(aDlg, [this, aDlg, aItemConverter=std::move(aItemConverter),
+ xUndoGuard=std::move(xUndoGuard)](int nResult) {
+ if ( nResult == RET_OK || aDlg->DialogWasClosedWithOK() )
{
- ControllerLockGuardUNO aCLGuard( getChartModel() );
- aItemConverter.ApplyItemSet( *pOutItemSet );
+ const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet();
+ if( pOutItemSet )
+ {
+ ControllerLockGuardUNO aCLGuard( getChartModel() );
+ aItemConverter->ApplyItemSet( *pOutItemSet );
+ }
+ xUndoGuard->commit();
}
- aUndoGuard.commit();
- }
+ });
}
else
{
//if no series is selected insert error bars for all series
- UndoGuard aUndoGuard(
+ auto xUndoGuard = std::make_shared<UndoGuard>(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert,
ObjectNameProvider::getName_ObjectForAllSeries( objType ) ),
@@ -479,32 +589,35 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
try
{
- wrapper::AllSeriesStatisticsConverter aItemConverter(
+ auto xItemConverter = std::make_shared<wrapper::AllSeriesStatisticsConverter>(
getChartModel(), m_pDrawModelWrapper->GetItemPool() );
- SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
- aItemConverter.FillItemSet( aItemSet );
+ SfxItemSet aItemSet = xItemConverter->CreateEmptyItemSet();
+ xItemConverter->FillItemSet( aItemSet );
//prepare and open dialog
SolarMutexGuard aGuard;
- InsertErrorBarsDialog aDlg(
+ auto aDlg = std::make_shared<InsertErrorBarsDialog>(
GetChartFrame(), aItemSet,
getChartModel(),
bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X);
- aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
- InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getChartModel(), m_xChartView, OUString() ) );
-
- if (aDlg.run() == RET_OK)
- {
- SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
- aDlg.FillItemSet( aOutItemSet );
-
- // lock controllers till end of block
- ControllerLockGuardUNO aCLGuard( getChartModel() );
- bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
- if( bChanged )
- aUndoGuard.commit();
- }
+ aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
+ InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getChartModel(), m_xChartView, u"" ) );
+
+ weld::DialogController::runAsync(aDlg, [this, aDlg, xItemConverter=std::move(xItemConverter),
+ xUndoGuard=std::move(xUndoGuard)](int nResult) {
+ if ( nResult == RET_OK )
+ {
+ SfxItemSet aOutItemSet = xItemConverter->CreateEmptyItemSet();
+ aDlg->FillItemSet( aOutItemSet );
+
+ // lock controllers till end of block
+ ControllerLockGuardUNO aCLGuard( getChartModel() );
+ bool bChanged = xItemConverter->ApplyItemSet( aOutItemSet );//model should be changed now
+ if( bChanged )
+ xUndoGuard->commit();
+ }
+ });
}
catch(const uno::RuntimeException&)
{
@@ -519,8 +632,8 @@ void ChartController::executeDispatch_InsertTrendlineEquation( bool bInsertR2 )
ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), getChartModel() ), uno::UNO_QUERY );
if( !xRegCurve.is() )
{
- uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
- ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() ), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xRegCurveCnt =
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
xRegCurve.set( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) );
}
if( !xRegCurve.is())
@@ -533,10 +646,10 @@ void ChartController::executeDispatch_InsertTrendlineEquation( bool bInsertR2 )
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_CURVE_EQUATION )),
m_xUndoManager );
- xEqProp->setPropertyValue( "ShowEquation", uno::Any( true ));
- xEqProp->setPropertyValue( "XName", uno::Any( OUString("x") ));
- xEqProp->setPropertyValue( "YName", uno::Any( OUString("f(x)") ));
- xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::Any( bInsertR2 ));
+ xEqProp->setPropertyValue( u"ShowEquation"_ustr, uno::Any( true ));
+ xEqProp->setPropertyValue( u"XName"_ustr, uno::Any( u"x"_ustr ));
+ xEqProp->setPropertyValue( u"YName"_ustr, uno::Any( u"f(x)"_ustr ));
+ xEqProp->setPropertyValue( u"ShowCorrelationCoefficient"_ustr, uno::Any( bInsertR2 ));
aUndoGuard.commit();
}
}
@@ -551,7 +664,7 @@ void ChartController::executeDispatch_InsertR2Value()
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_CURVE_EQUATION )),
m_xUndoManager );
- xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::Any( true ));
+ xEqProp->setPropertyValue( u"ShowCorrelationCoefficient"_ustr, uno::Any( true ));
aUndoGuard.commit();
}
}
@@ -566,15 +679,15 @@ void ChartController::executeDispatch_DeleteR2Value()
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_CURVE_EQUATION )),
m_xUndoManager );
- xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::Any( false ));
+ xEqProp->setPropertyValue( u"ShowCorrelationCoefficient"_ustr, uno::Any( false ));
aUndoGuard.commit();
}
}
void ChartController::executeDispatch_DeleteMeanValue()
{
- uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
- ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() ), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xRegCurveCnt =
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xRegCurveCnt.is())
{
UndoGuard aUndoGuard(
@@ -588,8 +701,8 @@ void ChartController::executeDispatch_DeleteMeanValue()
void ChartController::executeDispatch_DeleteTrendline()
{
- uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
- ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() ), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xRegCurveCnt =
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xRegCurveCnt.is())
{
UndoGuard aUndoGuard(
@@ -603,8 +716,8 @@ void ChartController::executeDispatch_DeleteTrendline()
void ChartController::executeDispatch_DeleteTrendlineEquation()
{
- uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
- ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() ), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xRegCurveCnt =
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xRegCurveCnt.is())
{
UndoGuard aUndoGuard(
@@ -618,8 +731,8 @@ void ChartController::executeDispatch_DeleteTrendlineEquation()
void ChartController::executeDispatch_DeleteErrorBars( bool bYError )
{
- uno::Reference< chart2::XDataSeries > xDataSeries(
- ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() ));
+ rtl::Reference< DataSeries > xDataSeries =
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xDataSeries.is())
{
UndoGuard aUndoGuard(
@@ -633,14 +746,14 @@ void ChartController::executeDispatch_DeleteErrorBars( bool bYError )
void ChartController::executeDispatch_InsertDataLabels()
{
- uno::Reference< chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xSeries.is() )
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Insert,
SchResId( STR_OBJECT_DATALABELS )),
m_xUndoManager );
- DataSeriesHelper::insertDataLabelsToSeriesAndAllPoints( xSeries );
+ xSeries->insertDataLabelsToSeriesAndAllPoints();
aUndoGuard.commit();
}
}
@@ -656,14 +769,14 @@ void ChartController::executeDispatch_InsertDataLabel()
void ChartController::executeDispatch_DeleteDataLabels()
{
- uno::Reference< chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xSeries.is() )
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Delete,
SchResId( STR_OBJECT_DATALABELS )),
m_xUndoManager );
- DataSeriesHelper::deleteDataLabelsFromSeriesAndAllPoints( xSeries );
+ xSeries->deleteDataLabelsFromSeriesAndAllPoints();
aUndoGuard.commit();
}
}
@@ -682,7 +795,7 @@ void ChartController::executeDispatch_ResetAllDataPoints()
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Format,
SchResId( STR_OBJECT_DATAPOINTS )),
m_xUndoManager );
- uno::Reference< chart2::XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xSeries.is() )
xSeries->resetAllDataPoints();
aUndoGuard.commit();
@@ -692,7 +805,7 @@ void ChartController::executeDispatch_ResetDataPoint()
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Format,
SchResId( STR_OBJECT_DATAPOINT )),
m_xUndoManager );
- uno::Reference< chart2::XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xSeries.is() )
{
sal_Int32 nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
@@ -705,14 +818,14 @@ void ChartController::executeDispatch_InsertAxisTitle()
{
try
{
- uno::Reference< XTitle > xTitle;
+ rtl::Reference< Title > xTitle;
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_TITLE )),
m_xUndoManager );
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
sal_Int32 nDimensionIndex = -1;
sal_Int32 nCooSysIndex = -1;
sal_Int32 nAxisIndex = -1;
@@ -726,8 +839,8 @@ void ChartController::executeDispatch_InsertAxisTitle()
else
eTitleType = TitleHelper::Z_AXIS_TITLE;
- std::unique_ptr< ReferenceSizeProvider > apRefSizeProvider( impl_createReferenceSizeProvider());
- xTitle = TitleHelper::createTitle( eTitleType, ObjectNameProvider::getTitleNameByType(eTitleType), getChartModel(), m_xCC, apRefSizeProvider.get() );
+ ReferenceSizeProvider aRefSizeProvider( impl_createReferenceSizeProvider());
+ xTitle = TitleHelper::createTitle( eTitleType, ObjectNameProvider::getTitleNameByType(eTitleType), getChartModel(), m_xCC, &aRefSizeProvider );
aUndoGuard.commit();
}
}
@@ -746,7 +859,7 @@ void ChartController::executeDispatch_InsertAxis()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
AxisHelper::makeAxisVisible( xAxis );
@@ -768,7 +881,7 @@ void ChartController::executeDispatch_DeleteAxis()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
AxisHelper::makeAxisInvisible( xAxis );
@@ -790,10 +903,10 @@ void ChartController::executeDispatch_InsertMajorGrid()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
- AxisHelper::makeGridVisible( xAxis->getGridProperties() );
+ AxisHelper::makeGridVisible( xAxis->getGridProperties2() );
aUndoGuard.commit();
}
}
@@ -812,10 +925,10 @@ void ChartController::executeDispatch_DeleteMajorGrid()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
- AxisHelper::makeGridInvisible( xAxis->getGridProperties() );
+ AxisHelper::makeGridInvisible( xAxis->getGridProperties2() );
aUndoGuard.commit();
}
}
@@ -834,11 +947,11 @@ void ChartController::executeDispatch_InsertMinorGrid()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
- const Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
- for( Reference< beans::XPropertySet > const & props : aSubGrids)
+ std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
+ for( rtl::Reference< GridProperties > const & props : aSubGrids)
AxisHelper::makeGridVisible( props );
aUndoGuard.commit();
}
@@ -858,11 +971,11 @@ void ChartController::executeDispatch_DeleteMinorGrid()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
- const Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
- for( Reference< beans::XPropertySet > const & props : aSubGrids)
+ std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
+ for( rtl::Reference< ::chart::GridProperties > const & props : aSubGrids)
AxisHelper::makeGridInvisible( props );
aUndoGuard.commit();
}
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index f57a3b8e8f96..6bdedb0565b7 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -19,31 +19,27 @@
#include <ChartController.hxx>
-#include <ChartWindow.hxx>
#include <DrawViewWrapper.hxx>
#include <PositionAndSizeHelper.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartView.hxx>
#include "UndoGuard.hxx"
#include <ObjectNameProvider.hxx>
#include <DiagramHelper.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
#include <CommonConverters.hxx>
#include <svx/ActionDescriptionProvider.hxx>
-#include <comphelper/servicehelper.hxx>
#include <svx/svxids.hrc>
#include <svx/rectenum.hxx>
#include <svl/intitem.hxx>
#include <svx/svxdlg.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/svapp.hxx>
#include <memory>
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
static void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectangle& rPosAndSize, const awt::Size& rOriginalSize )
{
@@ -54,19 +50,18 @@ static void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::
RectPoint eRP = RectPoint::LT;
- const SfxPoolItem* pPoolItem=nullptr;
//read position
- if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem)==SfxItemState::SET)
- nPosX= static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
- if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem)==SfxItemState::SET)
- nPosY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ if (const SfxInt32Item* pPosXItem = rItemSet.GetItemIfSet(SID_ATTR_TRANSFORM_POS_X))
+ nPosX = pPosXItem->GetValue();
+ if (const SfxInt32Item* pPosYItem = rItemSet.GetItemIfSet(SID_ATTR_TRANSFORM_POS_Y))
+ nPosY = pPosYItem->GetValue();
//read size
- if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)==SfxItemState::SET)
- nSizX=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
- if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)==SfxItemState::SET)
- nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
- if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT,true,&pPoolItem)==SfxItemState::SET)
- eRP=static_cast<RectPoint>(static_cast<const SfxUInt16Item*>(pPoolItem)->GetValue());
+ if (const SfxUInt32Item* pWidthItem = rItemSet.GetItemIfSet(SID_ATTR_TRANSFORM_WIDTH))
+ nSizX = pWidthItem->GetValue();
+ if (const SfxUInt32Item* pHeightItem = rItemSet.GetItemIfSet(SID_ATTR_TRANSFORM_HEIGHT))
+ nSizY = pHeightItem->GetValue();
+ if (const SfxUInt16Item* pSizeItem = rItemSet.GetItemIfSet(SID_ATTR_TRANSFORM_SIZE_POINT))
+ eRP=static_cast<RectPoint>(pSizeItem->GetValue());
switch( eRP )
{
@@ -150,26 +145,21 @@ void ChartController::executeDispatch_PositionAndSize(const ::css::uno::Sequence
if (!pPool)
return;
- sal_uInt16 nWhich;
for (const auto& aProp: *pArgs)
{
sal_Int32 nValue = 0;
aProp.Value >>= nValue;
if (aProp.Name == "TransformPosX") {
- nWhich = pPool->GetWhich(SID_ATTR_TRANSFORM_POS_X);
- aItemSet.Put(SfxInt32Item(nWhich, nValue));
+ aItemSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X, nValue));
}
else if (aProp.Name == "TransformPosY") {
- nWhich = pPool->GetWhich(SID_ATTR_TRANSFORM_POS_Y);
- aItemSet.Put(SfxInt32Item(nWhich, nValue));
+ aItemSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y, nValue));
}
else if (aProp.Name == "TransformWidth") {
- nWhich = pPool->GetWhich(SID_ATTR_TRANSFORM_WIDTH);
- aItemSet.Put(SfxUInt32Item(nWhich, static_cast<sal_uInt32>(nValue)));
+ aItemSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_WIDTH, static_cast<sal_uInt32>(nValue)));
}
else if (aProp.Name == "TransformHeight") {
- nWhich = pPool->GetWhich(SID_ATTR_TRANSFORM_HEIGHT);
- aItemSet.Put(SfxUInt32Item(nWhich, static_cast<sal_uInt32>(nValue)));
+ aItemSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_HEIGHT, static_cast<sal_uInt32>(nValue)));
}
}
}
@@ -177,20 +167,18 @@ void ChartController::executeDispatch_PositionAndSize(const ::css::uno::Sequence
if(pOutItemSet || pArgs)
{
awt::Rectangle aOldObjectRect;
- ExplicitValueProvider* pProvider(comphelper::getFromUnoTunnel<ExplicitValueProvider>( m_xChartView ));
- if( pProvider )
- aOldObjectRect = pProvider->getRectangleOfObject(aCID);
+ if( m_xChartView )
+ aOldObjectRect = m_xChartView->getRectangleOfObject(aCID);
awt::Rectangle aNewObjectRect;
lcl_getPositionAndSizeFromItemSet( aItemSet, aNewObjectRect, ToSize(aOldObjectRect) );
- awt::Size aPageSize( ChartModelHelper::getPageSize( getChartModel() ) );
+ awt::Size aPageSize( getChartModel()->getPageSize() );
awt::Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
bool bChanged = false;
if ( eObjectType == OBJECTTYPE_LEGEND )
{
- ChartModel& rModel = dynamic_cast<ChartModel&>(*getModel());
- bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning(rModel, false , true);
+ bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning(*getChartModel(), false , true);
}
bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID(), getChartModel()
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index df0da042a218..762d730d0539 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -18,12 +18,11 @@
*/
#include <ChartController.hxx>
-#include <ChartWindow.hxx>
+#include <ChartView.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include <chartview/ChartSfxItemIds.hxx>
#include <ObjectIdentifier.hxx>
#include <chartview/ExplicitScaleValues.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
#include <dlg_ObjectProperties.hxx>
#include <dlg_View3D.hxx>
#include <dlg_InsertErrorBars.hxx>
@@ -34,16 +33,18 @@
#include <MultipleChartConverters.hxx>
#include <TitleItemConverter.hxx>
#include <LegendItemConverter.hxx>
+#include <DataTableItemConverter.hxx>
#include <RegressionCurveItemConverter.hxx>
#include <RegressionEquationItemConverter.hxx>
#include <ErrorBarItemConverter.hxx>
-#include <ChartModelHelper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <TitleHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ChartModel.hxx>
-#include <ColorPerPointHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
#include <Diagram.hxx>
#include <ControllerLockGuard.hxx>
#include "UndoGuard.hxx"
@@ -52,30 +53,30 @@
#include <strings.hrc>
#include <ReferenceSizeProvider.hxx>
#include <RegressionCurveHelper.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <RegressionCurveModel.hxx>
+#include <o3tl/string_view.hxx>
#include <com/sun/star/util/CloseVetoException.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-#include <comphelper/servicehelper.hxx>
#include <memory>
#include <vcl/svapp.hxx>
#include <svx/ActionDescriptionProvider.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Reference;
namespace
{
wrapper::ItemConverter* createItemConverter(
- const OUString & aObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel,
+ std::u16string_view aObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel,
const uno::Reference<uno::XComponentContext>& xContext, SdrModel& rDrawModel,
- ExplicitValueProvider* pExplicitValueProvider, ReferenceSizeProvider const * pRefSizeProvider )
+ ChartView* pExplicitValueProvider, ReferenceSizeProvider const * pRefSizeProvider )
{
wrapper::ItemConverter* pItemConverter=nullptr;
@@ -87,8 +88,8 @@ wrapper::ItemConverter* createItemConverter(
return nullptr;
}
- OUString aParticleID = ObjectIdentifier::getParticleID( aObjectCID );
- bool bAffectsMultipleObjects = aParticleID == "ALLELEMENTS";
+ std::u16string_view aParticleID = ObjectIdentifier::getParticleID( aObjectCID );
+ bool bAffectsMultipleObjects = aParticleID == u"ALLELEMENTS";
if( !bAffectsMultipleObjects )
{
uno::Reference< beans::XPropertySet > xObjectProperties =
@@ -98,6 +99,10 @@ wrapper::ItemConverter* createItemConverter(
//create itemconverter for a single object
switch(eObjectType)
{
+ case OBJECTTYPE_DATA_STOCK_LOSS:
+ case OBJECTTYPE_DATA_STOCK_GAIN:
+ case OBJECTTYPE_DIAGRAM_WALL:
+ case OBJECTTYPE_DIAGRAM_FLOOR:
case OBJECTTYPE_PAGE:
pItemConverter = new wrapper::GraphicPropertyItemConverter(
xObjectProperties, rDrawModel.GetItemPool(),
@@ -106,44 +111,37 @@ wrapper::ItemConverter* createItemConverter(
break;
case OBJECTTYPE_TITLE:
{
- std::unique_ptr<awt::Size> pRefSize;
+ std::optional<awt::Size> pRefSize;
if (pRefSizeProvider)
- pRefSize.reset(new awt::Size(pRefSizeProvider->getPageSize()));
+ pRefSize.emplace(pRefSizeProvider->getPageSize());
pItemConverter = new wrapper::TitleItemConverter(
xObjectProperties, rDrawModel.GetItemPool(), rDrawModel,
xChartModel,
- pRefSize.get());
+ pRefSize);
}
break;
case OBJECTTYPE_LEGEND:
{
- std::unique_ptr<awt::Size> pRefSize;
+ std::optional<awt::Size> pRefSize;
if (pRefSizeProvider)
- pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
+ pRefSize.emplace( pRefSizeProvider->getPageSize() );
pItemConverter = new wrapper::LegendItemConverter(
xObjectProperties, rDrawModel.GetItemPool(), rDrawModel,
xChartModel,
- pRefSize.get());
+ pRefSize);
}
break;
case OBJECTTYPE_LEGEND_ENTRY:
break;
case OBJECTTYPE_DIAGRAM:
break;
- case OBJECTTYPE_DIAGRAM_WALL:
- case OBJECTTYPE_DIAGRAM_FLOOR:
- pItemConverter = new wrapper::GraphicPropertyItemConverter(
- xObjectProperties, rDrawModel.GetItemPool(),
- rDrawModel, xChartModel,
- wrapper::GraphicObjectType::LineAndFillProperties );
- break;
case OBJECTTYPE_AXIS:
{
- std::unique_ptr<awt::Size> pRefSize;
+ std::optional<awt::Size> pRefSize;
if (pRefSizeProvider)
- pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
+ pRefSize.emplace( pRefSizeProvider->getPageSize() );
// the second property set contains the property CoordinateOrigin
// nOriginIndex is the index of the corresponding index of the
@@ -153,7 +151,7 @@ wrapper::ItemConverter* createItemConverter(
ExplicitIncrementData aExplicitIncrement;
if( pExplicitValueProvider )
pExplicitValueProvider->getExplicitValuesForAxis(
- uno::Reference< XAxis >( xObjectProperties, uno::UNO_QUERY ),
+ dynamic_cast< Axis* >( xObjectProperties.get() ),
aExplicitScale, aExplicitIncrement );
pItemConverter = new wrapper::AxisItemConverter(
@@ -161,7 +159,7 @@ wrapper::ItemConverter* createItemConverter(
rDrawModel,
xChartModel,
&aExplicitScale, &aExplicitIncrement,
- pRefSize.get() );
+ pRefSize );
}
break;
case OBJECTTYPE_AXIS_UNITLABEL:
@@ -169,40 +167,40 @@ wrapper::ItemConverter* createItemConverter(
case OBJECTTYPE_DATA_LABELS:
case OBJECTTYPE_DATA_LABEL:
{
- std::unique_ptr<awt::Size> pRefSize;
+ std::optional<awt::Size> pRefSize;
if (pRefSizeProvider)
- pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
+ pRefSize.emplace( pRefSizeProvider->getPageSize() );
- uno::Reference<XDataSeries> xSeries = ObjectIdentifier::getDataSeriesForCID(aObjectCID, xChartModel);
+ rtl::Reference<DataSeries> xSeries = ObjectIdentifier::getDataSeriesForCID(aObjectCID, xChartModel);
bool bDataSeries = eObjectType == OBJECTTYPE_DATA_LABELS;
- sal_Int32 nNumberFormat = ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties );
- sal_Int32 nPercentNumberFormat = ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
+ sal_Int32 nNumberFormat = xSeries->getExplicitNumberFormatKeyForDataLabel();
+ sal_Int32 nPercentNumberFormat = ChartView::getExplicitPercentageNumberFormatKeyForDataLabel(
xObjectProperties, xChartModel);
pItemConverter = new wrapper::TextLabelItemConverter(
xChartModel, xObjectProperties, xSeries,
- rDrawModel.GetItemPool(), pRefSize.get(), bDataSeries,
+ rDrawModel.GetItemPool(), pRefSize, bDataSeries,
nNumberFormat, nPercentNumberFormat);
}
break;
case OBJECTTYPE_DATA_SERIES:
case OBJECTTYPE_DATA_POINT:
{
- std::unique_ptr<awt::Size> pRefSize;
+ std::optional<awt::Size> pRefSize;
if (pRefSizeProvider)
- pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
+ pRefSize.emplace( pRefSizeProvider->getPageSize() );
wrapper::GraphicObjectType eMapTo =
wrapper::GraphicObjectType::FilledDataPoint;
- uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( aObjectCID, xChartModel );
- uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( aObjectCID, xChartModel );
+ rtl::Reference< ChartType > xChartType = xChartModel->getChartTypeOfSeries( xSeries );
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
- if( !ChartTypeHelper::isSupportingAreaProperties( xChartType, nDimensionCount ) )
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
+ if (xChartType.is() && !xChartType->isSupportingAreaProperties(nDimensionCount))
eMapTo = wrapper::GraphicObjectType::LineDataPoint;
bool bDataSeries = eObjectType == OBJECTTYPE_DATA_SERIES;
@@ -213,14 +211,14 @@ wrapper::ItemConverter* createItemConverter(
sal_Int32 nPointIndex = -1; /*-1 for whole series*/
if(!bDataSeries)
{
- nPointIndex = aParticleID.toInt32();
- uno::Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
+ nPointIndex = o3tl::toInt32(aParticleID);
bool bVaryColorsByPoint = false;
- if( xSeriesProp.is() &&
- (xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint) &&
+ if( xSeries.is() &&
+ // "VaryColorsByPoint"
+ (xSeries->getFastPropertyValue(PROP_DATASERIES_VARY_COLORS_BY_POINT) >>= bVaryColorsByPoint) &&
bVaryColorsByPoint )
{
- if( !ColorPerPointHelper::hasPointOwnColor( xSeriesProp, nPointIndex, xObjectProperties ) )
+ if( !xSeries->hasPointOwnColor( nPointIndex, xObjectProperties ) )
{
bUseSpecialFillColor = true;
OSL_ASSERT( xDiagram.is());
@@ -230,14 +228,13 @@ wrapper::ItemConverter* createItemConverter(
}
}
}
- sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties );
- sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
+ sal_Int32 nNumberFormat=xSeries->getExplicitNumberFormatKeyForDataLabel();
+ sal_Int32 nPercentNumberFormat=ChartView::getExplicitPercentageNumberFormatKeyForDataLabel(
xObjectProperties, xChartModel);
pItemConverter = new wrapper::DataPointItemConverter( xChartModel, xContext,
xObjectProperties, xSeries, rDrawModel.GetItemPool(), rDrawModel,
- xChartModel,
- eMapTo, pRefSize.get(), bDataSeries, bUseSpecialFillColor, nSpecialFillColor, true,
+ eMapTo, pRefSize, bDataSeries, bUseSpecialFillColor, nSpecialFillColor, true,
nNumberFormat, nPercentNumberFormat, nPointIndex );
break;
}
@@ -255,37 +252,37 @@ wrapper::ItemConverter* createItemConverter(
case OBJECTTYPE_DATA_ERRORS_Z:
pItemConverter = new wrapper::ErrorBarItemConverter(
xChartModel, xObjectProperties, rDrawModel.GetItemPool(),
- rDrawModel, xChartModel);
+ rDrawModel );
break;
case OBJECTTYPE_DATA_CURVE:
pItemConverter = new wrapper::RegressionCurveItemConverter(
- xObjectProperties, uno::Reference< chart2::XRegressionCurveContainer >(
- ObjectIdentifier::getDataSeriesForCID( aObjectCID, xChartModel ), uno::UNO_QUERY ),
- rDrawModel.GetItemPool(), rDrawModel,
- xChartModel);
+ xObjectProperties,
+ ObjectIdentifier::getDataSeriesForCID( aObjectCID, xChartModel ),
+ rDrawModel.GetItemPool(), rDrawModel,
+ xChartModel);
break;
case OBJECTTYPE_DATA_CURVE_EQUATION:
{
- std::unique_ptr<awt::Size> pRefSize;
+ std::optional<awt::Size> pRefSize;
if (pRefSizeProvider)
- pRefSize.reset(new awt::Size(pRefSizeProvider->getPageSize()));
+ pRefSize.emplace(pRefSizeProvider->getPageSize());
pItemConverter = new wrapper::RegressionEquationItemConverter(
xObjectProperties, rDrawModel.GetItemPool(), rDrawModel,
xChartModel,
- pRefSize.get());
+ pRefSize);
break;
}
case OBJECTTYPE_DATA_STOCK_RANGE:
break;
- case OBJECTTYPE_DATA_STOCK_LOSS:
- case OBJECTTYPE_DATA_STOCK_GAIN:
- pItemConverter = new wrapper::GraphicPropertyItemConverter(
+ case OBJECTTYPE_DATA_TABLE:
+ {
+ pItemConverter = new wrapper::DataTableItemConverter(
xObjectProperties, rDrawModel.GetItemPool(),
- rDrawModel, xChartModel,
- wrapper::GraphicObjectType::LineAndFillProperties );
- break;
+ rDrawModel, xChartModel);
+ }
+ break;
default: //OBJECTTYPE_UNKNOWN
break;
}
@@ -297,23 +294,23 @@ wrapper::ItemConverter* createItemConverter(
{
case OBJECTTYPE_TITLE:
pItemConverter = new wrapper::AllTitleItemConverter( xChartModel, rDrawModel.GetItemPool(),
- rDrawModel, xChartModel);
+ rDrawModel );
break;
case OBJECTTYPE_AXIS:
{
- std::unique_ptr<awt::Size> pRefSize;
+ std::optional<awt::Size> pRefSize;
if (pRefSizeProvider)
- pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
+ pRefSize.emplace( pRefSizeProvider->getPageSize() );
pItemConverter = new wrapper::AllAxisItemConverter(
xChartModel, rDrawModel.GetItemPool(),
- rDrawModel, pRefSize.get());
+ rDrawModel, pRefSize );
}
break;
case OBJECTTYPE_GRID:
case OBJECTTYPE_SUBGRID:
pItemConverter = new wrapper::AllGridItemConverter( xChartModel, rDrawModel.GetItemPool(),
- rDrawModel, xChartModel);
+ rDrawModel );
break;
default: //for this type it is not supported to change all elements at once
break;
@@ -342,7 +339,7 @@ OUString lcl_getTitleCIDForCommand( std::string_view rDispatchCommand, const rtl
else if( rDispatchCommand == "SecondaryYTitle" )
nTitleType = TitleHelper::SECONDARY_Y_AXIS_TITLE;
- uno::Reference< XTitle > xTitle( TitleHelper::getTitle( nTitleType, xChartModel ) );
+ rtl::Reference< Title > xTitle( TitleHelper::getTitle( nTitleType, xChartModel ) );
return ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, xChartModel );
}
@@ -374,14 +371,14 @@ OUString lcl_getAxisCIDForCommand( std::string_view rDispatchCommand, const rtl:
nDimensionIndex=1; bMainAxis=false;
}
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
- uno::Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) );
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram );
return ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, xChartModel );
}
OUString lcl_getGridCIDForCommand( std::string_view rDispatchCommand, const rtl::Reference<::chart::ChartModel>& xChartModel )
{
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
if( rDispatchCommand == "DiagramGridAll")
return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_GRID, u"ALLELEMENTS" );
@@ -416,7 +413,7 @@ OUString lcl_getGridCIDForCommand( std::string_view rDispatchCommand, const rtl:
nDimensionIndex=2; bMainGrid=false;
}
- uno::Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, true/*bMainAxis*/, xDiagram ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDimensionIndex, true/*bMainAxis*/, xDiagram );
sal_Int32 nSubGridIndex= bMainGrid ? -1 : 0;
OUString aCID( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGridIndex ) );
@@ -436,8 +433,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const rt
ObjectType eObjectType = OBJECTTYPE_UNKNOWN;
const ObjectType eSelectedType = ObjectIdentifier::getObjectType( rSelectedCID );
- uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSelectedCID, xChartDocument );
- uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( xSeries, uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSelectedCID, xChartDocument );
//legend
if( rDispatchCommand == "Legend" || rDispatchCommand == "FormatLegend" )
@@ -527,7 +523,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const rt
return rSelectedCID;
else
{
- sal_Int32 nPointIndex = ObjectIdentifier::getParticleID( rSelectedCID ).toInt32();
+ sal_Int32 nPointIndex = o3tl::toInt32(ObjectIdentifier::getParticleID( rSelectedCID ));
if( nPointIndex>=0 )
{
OUString aSeriesParticle = ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID );
@@ -548,8 +544,8 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const rt
else
return ObjectIdentifier::createDataCurveCID(
ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
- RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
- RegressionCurveHelper::getMeanValueLine( xRegCurveCnt ) ), true );
+ RegressionCurveHelper::getRegressionCurveIndex( xSeries,
+ RegressionCurveHelper::getMeanValueLine( xSeries ) ), true );
}
//trend line
else if( rDispatchCommand == "FormatTrendline" )
@@ -559,8 +555,8 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const rt
else
return ObjectIdentifier::createDataCurveCID(
ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
- RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
- RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ), false );
+ RegressionCurveHelper::getRegressionCurveIndex( xSeries,
+ RegressionCurveHelper::getFirstCurveNotMeanValueLine( xSeries ) ), false );
}
//trend line equation
else if( rDispatchCommand == "FormatTrendlineEquation" )
@@ -570,8 +566,8 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const rt
else
return ObjectIdentifier::createDataCurveEquationCID(
ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
- RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
- RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ) );
+ RegressionCurveHelper::getRegressionCurveIndex( xSeries,
+ RegressionCurveHelper::getFirstCurveNotMeanValueLine( xSeries ) ) );
}
// y error bars
else if( rDispatchCommand == "FormatXErrorBars" )
@@ -590,7 +586,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const rt
return rSelectedCID;
else
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartDocument );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartDocument );
return ObjectIdentifier::createClassifiedIdentifierForObject( xAxis , xChartDocument );
}
}
@@ -601,7 +597,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const rt
return rSelectedCID;
else
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartDocument );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartDocument );
return ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartDocument );
}
@@ -613,7 +609,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const rt
return rSelectedCID;
else
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartDocument );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartDocument );
return ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartDocument, 0 /*sub grid index*/ );
}
}
@@ -674,7 +670,7 @@ OUString lcl_getFormatCIDforSelectedCID( const OUString& rSelectedCID )
// some legend entries are handled as if they were data series
if( eObjectType==OBJECTTYPE_LEGEND_ENTRY )
{
- OUString aParentParticle( ObjectIdentifier::getFullParentParticle( rSelectedCID ) );
+ std::u16string_view aParentParticle( ObjectIdentifier::getFullParentParticle( rSelectedCID ) );
aFormatCID = ObjectIdentifier::createClassifiedIdentifierForParticle( aParentParticle );
}
@@ -691,24 +687,22 @@ void ChartController::executeDlg_ObjectProperties( const OUString& rSelectedObje
{
OUString aObjectCID = lcl_getFormatCIDforSelectedCID( rSelectedObjectCID );
- UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::ActionType::Format,
- ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aObjectCID ))),
- m_xUndoManager );
+ auto xUndoGuard = std::make_shared<UndoGuard>(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::ActionType::Format,
+ ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aObjectCID ))),
+ m_xUndoManager );
- bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, false );
- if( bSuccess )
- aUndoGuard.commit();
+ ChartController::executeDlg_ObjectProperties_withUndoGuard(std::move(xUndoGuard), aObjectCID, false );
}
-bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
- const OUString& rObjectCID, bool bSuccessOnUnchanged )
+void ChartController::executeDlg_ObjectProperties_withUndoGuard(
+ std::shared_ptr<UndoGuard> xUndoGuard, const OUString& rObjectCID, bool bSuccessOnUnchanged )
{
//return true if the properties were changed successfully
- bool bRet = false;
if( rObjectCID.isEmpty() )
{
- return bRet;
+ return;
}
try
{
@@ -716,26 +710,28 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
ObjectType eObjectType = ObjectIdentifier::getObjectType( rObjectCID );
if( eObjectType==OBJECTTYPE_UNKNOWN )
{
- return bRet;
+ return;
}
if( eObjectType==OBJECTTYPE_DIAGRAM_WALL || eObjectType==OBJECTTYPE_DIAGRAM_FLOOR )
{
- if( !DiagramHelper::isSupportingFloorAndWall( getFirstDiagram() ) )
- return bRet;
+ if( !getFirstDiagram()->isSupportingFloorAndWall() )
+ return;
}
//convert properties to ItemSet
- std::unique_ptr<ReferenceSizeProvider> pRefSizeProv(impl_createReferenceSizeProvider());
+ ReferenceSizeProvider aRefSizeProv(impl_createReferenceSizeProvider());
+
+ rtl::Reference<::chart::ChartModel> xChartDoc(getChartModel());
- std::unique_ptr<wrapper::ItemConverter> pItemConverter(
- createItemConverter( rObjectCID, getChartModel(), m_xCC,
+ std::shared_ptr<wrapper::ItemConverter> pItemConverter(
+ createItemConverter( rObjectCID, xChartDoc, m_xCC,
m_pDrawModelWrapper->getSdrModel(),
- comphelper::getFromUnoTunnel<ExplicitValueProvider>(m_xChartView),
- pRefSizeProv.get()));
+ m_xChartView.get(),
+ &aRefSizeProv));
if (!pItemConverter)
- return bRet;
+ return;
SfxItemSet aItemSet = pItemConverter->CreateEmptyItemSet();
@@ -746,52 +742,52 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
//prepare dialog
ObjectPropertiesDialogParameter aDialogParameter( rObjectCID );
- aDialogParameter.init( getChartModel() );
+ aDialogParameter.init(xChartDoc);
ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get() );
SolarMutexGuard aGuard;
- SchAttribTabDlg aDlg(
- GetChartFrame(), &aItemSet, &aDialogParameter,
- &aViewElementListProvider,
- uno::Reference< util::XNumberFormatsSupplier >(
- getModel(), uno::UNO_QUERY ) );
+ std::shared_ptr<SchAttribTabDlg> aDlgPtr = std::make_shared<SchAttribTabDlg>(
+ GetChartFrame(), &aItemSet, &aDialogParameter,
+ &aViewElementListProvider,
+ xChartDoc);
if(aDialogParameter.HasSymbolProperties())
{
uno::Reference< beans::XPropertySet > xObjectProperties =
- ObjectIdentifier::getObjectPropertySet( rObjectCID, getChartModel() );
- wrapper::DataPointItemConverter aSymbolItemConverter( getChartModel(), m_xCC
- , xObjectProperties, ObjectIdentifier::getDataSeriesForCID( rObjectCID, getChartModel() )
+ ObjectIdentifier::getObjectPropertySet( rObjectCID, xChartDoc );
+ wrapper::DataPointItemConverter aSymbolItemConverter( xChartDoc, m_xCC
+ , xObjectProperties, ObjectIdentifier::getDataSeriesForCID( rObjectCID, xChartDoc )
, m_pDrawModelWrapper->getSdrModel().GetItemPool()
, m_pDrawModelWrapper->getSdrModel()
- , getChartModel()
, wrapper::GraphicObjectType::FilledDataPoint );
SfxItemSet aSymbolShapeProperties(aSymbolItemConverter.CreateEmptyItemSet() );
aSymbolItemConverter.FillItemSet( aSymbolShapeProperties );
sal_Int32 const nStandardSymbol=0;//@todo get from somewhere
- std::unique_ptr<Graphic> pAutoSymbolGraphic(new Graphic( aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, &aSymbolShapeProperties ) ));
+ std::optional<Graphic> oAutoSymbolGraphic(std::in_place, aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, &aSymbolShapeProperties ) );
// note: the dialog takes the ownership of pSymbolShapeProperties and pAutoSymbolGraphic
- aDlg.setSymbolInformation( std::move(aSymbolShapeProperties), std::move(pAutoSymbolGraphic) );
+ aDlgPtr->setSymbolInformation( std::move(aSymbolShapeProperties), std::move(oAutoSymbolGraphic) );
}
if( aDialogParameter.HasStatisticProperties() )
{
- aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
- InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getChartModel(), m_xChartView, rObjectCID ) );
+ aDlgPtr->SetAxisMinorStepWidthForErrorBarDecimals(
+ InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( xChartDoc, m_xChartView, rObjectCID ) );
}
//open the dialog
- if (aDlg.run() == RET_OK || (bSuccessOnUnchanged && aDlg.DialogWasClosedWithOK()))
+ SfxTabDialogController::runAsync(aDlgPtr, [aDlgPtr, xChartDoc, pItemConverter=std::move(pItemConverter),
+ bSuccessOnUnchanged, xUndoGuard=std::move(xUndoGuard)] (int nResult)
{
- const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
- if(pOutItemSet)
- {
- ControllerLockGuardUNO aCLGuard( getChartModel());
- (void)pItemConverter->ApplyItemSet(*pOutItemSet); //model should be changed now
- bRet = true;
+ if (nResult == RET_OK || (bSuccessOnUnchanged && aDlgPtr->DialogWasClosedWithOK())) {
+ const SfxItemSet* pOutItemSet = aDlgPtr->GetOutputItemSet();
+ if(pOutItemSet) {
+ ControllerLockGuardUNO aCLGuard(xChartDoc);
+ (void)pItemConverter->ApplyItemSet(*pOutItemSet); //model should be changed now
+ xUndoGuard->commit();
+ }
}
- }
+ });
}
catch( const util::CloseVetoException& )
{
@@ -799,7 +795,6 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
catch( const uno::RuntimeException& )
{
}
- return bRet;
}
void ChartController::executeDispatch_View3D()
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index 100d210c2e9e..0cd974176672 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -26,9 +26,11 @@
#include <DrawViewWrapper.hxx>
#include <ChartWindow.hxx>
#include <ChartModel.hxx>
+#include <ChartView.hxx>
#include <TitleHelper.hxx>
#include <ObjectIdentifier.hxx>
#include <ControllerLockGuard.hxx>
+#include <comphelper/diagnose_ex.hxx>
#if !ENABLE_WASM_STRIP_ACCESSIBILITY
#include <AccessibleTextHelper.hxx>
#endif
@@ -42,9 +44,12 @@
#include <editeng/editids.hrc>
#include <vcl/svapp.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/chart2/XTitle.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/chart2/FormattedString.hpp>
#include <svl/stritem.hxx>
#include <editeng/fontitem.hxx>
+#include <editeng/section.hxx>
#include <memory>
namespace chart
@@ -72,9 +77,8 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner();
//#i77362 change notification for changes on additional shapes are missing
- uno::Reference< beans::XPropertySet > xChartViewProps( m_xChartView, uno::UNO_QUERY );
- if( xChartViewProps.is() )
- xChartViewProps->setPropertyValue( "SdrViewIsInEditMode", uno::Any(true) );
+ if( m_xChartView.is() )
+ m_xChartView->setPropertyValue( u"SdrViewIsInEditMode"_ustr, uno::Any(true) );
auto pChartWindow(GetChartWindow());
@@ -117,25 +121,17 @@ bool ChartController::EndTextEdit()
m_pDrawViewWrapper->SdrEndTextEdit();
//#i77362 change notification for changes on additional shapes are missing
- uno::Reference< beans::XPropertySet > xChartViewProps( m_xChartView, uno::UNO_QUERY );
- if( xChartViewProps.is() )
- xChartViewProps->setPropertyValue( "SdrViewIsInEditMode", uno::Any(false) );
+ if( m_xChartView.is() )
+ m_xChartView->setPropertyValue( u"SdrViewIsInEditMode"_ustr, uno::Any(false) );
SdrObject* pTextObject = m_pDrawViewWrapper->getTextEditObject();
if(!pTextObject)
return false;
- SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner();
OutlinerParaObject* pParaObj = pTextObject->GetOutlinerParaObject();
- if( !pParaObj || !pOutliner )
+ if( !pParaObj )
return true;
- pOutliner->SetText( *pParaObj );
-
- OUString aString = pOutliner->GetText(
- pOutliner->GetParagraph( 0 ),
- pOutliner->GetParagraphCount() );
-
OUString aObjectCID = m_aSelection.getSelectedCID();
if ( !aObjectCID.isEmpty() )
{
@@ -145,8 +141,11 @@ bool ChartController::EndTextEdit()
// lock controllers till end of block
ControllerLockGuardUNO aCLGuard( getChartModel() );
- TitleHelper::setCompleteString( aString, uno::Reference<
- css::chart2::XTitle >::query( xPropSet ), m_xCC );
+ uno::Sequence< uno::Reference< chart2::XFormattedString > > aNewFormattedTitle =
+ GetFormattedTitle(pParaObj->GetTextObject(), pTextObject->getUnoShape());
+
+ Title* pTitle = dynamic_cast<Title*>(xPropSet.get());
+ TitleHelper::setFormattedString(pTitle, aNewFormattedTitle);
OSL_ENSURE(m_pTextActionUndoGuard, "ChartController::EndTextEdit: no TextUndoGuard!");
if (m_pTextActionUndoGuard)
@@ -156,6 +155,70 @@ bool ChartController::EndTextEdit()
return true;
}
+uno::Sequence< uno::Reference< chart2::XFormattedString > > ChartController::GetFormattedTitle(
+ const EditTextObject& aEdit, const uno::Reference< drawing::XShape >& xShape )
+{
+ std::vector < uno::Reference< chart2::XFormattedString > > aNewStrings;
+ if (!xShape.is())
+ return comphelper::containerToSequence(aNewStrings);
+
+ uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
+ if (!xText.is())
+ return comphelper::containerToSequence(aNewStrings);
+
+ uno::Reference< text::XTextCursor > xSelectionCursor(xText->createTextCursor());
+ if (!xSelectionCursor.is())
+ return comphelper::containerToSequence(aNewStrings);
+
+ xSelectionCursor->gotoStart(false);
+
+ std::vector<editeng::Section> aSecAttrs;
+ aEdit.GetAllSections(aSecAttrs);
+
+ for (editeng::Section const& rSection : aSecAttrs)
+ {
+ if (!xSelectionCursor->isCollapsed())
+ xSelectionCursor->collapseToEnd();
+
+ xSelectionCursor->goRight(rSection.mnEnd - rSection.mnStart, true);
+
+ OUString aNewString = xSelectionCursor->getString();
+
+ bool bNextPara = (aEdit.GetParagraphCount() > 1 && rSection.mnParagraph != aEdit.GetParagraphCount() - 1 &&
+ aEdit.GetTextLen(rSection.mnParagraph) <= rSection.mnEnd);
+
+ uno::Reference< chart2::XFormattedString2 > xFmtStr = chart2::FormattedString::create(m_xCC);
+ if (bNextPara)
+ aNewString = aNewString + OUStringChar('\n');
+ xFmtStr->setString(aNewString);
+ aNewStrings.emplace_back(xFmtStr);
+
+ uno::Reference< beans::XPropertySetInfo > xInfo = xFmtStr->getPropertySetInfo();
+ uno::Reference< beans::XPropertySet > xSelectionProp(xSelectionCursor, uno::UNO_QUERY);
+ try
+ {
+ for (const beans::Property& rProp : xSelectionProp->getPropertySetInfo()->getProperties())
+ {
+ if (xInfo.is() && xInfo->hasPropertyByName(rProp.Name))
+ {
+ const uno::Any aValue = xSelectionProp->getPropertyValue(rProp.Name);
+ xFmtStr->setPropertyValue(rProp.Name, aValue);
+ }
+ }
+ }
+ catch ( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ aNewStrings.clear();
+ }
+
+ if (bNextPara)
+ xSelectionCursor->goRight(1, false); // next paragraph
+ }
+
+ return comphelper::containerToSequence(aNewStrings);
+}
+
void ChartController::executeDispatch_InsertSpecialCharacter()
{
SolarMutexGuard aGuard;
@@ -176,57 +239,59 @@ void ChartController::executeDispatch_InsertSpecialCharacter()
aSet.Put( SfxBoolItem( FN_PARAM_2, true ) ); //maybe not necessary in future
vcl::Font aCurFont = m_pDrawViewWrapper->getOutliner()->GetRefDevice()->GetFont();
- aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), SID_ATTR_CHAR_FONT ) );
-
- ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog(GetChartFrame(), aSet, nullptr));
- if( pDlg->Execute() != RET_OK )
- return;
-
- const SfxItemSet* pSet = pDlg->GetOutputItemSet();
- const SfxPoolItem* pItem=nullptr;
- OUString aString;
- if (pSet && pSet->GetItemState(SID_CHARMAP, true, &pItem) == SfxItemState::SET)
- if (auto pStringItem = dynamic_cast<const SfxStringItem*>(pItem))
- aString = pStringItem->GetValue();
-
- OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
- SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner();
+ aSet.Put( SvxFontItem( aCurFont.GetFamilyTypeMaybeAskConfig(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitchMaybeAskConfig(), aCurFont.GetCharSet(), SID_ATTR_CHAR_FONT ) );
- if(!pOutliner || !pOutlinerView)
- return;
-
- // insert string to outliner
-
- // prevent flicker
- pOutlinerView->HideCursor();
- pOutliner->SetUpdateLayout(false);
-
- // delete current selection by inserting empty String, so current
- // attributes become unique (sel. has to be erased anyway)
- pOutlinerView->InsertText(OUString());
-
- pOutlinerView->InsertText(aString, true);
-
- ESelection aSel = pOutlinerView->GetSelection();
- aSel.nStartPara = aSel.nEndPara;
- aSel.nStartPos = aSel.nEndPos;
- pOutlinerView->SetSelection(aSel);
+ VclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog(GetChartFrame(), aSet, nullptr));
+ pDlg->StartExecuteAsync(
+ [this, pDlg] (sal_Int32 nResult)->void
+ {
+ if (nResult == RET_OK)
+ {
+ const SfxItemSet* pSet = pDlg->GetOutputItemSet();
+ OUString aString;
+ if (pSet)
+ if (const SfxStringItem* pCharMapItem = pSet->GetItemIfSet(SID_CHARMAP))
+ aString = pCharMapItem->GetValue();
+
+ OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
+ SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner();
+
+ if(pOutliner && pOutlinerView)
+ {
+ // insert string to outliner
+
+ // prevent flicker
+ pOutlinerView->HideCursor();
+ pOutliner->SetUpdateLayout(false);
+
+ // delete current selection by inserting empty String, so current
+ // attributes become unique (sel. has to be erased anyway)
+ pOutlinerView->InsertText(OUString());
+
+ pOutlinerView->InsertText(aString, true);
+
+ ESelection aSel = pOutlinerView->GetSelection();
+ aSel.CollapseToEnd();
+ pOutlinerView->SetSelection(aSel);
+
+ // show changes
+ pOutliner->SetUpdateLayout(true);
+ pOutlinerView->ShowCursor();
+ }
+ }
+ pDlg->disposeOnce();
+ }
+ );
- // show changes
- pOutliner->SetUpdateLayout(true);
- pOutlinerView->ShowCursor();
}
-uno::Reference< css::accessibility::XAccessibleContext >
- ChartController::impl_createAccessibleTextContext()
+rtl::Reference< ::chart::AccessibleTextHelper >
+ ChartController::createAccessibleTextContext()
{
#if !ENABLE_WASM_STRIP_ACCESSIBILITY
- uno::Reference< css::accessibility::XAccessibleContext > xResult(
- new AccessibleTextHelper( m_pDrawViewWrapper.get() ));
-
- return xResult;
+ return new AccessibleTextHelper( m_pDrawViewWrapper.get() );
#else
- return uno::Reference< css::accessibility::XAccessibleContext >();
+ return {};
#endif
}
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 7b9c28de63e5..0539106c18d8 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -20,9 +20,9 @@
#include <ChartController.hxx>
#include <ChartWindow.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
#include <TitleHelper.hxx>
-#include <ThreeDHelper.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include "UndoGuard.hxx"
#include <ControllerLockGuard.hxx>
@@ -33,8 +33,11 @@
#include <chartview/DrawModelWrapper.hxx>
#include "ChartTransferable.hxx"
#include <DrawViewWrapper.hxx>
+#include <Legend.hxx>
#include <LegendHelper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include <RegressionCurveHelper.hxx>
#include "ShapeController.hxx"
#include <DiagramHelper.hxx>
@@ -42,15 +45,16 @@
#include <ObjectNameProvider.hxx>
#include <unonames.hxx>
+#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/awt/Gradient.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <docmodel/uno/UnoGradientTools.hxx>
#include <editeng/editview.hxx>
#include <editeng/outliner.hxx>
#include <svx/ActionDescriptionProvider.hxx>
@@ -70,12 +74,11 @@
#include <svx/unoapi.hxx>
#include <svx/unopage.hxx>
#include <svx/unoshape.hxx>
-#include <svx/xgrad.hxx>
#include <PropertyHelper.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <tools/debug.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/UnitConversion.hxx>
#include <memory>
@@ -92,16 +95,16 @@ namespace
{
bool lcl_deleteDataSeries(
- const OUString & rCID,
+ std::u16string_view rCID,
const rtl::Reference<::chart::ChartModel> & xModel,
const Reference< document::XUndoManager > & xUndoManager )
{
bool bResult = false;
- uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rCID, xModel ));
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rCID, xModel );
if( xSeries.is() && xModel.is())
{
- uno::Reference< chart2::XChartType > xChartType(
- DataSeriesHelper::getChartTypeOfSeries( xSeries, xModel->getFirstDiagram()));
+ rtl::Reference< ::chart::ChartType > xChartType =
+ DataSeriesHelper::getChartTypeOfSeries( xSeries, xModel->getFirstChartDiagram());
if( xChartType.is())
{
UndoGuard aUndoGuard(
@@ -109,10 +112,10 @@ bool lcl_deleteDataSeries(
ActionDescriptionProvider::ActionType::Delete, SchResId( STR_OBJECT_DATASERIES )),
xUndoManager );
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xModel );
- uno::Reference< chart2::XAxis > xAxis( DiagramHelper::getAttachedAxis( xSeries, xDiagram ) );
+ rtl::Reference< Diagram > xDiagram = xModel->getFirstChartDiagram();
+ rtl::Reference< Axis > xAxis = xDiagram->getAttachedAxis( xSeries );
- DataSeriesHelper::deleteSeries( xSeries, xChartType );
+ xChartType->deleteSeries( xSeries );
AxisHelper::hideAxisIfNoDataIsAttached( xAxis, xDiagram );
@@ -124,7 +127,7 @@ bool lcl_deleteDataSeries(
}
bool lcl_deleteDataCurve(
- const OUString & rCID,
+ std::u16string_view rCID,
const rtl::Reference<::chart::ChartModel> & xModel,
const Reference< document::XUndoManager > & xUndoManager )
{
@@ -157,20 +160,66 @@ bool lcl_deleteDataCurve(
return bResult;
}
+bool lcl_arePropertiesSame(const std::vector<Reference<beans::XPropertySet>>& xProperties,
+ OUString& aPropName)
+{
+ if (xProperties.size() == 1)
+ return true;
+ if (xProperties.size() < 1)
+ return false;
+
+ uno::Any aValue = xProperties[0]->getPropertyValue(aPropName);
+ for (std::size_t i = 1; i < xProperties.size(); i++)
+ {
+ if (aValue != xProperties[i]->getPropertyValue(aPropName))
+ return false;
+ }
+ return true;
+}
+
+// Cf. ChartColorWrapper::operator()
+std::pair<css::uno::Reference<css::beans::XPropertySet>, ObjectType>
+getSelectedGraphObject(const css::uno::Any& rSelection, const rtl::Reference<ChartModel>& pModel)
+{
+ if (OUString sCID; rSelection >>= sCID)
+ {
+ auto xPropSet(ObjectIdentifier::getObjectPropertySet(sCID, pModel));
+ ObjectType eType = ObjectIdentifier::getObjectType(sCID);
+ if (eType == ObjectType::OBJECTTYPE_DIAGRAM)
+ {
+ if (auto xDiagram = xPropSet.query<css::chart2::XDiagram>())
+ {
+ xPropSet = xDiagram->getWall();
+ eType = ObjectType::OBJECTTYPE_DIAGRAM_WALL;
+ }
+ }
+
+ return { xPropSet, eType };
+ }
+
+ if (css::uno::Reference<css::beans::XPropertySet> xSelection; rSelection >>= xSelection)
+ return { xSelection, ObjectType::OBJECTTYPE_SHAPE };
+
+ return {};
+}
+
+css::uno::Reference<css::beans::XPropertySet> getSelectedGraphObject(ChartController& rController)
+{
+ return getSelectedGraphObject(rController.getSelection(), rController.getChartModel()).first;
+}
+
} // anonymous namespace
-std::unique_ptr<ReferenceSizeProvider> ChartController::impl_createReferenceSizeProvider()
+ReferenceSizeProvider ChartController::impl_createReferenceSizeProvider()
{
- awt::Size aPageSize( ChartModelHelper::getPageSize( getChartModel() ) );
+ awt::Size aPageSize( getChartModel()->getPageSize() );
- return std::make_unique<ReferenceSizeProvider>(aPageSize, getChartModel());
+ return ReferenceSizeProvider(aPageSize, getChartModel());
}
void ChartController::impl_adaptDataSeriesAutoResize()
{
- std::unique_ptr<ReferenceSizeProvider> pRefSizeProvider(impl_createReferenceSizeProvider());
- if (pRefSizeProvider)
- pRefSizeProvider->setValuesAtAllDataSeries();
+ impl_createReferenceSizeProvider().setValuesAtAllDataSeries();
}
void ChartController::executeDispatch_NewArrangement()
@@ -181,7 +230,7 @@ void ChartController::executeDispatch_NewArrangement()
try
{
rtl::Reference<::chart::ChartModel> xModel( getChartModel() );
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xModel );
+ rtl::Reference< Diagram > xDiagram = xModel->getFirstChartDiagram();
if( xDiagram.is())
{
UndoGuard aUndoGuard(
@@ -190,20 +239,20 @@ void ChartController::executeDispatch_NewArrangement()
ControllerLockGuardUNO aCtlLockGuard( xModel );
// diagram
- xDiagram->setPropertyToDefault( "RelativeSize");
- xDiagram->setPropertyToDefault( "RelativePosition");
- xDiagram->setPropertyToDefault( "PosSizeExcludeAxes");
+ xDiagram->setPropertyToDefault( u"RelativeSize"_ustr);
+ xDiagram->setPropertyToDefault( u"RelativePosition"_ustr);
+ xDiagram->setPropertyToDefault( u"PosSizeExcludeAxes"_ustr);
// 3d rotation
- ThreeDHelper::set3DSettingsToDefault( xDiagram );
+ xDiagram->set3DSettingsToDefault();
// legend
- Reference< beans::XPropertyState > xLegendState( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xLegendState.is())
+ rtl::Reference< Legend > xLegend = xDiagram->getLegend2();
+ if( xLegend.is())
{
- xLegendState->setPropertyToDefault( "RelativePosition");
- xLegendState->setPropertyToDefault( "RelativeSize");
- xLegendState->setPropertyToDefault( "AnchorPosition");
+ xLegend->setPropertyToDefault( u"RelativePosition"_ustr);
+ xLegend->setPropertyToDefault( u"RelativeSize"_ustr);
+ xLegend->setPropertyToDefault( u"AnchorPosition"_ustr);
}
// titles
@@ -211,16 +260,16 @@ void ChartController::executeDispatch_NewArrangement()
eType < TitleHelper::NORMAL_TITLE_END;
++eType )
{
- Reference< beans::XPropertyState > xTitleState(
+ rtl::Reference< Title > xTitleState =
TitleHelper::getTitle(
- static_cast< TitleHelper::eTitleType >( eType ), xModel ), uno::UNO_QUERY );
+ static_cast< TitleHelper::eTitleType >( eType ), xModel );
if( xTitleState.is())
- xTitleState->setPropertyToDefault( "RelativePosition");
+ xTitleState->setPropertyToDefault( u"RelativePosition"_ustr);
}
// regression curve equations
- std::vector< Reference< chart2::XRegressionCurve > > aRegressionCurves(
- RegressionCurveHelper::getAllRegressionCurvesNotMeanValueLine( xDiagram ));
+ std::vector< rtl::Reference< RegressionCurveModel > > aRegressionCurves =
+ xDiagram->getAllRegressionCurvesNotMeanValueLine();
// reset equation position
for( const auto& xCurve : aRegressionCurves )
@@ -243,14 +292,239 @@ void ChartController::executeDispatch_ScaleText()
m_xUndoManager );
ControllerLockGuardUNO aCtlLockGuard( getChartModel() );
- std::unique_ptr<ReferenceSizeProvider> pRefSizeProv(impl_createReferenceSizeProvider());
- OSL_ASSERT(pRefSizeProv);
- if (pRefSizeProv)
- pRefSizeProv->toggleAutoResizeState();
+ impl_createReferenceSizeProvider().toggleAutoResizeState();
aUndoGuard.commit();
}
+void ChartController::executeDispatch_FontBold(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ OUString aPropName = u"CharWeight"_ustr;
+ float nFontWeight = awt::FontWeight::NORMAL;
+ if (lcl_arePropertiesSame(xProperties, aPropName))
+ {
+ xProperties[0]->getPropertyValue(aPropName) >>= nFontWeight;
+ }
+ nFontWeight = (nFontWeight == awt::FontWeight::NORMAL) ? awt::FontWeight::BOLD
+ : awt::FontWeight::NORMAL;
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(aPropName, uno::Any(nFontWeight));
+}
+
+void ChartController::executeDispatch_FontName(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs)
+{
+ // the sent font may have a lot of properties that we could set.
+ // but now we set only this
+ awt::FontDescriptor aFont;
+ rArgs[0].Value >>= aFont;
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(u"CharFontName"_ustr, css::uno::Any(aFont.Name));
+}
+
+void ChartController::executeDispatch_FontHeight(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs)
+{
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(u"CharHeight"_ustr, rArgs[0].Value);
+}
+
+void ChartController::executeDispatch_FontItalic(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ OUString aPropName = u"CharPosture"_ustr;
+ awt::FontSlant nFontItalic = awt::FontSlant::FontSlant_NONE;
+ if (lcl_arePropertiesSame(xProperties, aPropName))
+ {
+ xProperties[0]->getPropertyValue(aPropName) >>= nFontItalic;
+ }
+ nFontItalic = (nFontItalic == awt::FontSlant::FontSlant_NONE ? awt::FontSlant::FontSlant_ITALIC
+ : awt::FontSlant::FontSlant_NONE);
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(aPropName, css::uno::Any(nFontItalic));
+}
+
+void ChartController::executeDispatch_FontUnderline(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs)
+{
+ OUString aPropName = u"CharUnderline"_ustr;
+ sal_Int16 nFontUnderline = 0;
+ sal_Int32 nFontUnderline32 = 0;
+ if (!(rArgs[0].Value >>= nFontUnderline) && (rArgs[0].Value >>= nFontUnderline32))
+ {
+ nFontUnderline = nFontUnderline32;
+ }
+ else
+ {
+ if (lcl_arePropertiesSame(xProperties, aPropName))
+ {
+ xProperties[0]->getPropertyValue(aPropName) >>= nFontUnderline;
+ }
+ nFontUnderline = (nFontUnderline == 0 ? 1 : 0);
+ }
+
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(aPropName, css::uno::Any(nFontUnderline));
+}
+
+void ChartController::executeDispatch_FontStrikeout(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ OUString aPropName = u"CharStrikeout"_ustr;
+ sal_Int16 nFontStrikeout = 0;
+ if (lcl_arePropertiesSame(xProperties, aPropName))
+ {
+ xProperties[0]->getPropertyValue(aPropName) >>= nFontStrikeout;
+ }
+ nFontStrikeout = (nFontStrikeout == 0 ? 1 : 0);
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(aPropName, css::uno::Any(nFontStrikeout));
+}
+
+void ChartController::executeDispatch_FontShadowed(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ OUString aPropName = u"CharShadowed"_ustr;
+ bool bFontShadowed = false;
+ if (lcl_arePropertiesSame(xProperties, aPropName))
+ {
+ xProperties[0]->getPropertyValue(aPropName) >>= bFontShadowed;
+ }
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(u"CharShadowed"_ustr, css::uno::Any(!bFontShadowed));
+}
+
+void ChartController::executeDispatch_FontColor(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs)
+{
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(u"CharColor"_ustr, rArgs[0].Value);
+}
+
+void ChartController::executeDispatch_FontGrow(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ {
+ float nFontHeight = 0;
+ xProperties[i]->getPropertyValue(u"CharHeight"_ustr) >>= nFontHeight;
+ if (nFontHeight > 0)
+ {
+ nFontHeight = ceil(nFontHeight); //round
+ nFontHeight += 1;
+ if (nFontHeight > 999)
+ nFontHeight = 999;
+ xProperties[i]->setPropertyValue(u"CharHeight"_ustr, css::uno::Any(nFontHeight));
+ }
+ }
+}
+
+void ChartController::executeDispatch_FontShrink(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ {
+ float nFontHeight = 0;
+ xProperties[i]->getPropertyValue(u"CharHeight"_ustr) >>= nFontHeight;
+ if (nFontHeight > 0)
+ {
+ if (nFontHeight - ceil(nFontHeight) >= 0.4)
+ nFontHeight = ceil(nFontHeight); //round
+ else
+ {
+ nFontHeight -= 1;
+ if (nFontHeight < 2)
+ nFontHeight = 2;
+ }
+ xProperties[i]->setPropertyValue(u"CharHeight"_ustr, css::uno::Any(nFontHeight));
+ }
+ }
+}
+
+void ChartController::executeDispatch_FontReset(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ {
+ xProperties[i]->setPropertyValue(u"CharFontName"_ustr,
+ css::uno::Any(OUString("Liberation Sans")));
+ xProperties[i]->setPropertyValue(u"CharHeight"_ustr, css::uno::Any(float(13)));
+ xProperties[i]->setPropertyValue(u"CharWeight"_ustr, uno::Any(float(100)));
+ xProperties[i]->setPropertyValue(u"CharPosture"_ustr,
+ css::uno::Any(awt::FontSlant::FontSlant_NONE));
+ xProperties[i]->setPropertyValue(u"CharUnderline"_ustr, css::uno::Any(sal_Int16(0)));
+ xProperties[i]->setPropertyValue(u"CharStrikeout"_ustr, css::uno::Any(sal_Int16(0)));
+ xProperties[i]->setPropertyValue(u"CharShadowed"_ustr, css::uno::Any(false));
+ xProperties[i]->setPropertyValue(u"CharColor"_ustr, css::uno::Any(Color(0)));
+
+ xProperties[i]->setPropertyValue(u"CharKerning"_ustr, css::uno::Any(sal_Int16(0)));
+ xProperties[i]->setPropertyValue(u"CharEscapement"_ustr, css::uno::Any(sal_Int16(0)));
+ xProperties[i]->setPropertyValue(u"CharEscapementHeight"_ustr,
+ css::uno::Any(sal_Int8(100)));
+ }
+}
+
+void ChartController::executeDispatch_FontSpacing(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArgs)
+{
+ sal_Int16 nKerning = 0;
+ rArgs[0].Value >>= nKerning;
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ xProperties[i]->setPropertyValue(u"CharKerning"_ustr, css::uno::Any(nKerning));
+}
+
+void ChartController::executeDispatch_FontSuperScript(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ sal_Int16 nCharEscapement = 0;
+ xProperties[0]->getPropertyValue(u"CharEscapement"_ustr) >>= nCharEscapement;
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ {
+ if (nCharEscapement > 0)
+ {
+ xProperties[i]->setPropertyValue(u"CharEscapement"_ustr, css::uno::Any(sal_Int16(0)));
+ xProperties[i]->setPropertyValue(u"CharEscapementHeight"_ustr,
+ css::uno::Any(sal_Int8(100)));
+ }
+ else
+ {
+ xProperties[i]->setPropertyValue(u"CharEscapement"_ustr,
+ css::uno::Any(sal_Int16(14000)));
+ xProperties[i]->setPropertyValue(u"CharEscapementHeight"_ustr,
+ css::uno::Any(sal_Int8(58)));
+ }
+ }
+}
+
+void ChartController::executeDispatch_FontSubScript(
+ const std::vector<css::uno::Reference<css::beans::XPropertySet>>& xProperties)
+{
+ sal_Int16 nCharEscapement = 0;
+ xProperties[0]->getPropertyValue(u"CharEscapement"_ustr) >>= nCharEscapement;
+ for (std::size_t i = 0; i < xProperties.size(); i++)
+ {
+ if (nCharEscapement < 0)
+ {
+ xProperties[i]->setPropertyValue(u"CharEscapement"_ustr, css::uno::Any(sal_Int16(0)));
+ xProperties[i]->setPropertyValue(u"CharEscapementHeight"_ustr,
+ css::uno::Any(sal_Int8(100)));
+ }
+ else
+ {
+ xProperties[i]->setPropertyValue(u"CharEscapement"_ustr,
+ css::uno::Any(sal_Int16(-14000)));
+ xProperties[i]->setPropertyValue(u"CharEscapementHeight"_ustr,
+ css::uno::Any(sal_Int8(58)));
+ }
+ }
+}
+
void ChartController::executeDispatch_Paste()
{
SolarMutexGuard aGuard;
@@ -260,7 +534,7 @@ void ChartController::executeDispatch_Paste()
Graphic aGraphic;
// paste location: center of window
- Point aPos = pChartWindow->PixelToLogic( tools::Rectangle( {}, pChartWindow->GetSizePixel()).Center());
+ Point aPos = pChartWindow->PixelToLogic( tools::Rectangle(Point{}, pChartWindow->GetSizePixel()).Center());
// handle different formats
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pChartWindow ));
@@ -268,8 +542,7 @@ void ChartController::executeDispatch_Paste()
{
if ( aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) )
{
- tools::SvRef<SotTempStream> xStm;
- if ( aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING, xStm ) )
+ if (std::unique_ptr<SvStream> xStm = aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING) )
{
xStm->Seek( 0 );
Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( *xStm ) );
@@ -286,8 +559,7 @@ void ChartController::executeDispatch_Paste()
else if ( aDataHelper.HasFormat( SotClipboardFormatId::SVXB ) )
{
// graphic exchange format (graphic manager bitmap format?)
- tools::SvRef<SotTempStream> xStm;
- if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB, xStm ))
+ if (std::unique_ptr<SvStream> xStm = aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB ))
{
TypeSerializer aSerializer(*xStm);
aSerializer.readGraphic(aGraphic);
@@ -315,8 +587,8 @@ void ChartController::executeDispatch_Paste()
if( m_pDrawViewWrapper )
{
OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
- if( pOutlinerView )//in case of edit mode insert into edited string
- pOutlinerView->InsertText( aString );
+ if (pOutlinerView)//in case of edit mode insert the formatted string
+ pOutlinerView->PasteSpecial();
else
{
impl_PasteStringAsTextShape( aString, awt::Point( 0, 0 ) );
@@ -343,38 +615,50 @@ void ChartController::impl_PasteGraphic(
DBG_TESTSOLARMUTEX();
// note: the XPropertySet of the model is the old API. Also the property
// "AdditionalShapes" that is used there.
- uno::Reference< beans::XPropertySet > xModelProp( getModel(), uno::UNO_QUERY );
+ rtl::Reference< ChartModel > xModel = getChartModel();
DrawModelWrapper * pDrawModelWrapper( GetDrawModelWrapper());
- if( ! (xGraphic.is() && xModelProp.is()))
+ if( ! (xGraphic.is() && xModel.is()))
return;
rtl::Reference<SvxGraphicObject> xGraphicShape = new SvxGraphicObject(nullptr);
xGraphicShape->setShapeKind(SdrObjKind::Graphic);
- uno::Reference< drawing::XShapes > xPage = pDrawModelWrapper->getMainDrawPage();
+ rtl::Reference< SvxDrawPage > xPage = pDrawModelWrapper->getMainDrawPage();
if( xPage.is())
{
xPage->add( xGraphicShape );
//need to change the model state manually
- {
- uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY );
- if( xModifiable.is() )
- xModifiable->setModified( true );
- }
+ xModel->setModified( true );
//select new shape
m_aSelection.setSelection( xGraphicShape );
m_aSelection.applySelection( m_pDrawViewWrapper.get() );
}
- xGraphicShape->SvxShape::setPropertyValue( "Graphic", uno::Any( xGraphic ));
+ xGraphicShape->SvxShape::setPropertyValue( u"Graphic"_ustr, uno::Any( xGraphic ));
awt::Size aGraphicSize( 1000, 1000 );
+ bool bGotGraphicSize = false;
+ try
+ {
+ bGotGraphicSize = xGraphicShape->SvxShape::getPropertyValue( u"Size100thMM"_ustr) >>= aGraphicSize;
+ }
+ catch (css::beans::UnknownPropertyException& )
+ {}
auto pChartWindow(GetChartWindow());
// first try size in 100th mm, then pixel size
- if( ! ( xGraphicShape->SvxShape::getPropertyValue( "Size100thMM") >>= aGraphicSize ) &&
- ( ( xGraphicShape->SvxShape::getPropertyValue( "SizePixel") >>= aGraphicSize ) && pChartWindow ))
+ if( !bGotGraphicSize )
{
- ::Size aVCLSize( pChartWindow->PixelToLogic( Size( aGraphicSize.Width, aGraphicSize.Height )));
- aGraphicSize.Width = aVCLSize.getWidth();
- aGraphicSize.Height = aVCLSize.getHeight();
+ bool bGotSizePixel = false;
+ try
+ {
+ bGotSizePixel = xGraphicShape->SvxShape::getPropertyValue( u"SizePixel"_ustr) >>= aGraphicSize;
+ }
+ catch (css::beans::UnknownPropertyException& )
+ {}
+ if ( bGotSizePixel && pChartWindow )
+ {
+ ::Size aVCLSize( pChartWindow->PixelToLogic( Size( aGraphicSize.Width, aGraphicSize.Height )));
+ aGraphicSize.Width = aVCLSize.getWidth();
+ aGraphicSize.Height = aVCLSize.getHeight();
+ }
}
xGraphicShape->setSize( aGraphicSize );
xGraphicShape->setPosition( awt::Point( 0, 0 ) );
@@ -386,7 +670,7 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
if ( !(pDrawModelWrapper && m_pDrawViewWrapper) )
return;
- Reference< drawing::XDrawPage > xDestPage( pDrawModelWrapper->getMainDrawPage() );
+ rtl::Reference< SvxDrawPage > xDestPage( pDrawModelWrapper->getMainDrawPage() );
SdrPage* pDestPage = GetSdrPageFromXDrawPage( xDestPage );
if ( !pDestPage )
return;
@@ -402,7 +686,9 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
{
SdrObject* pObj(aIter.Next());
// Clone to new SdrModel
- SdrObject* pNewObj(pObj ? pObj->CloneSdrObject(pDrawModelWrapper->getSdrModel()) : nullptr);
+ rtl::Reference<SdrObject> pNewObj;
+ if (pObj)
+ pNewObj = pObj->CloneSdrObject(pDrawModelWrapper->getSdrModel());
if ( pNewObj )
{
@@ -413,14 +699,14 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
xShape->setPosition( awt::Point( 0, 0 ) );
}
- pDestPage->InsertObject( pNewObj );
+ pDestPage->InsertObject( pNewObj.get() );
m_pDrawViewWrapper->AddUndo( std::make_unique<SdrUndoInsertObj>( *pNewObj ) );
- xSelShape = xShape;
+ xSelShape = std::move(xShape);
}
}
}
- Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY );
+ rtl::Reference< ChartModel > xModifiable = getChartModel();
if ( xModifiable.is() )
{
xModifiable->setModified( true );
@@ -441,7 +727,7 @@ void ChartController::impl_PasteStringAsTextShape( const OUString& rString, cons
if ( !(pDrawModelWrapper && m_pDrawViewWrapper) )
return;
- const Reference< drawing::XDrawPage >& xDrawPage( pDrawModelWrapper->getMainDrawPage() );
+ const rtl::Reference< SvxDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
OSL_ASSERT( xDrawPage.is() );
if ( !xDrawPage )
@@ -456,14 +742,14 @@ void ChartController::impl_PasteStringAsTextShape( const OUString& rString, cons
xTextShape->setString( rString );
float fCharHeight = 10.0;
- xTextShape->SvxShape::setPropertyValue( "TextAutoGrowHeight", uno::Any( true ) );
- xTextShape->SvxShape::setPropertyValue( "TextAutoGrowWidth", uno::Any( true ) );
- xTextShape->SvxShape::setPropertyValue( "CharHeight", uno::Any( fCharHeight ) );
- xTextShape->SvxShape::setPropertyValue( "CharHeightAsian", uno::Any( fCharHeight ) );
- xTextShape->SvxShape::setPropertyValue( "CharHeightComplex", uno::Any( fCharHeight ) );
- xTextShape->SvxShape::setPropertyValue( "TextVerticalAdjust", uno::Any( drawing::TextVerticalAdjust_CENTER ) );
- xTextShape->SvxShape::setPropertyValue( "TextHorizontalAdjust", uno::Any( drawing::TextHorizontalAdjust_CENTER ) );
- xTextShape->SvxShape::setPropertyValue( "CharFontName", uno::Any( OUString("Albany") ) );
+ xTextShape->SvxShape::setPropertyValue( u"TextAutoGrowHeight"_ustr, uno::Any( true ) );
+ xTextShape->SvxShape::setPropertyValue( u"TextAutoGrowWidth"_ustr, uno::Any( true ) );
+ xTextShape->SvxShape::setPropertyValue( u"CharHeight"_ustr, uno::Any( fCharHeight ) );
+ xTextShape->SvxShape::setPropertyValue( u"CharHeightAsian"_ustr, uno::Any( fCharHeight ) );
+ xTextShape->SvxShape::setPropertyValue( u"CharHeightComplex"_ustr, uno::Any( fCharHeight ) );
+ xTextShape->SvxShape::setPropertyValue( u"TextVerticalAdjust"_ustr, uno::Any( drawing::TextVerticalAdjust_CENTER ) );
+ xTextShape->SvxShape::setPropertyValue( u"TextHorizontalAdjust"_ustr, uno::Any( drawing::TextHorizontalAdjust_CENTER ) );
+ xTextShape->SvxShape::setPropertyValue( u"CharFontName"_ustr, uno::Any( u"Albany"_ustr ) );
xTextShape->setPosition( rPosition );
@@ -566,10 +852,17 @@ bool ChartController::isObjectDeleteable( const uno::Any& rSelection )
bool ChartController::isShapeContext() const
{
return m_aSelection.isAdditionalShapeSelected() ||
- ( m_pDrawViewWrapper && m_pDrawViewWrapper->AreObjectsMarked() &&
+ ( m_pDrawViewWrapper && m_pDrawViewWrapper->GetMarkedObjectList().GetMarkCount() != 0 &&
( m_pDrawViewWrapper->GetCurrentObjIdentifier() == SdrObjKind::Text ) );
}
+bool ChartController::IsTextEdit() const
+{
+ // only Title objects and additional shapes are editable textshapes in chart
+ return m_pDrawViewWrapper && m_pDrawViewWrapper->IsTextEdit() &&
+ (m_aSelection.isTitleObjectSelected() || m_aSelection.isAdditionalShapeSelected());
+}
+
void ChartController::impl_ClearSelection()
{
if( m_aSelection.hasSelection())
@@ -591,7 +884,7 @@ bool ChartController::executeDispatch_Delete()
return false;
//remove chart object
- uno::Reference< chart2::XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY );
+ rtl::Reference< ChartModel > xChartDoc = getChartModel();
if( !xChartDoc.is() )
return false;
@@ -612,17 +905,17 @@ bool ChartController::executeDispatch_Delete()
}
case OBJECTTYPE_LEGEND:
{
- uno::Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram());
+ rtl::Reference< Diagram > xDiagram( xChartDoc->getFirstChartDiagram());
if( xDiagram.is())
{
- uno::Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xLegendProp.is())
+ rtl::Reference< Legend > xLegend( xDiagram->getLegend2() );
+ if( xLegend.is())
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::ActionType::Delete, SchResId( STR_OBJECT_LEGEND )),
m_xUndoManager );
- xLegendProp->setPropertyValue( "Show", uno::Any( false ));
+ xLegend->setPropertyValue( u"Show"_ustr, uno::Any( false ));
bReturn = true;
aUndoGuard.commit();
}
@@ -695,10 +988,10 @@ bool ChartController::executeDispatch_Delete()
m_xUndoManager );
{
ControllerLockGuardUNO aCtlLockGuard( xModel );
- xEqProp->setPropertyValue( "ShowEquation", uno::Any( false ));
- xEqProp->setPropertyValue( "XName", uno::Any( OUString("x") ));
- xEqProp->setPropertyValue( "YName", uno::Any( OUString("f(x)") ));
- xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::Any( false ));
+ xEqProp->setPropertyValue( u"ShowEquation"_ustr, uno::Any( false ));
+ xEqProp->setPropertyValue( u"XName"_ustr, uno::Any( u"x"_ustr ));
+ xEqProp->setPropertyValue( u"YName"_ustr, uno::Any( u"f(x)"_ustr ));
+ xEqProp->setPropertyValue( u"ShowCorrelationCoefficient"_ustr, uno::Any( false ));
}
bReturn = true;
aUndoGuard.commit();
@@ -731,7 +1024,7 @@ bool ChartController::executeDispatch_Delete()
{
ControllerLockGuardUNO aCtlLockGuard( xModel );
xErrorBarProp->setPropertyValue(
- "ErrorBarStyle",
+ u"ErrorBarStyle"_ustr,
uno::Any( css::chart::ErrorBarStyle::NONE ));
}
bReturn = true;
@@ -762,9 +1055,9 @@ bool ChartController::executeDispatch_Delete()
aLabel.ShowSeriesName = false;
if( aObjectType == OBJECTTYPE_DATA_LABELS )
{
- uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( aCID, getChartModel() ));
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_LABEL, uno::Any(aLabel) );
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any() );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( aCID, getChartModel() );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( CHART_UNONAME_LABEL, uno::Any(aLabel) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any() );
}
else
{
@@ -819,20 +1112,19 @@ bool ChartController::executeDispatch_Delete()
void ChartController::executeDispatch_ToggleLegend()
{
- Reference< frame::XModel > xModel( getModel() );
+ rtl::Reference< ChartModel > xModel = getChartModel();
UndoGuard aUndoGuard(
SchResId( STR_ACTION_TOGGLE_LEGEND ), m_xUndoManager );
- ChartModel& rModel = dynamic_cast<ChartModel&>(*xModel);
- Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend(rModel), uno::UNO_QUERY );
+ rtl::Reference< Legend > xLegendProp = LegendHelper::getLegend(*xModel);
bool bChanged = false;
if( xLegendProp.is())
{
try
{
bool bShow = false;
- if( xLegendProp->getPropertyValue( "Show") >>= bShow )
+ if( xLegendProp->getPropertyValue( u"Show"_ustr) >>= bShow )
{
- xLegendProp->setPropertyValue( "Show", uno::Any( ! bShow ));
+ xLegendProp->setPropertyValue( u"Show"_ustr, uno::Any( ! bShow ));
bChanged = true;
}
}
@@ -843,7 +1135,7 @@ void ChartController::executeDispatch_ToggleLegend()
}
else
{
- xLegendProp.set( LegendHelper::getLegend(rModel, m_xCC, true), uno::UNO_QUERY );
+ xLegendProp = LegendHelper::getLegend(*xModel, m_xCC, true);
if( xLegendProp.is())
bChanged = true;
}
@@ -918,18 +1210,22 @@ void ChartController::executeDispatch_ToggleGridVertical()
aUndoGuard.commit();
}
-void ChartController::executeDispatch_FillColor(sal_uInt32 nColor)
+void ChartController::executeDispatch_FillColor(const css::uno::Any& rColor)
{
try
{
- OUString aCID( m_aSelection.getSelectedCID() );
rtl::Reference<::chart::ChartModel> xChartModel = getChartModel();
if( xChartModel.is() )
{
- Reference< beans::XPropertySet > xPointProperties(
- ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ) );
+ const auto [xPointProperties, eType]
+ = getSelectedGraphObject(getSelection(), xChartModel);
if( xPointProperties.is() )
- xPointProperties->setPropertyValue( "FillColor", uno::Any( nColor ) );
+ xPointProperties->setPropertyValue(u"FillColor"_ustr, rColor);
+
+ if (eType == OBJECTTYPE_DATA_SERIES || eType == OBJECTTYPE_DATA_POINT)
+ {
+ xChartModel->clearColorPalette();
+ }
}
}
catch( const uno::Exception& )
@@ -938,10 +1234,10 @@ void ChartController::executeDispatch_FillColor(sal_uInt32 nColor)
}
}
-void ChartController::executeDispatch_FillGradient(OUString sJSONGradient)
+void ChartController::executeDispatch_FillGradient(std::u16string_view sJSONGradient)
{
- XGradient aXGradient = XGradient::fromJSON(sJSONGradient);
- css::awt::Gradient aGradient = aXGradient.toGradientUNO();
+ basegfx::BGradient aBGradient = basegfx::BGradient::fromJSON(sJSONGradient);
+ css::awt::Gradient aGradient = model::gradient::createUnoGradient2(aBGradient);
try
{
@@ -955,15 +1251,16 @@ void ChartController::executeDispatch_FillGradient(OUString sJSONGradient)
if( xPropSet.is() )
{
- OUString aPrefferedName = OUString::number(static_cast<sal_Int32>(aXGradient.GetStartColor()))
- + OUString::number(static_cast<sal_Int32>(aXGradient.GetEndColor()))
- + OUString::number(static_cast<sal_Int32>(aXGradient.GetAngle().get()));
+ OUString aPrefferedName =
+ OUString::number(static_cast<sal_Int32>(Color(aBGradient.GetColorStops().front().getStopColor())))
+ + OUString::number(static_cast<sal_Int32>(Color(aBGradient.GetColorStops().back().getStopColor())))
+ + OUString::number(static_cast<sal_Int32>(aBGradient.GetAngle().get()));
OUString aNewName = PropertyHelper::addGradientUniqueNameToTable(css::uno::Any(aGradient),
xChartModel,
aPrefferedName);
- xPropSet->setPropertyValue("FillGradientName", css::uno::Any(aNewName));
+ xPropSet->setPropertyValue(u"FillGradientName"_ustr, css::uno::Any(aNewName));
}
}
}
@@ -973,29 +1270,12 @@ void ChartController::executeDispatch_FillGradient(OUString sJSONGradient)
}
}
-void ChartController::executeDispatch_LineColor(sal_uInt32 nColor)
+void ChartController::executeDispatch_LineColor(const css::uno::Any& rColor)
{
try
{
- OUString aCID( m_aSelection.getSelectedCID() );
- rtl::Reference<::chart::ChartModel> xChartModel = getChartModel();
- if( xChartModel.is() )
- {
- Reference< beans::XPropertySet > xPropSet(
- ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ) );
-
- ObjectType eType = ObjectIdentifier::getObjectType(aCID);
- if (eType == OBJECTTYPE_DIAGRAM)
- {
- css::uno::Reference<css::chart2::XDiagram> xDiagram(
- xPropSet, css::uno::UNO_QUERY);
- if (xDiagram.is())
- xPropSet.set(xDiagram->getWall());
- }
-
- if( xPropSet.is() )
- xPropSet->setPropertyValue( "LineColor", css::uno::makeAny( Color(ColorTransparency, nColor) ) );
- }
+ if (css::uno::Reference<css::beans::XPropertySet> xPropSet = getSelectedGraphObject(*this))
+ xPropSet->setPropertyValue(u"LineColor"_ustr, rColor);
}
catch( const uno::Exception& )
{
@@ -1003,29 +1283,12 @@ void ChartController::executeDispatch_LineColor(sal_uInt32 nColor)
}
}
-void ChartController::executeDispatch_LineWidth(sal_uInt32 nWidth)
+void ChartController::executeDispatch_LineWidth(const css::uno::Any& rWidth)
{
try
{
- OUString aCID( m_aSelection.getSelectedCID() );
- rtl::Reference<::chart::ChartModel> xChartModel = getChartModel();
- if( xChartModel.is() )
- {
- Reference< beans::XPropertySet > xPropSet(
- ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ) );
-
- ObjectType eType = ObjectIdentifier::getObjectType(aCID);
- if (eType == OBJECTTYPE_DIAGRAM)
- {
- css::uno::Reference<css::chart2::XDiagram> xDiagram(
- xPropSet, css::uno::UNO_QUERY);
- if (xDiagram.is())
- xPropSet.set(xDiagram->getWall());
- }
-
- if( xPropSet.is() )
- xPropSet->setPropertyValue( "LineWidth", css::uno::makeAny( nWidth ) );
- }
+ if (css::uno::Reference<css::beans::XPropertySet> xPropSet = getSelectedGraphObject(*this))
+ xPropSet->setPropertyValue(u"LineWidth"_ustr, rWidth);
}
catch( const uno::Exception& )
{
@@ -1075,7 +1338,7 @@ void ChartController::executeDispatch_LOKPieSegmentDragging( int nOffset )
Reference< beans::XPropertySet > xPointProperties(
ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ) );
if( xPointProperties.is() )
- xPointProperties->setPropertyValue( "Offset", uno::Any( nOffset / 100.0 ) );
+ xPointProperties->setPropertyValue( u"Offset"_ustr, uno::Any( nOffset / 100.0 ) );
}
}
catch( const uno::Exception & )
@@ -1099,8 +1362,7 @@ void ChartController::impl_switchDiagramPositioningToExcludingPositioning()
ActionDescriptionProvider::ActionType::PosSize,
ObjectNameProvider::getName( OBJECTTYPE_DIAGRAM)),
m_xUndoManager );
- ChartModel& rModel = dynamic_cast<ChartModel&>(*m_aModel->getModel());
- if (DiagramHelper::switchDiagramPositioningToExcludingPositioning(rModel, true, true))
+ if (DiagramHelper::switchDiagramPositioningToExcludingPositioning(*getChartModel(), true, true))
aUndoGuard.commit();
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index b8d925427736..a7c315ba3231 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -22,12 +22,13 @@
#include <string_view>
#include <ChartController.hxx>
+#include <ChartView.hxx>
#include <PositionAndSizeHelper.hxx>
#include <ObjectIdentifier.hxx>
#include <ChartWindow.hxx>
#include <ResId.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <TitleHelper.hxx>
@@ -38,39 +39,35 @@
#include "DragMethod_PieSegment.hxx"
#include "DragMethod_RotateDiagram.hxx"
#include <ObjectHierarchy.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
#include <RelativePositionHelper.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include <RegressionCurveHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include <StatisticsHelper.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
+#include <DataSeriesProperties.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <LegendHelper.hxx>
#include <servicenames_charttypes.hxx>
#include "DrawCommandDispatch.hxx"
#include <PopupRequest.hxx>
-#include "ControllerCommandDispatch.hxx"
+#include <ControllerCommandDispatch.hxx>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/awt/PopupMenuDirection.hpp>
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
-#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
-#include <com/sun/star/qa/XDumper.hpp>
#include <comphelper/lok.hxx>
#include <comphelper/propertysequence.hxx>
#include <comphelper/propertyvalue.hxx>
-#include <comphelper/sequence.hxx>
-
-#include <toolkit/awt/vclxmenu.hxx>
#include <sfx2/viewsh.hxx>
#include <svx/ActionDescriptionProvider.hxx>
@@ -84,8 +81,10 @@
#include <vcl/weld.hxx>
#include <vcl/ptrstyle.hxx>
#include <svtools/acceleratorexecute.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <toolkit/awt/vclxmenu.hxx>
#include <sal/log.hxx>
+#include <o3tl/string_view.hxx>
#include <boost/property_tree/json_parser.hpp>
#include <sfx2/dispatch.hxx>
@@ -95,6 +94,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Reference;
namespace chart
@@ -144,13 +144,13 @@ void lcl_insertMenuCommand(
const uno::Reference< awt::XPopupMenu > & xMenu,
sal_Int16 nId, const OUString & rCommand )
{
- xMenu->insertItem( nId, "", 0, -1 );
+ xMenu->insertItem( nId, u""_ustr, 0, -1 );
xMenu->setCommand( nId, rCommand );
}
-OUString lcl_getFormatCommandForObjectCID( const OUString& rCID )
+OUString lcl_getFormatCommandForObjectCID( std::u16string_view rCID )
{
- OUString aDispatchCommand( ".uno:FormatSelection" );
+ OUString aDispatchCommand( u".uno:FormatSelection"_ustr );
ObjectType eObjectType = ObjectIdentifier::getObjectType( rCID );
@@ -173,6 +173,7 @@ OUString lcl_getFormatCommandForObjectCID( const OUString& rCID )
aDispatchCommand = ".uno:FormatTitle";
break;
case OBJECTTYPE_LEGEND_ENTRY:
+ case OBJECTTYPE_DATA_SERIES:
aDispatchCommand = ".uno:FormatDataSeries";
break;
case OBJECTTYPE_AXIS:
@@ -188,9 +189,6 @@ OUString lcl_getFormatCommandForObjectCID( const OUString& rCID )
case OBJECTTYPE_DATA_LABELS:
aDispatchCommand = ".uno:FormatDataLabels";
break;
- case OBJECTTYPE_DATA_SERIES:
- aDispatchCommand = ".uno:FormatDataSeries";
- break;
case OBJECTTYPE_DATA_LABEL:
aDispatchCommand = ".uno:FormatDataLabel";
break;
@@ -241,17 +239,16 @@ void SAL_CALL ChartController::setPosSize(
sal_Int16 Flags )
{
SolarMutexGuard aGuard;
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
auto pChartWindow(GetChartWindow());
- if(!(xWindow.is() && pChartWindow))
+ if(!(m_xViewWindow.is() && pChartWindow))
return;
Size aLogicSize = pChartWindow->PixelToLogic( Size( Width, Height ), MapMode( MapUnit::Map100thMM ) );
//todo: for standalone chart: detect whether we are standalone
//change map mode to fit new size
- awt::Size aModelPageSize = ChartModelHelper::getPageSize( getChartModel() );
+ awt::Size aModelPageSize = getChartModel()->getPageSize();
sal_Int32 nScaleXNumerator = aLogicSize.Width();
sal_Int32 nScaleXDenominator = aModelPageSize.Width;
sal_Int32 nScaleYNumerator = aLogicSize.Height();
@@ -265,8 +262,7 @@ void SAL_CALL ChartController::setPosSize(
pChartWindow->setPosSizePixel( X, Y, Width, Height, static_cast<PosSizeFlags>(Flags) );
//#i75867# poor quality of ole's alternative view with 3D scenes and zoomfactors besides 100%
- uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY );
- if( xProp.is() )
+ if( m_xChartView.is() )
{
auto aZoomFactors(::comphelper::InitPropertySequence({
{ "ScaleXNumerator", uno::Any( nScaleXNumerator ) },
@@ -274,7 +270,7 @@ void SAL_CALL ChartController::setPosSize(
{ "ScaleYNumerator", uno::Any( nScaleYNumerator ) },
{ "ScaleYDenominator", uno::Any( nScaleYDenominator ) }
}));
- xProp->setPropertyValue( "ZoomFactors", uno::Any( aZoomFactors ));
+ m_xChartView->setPropertyValue( u"ZoomFactors"_ustr, uno::Any( aZoomFactors ));
}
//a correct work area is at least necessary for correct values in the position and size dialog and for dragging area
@@ -288,161 +284,114 @@ void SAL_CALL ChartController::setPosSize(
awt::Rectangle SAL_CALL ChartController::getPosSize()
{
- //@todo
awt::Rectangle aRet(0, 0, 0, 0);
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
- if(xWindow.is())
- aRet = xWindow->getPosSize();
+ if (m_xViewWindow.is())
+ aRet = m_xViewWindow->getPosSize();
return aRet;
}
void SAL_CALL ChartController::setVisible( sal_Bool Visible )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->setVisible( Visible );
+ if (m_xViewWindow.is())
+ m_xViewWindow->setVisible(Visible);
}
void SAL_CALL ChartController::setEnable( sal_Bool Enable )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->setEnable( Enable );
+ if (m_xViewWindow.is())
+ m_xViewWindow->setEnable(Enable);
}
void SAL_CALL ChartController::setFocus()
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->setFocus();
+ if (m_xViewWindow.is())
+ m_xViewWindow->setFocus();
}
void SAL_CALL ChartController::addWindowListener(
const uno::Reference< awt::XWindowListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->addWindowListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->addWindowListener(xListener);
}
void SAL_CALL ChartController::removeWindowListener(
const uno::Reference< awt::XWindowListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->removeWindowListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->removeWindowListener(xListener);
}
void SAL_CALL ChartController::addFocusListener(
const uno::Reference< awt::XFocusListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->addFocusListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->addFocusListener(xListener);
}
void SAL_CALL ChartController::removeFocusListener(
const uno::Reference< awt::XFocusListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->removeFocusListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->removeFocusListener(xListener);
}
void SAL_CALL ChartController::addKeyListener(
const uno::Reference< awt::XKeyListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->addKeyListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->addKeyListener(xListener);
}
void SAL_CALL ChartController::removeKeyListener(
const uno::Reference< awt::XKeyListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->removeKeyListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->removeKeyListener(xListener);
}
void SAL_CALL ChartController::addMouseListener(
const uno::Reference< awt::XMouseListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->addMouseListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->addMouseListener(xListener);
}
void SAL_CALL ChartController::removeMouseListener(
const uno::Reference< awt::XMouseListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->removeMouseListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->removeMouseListener(xListener);
}
void SAL_CALL ChartController::addMouseMotionListener(
const uno::Reference< awt::XMouseMotionListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->addMouseMotionListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->addMouseMotionListener(xListener);
}
void SAL_CALL ChartController::removeMouseMotionListener(
const uno::Reference< awt::XMouseMotionListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->removeMouseMotionListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->removeMouseMotionListener(xListener);
}
void SAL_CALL ChartController::addPaintListener(
const uno::Reference< awt::XPaintListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->addPaintListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->addPaintListener(xListener);
}
void SAL_CALL ChartController::removePaintListener(
const uno::Reference< awt::XPaintListener >& xListener )
{
- //@todo
- uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
-
- if(xWindow.is())
- xWindow->removePaintListener( xListener );
+ if (m_xViewWindow.is())
+ m_xViewWindow->removePaintListener(xListener);
}
// impl vcl window controller methods
@@ -461,14 +410,13 @@ void ChartController::execute_Paint(vcl::RenderContext& rRenderContext, const to
{
try
{
- uno::Reference<frame::XModel> xModel(getModel());
+ rtl::Reference<ChartModel> xModel(getChartModel());
//OSL_ENSURE( xModel.is(), "ChartController::execute_Paint: have no model to paint");
if (!xModel.is())
return;
//better performance for big data
- uno::Reference<beans::XPropertySet> xProp(m_xChartView, uno::UNO_QUERY);
- if (xProp.is())
+ if (m_xChartView.is())
{
awt::Size aResolution(1000, 1000);
{
@@ -480,12 +428,11 @@ void ChartController::execute_Paint(vcl::RenderContext& rRenderContext, const to
aResolution.Height = pChartWindow->GetSizePixel().Height();
}
}
- xProp->setPropertyValue( "Resolution", uno::Any( aResolution ));
+ m_xChartView->setPropertyValue( u"Resolution"_ustr, uno::Any( aResolution ));
}
- uno::Reference< util::XUpdatable > xUpdatable( m_xChartView, uno::UNO_QUERY );
- if (xUpdatable.is())
- xUpdatable->update();
+ if (m_xChartView.is())
+ m_xChartView->update();
{
SolarMutexGuard aGuard;
@@ -705,7 +652,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
}
else
{
- OUString aDragMethodServiceName( ObjectIdentifier::getDragMethodServiceName( m_aSelection.getSelectedCID() ) );
+ std::u16string_view aDragMethodServiceName( ObjectIdentifier::getDragMethodServiceName( m_aSelection.getSelectedCID() ) );
if( aDragMethodServiceName == ObjectIdentifier::getPieSegmentDragMethodServiceName() )
pDragMethod = new DragMethod_PieSegment( *pDrawViewWrapper, m_aSelection.getSelectedCID(), getChartModel() );
}
@@ -744,6 +691,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
bool bMouseUpWithoutMouseDown = !m_bWaitingForMouseUp;
m_bWaitingForMouseUp = false;
bool bNotifySelectionChange = false;
+ bool bEditText = false;
{
SolarMutexGuard aGuard;
@@ -785,7 +733,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
// don't want the positioning Undo action to appear in the UI
impl_switchDiagramPositioningToExcludingPositioning();
}
- if ( pDrawViewWrapper->AreObjectsMarked() )
+ if ( pDrawViewWrapper->GetMarkedObjectList().GetMarkCount() != 0 )
{
if ( pDrawViewWrapper->GetCurrentObjIdentifier() == SdrObjKind::Text )
{
@@ -840,10 +788,10 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
{
tools::Rectangle aObjectRect = pObj->GetSnapRect();
tools::Rectangle aOldObjectRect = pObj->GetLastBoundRect();
- awt::Size aPageSize( ChartModelHelper::getPageSize( getChartModel() ) );
+ awt::Size aPageSize( getChartModel()->getPageSize() );
tools::Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
- const E3dObject* pE3dObject(dynamic_cast< const E3dObject*>(pObj));
+ const E3dObject* pE3dObject(DynCastE3dObject(pObj));
if(nullptr != pE3dObject)
{
E3dScene* pScene(pE3dObject->getRootE3dSceneFromE3dObject());
@@ -864,17 +812,15 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
m_xUndoManager );
bool bChanged = false;
- css::uno::Reference< css::frame::XModel > xModel = getModel();
- ChartModel* pModel = dynamic_cast<ChartModel*>(xModel.get());
- assert(pModel);
+ rtl::Reference< ChartModel > xModel = getChartModel();
if ( eObjectType == OBJECTTYPE_LEGEND )
- bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( *pModel, false , true );
+ bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( *xModel, false , true );
bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
- , getChartModel()
- , awt::Rectangle(aObjectRect.Left(),aObjectRect.Top(),aObjectRect.getWidth(),aObjectRect.getHeight())
+ , xModel
+ , awt::Rectangle(aObjectRect.Left(),aObjectRect.Top(),aObjectRect.getOpenWidth(),aObjectRect.getOpenHeight())
, awt::Rectangle(aOldObjectRect.Left(), aOldObjectRect.Top(), 0, 0)
- , awt::Rectangle(aPageRect.Left(),aPageRect.Top(),aPageRect.getWidth(),aPageRect.getHeight()) );
+ , awt::Rectangle(aPageRect.Left(),aPageRect.Top(),aPageRect.getOpenWidth(),aPageRect.getOpenHeight()) );
if( bMoved || bChanged )
{
@@ -922,7 +868,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if( isDoubleClick(rMEvt) && !bMouseUpWithoutMouseDown /*#i106966#*/ )
{
Point aMousePixel = rMEvt.GetPosPixel();
- execute_DoubleClick( &aMousePixel );
+ execute_DoubleClick( &aMousePixel, bEditText );
}
if( m_aSelection.isSelectionDifferentFromBeforeMouseDown() )
@@ -931,18 +877,17 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
impl_SetMousePointer( rMEvt );
- if(bNotifySelectionChange)
+ if(bNotifySelectionChange || bEditText)
impl_notifySelectionChangeListeners();
}
-void ChartController::execute_DoubleClick( const Point* pMousePixel )
+void ChartController::execute_DoubleClick( const Point* pMousePixel, bool &bEditText )
{
const SfxViewShell* pViewShell = SfxViewShell::Current();
- bool isMobilePhone = pViewShell && pViewShell->isLOKMobilePhone();
- if (isMobilePhone)
+ bool notAllowed = pViewShell && (pViewShell->isLOKMobilePhone() || pViewShell->IsLokReadOnlyView());
+ if (notAllowed)
return;
- bool bEditText = false;
if ( m_aSelection.hasSelection() )
{
OUString aCID( m_aSelection.getSelectedCID() );
@@ -958,7 +903,7 @@ void ChartController::execute_DoubleClick( const Point* pMousePixel )
{
// #i12587# support for shapes in chart
SdrObject* pObj = DrawViewWrapper::getSdrObject( m_aSelection.getSelectedAdditionalShape() );
- if ( dynamic_cast< const SdrTextObj* >(pObj) != nullptr )
+ if ( DynCastSdrTextObj(pObj) != nullptr )
{
bEditText = true;
}
@@ -987,33 +932,25 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
{
SolarMutexGuard aGuard;
auto pChartWindow(GetChartWindow());
- bool bIsAction = false;
- {
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
- if(!pChartWindow || !pDrawViewWrapper)
- return;
- bIsAction = m_pDrawViewWrapper->IsAction();
- }
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
+ if(!pChartWindow || !pDrawViewWrapper)
+ return;
+ bool bIsAction = m_pDrawViewWrapper->IsAction();
// pop-up menu
if(rCEvt.GetCommand() == CommandEventId::ContextMenu && !bIsAction)
{
- {
- if(pChartWindow)
- pChartWindow->ReleaseMouse();
- }
+ pChartWindow->ReleaseMouse();
if( m_aSelection.isSelectionDifferentFromBeforeMouseDown() )
impl_notifySelectionChangeListeners();
- css::uno::Reference< css::awt::XPopupMenu > xPopupMenu( m_xCC->getServiceManager()->createInstanceWithContext(
- "com.sun.star.awt.PopupMenu", m_xCC ), css::uno::UNO_QUERY );
+ rtl::Reference< VCLXPopupMenu > xPopupMenu = new VCLXPopupMenu();
Point aPos( rCEvt.GetMousePosPixel() );
if( !rCEvt.IsMouseEvent() )
{
- if(pChartWindow)
- aPos = pChartWindow->GetPointerState().maPos;
+ aPos = pChartWindow->GetPointerState().maPos;
}
OUString aMenuName;
@@ -1022,265 +959,260 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
aMenuName = m_pDrawViewWrapper->IsTextEdit() ? std::u16string_view( u"drawtext" ) : std::u16string_view( u"draw" );
else
{
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
+
// todo: the context menu should be specified by an xml file in uiconfig
- if( xPopupMenu.is())
+ sal_Int16 nUniqueId = 1;
+ if (eObjectType != OBJECTTYPE_DATA_TABLE)
{
- sal_Int16 nUniqueId = 1;
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Cut" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Copy" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Paste" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:Cut"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:Copy"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:Paste"_ustr );
xPopupMenu->insertSeparator( -1 );
+ }
- ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
- rtl::Reference< Diagram > xDiagram = getFirstDiagram();
+ rtl::Reference< Diagram > xDiagram = getFirstDiagram();
- OUString aFormatCommand( lcl_getFormatCommandForObjectCID( m_aSelection.getSelectedCID() ) );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, aFormatCommand );
+ OUString aFormatCommand( lcl_getFormatCommandForObjectCID( m_aSelection.getSelectedCID() ) );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, aFormatCommand );
+ if (eObjectType == OBJECTTYPE_TITLE && m_pDrawViewWrapper->IsTextEdit())
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FontDialog"_ustr );
- //some commands for dataseries and points:
+ //some commands for dataseries and points:
- if( eObjectType == OBJECTTYPE_DATA_SERIES || eObjectType == OBJECTTYPE_DATA_POINT )
+ if( eObjectType == OBJECTTYPE_DATA_SERIES || eObjectType == OBJECTTYPE_DATA_POINT )
+ {
+ bool bIsPoint = ( eObjectType == OBJECTTYPE_DATA_POINT );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< RegressionCurveModel > xTrendline = RegressionCurveHelper::getFirstCurveNotMeanValueLine( xSeries );
+ bool bHasEquation = RegressionCurveHelper::hasEquation( xTrendline );
+ rtl::Reference< RegressionCurveModel > xMeanValue = RegressionCurveHelper::getMeanValueLine( xSeries );
+ bool bHasYErrorBars = StatisticsHelper::hasErrorBars( xSeries );
+ bool bHasXErrorBars = StatisticsHelper::hasErrorBars( xSeries, false );
+ bool bHasDataLabelsAtSeries = xSeries->hasDataLabelsAtSeries();
+ bool bHasDataLabelsAtPoints = xSeries->hasDataLabelsAtPoints();
+ bool bHasDataLabelAtPoint = false;
+ sal_Int32 nPointIndex = -1;
+ if( bIsPoint )
{
- bool bIsPoint = ( eObjectType == OBJECTTYPE_DATA_POINT );
- uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getChartModel() );
- uno::Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
- Reference< chart2::XRegressionCurve > xTrendline( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xCurveCnt ) );
- bool bHasEquation = RegressionCurveHelper::hasEquation( xTrendline );
- Reference< chart2::XRegressionCurve > xMeanValue( RegressionCurveHelper::getMeanValueLine( xCurveCnt ) );
- bool bHasYErrorBars = StatisticsHelper::hasErrorBars( xSeries );
- bool bHasXErrorBars = StatisticsHelper::hasErrorBars( xSeries, false );
- bool bHasDataLabelsAtSeries = DataSeriesHelper::hasDataLabelsAtSeries( xSeries );
- bool bHasDataLabelsAtPoints = DataSeriesHelper::hasDataLabelsAtPoints( xSeries );
- bool bHasDataLabelAtPoint = false;
- sal_Int32 nPointIndex = -1;
- if( bIsPoint )
- {
- nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
- bHasDataLabelAtPoint = DataSeriesHelper::hasDataLabelAtPoint( xSeries, nPointIndex );
- }
- bool bSelectedPointIsFormatted = false;
- bool bHasFormattedDataPointsOtherThanSelected = false;
+ nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
+ bHasDataLabelAtPoint = xSeries->hasDataLabelAtPoint( nPointIndex );
+ }
+ bool bSelectedPointIsFormatted = false;
+ bool bHasFormattedDataPointsOtherThanSelected = false;
- Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
- if( xSeriesProperties.is() )
+ if( xSeries.is() )
+ {
+ uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
+ // "AttributedDataPoints"
+ if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList )
{
- uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
+ if( aAttributedDataPointIndexList.hasElements() )
{
- if( aAttributedDataPointIndexList.hasElements() )
+ if( bIsPoint )
{
- if( bIsPoint )
- {
- auto aIndices( comphelper::sequenceToContainer<std::vector< sal_Int32 >>( aAttributedDataPointIndexList ) );
- std::vector< sal_Int32 >::iterator aIt = std::find( aIndices.begin(), aIndices.end(), nPointIndex );
- if( aIt != aIndices.end())
- bSelectedPointIsFormatted = true;
- else
- bHasFormattedDataPointsOtherThanSelected = true;
- }
+ auto aIt = std::find( aAttributedDataPointIndexList.begin(), aAttributedDataPointIndexList.end(), nPointIndex );
+ if (aIt != aAttributedDataPointIndexList.end())
+ bSelectedPointIsFormatted = true;
else
bHasFormattedDataPointsOtherThanSelected = true;
}
+ else
+ bHasFormattedDataPointsOtherThanSelected = true;
}
}
+ }
- if( bIsPoint )
- {
- if( bHasDataLabelAtPoint )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataLabel" );
- if( !bHasDataLabelAtPoint )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertDataLabel" );
- else
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteDataLabel" );
- if( bSelectedPointIsFormatted )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:ResetDataPoint" );
+ if( bIsPoint )
+ {
+ if( bHasDataLabelAtPoint )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatDataLabel"_ustr );
+ if( !bHasDataLabelAtPoint )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertDataLabel"_ustr );
+ else
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteDataLabel"_ustr );
+ if( bSelectedPointIsFormatted )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:ResetDataPoint"_ustr );
- xPopupMenu->insertSeparator( -1 );
+ xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataSeries" );
- }
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatDataSeries"_ustr );
+ }
- Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
- if( xChartType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK )
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeOfSeries( xSeries ) );
+ if( xChartType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK )
+ {
+ try
{
- try
- {
- Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY );
- if( xChartTypeProp.is() )
- {
- bool bJapaneseStyle = false;
- xChartTypeProp->getPropertyValue( "Japanese" ) >>= bJapaneseStyle;
-
- if( bJapaneseStyle )
- {
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockLoss" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockGain" );
- }
- }
- }
- catch( const uno::Exception & )
+ bool bJapaneseStyle = false;
+ xChartType->getPropertyValue( u"Japanese"_ustr ) >>= bJapaneseStyle;
+
+ if( bJapaneseStyle )
{
- DBG_UNHANDLED_EXCEPTION("chart2");
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatStockLoss"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatStockGain"_ustr );
}
}
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ }
- if( bHasDataLabelsAtSeries )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataLabels" );
- if( bHasEquation )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" );
- if( xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatMeanValue" );
- if( bHasXErrorBars )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatXErrorBars" );
- if( bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatYErrorBars" );
+ if( bHasDataLabelsAtSeries )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatDataLabels"_ustr );
+ if( bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatTrendlineEquation"_ustr );
+ if( xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatMeanValue"_ustr );
+ if( bHasXErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatXErrorBars"_ustr );
+ if( bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatYErrorBars"_ustr );
- xPopupMenu->insertSeparator( -1 );
+ xPopupMenu->insertSeparator( -1 );
- if( !bHasDataLabelsAtSeries )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertDataLabels" );
-
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendline" );
-
- if( !xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMeanValue" );
- if( !bHasXErrorBars )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertXErrorBars" );
- if( !bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertYErrorBars" );
- if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteDataLabels" );
- if( bHasEquation )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" );
- if( xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteMeanValue" );
- if( bHasXErrorBars )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteXErrorBars" );
- if( bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteYErrorBars" );
-
- if( bHasFormattedDataPointsOtherThanSelected )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:ResetAllDataPoints" );
+ if( !bHasDataLabelsAtSeries )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertDataLabels"_ustr );
+
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertTrendline"_ustr );
+
+ if( !xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertMeanValue"_ustr );
+ if( !bHasXErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertXErrorBars"_ustr );
+ if( !bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertYErrorBars"_ustr );
+ if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteDataLabels"_ustr );
+ if( bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteTrendlineEquation"_ustr );
+ if( xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteMeanValue"_ustr );
+ if( bHasXErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteXErrorBars"_ustr );
+ if( bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteYErrorBars"_ustr );
+
+ if( bHasFormattedDataPointsOtherThanSelected )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:ResetAllDataPoints"_ustr );
- xPopupMenu->insertSeparator( -1 );
+ xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId, ".uno:ArrangeRow" );
- uno::Reference< awt::XPopupMenu > xArrangePopupMenu(
- m_xCC->getServiceManager()->createInstanceWithContext(
- "com.sun.star.awt.PopupMenu", m_xCC ), uno::UNO_QUERY );
- if( xArrangePopupMenu.is() )
- {
- sal_Int16 nSubId = nUniqueId + 1;
- lcl_insertMenuCommand( xArrangePopupMenu, nSubId++, ".uno:Forward" );
- lcl_insertMenuCommand( xArrangePopupMenu, nSubId, ".uno:Backward" );
- xPopupMenu->setPopupMenu( nUniqueId, xArrangePopupMenu );
- nUniqueId = nSubId;
- }
- ++nUniqueId;
- }
- else if( eObjectType == OBJECTTYPE_DATA_CURVE )
- {
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendline" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquation" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquationAndR2" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertR2Value" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteR2Value" );
- }
- else if( eObjectType == OBJECTTYPE_DATA_CURVE_EQUATION )
- {
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertR2Value" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteR2Value" );
- }
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId, u".uno:ArrangeRow"_ustr );
+ rtl::Reference< VCLXPopupMenu > xArrangePopupMenu = new VCLXPopupMenu();
+ sal_Int16 nSubId = nUniqueId + 1;
+ lcl_insertMenuCommand( xArrangePopupMenu, nSubId++, u".uno:Forward"_ustr );
+ lcl_insertMenuCommand( xArrangePopupMenu, nSubId, u".uno:Backward"_ustr );
+ xPopupMenu->setPopupMenu( nUniqueId, xArrangePopupMenu );
+ nUniqueId = nSubId;
+ ++nUniqueId;
+ }
+ else if( eObjectType == OBJECTTYPE_DATA_CURVE )
+ {
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteTrendline"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatTrendlineEquation"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertTrendlineEquation"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertTrendlineEquationAndR2"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertR2Value"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteTrendlineEquation"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteR2Value"_ustr );
+ }
+ else if( eObjectType == OBJECTTYPE_DATA_CURVE_EQUATION )
+ {
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertR2Value"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteR2Value"_ustr );
+ }
- //some commands for axes: and grids
+ //some commands for axes: and grids
- else if( eObjectType == OBJECTTYPE_AXIS || eObjectType == OBJECTTYPE_GRID || eObjectType == OBJECTTYPE_SUBGRID )
+ else if( eObjectType == OBJECTTYPE_AXIS || eObjectType == OBJECTTYPE_GRID || eObjectType == OBJECTTYPE_SUBGRID )
+ {
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
+ if( xAxis.is() && xDiagram.is() )
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getChartModel() );
- if( xAxis.is() && xDiagram.is() )
- {
- sal_Int32 nDimensionIndex = -1;
- sal_Int32 nCooSysIndex = -1;
- sal_Int32 nAxisIndex = -1;
- AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex );
- bool bIsSecondaryAxis = nAxisIndex!=0;
- bool bIsAxisVisible = AxisHelper::isAxisVisible( xAxis );
- bool bIsMajorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, true /*bMainGrid*/, xDiagram );
- bool bIsMinorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, false /*bMainGrid*/, xDiagram );
- bool bHasTitle = false;
- uno::Reference< XTitled > xTitled( xAxis, uno::UNO_QUERY );
- if( xTitled.is())
- bHasTitle = !TitleHelper::getCompleteString( xTitled->getTitleObject() ).isEmpty();
-
- if( eObjectType != OBJECTTYPE_AXIS && bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatAxis" );
- if( eObjectType != OBJECTTYPE_GRID && bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatMajorGrid" );
- if( eObjectType != OBJECTTYPE_SUBGRID && bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatMinorGrid" );
-
- xPopupMenu->insertSeparator( -1 );
-
- if( eObjectType != OBJECTTYPE_AXIS && !bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertAxis" );
- if( eObjectType != OBJECTTYPE_GRID && !bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMajorGrid" );
- if( eObjectType != OBJECTTYPE_SUBGRID && !bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMinorGrid" );
- if( !bHasTitle )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertAxisTitle" );
-
- if( bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteAxis" );
- if( bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteMajorGrid" );
- if( bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteMinorGrid" );
- }
- }
-
- if( eObjectType == OBJECTTYPE_DATA_STOCK_LOSS )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockGain" );
- else if( eObjectType == OBJECTTYPE_DATA_STOCK_GAIN )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockLoss" );
+ sal_Int32 nDimensionIndex = -1;
+ sal_Int32 nCooSysIndex = -1;
+ sal_Int32 nAxisIndex = -1;
+ AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex );
+ bool bIsSecondaryAxis = nAxisIndex!=0;
+ bool bIsAxisVisible = AxisHelper::isAxisVisible( xAxis );
+ bool bIsMajorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, true /*bMainGrid*/, xDiagram );
+ bool bIsMinorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, false /*bMainGrid*/, xDiagram );
+ bool bHasTitle = !TitleHelper::getCompleteString( xAxis->getTitleObject2() ).isEmpty();
+
+ if( eObjectType != OBJECTTYPE_AXIS && bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatAxis"_ustr );
+ if( eObjectType != OBJECTTYPE_GRID && bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatMajorGrid"_ustr );
+ if( eObjectType != OBJECTTYPE_SUBGRID && bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatMinorGrid"_ustr );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:TransformDialog" );
+ xPopupMenu->insertSeparator( -1 );
- if( eObjectType == OBJECTTYPE_PAGE || eObjectType == OBJECTTYPE_DIAGRAM
- || eObjectType == OBJECTTYPE_DIAGRAM_WALL
- || eObjectType == OBJECTTYPE_DIAGRAM_FLOOR
- || eObjectType == OBJECTTYPE_UNKNOWN )
- {
- if( eObjectType != OBJECTTYPE_UNKNOWN )
- xPopupMenu->insertSeparator( -1 );
- bool bHasLegend = LegendHelper::hasLegend( xDiagram );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTitles" );
- if( !bHasLegend )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertLegend" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertRemoveAxes" );
- if( bHasLegend )
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteLegend" );
+ if( eObjectType != OBJECTTYPE_AXIS && !bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertAxis"_ustr );
+ if( eObjectType != OBJECTTYPE_GRID && !bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertMajorGrid"_ustr );
+ if( eObjectType != OBJECTTYPE_SUBGRID && !bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertMinorGrid"_ustr );
+ if( !bHasTitle )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertAxisTitle"_ustr );
+
+ if( bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteAxis"_ustr );
+ if( bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteMajorGrid"_ustr );
+ if( bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteMinorGrid"_ustr );
+ if (bIsAxisVisible)
+ lcl_insertMenuCommand(xPopupMenu, nUniqueId++, u".uno:InsertDataTable"_ustr);
}
+ }
+ else if (eObjectType == OBJECTTYPE_DATA_TABLE)
+ {
+ lcl_insertMenuCommand(xPopupMenu, nUniqueId++, u".uno:DeleteDataTable"_ustr);
+ }
- xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DiagramType" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DataRanges" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DiagramData" );
- lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:View3D" );
+ if( eObjectType == OBJECTTYPE_DATA_STOCK_LOSS )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatStockGain"_ustr );
+ else if( eObjectType == OBJECTTYPE_DATA_STOCK_GAIN )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:FormatStockLoss"_ustr );
+
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:TransformDialog"_ustr );
+
+ if( eObjectType == OBJECTTYPE_PAGE || eObjectType == OBJECTTYPE_DIAGRAM
+ || eObjectType == OBJECTTYPE_DIAGRAM_WALL
+ || eObjectType == OBJECTTYPE_DIAGRAM_FLOOR
+ || eObjectType == OBJECTTYPE_UNKNOWN )
+ {
+ if( eObjectType != OBJECTTYPE_UNKNOWN )
+ xPopupMenu->insertSeparator( -1 );
+ bool bHasLegend = LegendHelper::hasLegend( xDiagram );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertTitles"_ustr );
+ if( !bHasLegend )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertLegend"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:InsertRemoveAxes"_ustr );
+ if( bHasLegend )
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DeleteLegend"_ustr );
}
+
+ xPopupMenu->insertSeparator( -1 );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DiagramType"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DataRanges"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:DiagramData"_ustr );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, u".uno:View3D"_ustr );
}
css::uno::Sequence< css::uno::Any > aArgs{
- css::uno::Any(comphelper::makePropertyValue( "IsContextMenu", true )),
- css::uno::Any(comphelper::makePropertyValue( "Frame", m_xFrame )),
- css::uno::Any(comphelper::makePropertyValue( "Value", aMenuName ))
+ css::uno::Any(comphelper::makePropertyValue( u"IsContextMenu"_ustr, true )),
+ css::uno::Any(comphelper::makePropertyValue( u"Frame"_ustr, m_xFrame )),
+ css::uno::Any(comphelper::makePropertyValue( u"Value"_ustr, aMenuName ))
};
css::uno::Reference< css::frame::XPopupMenuController > xPopupController(
m_xCC->getServiceManager()->createInstanceWithArgumentsAndContext(
- "com.sun.star.comp.framework.ResourceMenuController", aArgs, m_xCC ), css::uno::UNO_QUERY );
+ u"com.sun.star.comp.framework.ResourceMenuController"_ustr, aArgs, m_xCC ), css::uno::UNO_QUERY );
if ( !xPopupController.is() || !xPopupMenu.is() )
return;
@@ -1291,7 +1223,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
{
if (SfxViewShell* pViewShell = SfxViewShell::Current())
{
- ControllerCommandDispatch* pCommandDispatch = dynamic_cast<ControllerCommandDispatch*>(m_aDispatchContainer.getChartDispatcher().get());
+ const ControllerCommandDispatch* pCommandDispatch = m_aDispatchContainer.getChartDispatcher();
if (pCommandDispatch)
{
for (int nPos = 0, nCount = xPopupMenu->getItemCount(); nPos < nCount; ++nPos)
@@ -1303,14 +1235,13 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
}
}
- Menu* pPopupMenu = comphelper::getFromUnoTunnel<VCLXMenu>(xPopupMenu)->GetMenu();
- boost::property_tree::ptree aMenu = SfxDispatcher::fillPopupMenu(pPopupMenu);
+ boost::property_tree::ptree aMenu = SfxDispatcher::fillPopupMenu(xPopupMenu);
boost::property_tree::ptree aRoot;
aRoot.add_child("menu", aMenu);
std::stringstream aStream;
boost::property_tree::write_json(aStream, aRoot, true);
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, aStream.str().c_str());
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, OString(aStream.str()));
}
}
else
@@ -1330,8 +1261,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
( rCEvt.GetCommand() == CommandEventId::InputContextChange ) )
{
//#i84417# enable editing with IME
- if( m_pDrawViewWrapper )
- m_pDrawViewWrapper->Command( rCEvt, pChartWindow );
+ m_pDrawViewWrapper->Command( rCEvt, pChartWindow );
}
}
@@ -1384,7 +1314,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
{
// Navigation (Tab/F3/Home/End)
rtl::Reference<::chart::ChartModel> xChartDoc( getChartModel() );
- ObjectKeyNavigation aObjNav( m_aSelection.getSelectedOID(), xChartDoc, comphelper::getFromUnoTunnel<ExplicitValueProvider>( m_xChartView ));
+ ObjectKeyNavigation aObjNav( m_aSelection.getSelectedOID(), xChartDoc, m_xChartView.get() );
awt::KeyEvent aKeyEvent( ::svt::AcceleratorExecute::st_VCLKey2AWTKey( aKeyCode ));
bReturn = aObjNav.handleKeyEvent( aKeyEvent );
if( bReturn )
@@ -1427,7 +1357,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
nCode == KEY_DOWN )
{
bDrag = true;
- OUString aParameter( ObjectIdentifier::getDragParameterString( m_aSelection.getSelectedCID() ));
+ std::u16string_view aParameter( ObjectIdentifier::getDragParameterString( m_aSelection.getSelectedCID() ));
sal_Int32 nOffsetPercentDummy( 0 );
awt::Point aMinimumPosition( 0, 0 );
awt::Point aMaximumPosition( 0, 0 );
@@ -1523,7 +1453,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
if (pObj)
{
tools::Rectangle aRect = pObj->GetSnapRect();
- awt::Size aPageSize(ChartModelHelper::getPageSize(getChartModel()));
+ awt::Size aPageSize(getChartModel()->getPageSize());
if ((fShiftAmountX > 0.0 && (aRect.Right() + fShiftAmountX > aPageSize.Width)) ||
(fShiftAmountX < 0.0 && (aRect.Left() + fShiftAmountX < 0)) ||
(fShiftAmountY > 0.0 && (aRect.Bottom() + fShiftAmountY > aPageSize.Height)) ||
@@ -1532,7 +1462,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
else
bReturn = PositionAndSizeHelper::moveObject(
m_aSelection.getSelectedCID(), getChartModel(),
- awt::Rectangle(aRect.Left() + fShiftAmountX, aRect.Top() + fShiftAmountY, aRect.getWidth(), aRect.getHeight()),
+ awt::Rectangle(aRect.Left() + fShiftAmountX, aRect.Top() + fShiftAmountY, aRect.getOpenWidth(), aRect.getOpenHeight()),
awt::Rectangle(aRect.Left(), aRect.Top(), 0, 0),
awt::Rectangle(0, 0, aPageSize.Width, aPageSize.Height));
}
@@ -1549,7 +1479,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
{
awt::Point aPos( xShape->getPosition() );
awt::Size aSize( xShape->getSize() );
- awt::Size aPageSize( ChartModelHelper::getPageSize( getChartModel() ) );
+ awt::Size aPageSize( getChartModel()->getPageSize() );
aPos.X = static_cast< tools::Long >( static_cast< double >( aPos.X ) + fShiftAmountX );
aPos.Y = static_cast< tools::Long >( static_cast< double >( aPos.Y ) + fShiftAmountY );
if( aPos.X + aSize.Width > aPageSize.Width )
@@ -1572,10 +1502,10 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// dumping the shape
if( !bReturn && bCtrl && nCode == KEY_F12)
{
- uno::Reference< qa::XDumper > xChartModel( getModel(), uno::UNO_QUERY );
+ rtl::Reference< ChartModel > xChartModel = getChartModel();
if(xChartModel.is())
{
- OUString aDump = xChartModel->dump();
+ OUString aDump = xChartModel->dump(u"shapes"_ustr);
SAL_WARN("chart2", aDump);
}
}
@@ -1600,8 +1530,8 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
uno::Sequence< beans::PropertyValue > aArgs;
xDispatchHelper->executeDispatch(
uno::Reference< frame::XDispatchProvider >( m_xFrame, uno::UNO_QUERY ),
- ".uno:TerminateInplaceActivation",
- "_parent",
+ u".uno:TerminateInplaceActivation"_ustr,
+ u"_parent"_ustr,
frame::FrameSearchFlag::PARENT,
aArgs );
bReturn = true;
@@ -1613,10 +1543,10 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
bReturn = executeDispatch_Delete();
if( ! bReturn )
{
- std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pChartWindow->GetFrameWeld(),
+ std::shared_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pChartWindow->GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SchResId(STR_ACTION_NOTPOSSIBLE)));
- xInfoBox->run();
+ xInfoBox->runAsync(xInfoBox, [] (int) {});
}
}
@@ -1650,10 +1580,8 @@ bool ChartController::requestQuickHelp(
rOutQuickHelpText = ObjectNameProvider::getHelpText( aCID, xChartModel, bIsBalloonHelp /* bVerbose */ );
// set rectangle
- ExplicitValueProvider * pValueProvider(
- comphelper::getFromUnoTunnel<ExplicitValueProvider>( m_xChartView ));
- if( pValueProvider )
- rOutEqualRect = pValueProvider->getRectangleOfObject( aCID, true );
+ if( m_xChartView )
+ rOutEqualRect = m_xChartView->getRectangleOfObject( aCID, true );
}
return bResult;
@@ -1666,8 +1594,7 @@ sal_Bool SAL_CALL ChartController::select( const uno::Any& rSelection )
if ( rSelection.hasValue() )
{
- const uno::Type& rType = rSelection.getValueType();
- if ( rType == cppu::UnoType< OUString >::get() )
+ if (rSelection.getValueType() == cppu::UnoType<OUString>::get())
{
OUString aNewCID;
if ( ( rSelection >>= aNewCID ) && m_aSelection.setSelection( aNewCID ) )
@@ -1675,10 +1602,9 @@ sal_Bool SAL_CALL ChartController::select( const uno::Any& rSelection )
bSuccess = true;
}
}
- else if ( rType == cppu::UnoType<drawing::XShape>::get() )
+ else if (uno::Reference<drawing::XShape> xShape; rSelection >>= xShape)
{
- uno::Reference< drawing::XShape > xShape;
- if ( ( rSelection >>= xShape ) && m_aSelection.setSelection( xShape ) )
+ if (m_aSelection.setSelection(xShape))
{
bSuccess = true;
}
@@ -1738,7 +1664,8 @@ void SAL_CALL ChartController::addSelectionChangeListener( const uno::Reference<
return; //behave passive if already disposed or suspended
//--add listener
- m_aLifeTimeManager.m_aListenerContainer.addInterface( cppu::UnoType<view::XSelectionChangeListener>::get(), xListener );
+ std::unique_lock aGuard2(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aSelectionChangeListeners.addInterface( aGuard2, xListener );
}
void SAL_CALL ChartController::removeSelectionChangeListener( const uno::Reference<view::XSelectionChangeListener> & xListener )
@@ -1748,22 +1675,18 @@ void SAL_CALL ChartController::removeSelectionChangeListener( const uno::Referen
return; //behave passive if already disposed or suspended
//--remove listener
- m_aLifeTimeManager.m_aListenerContainer.removeInterface( cppu::UnoType<view::XSelectionChangeListener>::get(), xListener );
+ std::unique_lock aGuard2(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aSelectionChangeListeners.removeInterface( aGuard2, xListener );
}
void ChartController::impl_notifySelectionChangeListeners()
{
- ::comphelper::OInterfaceContainerHelper2* pIC = m_aLifeTimeManager.m_aListenerContainer
- .getContainer( cppu::UnoType<view::XSelectionChangeListener>::get() );
- if( pIC )
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ if( m_aLifeTimeManager.m_aSelectionChangeListeners.getLength(aGuard) )
{
uno::Reference< view::XSelectionSupplier > xSelectionSupplier(this);
lang::EventObject aEvent( xSelectionSupplier );
- ::comphelper::OInterfaceIteratorHelper2 aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- static_cast< view::XSelectionChangeListener* >( aIt.next() )->selectionChanged( aEvent );
- }
+ m_aLifeTimeManager.m_aSelectionChangeListeners.notifyEach(aGuard, &view::XSelectionChangeListener::selectionChanged, aEvent);
}
}
@@ -1795,18 +1718,17 @@ bool ChartController::impl_moveOrResizeObject(
ObjectIdentifier::getObjectPropertySet( rCID, xChartModel ));
if( xObjProp.is())
{
- awt::Size aRefSize = ChartModelHelper::getPageSize( xChartModel );
+ awt::Size aRefSize = xChartModel->getPageSize();
chart2::RelativePosition aRelPos;
chart2::RelativeSize aRelSize;
- bool bDeterminePos = !(xObjProp->getPropertyValue( "RelativePosition") >>= aRelPos);
- bool bDetermineSize = !bNeedResize || !(xObjProp->getPropertyValue( "RelativeSize") >>= aRelSize);
+ bool bDeterminePos = !(xObjProp->getPropertyValue( u"RelativePosition"_ustr) >>= aRelPos);
+ bool bDetermineSize = !bNeedResize || !(xObjProp->getPropertyValue( u"RelativeSize"_ustr) >>= aRelSize);
if( ( bDeterminePos || bDetermineSize ) &&
( aRefSize.Width > 0 && aRefSize.Height > 0 ) )
{
- ExplicitValueProvider * pValueProvider(
- comphelper::getFromUnoTunnel<ExplicitValueProvider>( m_xChartView ));
+ ChartView * pValueProvider( m_xChartView.get() );
if( pValueProvider )
{
awt::Rectangle aRect( pValueProvider->getRectangleOfObject( rCID ));
@@ -1853,9 +1775,9 @@ bool ChartController::impl_moveOrResizeObject(
eActionType, ObjectNameProvider::getName( eObjectType )), m_xUndoManager );
{
ControllerLockGuardUNO aCLGuard( xChartModel );
- xObjProp->setPropertyValue( "RelativePosition", uno::Any( aRelPos ));
+ xObjProp->setPropertyValue( u"RelativePosition"_ustr, uno::Any( aRelPos ));
if( bNeedResize || (eObjectType == OBJECTTYPE_DIAGRAM) )//Also set an explicit size at the diagram when an explicit position is set
- xObjProp->setPropertyValue( "RelativeSize", uno::Any( aRelSize ));
+ xObjProp->setPropertyValue( u"RelativeSize"_ustr, uno::Any( aRelSize ));
}
aUndoGuard.commit();
}
@@ -1863,15 +1785,15 @@ bool ChartController::impl_moveOrResizeObject(
return bResult;
}
-bool ChartController::impl_DragDataPoint( const OUString & rCID, double fAdditionalOffset )
+bool ChartController::impl_DragDataPoint( std::u16string_view rCID, double fAdditionalOffset )
{
bool bResult = false;
if( fAdditionalOffset < -1.0 || fAdditionalOffset > 1.0 || fAdditionalOffset == 0.0 )
return bResult;
sal_Int32 nDataPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( rCID );
- uno::Reference< chart2::XDataSeries > xSeries(
- ObjectIdentifier::getDataSeriesForCID( rCID, getChartModel() ));
+ rtl::Reference< DataSeries > xSeries =
+ ObjectIdentifier::getDataSeriesForCID( rCID, getChartModel() );
if( xSeries.is())
{
try
@@ -1879,7 +1801,7 @@ bool ChartController::impl_DragDataPoint( const OUString & rCID, double fAdditio
uno::Reference< beans::XPropertySet > xPointProp( xSeries->getDataPointByIndex( nDataPointIndex ));
double fOffset = 0.0;
if( xPointProp.is() &&
- (xPointProp->getPropertyValue( "Offset" ) >>= fOffset ) &&
+ (xPointProp->getPropertyValue( u"Offset"_ustr ) >>= fOffset ) &&
(( fAdditionalOffset > 0.0 && fOffset < 1.0 ) || (fOffset > 0.0)) )
{
fOffset += fAdditionalOffset;
@@ -1887,7 +1809,7 @@ bool ChartController::impl_DragDataPoint( const OUString & rCID, double fAdditio
fOffset = 1.0;
else if( fOffset < 0.0 )
fOffset = 0.0;
- xPointProp->setPropertyValue( "Offset", uno::Any( fOffset ));
+ xPointProp->setPropertyValue( u"Offset"_ustr, uno::Any( fOffset ));
bResult = true;
}
}
@@ -2073,12 +1995,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
pChartWindow->SetPointer( PointerStyle::Arrow );
}
-css::uno::Reference<css::uno::XInterface> const & ChartController::getChartView() const
-{
- return m_xChartView;
-}
-
-void ChartController::sendPopupRequest(OUString const & rCID, tools::Rectangle aRectangle)
+void ChartController::sendPopupRequest(std::u16string_view rCID, tools::Rectangle aRectangle)
{
ChartModel* pChartModel = m_aModel->getModel().get();
if (!pChartModel)
@@ -2097,11 +2014,11 @@ void ChartController::sendPopupRequest(OUString const & rCID, tools::Rectangle a
return;
// Get dimension index from CID
- sal_Int32 nStartPos = rCID.lastIndexOf('.');
- nStartPos++;
- sal_Int32 nEndPos = rCID.getLength();
- OUString sDimensionIndex = rCID.copy(nStartPos, nEndPos - nStartPos);
- sal_Int32 nDimensionIndex = sDimensionIndex.toInt32();
+ size_t nStartPos = rCID.rfind('.');
+ nStartPos = (nStartPos == std::u16string_view::npos) ? 0 : (nStartPos + 1);
+ sal_Int32 nEndPos = rCID.size();
+ std::u16string_view sDimensionIndex = rCID.substr(nStartPos, nEndPos - nStartPos);
+ sal_Int32 nDimensionIndex = o3tl::toInt32(sDimensionIndex);
awt::Rectangle xRectangle {
sal_Int32(aRectangle.Left()),
@@ -2112,12 +2029,12 @@ void ChartController::sendPopupRequest(OUString const & rCID, tools::Rectangle a
uno::Sequence<beans::PropertyValue> aCallbackData = comphelper::InitPropertySequence(
{
- {"Rectangle", uno::makeAny<awt::Rectangle>(xRectangle)},
- {"DimensionIndex", uno::makeAny<sal_Int32>(nDimensionIndex)},
- {"PivotTableName", uno::makeAny<OUString>(sPivotTableName)},
+ {"Rectangle", uno::Any(xRectangle)},
+ {"DimensionIndex", uno::Any(sal_Int32(nDimensionIndex))},
+ {"PivotTableName", uno::Any(sPivotTableName)},
});
- pPopupRequest->getCallback()->notify(uno::makeAny(aCallbackData));
+ pPopupRequest->getCallback()->notify(uno::Any(aCallbackData));
}
} //namespace chart
diff --git a/chart2/source/controller/main/ChartDropTargetHelper.cxx b/chart2/source/controller/main/ChartDropTargetHelper.cxx
index ceb599569e16..f03596e96475 100644
--- a/chart2/source/controller/main/ChartDropTargetHelper.cxx
+++ b/chart2/source/controller/main/ChartDropTargetHelper.cxx
@@ -18,14 +18,15 @@
*/
#include "ChartDropTargetHelper.hxx"
+#include <DataSource.hxx>
#include <DataSourceHelper.hxx>
#include <ChartModel.hxx>
+#include <Diagram.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
-#include <com/sun/star/container/XChild.hpp>
#include <sot/formats.hxx>
+#include <utility>
#include <vector>
using namespace ::com::sun::star;
@@ -61,9 +62,9 @@ namespace chart
ChartDropTargetHelper::ChartDropTargetHelper(
const Reference< datatransfer::dnd::XDropTarget >& rxDropTarget,
- const rtl::Reference<::chart::ChartModel> & xChartDocument ) :
+ rtl::Reference<::chart::ChartModel> xChartDocument ) :
DropTargetHelper( rxDropTarget ),
- m_xChartDocument( xChartDocument )
+ m_xChartDocument(std::move( xChartDocument ))
{}
ChartDropTargetHelper::~ChartDropTargetHelper()
@@ -109,7 +110,7 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt )
std::vector< OUString > aStrings( lcl_getStringsFromByteSequence( aBytes ));
if( aStrings.size() >= 3 && aStrings[0] == "soffice" )
{
- OUString aRangeString( aStrings[2] );
+ const OUString& aRangeString( aStrings[2] );
if( m_xChartDocument.is())
{
Reference< frame::XModel > xParentModel( m_xChartDocument->getParent(), uno::UNO_QUERY );
@@ -119,15 +120,15 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt )
// @todo: get the title somehow and compare it to
// aDocName if successful (the document is the
// parent)
- Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
+ rtl::Reference< Diagram > xDiagram = m_xChartDocument->getFirstChartDiagram();
Reference< chart2::data::XDataProvider > xDataProvider( m_xChartDocument->getDataProvider());
if( xDataProvider.is() && xDiagram.is() &&
DataSourceHelper::allArgumentsForRectRangeDetected( m_xChartDocument ))
{
- Reference< chart2::data::XDataSource > xDataSource(
- DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument ));
+ rtl::Reference< DataSource > xDataSource1 =
+ DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument );
Sequence< beans::PropertyValue > aArguments(
- xDataProvider->detectArguments( xDataSource ));
+ xDataProvider->detectArguments( xDataSource1 ));
OUString aOldRange;
beans::PropertyValue * pCellRange = nullptr;
@@ -155,8 +156,9 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt )
pCellRange->Value <<= aRangeString;
}
- xDataSource.set( xDataProvider->createDataSource( aArguments ));
- xDiagram->setDiagramData( xDataSource, aArguments );
+ Reference< chart2::data::XDataSource > xDataSource2 =
+ xDataProvider->createDataSource( aArguments );
+ xDiagram->setDiagramData( xDataSource2, aArguments );
// always return copy state to avoid deletion of the dragged range
nResult = DND_ACTION_COPY;
diff --git a/chart2/source/controller/main/ChartDropTargetHelper.hxx b/chart2/source/controller/main/ChartDropTargetHelper.hxx
index 4955d6eaea43..6a5383825836 100644
--- a/chart2/source/controller/main/ChartDropTargetHelper.hxx
+++ b/chart2/source/controller/main/ChartDropTargetHelper.hxx
@@ -21,12 +21,6 @@
#include <vcl/transfer.hxx>
#include <rtl/ref.hxx>
-namespace com::sun::star {
- namespace chart2 {
- class XChartDocument;
- }
-}
-
namespace chart
{
class ChartModel;
@@ -37,7 +31,7 @@ public:
ChartDropTargetHelper() = delete;
explicit ChartDropTargetHelper(
const css::uno::Reference< css::datatransfer::dnd::XDropTarget >& rxDropTarget,
- const rtl::Reference<::chart::ChartModel> & xChartDocument );
+ rtl::Reference<::chart::ChartModel> xChartDocument );
virtual ~ChartDropTargetHelper() override;
protected:
diff --git a/chart2/source/controller/main/ChartFrameloader.cxx b/chart2/source/controller/main/ChartFrameloader.cxx
index 991c6a87e00f..cbaec55db9e0 100644
--- a/chart2/source/controller/main/ChartFrameloader.cxx
+++ b/chart2/source/controller/main/ChartFrameloader.cxx
@@ -20,11 +20,14 @@
#include "ChartFrameloader.hxx"
#include <servicenames.hxx>
#include <MediaDescriptorHelper.hxx>
+#include <ChartController.hxx>
+#include <ChartModel.hxx>
+#include <unotools/fcm.hxx>
#include <unotools/mediadescriptor.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -57,7 +60,7 @@ bool ChartFrameLoader::impl_checkCancel()
OUString SAL_CALL ChartFrameLoader::getImplementationName()
{
- return CHART_FRAMELOADER_SERVICE_IMPLEMENTATION_NAME;
+ return u"com.sun.star.comp.chart2.ChartFrameLoader"_ustr;
}
sal_Bool SAL_CALL ChartFrameLoader::supportsService( const OUString& rServiceName )
@@ -67,7 +70,7 @@ sal_Bool SAL_CALL ChartFrameLoader::supportsService( const OUString& rServiceNam
css::uno::Sequence< OUString > SAL_CALL ChartFrameLoader::getSupportedServiceNames()
{
- return { CHART_FRAMELOADER_SERVICE_NAME };
+ return { u"com.sun.star.frame.SynchronousFrameLoader"_ustr };
}
// frame::XFrameLoader
@@ -93,44 +96,22 @@ sal_Bool SAL_CALL ChartFrameLoader::load( const uno::Sequence< beans::PropertyVa
if( ! xModel.is())
{
//@todo?? load mechanism to cancel during loading of document
- xModel.set(
- m_xCC->getServiceManager()->createInstanceWithContext(
- CHART_MODEL_SERVICE_IMPLEMENTATION_NAME, m_xCC )
- , uno::UNO_QUERY );
+ xModel = new ChartModel(m_xCC);
if( impl_checkCancel() )
return false;
}
//create the controller(+XWindow)
- uno::Reference< frame::XController > xController;
- uno::Reference< awt::XWindow > xComponentWindow;
- {
- xController.set(
- m_xCC->getServiceManager()->createInstanceWithContext(
- CHART_CONTROLLER_SERVICE_IMPLEMENTATION_NAME,m_xCC )
- , uno::UNO_QUERY );
-
- //!!!it is a special characteristic of the example application
- //that the controller simultaneously provides the XWindow controller functionality
- xComponentWindow =
- uno::Reference< awt::XWindow >( xController, uno::UNO_QUERY );
+ rtl::Reference< ChartController > xController = new ChartController(m_xCC);
- if( impl_checkCancel() )
- return false;
- }
+ if( impl_checkCancel() )
+ return false;
//connect frame, controller and model one to each other:
- if(xController.is()&&xModel.is())
+ if(xModel.is())
{
- xModel->connectController(xController);
- xModel->setCurrentController(xController);
- xController->attachModel(xModel);
- if(xFrame.is())
- xFrame->setComponent(xComponentWindow,xController);
- //creates the view and menu
- //for correct menu creation the initialized component must be already set into the frame
- xController->attachFrame(xFrame);
+ utl::ConnectFrameControllerModel(xFrame, xController, xModel);
}
// call initNew() or load() at XLoadable
@@ -167,8 +148,9 @@ sal_Bool SAL_CALL ChartFrameLoader::load( const uno::Sequence< beans::PropertyVa
xLoadable->load( aCompleteMediaDescriptor );
//resize standalone files to get correct size:
- if( xComponentWindow.is() && aMDHelper.ISSET_FilterName && aMDHelper.FilterName == "StarChart 5.0" )
+ if( aMDHelper.ISSET_FilterName && aMDHelper.FilterName == "StarChart 5.0" )
{
+ uno::Reference<awt::XWindow> xComponentWindow = xController->getComponentWindow();
awt::Rectangle aRect( xComponentWindow->getPosSize() );
xComponentWindow->setPosSize( aRect.X, aRect.Y, aRect.Width, aRect.Height, 0 );
}
diff --git a/chart2/source/controller/main/ChartModelClone.cxx b/chart2/source/controller/main/ChartModelClone.cxx
index dfb089d566e8..153a37d7f982 100644
--- a/chart2/source/controller/main/ChartModelClone.cxx
+++ b/chart2/source/controller/main/ChartModelClone.cxx
@@ -19,8 +19,8 @@
#include "ChartModelClone.hxx"
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
#include <ControllerLockGuard.hxx>
+#include <DataSource.hxx>
#include <DataSourceHelper.hxx>
#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
@@ -28,14 +28,10 @@
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/chart2/XTitled.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
#include <comphelper/property.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -51,10 +47,6 @@ namespace chart
using ::com::sun::star::chart2::XInternalDataProvider;
using ::com::sun::star::chart2::XAnyDescriptionAccess;
using ::com::sun::star::view::XSelectionSupplier;
- using ::com::sun::star::lang::XComponent;
- using ::com::sun::star::chart2::XTitled;
- using ::com::sun::star::util::XModifiable;
- using ::com::sun::star::chart2::data::XDataSource;
using ::com::sun::star::chart2::data::XLabeledDataSequence;
// = helper
@@ -179,7 +171,7 @@ namespace chart
ControllerLockGuardUNO aLockedControllers( i_model );
// propagate the correct flag for plotting of hidden values to the data provider and all used sequences
- ChartModelHelper::setIncludeHiddenCells(ChartModelHelper::isIncludeHiddenCells( i_modelToCopyFrom ), *i_model);
+ i_model->setIncludeHiddenCells(i_modelToCopyFrom->isIncludeHiddenCells());
// diagram
i_model->setFirstDiagram( i_modelToCopyFrom->getFirstDiagram() );
@@ -201,7 +193,7 @@ namespace chart
if ( i_model->hasInternalDataProvider() )
{
Reference< XInternalDataProvider > xNewDataProvider( i_model->getDataProvider(), UNO_QUERY );
- Reference< XDataSource > xUsedData( DataSourceHelper::getUsedData( *i_model ) );
+ rtl::Reference< DataSource > xUsedData = DataSourceHelper::getUsedData( *i_model );
if ( xUsedData.is() && xNewDataProvider.is() )
{
const Sequence< Reference< XLabeledDataSequence > > aData( xUsedData->getDataSequences() );
diff --git a/chart2/source/controller/main/ChartModelClone.hxx b/chart2/source/controller/main/ChartModelClone.hxx
index 41cf7fc10924..4f70132486b1 100644
--- a/chart2/source/controller/main/ChartModelClone.hxx
+++ b/chart2/source/controller/main/ChartModelClone.hxx
@@ -24,7 +24,6 @@
#include <rtl/ref.hxx>
namespace com::sun::star::chart2 { class XInternalDataProvider; }
-namespace com::sun::star::frame { class XModel; }
namespace chart
{
diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx
index 322e73be3aa8..7c8eb12041f6 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -49,20 +49,19 @@ ChartTransferable::ChartTransferable(
SdrModel& rSdrModel,
SdrObject* pSelectedObj,
bool bDrawing)
-: m_pMarkedObjModel( nullptr )
- ,m_bDrawing( bDrawing )
+ : m_bDrawing(bDrawing)
{
- std::unique_ptr<SdrExchangeView> pExchgView(std::make_unique<SdrView>( rSdrModel ));
- SdrPageView* pPv = pExchgView->ShowSdrPage( rSdrModel.GetPage( 0 ));
+ SdrView aExchgView( rSdrModel );
+ SdrPageView* pPv = aExchgView.ShowSdrPage( rSdrModel.GetPage( 0 ));
if( pSelectedObj )
- pExchgView->MarkObj( pSelectedObj, pPv );
+ aExchgView.MarkObj( pSelectedObj, pPv );
else
- pExchgView->MarkAllObj( pPv );
- Graphic aGraphic( pExchgView->GetMarkedObjMetaFile(true));
+ aExchgView.MarkAllObj( pPv );
+ Graphic aGraphic( aExchgView.GetMarkedObjMetaFile(true));
m_xMetaFileGraphic.set( aGraphic.GetXGraphic());
if ( m_bDrawing )
{
- m_pMarkedObjModel = pExchgView->CreateMarkedObjModel().release();
+ m_xMarkedObjModel = aExchgView.CreateMarkedObjModel();
}
}
@@ -89,7 +88,7 @@ bool ChartTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, c
{
if ( nFormat == SotClipboardFormatId::DRAWING )
{
- bResult = SetObject( m_pMarkedObjModel, CHARTTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor );
+ bResult = SetObject(m_xMarkedObjModel.get(), CHARTTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor);
}
else if ( nFormat == SotClipboardFormatId::GDIMETAFILE )
{
@@ -106,7 +105,7 @@ bool ChartTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, c
return bResult;
}
-bool ChartTransferable::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+bool ChartTransferable::WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 nUserObjectId,
const datatransfer::DataFlavor& /* rFlavor */ )
{
// called from SetObject, put data into stream
@@ -119,12 +118,12 @@ bool ChartTransferable::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void*
SdrModel* pMarkedObjModel = static_cast< SdrModel* >( pUserObject );
if ( pMarkedObjModel )
{
- rxOStm->SetBufferSize( 0xff00 );
+ rOStm.SetBufferSize( 0xff00 );
// for the changed pool defaults from drawing layer pool set those
// attributes as hard attributes to preserve them for saving
const SfxItemPool& rItemPool = pMarkedObjModel->GetItemPool();
- const SvxFontHeightItem& rDefaultFontHeight = rItemPool.GetDefaultItem( EE_CHAR_FONTHEIGHT );
+ const SvxFontHeightItem& rDefaultFontHeight = rItemPool.GetUserOrPoolDefaultItem( EE_CHAR_FONTHEIGHT );
sal_uInt16 nCount = pMarkedObjModel->GetPageCount();
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
@@ -141,10 +140,10 @@ bool ChartTransferable::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void*
}
}
- Reference< io::XOutputStream > xDocOut( new utl::OOutputStreamWrapper( *rxOStm ) );
+ Reference< io::XOutputStream > xDocOut( new utl::OOutputStreamWrapper( rOStm ) );
SvxDrawingLayerExport( pMarkedObjModel, xDocOut );
- bRet = ( rxOStm->GetError() == ERRCODE_NONE );
+ bRet = ( rOStm.GetError() == ERRCODE_NONE );
}
}
break;
diff --git a/chart2/source/controller/main/ChartTransferable.hxx b/chart2/source/controller/main/ChartTransferable.hxx
index 34567dceb6a9..486fdb48c5a9 100644
--- a/chart2/source/controller/main/ChartTransferable.hxx
+++ b/chart2/source/controller/main/ChartTransferable.hxx
@@ -46,12 +46,12 @@ protected:
// implementation of TransferableHelper methods
virtual void AddSupportedFormats() override;
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
- virtual bool WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+ virtual bool WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 nUserObjectId,
const css::datatransfer::DataFlavor& rFlavor ) override;
private:
css::uno::Reference< css::graphic::XGraphic > m_xMetaFileGraphic;
- SdrModel* m_pMarkedObjModel;
+ std::unique_ptr<SdrModel> m_xMarkedObjModel;
bool m_bDrawing;
};
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index b3d2c8db4df6..ee8b70aab9a8 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -53,7 +53,7 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
, m_bInPaint(false)
, m_pViewShellWindow( nullptr )
{
- set_id("chart_window");
+ set_id(u"chart_window"_ustr);
SetHelpId( HID_SCH_WIN_DOCUMENT );
SetMapMode( MapMode(MapUnit::Map100thMM) );
adjustHighContrastMode();
@@ -72,7 +72,7 @@ ChartWindow::~ChartWindow()
void ChartWindow::dispose()
{
m_pWindowController = nullptr;
- m_pViewShellWindow.clear();
+ m_pViewShellWindow.reset();
vcl::Window::dispose();
}
@@ -209,7 +209,6 @@ void ChartWindow::RequestHelp( const HelpEvent& rHEvt )
if( ( rHEvt.GetMode() & HelpEventMode::QUICK ) &&
m_pWindowController )
{
-// Point aLogicHitPos = PixelToLogic( rHEvt.GetMousePosPixel()); // old chart: GetPointerPosPixel()
Point aLogicHitPos = PixelToLogic( GetPointerPosPixel());
OUString aQuickHelpText;
awt::Rectangle aHelpRect;
@@ -218,12 +217,14 @@ void ChartWindow::RequestHelp( const HelpEvent& rHEvt )
if( bHelpHandled )
{
+ tools::Rectangle aPixelRect(LogicToPixel(lcl_AWTRectToVCLRect(aHelpRect)));
+ tools::Rectangle aScreenRect(OutputToScreenPixel(aPixelRect.TopLeft()),
+ OutputToScreenPixel(aPixelRect.BottomRight()));
+
if( bIsBalloonHelp )
- Help::ShowBalloon(
- this, rHEvt.GetMousePosPixel(), lcl_AWTRectToVCLRect( aHelpRect ), aQuickHelpText );
+ Help::ShowBalloon(this, rHEvt.GetMousePosPixel(), aScreenRect, aQuickHelpText);
else
- Help::ShowQuickHelp(
- this, lcl_AWTRectToVCLRect( aHelpRect ), aQuickHelpText );
+ Help::ShowQuickHelp(this, aScreenRect, aQuickHelpText);
}
}
@@ -231,21 +232,6 @@ void ChartWindow::RequestHelp( const HelpEvent& rHEvt )
vcl::Window::RequestHelp( rHEvt );
}
-void ChartWindow::LogicMouseButtonDown(const MouseEvent& rEvent)
-{
- MouseButtonDown(rEvent);
-}
-
-void ChartWindow::LogicMouseButtonUp(const MouseEvent& rEvent)
-{
- MouseButtonUp(rEvent);
-}
-
-void ChartWindow::LogicMouseMove(const MouseEvent& rEvent)
-{
- MouseMove(rEvent);
-}
-
void ChartWindow::adjustHighContrastMode()
{
static const DrawModeFlags nContrastMode =
@@ -260,23 +246,11 @@ void ChartWindow::ForceInvalidate()
{
vcl::Window::Invalidate();
}
-void ChartWindow::Invalidate( InvalidateFlags nFlags )
-{
- if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
- return;
- vcl::Window::Invalidate( nFlags );
-}
-void ChartWindow::Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags )
-{
- if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
- return;
- vcl::Window::Invalidate( rRect, nFlags );
-}
-void ChartWindow::Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags )
+void ChartWindow::ImplInvalidate( const vcl::Region* rRegion, InvalidateFlags nFlags )
{
if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
return;
- vcl::Window::Invalidate( rRegion, nFlags );
+ vcl::Window::ImplInvalidate( rRegion, nFlags );
}
void ChartWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
diff --git a/chart2/source/controller/main/CommandDispatch.cxx b/chart2/source/controller/main/CommandDispatch.cxx
index 9a16fbb73b8b..e4f8b1acebcf 100644
--- a/chart2/source/controller/main/CommandDispatch.cxx
+++ b/chart2/source/controller/main/CommandDispatch.cxx
@@ -17,9 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "CommandDispatch.hxx"
+#include <sal/config.h>
+
+#include <CommandDispatch.hxx>
#include <com/sun/star/util/URLTransformer.hpp>
-#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
@@ -31,7 +32,6 @@ namespace chart
CommandDispatch::CommandDispatch(
const Reference< uno::XComponentContext > & xContext ) :
- impl::CommandDispatch_Base( m_aMutex ),
m_xContext( xContext )
{
}
@@ -44,17 +44,11 @@ void CommandDispatch::initialize()
// ____ WeakComponentImplHelperBase ____
/// is called when this is disposed
-void SAL_CALL CommandDispatch::disposing()
+void CommandDispatch::disposing(std::unique_lock<std::mutex>& rGuard)
{
Reference< uno::XInterface > xEventSource(static_cast< cppu::OWeakObject* >( this ));
for( auto& rElement : m_aListeners )
- {
- if( rElement.second )
- {
- rElement.second->disposeAndClear( xEventSource );
- rElement.second.reset();
- }
- }
+ rElement.second.disposeAndClear( rGuard, xEventSource );
m_aListeners.clear();
}
@@ -64,24 +58,29 @@ void SAL_CALL CommandDispatch::dispatch( const util::URL& /* URL */, const Seque
void SAL_CALL CommandDispatch::addStatusListener( const Reference< frame::XStatusListener >& Control, const util::URL& URL )
{
- tListenerMap::iterator aIt( m_aListeners.find( URL.Complete ));
- if( aIt == m_aListeners.end())
{
- aIt = m_aListeners.insert(
- m_aListeners.begin(),
- tListenerMap::value_type( URL.Complete, new ::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener>( m_aMutex )));
- }
- OSL_ASSERT( aIt != m_aListeners.end());
+ std::unique_lock g(m_aMutex);
+ tListenerMap::iterator aIt( m_aListeners.find( URL.Complete ));
+ if( aIt == m_aListeners.end())
+ {
+ aIt = m_aListeners.emplace(
+ std::piecewise_construct,
+ std::forward_as_tuple(URL.Complete),
+ std::forward_as_tuple()).first;
+ }
+ assert( aIt != m_aListeners.end());
- aIt->second->addInterface( Control );
+ aIt->second.addInterface( g, Control );
+ }
fireStatusEvent( URL.Complete, Control );
}
void SAL_CALL CommandDispatch::removeStatusListener( const Reference< frame::XStatusListener >& Control, const util::URL& URL )
{
+ std::unique_lock g(m_aMutex);
tListenerMap::iterator aIt( m_aListeners.find( URL.Complete ));
if( aIt != m_aListeners.end())
- (*aIt).second->removeInterface( Control );
+ (*aIt).second.removeInterface( g, Control );
}
// ____ XModifyListener ____
@@ -132,22 +131,8 @@ void CommandDispatch::fireStatusEventForURL(
tListenerMap::iterator aIt( m_aListeners.find( aURL.Complete ));
if( aIt != m_aListeners.end())
{
- if( aIt->second )
- {
- ::comphelper::OInterfaceIteratorHelper3 aIntfIt( *((*aIt).second) );
-
- while( aIntfIt.hasMoreElements())
- {
- try
- {
- aIntfIt.next()->statusChanged( aEventToSend );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- }
- }
+ std::unique_lock g(m_aMutex);
+ aIt->second.notifyEach(g, &css::frame::XStatusListener::statusChanged, aEventToSend);
}
}
}
diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx
index 05eea58de66d..1dc98f1f88b6 100644
--- a/chart2/source/controller/main/CommandDispatchContainer.cxx
+++ b/chart2/source/controller/main/CommandDispatchContainer.cxx
@@ -18,6 +18,7 @@
*/
#include <CommandDispatchContainer.hxx>
+#include <ControllerCommandDispatch.hxx>
#include "UndoCommandDispatch.hxx"
#include "StatusBarCommandDispatch.hxx"
#include <DisposeHelper.hxx>
@@ -26,8 +27,8 @@
#include <ChartModel.hxx>
#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <osl/diagnose.h>
#include <rtl/ref.hxx>
#include <o3tl/sorted_vector.hxx>
@@ -48,6 +49,8 @@ CommandDispatchContainer::CommandDispatchContainer(
{
}
+CommandDispatchContainer::~CommandDispatchContainer() = default;
+
void CommandDispatchContainer::setModel(
const rtl::Reference<::chart::ChartModel> & xModel )
{
@@ -59,85 +62,79 @@ void CommandDispatchContainer::setModel(
}
void CommandDispatchContainer::setChartDispatch(
- const Reference< frame::XDispatch >& rChartDispatch,
- o3tl::sorted_vector< OUString > && rChartCommands )
+ const rtl::Reference< ControllerCommandDispatch >& rChartDispatch,
+ const o3tl::sorted_vector< std::u16string_view > & rChartCommands )
{
OSL_ENSURE(rChartDispatch.is(),"Invalid fall back dispatcher!");
- m_xChartDispatcher.set( rChartDispatch );
- m_aChartCommands = std::move(rChartCommands);
+ m_xChartDispatcher = rChartDispatch;
+ m_aAdditionalChartCommands = rChartCommands;
m_aToBeDisposedDispatches.push_back( m_xChartDispatcher );
}
Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL(
const util::URL & rURL )
{
- static const o3tl::sorted_vector< OUString > s_aContainerDocumentCommands {
- "AddDirect", "NewDoc", "Open",
- "Save", "SaveAs", "SendMail",
- "EditDoc", "ExportDirectToPDF", "PrintDefault"};
+ static const o3tl::sorted_vector< std::u16string_view > s_aContainerDocumentCommands {
+ u"AddDirect", u"NewDoc", u"Open",
+ u"Save", u"SaveAs", u"SendMail",
+ u"EditDoc", u"ExportDirectToPDF", u"PrintDefault"};
- Reference< frame::XDispatch > xResult;
- tDispatchMap::const_iterator aIt( m_aCachedDispatches.find( rURL.Complete ));
- if( aIt != m_aCachedDispatches.end())
- {
- xResult.set( (*aIt).second );
- }
- else
+ if (auto aIt = m_aCachedDispatches.find(rURL.Complete); aIt != m_aCachedDispatches.end())
+ return aIt->second;
+
+ auto cacheIt = [this, url = rURL.Complete](const Reference<frame::XDispatch>& val)
{
- rtl::Reference< ::chart::ChartModel > xModel( m_xModel );
+ m_aCachedDispatches[url].set(val);
+ return val;
+ };
- if( xModel.is() && ( rURL.Path == "Undo" || rURL.Path == "Redo" ||
- rURL.Path == "GetUndoStrings" || rURL.Path == "GetRedoStrings" ) )
+ if (rtl::Reference<::chart::ChartModel> xModel{ m_xModel })
+ {
+ if (rURL.Path == "Undo" || rURL.Path == "Redo" ||
+ rURL.Path == "GetUndoStrings" || rURL.Path == "GetRedoStrings")
{
rtl::Reference<CommandDispatch> pDispatch = new UndoCommandDispatch( m_xContext, xModel );
- xResult.set( pDispatch );
pDispatch->initialize();
- m_aCachedDispatches[ ".uno:Undo" ].set( xResult );
- m_aCachedDispatches[ ".uno:Redo" ].set( xResult );
- m_aCachedDispatches[ ".uno:GetUndoStrings" ].set( xResult );
- m_aCachedDispatches[ ".uno:GetRedoStrings" ].set( xResult );
- m_aToBeDisposedDispatches.push_back( xResult );
+ m_aCachedDispatches[u".uno:Undo"_ustr].set(pDispatch);
+ m_aCachedDispatches[u".uno:Redo"_ustr].set(pDispatch);
+ m_aCachedDispatches[u".uno:GetUndoStrings"_ustr].set(pDispatch);
+ m_aCachedDispatches[u".uno:GetRedoStrings"_ustr].set(pDispatch);
+ m_aToBeDisposedDispatches.push_back(pDispatch);
+ return pDispatch;
}
- else if( xModel.is() && ( rURL.Path == "Context" || rURL.Path == "ModifiedStatus" ) )
+ if (rURL.Path == "Context" || rURL.Path == "ModifiedStatus")
{
Reference< view::XSelectionSupplier > xSelSupp( xModel->getCurrentController(), uno::UNO_QUERY );
rtl::Reference<CommandDispatch> pDispatch = new StatusBarCommandDispatch( m_xContext, xModel, xSelSupp );
- xResult.set( pDispatch );
pDispatch->initialize();
- m_aCachedDispatches[ ".uno:Context" ].set( xResult );
- m_aCachedDispatches[ ".uno:ModifiedStatus" ].set( xResult );
- m_aToBeDisposedDispatches.push_back( xResult );
+ m_aCachedDispatches[u".uno:Context"_ustr].set(pDispatch);
+ m_aCachedDispatches[u".uno:ModifiedStatus"_ustr].set(pDispatch);
+ m_aToBeDisposedDispatches.push_back(pDispatch);
+ return pDispatch;
}
- else if( xModel.is() &&
- (s_aContainerDocumentCommands.find( rURL.Path ) != s_aContainerDocumentCommands.end()) )
+ if (s_aContainerDocumentCommands.count(rURL.Path) > 0)
{
- xResult.set( getContainerDispatchForURL( xModel->getCurrentController(), rURL ));
// ToDo: can those dispatches be cached?
- m_aCachedDispatches[ rURL.Complete ].set( xResult );
- }
- else if( m_xChartDispatcher.is() &&
- (m_aChartCommands.find( rURL.Path ) != m_aChartCommands.end()) )
- {
- xResult.set( m_xChartDispatcher );
- m_aCachedDispatches[ rURL.Complete ].set( xResult );
- }
- // #i12587# support for shapes in chart
- // Note, that the chart dispatcher must be queried first, because
- // the chart dispatcher is the default dispatcher for all context
- // sensitive commands.
- else if ( m_pDrawCommandDispatch && m_pDrawCommandDispatch->isFeatureSupported( rURL.Complete ) )
- {
- xResult.set( m_pDrawCommandDispatch );
- m_aCachedDispatches[ rURL.Complete ].set( xResult );
- }
- else if ( m_pShapeController && m_pShapeController->isFeatureSupported( rURL.Complete ) )
- {
- xResult.set( m_pShapeController );
- m_aCachedDispatches[ rURL.Complete ].set( xResult );
+ return cacheIt(getContainerDispatchForURL(xModel->getCurrentController(), rURL));
}
}
- return xResult;
+ if (m_xChartDispatcher.is()
+ && (m_xChartDispatcher->commandHandled(rURL.Complete)
+ || m_aAdditionalChartCommands.count(rURL.Path) > 0))
+ return cacheIt(m_xChartDispatcher);
+
+ // #i12587# support for shapes in chart
+ // Note, that the chart dispatcher must be queried first, because
+ // the chart dispatcher is the default dispatcher for all context
+ // sensitive commands.
+ if (m_pDrawCommandDispatch && m_pDrawCommandDispatch->isFeatureSupported(rURL.Complete))
+ return cacheIt(m_pDrawCommandDispatch);
+
+ if (m_pShapeController && m_pShapeController->isFeatureSupported(rURL.Complete))
+ return cacheIt(m_pShapeController);
+
+ return {};
}
Sequence< Reference< frame::XDispatch > > CommandDispatchContainer::getDispatchesForURLs(
@@ -149,7 +146,7 @@ Sequence< Reference< frame::XDispatch > > CommandDispatchContainer::getDispatche
for( sal_Int32 nPos = 0; nPos < nCount; ++nPos )
{
- if ( aDescriptors[ nPos ].FrameName == "_self" )
+ if (aDescriptors[nPos].FrameName.isEmpty() || aDescriptors[nPos].FrameName == "_self")
aRetRange[ nPos ] = getDispatchForURL( aDescriptors[ nPos ].FeatureURL );
}
return aRet;
@@ -161,7 +158,7 @@ void CommandDispatchContainer::DisposeAndClear()
DisposeHelper::DisposeAllElements( m_aToBeDisposedDispatches );
m_aToBeDisposedDispatches.clear();
m_xChartDispatcher.clear();
- m_aChartCommands.clear();
+ m_aAdditionalChartCommands.clear();
m_pDrawCommandDispatch = nullptr;
m_pShapeController = nullptr;
}
@@ -178,7 +175,7 @@ Reference< frame::XDispatch > CommandDispatchContainer::getContainerDispatchForU
{
Reference< frame::XDispatchProvider > xDispProv( xFrame->getCreator(), uno::UNO_QUERY );
if( xDispProv.is())
- xResult.set( xDispProv->queryDispatch( rURL, "_self", 0 ));
+ xResult.set( xDispProv->queryDispatch( rURL, u"_self"_ustr, 0 ));
}
}
return xResult;
diff --git a/chart2/source/controller/main/ConfigurationAccess.cxx b/chart2/source/controller/main/ConfigurationAccess.cxx
deleted file mode 100644
index f6dfecc60113..000000000000
--- a/chart2/source/controller/main/ConfigurationAccess.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- 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 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 .
- */
-
-#include <ConfigurationAccess.hxx>
-
-#include <unotools/syslocale.hxx>
-#include <unotools/configitem.hxx>
-#include <unotools/localedatawrapper.hxx>
-
-namespace chart
-{
-using namespace ::com::sun::star;
-
-namespace
-{
-bool lcl_IsMetric()
-{
- SvtSysLocale aSysLocale;
- MeasurementSystem eSys = aSysLocale.GetLocaleData().getMeasurementSystemEnum();
-
- return ( eSys == MeasurementSystem::Metric );
-}
-
-class CalcConfigItem : public ::utl::ConfigItem
-{
-private:
- virtual void ImplCommit() override;
-
-public:
- CalcConfigItem();
-
- FieldUnit getFieldUnit();
- virtual void Notify( const uno::Sequence<OUString>& aPropertyNames) override;
-};
-
-}//end anonymous namespace
-
-CalcConfigItem::CalcConfigItem()
- : ConfigItem( "Office.Calc/Layout" )
-{
-}
-
-void CalcConfigItem::ImplCommit() {}
-void CalcConfigItem::Notify( const uno::Sequence<OUString>& ) {}
-
-FieldUnit CalcConfigItem::getFieldUnit()
-{
- FieldUnit eResult( FieldUnit::CM );
-
- uno::Sequence< OUString > aNames;
- if( lcl_IsMetric() )
- aNames = { "Other/MeasureUnit/Metric" };
- else
- aNames = { "Other/MeasureUnit/NonMetric" };
-
- uno::Sequence< uno::Any > aResult( GetProperties( aNames ));
- sal_Int32 nValue = 0;
- if( aResult[ 0 ] >>= nValue )
- eResult = static_cast< FieldUnit >( nValue );
-
- return eResult;
-}
-
-namespace ConfigurationAccess
-{
- FieldUnit getFieldUnit()
- {
- //a CalcConfigItem Singleton
- static CalcConfigItem SINGLETON;
- FieldUnit aUnit( SINGLETON.getFieldUnit() );
- return aUnit;
- }
-} //namespace ConfigurationAccess
-
-} //namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 9da88ea5d6c7..517fb3c6d4ad 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -17,36 +17,38 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "ControllerCommandDispatch.hxx"
-#include <ChartModelHelper.hxx>
+#include <sal/config.h>
+
+#include <ControllerCommandDispatch.hxx>
#include <ChartModel.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <TitleHelper.hxx>
#include <LegendHelper.hxx>
#include <ObjectIdentifier.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ChartController.hxx>
#include <RegressionCurveHelper.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <StatisticsHelper.hxx>
#include <ReferenceSizeProvider.hxx>
+#include <RegressionCurveModel.hxx>
#include "ShapeController.hxx"
+#include <CharacterProperties.hxx>
#include <vcl/svapp.hxx>
#include <sal/log.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/lok.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/objsh.hxx>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XRegressionCurve.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart2/XDataProviderAccess.hpp>
+#include <com/sun/star/frame/status/FontHeight.hpp>
// only needed until #i68864# is fixed
#include <com/sun/star/frame/XLayoutManager.hpp>
@@ -58,23 +60,22 @@ using ::com::sun::star::uno::Sequence;
namespace
{
-bool lcl_isStatusBarVisible( const Reference< frame::XController > & xController )
+uno::Any getPropertyIfSame(std::vector<Reference<beans::XPropertySet>>& xProperties,
+ const OUString& aPropName)
{
- bool bIsStatusBarVisible = false;
- // Status-Bar visible, workaround: this should not be necessary. @todo:
- // remove when Issue #i68864# is fixed
- if( xController.is())
+ if (xProperties.size() < 1)
+ return {};
+
+ if (!xProperties[0])
+ return {};
+
+ uno::Any aValue = xProperties[0]->getPropertyValue(aPropName);
+ for (std::size_t i = 1; i < xProperties.size(); i++)
{
- Reference< beans::XPropertySet > xPropSet( xController->getFrame(), uno::UNO_QUERY );
- if( xPropSet.is() )
- {
- uno::Reference< css::frame::XLayoutManager > xLayoutManager;
- xPropSet->getPropertyValue( "LayoutManager" ) >>= xLayoutManager;
- if ( xLayoutManager.is() )
- bIsStatusBarVisible = xLayoutManager->isElementVisible( "private:resource/statusbar/statusbar" );
- }
+ if (xProperties[i] && aValue != xProperties[i]->getPropertyValue(aPropName))
+ return {};
}
- return bIsStatusBarVisible;
+ return aValue;
}
} // anonymous namespace
@@ -185,7 +186,7 @@ void ControllerState::update(
uno::Any aSelObj( xSelectionSupplier->getSelection() );
ObjectIdentifier aSelOID( aSelObj );
- OUString aSelObjCID( aSelOID.getObjectCID() );
+ const OUString& aSelObjCID( aSelOID.getObjectCID() );
bHasSelectedObject = aSelOID.isValid();
@@ -194,24 +195,22 @@ void ControllerState::update(
bIsPositionableObject = (aObjectType != OBJECTTYPE_DATA_POINT) && aSelOID.isDragableObject();
bIsTextObject = aObjectType == OBJECTTYPE_TITLE;
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xModel );
+ rtl::Reference< Diagram > xDiagram = xModel->getFirstChartDiagram();
bIsFormateableObjectSelected = bHasSelectedObject && aSelOID.isAutoGeneratedObject();
if( aObjectType==OBJECTTYPE_DIAGRAM || aObjectType==OBJECTTYPE_DIAGRAM_WALL || aObjectType==OBJECTTYPE_DIAGRAM_FLOOR )
- bIsFormateableObjectSelected = DiagramHelper::isSupportingFloorAndWall( xDiagram );
+ bIsFormateableObjectSelected = xDiagram->isSupportingFloorAndWall();
- uno::Reference< chart2::XDataSeries > xGivenDataSeries(
+ rtl::Reference< DataSeries > xGivenDataSeries =
ObjectIdentifier::getDataSeriesForCID(
- aSelObjCID, xModel ) );
+ aSelObjCID, xModel );
bIsDeleteableObjectSelected = ChartController::isObjectDeleteable( aSelObj );
- bMayMoveSeriesForward = (aObjectType!=OBJECTTYPE_DATA_POINT) && DiagramHelper::isSeriesMoveable(
- ChartModelHelper::findDiagram( xModel ),
+ bMayMoveSeriesForward = (aObjectType!=OBJECTTYPE_DATA_POINT) && xDiagram && xDiagram->isSeriesMoveable(
xGivenDataSeries,
MOVE_SERIES_FORWARD );
- bMayMoveSeriesBackward = (aObjectType!=OBJECTTYPE_DATA_POINT) && DiagramHelper::isSeriesMoveable(
- ChartModelHelper::findDiagram( xModel ),
+ bMayMoveSeriesBackward = (aObjectType!=OBJECTTYPE_DATA_POINT) && xDiagram && xDiagram->isSeriesMoveable(
xGivenDataSeries,
MOVE_SERIES_BACKWARD );
@@ -239,29 +238,25 @@ void ControllerState::update(
if( xGivenDataSeries.is())
{
bMayAddMenuTrendline = true;
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
- uno::Reference< chart2::XChartType > xFirstChartType(
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
+ rtl::Reference< ::chart::ChartType > xFirstChartType(
DataSeriesHelper::getChartTypeOfSeries( xGivenDataSeries, xDiagram ));
// trend lines/mean value line
if( (aObjectType == OBJECTTYPE_DATA_SERIES || aObjectType == OBJECTTYPE_DATA_POINT)
- && ChartTypeHelper::isSupportingRegressionProperties( xFirstChartType, nDimensionCount ))
+ && xFirstChartType.is() ? xFirstChartType->isSupportingRegressionProperties(nDimensionCount) : true)
{
- uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( xGivenDataSeries, uno::UNO_QUERY );
- if( xRegCurveCnt.is())
- {
- // Trendline
- bMayAddTrendline = true;
+ // Trendline
+ bMayAddTrendline = true;
- // Mean Value
- bMayFormatMeanValue = bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xRegCurveCnt );
- bMayAddMeanValue = ! bMayDeleteMeanValue;
- }
+ // Mean Value
+ bMayFormatMeanValue = bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xGivenDataSeries );
+ bMayAddMeanValue = ! bMayDeleteMeanValue;
}
// error bars
if( (aObjectType == OBJECTTYPE_DATA_SERIES || aObjectType == OBJECTTYPE_DATA_POINT)
- && ChartTypeHelper::isSupportingStatisticProperties( xFirstChartType, nDimensionCount ))
+ && xFirstChartType.is() ? xFirstChartType->isSupportingStatisticProperties(nDimensionCount) : true)
{
bMayFormatXErrorBars = bMayDeleteXErrorBars = StatisticsHelper::hasErrorBars( xGivenDataSeries, false );
bMayAddXErrorBars = ! bMayDeleteXErrorBars;
@@ -284,29 +279,34 @@ void ControllerState::update(
{
bMayFormatTrendline = true;
bMayDeleteTrendline = true;
- uno::Reference< chart2::XRegressionCurve > xRegCurve(
- ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
+ rtl::Reference< RegressionCurveModel > xRegCurve(
+ dynamic_cast<RegressionCurveModel*>(ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ).get()) );
// Trendline Equation
bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
+ bMayAddR2Value = RegressionCurveHelper::MayHaveCorrelationCoefficient( xRegCurve ) && bMayAddTrendlineEquation;
}
else if( aObjectType == OBJECTTYPE_DATA_CURVE_EQUATION )
{
bMayFormatTrendlineEquation = true;
bool bHasR2Value = false;
+ bool bMayHaveR2 = true;
try
{
uno::Reference< beans::XPropertySet > xEquationProperties =
ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel );
if( xEquationProperties.is() )
- xEquationProperties->getPropertyValue( "ShowCorrelationCoefficient" ) >>= bHasR2Value;
+ {
+ xEquationProperties->getPropertyValue( u"ShowCorrelationCoefficient"_ustr ) >>= bHasR2Value;
+ xEquationProperties->getPropertyValue( u"MayHaveCorrelationCoefficient"_ustr ) >>= bMayHaveR2;
+ }
}
catch(const uno::RuntimeException&)
{
TOOLS_WARN_EXCEPTION("chart2", "" );
}
- bMayAddR2Value = !bHasR2Value;
+ bMayAddR2Value = !bHasR2Value && bMayHaveR2;
bMayDeleteR2Value = bHasR2Value;
}
}
@@ -365,6 +365,8 @@ struct ModelState
bool bSupportsStatistics;
bool bSupportsAxes;
+
+ bool bDataTable = false;
};
ModelState::ModelState() :
@@ -400,15 +402,19 @@ ModelState::ModelState() :
void ModelState::update( const rtl::Reference<::chart::ChartModel> & xModel )
{
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xModel );
+ rtl::Reference< Diagram > xDiagram = xModel->getFirstChartDiagram();
bIsReadOnly = xModel->isReadonly();
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
+ sal_Int32 nDimensionCount = 0;
+ if (xDiagram)
+ nDimensionCount = xDiagram->getDimension();
- uno::Reference< chart2::XChartType > xFirstChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
- bSupportsStatistics = ChartTypeHelper::isSupportingStatisticProperties( xFirstChartType, nDimensionCount );
- bSupportsAxes = ChartTypeHelper::isSupportingMainAxis( xFirstChartType, nDimensionCount, 0 );
+ rtl::Reference<ChartType> xFirstChartType;
+ if (xDiagram)
+ xFirstChartType = xDiagram->getChartTypeByIndex( 0 );
+ bSupportsStatistics = xFirstChartType.is() ? xFirstChartType->isSupportingStatisticProperties(nDimensionCount) : true;
+ bSupportsAxes = xFirstChartType.is() ? xFirstChartType->isSupportingMainAxis(nDimensionCount, 0) : true;
bIsThreeD = (nDimensionCount == 3);
if (xModel.is())
@@ -443,8 +449,10 @@ void ModelState::update( const rtl::Reference<::chart::ChartModel> & xModel )
ReferenceSizeProvider::AUTO_RESIZE_YES);
bHasLegend = LegendHelper::hasLegend( xDiagram );
- bHasWall = DiagramHelper::isSupportingFloorAndWall( xDiagram );
+ bHasWall = xDiagram && xDiagram->isSupportingFloorAndWall();
bHasFloor = bHasWall && bIsThreeD;
+
+ bDataTable = xDiagram.is() && xDiagram->getDataTable().is();
}
bool ModelState::HasAnyAxis() const
@@ -527,6 +535,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
// read-only
bool bIsWritable = bModelStateIsValid && (! m_apModelState->bIsReadOnly);
bool bShapeContext = m_xChartController.is() && m_xChartController->isShapeContext();
+ bool bIsTextEdit = m_xChartController.is() && m_xChartController->IsTextEdit();
bool bEnableDataTableDialog = false;
bool bCanCreateDataProvider = false;
@@ -538,7 +547,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
{
try
{
- xProps->getPropertyValue("EnableDataTableDialog") >>= bEnableDataTableDialog;
+ xProps->getPropertyValue(u"EnableDataTableDialog"_ustr) >>= bEnableDataTableDialog;
}
catch( const uno::Exception& )
{
@@ -546,163 +555,324 @@ void ControllerCommandDispatch::updateCommandAvailability()
}
}
- Reference< chart2::XChartDocument > xChartDoc(m_xChartController->getModel(), uno::UNO_QUERY);
- OSL_ENSURE(xChartDoc.is(), "Invalid XChartDocument");
- if ( xChartDoc.is() )
+ rtl::Reference< ChartModel > xChartModel = m_xChartController->getChartModel();
+ OSL_ENSURE(xChartModel.is(), "Invalid XChartDocument");
+ if ( xChartModel.is() )
{
- ChartModel& rModel = dynamic_cast<ChartModel&>(*xChartDoc);
- css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc(rModel.getParent(), uno::UNO_QUERY);
+ css::uno::Reference< css::chart2::XDataProviderAccess > xCreatorDoc(xChartModel->getParent(), uno::UNO_QUERY);
bCanCreateDataProvider = xCreatorDoc.is();
}
}
// edit commands
- m_aCommandAvailability[ ".uno:Cut" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsDeleteableObjectSelected;
- m_aCommandAvailability[ ".uno:Copy" ] = bControllerStateIsValid && m_apControllerState->bHasSelectedObject;
- m_aCommandAvailability[ ".uno:Paste" ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:Cut"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsDeleteableObjectSelected;
+ m_aCommandAvailability[ u".uno:Copy"_ustr ] = bControllerStateIsValid && m_apControllerState->bHasSelectedObject;
+ m_aCommandAvailability[ u".uno:Paste"_ustr ] = bIsWritable;
// toolbar commands
- m_aCommandAvailability[ ".uno:ToggleGridHorizontal" ] = bIsWritable;
- m_aCommandArguments[ ".uno:ToggleGridHorizontal" ] <<= m_apModelState->bHasMainYGrid;
- m_aCommandAvailability[ ".uno:ToggleGridVertical" ] = bIsWritable;
- m_aCommandArguments[ ".uno:ToggleGridVertical" ] <<= m_apModelState->bHasMainXGrid;
-
- m_aCommandAvailability[ ".uno:ToggleLegend" ] = bIsWritable;
- m_aCommandArguments[ ".uno:ToggleLegend" ] <<= m_apModelState->bHasLegend;
-
- m_aCommandAvailability[ ".uno:NewArrangement" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:Update" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:DefaultColors" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:BarWidth" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:NumberOfLines" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:ArrangeRow" ] =
+ m_aCommandAvailability[ u".uno:ToggleGridHorizontal"_ustr ] = bIsWritable;
+ m_aCommandArguments[ u".uno:ToggleGridHorizontal"_ustr ] <<= bModelStateIsValid && m_apModelState->bHasMainYGrid;
+ m_aCommandAvailability[ u".uno:ToggleGridVertical"_ustr ] = bIsWritable;
+ m_aCommandArguments[ u".uno:ToggleGridVertical"_ustr ] <<= bModelStateIsValid && m_apModelState->bHasMainXGrid;
+
+ m_aCommandAvailability[ u".uno:ToggleLegend"_ustr ] = bIsWritable;
+ m_aCommandArguments[ u".uno:ToggleLegend"_ustr ] <<= bModelStateIsValid && m_apModelState->bHasLegend;
+
+ m_aCommandAvailability[ u".uno:NewArrangement"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:Update"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:DefaultColors"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:BarWidth"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:NumberOfLines"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:ArrangeRow"_ustr ] =
bShapeContext || ( bIsWritable && bControllerStateIsValid && ( m_apControllerState->bMayMoveSeriesForward || m_apControllerState->bMayMoveSeriesBackward ) );
// insert objects
- m_aCommandAvailability[ ".uno:InsertTitles" ] = m_aCommandAvailability[ ".uno:InsertMenuTitles" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:InsertLegend" ] = m_aCommandAvailability[ ".uno:InsertMenuLegend" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:DeleteLegend" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:InsertMenuDataLabels" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:InsertRemoveAxes" ] = m_aCommandAvailability[ ".uno:InsertMenuAxes" ] = bIsWritable && m_apModelState->bSupportsAxes;
- m_aCommandAvailability[ ".uno:InsertMenuGrids" ] = bIsWritable && m_apModelState->bSupportsAxes;
- m_aCommandAvailability[ ".uno:InsertMenuTrendlines" ] = bIsWritable && m_apModelState->bSupportsStatistics && m_apControllerState->bMayAddMenuTrendline;
- m_aCommandAvailability[ ".uno:InsertMenuMeanValues" ] = bIsWritable && m_apModelState->bSupportsStatistics;
- m_aCommandAvailability[ ".uno:InsertMenuXErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics;
- m_aCommandAvailability[ ".uno:InsertMenuYErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics;
- m_aCommandAvailability[ ".uno:InsertSymbol" ] = bIsWritable && m_apControllerState->bIsTextObject;
+ m_aCommandAvailability[ u".uno:InsertTitles"_ustr ] = m_aCommandAvailability[ u".uno:InsertMenuTitles"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertLegend"_ustr ] = m_aCommandAvailability[ u".uno:InsertMenuLegend"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:DeleteLegend"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertMenuDataLabels"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertRemoveAxes"_ustr ] = m_aCommandAvailability[ u".uno:InsertMenuAxes"_ustr ] = bIsWritable && m_apModelState->bSupportsAxes;
+ m_aCommandAvailability[ u".uno:InsertMenuGrids"_ustr ] = bIsWritable && m_apModelState->bSupportsAxes;
+ m_aCommandAvailability[ u".uno:InsertMenuTrendlines"_ustr ] = bIsWritable && m_apModelState->bSupportsStatistics && bControllerStateIsValid && m_apControllerState->bMayAddMenuTrendline;
+ m_aCommandAvailability[ u".uno:InsertMenuMeanValues"_ustr ] = bIsWritable && m_apModelState->bSupportsStatistics;
+ m_aCommandAvailability[ u".uno:InsertMenuXErrorBars"_ustr ] = bIsWritable && m_apModelState->bSupportsStatistics;
+ m_aCommandAvailability[ u".uno:InsertMenuYErrorBars"_ustr ] = bIsWritable && m_apModelState->bSupportsStatistics;
+ m_aCommandAvailability[ u".uno:InsertSymbol"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsTextObject;
+ m_aCommandAvailability[ u".uno:InsertMenuDataTable"_ustr ] = bIsWritable;
// format objects
bool bFormatObjectAvailable = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsFormateableObjectSelected;
- m_aCommandAvailability[ ".uno:FormatSelection" ] = bFormatObjectAvailable;
- m_aCommandAvailability[ ".uno:FormatAxis" ] = bFormatObjectAvailable;
- m_aCommandAvailability[ ".uno:FormatTitle" ] = bFormatObjectAvailable;
- m_aCommandAvailability[ ".uno:FormatDataSeries" ] = bFormatObjectAvailable;
- m_aCommandAvailability[ ".uno:FormatDataPoint" ] = bFormatObjectAvailable;
- m_aCommandAvailability[ ".uno:FormatDataLabels" ] = bFormatObjectAvailable;
- m_aCommandAvailability[ ".uno:FormatDataLabel" ] = bFormatObjectAvailable;
- m_aCommandAvailability[ ".uno:FormatXErrorBars" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatXErrorBars;
- m_aCommandAvailability[ ".uno:FormatYErrorBars" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatYErrorBars;
- m_aCommandAvailability[ ".uno:FormatMeanValue" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatMeanValue;
- m_aCommandAvailability[ ".uno:FormatTrendline" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatTrendline;
- m_aCommandAvailability[ ".uno:FormatTrendlineEquation" ] = bFormatObjectAvailable && bControllerStateIsValid && m_apControllerState->bMayFormatTrendlineEquation;
- m_aCommandAvailability[ ".uno:FormatStockLoss" ] = bFormatObjectAvailable;
- m_aCommandAvailability[ ".uno:FormatStockGain" ] = bFormatObjectAvailable;
-
- m_aCommandAvailability[ ".uno:DiagramType" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:Legend" ] = bIsWritable && m_apModelState->bHasLegend;
- m_aCommandAvailability[ ".uno:DiagramWall" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasWall;
- m_aCommandAvailability[ ".uno:DiagramArea" ] = bIsWritable;
-
- m_aCommandAvailability[ ".uno:TransformDialog" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bHasSelectedObject && m_apControllerState->bIsPositionableObject;
+ m_aCommandAvailability[ u".uno:FormatSelection"_ustr ] = bFormatObjectAvailable && !bIsTextEdit;
+ m_aCommandAvailability[ u".uno:FontDialog"_ustr ] = (bShapeContext ? isShapeControllerCommandAvailable(u".uno:FontDialog"_ustr) :
+ bFormatObjectAvailable) && bIsTextEdit;
+ m_aCommandAvailability[ u".uno:FormatAxis"_ustr ] = bFormatObjectAvailable;
+ m_aCommandAvailability[ u".uno:FormatTitle"_ustr ] = bFormatObjectAvailable && !bIsTextEdit;
+ m_aCommandAvailability[ u".uno:FormatDataSeries"_ustr ] = bFormatObjectAvailable;
+ m_aCommandAvailability[ u".uno:FormatDataPoint"_ustr ] = bFormatObjectAvailable;
+ m_aCommandAvailability[ u".uno:FormatDataLabels"_ustr ] = bFormatObjectAvailable;
+ m_aCommandAvailability[ u".uno:FormatDataLabel"_ustr ] = bFormatObjectAvailable;
+ m_aCommandAvailability[ u".uno:FormatXErrorBars"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatXErrorBars;
+ m_aCommandAvailability[ u".uno:FormatYErrorBars"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatYErrorBars;
+ m_aCommandAvailability[ u".uno:FormatMeanValue"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatMeanValue;
+ m_aCommandAvailability[ u".uno:FormatTrendline"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatTrendline;
+ m_aCommandAvailability[ u".uno:FormatTrendlineEquation"_ustr ] = bFormatObjectAvailable && bControllerStateIsValid && m_apControllerState->bMayFormatTrendlineEquation;
+ m_aCommandAvailability[ u".uno:FormatStockLoss"_ustr ] = bFormatObjectAvailable;
+ m_aCommandAvailability[ u".uno:FormatStockGain"_ustr ] = bFormatObjectAvailable;
+
+ m_aCommandAvailability[ u".uno:DiagramType"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:Legend"_ustr ] = bIsWritable && m_apModelState->bHasLegend;
+ m_aCommandAvailability[ u".uno:DiagramWall"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasWall;
+ m_aCommandAvailability[ u".uno:DiagramArea"_ustr ] = bIsWritable;
+
+ m_aCommandAvailability[ u".uno:TransformDialog"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bHasSelectedObject && m_apControllerState->bIsPositionableObject;
// 3d commands
- m_aCommandAvailability[ ".uno:View3D" ] = bIsWritable && bModelStateIsValid && m_apModelState->bIsThreeD;
- m_aCommandAvailability[ ".uno:DiagramFloor" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasFloor;
+ m_aCommandAvailability[ u".uno:View3D"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bIsThreeD;
+ m_aCommandAvailability[ u".uno:DiagramFloor"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasFloor;
//some more format commands with different ui text
- m_aCommandAvailability[ ".uno:FormatWall" ] = m_aCommandAvailability[ ".uno:DiagramWall" ];
- m_aCommandAvailability[ ".uno:FormatFloor" ] = m_aCommandAvailability[ ".uno:DiagramFloor" ];
- m_aCommandAvailability[ ".uno:FormatChartArea" ] = m_aCommandAvailability[ ".uno:DiagramArea" ];
- m_aCommandAvailability[ ".uno:FormatLegend" ] = m_aCommandAvailability[ ".uno:Legend" ];
+ m_aCommandAvailability[ u".uno:FormatWall"_ustr ] = m_aCommandAvailability[ u".uno:DiagramWall"_ustr ];
+ m_aCommandAvailability[ u".uno:FormatFloor"_ustr ] = m_aCommandAvailability[ u".uno:DiagramFloor"_ustr ];
+ m_aCommandAvailability[ u".uno:FormatChartArea"_ustr ] = m_aCommandAvailability[ u".uno:DiagramArea"_ustr ];
+ m_aCommandAvailability[ u".uno:FormatLegend"_ustr ] = m_aCommandAvailability[ u".uno:Legend"_ustr ];
// depending on own data and ability to create new data provider
- m_aCommandAvailability[".uno:DataRanges"] = bIsWritable && bModelStateIsValid && !m_apModelState->bHasDataFromPivotTable
+ m_aCommandAvailability[u".uno:DataRanges"_ustr] = bIsWritable && bModelStateIsValid && !m_apModelState->bHasDataFromPivotTable
&& ((m_apModelState->bHasOwnData && bCanCreateDataProvider) || !m_apModelState->bHasOwnData);
- m_aCommandAvailability[ ".uno:DiagramData" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasOwnData && bEnableDataTableDialog;
+ m_aCommandAvailability[ u".uno:DiagramData"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasOwnData && bEnableDataTableDialog;
// titles
- m_aCommandAvailability[ ".uno:MainTitle" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainTitle;
- m_aCommandAvailability[ ".uno:SubTitle" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasSubTitle;
- m_aCommandAvailability[ ".uno:XTitle" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasXAxisTitle;
- m_aCommandAvailability[ ".uno:YTitle" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasYAxisTitle;
- m_aCommandAvailability[ ".uno:ZTitle" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasZAxisTitle;
- m_aCommandAvailability[ ".uno:SecondaryXTitle" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasSecondaryXAxisTitle;
- m_aCommandAvailability[ ".uno:SecondaryYTitle" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasSecondaryYAxisTitle;
- m_aCommandAvailability[ ".uno:AllTitles" ] = bIsWritable && bModelStateIsValid && m_apModelState->HasAnyTitle();
+ m_aCommandAvailability[ u".uno:MainTitle"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainTitle;
+ m_aCommandAvailability[ u".uno:SubTitle"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasSubTitle;
+ m_aCommandAvailability[ u".uno:XTitle"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasXAxisTitle;
+ m_aCommandAvailability[ u".uno:YTitle"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasYAxisTitle;
+ m_aCommandAvailability[ u".uno:ZTitle"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasZAxisTitle;
+ m_aCommandAvailability[ u".uno:SecondaryXTitle"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasSecondaryXAxisTitle;
+ m_aCommandAvailability[ u".uno:SecondaryYTitle"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasSecondaryYAxisTitle;
+ m_aCommandAvailability[ u".uno:AllTitles"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->HasAnyTitle();
// text
- m_aCommandAvailability[ ".uno:ScaleText" ] = bIsWritable && bModelStateIsValid ;
- m_aCommandArguments[ ".uno:ScaleText" ] <<= m_apModelState->bHasAutoScaledText;
+ m_aCommandAvailability[ u".uno:ScaleText"_ustr ] = bIsWritable && bModelStateIsValid ;
+ m_aCommandArguments[ u".uno:ScaleText"_ustr ] <<= bModelStateIsValid && m_apModelState->bHasAutoScaledText;
+
+ bool bTitleIsInEditMode = false;
+ try
+ {
+ OUString aObjectCID2 = m_xChartController->getSelectionMember().getSelectedCID();
+ if (!aObjectCID2.isEmpty())
+ if (ObjectIdentifier::getObjectType(aObjectCID2) == OBJECTTYPE_TITLE)
+ if (m_xChartController->GetDrawViewWrapper())
+ if (m_xChartController->GetDrawViewWrapper()->GetTextEditOutlinerView())
+ bTitleIsInEditMode = true;
+ }
+ catch (const uno::Exception&) { TOOLS_WARN_EXCEPTION("chart2", ""); }
+
+ bool bEnableUnoCommands = bIsWritable && bModelStateIsValid && !bTitleIsInEditMode;
+ m_aCommandAvailability[u".uno:Bold"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:Strikeout"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:CharFontName"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:FontHeight"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:Italic"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:Underline"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:Shadowed"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:Color"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:FontColor"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:Grow"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:Shrink"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:SuperScript"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:SubScript"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:Spacing"_ustr] = bEnableUnoCommands;
+ m_aCommandAvailability[u".uno:ResetAttributes"_ustr] = bEnableUnoCommands;
+
+ if (!bTitleIsInEditMode)
+ {
+ // at default they are not filled in the sidebar
+ m_aCommandArguments[u".uno:CharFontName"_ustr] <<= false;
+ m_aCommandArguments[u".uno:FontHeight"_ustr] <<= false;
+ m_aCommandArguments[u".uno:Bold"_ustr] <<= false;
+ m_aCommandArguments[u".uno:Strikeout"_ustr] <<= false;
+ m_aCommandArguments[u".uno:Italic"_ustr] <<= false;
+ m_aCommandArguments[u".uno:Underline"_ustr] <<= false;
+ m_aCommandArguments[u".uno:Shadowed"_ustr] <<= false;
+ m_aCommandArguments[u".uno:Color"_ustr] <<= false;
+ m_aCommandArguments[u".uno:FontColor"_ustr] <<= false;
+ m_aCommandArguments[u".uno:SuperScript"_ustr] <<= false;
+ m_aCommandArguments[u".uno:SubScript"_ustr] <<= false;
+ m_aCommandArguments[u".uno:Spacing"_ustr] <<= false;
+ m_aCommandArguments[u".uno:ResetAttributes"_ustr] <<= false;
+ }
+
+ // They are filled based on the text properties.. if there are only 1
+ // but only those properties that are true for the whole text
+ try
+ {
+ // if title is selected, and in edit mode, then the font panel should be disabled
+ // enable the uno commands only if the title is not in edit mode
+ // Todo: enable font panel here if the panel will be able to handle edited title.
+ OUString aObjectCID = m_xChartController->getSelectionMember().getSelectedCID();
+ if (!aObjectCID.isEmpty() && !bTitleIsInEditMode)
+ {
+ // If the selected is not title, then we should check the text properties..
+ // or the selected text properties?
+ std::vector<Reference<beans::XPropertySet>> xProperties;
+ xProperties.emplace(xProperties.end(),
+ ObjectIdentifier::getObjectPropertySet(
+ aObjectCID, m_xChartController->getChartModel()));
+
+ if (ObjectIdentifier::getObjectType(aObjectCID) == OBJECTTYPE_TITLE)
+ {
+ Reference<chart2::XTitle> xTitle(xProperties[0], uno::UNO_QUERY);
+ if (xTitle.is())
+ {
+ const Sequence<Reference<chart2::XFormattedString>> aStrings(xTitle->getText());
+ xProperties.pop_back();
+ for (int i = 0; i < aStrings.getLength(); i++)
+ {
+ Reference<beans::XPropertySet> xTitlePropSet(aStrings[i], uno::UNO_QUERY);
+ xProperties.push_back(xTitlePropSet);
+ }
+ }
+ }
+
+ Reference<beans::XMultiPropertySet> aMObjProps(xProperties[0], uno::UNO_QUERY);
+ if (aMObjProps)
+ {
+ awt::FontDescriptor aFont
+ = CharacterProperties::createFontDescriptorFromPropertySet(aMObjProps);
+
+ if (!aFont.Name.isEmpty())
+ {
+ if (getPropertyIfSame(xProperties, u"CharFontName"_ustr).hasValue())
+ {
+ m_aCommandArguments[u".uno:CharFontName"_ustr] <<= aFont;
+ }
+ }
+ }
+ if (frame::status::FontHeight aFontHeight;
+ getPropertyIfSame(xProperties, u"CharHeight"_ustr) >>= aFontHeight.Height)
+ {
+ // another type is needed here, so
+ m_aCommandArguments[u".uno:FontHeight"_ustr] <<= aFontHeight;
+ }
+
+ if (float nFontWeight;
+ getPropertyIfSame(xProperties, u"CharWeight"_ustr) >>= nFontWeight)
+ {
+ bool bFontWeight = (nFontWeight > 100.0);
+ m_aCommandArguments[u".uno:Bold"_ustr] <<= bFontWeight;
+ }
+
+ if (awt::FontSlant nFontItalic;
+ getPropertyIfSame(xProperties, u"CharPosture"_ustr) >>= nFontItalic)
+ {
+ bool bItalic = (nFontItalic == awt::FontSlant_ITALIC);
+ m_aCommandArguments[u".uno:Italic"_ustr] <<= bItalic;
+ }
+
+ if (sal_Int16 nFontStrikeout;
+ getPropertyIfSame(xProperties, u"CharStrikeout"_ustr) >>= nFontStrikeout)
+ {
+ bool bFontStrikeout = (nFontStrikeout > 0);
+ m_aCommandArguments[u".uno:Strikeout"_ustr] <<= bFontStrikeout;
+ }
+
+ if (sal_Int16 nFontUnderline;
+ getPropertyIfSame(xProperties, u"CharUnderline"_ustr) >>= nFontUnderline)
+ {
+ bool bFontUnderline = (nFontUnderline > 0);
+ m_aCommandArguments[u".uno:Underline"_ustr] <<= bFontUnderline;
+ }
+
+ if (bool bShadowed; getPropertyIfSame(xProperties, u"CharShadowed"_ustr) >>= bShadowed)
+ {
+ m_aCommandArguments[u".uno:Shadowed"_ustr] <<= bShadowed;
+ }
+
+ // Font color is not set in panel... it is just enabled to use
+ m_aCommandArguments[u".uno:Color"_ustr] <<= false;
+ m_aCommandArguments[u".uno:FontColor"_ustr] <<= false;
+
+ if (sal_Int32 nCharEscapement;
+ getPropertyIfSame(xProperties, u"CharEscapement"_ustr) >>= nCharEscapement)
+ {
+ m_aCommandArguments[u".uno:SuperScript"_ustr] <<= (nCharEscapement > 0);
+ m_aCommandArguments[u".uno:SubScript"_ustr] <<= (nCharEscapement < 0);
+ }
+
+ // Font Spacing is not set in panel... it is just enabled to use
+ m_aCommandArguments[u".uno:Spacing"_ustr] <<= false;
+ }
+ }
+ catch (const uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "");
+ }
// axes
- m_aCommandAvailability[ ".uno:DiagramAxisX" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasXAxis;
- m_aCommandAvailability[ ".uno:DiagramAxisY" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasYAxis;
- m_aCommandAvailability[ ".uno:DiagramAxisZ" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasZAxis;
- m_aCommandAvailability[ ".uno:DiagramAxisA" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasAAxis;
- m_aCommandAvailability[ ".uno:DiagramAxisB" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasBAxis;
- m_aCommandAvailability[ ".uno:DiagramAxisAll" ] = bIsWritable && bModelStateIsValid && m_apModelState->HasAnyAxis();
+ m_aCommandAvailability[ u".uno:DiagramAxisX"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasXAxis;
+ m_aCommandAvailability[ u".uno:DiagramAxisY"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasYAxis;
+ m_aCommandAvailability[ u".uno:DiagramAxisZ"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasZAxis;
+ m_aCommandAvailability[ u".uno:DiagramAxisA"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasAAxis;
+ m_aCommandAvailability[ u".uno:DiagramAxisB"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasBAxis;
+ m_aCommandAvailability[ u".uno:DiagramAxisAll"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->HasAnyAxis();
// grids
// note: x and y are swapped in the commands!
- m_aCommandAvailability[ ".uno:DiagramGridYMain" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainXGrid;
- m_aCommandAvailability[ ".uno:DiagramGridXMain" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainYGrid;
- m_aCommandAvailability[ ".uno:DiagramGridZMain" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainZGrid;
- m_aCommandAvailability[ ".uno:DiagramGridYHelp" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasHelpXGrid;
- m_aCommandAvailability[ ".uno:DiagramGridXHelp" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasHelpYGrid;
- m_aCommandAvailability[ ".uno:DiagramGridZHelp" ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasHelpZGrid;
- m_aCommandAvailability[ ".uno:DiagramGridAll" ] = bIsWritable && bModelStateIsValid && m_apModelState->HasAnyGrid();
+ m_aCommandAvailability[ u".uno:DiagramGridYMain"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainXGrid;
+ m_aCommandAvailability[ u".uno:DiagramGridXMain"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainYGrid;
+ m_aCommandAvailability[ u".uno:DiagramGridZMain"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainZGrid;
+ m_aCommandAvailability[ u".uno:DiagramGridYHelp"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasHelpXGrid;
+ m_aCommandAvailability[ u".uno:DiagramGridXHelp"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasHelpYGrid;
+ m_aCommandAvailability[ u".uno:DiagramGridZHelp"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bHasHelpZGrid;
+ m_aCommandAvailability[ u".uno:DiagramGridAll"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->HasAnyGrid();
// series arrangement
- m_aCommandAvailability[ ".uno:Forward" ] = ( bShapeContext ? isShapeControllerCommandAvailable( ".uno:Forward" ) :
+ m_aCommandAvailability[ u".uno:Forward"_ustr ] = ( bShapeContext ? isShapeControllerCommandAvailable( u".uno:Forward"_ustr ) :
( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesForward && bEnableDataTableDialog ) );
- m_aCommandAvailability[ ".uno:Backward" ] = ( bShapeContext ? isShapeControllerCommandAvailable( ".uno:Backward" ) :
+ m_aCommandAvailability[ u".uno:Backward"_ustr ] = ( bShapeContext ? isShapeControllerCommandAvailable( u".uno:Backward"_ustr ) :
( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesBackward && bEnableDataTableDialog ) );
- m_aCommandAvailability[ ".uno:InsertDataLabels" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:InsertDataLabel" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:InsertMeanValue" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddMeanValue;
- m_aCommandAvailability[ ".uno:InsertTrendline" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddTrendline;
- m_aCommandAvailability[ ".uno:InsertTrendlineEquation" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddTrendlineEquation;
- m_aCommandAvailability[ ".uno:InsertTrendlineEquationAndR2" ] = m_aCommandAvailability[ ".uno:InsertTrendlineEquation" ];
- m_aCommandAvailability[ ".uno:InsertR2Value" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddR2Value;
- m_aCommandAvailability[ ".uno:DeleteR2Value" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteR2Value;
-
- m_aCommandAvailability[ ".uno:InsertXErrorBars" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddXErrorBars;
- m_aCommandAvailability[ ".uno:InsertYErrorBars" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddYErrorBars;
-
- m_aCommandAvailability[ ".uno:DeleteDataLabels" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:DeleteDataLabel" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:DeleteTrendline" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteTrendline;
- m_aCommandAvailability[ ".uno:DeleteTrendlineEquation" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteTrendlineEquation;
- m_aCommandAvailability[ ".uno:DeleteMeanValue" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteMeanValue;
- m_aCommandAvailability[ ".uno:DeleteXErrorBars" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteXErrorBars;
- m_aCommandAvailability[ ".uno:DeleteYErrorBars" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteYErrorBars;
-
- m_aCommandAvailability[ ".uno:ResetDataPoint" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:ResetAllDataPoints" ] = bIsWritable;
-
- m_aCommandAvailability[ ".uno:InsertAxis" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:DeleteAxis" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:InsertAxisTitle" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:FormatMajorGrid" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:InsertMajorGrid" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:DeleteMajorGrid" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:FormatMinorGrid" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:InsertMinorGrid" ] = bIsWritable;
- m_aCommandAvailability[ ".uno:DeleteMinorGrid" ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertDataLabels"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertDataLabel"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertMeanValue"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddMeanValue;
+ m_aCommandAvailability[ u".uno:InsertTrendline"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddTrendline;
+ const bool bInsertTrendlineEquation = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddTrendlineEquation;
+ m_aCommandAvailability[ u".uno:InsertTrendlineEquation"_ustr ] = bInsertTrendlineEquation;
+ m_aCommandAvailability[ u".uno:InsertTrendlineEquationAndR2"_ustr ] = bInsertTrendlineEquation && m_apControllerState->bMayAddR2Value;
+ m_aCommandAvailability[ u".uno:InsertR2Value"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddR2Value
+ && !m_apControllerState->bMayAddTrendlineEquation;
+ m_aCommandAvailability[ u".uno:DeleteR2Value"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteR2Value;
+
+ m_aCommandAvailability[ u".uno:InsertXErrorBars"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddXErrorBars;
+ m_aCommandAvailability[ u".uno:InsertYErrorBars"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddYErrorBars;
+
+ m_aCommandAvailability[ u".uno:DeleteDataLabels"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:DeleteDataLabel"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:DeleteTrendline"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteTrendline;
+ m_aCommandAvailability[ u".uno:DeleteTrendlineEquation"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteTrendlineEquation;
+ m_aCommandAvailability[ u".uno:DeleteMeanValue"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteMeanValue;
+ m_aCommandAvailability[ u".uno:DeleteXErrorBars"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteXErrorBars;
+ m_aCommandAvailability[ u".uno:DeleteYErrorBars"_ustr ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteYErrorBars;
+
+ m_aCommandAvailability[ u".uno:ResetDataPoint"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:ResetAllDataPoints"_ustr ] = bIsWritable;
+
+ m_aCommandAvailability[ u".uno:InsertAxis"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:DeleteAxis"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertAxisTitle"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:FormatMajorGrid"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertMajorGrid"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:DeleteMajorGrid"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:FormatMinorGrid"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:InsertMinorGrid"_ustr ] = bIsWritable;
+ m_aCommandAvailability[ u".uno:DeleteMinorGrid"_ustr ] = bIsWritable;
+
+ // data table
+ m_aCommandAvailability[ u".uno:InsertDataTable"_ustr ] = bIsWritable && bModelStateIsValid && !m_apModelState->bDataTable;
+ m_aCommandAvailability[ u".uno:DeleteDataTable"_ustr ] = bIsWritable && bModelStateIsValid && m_apModelState->bDataTable;
}
-bool ControllerCommandDispatch::commandAvailable( const OUString & rCommand )
+bool ControllerCommandDispatch::commandAvailable(const OUString& rCommand) const
{
std::map< OUString, bool >::const_iterator aIt( m_aCommandAvailability.find( rCommand ));
if( aIt != m_aCommandAvailability.end())
@@ -711,6 +881,11 @@ bool ControllerCommandDispatch::commandAvailable( const OUString & rCommand )
return false;
}
+bool ControllerCommandDispatch::commandHandled(const OUString& rCommand) const
+{
+ return m_aCommandAvailability.contains(rCommand);
+}
+
bool ControllerCommandDispatch::isShapeControllerCommandAvailable( const OUString& rCommand )
{
ShapeController* pShapeController(nullptr);
@@ -731,12 +906,11 @@ void ControllerCommandDispatch::fireStatusEvent(
const OUString & rURL,
const Reference< frame::XStatusListener > & xSingleListener /* = 0 */ )
{
- bool bIsChartSelectorURL = rURL == ".uno:ChartElementSelector";
- if( rURL.isEmpty() || bIsChartSelectorURL )
+ if (rURL.isEmpty() || rURL == ".uno:ChartElementSelector")
{
uno::Any aArg;
aArg <<= Reference< frame::XController >(m_xChartController);
- fireStatusEventForURL( ".uno:ChartElementSelector", aArg, true, xSingleListener );
+ fireStatusEventForURL( u".uno:ChartElementSelector"_ustr, aArg, true, xSingleListener );
}
if( rURL.isEmpty() )
@@ -744,16 +918,8 @@ void ControllerCommandDispatch::fireStatusEvent(
for (auto const& elem : m_aCommandAvailability)
fireStatusEventForURLImpl( elem.first, xSingleListener );
}
- else if( !bIsChartSelectorURL )
+ else if (m_aCommandAvailability.contains(rURL))
fireStatusEventForURLImpl( rURL, xSingleListener );
-
- // statusbar. Should be handled by base implementation
- // @todo: remove if Issue 68864 is fixed
- if( rURL.isEmpty() || rURL == ".uno:StatusBarVisible" )
- {
- bool bIsStatusBarVisible( lcl_isStatusBarVisible( m_xChartController ));
- fireStatusEventForURL( ".uno:StatusBarVisible", uno::Any( bIsStatusBarVisible ), true, xSingleListener );
- }
}
// ____ XDispatch ____
@@ -767,7 +933,7 @@ void SAL_CALL ControllerCommandDispatch::dispatch(
// ____ WeakComponentImplHelperBase ____
/// is called when this is disposed
-void SAL_CALL ControllerCommandDispatch::disposing()
+void ControllerCommandDispatch::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
{
m_xChartController.clear();
m_xDispatch.clear();
diff --git a/chart2/source/controller/main/DragMethod_Base.cxx b/chart2/source/controller/main/DragMethod_Base.cxx
index d1885e333077..5e46dc327b19 100644
--- a/chart2/source/controller/main/DragMethod_Base.cxx
+++ b/chart2/source/controller/main/DragMethod_Base.cxx
@@ -24,23 +24,21 @@
#include <ObjectIdentifier.hxx>
#include <svx/ActionDescriptionProvider.hxx>
-#include <com/sun/star/frame/XModel.hpp>
+#include <utility>
#include <vcl/ptrstyle.hxx>
namespace chart
{
using namespace ::com::sun::star;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::WeakReference;
DragMethod_Base::DragMethod_Base( DrawViewWrapper& rDrawViewWrapper
- , const OUString& rObjectCID
+ , OUString aObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel
, ActionDescriptionProvider::ActionType eActionType )
: SdrDragMethod( rDrawViewWrapper )
, m_rDrawViewWrapper(rDrawViewWrapper)
- , m_aObjectCID(rObjectCID)
+ , m_aObjectCID(std::move(aObjectCID))
, m_eActionType( eActionType )
, m_xChartModel( xChartModel.get() )
{
diff --git a/chart2/source/controller/main/DragMethod_Base.hxx b/chart2/source/controller/main/DragMethod_Base.hxx
index 497b31f6e88d..df124406894c 100644
--- a/chart2/source/controller/main/DragMethod_Base.hxx
+++ b/chart2/source/controller/main/DragMethod_Base.hxx
@@ -23,7 +23,6 @@
#include <unotools/weakref.hxx>
namespace chart { class DrawViewWrapper; }
-namespace com::sun::star::frame { class XModel; }
namespace chart
{
@@ -32,7 +31,7 @@ class ChartModel;
class DragMethod_Base : public SdrDragMethod
{
public:
- DragMethod_Base( DrawViewWrapper& rDrawViewWrapper, const OUString& rObjectCID
+ DragMethod_Base( DrawViewWrapper& rDrawViewWrapper, OUString aObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel
, ActionDescriptionProvider::ActionType eActionType = ActionDescriptionProvider::ActionType::Move );
virtual ~DragMethod_Base() override;
diff --git a/chart2/source/controller/main/DragMethod_PieSegment.cxx b/chart2/source/controller/main/DragMethod_PieSegment.cxx
index c2c5db234bd7..f5145d276c99 100644
--- a/chart2/source/controller/main/DragMethod_PieSegment.cxx
+++ b/chart2/source/controller/main/DragMethod_PieSegment.cxx
@@ -25,9 +25,8 @@
#include <ObjectIdentifier.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Point.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -46,7 +45,7 @@ DragMethod_PieSegment::DragMethod_PieSegment( DrawViewWrapper& rDrawViewWrapper
, m_aDragDirection(1000.0,1000.0)
, m_fDragRange( 1.0 )
{
- OUString aParameter( ObjectIdentifier::getDragParameterString( m_aObjectCID ) );
+ std::u16string_view aParameter( ObjectIdentifier::getDragParameterString( m_aObjectCID ) );
sal_Int32 nOffsetPercent(0);
awt::Point aMinimumPosition(0,0);
@@ -118,7 +117,7 @@ bool DragMethod_PieSegment::EndSdrDrag(bool /*bCopy*/)
Reference< beans::XPropertySet > xPointProperties(
ObjectIdentifier::getObjectPropertySet( m_aObjectCID, xChartModel ) );
if( xPointProperties.is() )
- xPointProperties->setPropertyValue( "Offset", uno::Any( m_fAdditionalOffset+m_fInitialOffset ));
+ xPointProperties->setPropertyValue( u"Offset"_ustr, uno::Any( m_fAdditionalOffset+m_fInitialOffset ));
}
}
catch( const uno::Exception & )
@@ -128,7 +127,7 @@ bool DragMethod_PieSegment::EndSdrDrag(bool /*bCopy*/)
return true;
}
-basegfx::B2DHomMatrix DragMethod_PieSegment::getCurrentTransformation()
+basegfx::B2DHomMatrix DragMethod_PieSegment::getCurrentTransformation() const
{
basegfx::B2DHomMatrix aRetval;
@@ -143,8 +142,8 @@ void DragMethod_PieSegment::createSdrDragEntries()
if( pObj && pPV )
{
- const basegfx::B2DPolyPolygon aNewPolyPolygon(pObj->TakeXorPoly());
- addSdrDragEntry(std::unique_ptr<SdrDragEntry>(new SdrDragEntryPolyPolygon(aNewPolyPolygon)));
+ basegfx::B2DPolyPolygon aNewPolyPolygon(pObj->TakeXorPoly());
+ addSdrDragEntry(std::unique_ptr<SdrDragEntry>(new SdrDragEntryPolyPolygon(std::move(aNewPolyPolygon))));
}
}
} //namespace chart
diff --git a/chart2/source/controller/main/DragMethod_PieSegment.hxx b/chart2/source/controller/main/DragMethod_PieSegment.hxx
index 8a36dbd4c876..8cb498373f33 100644
--- a/chart2/source/controller/main/DragMethod_PieSegment.hxx
+++ b/chart2/source/controller/main/DragMethod_PieSegment.hxx
@@ -36,7 +36,7 @@ public:
virtual void MoveSdrDrag(const Point& rPnt) override;
virtual bool EndSdrDrag(bool bCopy) override;
- virtual basegfx::B2DHomMatrix getCurrentTransformation() override;
+ virtual basegfx::B2DHomMatrix getCurrentTransformation() const override;
protected:
virtual void createSdrDragEntries() override;
diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
index 030fcd0bf8bc..68698f195bae 100644
--- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
+++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
@@ -21,10 +21,9 @@
#include <DrawViewWrapper.hxx>
#include <SelectionHelper.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ThreeDHelper.hxx>
#include <defines.hxx>
@@ -32,8 +31,6 @@
#include <svx/scene3d.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
@@ -42,7 +39,6 @@ namespace chart
{
using namespace ::com::sun::star;
-using ::com::sun::star::uno::Reference;
DragMethod_RotateDiagram::DragMethod_RotateDiagram( DrawViewWrapper& rDrawViewWrapper
, const OUString& rObjectCID
@@ -74,19 +70,19 @@ DragMethod_RotateDiagram::DragMethod_RotateDiagram( DrawViewWrapper& rDrawViewWr
m_aWireframePolyPolygon = m_pScene->CreateWireframe();
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram(getChartModel());
+ rtl::Reference< Diagram > xDiagram = getChartModel()->getFirstChartDiagram();
if( !xDiagram.is() )
return;
- ThreeDHelper::getRotationFromDiagram( xDiagram
- , m_nInitialHorizontalAngleDegree, m_nInitialVerticalAngleDegree );
+ xDiagram->getRotation(
+ m_nInitialHorizontalAngleDegree, m_nInitialVerticalAngleDegree );
- ThreeDHelper::getRotationAngleFromDiagram( xDiagram
- , m_fInitialXAngleRad, m_fInitialYAngleRad, m_fInitialZAngleRad );
+ xDiagram->getRotationAngle(
+ m_fInitialXAngleRad, m_fInitialYAngleRad, m_fInitialZAngleRad );
- if( ChartTypeHelper::isSupportingRightAngledAxes(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ) )
- xDiagram->getPropertyValue("RightAngledAxes") >>= m_bRightAngledAxes;
+ auto xChartType = xDiagram->getChartTypeByIndex(0);
+ if (xChartType.is() ? xChartType->isSupportingRightAngledAxes() : true)
+ xDiagram->getPropertyValue(u"RightAngledAxes"_ustr) >>= m_bRightAngledAxes;
if(m_bRightAngledAxes)
{
if( m_eRotationDirection==ROTATIONDIRECTION_Z )
@@ -161,20 +157,23 @@ bool DragMethod_RotateDiagram::EndSdrDrag(bool /*bCopy*/)
if(m_bRightAngledAxes)
ThreeDHelper::adaptRadAnglesForRightAngledAxes( fResultX, fResultY );
- ThreeDHelper::setRotationAngleToDiagram( ChartModelHelper::findDiagram( getChartModel() )
- , fResultX, fResultY, fResultZ );
+ rtl::Reference<Diagram> xDiagram = getChartModel()->getFirstChartDiagram();
+ if (xDiagram)
+ xDiagram->setRotationAngle( fResultX, fResultY, fResultZ );
}
else
{
- ThreeDHelper::setRotationToDiagram( ChartModelHelper::findDiagram( getChartModel() )
- , m_nInitialHorizontalAngleDegree+m_nAdditionalHorizontalAngleDegree, m_nInitialVerticalAngleDegree+m_nAdditionalVerticalAngleDegree );
+ rtl::Reference<Diagram> xDiagram = getChartModel()->getFirstChartDiagram();
+ if (xDiagram)
+ xDiagram->setRotation(
+ m_nInitialHorizontalAngleDegree+m_nAdditionalHorizontalAngleDegree, m_nInitialVerticalAngleDegree+m_nAdditionalVerticalAngleDegree );
}
return true;
}
void DragMethod_RotateDiagram::CreateOverlayGeometry(
sdr::overlay::OverlayManager& rOverlayManager,
- const sdr::contact::ObjectContact& rObjectContact)
+ const sdr::contact::ObjectContact& rObjectContact, bool /* bIsGeometrySizeValid */)
{
::basegfx::B3DHomMatrix aCurrentTransform;
aCurrentTransform.translate( -FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0,
@@ -217,7 +216,7 @@ void DragMethod_RotateDiagram::CreateOverlayGeometry(
std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(
new sdr::overlay::OverlayPolyPolygonStripedAndFilled(
- aPolyPolygon));
+ std::move(aPolyPolygon)));
insertNewlyCreatedOverlayObjectForSdrDragMethod(
std::move(pNew),
diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.hxx b/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
index 69e9050eeb4e..d50fb42354ea 100644
--- a/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
+++ b/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
@@ -54,7 +54,7 @@ public:
virtual void CreateOverlayGeometry(
sdr::overlay::OverlayManager& rOverlayManager,
- const sdr::contact::ObjectContact& rObjectContact) override;
+ const sdr::contact::ObjectContact& rObjectContact, bool bIsGeometrySizeValid=true) override;
private:
E3dScene* m_pScene;
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index a20d2ba1a7fb..c7a3d9837ce8 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -18,15 +18,14 @@
*/
#include "DrawCommandDispatch.hxx"
-#include "DrawCommandDispatch.h"
#include <ChartController.hxx>
#include <DrawViewWrapper.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include <com/sun/star/frame/CommandGroup.hpp>
#include <o3tl/unsafe_downcast.hxx>
+#include <o3tl/string_view.hxx>
#include <vcl/svapp.hxx>
-#include <svl/itempool.hxx>
#include <editeng/eeitem.hxx>
#include <svx/strings.hrc>
#include <svx/dialmgr.hxx>
@@ -67,7 +66,7 @@ DrawCommandDispatch::~DrawCommandDispatch()
bool DrawCommandDispatch::isFeatureSupported( const OUString& rCommandURL )
{
- sal_uInt16 nFeatureId = 0;
+ ChartCommandID nFeatureId = ChartCommandID::NONE;
OUString aBaseCommand;
OUString aCustomShapeType;
return parseCommandURL( rCommandURL, &nFeatureId, &aBaseCommand, &aCustomShapeType );
@@ -115,8 +114,6 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
if ( aObjList[ i ].equalsIgnoreAsciiCase( m_aCustomShapeType ) )
{
FmFormModel aModel;
- SfxItemPool& rPool(aModel.GetItemPool());
- rPool.FreezeIdRanges();
if ( GalleryExplorer::GetSdrObj( GALLERY_THEME_POWERPOINT, i, &aModel ) )
{
@@ -124,21 +121,19 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
if ( pSourceObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
- SfxItemSetFixed<
+ // Create a dynamic SfxItemSet
+ SfxItemSet aDest(
+ SfxItemSet::makeFixedSfxItemSet<
// Ranges from SdrAttrObj:
- SDRATTR_START, SDRATTR_SHADOW_LAST,
- SDRATTR_MISC_FIRST,
- SDRATTR_MISC_LAST,
- SDRATTR_TEXTDIRECTION,
- SDRATTR_TEXTDIRECTION,
+ SDRATTR_START, SDRATTR_SHADOW_LAST, SDRATTR_MISC_FIRST,
+ SDRATTR_MISC_LAST, SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
// Graphic attributes, 3D
// properties, CustomShape
// properties:
- SDRATTR_GRAF_FIRST,
- SDRATTR_CUSTOMSHAPE_LAST,
+ SDRATTR_GRAF_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
// Range from SdrTextObj:
- EE_ITEMS_START, EE_ITEMS_END>
- aDest(pObj->getSdrModelFromSdrObject().GetItemPool());
+ EE_ITEMS_START, EE_ITEMS_END>(
+ pObj->getSdrModelFromSdrObject().GetItemPool()));
aDest.Set( rSource );
pObj->SetMergedItemSet( aDest );
Degree100 nAngle = pSourceObj->GetRotateAngle();
@@ -164,7 +159,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
{
- if ( !(m_nFeatureId == COMMAND_ID_LINE_ARROW_END && m_pChartController) )
+ if ( !(m_nFeatureId == ChartCommandID::DrawLineArrowEnd && m_pChartController) )
return;
DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
@@ -183,11 +178,11 @@ void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
aArrow.append( aNewArrow );
}
- SfxItemSet aSet( pDrawViewWrapper->GetModel()->GetItemPool() );
+ SfxItemSet aSet(pDrawViewWrapper->GetModel().GetItemPool());
pDrawViewWrapper->GetAttributes( aSet );
tools::Long nWidth = 300; // (1/100th mm)
- if ( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
+ if ( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::INVALID )
{
tools::Long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
if ( nValue > 0 )
@@ -196,12 +191,12 @@ void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
}
}
- rAttr.Put( XLineEndItem( SvxResId( RID_SVXSTR_ARROW ), aArrow ) );
+ rAttr.Put( XLineEndItem( SvxResId( RID_SVXSTR_ARROW ), std::move(aArrow) ) );
rAttr.Put( XLineEndWidthItem( nWidth ) );
}
// WeakComponentImplHelperBase
-void DrawCommandDispatch::disposing()
+void DrawCommandDispatch::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
{
}
@@ -216,27 +211,27 @@ FeatureState DrawCommandDispatch::getState( const OUString& rCommand )
aReturn.bEnabled = false;
aReturn.aState <<= false;
- sal_uInt16 nFeatureId = 0;
+ ChartCommandID nFeatureId = ChartCommandID::NONE;
OUString aBaseCommand;
OUString aCustomShapeType;
if ( parseCommandURL( rCommand, &nFeatureId, &aBaseCommand, &aCustomShapeType ) )
{
switch ( nFeatureId )
{
- case COMMAND_ID_OBJECT_SELECT:
- case COMMAND_ID_DRAW_LINE:
- case COMMAND_ID_LINE_ARROW_END:
- case COMMAND_ID_DRAW_RECT:
- case COMMAND_ID_DRAW_ELLIPSE:
- case COMMAND_ID_DRAW_FREELINE_NOFILL:
- case COMMAND_ID_DRAW_TEXT:
- case COMMAND_ID_DRAW_CAPTION:
- case COMMAND_ID_DRAWTBX_CS_BASIC:
- case COMMAND_ID_DRAWTBX_CS_SYMBOL:
- case COMMAND_ID_DRAWTBX_CS_ARROW:
- case COMMAND_ID_DRAWTBX_CS_FLOWCHART:
- case COMMAND_ID_DRAWTBX_CS_CALLOUT:
- case COMMAND_ID_DRAWTBX_CS_STAR:
+ case ChartCommandID::DrawObjectSelect:
+ case ChartCommandID::DrawLine:
+ case ChartCommandID::DrawLineArrowEnd:
+ case ChartCommandID::DrawRect:
+ case ChartCommandID::DrawEllipse:
+ case ChartCommandID::DrawFreelineNoFill:
+ case ChartCommandID::DrawText:
+ case ChartCommandID::DrawCaption:
+ case ChartCommandID::DrawToolboxCsBasic:
+ case ChartCommandID::DrawToolboxCsSymbol:
+ case ChartCommandID::DrawToolboxCsArrow:
+ case ChartCommandID::DrawToolboxCsFlowchart:
+ case ChartCommandID::DrawToolboxCsCallout:
+ case ChartCommandID::DrawToolboxCsStar:
{
aReturn.bEnabled = true;
aReturn.aState <<= false;
@@ -259,7 +254,7 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea
ChartDrawMode eDrawMode = CHARTDRAW_SELECT;
SdrObjKind eKind = SdrObjKind::NONE;
- sal_uInt16 nFeatureId = 0;
+ ChartCommandID nFeatureId = ChartCommandID::NONE;
OUString aBaseCommand;
OUString aCustomShapeType;
if ( !parseCommandURL( rCommand, &nFeatureId, &aBaseCommand, &aCustomShapeType ) )
@@ -271,56 +266,56 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea
switch ( nFeatureId )
{
- case COMMAND_ID_OBJECT_SELECT:
+ case ChartCommandID::DrawObjectSelect:
{
eDrawMode = CHARTDRAW_SELECT;
eKind = SdrObjKind::NONE;
}
break;
- case COMMAND_ID_DRAW_LINE:
- case COMMAND_ID_LINE_ARROW_END:
+ case ChartCommandID::DrawLine:
+ case ChartCommandID::DrawLineArrowEnd:
{
eDrawMode = CHARTDRAW_INSERT;
eKind = SdrObjKind::Line;
}
break;
- case COMMAND_ID_DRAW_RECT:
+ case ChartCommandID::DrawRect:
{
eDrawMode = CHARTDRAW_INSERT;
eKind = SdrObjKind::Rectangle;
}
break;
- case COMMAND_ID_DRAW_ELLIPSE:
+ case ChartCommandID::DrawEllipse:
{
eDrawMode = CHARTDRAW_INSERT;
eKind = SdrObjKind::CircleOrEllipse;
}
break;
- case COMMAND_ID_DRAW_FREELINE_NOFILL:
+ case ChartCommandID::DrawFreelineNoFill:
{
eDrawMode = CHARTDRAW_INSERT;
eKind = SdrObjKind::FreehandLine;
}
break;
- case COMMAND_ID_DRAW_TEXT:
+ case ChartCommandID::DrawText:
{
eDrawMode = CHARTDRAW_INSERT;
eKind = SdrObjKind::Text;
bCreate = true;
}
break;
- case COMMAND_ID_DRAW_CAPTION:
+ case ChartCommandID::DrawCaption:
{
eDrawMode = CHARTDRAW_INSERT;
eKind = SdrObjKind::Caption;
}
break;
- case COMMAND_ID_DRAWTBX_CS_BASIC:
- case COMMAND_ID_DRAWTBX_CS_SYMBOL:
- case COMMAND_ID_DRAWTBX_CS_ARROW:
- case COMMAND_ID_DRAWTBX_CS_FLOWCHART:
- case COMMAND_ID_DRAWTBX_CS_CALLOUT:
- case COMMAND_ID_DRAWTBX_CS_STAR:
+ case ChartCommandID::DrawToolboxCsBasic:
+ case ChartCommandID::DrawToolboxCsSymbol:
+ case ChartCommandID::DrawToolboxCsArrow:
+ case ChartCommandID::DrawToolboxCsFlowchart:
+ case ChartCommandID::DrawToolboxCsCallout:
+ case ChartCommandID::DrawToolboxCsStar:
{
eDrawMode = CHARTDRAW_INSERT;
eKind = SdrObjKind::CustomShape;
@@ -349,25 +344,23 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea
pDrawViewWrapper->SetCreateMode();
}
- const beans::PropertyValue* pIter = rArgs.getConstArray();
- const beans::PropertyValue* pEnd = pIter + rArgs.getLength();
- const beans::PropertyValue* pKeyModifier = std::find_if(pIter, pEnd,
+ const beans::PropertyValue* pKeyModifier = std::find_if(rArgs.begin(), rArgs.end(),
[](const beans::PropertyValue& lhs)
{return lhs.Name == "KeyModifier";} );
sal_Int16 nKeyModifier = 0;
- if ( !(pKeyModifier != pEnd && ( pKeyModifier->Value >>= nKeyModifier ) && nKeyModifier == KEY_MOD1) )
+ if ( !(pKeyModifier != rArgs.end() && ( pKeyModifier->Value >>= nKeyModifier ) && nKeyModifier == KEY_MOD1) )
return;
if ( eDrawMode != CHARTDRAW_INSERT )
return;
- SdrObject* pObj = createDefaultObject( nFeatureId );
+ rtl::Reference<SdrObject> pObj = createDefaultObject( nFeatureId );
if ( pObj )
{
SdrPageView* pPageView = pDrawViewWrapper->GetSdrPageView();
- if (pDrawViewWrapper->InsertObjectAtView(pObj, *pPageView))
+ if (pDrawViewWrapper->InsertObjectAtView(pObj.get(), *pPageView))
m_pChartController->SetAndApplySelection(Reference<drawing::XShape>(pObj->getUnoShape(), uno::UNO_QUERY));
- if ( nFeatureId == COMMAND_ID_DRAW_TEXT )
+ if ( nFeatureId == ChartCommandID::DrawText )
{
m_pChartController->StartTextEdit();
}
@@ -376,20 +369,20 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea
void DrawCommandDispatch::describeSupportedFeatures()
{
- implDescribeSupportedFeature( ".uno:SelectObject", COMMAND_ID_OBJECT_SELECT, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:Line", COMMAND_ID_DRAW_LINE, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:LineArrowEnd", COMMAND_ID_LINE_ARROW_END, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:Rect", COMMAND_ID_DRAW_RECT, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:Ellipse", COMMAND_ID_DRAW_ELLIPSE, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:Freeline_Unfilled", COMMAND_ID_DRAW_FREELINE_NOFILL, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:DrawText", COMMAND_ID_DRAW_TEXT, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:DrawCaption", COMMAND_ID_DRAW_CAPTION, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:BasicShapes", COMMAND_ID_DRAWTBX_CS_BASIC, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:SymbolShapes", COMMAND_ID_DRAWTBX_CS_SYMBOL, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:ArrowShapes", COMMAND_ID_DRAWTBX_CS_ARROW, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:FlowChartShapes", COMMAND_ID_DRAWTBX_CS_FLOWCHART, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:CalloutShapes", COMMAND_ID_DRAWTBX_CS_CALLOUT, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:StarShapes", COMMAND_ID_DRAWTBX_CS_STAR, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:SelectObject"_ustr, ChartCommandID::DrawObjectSelect, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:Line"_ustr, ChartCommandID::DrawLine, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:LineArrowEnd"_ustr, ChartCommandID::DrawLineArrowEnd, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:Rect"_ustr, ChartCommandID::DrawRect, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:Ellipse"_ustr, ChartCommandID::DrawEllipse, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:Freeline_Unfilled"_ustr, ChartCommandID::DrawFreelineNoFill, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:DrawText"_ustr, ChartCommandID::DrawText, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:DrawCaption"_ustr, ChartCommandID::DrawCaption, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:BasicShapes"_ustr, ChartCommandID::DrawToolboxCsBasic, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:SymbolShapes"_ustr, ChartCommandID::DrawToolboxCsSymbol, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:ArrowShapes"_ustr, ChartCommandID::DrawToolboxCsArrow, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:FlowChartShapes"_ustr, ChartCommandID::DrawToolboxCsFlowchart, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:CalloutShapes"_ustr, ChartCommandID::DrawToolboxCsCallout, CommandGroup::INSERT );
+ implDescribeSupportedFeature( u".uno:StarShapes"_ustr, ChartCommandID::DrawToolboxCsStar, CommandGroup::INSERT );
}
void DrawCommandDispatch::setInsertObj(SdrObjKind eObj)
@@ -401,15 +394,15 @@ void DrawCommandDispatch::setInsertObj(SdrObjKind eObj)
}
}
-SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
+rtl::Reference<SdrObject> DrawCommandDispatch::createDefaultObject( const ChartCommandID nID )
{
- SdrObject* pObj = nullptr;
+ rtl::Reference<SdrObject> pObj;
DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : nullptr );
DrawModelWrapper* pDrawModelWrapper = ( m_pChartController ? m_pChartController->GetDrawModelWrapper() : nullptr );
if ( pDrawViewWrapper && pDrawModelWrapper )
{
- Reference< drawing::XDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
+ rtl::Reference< SvxDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
SdrPage* pPage = GetSdrPageFromXDrawPage( xDrawPage );
if ( pPage )
{
@@ -431,10 +424,10 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
switch ( nID )
{
- case COMMAND_ID_DRAW_LINE:
- case COMMAND_ID_LINE_ARROW_END:
+ case ChartCommandID::DrawLine:
+ case ChartCommandID::DrawLineArrowEnd:
{
- if ( auto const pathObj = dynamic_cast<SdrPathObj*>( pObj) )
+ if ( auto const pathObj = dynamic_cast<SdrPathObj*>( pObj.get()) )
{
Point aStart = aRect.TopLeft();
Point aEnd = aRect.BottomRight();
@@ -449,9 +442,9 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
}
}
break;
- case COMMAND_ID_DRAW_FREELINE_NOFILL:
+ case ChartCommandID::DrawFreelineNoFill:
{
- if ( auto const pathObj = dynamic_cast<SdrPathObj*>( pObj) )
+ if ( auto const pathObj = dynamic_cast<SdrPathObj*>( pObj.get()) )
{
basegfx::B2DPolygon aInnerPoly;
aInnerPoly.append( basegfx::B2DPoint( aRect.Left(), aRect.Bottom() ) );
@@ -469,13 +462,13 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
}
}
break;
- case COMMAND_ID_DRAW_TEXT:
- case COMMAND_ID_DRAW_TEXT_VERTICAL:
+ case ChartCommandID::DrawText:
+ case ChartCommandID::DrawTextVertical:
{
- if ( SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( pObj) )
+ if ( SdrTextObj* pTextObj = DynCastSdrTextObj( pObj.get()) )
{
pTextObj->SetLogicRect( aRect );
- bool bVertical = ( nID == COMMAND_ID_DRAW_TEXT_VERTICAL );
+ bool bVertical = ( nID == ChartCommandID::DrawTextVertical );
pTextObj->SetVerticalWriting( bVertical );
if ( bVertical )
{
@@ -489,12 +482,12 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
}
}
break;
- case COMMAND_ID_DRAW_CAPTION:
- case COMMAND_ID_DRAW_CAPTION_VERTICAL:
+ case ChartCommandID::DrawCaption:
+ case ChartCommandID::DrawCaptionVertical:
{
- if ( SdrCaptionObj* pCaptionObj = dynamic_cast<SdrCaptionObj*>( pObj) )
+ if ( SdrCaptionObj* pCaptionObj = dynamic_cast<SdrCaptionObj*>( pObj.get()) )
{
- bool bIsVertical( nID == COMMAND_ID_DRAW_CAPTION_VERTICAL );
+ bool bIsVertical( nID == ChartCommandID::DrawCaptionVertical );
pCaptionObj->SetVerticalWriting( bIsVertical );
if ( bIsVertical )
{
@@ -513,7 +506,7 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
{
pObj->SetLogicRect( aRect );
SfxItemSet aSet( pDrawModelWrapper->GetItemPool() );
- setAttributes( pObj );
+ setAttributes( pObj.get() );
pObj->SetMergedItemSet( aSet );
}
break;
@@ -525,17 +518,17 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
return pObj;
}
-bool DrawCommandDispatch::parseCommandURL( const OUString& rCommandURL, sal_uInt16* pnFeatureId,
+bool DrawCommandDispatch::parseCommandURL( const OUString& rCommandURL, ChartCommandID* pnFeatureId,
OUString* pBaseCommand, OUString* pCustomShapeType )
{
bool bFound = true;
- sal_uInt16 nFeatureId = 0;
+ ChartCommandID nFeatureId = ChartCommandID::NONE;
OUString aBaseCommand;
OUString aType;
- sal_Int32 nIndex = 1;
- OUString aToken = rCommandURL.getToken( 0, '.', nIndex );
- if ( nIndex == -1 || aToken.isEmpty() )
+ sal_Int32 nIndex = std::min(sal_Int32(1), rCommandURL.getLength());
+ std::u16string_view aToken = o3tl::getToken(rCommandURL, 0, '.', nIndex );
+ if ( nIndex == -1 || aToken.empty() )
{
aBaseCommand = rCommandURL;
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( aBaseCommand );
@@ -545,32 +538,32 @@ bool DrawCommandDispatch::parseCommandURL( const OUString& rCommandURL, sal_uInt
switch ( nFeatureId )
{
- case COMMAND_ID_DRAWTBX_CS_BASIC:
+ case ChartCommandID::DrawToolboxCsBasic:
{
aType = "diamond";
}
break;
- case COMMAND_ID_DRAWTBX_CS_SYMBOL:
+ case ChartCommandID::DrawToolboxCsSymbol:
{
aType = "smiley";
}
break;
- case COMMAND_ID_DRAWTBX_CS_ARROW:
+ case ChartCommandID::DrawToolboxCsArrow:
{
aType = "left-right-arrow";
}
break;
- case COMMAND_ID_DRAWTBX_CS_FLOWCHART:
+ case ChartCommandID::DrawToolboxCsFlowchart:
{
aType = "flowchart-internal-storage";
}
break;
- case COMMAND_ID_DRAWTBX_CS_CALLOUT:
+ case ChartCommandID::DrawToolboxCsCallout:
{
aType = "round-rectangular-callout";
}
break;
- case COMMAND_ID_DRAWTBX_CS_STAR:
+ case ChartCommandID::DrawToolboxCsStar:
{
aType = "star5";
}
diff --git a/chart2/source/controller/main/DrawCommandDispatch.h b/chart2/source/controller/main/DrawCommandDispatch.h
deleted file mode 100644
index faf70bde1047..000000000000
--- a/chart2/source/controller/main/DrawCommandDispatch.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- 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 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 .
- */
-#ifndef CHART_DRAWCOMMANDDISPATCH_HRC
-#define CHART_DRAWCOMMANDDISPATCH_HRC
-
-//Command Ids:
-#define COMMAND_ID_OBJECT_SELECT 1
-#define COMMAND_ID_DRAW_LINE 2
-#define COMMAND_ID_LINE_ARROW_END 3
-#define COMMAND_ID_DRAW_RECT 4
-#define COMMAND_ID_DRAW_ELLIPSE 5
-#define COMMAND_ID_DRAW_FREELINE_NOFILL 6
-#define COMMAND_ID_DRAW_TEXT 7
-#define COMMAND_ID_DRAW_TEXT_VERTICAL 8
-#define COMMAND_ID_DRAW_CAPTION 9
-#define COMMAND_ID_DRAW_CAPTION_VERTICAL 10
-#define COMMAND_ID_DRAWTBX_CS_BASIC 11
-#define COMMAND_ID_DRAWTBX_CS_SYMBOL 12
-#define COMMAND_ID_DRAWTBX_CS_ARROW 13
-#define COMMAND_ID_DRAWTBX_CS_FLOWCHART 14
-#define COMMAND_ID_DRAWTBX_CS_CALLOUT 15
-#define COMMAND_ID_DRAWTBX_CS_STAR 16
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/main/DrawCommandDispatch.hxx b/chart2/source/controller/main/DrawCommandDispatch.hxx
index febfa8338d40..65200cca6323 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.hxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.hxx
@@ -20,6 +20,7 @@
#include <svx/svdobjkind.hxx>
#include "FeatureCommandDispatchBase.hxx"
+#include <rtl/ref.hxx>
class SfxItemSet;
class SdrObject;
@@ -44,7 +45,7 @@ public:
protected:
// WeakComponentImplHelperBase
- virtual void SAL_CALL disposing() override;
+ virtual void disposing( std::unique_lock<std::mutex>& rGuard ) override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
@@ -60,9 +61,9 @@ protected:
private:
void setInsertObj(SdrObjKind eObj);
- SdrObject* createDefaultObject( const sal_uInt16 nID );
+ rtl::Reference<SdrObject> createDefaultObject( const ChartCommandID nID );
- bool parseCommandURL( const OUString& rCommandURL, sal_uInt16* pnFeatureId, OUString* pBaseCommand, OUString* pCustomShapeType );
+ bool parseCommandURL( const OUString& rCommandURL, ChartCommandID* pnFeatureId, OUString* pBaseCommand, OUString* pCustomShapeType );
ChartController* m_pChartController;
OUString m_aCustomShapeType;
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index e56da4fc6173..36ea5dabfc18 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -27,16 +27,13 @@
#include <ObjectIdentifier.hxx>
#include <ChartController.hxx>
#include <ChartModel.hxx>
+#include <ChartView.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <o3tl/safeint.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
namespace chart { class ExplicitValueProvider; }
namespace chart
@@ -55,8 +52,8 @@ constexpr OUStringLiteral lcl_aServiceName
}
SelectorListBox::SelectorListBox(vcl::Window* pParent)
- : InterimItemWindow(pParent, "modules/schart/ui/combobox.ui", "ComboBox")
- , m_xWidget(m_xBuilder->weld_combo_box("combobox"))
+ : InterimItemWindow(pParent, u"modules/schart/ui/combobox.ui"_ustr, u"ComboBox"_ustr)
+ , m_xWidget(m_xBuilder->weld_combo_box(u"combobox"_ustr))
, m_bReleaseFocus(true)
{
InitControlBase(m_xWidget.get());
@@ -111,7 +108,7 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
if( xChartController.is() )
{
ObjectIdentifier aSelectedOID( xChartController->getSelection() );
- OUString aSelectedCID = aSelectedOID.getObjectCID();
+ const OUString& aSelectedCID = aSelectedOID.getObjectCID();
rtl::Reference<::chart::ChartModel> xChartDoc = xChartController->getChartModel();
ObjectType eType( aSelectedOID.getObjectType() );
@@ -119,11 +116,11 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
if ( eType == OBJECTTYPE_DATA_POINT || eType == OBJECTTYPE_DATA_LABEL || eType == OBJECTTYPE_SHAPE )
bAddSelectionToList = true;
- Reference< uno::XInterface > xChartView;
- Reference< lang::XMultiServiceFactory > xFact( xChartController->getModel(), uno::UNO_QUERY );
+ rtl::Reference< ChartView > xChartView;
+ rtl::Reference< ChartModel > xFact = xChartController->getChartModel();
if( xFact.is() )
- xChartView = xFact->createInstance( CHART_VIEW_SERVICE_NAME );
- ExplicitValueProvider* pExplicitValueProvider = nullptr; //ExplicitValueProvider::getExplicitValueProvider(xChartView); this creates all visible data points, that's too much
+ xChartView = xFact->createChartView();
+ ChartView* pExplicitValueProvider = nullptr; //ExplicitValueProvider::getExplicitValueProvider(xChartView); this creates all visible data points, that's too much
ObjectHierarchy aHierarchy( xChartDoc, pExplicitValueProvider, true /*bFlattenDiagram*/, true /*bOrderingForElementSelector*/ );
lcl_addObjectsToList( aHierarchy, ::chart::ObjectHierarchy::getRootNodeOID(), m_aEntries, 0, xChartDoc );
@@ -162,7 +159,8 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
sal_uInt16 nN=0;
for (auto const& entry : m_aEntries)
{
- m_xWidget->append_text(entry.UIName);
+ // tdf#152087 strip any newlines from the entry
+ m_xWidget->append_text(entry.UIName.replaceAll("\n", " "));
if ( !bSelectionFound && aSelectedOID == entry.OID )
{
nEntryPosToSelect = nN;
@@ -254,7 +252,7 @@ sal_Bool SAL_CALL ElementSelectorToolbarController::supportsService( const OUStr
css::uno::Sequence< OUString > SAL_CALL ElementSelectorToolbarController::getSupportedServiceNames()
{
- return { "com.sun.star.frame.ToolbarController" };
+ return { u"com.sun.star.frame.ToolbarController"_ustr };
}
ElementSelectorToolbarController::ElementSelectorToolbarController()
{
@@ -288,7 +286,7 @@ void SAL_CALL ElementSelectorToolbarController::statusChanged( const frame::Feat
Reference< frame::XController > xChartController;
rEvent.State >>= xChartController;
::chart::ChartController* pController = dynamic_cast<::chart::ChartController*>(xChartController.get());
- assert(pController);
+ assert(!xChartController || pController);
m_apSelectorListBox->SetChartController( pController );
m_apSelectorListBox->UpdateChartElementsListAndSelection();
}
diff --git a/chart2/source/controller/main/ElementSelector.hxx b/chart2/source/controller/main/ElementSelector.hxx
index 5467dd161299..fb1e4e0527ff 100644
--- a/chart2/source/controller/main/ElementSelector.hxx
+++ b/chart2/source/controller/main/ElementSelector.hxx
@@ -20,7 +20,6 @@
#include <ObjectIdentifier.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/frame/XController.hpp>
#include <cppuhelper/implbase1.hxx>
#include <svtools/toolboxcontroller.hxx>
diff --git a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx
index 90dcf77b2482..a07fb0735fa3 100644
--- a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx
+++ b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx
@@ -29,7 +29,7 @@ namespace chart
FeatureCommandDispatchBase::FeatureCommandDispatchBase( const Reference< uno::XComponentContext >& rxContext )
:CommandDispatch( rxContext )
- ,m_nFeatureId( 0 )
+ ,m_nFeatureId( ChartCommandID::NONE )
{
}
@@ -45,8 +45,7 @@ void FeatureCommandDispatchBase::initialize()
bool FeatureCommandDispatchBase::isFeatureSupported( const OUString& rCommandURL )
{
- SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( rCommandURL );
- return aIter != m_aSupportedFeatures.end();
+ return m_aSupportedFeatures.contains(rCommandURL);
}
void FeatureCommandDispatchBase::fireStatusEvent( const OUString& rURL,
@@ -78,15 +77,10 @@ void FeatureCommandDispatchBase::dispatch( const util::URL& URL,
}
}
-void FeatureCommandDispatchBase::implDescribeSupportedFeature( const char* pAsciiCommandURL,
- sal_uInt16 nId, sal_Int16 nGroup )
+void FeatureCommandDispatchBase::implDescribeSupportedFeature( const OUString& sCommandURL,
+ ChartCommandID nId, sal_Int16 nGroup )
{
- ControllerFeature aFeature;
- aFeature.Command = OUString::createFromAscii( pAsciiCommandURL );
- aFeature.nFeatureId = nId;
- aFeature.GroupId = nGroup;
-
- m_aSupportedFeatures[ aFeature.Command ] = aFeature;
+ m_aSupportedFeatures[sCommandURL] = { sCommandURL, nGroup, nId };
}
} // namespace chart
diff --git a/chart2/source/controller/main/FeatureCommandDispatchBase.hxx b/chart2/source/controller/main/FeatureCommandDispatchBase.hxx
index 0c291a684d79..ef8b968287bf 100644
--- a/chart2/source/controller/main/FeatureCommandDispatchBase.hxx
+++ b/chart2/source/controller/main/FeatureCommandDispatchBase.hxx
@@ -18,16 +18,62 @@
*/
#pragma once
-#include "CommandDispatch.hxx"
+#include <sal/config.h>
+
+#include <CommandDispatch.hxx>
#include <com/sun/star/frame/DispatchInformation.hpp>
+enum class ChartCommandID
+{
+ NONE = 0,
+
+ //Draw Command Ids:
+ DrawObjectSelect = 1,
+ DrawLine = 2,
+ DrawLineArrowEnd = 3,
+ DrawRect = 4,
+ DrawEllipse = 5,
+ DrawFreelineNoFill = 6,
+ DrawText = 7,
+ DrawTextVertical = 8,
+ DrawCaption = 9,
+ DrawCaptionVertical = 10,
+ DrawToolboxCsBasic = 11,
+ DrawToolboxCsSymbol = 12,
+ DrawToolboxCsArrow = 13,
+ DrawToolboxCsFlowchart = 14,
+ DrawToolboxCsCallout = 15,
+ DrawToolboxCsStar = 16,
+
+ //Shape Controller Command Ids:
+ ShapeFormatLine = 21,
+ ShapeFormatArea = 22,
+ ShapeTextAttributes = 23,
+ ShapeTransformDialog = 24,
+ ShapeObjectTitleDescription = 25,
+ ShapeRenameObject = 26,
+ ShapeBringToFront = 28,
+ ShapeForward = 29,
+ ShapeBackward = 30,
+ ShapeSendToBack = 31,
+ ShapeFontDialog = 35,
+ ShapeParagraphDialog = 36
+};
+
+
namespace chart
{
struct ControllerFeature: public css::frame::DispatchInformation
{
- sal_uInt16 nFeatureId;
+ ChartCommandID nFeatureId;
+ ControllerFeature() = default;
+ ControllerFeature(const OUString& command, sal_Int16 groupId, ChartCommandID featureId)
+ : css::frame::DispatchInformation(command, groupId)
+ , nFeatureId(featureId)
+ {
+ }
};
typedef std::map< OUString,
@@ -75,7 +121,7 @@ protected:
Must not be called outside <member>describeSupportedFeatures</member>.
- @param pAsciiCommandURL
+ @param sCommandURL
the URL of the feature command
@param nId
the id of the feature. Later references to this feature usually happen by id, not by
@@ -84,12 +130,12 @@ protected:
the command group of the feature. This is important for configuring the controller UI
by the user, see also <type scope="css::frame">CommandGroup</type>.
*/
- void implDescribeSupportedFeature( const char* pAsciiCommandURL, sal_uInt16 nId,
+ void implDescribeSupportedFeature( const OUString& sCommandURL, ChartCommandID nId,
sal_Int16 nGroup );
mutable SupportedFeatures m_aSupportedFeatures;
- sal_uInt16 m_nFeatureId;
+ ChartCommandID m_nFeatureId;
};
} // namespace chart
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 326d43461d9f..c82d1c15bacb 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -19,63 +19,44 @@
#include <ObjectHierarchy.hxx>
#include <ObjectIdentifier.hxx>
-#include <ChartModelHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <ChartView.hxx>
#include <Diagram.hxx>
#include <RegressionCurveHelper.hxx>
+#include <RegressionCurveModel.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ChartModel.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
+#include <GridProperties.hxx>
#include <LegendHelper.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include <unonames.hxx>
+#include <BaseCoordinateSystem.hxx>
#include <map>
#include <algorithm>
-#include <iterator>
+#include <cstddef>
#include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/chart2/XTitled.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/awt/Key.hpp>
-#include <com/sun/star/awt/KeyEvent.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
namespace
{
-struct lcl_ObjectToOID
-{
- explicit lcl_ObjectToOID( const rtl::Reference<::chart::ChartModel> & xChartDoc ) :
- m_xModel( xChartDoc )
- {}
-
- ::chart::ObjectIdentifier operator() ( const Reference< uno::XInterface > & xObj )
- {
- return ::chart::ObjectIdentifier( ::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xObj, m_xModel ) );
- }
-
-private:
- rtl::Reference<::chart::ChartModel> m_xModel;
-};
-
void lcl_getChildOIDs(
::chart::ObjectHierarchy::tChildContainer& rOutChildren,
const Reference< container::XIndexAccess >& xShapes )
@@ -92,8 +73,8 @@ void lcl_getChildOIDs(
Reference< beans::XPropertySetInfo > xInfo( xShapeProp->getPropertySetInfo());
OUString aName;
if( xInfo.is() &&
- xInfo->hasPropertyByName( "Name") &&
- (xShapeProp->getPropertyValue( "Name") >>= aName ) &&
+ xInfo->hasPropertyByName( u"Name"_ustr) &&
+ (xShapeProp->getPropertyValue( u"Name"_ustr) >>= aName ) &&
!aName.isEmpty() &&
::chart::ObjectIdentifier::isCID( aName ))
{
@@ -106,12 +87,11 @@ void lcl_getChildOIDs(
}
}
-void lcl_addAxisTitle( const Reference< XAxis >& xAxis, ::chart::ObjectHierarchy::tChildContainer& rContainer, const rtl::Reference<::chart::ChartModel>& xChartModel )
+void lcl_addAxisTitle( const rtl::Reference< ::chart::Axis >& xAxis, ::chart::ObjectHierarchy::tChildContainer& rContainer, const rtl::Reference<::chart::ChartModel>& xChartModel )
{
- Reference< XTitled > xAxisTitled( xAxis, uno::UNO_QUERY );
- if( xAxisTitled.is())
+ if( xAxis.is())
{
- Reference< XTitle > xAxisTitle( xAxisTitled->getTitleObject());
+ Reference< XTitle > xAxisTitle( xAxis->getTitleObject());
if( xAxisTitle.is())
rContainer.emplace_back( ::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xAxisTitle, xChartModel ) );
}
@@ -124,17 +104,17 @@ namespace chart
void ObjectHierarchy::createTree( const rtl::Reference<::chart::ChartModel>& xChartDocument )
{
- m_aChildMap = tChildMap();//clear tree
+ m_aChildMap.clear();
if( !xChartDocument.is() )
return;
//@todo: change ObjectIdentifier to take an XChartDocument rather than XModel
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartDocument );
+ rtl::Reference< Diagram > xDiagram = xChartDocument->getFirstChartDiagram();
ObjectIdentifier aDiaOID;
if( xDiagram.is() )
aDiaOID = ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( static_cast<cppu::OWeakObject*>(xDiagram.get()), xChartDocument ) );
- ObjectHierarchy::tChildContainer aTopLevelContainer;
+ tChildContainer aTopLevelContainer;
// First Level
@@ -165,8 +145,8 @@ void ObjectHierarchy::createTree( const rtl::Reference<::chart::ChartModel>& xCh
if( !m_bOrderingForElementSelector )
{
// Axis Titles. Note: These are interpreted of being top level
- const Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( Reference< XAxis > const & axis : aAxes )
+ const std::vector< rtl::Reference< Axis > > aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
+ for( rtl::Reference< Axis > const & axis : aAxes )
lcl_addAxisTitle( axis, aTopLevelContainer, xChartDocument );
// Diagram
@@ -177,10 +157,10 @@ void ObjectHierarchy::createTree( const rtl::Reference<::chart::ChartModel>& xCh
createDiagramTree( aTopLevelContainer, xChartDocument, xDiagram );
else
{
- ObjectHierarchy::tChildContainer aSubContainer;
+ tChildContainer aSubContainer;
createDiagramTree( aSubContainer, xChartDocument, xDiagram );
if( !aSubContainer.empty() )
- m_aChildMap[ aDiaOID ] = aSubContainer;
+ m_aChildMap[ aDiaOID ] = std::move(aSubContainer);
}
if( !m_bOrderingForElementSelector )
@@ -198,13 +178,13 @@ void ObjectHierarchy::createTree( const rtl::Reference<::chart::ChartModel>& xCh
aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) );
if( ! aTopLevelContainer.empty())
- m_aChildMap[ ObjectHierarchy::getRootNodeOID() ] = aTopLevelContainer;
+ m_aChildMap[ObjectHierarchy::getRootNodeOID()] = std::move(aTopLevelContainer);
}
void ObjectHierarchy::createLegendTree(
- ObjectHierarchy::tChildContainer & rContainer,
+ tChildContainer & rContainer,
const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const Reference< XDiagram > & xDiagram )
+ const rtl::Reference< Diagram > & xDiagram )
{
if( !(xDiagram.is() && LegendHelper::hasLegend( xDiagram )) )
return;
@@ -215,37 +195,49 @@ void ObjectHierarchy::createLegendTree(
// iterate over child shapes of legend and search for matching CIDs
if( m_pExplicitValueProvider )
{
- Reference< container::XIndexAccess > xLegendShapeContainer(
- m_pExplicitValueProvider->getShapeForCID( aLegendOID.getObjectCID() ), uno::UNO_QUERY );
- ObjectHierarchy::tChildContainer aLegendEntryOIDs;
+ rtl::Reference< SvxShapeGroupAnyD > xLegendShapeContainer =
+ dynamic_cast<SvxShapeGroupAnyD*>(
+ m_pExplicitValueProvider->getShapeForCID( aLegendOID.getObjectCID() ).get() );
+ tChildContainer aLegendEntryOIDs;
lcl_getChildOIDs( aLegendEntryOIDs, xLegendShapeContainer );
- m_aChildMap[ aLegendOID ] = aLegendEntryOIDs;
+ m_aChildMap[aLegendOID] = std::move(aLegendEntryOIDs);
}
}
void ObjectHierarchy::createAxesTree(
- ObjectHierarchy::tChildContainer & rContainer,
+ tChildContainer & rContainer,
const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const Reference< XDiagram > & xDiagram )
+ const rtl::Reference< Diagram > & xDiagram )
{
- Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
- uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
- bool bSupportsAxesGrids = ChartTypeHelper::isSupportingMainAxis( xChartType, nDimensionCount, 0 );
- if( !bSupportsAxesGrids )
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeByIndex( 0 ) );
+ bool bSupportsAxesGrids = true;
+ if (xChartType.is())
+ bSupportsAxesGrids = xChartType->isSupportingMainAxis(nDimensionCount, 0);
+
+ if (!bSupportsAxesGrids)
return;
- Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram, /* bOnlyVisible = */ true ) );
+ // Data Table
+ uno::Reference<chart2::XDataTable> xDataTable = xDiagram->getDataTable();
+ if (xDataTable.is())
+ {
+ rContainer.push_back(ObjectIdentifier::createClassifiedIdentifierForObject(xDataTable, xChartDoc));
+ }
+
+ // Axes
+ std::vector< rtl::Reference< Axis > > aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram, /* bOnlyVisible = */ true );
if( !m_bOrderingForElementSelector )
- std::transform( std::cbegin(aAxes), std::cend(aAxes),
- std::back_inserter( rContainer ),
- lcl_ObjectToOID( xChartDoc ));
+ {
+ for (const auto& rAxis : aAxes)
+ rContainer.push_back( ObjectIdentifier::createClassifiedIdentifierForObject( rAxis, xChartDoc ) );
+ }
// get all axes, also invisible ones
aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
// Grids
- for( Reference< XAxis > const & xAxis : std::as_const(aAxes) )
+ for( rtl::Reference< Axis > const & xAxis : aAxes )
{
if(!xAxis.is())
continue;
@@ -254,7 +246,7 @@ void ObjectHierarchy::createAxesTree(
sal_Int32 nDimensionIndex = 0;
sal_Int32 nAxisIndex = 0;
AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex );
- if( nAxisIndex>0 && !ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount ) )
+ if (nAxisIndex > 0 && !(xChartType.is() ? xChartType->isSupportingSecondaryAxis(nDimensionCount) : true))
continue;
if( m_bOrderingForElementSelector )
@@ -267,19 +259,17 @@ void ObjectHierarchy::createAxesTree(
lcl_addAxisTitle( xAxis, rContainer, xChartDoc );
}
- Reference< beans::XPropertySet > xGridProperties( xAxis->getGridProperties() );
+ rtl::Reference< ::chart::GridProperties > xGridProperties( xAxis->getGridProperties2() );
if( AxisHelper::isGridVisible( xGridProperties ) )
{
//main grid
rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartDoc ) );
}
- Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
- sal_Int32 nSubGrid = 0;
- for( nSubGrid = 0; nSubGrid < aSubGrids.getLength(); ++nSubGrid )
+ std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
+ for( size_t nSubGrid = 0; nSubGrid < aSubGrids.size(); ++nSubGrid )
{
- Reference< beans::XPropertySet > xSubGridProperties( aSubGrids[nSubGrid] );
- if( AxisHelper::isGridVisible( xSubGridProperties ) )
+ if( AxisHelper::isGridVisible( aSubGrids[nSubGrid] ) )
{
//sub grid
rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartDoc, nSubGrid ) );
@@ -289,12 +279,12 @@ void ObjectHierarchy::createAxesTree(
}
void ObjectHierarchy::createWallAndFloor(
- ObjectHierarchy::tChildContainer & rContainer,
- const Reference< XDiagram > & xDiagram )
+ tChildContainer & rContainer,
+ const rtl::Reference< Diagram > & xDiagram )
{
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
bool bIsThreeD = ( nDimensionCount == 3 );
- bool bHasWall = DiagramHelper::isSupportingFloorAndWall( xDiagram );
+ bool bHasWall = xDiagram->isSupportingFloorAndWall();
if( bHasWall && bIsThreeD )
{
rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, u"" ) );
@@ -307,9 +297,9 @@ void ObjectHierarchy::createWallAndFloor(
}
void ObjectHierarchy::createDiagramTree(
- ObjectHierarchy::tChildContainer & rContainer,
+ tChildContainer & rContainer,
const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const Reference< XDiagram > & xDiagram )
+ const rtl::Reference< Diagram > & xDiagram )
{
if( !m_bOrderingForElementSelector )
{
@@ -325,27 +315,23 @@ void ObjectHierarchy::createDiagramTree(
}
void ObjectHierarchy::createDataSeriesTree(
- ObjectHierarchy::tChildContainer & rOutDiagramSubContainer,
- const Reference< XDiagram > & xDiagram )
+ tChildContainer & rOutDiagramSubContainer,
+ const rtl::Reference< Diagram > & xDiagram )
{
- Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
-
try
{
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
- Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
- for( sal_Int32 nCooSysIdx=0; nCooSysIdx<aCooSysSeq.getLength(); ++nCooSysIdx )
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
+ std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysSeq(
+ xDiagram->getBaseCoordinateSystems());
+ for( std::size_t nCooSysIdx=0; nCooSysIdx<aCooSysSeq.size(); ++nCooSysIdx )
{
- Reference< XChartTypeContainer > xCTCnt( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY_THROW );
- Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
- for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypeSeq.getLength(); ++nCTIdx )
+ std::vector< rtl::Reference< ChartType > > aChartTypeSeq( aCooSysSeq[nCooSysIdx]->getChartTypes2());
+ for( std::size_t nCTIdx=0; nCTIdx<aChartTypeSeq.size(); ++nCTIdx )
{
- Reference< XChartType > xChartType( aChartTypeSeq[nCTIdx] );
- Reference< XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY_THROW );
- Sequence< Reference< XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() );
+ const rtl::Reference< ChartType >& xChartType( aChartTypeSeq[nCTIdx] );
+ std::vector< rtl::Reference< DataSeries > > aSeriesSeq( xChartType->getDataSeries2() );
const sal_Int32 nNumberOfSeries =
- ChartTypeHelper::getNumberOfDisplayedSeries( xChartType, aSeriesSeq.getLength());
+ ChartTypeHelper::getNumberOfDisplayedSeries( xChartType, aSeriesSeq.size());
for( sal_Int32 nSeriesIdx=0; nSeriesIdx<nNumberOfSeries; ++nSeriesIdx )
{
@@ -356,59 +342,52 @@ void ObjectHierarchy::createDataSeriesTree(
ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForParticle( aSeriesParticle ) ) );
rOutDiagramSubContainer.push_back( aSeriesOID );
- ObjectHierarchy::tChildContainer aSeriesSubContainer;
+ tChildContainer aSeriesSubContainer;
- Reference< chart2::XDataSeries > const & xSeries = aSeriesSeq[nSeriesIdx];
+ rtl::Reference< DataSeries > const & xSeries = aSeriesSeq[nSeriesIdx];
// data labels
- if( DataSeriesHelper::hasDataLabelsAtSeries( xSeries ) )
+ if( xSeries->hasDataLabelsAtSeries() )
{
OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) + "=" );
aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForParticles( aSeriesParticle, aChildParticle ) );
}
// Statistics
- if( ChartTypeHelper::isSupportingStatisticProperties( xChartType, nDimensionCount ) )
+ if (xChartType.is() ? xChartType->isSupportingStatisticProperties(nDimensionCount) : true)
{
- Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
- if( xCurveCnt.is())
+ const std::vector< rtl::Reference< RegressionCurveModel > > & rCurves( xSeries->getRegressionCurves2());
+ for( size_t nCurveIdx=0; nCurveIdx<rCurves.size(); ++nCurveIdx )
{
- Sequence< Reference< chart2::XRegressionCurve > > aCurves( xCurveCnt->getRegressionCurves());
- for( sal_Int32 nCurveIdx=0; nCurveIdx<aCurves.getLength(); ++nCurveIdx )
+ bool bIsAverageLine = RegressionCurveHelper::isMeanValueLine( rCurves[nCurveIdx] );
+ aSeriesSubContainer.emplace_back( ObjectIdentifier::createDataCurveCID( aSeriesParticle, nCurveIdx, bIsAverageLine ) );
+ if( RegressionCurveHelper::hasEquation( rCurves[nCurveIdx] ) )
{
- bool bIsAverageLine = RegressionCurveHelper::isMeanValueLine( aCurves[nCurveIdx] );
- aSeriesSubContainer.emplace_back( ObjectIdentifier::createDataCurveCID( aSeriesParticle, nCurveIdx, bIsAverageLine ) );
- if( RegressionCurveHelper::hasEquation( aCurves[nCurveIdx] ) )
- {
- aSeriesSubContainer.emplace_back( ObjectIdentifier::createDataCurveEquationCID( aSeriesParticle, nCurveIdx ) );
- }
+ aSeriesSubContainer.emplace_back( ObjectIdentifier::createDataCurveEquationCID( aSeriesParticle, nCurveIdx ) );
}
- Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
- Reference< beans::XPropertySet > xErrorBarProp;
- if( xSeriesProp.is() &&
- (xSeriesProp->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp) &&
- xErrorBarProp.is())
+ }
+ Reference< beans::XPropertySet > xErrorBarProp;
+ if( (xSeries->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp) &&
+ xErrorBarProp.is())
+ {
+ sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
+ if( ( xErrorBarProp->getPropertyValue( u"ErrorBarStyle"_ustr) >>= nStyle ) &&
+ ( nStyle != css::chart::ErrorBarStyle::NONE ) )
{
- sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
- if( ( xErrorBarProp->getPropertyValue( "ErrorBarStyle") >>= nStyle ) &&
- ( nStyle != css::chart::ErrorBarStyle::NONE ) )
- {
- aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierWithParent(
- OBJECTTYPE_DATA_ERRORS_Y, u"", aSeriesParticle ) );
- }
+ aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierWithParent(
+ OBJECTTYPE_DATA_ERRORS_Y, u"", aSeriesParticle ) );
}
+ }
- if( xSeriesProp.is() &&
- (xSeriesProp->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp) &&
- xErrorBarProp.is())
+ if( (xSeries->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp) &&
+ xErrorBarProp.is())
+ {
+ sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
+ if( ( xErrorBarProp->getPropertyValue( u"ErrorBarStyle"_ustr) >>= nStyle ) &&
+ ( nStyle != css::chart::ErrorBarStyle::NONE ) )
{
- sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
- if( ( xErrorBarProp->getPropertyValue( "ErrorBarStyle") >>= nStyle ) &&
- ( nStyle != css::chart::ErrorBarStyle::NONE ) )
- {
- aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierWithParent(
- OBJECTTYPE_DATA_ERRORS_X, u"", aSeriesParticle ) );
- }
+ aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierWithParent(
+ OBJECTTYPE_DATA_ERRORS_X, u"", aSeriesParticle ) );
}
}
}
@@ -417,13 +396,14 @@ void ObjectHierarchy::createDataSeriesTree(
// iterate over child shapes of legend and search for matching CIDs
if( m_pExplicitValueProvider )
{
- Reference< container::XIndexAccess > xSeriesShapeContainer(
- m_pExplicitValueProvider->getShapeForCID( aSeriesOID.getObjectCID() ), uno::UNO_QUERY );
+ rtl::Reference< SvxShapeGroupAnyD > xSeriesShapeContainer =
+ dynamic_cast<SvxShapeGroupAnyD*>(
+ m_pExplicitValueProvider->getShapeForCID( aSeriesOID.getObjectCID() ).get() );
lcl_getChildOIDs( aSeriesSubContainer, xSeriesShapeContainer );
}
if( ! aSeriesSubContainer.empty())
- m_aChildMap[ aSeriesOID ] = aSeriesSubContainer;
+ m_aChildMap[ aSeriesOID ] = std::move(aSeriesSubContainer);
}
}
}
@@ -434,7 +414,7 @@ void ObjectHierarchy::createDataSeriesTree(
}
}
-void ObjectHierarchy::createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer )
+void ObjectHierarchy::createAdditionalShapesTree(tChildContainer& rContainer)
{
try
{
@@ -481,7 +461,7 @@ const ObjectHierarchy::tChildContainer & ObjectHierarchy::getChildren( const Obj
if( aIt != m_aChildMap.end())
return aIt->second;
}
- static const ObjectHierarchy::tChildContainer EMPTY;
+ static const tChildContainer EMPTY;
return EMPTY;
}
@@ -491,13 +471,13 @@ const ObjectHierarchy::tChildContainer & ObjectHierarchy::getSiblings( const Obj
{
for (auto const& child : m_aChildMap)
{
- ObjectHierarchy::tChildContainer::const_iterator aElemIt(
+ tChildContainer::const_iterator aElemIt(
std::find( child.second.begin(), child.second.end(), rNode ));
if( aElemIt != child.second.end())
return child.second;
}
}
- static const ObjectHierarchy::tChildContainer EMPTY;
+ static const tChildContainer EMPTY;
return EMPTY;
}
@@ -506,8 +486,8 @@ ObjectIdentifier ObjectHierarchy::getParentImpl(
const ObjectIdentifier & rOID ) const
{
// search children
- ObjectHierarchy::tChildContainer aChildren( getChildren( rParentOID ));
- ObjectHierarchy::tChildContainer::const_iterator aIt(
+ tChildContainer aChildren( getChildren( rParentOID ));
+ tChildContainer::const_iterator aIt(
std::find( aChildren.begin(), aChildren.end(), rOID ));
// recursion end
if( aIt != aChildren.end())
@@ -536,7 +516,7 @@ ObjectIdentifier ObjectHierarchy::getParent(
ObjectHierarchy::ObjectHierarchy(
const rtl::Reference<::chart::ChartModel> & xChartDocument,
- ExplicitValueProvider * pExplicitValueProvider /* = 0 */,
+ ChartView * pExplicitValueProvider /* = 0 */,
bool bFlattenDiagram /* = false */,
bool bOrderingForElementSelector /* = false */) :
m_pExplicitValueProvider( pExplicitValueProvider ),
@@ -553,7 +533,7 @@ ObjectHierarchy::~ObjectHierarchy()
ObjectIdentifier ObjectHierarchy::getRootNodeOID()
{
- return ObjectIdentifier( "ROOT" );
+ return ObjectIdentifier( u"ROOT"_ustr );
}
bool ObjectHierarchy::isRootNode( const ObjectIdentifier& rOID )
@@ -582,11 +562,11 @@ sal_Int32 ObjectHierarchy::getIndexInParent(
}
ObjectKeyNavigation::ObjectKeyNavigation(
- const ObjectIdentifier & rCurrentOID,
- const rtl::Reference<::chart::ChartModel> & xChartDocument,
- ExplicitValueProvider * pExplicitValueProvider /* = 0 */ ) :
- m_aCurrentOID( rCurrentOID ),
- m_xChartDocument( xChartDocument ),
+ ObjectIdentifier aCurrentOID,
+ rtl::Reference<::chart::ChartModel> xChartDocument,
+ ChartView * pExplicitValueProvider /* = 0 */ ) :
+ m_aCurrentOID(std::move( aCurrentOID )),
+ m_xChartDocument(std::move( xChartDocument )),
m_pExplicitValueProvider( pExplicitValueProvider )
{
if ( !m_aCurrentOID.isValid() )
@@ -639,7 +619,7 @@ void ObjectKeyNavigation::setCurrentSelection( const ObjectIdentifier& rOID )
bool ObjectKeyNavigation::first()
{
ObjectHierarchy aHierarchy( m_xChartDocument, m_pExplicitValueProvider );
- ObjectHierarchy::tChildContainer aSiblings( aHierarchy.getSiblings( getCurrentSelection() ) );
+ const ObjectHierarchy::tChildContainer& aSiblings( aHierarchy.getSiblings( getCurrentSelection() ) );
bool bResult = !aSiblings.empty();
if( bResult )
setCurrentSelection( aSiblings.front());
@@ -651,7 +631,7 @@ bool ObjectKeyNavigation::first()
bool ObjectKeyNavigation::last()
{
ObjectHierarchy aHierarchy( m_xChartDocument, m_pExplicitValueProvider );
- ObjectHierarchy::tChildContainer aSiblings( aHierarchy.getSiblings( getCurrentSelection() ) );
+ const ObjectHierarchy::tChildContainer& aSiblings( aHierarchy.getSiblings( getCurrentSelection() ) );
bool bResult = !aSiblings.empty();
if( bResult )
setCurrentSelection( aSiblings.back());
@@ -715,7 +695,7 @@ bool ObjectKeyNavigation::down()
bool bResult = aHierarchy.hasChildren( getCurrentSelection());
if( bResult )
{
- ObjectHierarchy::tChildContainer aChildren = aHierarchy.getChildren( getCurrentSelection());
+ const ObjectHierarchy::tChildContainer& aChildren = aHierarchy.getChildren( getCurrentSelection());
OSL_ASSERT( !aChildren.empty());
setCurrentSelection( aChildren.front());
}
@@ -725,7 +705,7 @@ bool ObjectKeyNavigation::down()
bool ObjectKeyNavigation::veryFirst()
{
ObjectHierarchy aHierarchy( m_xChartDocument, m_pExplicitValueProvider );
- ObjectHierarchy::tChildContainer aChildren( aHierarchy.getTopLevelChildren());
+ const ObjectHierarchy::tChildContainer& aChildren( aHierarchy.getTopLevelChildren());
bool bResult = !aChildren.empty();
if( bResult )
setCurrentSelection( aChildren.front());
@@ -735,7 +715,7 @@ bool ObjectKeyNavigation::veryFirst()
bool ObjectKeyNavigation::veryLast()
{
ObjectHierarchy aHierarchy( m_xChartDocument, m_pExplicitValueProvider );
- ObjectHierarchy::tChildContainer aChildren( aHierarchy.getTopLevelChildren());
+ const ObjectHierarchy::tChildContainer& aChildren( aHierarchy.getTopLevelChildren());
bool bResult = !aChildren.empty();
if( bResult )
setCurrentSelection( aChildren.back());
diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx
index ec744633ca0c..dbb5368686ae 100644
--- a/chart2/source/controller/main/PositionAndSizeHelper.cxx
+++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx
@@ -20,12 +20,9 @@
#include <PositionAndSizeHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <com/sun/star/chart/ChartLegendExpansion.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <tools/gen.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <ChartModel.hxx>
#include <Diagram.hxx>
@@ -48,7 +45,7 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
tools::Rectangle aPageRect( Point(rPageRectangle.X,rPageRectangle.Y), Size(rPageRectangle.Width,rPageRectangle.Height) );
// every following branch divides by width and height
- if (aPageRect.getWidth() == 0 || aPageRect.getHeight() == 0)
+ if (aPageRect.getOpenWidth() == 0 || aPageRect.getOpenHeight() == 0)
return false;
if( eObjectType==OBJECTTYPE_TITLE )
@@ -58,18 +55,18 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
aRelativePosition.Anchor = drawing::Alignment_CENTER;
//the anchor point at the title object is top/middle
Point aPos = aObjectRect.TopLeft();
- aRelativePosition.Primary = (double(aPos.X())+double(aObjectRect.getWidth())/2.0)/double(aPageRect.getWidth());
- aRelativePosition.Secondary = (double(aPos.Y())+double(aObjectRect.getHeight())/2.0)/double(aPageRect.getHeight());
- xObjectProp->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) );
+ aRelativePosition.Primary = (double(aPos.X())+double(aObjectRect.getOpenWidth())/2.0)/double(aPageRect.getOpenWidth());
+ aRelativePosition.Secondary = (double(aPos.Y())+double(aObjectRect.getOpenHeight())/2.0)/double(aPageRect.getOpenHeight());
+ xObjectProp->setPropertyValue( u"RelativePosition"_ustr, uno::Any(aRelativePosition) );
}
else if( eObjectType == OBJECTTYPE_DATA_LABEL )
{
RelativePosition aAbsolutePosition;
RelativePosition aCustomLabelPosition;
- aAbsolutePosition.Primary = double(rOldPositionAndSize.X) / double(aPageRect.getWidth());
- aAbsolutePosition.Secondary = double(rOldPositionAndSize.Y) / double(aPageRect.getHeight());
+ aAbsolutePosition.Primary = double(rOldPositionAndSize.X) / double(aPageRect.getOpenWidth());
+ aAbsolutePosition.Secondary = double(rOldPositionAndSize.Y) / double(aPageRect.getOpenHeight());
- if( xObjectProp->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition )
+ if( xObjectProp->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition )
{
aAbsolutePosition.Primary -= aCustomLabelPosition.Primary;
aAbsolutePosition.Secondary -= aCustomLabelPosition.Secondary;
@@ -78,15 +75,15 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
//the anchor point at the data label object is top/left
Point aPos = aObjectRect.TopLeft();
double fRotation = 0.0;
- xObjectProp->getPropertyValue("TextRotation") >>= fRotation;
+ xObjectProp->getPropertyValue(u"TextRotation"_ustr) >>= fRotation;
if( fRotation == 90.0 )
aPos = aObjectRect.BottomLeft();
else if( fRotation == 270.0 )
aPos = aObjectRect.TopRight();
- aCustomLabelPosition.Primary = double(aPos.X()) / double(aPageRect.getWidth()) - aAbsolutePosition.Primary;
- aCustomLabelPosition.Secondary = double(aPos.Y()) / double(aPageRect.getHeight()) - aAbsolutePosition.Secondary;
- xObjectProp->setPropertyValue("CustomLabelPosition", uno::Any(aCustomLabelPosition));
+ aCustomLabelPosition.Primary = double(aPos.X()) / double(aPageRect.getOpenWidth()) - aAbsolutePosition.Primary;
+ aCustomLabelPosition.Secondary = double(aPos.Y()) / double(aPageRect.getOpenHeight()) - aAbsolutePosition.Secondary;
+ xObjectProp->setPropertyValue(u"CustomLabelPosition"_ustr, uno::Any(aCustomLabelPosition));
}
else if( eObjectType==OBJECTTYPE_DATA_CURVE_EQUATION )
{
@@ -95,38 +92,38 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
//the anchor point at the title object is top/middle
Point aPos = aObjectRect.TopLeft();
- aRelativePosition.Primary = double(aPos.X())/double(aPageRect.getWidth());
- aRelativePosition.Secondary = double(aPos.Y())/double(aPageRect.getHeight());
- xObjectProp->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) );
+ aRelativePosition.Primary = double(aPos.X())/double(aPageRect.getOpenWidth());
+ aRelativePosition.Secondary = double(aPos.Y())/double(aPageRect.getOpenHeight());
+ xObjectProp->setPropertyValue( u"RelativePosition"_ustr, uno::Any(aRelativePosition) );
}
else if(eObjectType==OBJECTTYPE_LEGEND)
{
- xObjectProp->setPropertyValue( "Expansion", uno::Any(css::chart::ChartLegendExpansion_CUSTOM));
+ xObjectProp->setPropertyValue( u"Expansion"_ustr, uno::Any(css::chart::ChartLegendExpansion_CUSTOM));
chart2::RelativePosition aRelativePosition;
chart2::RelativeSize aRelativeSize;
Point aAnchor = aObjectRect.TopLeft();
aRelativePosition.Primary =
static_cast< double >( aAnchor.X()) /
- static_cast< double >( aPageRect.getWidth() );
+ static_cast< double >( aPageRect.getOpenWidth() );
aRelativePosition.Secondary =
static_cast< double >( aAnchor.Y()) /
- static_cast< double >( aPageRect.getHeight());
+ static_cast< double >( aPageRect.getOpenHeight());
- xObjectProp->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) );
+ xObjectProp->setPropertyValue( u"RelativePosition"_ustr, uno::Any(aRelativePosition) );
aRelativeSize.Primary =
- static_cast< double >( aObjectRect.getWidth()) /
- static_cast< double >( aPageRect.getWidth() );
+ static_cast< double >( aObjectRect.getOpenWidth()) /
+ static_cast< double >( aPageRect.getOpenWidth() );
if (aRelativeSize.Primary > 1.0)
aRelativeSize.Primary = 1.0;
aRelativeSize.Secondary =
- static_cast< double >( aObjectRect.getHeight()) /
- static_cast< double >( aPageRect.getHeight());
+ static_cast< double >( aObjectRect.getOpenHeight()) /
+ static_cast< double >( aPageRect.getOpenHeight());
if (aRelativeSize.Secondary > 1.0)
aRelativeSize.Secondary = 1.0;
- xObjectProp->setPropertyValue( "RelativeSize", uno::Any(aRelativeSize) );
+ xObjectProp->setPropertyValue( u"RelativeSize"_ustr, uno::Any(aRelativeSize) );
}
else if(eObjectType==OBJECTTYPE_DIAGRAM || eObjectType==OBJECTTYPE_DIAGRAM_WALL || eObjectType==OBJECTTYPE_DIAGRAM_FLOOR)
{
@@ -137,24 +134,24 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
aRelativePosition.Anchor = drawing::Alignment_CENTER;
Point aPos = aObjectRect.Center();
- aRelativePosition.Primary = double(aPos.X())/double(aPageRect.getWidth());
- aRelativePosition.Secondary = double(aPos.Y())/double(aPageRect.getHeight());
- xObjectProp->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) );
+ aRelativePosition.Primary = double(aPos.X())/double(aPageRect.getOpenWidth());
+ aRelativePosition.Secondary = double(aPos.Y())/double(aPageRect.getOpenHeight());
+ xObjectProp->setPropertyValue( u"RelativePosition"_ustr, uno::Any(aRelativePosition) );
//set size:
RelativeSize aRelativeSize;
//the anchor points for the diagram are in the middle of the diagram
//and in the middle of the page
- aRelativeSize.Primary = double(aObjectRect.getWidth())/double(aPageRect.getWidth());
- aRelativeSize.Secondary = double(aObjectRect.getHeight())/double(aPageRect.getHeight());
- xObjectProp->setPropertyValue( "RelativeSize", uno::Any(aRelativeSize) );
+ aRelativeSize.Primary = double(aObjectRect.getOpenWidth())/double(aPageRect.getOpenWidth());
+ aRelativeSize.Secondary = double(aObjectRect.getOpenHeight())/double(aPageRect.getOpenHeight());
+ xObjectProp->setPropertyValue( u"RelativeSize"_ustr, uno::Any(aRelativeSize) );
}
else
return false;
return true;
}
-bool PositionAndSizeHelper::moveObject( const OUString& rObjectCID
+bool PositionAndSizeHelper::moveObject( std::u16string_view rObjectCID
, const rtl::Reference<::chart::ChartModel>& xChartModel
, const awt::Rectangle& rNewPositionAndSize
, const awt::Rectangle& rOldPositionAndSize
diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx
index 433a157ba828..8a6305c6f6c2 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -19,12 +19,9 @@
#include <SelectionHelper.hxx>
#include <ObjectIdentifier.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
-#include <com/sun/star/frame/XModel.hpp>
#include <svx/svdpage.hxx>
#include <svx/svditer.hxx>
#include <svx/obj3d.hxx>
@@ -220,10 +217,10 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper
{
if( bAllowMultiClickSelectionChange )
{
- m_aSelectedOID = aLastChild;
+ m_aSelectedOID = std::move(aLastChild);
}
else
- m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = aLastChild;
+ m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = std::move(aLastChild);
break;
}
}
@@ -315,6 +312,11 @@ bool Selection::isDragableObjectSelected() const
return m_aSelectedOID.isDragableObject();
}
+bool Selection::isTitleObjectSelected() const
+{
+ return m_aSelectedOID.getObjectType() == OBJECTTYPE_TITLE;
+}
+
bool Selection::isAdditionalShapeSelected() const
{
return m_aSelectedOID.isAdditionalShape();
@@ -433,8 +435,7 @@ OUString SelectionHelper::getHitObjectCID(
if( aRet == aWallCID )
{
- OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, OUString::number( 0 ) );
- aRet = aDiagramCID;
+ aRet = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, OUString::number( 0 ) );
}
}
}
@@ -443,13 +444,13 @@ OUString SelectionHelper::getHitObjectCID(
// \\- solar mutex
}
-bool SelectionHelper::isRotateableObject( const OUString& rCID
+bool SelectionHelper::isRotateableObject( std::u16string_view rCID
, const rtl::Reference<::chart::ChartModel>& xChartModel )
{
if( !ObjectIdentifier::isRotateableObject( rCID ) )
return false;
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( ChartModelHelper::findDiagram( xChartModel ) );
+ sal_Int32 nDimensionCount = xChartModel->getFirstChartDiagram()->getDimension();
return nDimensionCount == 3;
}
@@ -466,7 +467,7 @@ SelectionHelper::~SelectionHelper()
bool SelectionHelper::getFrameDragSingles()
{
//true == green == surrounding handles
- return dynamic_cast<const E3dObject*>( m_pSelectedObj) == nullptr;
+ return DynCastE3dObject( m_pSelectedObj) == nullptr;
}
SdrObject* SelectionHelper::getMarkHandlesObject( SdrObject* pObj )
@@ -533,7 +534,7 @@ E3dScene* SelectionHelper::getSceneToRotate( SdrObject* pObj )
if(pObj)
{
- pRotateable = dynamic_cast<E3dObject*>(pObj);
+ pRotateable = DynCastE3dObject(pObj);
if( !pRotateable )
{
SolarMutexGuard aSolarGuard;
@@ -543,8 +544,7 @@ E3dScene* SelectionHelper::getSceneToRotate( SdrObject* pObj )
SdrObjListIter aIterator(pSubList, SdrIterMode::DeepWithGroups);
while( aIterator.IsMore() && !pRotateable )
{
- SdrObject* pSubObj = aIterator.Next();
- pRotateable = dynamic_cast<E3dObject*>(pSubObj);
+ pRotateable = DynCastE3dObject(aIterator.Next());
}
}
}
@@ -598,7 +598,7 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList )
for( sal_uInt32 nM = 0; nM < aPolygon.count(); nM++)
{
const ::basegfx::B2DPoint aPoint(aPolygon.getB2DPoint(nM));
- rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY())), SdrHdlKind::Poly));
+ rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround<tools::Long>(aPoint.getX()), basegfx::fround<tools::Long>(aPoint.getY())), SdrHdlKind::Poly));
}
}
return true;
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index acdcb78ce045..548982720cd5 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -18,15 +18,14 @@
*/
#include "ShapeController.hxx"
-#include <ShapeController.h>
#include <ChartController.hxx>
#include <ViewElementListProvider.hxx>
#include <dlg_ShapeFont.hxx>
#include <dlg_ShapeParagraph.hxx>
+#include <ChartModel.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/frame/CommandGroup.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
#include <vcl/svapp.hxx>
#include <editeng/formatbreakitem.hxx>
@@ -37,7 +36,7 @@
#include <editeng/spltitem.hxx>
#include <svx/svxdlg.hxx>
#include <editeng/widwitem.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
@@ -60,7 +59,7 @@ ShapeController::~ShapeController()
}
// WeakComponentImplHelperBase
-void ShapeController::disposing()
+void ShapeController::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
{
}
@@ -78,7 +77,7 @@ FeatureState ShapeController::getState( const OUString& rCommand )
bool bWritable = false;
if ( m_pChartController )
{
- Reference< frame::XStorable > xStorable( m_pChartController->getModel(), uno::UNO_QUERY );
+ rtl::Reference< ChartModel > xStorable = m_pChartController->getChartModel();
if ( xStorable.is() )
{
bWritable = !xStorable->isReadonly();
@@ -88,42 +87,37 @@ FeatureState ShapeController::getState( const OUString& rCommand )
SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( rCommand );
if ( aIter != m_aSupportedFeatures.end() )
{
- sal_uInt16 nFeatureId = aIter->second.nFeatureId;
+ ChartCommandID nFeatureId = aIter->second.nFeatureId;
switch ( nFeatureId )
{
- case COMMAND_ID_FORMAT_LINE:
- case COMMAND_ID_FORMAT_AREA:
- case COMMAND_ID_TEXT_ATTRIBUTES:
- case COMMAND_ID_TRANSFORM_DIALOG:
- case COMMAND_ID_OBJECT_TITLE_DESCRIPTION:
- case COMMAND_ID_RENAME_OBJECT:
+ case ChartCommandID::ShapeFormatLine:
+ case ChartCommandID::ShapeFormatArea:
+ case ChartCommandID::ShapeTextAttributes:
+ case ChartCommandID::ShapeTransformDialog:
+ case ChartCommandID::ShapeObjectTitleDescription:
+ case ChartCommandID::ShapeRenameObject:
+ case ChartCommandID::ShapeFontDialog:
+ case ChartCommandID::ShapeParagraphDialog:
{
aReturn.bEnabled = bWritable;
aReturn.aState <<= false;
}
break;
- case COMMAND_ID_BRING_TO_FRONT:
- case COMMAND_ID_FORWARD:
+ case ChartCommandID::ShapeBringToFront:
+ case ChartCommandID::ShapeForward:
{
aReturn.bEnabled = ( bWritable && isForwardPossible() );
aReturn.aState <<= false;
}
break;
- case COMMAND_ID_BACKWARD:
- case COMMAND_ID_SEND_TO_BACK:
+ case ChartCommandID::ShapeBackward:
+ case ChartCommandID::ShapeSendToBack:
{
aReturn.bEnabled = ( bWritable && isBackwardPossible() );
aReturn.aState <<= false;
}
break;
- case COMMAND_ID_FONT_DIALOG:
- case COMMAND_ID_PARAGRAPH_DIALOG:
- {
- aReturn.bEnabled = bWritable;
- aReturn.aState <<= false;
- }
- break;
default:
{
aReturn.bEnabled = false;
@@ -142,53 +136,53 @@ void ShapeController::execute( const OUString& rCommand, const Sequence< beans::
if ( aIter == m_aSupportedFeatures.end() )
return;
- sal_uInt16 nFeatureId = aIter->second.nFeatureId;
+ ChartCommandID nFeatureId = aIter->second.nFeatureId;
switch ( nFeatureId )
{
- case COMMAND_ID_FORMAT_LINE:
+ case ChartCommandID::ShapeFormatLine:
{
executeDispatch_FormatLine();
}
break;
- case COMMAND_ID_FORMAT_AREA:
+ case ChartCommandID::ShapeFormatArea:
{
executeDispatch_FormatArea();
}
break;
- case COMMAND_ID_TEXT_ATTRIBUTES:
+ case ChartCommandID::ShapeTextAttributes:
{
executeDispatch_TextAttributes();
}
break;
- case COMMAND_ID_TRANSFORM_DIALOG:
+ case ChartCommandID::ShapeTransformDialog:
{
executeDispatch_TransformDialog();
}
break;
- case COMMAND_ID_OBJECT_TITLE_DESCRIPTION:
+ case ChartCommandID::ShapeObjectTitleDescription:
{
executeDispatch_ObjectTitleDescription();
}
break;
- case COMMAND_ID_RENAME_OBJECT:
+ case ChartCommandID::ShapeRenameObject:
{
executeDispatch_RenameObject();
}
break;
- case COMMAND_ID_BRING_TO_FRONT:
- case COMMAND_ID_FORWARD:
- case COMMAND_ID_BACKWARD:
- case COMMAND_ID_SEND_TO_BACK:
+ case ChartCommandID::ShapeBringToFront:
+ case ChartCommandID::ShapeForward:
+ case ChartCommandID::ShapeBackward:
+ case ChartCommandID::ShapeSendToBack:
{
executeDispatch_ChangeZOrder( nFeatureId );
}
break;
- case COMMAND_ID_FONT_DIALOG:
+ case ChartCommandID::ShapeFontDialog:
{
executeDispatch_FontDialog();
}
break;
- case COMMAND_ID_PARAGRAPH_DIALOG:
+ case ChartCommandID::ShapeParagraphDialog:
{
executeDispatch_ParagraphDialog();
}
@@ -202,24 +196,23 @@ void ShapeController::execute( const OUString& rCommand, const Sequence< beans::
void ShapeController::describeSupportedFeatures()
{
- implDescribeSupportedFeature( ".uno:FormatLine", COMMAND_ID_FORMAT_LINE, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:FormatArea", COMMAND_ID_FORMAT_AREA, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:TextAttributes", COMMAND_ID_TEXT_ATTRIBUTES, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:TransformDialog", COMMAND_ID_TRANSFORM_DIALOG, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:ObjectTitleDescription", COMMAND_ID_OBJECT_TITLE_DESCRIPTION, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:RenameObject", COMMAND_ID_RENAME_OBJECT, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:BringToFront", COMMAND_ID_BRING_TO_FRONT, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:Forward", COMMAND_ID_FORWARD, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:Backward", COMMAND_ID_BACKWARD, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:SendToBack", COMMAND_ID_SEND_TO_BACK, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:FontDialog", COMMAND_ID_FONT_DIALOG, CommandGroup::EDIT );
- implDescribeSupportedFeature( ".uno:ParagraphDialog", COMMAND_ID_PARAGRAPH_DIALOG, CommandGroup::EDIT );
+ implDescribeSupportedFeature( u".uno:FormatLine"_ustr, ChartCommandID::ShapeFormatLine, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:FormatArea"_ustr, ChartCommandID::ShapeFormatArea, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:TextAttributes"_ustr, ChartCommandID::ShapeTextAttributes, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:TransformDialog"_ustr, ChartCommandID::ShapeTransformDialog, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:ObjectTitleDescription"_ustr, ChartCommandID::ShapeObjectTitleDescription, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:RenameObject"_ustr, ChartCommandID::ShapeRenameObject, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:BringToFront"_ustr, ChartCommandID::ShapeBringToFront, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:Forward"_ustr, ChartCommandID::ShapeForward, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:Backward"_ustr, ChartCommandID::ShapeBackward, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:SendToBack"_ustr, ChartCommandID::ShapeSendToBack, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( u".uno:FontDialog"_ustr, ChartCommandID::ShapeFontDialog, CommandGroup::EDIT );
+ implDescribeSupportedFeature( u".uno:ParagraphDialog"_ustr, ChartCommandID::ShapeParagraphDialog, CommandGroup::EDIT );
}
IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxObjectNameDialog&, rDialog, bool )
{
- OUString aName;
- rDialog.GetName( aName );
+ OUString aName = rDialog.GetName();
if ( !aName.isEmpty() )
{
@@ -246,7 +239,7 @@ void ShapeController::executeDispatch_FormatLine()
SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ bool bHasMarked = pDrawViewWrapper->GetMarkedObjectList().GetMarkCount() != 0;
if ( bHasMarked )
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, false );
@@ -282,14 +275,14 @@ void ShapeController::executeDispatch_FormatArea()
return;
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ bool bHasMarked = pDrawViewWrapper->GetMarkedObjectList().GetMarkCount() != 0;
if ( bHasMarked )
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, false );
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr< AbstractSvxAreaTabDialog > pDlg(
- pFact->CreateSvxAreaTabDialog(pChartWindow, &aAttr, &pDrawModelWrapper->getSdrModel(), true));
+ pFact->CreateSvxAreaTabDialog(pChartWindow, &aAttr, &pDrawModelWrapper->getSdrModel(), true, false));
if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
@@ -316,26 +309,32 @@ void ShapeController::executeDispatch_TextAttributes()
return;
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ bool bHasMarked = pDrawViewWrapper->GetMarkedObjectList().GetMarkCount() != 0;
if ( bHasMarked )
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, false );
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr< SfxAbstractTabDialog > pDlg(
+ VclPtr< SfxAbstractTabDialog > pDlg(
pFact->CreateTextTabDialog(pChartWindow, &aAttr, pDrawViewWrapper));
- if ( pDlg->Execute() == RET_OK )
- {
- const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
- if ( bHasMarked )
- {
- pDrawViewWrapper->SetAttributes( *pOutAttr );
- }
- else
+ pDlg->StartExecuteAsync(
+ [pDlg, bHasMarked, pDrawViewWrapper] (sal_Int32 nResult)->void
{
- pDrawViewWrapper->SetDefaultAttr( *pOutAttr, false );
+ if ( RET_OK == nResult )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ }
+ else
+ {
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, false );
+ }
+ }
+ pDlg->disposeOnce();
}
- }
+ );
}
void ShapeController::executeDispatch_TransformDialog()
@@ -353,15 +352,15 @@ void ShapeController::executeDispatch_TransformDialog()
if ( pSelectedObj && pSelectedObj->GetObjIdentifier() == SdrObjKind::Caption )
{
// item set for caption
- SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+ SfxItemSet aAttr(pDrawViewWrapper->GetModel().GetItemPool());
pDrawViewWrapper->GetAttributes( aAttr );
// item set for position and size
SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr< SfxAbstractTabDialog > pDlg(
pFact->CreateCaptionDialog(pChartWindow, pDrawViewWrapper));
- const WhichRangesContainer& pRange = pDlg->GetInputRanges( *aAttr.GetPool() );
- SfxItemSet aCombAttr( *aAttr.GetPool(), pRange );
+ const WhichRangesContainer aRange = pDlg->GetInputRanges( *aAttr.GetPool() );
+ SfxItemSet aCombAttr( *aAttr.GetPool(), aRange );
aCombAttr.Put( aAttr );
aCombAttr.Put( aGeoAttr );
pDlg->SetInputSet( &aCombAttr );
@@ -393,7 +392,7 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
return;
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( !(pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1) )
+ if ( !(pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectList().GetMarkCount() == 1) )
return;
SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
@@ -402,17 +401,23 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
OUString aTitle( pSelectedObj->GetTitle() );
OUString aDescription( pSelectedObj->GetDescription() );
+ bool isDecorative(pSelectedObj->IsDecorative());
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
weld::Window* pChartWindow(m_pChartController->GetChartFrame());
- ScopedVclPtr< AbstractSvxObjectTitleDescDialog > pDlg(
- pFact->CreateSvxObjectTitleDescDialog(pChartWindow, aTitle, aDescription));
- if ( pDlg->Execute() == RET_OK )
- {
- pDlg->GetTitle( aTitle );
- pDlg->GetDescription( aDescription );
- pSelectedObj->SetTitle( aTitle );
- pSelectedObj->SetDescription( aDescription );
- }
+ VclPtr< AbstractSvxObjectTitleDescDialog > pDlg(
+ pFact->CreateSvxObjectTitleDescDialog(pChartWindow, aTitle, aDescription, isDecorative));
+ pDlg->StartExecuteAsync(
+ [pDlg, pSelectedObj] (sal_Int32 nResult)->void
+ {
+ if (nResult == RET_OK)
+ {
+ pSelectedObj->SetTitle( pDlg->GetTitle() );
+ pSelectedObj->SetDescription( pDlg->GetDescription() );
+ pSelectedObj->SetDecorative(pDlg->IsDecorative());
+ }
+ pDlg->disposeOnce();
+ }
+ );
}
void ShapeController::executeDispatch_RenameObject()
@@ -422,30 +427,35 @@ void ShapeController::executeDispatch_RenameObject()
return;
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( !(pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1) )
+ if ( !(pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectList().GetMarkCount() == 1) )
return;
SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
if ( !pSelectedObj )
return;
- OUString aName = pSelectedObj->GetName();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
weld::Window* pChartWindow(m_pChartController->GetChartFrame());
- ScopedVclPtr< AbstractSvxObjectNameDialog > pDlg(
- pFact->CreateSvxObjectNameDialog(pChartWindow, aName));
+ VclPtr< AbstractSvxObjectNameDialog > pDlg(
+ pFact->CreateSvxObjectNameDialog(pChartWindow, pSelectedObj->GetName()));
pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
- if ( pDlg->Execute() == RET_OK )
- {
- pDlg->GetName(aName);
- if (pSelectedObj->GetName() == aName)
+ pDlg->StartExecuteAsync(
+ [pDlg, pSelectedObj] (sal_Int32 nResult)->void
{
- pSelectedObj->SetName( aName );
+ if (nResult == RET_OK)
+ {
+ OUString aName = pDlg->GetName();
+ if (pSelectedObj->GetName() != aName)
+ {
+ pSelectedObj->SetName( aName );
+ }
+ }
+ pDlg->disposeOnce();
}
- }
+ );
}
-void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
+void ShapeController::executeDispatch_ChangeZOrder( ChartCommandID nId )
{
SolarMutexGuard aGuard;
DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : nullptr );
@@ -454,7 +464,7 @@ void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
switch ( nId )
{
- case COMMAND_ID_BRING_TO_FRONT:
+ case ChartCommandID::ShapeBringToFront:
{
if ( isForwardPossible() )
{
@@ -462,7 +472,7 @@ void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
}
}
break;
- case COMMAND_ID_FORWARD:
+ case ChartCommandID::ShapeForward:
{
if ( isForwardPossible() )
{
@@ -470,7 +480,7 @@ void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
}
}
break;
- case COMMAND_ID_BACKWARD:
+ case ChartCommandID::ShapeBackward:
{
if ( isBackwardPossible() )
{
@@ -478,7 +488,7 @@ void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
}
}
break;
- case COMMAND_ID_SEND_TO_BACK:
+ case ChartCommandID::ShapeSendToBack:
{
if ( isBackwardPossible() )
{
@@ -505,7 +515,7 @@ void ShapeController::executeDispatch_FontDialog()
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pChartWindow && pDrawModelWrapper && pDrawViewWrapper )
{
- SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+ SfxItemSet aAttr(pDrawViewWrapper->GetModel().GetItemPool());
pDrawViewWrapper->GetAttributes( aAttr );
ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
ShapeFontDialog aDlg(pChartWindow, &aAttr, &aViewElementListProvider);
@@ -528,7 +538,7 @@ void ShapeController::executeDispatch_ParagraphDialog()
if ( !(pChartWindow && pDrawViewWrapper) )
return;
- SfxItemPool& rPool = pDrawViewWrapper->GetModel()->GetItemPool();
+ SfxItemPool& rPool = pDrawViewWrapper->GetModel().GetItemPool();
SfxItemSet aAttr( rPool );
pDrawViewWrapper->GetAttributes( aAttr );
@@ -570,7 +580,7 @@ SdrObject* ShapeController::getFirstAdditionalShape()
{
if ( xShape.is() && xShape != xChartRoot )
{
- xFirstShape = xShape;
+ xFirstShape = std::move(xShape);
break;
}
}
@@ -609,7 +619,7 @@ SdrObject* ShapeController::getLastAdditionalShape()
{
if ( xShape.is() && xShape != xChartRoot )
{
- xLastShape = xShape;
+ xLastShape = std::move(xShape);
break;
}
}
diff --git a/chart2/source/controller/main/ShapeController.hxx b/chart2/source/controller/main/ShapeController.hxx
index 3d65c49e504c..cdd8002ce2d8 100644
--- a/chart2/source/controller/main/ShapeController.hxx
+++ b/chart2/source/controller/main/ShapeController.hxx
@@ -41,7 +41,7 @@ public:
protected:
// WeakComponentImplHelperBase
- virtual void SAL_CALL disposing() override;
+ virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
@@ -64,7 +64,7 @@ private:
void executeDispatch_TransformDialog();
void executeDispatch_ObjectTitleDescription();
void executeDispatch_RenameObject();
- void executeDispatch_ChangeZOrder( sal_uInt16 nId );
+ void executeDispatch_ChangeZOrder( ChartCommandID nId );
void executeDispatch_FontDialog();
void executeDispatch_ParagraphDialog();
diff --git a/chart2/source/controller/main/StatusBarCommandDispatch.cxx b/chart2/source/controller/main/StatusBarCommandDispatch.cxx
index 1b867cb562f8..863436c3bab0 100644
--- a/chart2/source/controller/main/StatusBarCommandDispatch.cxx
+++ b/chart2/source/controller/main/StatusBarCommandDispatch.cxx
@@ -19,10 +19,9 @@
#include "StatusBarCommandDispatch.hxx"
#include <ObjectNameProvider.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
#include <ChartModel.hxx>
+#include <utility>
using namespace ::com::sun::star;
@@ -34,10 +33,10 @@ namespace chart
StatusBarCommandDispatch::StatusBarCommandDispatch(
const Reference< uno::XComponentContext > & xContext,
- const rtl::Reference<::chart::ChartModel> & xModel,
+ rtl::Reference<::chart::ChartModel> xModel,
const Reference< view::XSelectionSupplier > & xSelSupp ) :
impl::StatusBarCommandDispatch_Base( xContext ),
- m_xChartModel( xModel ),
+ m_xChartModel(std::move( xModel )),
m_xSelectionSupplier( xSelSupp ),
m_bIsModified( false )
{}
@@ -66,18 +65,18 @@ void StatusBarCommandDispatch::fireStatusEvent(
bool bFireContext( bFireAll || rURL == ".uno:Context" );
bool bFireModified( bFireAll || rURL == ".uno:ModifiedStatus" );
- if( bFireContext )
+ if( bFireContext && m_xChartModel.is())
{
uno::Any aArg;
aArg <<= ObjectNameProvider::getSelectedObjectText( m_aSelectedOID.getObjectCID(), m_xChartModel );
- fireStatusEventForURL( ".uno:Context", aArg, true, xSingleListener );
+ fireStatusEventForURL( u".uno:Context"_ustr, aArg, true, xSingleListener );
}
if( bFireModified )
{
uno::Any aArg;
if( m_bIsModified )
- aArg <<= OUString("*");
- fireStatusEventForURL( ".uno:ModifiedStatus", aArg, true, xSingleListener );
+ aArg <<= u"*"_ustr;
+ fireStatusEventForURL( u".uno:ModifiedStatus"_ustr, aArg, true, xSingleListener );
}
}
@@ -91,7 +90,7 @@ void SAL_CALL StatusBarCommandDispatch::dispatch(
// ____ WeakComponentImplHelperBase ____
/// is called when this is disposed
-void SAL_CALL StatusBarCommandDispatch::disposing()
+void StatusBarCommandDispatch::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
{
m_xChartModel.clear();
m_xSelectionSupplier.clear();
diff --git a/chart2/source/controller/main/StatusBarCommandDispatch.hxx b/chart2/source/controller/main/StatusBarCommandDispatch.hxx
index c123475c037f..2fc3a4c9fa25 100644
--- a/chart2/source/controller/main/StatusBarCommandDispatch.hxx
+++ b/chart2/source/controller/main/StatusBarCommandDispatch.hxx
@@ -18,14 +18,14 @@
*/
#pragma once
-#include "CommandDispatch.hxx"
+#include <sal/config.h>
+
+#include <CommandDispatch.hxx>
#include <ObjectIdentifier.hxx>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/view/XSelectionChangeListener.hpp>
#include <rtl/ref.hxx>
-namespace com::sun::star::frame { class XModel; }
-namespace com::sun::star::util { class XModifiable; }
namespace com::sun::star::view { class XSelectionSupplier; }
namespace chart
@@ -49,7 +49,7 @@ class StatusBarCommandDispatch : public impl::StatusBarCommandDispatch_Base
public:
explicit StatusBarCommandDispatch(
const css::uno::Reference< css::uno::XComponentContext > & xContext,
- const rtl::Reference<::chart::ChartModel> & xModel,
+ rtl::Reference<::chart::ChartModel> xModel,
const css::uno::Reference< css::view::XSelectionSupplier > & xSelSupp );
virtual ~StatusBarCommandDispatch() override;
@@ -64,7 +64,7 @@ protected:
// ____ WeakComponentImplHelperBase ____
/// is called when this is disposed
- virtual void SAL_CALL disposing() override;
+ virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
// ____ XModifyListener (override from CommandDispatch) ____
virtual void SAL_CALL modified(
diff --git a/chart2/source/controller/main/ToolbarController.cxx b/chart2/source/controller/main/ToolbarController.cxx
index 17df7c7c8b14..de04e4c91b4d 100644
--- a/chart2/source/controller/main/ToolbarController.cxx
+++ b/chart2/source/controller/main/ToolbarController.cxx
@@ -97,7 +97,7 @@ void ChartToolbarController::update()
OUString ChartToolbarController::getImplementationName()
{
- return "org.libreoffice.chart2.Chart2ToolboxController";
+ return u"org.libreoffice.chart2.Chart2ToolboxController"_ustr;
}
sal_Bool ChartToolbarController::supportsService(OUString const & ServiceName)
@@ -107,7 +107,7 @@ sal_Bool ChartToolbarController::supportsService(OUString const & ServiceName)
css::uno::Sequence<OUString> ChartToolbarController::getSupportedServiceNames()
{
- return { "com.sun.star.frame.ToolbarController" };
+ return { u"com.sun.star.frame.ToolbarController"_ustr };
}
}
diff --git a/chart2/source/controller/main/UndoActions.cxx b/chart2/source/controller/main/UndoActions.cxx
index 6d043137d464..a3c899253295 100644
--- a/chart2/source/controller/main/UndoActions.cxx
+++ b/chart2/source/controller/main/UndoActions.cxx
@@ -26,19 +26,18 @@
#include <svx/svdundo.hxx>
#include <memory>
+#include <utility>
using namespace ::com::sun::star;
namespace chart::impl
{
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::frame::XModel;
using ::com::sun::star::lang::DisposedException;
-UndoElement::UndoElement( const OUString& i_actionString, const rtl::Reference<::chart::ChartModel>& i_documentModel, const std::shared_ptr< ChartModelClone >& i_modelClone )
- :m_sActionString( i_actionString )
- ,m_xDocumentModel( i_documentModel )
- ,m_pModelClone( i_modelClone )
+UndoElement::UndoElement( OUString i_actionString, rtl::Reference<::chart::ChartModel> i_documentModel, std::shared_ptr< ChartModelClone > i_modelClone )
+ :m_sActionString(std::move( i_actionString ))
+ ,m_xDocumentModel(std::move( i_documentModel ))
+ ,m_pModelClone(std::move( i_modelClone ))
{
}
@@ -66,7 +65,7 @@ void UndoElement::impl_toggleModelState()
// apply the previous snapshot to our model
m_pModelClone->applyToModel( m_xDocumentModel );
// remember the new snapshot, for the next toggle
- m_pModelClone = pNewClone;
+ m_pModelClone = std::move(pNewClone);
}
void SAL_CALL UndoElement::undo( )
diff --git a/chart2/source/controller/main/UndoActions.hxx b/chart2/source/controller/main/UndoActions.hxx
index 3291a72be649..10fc0aeb5817 100644
--- a/chart2/source/controller/main/UndoActions.hxx
+++ b/chart2/source/controller/main/UndoActions.hxx
@@ -26,8 +26,6 @@
#include <memory>
-namespace com::sun::star::frame { class XModel; }
-
class SdrUndoAction;
namespace chart
@@ -53,9 +51,9 @@ public:
is the cloned model from before the changes, which the Undo action represents, have been applied.
Upon <member>invoking</member>, the clone model is applied to the document model.
*/
- UndoElement( const OUString & i_actionString,
- const rtl::Reference<::chart::ChartModel>& i_documentModel,
- const std::shared_ptr< ChartModelClone >& i_modelClone
+ UndoElement( OUString i_actionString,
+ rtl::Reference<::chart::ChartModel> i_documentModel,
+ std::shared_ptr< ChartModelClone > i_modelClone
);
virtual ~UndoElement() override;
diff --git a/chart2/source/controller/main/UndoCommandDispatch.cxx b/chart2/source/controller/main/UndoCommandDispatch.cxx
index 3a05412d1670..1c5c760f93f5 100644
--- a/chart2/source/controller/main/UndoCommandDispatch.cxx
+++ b/chart2/source/controller/main/UndoCommandDispatch.cxx
@@ -20,13 +20,12 @@
#include "UndoCommandDispatch.hxx"
#include <ChartModel.hxx>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/document/UndoFailedException.hpp>
-#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+#include <utility>
#include <vcl/svapp.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <svtools/strings.hrc>
#include <svtools/svtresid.hxx>
@@ -41,9 +40,9 @@ namespace chart
UndoCommandDispatch::UndoCommandDispatch(
const Reference< uno::XComponentContext > & xContext,
- const rtl::Reference<::chart::ChartModel> & xModel ) :
+ rtl::Reference<::chart::ChartModel> xModel ) :
CommandDispatch( xContext ),
- m_xModel( xModel )
+ m_xModel(std::move( xModel ))
{
m_xUndoManager.set( m_xModel->getUndoManager(), uno::UNO_SET_THROW );
}
@@ -76,13 +75,13 @@ void UndoCommandDispatch::fireStatusEvent(
aRedoStrings <<= m_xUndoManager->getAllRedoActionTitles();
if( bFireAll || rURL == ".uno:Undo" )
- fireStatusEventForURL( ".uno:Undo", aUndoState, m_xUndoManager->isUndoPossible(), xSingleListener );
+ fireStatusEventForURL( u".uno:Undo"_ustr, aUndoState, m_xUndoManager->isUndoPossible(), xSingleListener );
if( bFireAll || rURL == ".uno:Redo" )
- fireStatusEventForURL( ".uno:Redo", aRedoState, m_xUndoManager->isRedoPossible(), xSingleListener );
+ fireStatusEventForURL( u".uno:Redo"_ustr, aRedoState, m_xUndoManager->isRedoPossible(), xSingleListener );
if( bFireAll || rURL == ".uno:GetUndoStrings" )
- fireStatusEventForURL( ".uno:GetUndoStrings", aUndoStrings, true, xSingleListener );
+ fireStatusEventForURL( u".uno:GetUndoStrings"_ustr, aUndoStrings, true, xSingleListener );
if( bFireAll || rURL == ".uno:GetRedoStrings" )
- fireStatusEventForURL( ".uno:GetRedoStrings", aRedoStrings, true, xSingleListener );
+ fireStatusEventForURL( u".uno:GetRedoStrings"_ustr, aRedoStrings, true, xSingleListener );
}
// ____ XDispatch ____
@@ -122,7 +121,7 @@ void SAL_CALL UndoCommandDispatch::dispatch(
// ____ WeakComponentImplHelperBase ____
/// is called when this is disposed
-void SAL_CALL UndoCommandDispatch::disposing()
+void UndoCommandDispatch::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
{
Reference< util::XModifyBroadcaster > xBroadcaster( m_xUndoManager, uno::UNO_QUERY );
OSL_ENSURE( xBroadcaster.is(), "UndoCommandDispatch::initialize: missing modification broadcaster interface!" );
diff --git a/chart2/source/controller/main/UndoCommandDispatch.hxx b/chart2/source/controller/main/UndoCommandDispatch.hxx
index 7be241a5fbc3..4d3903bc8b62 100644
--- a/chart2/source/controller/main/UndoCommandDispatch.hxx
+++ b/chart2/source/controller/main/UndoCommandDispatch.hxx
@@ -18,11 +18,12 @@
*/
#pragma once
-#include "CommandDispatch.hxx"
+#include <sal/config.h>
+
+#include <CommandDispatch.hxx>
#include <rtl/ref.hxx>
namespace com::sun::star::document { class XUndoManager; }
-namespace com::sun::star::frame { class XModel; }
namespace chart
{
@@ -35,7 +36,7 @@ class UndoCommandDispatch : public CommandDispatch
public:
explicit UndoCommandDispatch(
const css::uno::Reference< css::uno::XComponentContext > & xContext,
- const rtl::Reference<::chart::ChartModel> & xModel );
+ rtl::Reference<::chart::ChartModel> xModel );
virtual ~UndoCommandDispatch() override;
// late initialisation, especially for adding as listener
@@ -49,7 +50,7 @@ protected:
// ____ WeakComponentImplHelperBase ____
/// is called when this is disposed
- virtual void SAL_CALL disposing() override;
+ virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
// ____ XEventListener (base of XModifyListener) ____
virtual void SAL_CALL disposing(
diff --git a/chart2/source/controller/main/UndoGuard.cxx b/chart2/source/controller/main/UndoGuard.cxx
index 420347eb40d4..4e870c36d07d 100644
--- a/chart2/source/controller/main/UndoGuard.cxx
+++ b/chart2/source/controller/main/UndoGuard.cxx
@@ -23,9 +23,9 @@
#include <ChartModel.hxx>
#include <com/sun/star/document/XUndoManager.hpp>
-#include <com/sun/star/frame/XModel.hpp>
+#include <utility>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
@@ -34,10 +34,10 @@ using ::com::sun::star::uno::Reference;
namespace chart
{
-UndoGuard::UndoGuard( const OUString& i_undoString, const uno::Reference< document::XUndoManager > & i_undoManager,
+UndoGuard::UndoGuard( OUString i_undoString, const uno::Reference< document::XUndoManager > & i_undoManager,
const ModelFacet i_facet )
:m_xUndoManager( i_undoManager )
- ,m_aUndoString( i_undoString )
+ ,m_aUndoString(std::move( i_undoString ))
,m_bActionPosted( false )
{
m_xChartModel = dynamic_cast<::chart::ChartModel*>(i_undoManager->getParent().get());
diff --git a/chart2/source/controller/main/UndoGuard.hxx b/chart2/source/controller/main/UndoGuard.hxx
index 9808da8bc1ad..83938e86370a 100644
--- a/chart2/source/controller/main/UndoGuard.hxx
+++ b/chart2/source/controller/main/UndoGuard.hxx
@@ -25,7 +25,6 @@
#include <memory>
namespace com::sun::star::document { class XUndoManager; }
-namespace com::sun::star::frame { class XModel; }
namespace chart
{
@@ -37,7 +36,7 @@ class UndoGuard
{
public:
explicit UndoGuard(
- const OUString& i_undoMessage,
+ OUString i_undoMessage,
const css::uno::Reference< css::document::XUndoManager > & i_undoManager,
const ModelFacet i_facet = E_MODEL
);
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index 081322b09408..9274dc2e346c 100644
--- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -34,6 +34,7 @@
#include "ChartErrorBarPanel.hxx"
#include "ChartAreaPanel.hxx"
#include "ChartLinePanel.hxx"
+#include "ChartColorsPanel.hxx"
using namespace css::uno;
@@ -56,9 +57,9 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
try
{
const ::comphelper::NamedValueCollection aArguments (rArguments);
- Reference<css::frame::XFrame> xFrame (aArguments.getOrDefault("Frame", Reference<css::frame::XFrame>()));
- Reference<css::awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<css::awt::XWindow>()));
- Reference<css::frame::XController> xController (aArguments.getOrDefault("Controller", Reference<css::frame::XController>()));
+ Reference<css::frame::XFrame> xFrame(sfx2::sidebar::GetFrame(aArguments));
+ Reference<css::awt::XWindow> xParentWindow (aArguments.getOrDefault(u"ParentWindow"_ustr, Reference<css::awt::XWindow>()));
+ Reference<css::frame::XController> xController (aArguments.getOrDefault(u"Controller"_ustr, Reference<css::frame::XController>()));
weld::Widget* pParent(nullptr);
if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get()))
@@ -66,21 +67,21 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
if (!pParent)
throw RuntimeException(
- "PanelFactory::createUIElement called without ParentWindow",
+ u"PanelFactory::createUIElement called without ParentWindow"_ustr,
nullptr);
if ( ! xFrame.is())
throw RuntimeException(
- "PanelFactory::createUIElement called without Frame",
+ u"PanelFactory::createUIElement called without Frame"_ustr,
nullptr);
if (!xController.is())
throw RuntimeException(
- "ChartPanelFactory::createUIElement called without Controller",
+ u"ChartPanelFactory::createUIElement called without Controller"_ustr,
nullptr);
ChartController* pController = dynamic_cast<ChartController*>(xController.get());
if (!pController)
throw RuntimeException(
- "ChartPanelFactory::createUIElement called without valid ChartController",
+ u"ChartPanelFactory::createUIElement called without valid ChartController"_ustr,
nullptr);
std::unique_ptr<PanelLayout> xPanel;
@@ -98,6 +99,8 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
xPanel = ChartAreaPanel::Create(pParent, xFrame, pController);
else if (rsResourceURL.endsWith("/LinePanel"))
xPanel = ChartLinePanel::Create(pParent, xFrame, pController);
+ else if (rsResourceURL.endsWith("/ColorsPanel"))
+ xPanel = ChartColorsPanel::Create(pParent, xFrame, pController);
if (xPanel)
xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -114,7 +117,7 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
{
css::uno::Any anyEx = cppu::getCaughtException();
throw css::lang::WrappedTargetRuntimeException(
- "ChartPanelFactory::createUIElement exception",
+ u"ChartPanelFactory::createUIElement exception"_ustr,
nullptr, anyEx );
}
@@ -123,7 +126,7 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
OUString ChartPanelFactory::getImplementationName()
{
- return "org.libreoffice.comp.chart2.sidebar.ChartPanelFactory";
+ return u"org.libreoffice.comp.chart2.sidebar.ChartPanelFactory"_ustr;
}
sal_Bool ChartPanelFactory::supportsService(OUString const & ServiceName)
@@ -133,7 +136,7 @@ sal_Bool ChartPanelFactory::supportsService(OUString const & ServiceName)
css::uno::Sequence<OUString> ChartPanelFactory::getSupportedServiceNames()
{
- return { "com.sun.star.ui.UIElementFactory" };
+ return { u"com.sun.star.ui.UIElementFactory"_ustr };
}
} // end of namespace chart::sidebar
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index f13f2390debc..87a49974eb8c 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -19,7 +19,6 @@
#include <PropertyHelper.hxx>
#include <chartview/DrawModelWrapper.hxx>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <sfx2/weldutils.hxx>
@@ -37,7 +36,7 @@ namespace {
SvxColorToolBoxControl* getColorToolBoxControl(const ToolbarUnoDispatcher& rColorDispatch)
{
- css::uno::Reference<css::frame::XToolbarController> xController = rColorDispatch.GetControllerForCommand(".uno:FillColor");
+ css::uno::Reference<css::frame::XToolbarController> xController = rColorDispatch.GetControllerForCommand(u".uno:FillColor"_ustr);
SvxColorToolBoxControl* pToolBoxColorControl = dynamic_cast<SvxColorToolBoxControl*>(xController.get());
return pToolBoxColorControl;
}
@@ -124,7 +123,7 @@ XFillGradientItem getXGradientForName(const css::uno::Reference<css::frame::XMod
{
css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xModel, css::uno::UNO_QUERY);
css::uno::Reference<css::container::XNameAccess> xNameAccess(
- xFact->createInstance("com.sun.star.drawing.GradientTable"), css::uno::UNO_QUERY);
+ xFact->createInstance(u"com.sun.star.drawing.GradientTable"_ustr), css::uno::UNO_QUERY);
if (!xNameAccess.is())
return XFillGradientItem();
@@ -146,7 +145,7 @@ XFillFloatTransparenceItem getXTransparencyGradientForName(const css::uno::Refer
{
css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xModel, css::uno::UNO_QUERY);
css::uno::Reference<css::container::XNameAccess> xNameAccess(
- xFact->createInstance("com.sun.star.drawing.TransparencyGradientTable"), css::uno::UNO_QUERY);
+ xFact->createInstance(u"com.sun.star.drawing.TransparencyGradientTable"_ustr), css::uno::UNO_QUERY);
if (!xNameAccess.is())
return XFillFloatTransparenceItem();
@@ -263,9 +262,9 @@ std::unique_ptr<PanelLayout> ChartAreaPanel::Create(
ChartController* pController)
{
if (pParent == nullptr)
- throw css::lang::IllegalArgumentException("no parent Window given to ChartAxisPanel::Create", nullptr, 0);
+ throw css::lang::IllegalArgumentException(u"no parent Window given to ChartAxisPanel::Create"_ustr, nullptr, 0);
if (!rxFrame.is())
- throw css::lang::IllegalArgumentException("no XFrame given to ChartAxisPanel::Create", nullptr, 1);
+ throw css::lang::IllegalArgumentException(u"no XFrame given to ChartAxisPanel::Create"_ustr, nullptr, 1);
return std::make_unique<ChartAreaPanel>(pParent, rxFrame, pController);
}
@@ -279,7 +278,7 @@ ChartAreaPanel::ChartAreaPanel(weld::Widget* pParent,
mxSelectionListener(new ChartSidebarSelectionListener(this)),
mbUpdate(true),
mbModelValid(true),
- maFillColorWrapper(mxModel, getColorToolBoxControl(*mxColorDispatch), "FillColor")
+ maFillColorWrapper(mxModel, getColorToolBoxControl(*mxColorDispatch), u"FillColor"_ustr)
{
std::vector<ObjectType> aAcceptedTypes { OBJECTTYPE_PAGE, OBJECTTYPE_DIAGRAM,
OBJECTTYPE_DATA_SERIES, OBJECTTYPE_DATA_POINT,
@@ -307,6 +306,13 @@ void ChartAreaPanel::Initialize()
updateData();
}
+bool ChartAreaPanel::selectionIsDataSeries() const
+{
+ OUString aCID = getCID(mxModel);
+ ObjectType eType = ObjectIdentifier::getObjectType(aCID);
+ return eType == ObjectType::OBJECTTYPE_DATA_SERIES || eType == ObjectType::OBJECTTYPE_DATA_POINT;
+}
+
void ChartAreaPanel::setFillTransparence(const XFillTransparenceItem& rItem)
{
PreventUpdate aProtector(mbUpdate);
@@ -314,7 +320,7 @@ void ChartAreaPanel::setFillTransparence(const XFillTransparenceItem& rItem)
if (!xPropSet.is())
return;
- xPropSet->setPropertyValue("FillTransparence", css::uno::Any(rItem.GetValue()));
+ xPropSet->setPropertyValue(u"FillTransparence"_ustr, css::uno::Any(rItem.GetValue()));
}
void ChartAreaPanel::setFillFloatTransparence(
@@ -327,7 +333,7 @@ void ChartAreaPanel::setFillFloatTransparence(
if (!rItem.IsEnabled())
{
- xPropSet->setPropertyValue("FillTransparenceGradientName", css::uno::Any(OUString()));
+ xPropSet->setPropertyValue(u"FillTransparenceGradientName"_ustr, css::uno::Any(OUString()));
return;
}
@@ -335,7 +341,7 @@ void ChartAreaPanel::setFillFloatTransparence(
css::uno::Any aGradientVal;
rItem.QueryValue(aGradientVal, MID_FILLGRADIENT);
OUString aNewName = PropertyHelper::addTransparencyGradientUniqueNameToTable(aGradientVal, mxModel, aName);
- xPropSet->setPropertyValue("FillTransparenceGradientName", css::uno::Any(aNewName));
+ xPropSet->setPropertyValue(u"FillTransparenceGradientName"_ustr, css::uno::Any(aNewName));
}
void ChartAreaPanel::setFillStyle(const XFillStyleItem& rItem)
@@ -345,7 +351,7 @@ void ChartAreaPanel::setFillStyle(const XFillStyleItem& rItem)
if (!xPropSet.is())
return;
- xPropSet->setPropertyValue("FillStyle", css::uno::Any(rItem.GetValue()));
+ xPropSet->setPropertyValue(u"FillStyle"_ustr, css::uno::Any(rItem.GetValue()));
}
void ChartAreaPanel::setFillStyleAndColor(const XFillStyleItem* pStyleItem,
@@ -356,8 +362,12 @@ void ChartAreaPanel::setFillStyleAndColor(const XFillStyleItem* pStyleItem,
return;
if (pStyleItem)
- xPropSet->setPropertyValue("FillStyle", css::uno::Any(pStyleItem->GetValue()));
- xPropSet->setPropertyValue("FillColor", css::uno::Any(rColorItem.GetValue()));
+ xPropSet->setPropertyValue(u"FillStyle"_ustr, css::uno::Any(pStyleItem->GetValue()));
+ xPropSet->setPropertyValue(u"FillColor"_ustr, css::uno::Any(rColorItem.GetValue()));
+ if (selectionIsDataSeries())
+ {
+ mxModel->clearColorPalette();
+ }
}
void ChartAreaPanel::setFillStyleAndGradient(const XFillStyleItem* pStyleItem,
@@ -369,13 +379,13 @@ void ChartAreaPanel::setFillStyleAndGradient(const XFillStyleItem* pStyleItem,
return;
if (pStyleItem)
- xPropSet->setPropertyValue("FillStyle", css::uno::Any(pStyleItem->GetValue()));
+ xPropSet->setPropertyValue(u"FillStyle"_ustr, css::uno::Any(pStyleItem->GetValue()));
const OUString& aName = rGradientItem.GetName();
css::uno::Any aGradientVal;
rGradientItem.QueryValue(aGradientVal, MID_FILLGRADIENT);
OUString aNewName = PropertyHelper::addGradientUniqueNameToTable(aGradientVal, mxModel, aName);
- xPropSet->setPropertyValue("FillGradientName", css::uno::Any(aNewName));
+ xPropSet->setPropertyValue(u"FillGradientName"_ustr, css::uno::Any(aNewName));
}
void ChartAreaPanel::setFillStyleAndHatch(const XFillStyleItem* pStyleItem,
@@ -387,8 +397,8 @@ void ChartAreaPanel::setFillStyleAndHatch(const XFillStyleItem* pStyleItem,
return;
if (pStyleItem)
- xPropSet->setPropertyValue("FillStyle", css::uno::Any(pStyleItem->GetValue()));
- xPropSet->setPropertyValue("FillHatchName", css::uno::Any(rHatchItem.GetValue()));
+ xPropSet->setPropertyValue(u"FillStyle"_ustr, css::uno::Any(pStyleItem->GetValue()));
+ xPropSet->setPropertyValue(u"FillHatchName"_ustr, css::uno::Any(rHatchItem.GetValue()));
}
void ChartAreaPanel::setFillStyleAndBitmap(const XFillStyleItem* pStyleItem,
@@ -400,13 +410,19 @@ void ChartAreaPanel::setFillStyleAndBitmap(const XFillStyleItem* pStyleItem,
return;
if (pStyleItem)
- xPropSet->setPropertyValue("FillStyle", css::uno::Any(pStyleItem->GetValue()));
+ xPropSet->setPropertyValue(u"FillStyle"_ustr, css::uno::Any(pStyleItem->GetValue()));
css::uno::Any aBitmap;
rBitmapItem.QueryValue(aBitmap, MID_BITMAP);
const OUString& aPreferredName = rBitmapItem.GetName();
aBitmap <<= PropertyHelper::addBitmapUniqueNameToTable(aBitmap, mxModel, aPreferredName);
- xPropSet->setPropertyValue("FillBitmapName", aBitmap);
+ xPropSet->setPropertyValue(u"FillBitmapName"_ustr, aBitmap);
+}
+
+void ChartAreaPanel::setFillUseBackground(const XFillStyleItem* pStyleItem,
+ const XFillUseSlideBackgroundItem& /*rItem*/)
+{
+ setFillStyle(*pStyleItem);
}
void ChartAreaPanel::updateData()
@@ -423,43 +439,43 @@ void ChartAreaPanel::updateData()
return;
SolarMutexGuard aGuard;
- if (xInfo->hasPropertyByName("FillStyle"))
+ if (xInfo->hasPropertyByName(u"FillStyle"_ustr))
{
css::drawing::FillStyle eFillStyle = css::drawing::FillStyle_SOLID;
- xPropSet->getPropertyValue("FillStyle") >>= eFillStyle;
+ xPropSet->getPropertyValue(u"FillStyle"_ustr) >>= eFillStyle;
XFillStyleItem aFillStyleItem(eFillStyle);
updateFillStyle(false, true, &aFillStyleItem);
}
- if (xInfo->hasPropertyByName("FillTransparence"))
+ if (xInfo->hasPropertyByName(u"FillTransparence"_ustr))
{
sal_uInt16 nFillTransparence = 0;
- xPropSet->getPropertyValue("FillTransparence") >>= nFillTransparence;
+ xPropSet->getPropertyValue(u"FillTransparence"_ustr) >>= nFillTransparence;
SfxUInt16Item aTransparenceItem(0, nFillTransparence);
updateFillTransparence(false, true, &aTransparenceItem);
}
- if (xInfo->hasPropertyByName("FillGradientName"))
+ if (xInfo->hasPropertyByName(u"FillGradientName"_ustr))
{
OUString aGradientName;
- xPropSet->getPropertyValue("FillGradientName") >>= aGradientName;
+ xPropSet->getPropertyValue(u"FillGradientName"_ustr) >>= aGradientName;
XFillGradientItem aGradientItem = getXGradientForName(mxModel, aGradientName);
updateFillGradient(false, true, &aGradientItem);
}
- if (xInfo->hasPropertyByName("FillHatchName"))
+ if (xInfo->hasPropertyByName(u"FillHatchName"_ustr))
{
OUString aHatchName;
- xPropSet->getPropertyValue("FillHatchName") >>= aHatchName;
+ xPropSet->getPropertyValue(u"FillHatchName"_ustr) >>= aHatchName;
XHatch aHatch = getXHatchFromName(mxModel, aHatchName);
XFillHatchItem aHatchItem(aHatchName, aHatch);
updateFillHatch(false, true, &aHatchItem);
}
- if (xInfo->hasPropertyByName("FillBitmapName"))
+ if (xInfo->hasPropertyByName(u"FillBitmapName"_ustr))
{
OUString aBitmapName;
- xPropSet->getPropertyValue("FillBitmapName") >>= aBitmapName;
+ xPropSet->getPropertyValue(u"FillBitmapName"_ustr) >>= aBitmapName;
GraphicObject aBitmap = getXBitmapFromName(mxModel, aBitmapName);
XFillBitmapItem aBitmapItem(aBitmapName, aBitmap);
std::unique_ptr<XFillBitmapItem> pBitmapItem;
@@ -468,7 +484,7 @@ void ChartAreaPanel::updateData()
DrawModelWrapper* pModelWrapper = getDrawModelWrapper(mxModel);
if (pModelWrapper)
{
- pBitmapItem = aBitmapItem.checkForUniqueItem(&pModelWrapper->getSdrModel());
+ pBitmapItem = aBitmapItem.checkForUniqueItem(pModelWrapper->getSdrModel());
}
}
catch (...)
@@ -477,21 +493,21 @@ void ChartAreaPanel::updateData()
updateFillBitmap(false, true, pBitmapItem ? pBitmapItem.get() : &aBitmapItem);
}
- if (xInfo->hasPropertyByName("FillTransparenceGradientName"))
+ if (xInfo->hasPropertyByName(u"FillTransparenceGradientName"_ustr))
{
OUString aFillFloatTransparenceName;
- xPropSet->getPropertyValue("FillTransparenceGradientName") >>= aFillFloatTransparenceName;
+ xPropSet->getPropertyValue(u"FillTransparenceGradientName"_ustr) >>= aFillFloatTransparenceName;
XFillFloatTransparenceItem aFillFloatTransparenceItem = getXTransparencyGradientForName(mxModel, aFillFloatTransparenceName);
updateFillFloatTransparence(false, true, &aFillFloatTransparenceItem);
maFillColorWrapper.updateData();
}
- if (xInfo->hasPropertyByName("FillColor"))
+ if (xInfo->hasPropertyByName(u"FillColor"_ustr))
{
sal_uInt32 nFillColor = 0;
- xPropSet->getPropertyValue("FillColor") >>= nFillColor;
- XFillColorItem aFillColorItem("", Color(ColorTransparency, nFillColor));
+ xPropSet->getPropertyValue(u"FillColor"_ustr) >>= nFillColor;
+ XFillColorItem aFillColorItem(u""_ustr, Color(ColorTransparency, nFillColor));
updateFillColor(true, &aFillColorItem);
}
}
@@ -507,7 +523,7 @@ void ChartAreaPanel::selectionChanged(bool bCorrectType)
updateData();
}
-void ChartAreaPanel::doUpdateModel(rtl::Reference<::chart::ChartModel> xModel)
+void ChartAreaPanel::doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel)
{
if (mbModelValid)
{
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.hxx b/chart2/source/controller/sidebar/ChartAreaPanel.hxx
index 132513412518..24f0d85912b1 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.hxx
@@ -57,6 +57,7 @@ public:
virtual void setFillStyleAndGradient(const XFillStyleItem* pStyleItem, const XFillGradientItem& rGradientItem) override;
virtual void setFillStyleAndHatch(const XFillStyleItem* pStyleItem, const XFillHatchItem& rHatchItem) override;
virtual void setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& rBitmapItem) override;
+ virtual void setFillUseBackground(const XFillStyleItem* pStyleItem, const XFillUseSlideBackgroundItem& rItem) override;
virtual void updateData() override;
virtual void modelInvalid() override;
@@ -72,7 +73,8 @@ private:
rtl::Reference<ChartSidebarSelectionListener> mxSelectionListener;
void Initialize();
- void doUpdateModel(rtl::Reference<::chart::ChartModel> xModel);
+ void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
+ bool selectionIsDataSeries() const;
bool mbUpdate;
bool mbModelValid;
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
index 2b6bc5535b27..7554d164f11f 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
@@ -17,11 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart2/AxisOrientation.hpp>
-#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <vcl/svapp.hxx>
#include <sal/log.hxx>
@@ -29,6 +26,7 @@
#include "ChartAxisPanel.hxx"
#include <ChartController.hxx>
#include <ChartModel.hxx>
+#include <Axis.hxx>
using namespace css;
using namespace css::uno;
@@ -38,15 +36,14 @@ namespace chart::sidebar {
namespace {
bool isLabelShown(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return false;
- uno::Any aAny = xAxis->getPropertyValue("DisplayLabels");
+ uno::Any aAny = xAxis->getPropertyValue(u"DisplayLabels"_ustr);
if (!aAny.hasValue())
return false;
@@ -56,15 +53,14 @@ bool isLabelShown(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setLabelShown(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, bool bVisible)
+ std::u16string_view rCID, bool bVisible)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return;
- xAxis->setPropertyValue("DisplayLabels", css::uno::Any(bVisible));
+ xAxis->setPropertyValue(u"DisplayLabels"_ustr, css::uno::Any(bVisible));
}
struct AxisLabelPosMap
@@ -81,15 +77,14 @@ AxisLabelPosMap const aLabelPosMap[] = {
};
sal_Int32 getLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return 0;
- uno::Any aAny = xAxis->getPropertyValue("LabelPosition");
+ uno::Any aAny = xAxis->getPropertyValue(u"LabelPosition"_ustr);
if (!aAny.hasValue())
return 0;
@@ -105,10 +100,9 @@ sal_Int32 getLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, sal_Int32 nPos)
+ std::u16string_view rCID, sal_Int32 nPos)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return;
@@ -120,13 +114,13 @@ void setLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel,
ePos = i.ePos;
}
- xAxis->setPropertyValue("LabelPosition", css::uno::Any(ePos));
+ xAxis->setPropertyValue(u"LabelPosition"_ustr, css::uno::Any(ePos));
}
bool isReverse(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::chart2::XAxis > xAxis =
+ rtl::Reference< Axis > xAxis =
ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
@@ -138,9 +132,9 @@ bool isReverse(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setReverse(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, bool bReverse)
+ std::u16string_view rCID, bool bReverse)
{
- css::uno::Reference< css::chart2::XAxis > xAxis =
+ rtl::Reference< Axis > xAxis =
ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
@@ -176,27 +170,27 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
}
void setAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, double nVal)
+ std::u16string_view rCID, double nVal)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis =
+ ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return;
- xAxis->setPropertyValue("TextRotation", css::uno::Any(nVal));
+ xAxis->setPropertyValue(u"TextRotation"_ustr, css::uno::Any(nVal));
}
double getAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis =
+ ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return 0;
- css::uno::Any aAny = xAxis->getPropertyValue("TextRotation");
+ css::uno::Any aAny = xAxis->getPropertyValue(u"TextRotation"_ustr);
double nVal = 0;
aAny >>= nVal;
return nVal;
@@ -207,12 +201,12 @@ double getAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel,
ChartAxisPanel::ChartAxisPanel(
weld::Widget* pParent,
ChartController* pController)
- : PanelLayout(pParent, "ChartAxisPanel", "modules/schart/ui/sidebaraxis.ui")
- , mxCBShowLabel(m_xBuilder->weld_check_button("checkbutton_show_label"))
- , mxCBReverse(m_xBuilder->weld_check_button("checkbutton_reverse"))
- , mxLBLabelPos(m_xBuilder->weld_combo_box("comboboxtext_label_position"))
- , mxGridLabel(m_xBuilder->weld_widget("label_props"))
- , mxNFRotation(m_xBuilder->weld_metric_spin_button("spinbutton1", FieldUnit::DEGREE))
+ : PanelLayout(pParent, u"ChartAxisPanel"_ustr, u"modules/schart/ui/sidebaraxis.ui"_ustr)
+ , mxCBShowLabel(m_xBuilder->weld_check_button(u"checkbutton_show_label"_ustr))
+ , mxCBReverse(m_xBuilder->weld_check_button(u"checkbutton_reverse"_ustr))
+ , mxLBLabelPos(m_xBuilder->weld_combo_box(u"comboboxtext_label_position"_ustr))
+ , mxGridLabel(m_xBuilder->weld_widget(u"label_props"_ustr))
+ , mxNFRotation(m_xBuilder->weld_metric_spin_button(u"spinbutton1"_ustr, FieldUnit::DEGREE))
, mxModel(pController->getChartModel())
, mxModifyListener(new ChartSidebarModifyListener(this))
, mxSelectionListener(new ChartSidebarSelectionListener(this, OBJECTTYPE_AXIS))
@@ -278,7 +272,7 @@ std::unique_ptr<PanelLayout> ChartAxisPanel::Create (
ChartController* pController)
{
if (pParent == nullptr)
- throw lang::IllegalArgumentException("no parent Window given to ChartAxisPanel::Create", nullptr, 0);
+ throw lang::IllegalArgumentException(u"no parent Window given to ChartAxisPanel::Create"_ustr, nullptr, 0);
return std::make_unique<ChartAxisPanel>(pParent, pController);
}
@@ -306,7 +300,7 @@ void ChartAxisPanel::modelInvalid()
mbModelValid = false;
}
-void ChartAxisPanel::doUpdateModel(rtl::Reference<::chart::ChartModel> xModel)
+void ChartAxisPanel::doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel)
{
if (mbModelValid)
{
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.hxx b/chart2/source/controller/sidebar/ChartAxisPanel.hxx
index 32f3c0b3331e..e5ed4b5ebcc6 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.hxx
@@ -81,7 +81,7 @@ private:
bool mbModelValid;
void Initialize();
- void doUpdateModel(rtl::Reference<::chart::ChartModel> xModel);
+ void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
DECL_LINK(ListBoxHdl, weld::ComboBox&, void);
diff --git a/chart2/source/controller/sidebar/ChartColorPaletteControl.cxx b/chart2/source/controller/sidebar/ChartColorPaletteControl.cxx
new file mode 100644
index 000000000000..74a6c13d3f7b
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartColorPaletteControl.cxx
@@ -0,0 +1,353 @@
+/* -*- 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 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 .
+ */
+
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+#include <memory>
+#include <utility>
+#include <vcl/svapp.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/virdev.hxx>
+
+#include <ChartColorPaletteHelper.hxx>
+#include "ChartColorPaletteControl.hxx"
+
+#include <vcl/gdimtf.hxx>
+#include <vcl/graph.hxx>
+
+using namespace css;
+
+namespace chart::sidebar
+{
+constexpr tools::Long BORDER = ChartColorPaletteLayout::ItemBorder;
+constexpr tools::Long SIZE = ChartColorPaletteLayout::ItemSize;
+constexpr tools::Long constElementNumber = ChartColorPaletteSize;
+
+ChartColorPaletteControl::ChartColorPaletteControl(
+ const uno::Reference<uno::XComponentContext>& rContext)
+ : PopupWindowController(rContext, nullptr, OUString())
+ , meColorPaletteType(ChartColorPaletteType::Unknown)
+ , mnColorPaletteIndex(0)
+{
+}
+
+ChartColorPaletteControl::~ChartColorPaletteControl() = default;
+
+void ChartColorPaletteControl::initialize(const uno::Sequence<uno::Any>& rArguments)
+{
+ svt::PopupWindowController::initialize(rArguments);
+
+ if (m_pToolbar)
+ {
+ mxPopoverContainer = std::make_unique<ToolbarPopupContainer>(m_pToolbar);
+ m_pToolbar->set_item_popover(m_aCommandURL, mxPopoverContainer->getTopLevel());
+ m_pToolbar->set_item_sensitive(m_aCommandURL, true);
+ }
+
+ ToolBox* pToolBox = nullptr;
+ ToolBoxItemId nId;
+ if (getToolboxId(nId, &pToolBox))
+ {
+ pToolBox->SetItemBits(nId, pToolBox->GetItemBits(nId) | ToolBoxItemBits::DROPDOWNONLY);
+ pToolBox->EnableItem(nId, true);
+ }
+}
+
+void ChartColorPaletteControl::execute(sal_Int16 /*nKeyModifier*/)
+{
+ if (m_pToolbar)
+ {
+ // Toggle the popup also when toolbutton is activated
+ m_pToolbar->set_menu_item_active(m_aCommandURL,
+ !m_pToolbar->get_menu_item_active(m_aCommandURL));
+ }
+ else
+ {
+ // Open the popup also when Enter key is pressed.
+ createPopupWindow();
+ }
+}
+
+void ChartColorPaletteControl::statusChanged(const frame::FeatureStateEvent& rEvent)
+{
+ ToolBox* pToolBox = nullptr;
+ ToolBoxItemId nId;
+ if (!getToolboxId(nId, &pToolBox) && !m_pToolbar)
+ return;
+
+ if (rEvent.FeatureURL.Complete == m_aCommandURL)
+ {
+ updateStatus();
+ }
+}
+
+void ChartColorPaletteControl::updateStatus(bool bForce)
+{
+ if (!mpHandler)
+ return;
+
+ if (bForce || meColorPaletteType != getColorPaletteType()
+ || mnColorPaletteIndex != getColorPaletteIndex())
+ {
+ meColorPaletteType = getColorPaletteType();
+ mnColorPaletteIndex = getColorPaletteIndex();
+
+ ToolBox* pToolBox = nullptr;
+ ToolBoxItemId nId;
+ if (!getToolboxId(nId, &pToolBox) && !m_pToolbar)
+ return;
+
+ auto pDev = VclPtr<VirtualDevice>::Create();
+ renderSelectedColorPalette(pDev);
+ auto aSelItemImg(pDev->GetBitmapEx(Point(), pDev->GetOutputSizePixel()));
+ if (m_pToolbar)
+ {
+ m_pToolbar->set_item_image(m_aCommandURL, Graphic(aSelItemImg).GetXGraphic());
+ }
+ else
+ {
+ pToolBox->SetItemImage(nId, Image(aSelItemImg));
+ }
+ }
+}
+
+void ChartColorPaletteControl::renderSelectedColorPalette(const VclPtr<VirtualDevice>& pDev) const
+{
+ if (!pDev)
+ return;
+
+ const auto pHelper = getColorPaletteHelper();
+ if (!pHelper)
+ return;
+
+ static constexpr Point aPosition(0, 0);
+ static constexpr Size aSize
+ = { BORDER * 6 + SIZE * constElementNumber / 2, BORDER * 5 + SIZE * 2 };
+ static constexpr tools::Rectangle aDrawArea(aPosition, aSize);
+
+ pDev->SetOutputSizePixel(aSize, /*bErase*/ true, /*bAlphaMaskTransparent*/ true);
+
+ if (getColorPaletteType() == ChartColorPaletteType::Unknown)
+ {
+ ChartColorPaletteHelper::renderNoPalette(pDev, aDrawArea);
+ return;
+ }
+
+ const ChartColorPalette aColorPalette
+ = pHelper->getColorPalette(getColorPaletteType(), getColorPaletteIndex());
+ ChartColorPaletteHelper::renderColorPalette(pDev, aDrawArea, aColorPalette, true);
+}
+
+void ChartColorPaletteControl::setColorPaletteHandler(
+ const std::shared_ptr<IColorPaletteHandler>& rColorPaletteHandler)
+{
+ if (!mpHandler)
+ {
+ mpHandler = rColorPaletteHandler;
+ updateStatus(true);
+ }
+}
+
+std::shared_ptr<ChartColorPaletteHelper> ChartColorPaletteControl::getColorPaletteHelper() const
+{
+ if (mpHandler)
+ return mpHandler->getHelper();
+ return nullptr;
+}
+
+ChartColorPaletteType ChartColorPaletteControl::getColorPaletteType() const
+{
+ if (mpHandler)
+ return mpHandler->getType();
+ return ChartColorPaletteType::Unknown;
+}
+
+sal_uInt32 ChartColorPaletteControl::getColorPaletteIndex() const
+{
+ if (mpHandler)
+ return mpHandler->getIndex();
+ return 0;
+}
+
+void ChartColorPaletteControl::dispatchColorPaletteCommand(const ChartColorPaletteType eType,
+ const sal_uInt32 nIndex) const
+{
+ if (mpHandler)
+ mpHandler->select(eType, nIndex);
+}
+
+void ChartColorPaletteControl::applyColorPalette(const ChartColorPalette* pColorPalette) const
+{
+ if (mpHandler)
+ mpHandler->apply(pColorPalette);
+}
+
+std::unique_ptr<WeldToolbarPopup> ChartColorPaletteControl::weldPopupWindow()
+{
+ return std::make_unique<ChartColorPalettePopup>(this, m_pToolbar);
+}
+
+VclPtr<vcl::Window> ChartColorPaletteControl::createVclPopupWindow(vcl::Window* pParent)
+{
+ mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(
+ getFrameInterface(), pParent,
+ std::make_unique<ChartColorPalettePopup>(this, pParent->GetFrameWeld()));
+
+ mxInterimPopover->Show();
+
+ return mxInterimPopover;
+}
+
+OUString ChartColorPaletteControl::getImplementationName()
+{
+ return "com.sun.star.comp.chart2.ChartColorPaletteControl";
+}
+
+uno::Sequence<OUString> ChartColorPaletteControl::getSupportedServiceNames()
+{
+ return { "com.sun.star.frame.ToolbarController" };
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_chart2_ChartColorPaletteControl_get_implementation(
+ uno::XComponentContext* rContext, uno::Sequence<uno::Any> const&)
+{
+ return cppu::acquire(new ChartColorPaletteControl(rContext));
+}
+
+ChartColorPalettePopup::ChartColorPalettePopup(ChartColorPaletteControl* pControl,
+ weld::Widget* pParent)
+ : WeldToolbarPopup(pControl->getFrameInterface(), pParent,
+ "modules/schart/ui/chartcolorpalettepopup.ui", "ColorPaletteWindow")
+ , mxControl(pControl)
+ , mxColorfulValueSet(new ChartColorPalettes)
+ , mxColorfulValueSetWin(
+ new weld::CustomWeld(*m_xBuilder, "colorful_palettes", *mxColorfulValueSet))
+ , mxMonoValueSet(new ChartColorPalettes)
+ , mxMonoValueSetWin(
+ new weld::CustomWeld(*m_xBuilder, "monochromatic_palettes", *mxMonoValueSet))
+{
+ mxColorfulValueSet->SetColCount(2);
+ mxColorfulValueSet->SetLineCount(2);
+ mxColorfulValueSet->SetColor(Application::GetSettings().GetStyleSettings().GetFaceColor());
+
+ mxMonoValueSet->SetColCount(2);
+ mxMonoValueSet->SetLineCount(3);
+ mxMonoValueSet->SetColor(Application::GetSettings().GetStyleSettings().GetFaceColor());
+
+ initColorPalettes();
+
+ mxColorfulValueSet->SetOptimalSize();
+ mxColorfulValueSet->SetSelectHdl(LINK(this, ChartColorPalettePopup, SelectColorfulValueSetHdl));
+
+ mxMonoValueSet->SetOptimalSize();
+ mxMonoValueSet->SetSelectHdl(LINK(this, ChartColorPalettePopup, SelectMonoValueSetHdl));
+
+ selectItem(mxControl->getColorPaletteType(), mxControl->getColorPaletteIndex() + 1);
+}
+
+ChartColorPalettePopup::~ChartColorPalettePopup() {}
+
+void ChartColorPalettePopup::selectItem(const ChartColorPaletteType eType,
+ const sal_uInt32 nIndex) const
+{
+ switch (eType)
+ {
+ default:
+ case ChartColorPaletteType::Unknown:
+ mxColorfulValueSet->SetNoSelection();
+ mxMonoValueSet->SetNoSelection();
+ break;
+ case ChartColorPaletteType::Colorful:
+ mxColorfulValueSet->SelectItem(nIndex);
+ break;
+ case ChartColorPaletteType::Monochromatic:
+ mxMonoValueSet->SelectItem(nIndex);
+ break;
+ }
+}
+
+void ChartColorPalettePopup::initColorPalettes() const
+{
+ const auto pColorPaletteHelper = mxControl->getColorPaletteHelper();
+ if (!pColorPaletteHelper)
+ return;
+ // colorful palettes
+ for (size_t i = 0; i < ChartColorPaletteHelper::ColorfulPaletteSize; ++i)
+ mxColorfulValueSet->insert(
+ pColorPaletteHelper->getColorPalette(ChartColorPaletteType::Colorful, i));
+ // monotonic palettes
+ for (size_t i = 0; i < ChartColorPaletteHelper::MonotonicPaletteSize; ++i)
+ mxMonoValueSet->insert(
+ pColorPaletteHelper->getColorPalette(ChartColorPaletteType::Monochromatic, i));
+}
+
+void ChartColorPalettePopup::GrabFocus()
+{
+ if (mxMonoValueSet->IsNoSelection())
+ mxColorfulValueSet->GrabFocus();
+ else
+ mxMonoValueSet->GrabFocus();
+}
+
+IMPL_LINK_NOARG(ChartColorPalettePopup, SelectColorfulValueSetHdl, ValueSet*, void)
+{
+ sal_uInt32 nIndex = SelectValueSetHdl(mxColorfulValueSet);
+ if (nIndex != static_cast<sal_uInt32>(-1))
+ {
+ mxControl->dispatchColorPaletteCommand(ChartColorPaletteType::Colorful, nIndex);
+ mxMonoValueSet->SetNoSelection();
+ mxControl->updateStatus();
+ }
+ mxControl->EndPopupMode();
+}
+
+IMPL_LINK_NOARG(ChartColorPalettePopup, SelectMonoValueSetHdl, ValueSet*, void)
+{
+ sal_uInt32 nIndex = SelectValueSetHdl(mxMonoValueSet);
+ if (nIndex != static_cast<sal_uInt32>(-1))
+ {
+ mxControl->dispatchColorPaletteCommand(ChartColorPaletteType::Monochromatic, nIndex);
+ mxColorfulValueSet->SetNoSelection();
+ mxControl->updateStatus();
+ }
+ mxControl->EndPopupMode();
+}
+
+sal_uInt32 ChartColorPalettePopup::SelectValueSetHdl(
+ const std::unique_ptr<ChartColorPalettes>& xValueSet) const
+{
+ const sal_uInt32 nItemId = xValueSet->GetSelectedItemId();
+
+ if (!nItemId)
+ return static_cast<sal_uInt32>(-1);
+
+ const sal_uInt32 nIndex = nItemId - 1;
+
+ if (const ChartColorPalette* pPalette = xValueSet->getPalette(nIndex))
+ {
+ mxControl->applyColorPalette(pPalette);
+ return nIndex;
+ }
+ return static_cast<sal_uInt32>(-1);
+}
+
+} // end namespace chart::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartColorPaletteControl.hxx b/chart2/source/controller/sidebar/ChartColorPaletteControl.hxx
new file mode 100644
index 000000000000..3ba66a1e72ec
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartColorPaletteControl.hxx
@@ -0,0 +1,94 @@
+/* -*- 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 <svtools/popupwindowcontroller.hxx>
+#include <svtools/toolbarmenu.hxx>
+#include <ChartColorPalettes.hxx>
+
+namespace chart
+{
+class ChartColorPaletteHelper;
+
+namespace sidebar
+{
+struct IColorPaletteHandler
+{
+ virtual ~IColorPaletteHandler() = default;
+ virtual void select(ChartColorPaletteType eType, sal_uInt32 nIndex) = 0;
+ virtual void apply(const ChartColorPalette* pColorPalette) = 0;
+ [[nodiscard]] virtual std::shared_ptr<ChartColorPaletteHelper> getHelper() const = 0;
+ [[nodiscard]] virtual ChartColorPaletteType getType() const = 0;
+ [[nodiscard]] virtual sal_uInt32 getIndex() const = 0;
+};
+
+class ChartColorPaletteControl final : public svt::PopupWindowController
+{
+ std::shared_ptr<IColorPaletteHandler> mpHandler;
+ ChartColorPaletteType meColorPaletteType;
+ sal_uInt32 mnColorPaletteIndex;
+
+public:
+ explicit ChartColorPaletteControl(
+ const css::uno::Reference<css::uno::XComponentContext>& rContext);
+
+ // XInitialization
+ void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ void SAL_CALL execute(sal_Int16 nKeyModifier) override;
+ void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override;
+
+ ~ChartColorPaletteControl() override;
+
+ void setColorPaletteHandler(const std::shared_ptr<IColorPaletteHandler>& rColorPaletteHandler);
+ std::shared_ptr<ChartColorPaletteHelper> getColorPaletteHelper() const;
+ ChartColorPaletteType getColorPaletteType() const;
+ sal_uInt32 getColorPaletteIndex() const;
+ void dispatchColorPaletteCommand(ChartColorPaletteType eType, sal_uInt32 nIndex) const;
+ void applyColorPalette(const ChartColorPalette* pColorPalette) const;
+ void updateStatus(bool bForce = false);
+
+private:
+ std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
+ VclPtr<vcl::Window> createVclPopupWindow(vcl::Window* pParent) override;
+
+ void renderSelectedColorPalette(const VclPtr<VirtualDevice>& pDev) const;
+};
+
+class ChartColorPalettePopup final : public WeldToolbarPopup
+{
+ rtl::Reference<ChartColorPaletteControl> mxControl;
+ std::unique_ptr<ChartColorPalettes> mxColorfulValueSet;
+ std::unique_ptr<weld::CustomWeld> mxColorfulValueSetWin;
+ std::unique_ptr<ChartColorPalettes> mxMonoValueSet;
+ std::unique_ptr<weld::CustomWeld> mxMonoValueSetWin;
+
+ DECL_LINK(SelectColorfulValueSetHdl, ValueSet*, void);
+ DECL_LINK(SelectMonoValueSetHdl, ValueSet*, void);
+ sal_uInt32 SelectValueSetHdl(const std::unique_ptr<ChartColorPalettes>& xValueSet) const;
+
+ void GrabFocus() override;
+
+ void selectItem(ChartColorPaletteType eType, sal_uInt32 nIndex) const;
+ void initColorPalettes() const;
+
+public:
+ ChartColorPalettePopup(ChartColorPaletteControl* pControl, weld::Widget* pParent);
+ ~ChartColorPalettePopup() override;
+};
+} // end namespace sidebar
+} // end namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index ed94c0b0fa45..f706f763e737 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -30,6 +30,7 @@
#include <comphelper/lok.hxx>
#include <sal/log.hxx>
#include <sfx2/viewsh.hxx>
+#include <utility>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
namespace chart::sidebar {
@@ -38,6 +39,9 @@ namespace {
OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
{
+ if (!xModel.is())
+ return OUString();
+
css::uno::Reference<css::frame::XController> xController(xModel->getCurrentController());
css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(xController, css::uno::UNO_QUERY);
if (!xSelectionSupplier.is())
@@ -77,16 +81,16 @@ css::uno::Reference<css::beans::XPropertySet> getPropSet(
}
ChartColorWrapper::ChartColorWrapper(
- rtl::Reference<::chart::ChartModel> const & xModel,
+ rtl::Reference<::chart::ChartModel> xModel,
SvxColorToolBoxControl* pControl,
- const OUString& rName):
- mxModel(xModel),
+ OUString aName):
+ mxModel(std::move(xModel)),
mpControl(pControl),
- maPropertyName(rName)
+ maPropertyName(std::move(aName))
{
}
-void ChartColorWrapper::operator()([[maybe_unused]] const OUString& , const svx::NamedThemedColor& rColor)
+void ChartColorWrapper::operator()([[maybe_unused]] const OUString& , const NamedColor& rColor)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel);
@@ -96,7 +100,12 @@ void ChartColorWrapper::operator()([[maybe_unused]] const OUString& , const svx:
return;
}
- xPropSet->setPropertyValue(maPropertyName, css::uno::makeAny(rColor.m_aColor));
+ xPropSet->setPropertyValue(maPropertyName, css::uno::Any(rColor.m_aColor));
+
+ OUString aCID = getCID(mxModel);
+ ObjectType eType = ObjectIdentifier::getObjectType(aCID);
+ if (eType == OBJECTTYPE_DATA_SERIES || eType == OBJECTTYPE_DATA_POINT)
+ mxModel->clearColorPalette();
}
void ChartColorWrapper::updateModel(const rtl::Reference<::chart::ChartModel>& xModel)
@@ -106,7 +115,7 @@ void ChartColorWrapper::updateModel(const rtl::Reference<::chart::ChartModel>& x
void ChartColorWrapper::updateData()
{
- static constexpr OUStringLiteral aLineColor = u"LineColor";
+ static constexpr OUString aLineColor = u"LineColor"_ustr;
static const std::u16string_view aCommands[2] = {u".uno:XLineColor", u".uno:FillColor"};
css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel);
@@ -125,18 +134,18 @@ void ChartColorWrapper::updateData()
SfxViewShell* pViewShell = SfxViewShell::Current();
if (comphelper::LibreOfficeKit::isActive() && pViewShell && (maPropertyName == aLineColor))
{
- std::string sCommand = OUStringToOString(aUrl.Complete, RTL_TEXTENCODING_ASCII_US).getStr();
+ OString sCommand = OUStringToOString(aUrl.Complete, RTL_TEXTENCODING_ASCII_US);
sal_Int32 nColor = -1;
aEvent.State >>= nColor;
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
- (sCommand + "=" + std::to_string(nColor)).c_str());
+ sCommand + "=" + OString::number(nColor));
}
}
ChartLineStyleWrapper::ChartLineStyleWrapper(
- rtl::Reference<::chart::ChartModel> const & xModel,
+ rtl::Reference<::chart::ChartModel> xModel,
SvxLineStyleToolBoxControl* pControl)
- : mxModel(xModel)
+ : mxModel(std::move(xModel))
, mpControl(pControl)
{
}
@@ -153,7 +162,7 @@ namespace
{
css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xModel, css::uno::UNO_QUERY);
css::uno::Reference<css::container::XNameAccess> xNameAccess(
- xFact->createInstance("com.sun.star.drawing.DashTable"),
+ xFact->createInstance(u"com.sun.star.drawing.DashTable"_ustr),
css::uno::UNO_QUERY );
if(xNameAccess.is())
{
@@ -180,19 +189,19 @@ void ChartLineStyleWrapper::updateData()
aEvent.IsEnabled = true;
aEvent.FeatureURL = aUrl;
- aEvent.State = xPropSet->getPropertyValue("LineStyle");
+ aEvent.State = xPropSet->getPropertyValue(u"LineStyle"_ustr);
mpControl->statusChanged(aEvent);
aUrl.Complete = ".uno:LineDash";
- auto aLineDashName = xPropSet->getPropertyValue("LineDashName");
+ auto aLineDashName = xPropSet->getPropertyValue(u"LineDashName"_ustr);
OUString aDashName;
aLineDashName >>= aDashName;
css::uno::Any aLineDash = getLineDash(mxModel, aDashName);
XLineDashItem aDashItem;
aDashItem.PutValue(aLineDash, MID_LINEDASH);
- aEvent.FeatureURL = aUrl;
+ aEvent.FeatureURL = std::move(aUrl);
aDashItem.QueryValue(aEvent.State);
mpControl->statusChanged(aEvent);
}
@@ -209,7 +218,7 @@ bool ChartLineStyleWrapper::operator()(std::u16string_view rCommand, const css::
if (rCommand == u".uno:XLineStyle")
{
- xPropSet->setPropertyValue("LineStyle", rValue);
+ xPropSet->setPropertyValue(u"LineStyle"_ustr, rValue);
return true;
}
else if (rCommand == u".uno:LineDash")
@@ -220,9 +229,9 @@ bool ChartLineStyleWrapper::operator()(std::u16string_view rCommand, const css::
aDashItem.QueryValue(aAny, MID_LINEDASH);
OUString aDashName = PropertyHelper::addLineDashUniqueNameToTable(aAny,
mxModel,
- "");
- xPropSet->setPropertyValue("LineDash", aAny);
- xPropSet->setPropertyValue("LineDashName", css::uno::Any(aDashName));
+ u""_ustr);
+ xPropSet->setPropertyValue(u"LineDash"_ustr, aAny);
+ xPropSet->setPropertyValue(u"LineDashName"_ustr, css::uno::Any(aDashName));
return true;
}
return false;
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.hxx b/chart2/source/controller/sidebar/ChartColorWrapper.hxx
index 861f1e1628ea..6405e694b475 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.hxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.hxx
@@ -9,12 +9,11 @@
#pragma once
-#include <com/sun/star/uno/Reference.hxx>
-#include <svx/Palette.hxx>
+#include <ChartModel.hxx>
+
+#include <sfx2/namedcolor.hxx>
#include <rtl/ref.hxx>
-namespace com::sun::star::frame { class XModel; }
-namespace chart { class ChartModel; }
class SvxColorToolBoxControl;
class SvxLineStyleToolBoxControl;
@@ -23,11 +22,11 @@ namespace chart::sidebar {
class ChartColorWrapper
{
public:
- ChartColorWrapper(rtl::Reference<::chart::ChartModel> const & xModel,
+ ChartColorWrapper(rtl::Reference<::chart::ChartModel> xModel,
SvxColorToolBoxControl* pControl,
- const OUString& rPropertyName);
+ OUString rPropertyName);
- void operator()(const OUString& rCommand, const svx::NamedThemedColor& rColor);
+ void operator()(const OUString& rCommand, const NamedColor& rColor);
// ColorSelectFunction signature
void updateModel(const rtl::Reference<::chart::ChartModel>& xModel);
@@ -46,7 +45,7 @@ private:
class ChartLineStyleWrapper
{
public:
- ChartLineStyleWrapper(rtl::Reference<::chart::ChartModel> const & xModel,
+ ChartLineStyleWrapper(rtl::Reference<::chart::ChartModel> xModel,
SvxLineStyleToolBoxControl* pControl);
bool operator()(std::u16string_view rCommand, const css::uno::Any& rValue);
diff --git a/chart2/source/controller/sidebar/ChartColorsPanel.cxx b/chart2/source/controller/sidebar/ChartColorsPanel.cxx
new file mode 100644
index 000000000000..259365a28adb
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartColorsPanel.cxx
@@ -0,0 +1,310 @@
+/* -*- 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 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 .
+ */
+
+#include <sal/log.hxx>
+#include <vcl/svapp.hxx>
+
+#include "ChartColorsPanel.hxx"
+#include "ChartColorPaletteControl.hxx"
+
+#include <ChartColorPaletteHelper.hxx>
+#include <ChartController.hxx>
+#include <ChartModel.hxx>
+#include <DataSeries.hxx>
+
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+#include <sfx2/weldutils.hxx>
+#include <svtools/toolbarmenu.hxx>
+
+#include <algorithm>
+
+using namespace css;
+
+namespace chart::sidebar
+{
+namespace
+{
+OUString getCID(const uno::Reference<frame::XModel>& xModel)
+{
+ const uno::Reference<frame::XController> xController(xModel->getCurrentController());
+ uno::Reference<view::XSelectionSupplier> xSelectionSupplier(xController, uno::UNO_QUERY);
+ if (!xSelectionSupplier.is())
+ return {};
+
+ uno::Any aAny = xSelectionSupplier->getSelection();
+ if (!aAny.hasValue())
+ {
+ // if no selection, default to diagram wall so sidebar can show some editable properties
+ if (auto* pController = dynamic_cast<ChartController*>(xController.get()))
+ {
+ pController->select(
+ uno::Any(ObjectIdentifier::createClassifiedIdentifier(OBJECTTYPE_PAGE, u"")));
+ xSelectionSupplier
+ = uno::Reference<css::view::XSelectionSupplier>(xController, uno::UNO_QUERY);
+ if (xSelectionSupplier.is())
+ aAny = xSelectionSupplier->getSelection();
+ }
+
+ if (!aAny.hasValue())
+ return {};
+ }
+
+ OUString aCID;
+ aAny >>= aCID;
+ return aCID;
+}
+
+ChartColorPaletteControl* getChartColorPaletteControl(const ToolbarUnoDispatcher& rToolBoxColor)
+{
+ const uno::Reference<frame::XToolbarController> xController
+ = rToolBoxColor.GetControllerForCommand(sUnoChartColorPalette);
+ const auto pToolBoxLineStyleControl
+ = dynamic_cast<ChartColorPaletteControl*>(xController.get());
+ return pToolBoxLineStyleControl;
+}
+} // end unnamed namespace
+
+class ColorPaletteWrapper final : public IColorPaletteHandler
+{
+public:
+ ColorPaletteWrapper(rtl::Reference<ChartModel> mxModel, ChartColorPaletteControl* pControl);
+
+ void updateModel(const rtl::Reference<ChartModel>& xModel);
+ void updateData() const;
+
+ void select(ChartColorPaletteType eType, sal_uInt32 nIndex) override;
+ void apply(const ChartColorPalette* pColorPalette) override;
+ [[nodiscard]] std::shared_ptr<ChartColorPaletteHelper> getHelper() const override;
+ [[nodiscard]] ChartColorPaletteType getType() const override;
+ [[nodiscard]] sal_uInt32 getIndex() const override;
+
+private:
+ rtl::Reference<ChartModel> mxModel;
+ ChartColorPaletteControl* mpControl;
+};
+
+ColorPaletteWrapper::ColorPaletteWrapper(rtl::Reference<ChartModel> xModel,
+ ChartColorPaletteControl* pControl)
+ : mxModel(std::move(xModel))
+ , mpControl(pControl)
+{
+}
+
+void ColorPaletteWrapper::updateModel(const rtl::Reference<ChartModel>& xModel)
+{
+ mxModel = xModel;
+}
+
+void ColorPaletteWrapper::updateData() const
+{
+ frame::FeatureStateEvent aEvent;
+ aEvent.FeatureURL.Complete = sUnoChartColorPalette;
+ aEvent.IsEnabled = true;
+
+ if (mpControl)
+ mpControl->statusChanged(aEvent);
+}
+
+void ColorPaletteWrapper::select(ChartColorPaletteType eType, const sal_uInt32 nIndex)
+{
+ mxModel->setColorPalette(eType, nIndex);
+}
+
+void ColorPaletteWrapper::apply(const ChartColorPalette* pColorPalette)
+{
+ if (pColorPalette)
+ mxModel->applyColorPaletteToDataSeries(*pColorPalette);
+}
+
+std::shared_ptr<ChartColorPaletteHelper> ColorPaletteWrapper::getHelper() const
+{
+ const std::shared_ptr<model::Theme> pTheme = mxModel->getDocumentTheme();
+ return std::make_shared<ChartColorPaletteHelper>(pTheme);
+}
+
+ChartColorPaletteType ColorPaletteWrapper::getType() const
+{
+ return mxModel->getColorPaletteType();
+}
+
+sal_uInt32 ColorPaletteWrapper::getIndex() const { return mxModel->getColorPaletteIndex(); }
+
+const std::vector<ObjectType> ChartColorsPanel::maAcceptedTypes{
+ OBJECTTYPE_PAGE, OBJECTTYPE_LEGEND, OBJECTTYPE_DIAGRAM,
+ OBJECTTYPE_DIAGRAM_WALL, OBJECTTYPE_DIAGRAM_FLOOR, OBJECTTYPE_DATA_SERIES,
+ OBJECTTYPE_DATA_POINT,
+};
+
+ChartColorsPanel::ChartColorsPanel(weld::Widget* pParent,
+ const uno::Reference<frame::XFrame>& rxFrame,
+ ChartController* pController)
+ : PanelLayout(pParent, "ChartColorsPanel", "modules/schart/ui/sidebarcolors.ui")
+ , mxModel(pController->getChartModel())
+ , mxModifyListener(new ChartSidebarModifyListener(this))
+ , mxSelectionListener(new ChartSidebarSelectionListener(this))
+ , mbModelValid(true)
+ , mxColorPaletteTB(m_xBuilder->weld_toolbar("colorpalettetype"))
+ , mxColorPaletteDispatch(new ToolbarUnoDispatcher(*mxColorPaletteTB, *m_xBuilder, rxFrame))
+{
+ auto aAcceptedTypes(maAcceptedTypes);
+ mxSelectionListener->setAcceptedTypes(std::move(aAcceptedTypes));
+ Initialize();
+}
+
+ChartColorsPanel::~ChartColorsPanel()
+{
+ doUpdateModel(nullptr);
+ mxColorPaletteDispatch.reset();
+ mxColorPaletteTB.reset();
+}
+
+void ChartColorsPanel::Initialize()
+{
+ mxModel->addModifyListener(mxModifyListener);
+
+ uno::Reference<view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(),
+ uno::UNO_QUERY);
+ if (xSelectionSupplier.is())
+ xSelectionSupplier->addSelectionChangeListener(mxSelectionListener);
+
+ ChartColorPaletteControl* pColorPaletteControl
+ = getChartColorPaletteControl(*mxColorPaletteDispatch);
+ assert(pColorPaletteControl);
+ mxColorPaletteWrapper = std::make_shared<ColorPaletteWrapper>(mxModel, pColorPaletteControl);
+ pColorPaletteControl->setColorPaletteHandler(mxColorPaletteWrapper);
+
+ updateData();
+}
+
+void ChartColorsPanel::updateData()
+{
+ if (!mbModelValid)
+ return;
+
+ const OUString aCID = getCID(mxModel);
+ if (aCID.isEmpty())
+ return;
+ const ObjectType eType = ObjectIdentifier::getObjectType(aCID);
+
+ if (std::find(maAcceptedTypes.begin(), maAcceptedTypes.end(), eType) == maAcceptedTypes.end())
+ return;
+
+ // if fill style is not solid clear palette selection
+ if (eType == OBJECTTYPE_DATA_SERIES || eType == OBJECTTYPE_DATA_POINT)
+ {
+ const uno::Reference<beans::XPropertySet> xPropSet
+ = ObjectIdentifier::getObjectPropertySet(aCID, mxModel);
+ if (!xPropSet.is())
+ return;
+
+ uno::Reference<beans::XPropertySetInfo> xInfo(xPropSet->getPropertySetInfo());
+ if (!xInfo.is())
+ return;
+
+ SolarMutexGuard aGuard;
+ if (xInfo->hasPropertyByName("FillStyle"))
+ {
+ drawing::FillStyle eFillStyle = drawing::FillStyle_SOLID;
+ xPropSet->getPropertyValue("FillStyle") >>= eFillStyle;
+ if (eFillStyle != drawing::FillStyle_SOLID)
+ {
+ mxModel->clearColorPalette();
+ }
+ }
+ }
+
+ mxColorPaletteWrapper->updateData();
+}
+
+std::unique_ptr<PanelLayout> ChartColorsPanel::Create(weld::Widget* pParent,
+ const uno::Reference<frame::XFrame>& rxFrame,
+ ChartController* pController)
+{
+ if (pParent == nullptr)
+ throw lang::IllegalArgumentException("no parent Window given to ChartColorsPanel::Create",
+ nullptr, 0);
+ if (!rxFrame.is())
+ throw lang::IllegalArgumentException("no XFrame given to ChartColorsPanel::Create", nullptr,
+ 1);
+
+ return std::make_unique<ChartColorsPanel>(pParent, rxFrame, pController);
+}
+
+void ChartColorsPanel::DataChanged(const DataChangedEvent& rEvent)
+{
+ PanelLayout::DataChanged(rEvent);
+ updateData();
+}
+
+void ChartColorsPanel::HandleContextChange(const vcl::EnumContext&) { updateData(); }
+
+void ChartColorsPanel::NotifyItemUpdate(sal_uInt16 /*nSID*/, SfxItemState /*eState*/,
+ const SfxPoolItem* /*pState*/)
+{
+}
+
+void ChartColorsPanel::modelInvalid() { mbModelValid = false; }
+
+void ChartColorsPanel::doUpdateModel(const rtl::Reference<ChartModel>& xModel)
+{
+ if (mbModelValid)
+ {
+ mxModel->removeModifyListener(mxModifyListener);
+
+ const uno::Reference<view::XSelectionSupplier> oldSelectionSupplier(
+ mxModel->getCurrentController(), uno::UNO_QUERY);
+ if (oldSelectionSupplier.is())
+ {
+ oldSelectionSupplier->removeSelectionChangeListener(mxSelectionListener);
+ }
+ }
+
+ mxModel = xModel;
+ mbModelValid = mxModel.is();
+
+ if (!mbModelValid)
+ return;
+
+ mxColorPaletteWrapper->updateModel(mxModel);
+
+ mxModel->addModifyListener(mxModifyListener);
+
+ uno::Reference<view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(),
+ uno::UNO_QUERY);
+ if (xSelectionSupplier.is())
+ xSelectionSupplier->addSelectionChangeListener(mxSelectionListener);
+}
+
+void ChartColorsPanel::updateModel(const uno::Reference<frame::XModel> xModel)
+{
+ const auto pModel = dynamic_cast<ChartModel*>(xModel.get());
+ assert(!xModel || pModel);
+ doUpdateModel(pModel);
+}
+
+void ChartColorsPanel::selectionChanged(const bool bCorrectType)
+{
+ if (bCorrectType)
+ updateData();
+}
+
+} // end of namespace ::chart::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartColorsPanel.hxx b/chart2/source/controller/sidebar/ChartColorsPanel.hxx
new file mode 100644
index 000000000000..3180f7660f58
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartColorsPanel.hxx
@@ -0,0 +1,87 @@
+/* -*- 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 <com/sun/star/frame/XFrame.hpp>
+
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <sfx2/sidebar/SidebarModelUpdate.hxx>
+#include <sfx2/sidebar/PanelLayout.hxx>
+#include "ChartSidebarModifyListener.hxx"
+#include "ChartSidebarSelectionListener.hxx"
+#include <ChartColorPalettes.hxx>
+
+class ToolbarUnoDispatcher;
+
+namespace chart
+{
+class ChartController;
+
+namespace sidebar
+{
+class ColorPaletteWrapper;
+
+class ChartColorsPanel final : public PanelLayout,
+ public sfx2::sidebar::IContextChangeReceiver,
+ public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
+ public sfx2::sidebar::SidebarModelUpdate,
+ public ChartSidebarModifyListenerParent,
+ public ChartSidebarSelectionListenerParent
+{
+public:
+ static const std::vector<ObjectType> maAcceptedTypes;
+
+ static std::unique_ptr<PanelLayout>
+ Create(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ ChartController* pController);
+
+ void DataChanged(const DataChangedEvent& rEvent) override;
+
+ void HandleContextChange(const vcl::EnumContext& rContext) override;
+
+ void NotifyItemUpdate(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState) override;
+
+ void GetControlState(const sal_uInt16 /*nSId*/,
+ boost::property_tree::ptree& /*rState*/) override
+ {
+ }
+
+ // constructor/destructor
+ ChartColorsPanel(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ ChartController* pController);
+ ~ChartColorsPanel() override;
+
+ void updateData() override;
+ void modelInvalid() override;
+
+ void selectionChanged(bool bCorrectType) override;
+
+ void updateModel(css::uno::Reference<css::frame::XModel> xModel) override;
+
+private:
+ rtl::Reference<ChartModel> mxModel;
+ css::uno::Reference<css::util::XModifyListener> mxModifyListener;
+ rtl::Reference<ChartSidebarSelectionListener> mxSelectionListener;
+
+ bool mbModelValid;
+
+ std::unique_ptr<weld::Toolbar> mxColorPaletteTB;
+ std::unique_ptr<ToolbarUnoDispatcher> mxColorPaletteDispatch;
+ std::shared_ptr<ColorPaletteWrapper> mxColorPaletteWrapper;
+
+ void Initialize();
+ void doUpdateModel(const rtl::Reference<ChartModel>& xModel);
+};
+} // end of namespace sidebar
+} // end of namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 572ea7de4bd3..89dd339f9a48 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -19,8 +19,6 @@
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart/ChartLegendExpansion.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <vcl/svapp.hxx>
@@ -28,11 +26,11 @@
#include <ChartController.hxx>
#include <comphelper/processfactory.hxx>
+#include <Legend.hxx>
#include <LegendHelper.hxx>
-#include <ChartModelHelper.hxx>
#include <AxisHelper.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ChartModel.hxx>
#include <BaseCoordinateSystem.hxx>
@@ -75,13 +73,13 @@ bool isLegendVisible(const css::uno::Reference<css::frame::XModel>& xModel)
if (!pModel)
return false;
- Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend(*pModel), uno::UNO_QUERY );
+ rtl::Reference< Legend > xLegendProp = LegendHelper::getLegend(*pModel);
if( xLegendProp.is())
{
try
{
bool bShow = false;
- if( xLegendProp->getPropertyValue( "Show") >>= bShow )
+ if( xLegendProp->getPropertyValue( u"Show"_ustr) >>= bShow )
{
return bShow;
}
@@ -112,13 +110,13 @@ bool isLegendOverlay(const css::uno::Reference<css::frame::XModel>& xModel)
if (!pModel)
return false;
- Reference< beans::XPropertySet > xLegendProp(LegendHelper::getLegend(*pModel), uno::UNO_QUERY);
+ rtl::Reference< Legend > xLegendProp = LegendHelper::getLegend(*pModel);
if( xLegendProp.is())
{
try
{
bool bOverlay = false;
- if(xLegendProp->getPropertyValue("Overlay") >>= bOverlay)
+ if(xLegendProp->getPropertyValue(u"Overlay"_ustr) >>= bOverlay)
{
return bOverlay;
}
@@ -137,28 +135,27 @@ void setLegendOverlay(const css::uno::Reference<css::frame::XModel>& xModel, boo
if (!pModel)
return;
- Reference<beans::XPropertySet> xLegendProp(LegendHelper::getLegend(*pModel), uno::UNO_QUERY);
+ rtl::Reference<Legend> xLegendProp = LegendHelper::getLegend(*pModel);
if (!xLegendProp.is())
return;
- xLegendProp->setPropertyValue("Overlay", css::uno::Any(bOverlay));
+ xLegendProp->setPropertyValue(u"Overlay"_ustr, css::uno::Any(bOverlay));
}
bool isTitleVisible(const rtl::Reference<::chart::ChartModel>& xModel, TitleHelper::eTitleType eTitle)
{
- css::uno::Reference<css::uno::XInterface> xTitle = TitleHelper::getTitle(eTitle, xModel);
+ rtl::Reference<Title> xTitle = TitleHelper::getTitle(eTitle, xModel);
if (!xTitle.is())
return false;
- css::uno::Reference<css::beans::XPropertySet> xPropSet(xTitle, css::uno::UNO_QUERY_THROW);
- css::uno::Any aAny = xPropSet->getPropertyValue("Visible");
+ css::uno::Any aAny = xTitle->getPropertyValue(u"Visible"_ustr);
bool bVisible = aAny.get<bool>();
return bVisible;
}
bool isGridVisible(const rtl::Reference<::chart::ChartModel>& xModel, GridType eType)
{
- rtl::Reference< Diagram > xDiagram(ChartModelHelper::findDiagram(xModel));
+ rtl::Reference< Diagram > xDiagram(xModel->getFirstChartDiagram());
if(xDiagram.is())
{
sal_Int32 nDimensionIndex = 0;
@@ -175,7 +172,7 @@ bool isGridVisible(const rtl::Reference<::chart::ChartModel>& xModel, GridType e
void setGridVisible(const rtl::Reference<::chart::ChartModel>& xModel, GridType eType, bool bVisible)
{
- rtl::Reference< Diagram > xDiagram(ChartModelHelper::findDiagram(xModel));
+ rtl::Reference< Diagram > xDiagram(xModel->getFirstChartDiagram());
if(!xDiagram.is())
return;
@@ -195,7 +192,7 @@ void setGridVisible(const rtl::Reference<::chart::ChartModel>& xModel, GridType
bool isAxisVisible(const rtl::Reference<::chart::ChartModel>& xModel, AxisType eType)
{
- rtl::Reference< Diagram > xDiagram(ChartModelHelper::findDiagram(xModel));
+ rtl::Reference< Diagram > xDiagram(xModel->getFirstChartDiagram());
if(xDiagram.is())
{
sal_Int32 nDimensionIndex = 0;
@@ -214,7 +211,7 @@ bool isAxisVisible(const rtl::Reference<::chart::ChartModel>& xModel, AxisType e
void setAxisVisible(const rtl::Reference<::chart::ChartModel>& xModel, AxisType eType, bool bVisible)
{
- rtl::Reference< Diagram > xDiagram(ChartModelHelper::findDiagram(xModel));
+ rtl::Reference< Diagram > xDiagram(xModel->getFirstChartDiagram());
if(!xDiagram.is())
return;
@@ -238,12 +235,12 @@ sal_Int32 getLegendPos(const css::uno::Reference<css::frame::XModel>& xModel)
if (!pModel)
return -1;
- Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend(*pModel), uno::UNO_QUERY );
+ rtl::Reference< Legend > xLegendProp = LegendHelper::getLegend(*pModel);
if (!xLegendProp.is())
return -1;
chart2::LegendPosition eLegendPos = chart2::LegendPosition_LINE_END;
- xLegendProp->getPropertyValue("AnchorPosition") >>= eLegendPos;
+ xLegendProp->getPropertyValue(u"AnchorPosition"_ustr) >>= eLegendPos;
switch(eLegendPos)
{
case chart2::LegendPosition_LINE_START:
@@ -265,7 +262,7 @@ void setLegendPos(const css::uno::Reference<css::frame::XModel>& xModel, sal_Int
if (!pModel)
return;
- Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend(*pModel), uno::UNO_QUERY );
+ rtl::Reference< Legend > xLegendProp = LegendHelper::getLegend(*pModel);
if (!xLegendProp.is())
return;
@@ -291,42 +288,42 @@ void setLegendPos(const css::uno::Reference<css::frame::XModel>& xModel, sal_Int
assert(false);
}
- xLegendProp->setPropertyValue("AnchorPosition", css::uno::Any(eLegendPos));
- xLegendProp->setPropertyValue("Expansion", css::uno::Any(eExpansion));
- xLegendProp->setPropertyValue("RelativePosition", uno::Any());
+ xLegendProp->setPropertyValue(u"AnchorPosition"_ustr, css::uno::Any(eLegendPos));
+ xLegendProp->setPropertyValue(u"Expansion"_ustr, css::uno::Any(eExpansion));
+ xLegendProp->setPropertyValue(u"RelativePosition"_ustr, uno::Any());
}
}
ChartElementsPanel::ChartElementsPanel(
weld::Widget* pParent, ChartController* pController)
- : PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui")
- , mxCBTitle(m_xBuilder->weld_check_button("checkbutton_title"))
- , mxEditTitle(m_xBuilder->weld_entry("edit_title"))
- , mxCBSubtitle(m_xBuilder->weld_check_button("checkbutton_subtitle"))
- , mxEditSubtitle(m_xBuilder->weld_entry("edit_subtitle"))
- , mxCBXAxis(m_xBuilder->weld_check_button("checkbutton_x_axis"))
- , mxCBXAxisTitle(m_xBuilder->weld_check_button("checkbutton_x_axis_title"))
- , mxCBYAxis(m_xBuilder->weld_check_button("checkbutton_y_axis"))
- , mxCBYAxisTitle(m_xBuilder->weld_check_button("checkbutton_y_axis_title"))
- , mxCBZAxis(m_xBuilder->weld_check_button("checkbutton_z_axis"))
- , mxCBZAxisTitle(m_xBuilder->weld_check_button("checkbutton_z_axis_title"))
- , mxCB2ndXAxis(m_xBuilder->weld_check_button("checkbutton_2nd_x_axis"))
- , mxCB2ndXAxisTitle(m_xBuilder->weld_check_button("checkbutton_2nd_x_axis_title"))
- , mxCB2ndYAxis(m_xBuilder->weld_check_button("checkbutton_2nd_y_axis"))
- , mxCB2ndYAxisTitle(m_xBuilder->weld_check_button("checkbutton_2nd_y_axis_title"))
- , mxCBLegend(m_xBuilder->weld_check_button("checkbutton_legend"))
- , mxCBLegendNoOverlay(m_xBuilder->weld_check_button("checkbutton_no_overlay"))
- , mxCBGridVerticalMajor(m_xBuilder->weld_check_button("checkbutton_gridline_vertical_major"))
- , mxCBGridHorizontalMajor(m_xBuilder->weld_check_button("checkbutton_gridline_horizontal_major"))
- , mxCBGridVerticalMinor(m_xBuilder->weld_check_button("checkbutton_gridline_vertical_minor"))
- , mxCBGridHorizontalMinor(m_xBuilder->weld_check_button("checkbutton_gridline_horizontal_minor"))
- , mxTextTitle(m_xBuilder->weld_label("text_title"))
- , mxTextSubTitle(m_xBuilder->weld_label("text_subtitle"))
- , mxLBAxis(m_xBuilder->weld_label("label_axes"))
- , mxLBGrid(m_xBuilder->weld_label("label_gri"))
- , mxLBLegendPosition(m_xBuilder->weld_combo_box("comboboxtext_legend"))
- , mxBoxLegend(m_xBuilder->weld_widget("box_legend"))
+ : PanelLayout(pParent, u"ChartElementsPanel"_ustr, u"modules/schart/ui/sidebarelements.ui"_ustr)
+ , mxCBTitle(m_xBuilder->weld_check_button(u"checkbutton_title"_ustr))
+ , mxEditTitle(m_xBuilder->weld_entry(u"edit_title"_ustr))
+ , mxCBSubtitle(m_xBuilder->weld_check_button(u"checkbutton_subtitle"_ustr))
+ , mxEditSubtitle(m_xBuilder->weld_entry(u"edit_subtitle"_ustr))
+ , mxCBXAxis(m_xBuilder->weld_check_button(u"checkbutton_x_axis"_ustr))
+ , mxCBXAxisTitle(m_xBuilder->weld_check_button(u"checkbutton_x_axis_title"_ustr))
+ , mxCBYAxis(m_xBuilder->weld_check_button(u"checkbutton_y_axis"_ustr))
+ , mxCBYAxisTitle(m_xBuilder->weld_check_button(u"checkbutton_y_axis_title"_ustr))
+ , mxCBZAxis(m_xBuilder->weld_check_button(u"checkbutton_z_axis"_ustr))
+ , mxCBZAxisTitle(m_xBuilder->weld_check_button(u"checkbutton_z_axis_title"_ustr))
+ , mxCB2ndXAxis(m_xBuilder->weld_check_button(u"checkbutton_2nd_x_axis"_ustr))
+ , mxCB2ndXAxisTitle(m_xBuilder->weld_check_button(u"checkbutton_2nd_x_axis_title"_ustr))
+ , mxCB2ndYAxis(m_xBuilder->weld_check_button(u"checkbutton_2nd_y_axis"_ustr))
+ , mxCB2ndYAxisTitle(m_xBuilder->weld_check_button(u"checkbutton_2nd_y_axis_title"_ustr))
+ , mxCBLegend(m_xBuilder->weld_check_button(u"checkbutton_legend"_ustr))
+ , mxCBLegendNoOverlay(m_xBuilder->weld_check_button(u"checkbutton_no_overlay"_ustr))
+ , mxCBGridVerticalMajor(m_xBuilder->weld_check_button(u"checkbutton_gridline_vertical_major"_ustr))
+ , mxCBGridHorizontalMajor(m_xBuilder->weld_check_button(u"checkbutton_gridline_horizontal_major"_ustr))
+ , mxCBGridVerticalMinor(m_xBuilder->weld_check_button(u"checkbutton_gridline_vertical_minor"_ustr))
+ , mxCBGridHorizontalMinor(m_xBuilder->weld_check_button(u"checkbutton_gridline_horizontal_minor"_ustr))
+ , mxTextTitle(m_xBuilder->weld_label(u"text_title"_ustr))
+ , mxTextSubTitle(m_xBuilder->weld_label(u"text_subtitle"_ustr))
+ , mxLBAxis(m_xBuilder->weld_label(u"label_axes"_ustr))
+ , mxLBGrid(m_xBuilder->weld_label(u"label_gri"_ustr))
+ , mxLBLegendPosition(m_xBuilder->weld_combo_box(u"comboboxtext_legend"_ustr))
+ , mxBoxLegend(m_xBuilder->weld_widget(u"box_legend"_ustr))
, mxModel(pController->getChartModel())
, mxListener(new ChartSidebarModifyListener(this))
, mbModelValid(true)
@@ -406,21 +403,21 @@ void ChartElementsPanel::Initialize()
namespace {
-css::uno::Reference<css::chart2::XChartType> getChartType(const rtl::Reference<ChartModel>& xModel)
+rtl::Reference<ChartType> getChartType(const rtl::Reference<ChartModel>& xModel)
{
rtl::Reference<Diagram > xDiagram = xModel->getFirstChartDiagram();
if (!xDiagram.is())
- return css::uno::Reference<css::chart2::XChartType>();
+ return nullptr;
- const std::vector<rtl::Reference<BaseCoordinateSystem>> & xCooSysSequence(xDiagram->getBaseCoordinateSystems());
+ const std::vector<rtl::Reference<BaseCoordinateSystem>> xCooSysSequence(xDiagram->getBaseCoordinateSystems());
if (xCooSysSequence.empty())
- return css::uno::Reference<css::chart2::XChartType>();
+ return nullptr;
- css::uno::Sequence<css::uno::Reference<css::chart2::XChartType>> xChartTypeSequence(xCooSysSequence[0]->getChartTypes());
+ const std::vector<rtl::Reference<ChartType>> & xChartTypeSequence(xCooSysSequence[0]->getChartTypes2());
- if (!xChartTypeSequence.hasElements())
- return css::uno::Reference<css::chart2::XChartType>();
+ if (xChartTypeSequence.empty())
+ return nullptr;
return xChartTypeSequence[0];
}
@@ -432,8 +429,10 @@ void ChartElementsPanel::updateData()
if (!mbModelValid)
return;
- rtl::Reference< Diagram > xDiagram(ChartModelHelper::findDiagram(mxModel));
- sal_Int32 nDimension = DiagramHelper::getDimension(xDiagram);
+ rtl::Reference< Diagram > xDiagram(mxModel->getFirstChartDiagram());
+ sal_Int32 nDimension = 0;
+ if (xDiagram)
+ nDimension = xDiagram->getDimension();
SolarMutexGuard aGuard;
mxCBLegend->set_active(isLegendVisible(mxModel));
@@ -476,8 +475,8 @@ void ChartElementsPanel::updateData()
mxCB2ndXAxis->set_active(isAxisVisible(mxModel, AxisType::X_SECOND));
mxCB2ndYAxis->set_active(isAxisVisible(mxModel, AxisType::Y_SECOND));
- bool bSupportsMainAxis = ChartTypeHelper::isSupportingMainAxis(
- getChartType(mxModel), 0, 0);
+ auto xChartType = getChartType(mxModel);
+ bool bSupportsMainAxis = xChartType.is() ? xChartType->isSupportingMainAxis(0, 0) : true;
if (bSupportsMainAxis)
{
mxCBXAxis->show();
@@ -528,7 +527,7 @@ std::unique_ptr<PanelLayout> ChartElementsPanel::Create (
ChartController* pController)
{
if (pParent == nullptr)
- throw lang::IllegalArgumentException("no parent Window given to ChartElementsPanel::Create", nullptr, 0);
+ throw lang::IllegalArgumentException(u"no parent Window given to ChartElementsPanel::Create"_ustr, nullptr, 0);
return std::make_unique<ChartElementsPanel>(pParent, pController);
}
@@ -556,7 +555,7 @@ void ChartElementsPanel::modelInvalid()
mbModelValid = false;
}
-void ChartElementsPanel::doUpdateModel(rtl::Reference<::chart::ChartModel> xModel)
+void ChartElementsPanel::doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel)
{
if (mbModelValid)
{
@@ -635,7 +634,8 @@ IMPL_LINK(ChartElementsPanel, EditHdl, weld::Entry&, rEdit, void)
// set it
OUString aText(rEdit.get_text());
- TitleHelper::setCompleteString(aText, TitleHelper::getTitle(aTitleType, mxModel), comphelper::getProcessComponentContext());
+ TitleHelper::setCompleteString(aText, TitleHelper::getTitle(aTitleType, mxModel),
+ comphelper::getProcessComponentContext(), nullptr, true);
}
IMPL_LINK_NOARG(ChartElementsPanel, LegendPosHdl, weld::ComboBox&, void)
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index 07c7ee19c3db..2e0dee28b68f 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -102,7 +102,7 @@ private:
OUString maTextSubTitle;
void Initialize();
- void doUpdateModel(rtl::Reference<::chart::ChartModel> xModel);
+ void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
void setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible);
diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
index 0db870b8bcc5..87be2b47d185 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
@@ -18,7 +18,6 @@
*/
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include "ChartErrorBarPanel.hxx"
@@ -42,13 +41,13 @@ enum class ErrorBarDirection
};
css::uno::Reference<css::beans::XPropertySet> getErrorBarPropSet(
- const rtl::Reference<::chart::ChartModel>& xModel, const OUString& rCID)
+ const rtl::Reference<::chart::ChartModel>& xModel, std::u16string_view rCID)
{
return ObjectIdentifier::getObjectPropertySet(rCID, xModel);
}
bool showPositiveError(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
getErrorBarPropSet(xModel, rCID);
@@ -56,7 +55,7 @@ bool showPositiveError(const rtl::Reference<::chart::ChartModel>& xModel,
if (!xPropSet.is())
return false;
- css::uno::Any aAny = xPropSet->getPropertyValue("ShowPositiveError");
+ css::uno::Any aAny = xPropSet->getPropertyValue(u"ShowPositiveError"_ustr);
if (!aAny.hasValue())
return false;
@@ -67,7 +66,7 @@ bool showPositiveError(const rtl::Reference<::chart::ChartModel>& xModel,
}
bool showNegativeError(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
getErrorBarPropSet(xModel, rCID);
@@ -75,7 +74,7 @@ bool showNegativeError(const rtl::Reference<::chart::ChartModel>& xModel,
if (!xPropSet.is())
return false;
- css::uno::Any aAny = xPropSet->getPropertyValue("ShowNegativeError");
+ css::uno::Any aAny = xPropSet->getPropertyValue(u"ShowNegativeError"_ustr);
if (!aAny.hasValue())
return false;
@@ -86,7 +85,7 @@ bool showNegativeError(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setShowPositiveError(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, bool bShow)
+ std::u16string_view rCID, bool bShow)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
getErrorBarPropSet(xModel, rCID);
@@ -94,11 +93,11 @@ void setShowPositiveError(const rtl::Reference<::chart::ChartModel>& xModel,
if (!xPropSet.is())
return;
- xPropSet->setPropertyValue("ShowPositiveError", css::uno::Any(bShow));
+ xPropSet->setPropertyValue(u"ShowPositiveError"_ustr, css::uno::Any(bShow));
}
void setShowNegativeError(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, bool bShow)
+ std::u16string_view rCID, bool bShow)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
getErrorBarPropSet(xModel, rCID);
@@ -106,7 +105,7 @@ void setShowNegativeError(const rtl::Reference<::chart::ChartModel>& xModel,
if (!xPropSet.is())
return;
- xPropSet->setPropertyValue("ShowNegativeError", css::uno::Any(bShow));
+ xPropSet->setPropertyValue(u"ShowNegativeError"_ustr, css::uno::Any(bShow));
}
struct ErrorBarTypeMap
@@ -126,7 +125,7 @@ ErrorBarTypeMap const aErrorBarType[] = {
};
sal_Int32 getTypePos(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
getErrorBarPropSet(xModel, rCID);
@@ -134,7 +133,7 @@ sal_Int32 getTypePos(const rtl::Reference<::chart::ChartModel>& xModel,
if (!xPropSet.is())
return 0;
- css::uno::Any aAny = xPropSet->getPropertyValue("ErrorBarStyle");
+ css::uno::Any aAny = xPropSet->getPropertyValue(u"ErrorBarStyle"_ustr);
if (!aAny.hasValue())
return 0;
@@ -152,7 +151,7 @@ sal_Int32 getTypePos(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setTypePos(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, sal_Int32 nPos)
+ std::u16string_view rCID, sal_Int32 nPos)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
getErrorBarPropSet(xModel, rCID);
@@ -167,11 +166,11 @@ void setTypePos(const rtl::Reference<::chart::ChartModel>& xModel,
nApi = i.nApi;
}
- xPropSet->setPropertyValue("ErrorBarStyle", css::uno::Any(nApi));
+ xPropSet->setPropertyValue(u"ErrorBarStyle"_ustr, css::uno::Any(nApi));
}
double getValue(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, ErrorBarDirection eDir)
+ std::u16string_view rCID, ErrorBarDirection eDir)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
getErrorBarPropSet(xModel, rCID);
@@ -179,7 +178,7 @@ double getValue(const rtl::Reference<::chart::ChartModel>& xModel,
if (!xPropSet.is())
return 0;
- OUString aName = "PositiveError";
+ OUString aName = u"PositiveError"_ustr;
if (eDir == ErrorBarDirection::NEGATIVE)
aName = "NegativeError";
@@ -195,7 +194,7 @@ double getValue(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setValue(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, double nVal, ErrorBarDirection eDir)
+ std::u16string_view rCID, double nVal, ErrorBarDirection eDir)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
getErrorBarPropSet(xModel, rCID);
@@ -203,7 +202,7 @@ void setValue(const rtl::Reference<::chart::ChartModel>& xModel,
if (!xPropSet.is())
return;
- OUString aName = "PositiveError";
+ OUString aName = u"PositiveError"_ustr;
if (eDir == ErrorBarDirection::NEGATIVE)
aName = "NegativeError";
@@ -236,13 +235,13 @@ OUString getCID(const rtl::Reference<::chart::ChartModel>& xModel)
}
ChartErrorBarPanel::ChartErrorBarPanel(weld::Widget* pParent, ChartController* pController)
- : PanelLayout(pParent, "ChartErrorBarPanel", "modules/schart/ui/sidebarerrorbar.ui")
- , mxRBPosAndNeg(m_xBuilder->weld_radio_button("radiobutton_positive_negative"))
- , mxRBPos(m_xBuilder->weld_radio_button("radiobutton_positive"))
- , mxRBNeg(m_xBuilder->weld_radio_button("radiobutton_negative"))
- , mxLBType(m_xBuilder->weld_combo_box("comboboxtext_type"))
- , mxMFPos(m_xBuilder->weld_spin_button("spinbutton_pos"))
- , mxMFNeg(m_xBuilder->weld_spin_button("spinbutton_neg"))
+ : PanelLayout(pParent, u"ChartErrorBarPanel"_ustr, u"modules/schart/ui/sidebarerrorbar.ui"_ustr)
+ , mxRBPosAndNeg(m_xBuilder->weld_radio_button(u"radiobutton_positive_negative"_ustr))
+ , mxRBPos(m_xBuilder->weld_radio_button(u"radiobutton_positive"_ustr))
+ , mxRBNeg(m_xBuilder->weld_radio_button(u"radiobutton_negative"_ustr))
+ , mxLBType(m_xBuilder->weld_combo_box(u"comboboxtext_type"_ustr))
+ , mxMFPos(m_xBuilder->weld_spin_button(u"spinbutton_pos"_ustr))
+ , mxMFNeg(m_xBuilder->weld_spin_button(u"spinbutton_neg"_ustr))
, mxModel(pController->getChartModel())
, mxListener(new ChartSidebarModifyListener(this))
, mbModelValid(true)
@@ -342,7 +341,7 @@ std::unique_ptr<PanelLayout> ChartErrorBarPanel::Create (
ChartController* pController)
{
if (pParent == nullptr)
- throw lang::IllegalArgumentException("no parent Window given to ChartErrorBarPanel::Create", nullptr, 0);
+ throw lang::IllegalArgumentException(u"no parent Window given to ChartErrorBarPanel::Create"_ustr, nullptr, 0);
return std::make_unique<ChartErrorBarPanel>(pParent, pController);
}
@@ -370,7 +369,7 @@ void ChartErrorBarPanel::modelInvalid()
mbModelValid = false;
}
-void ChartErrorBarPanel::doUpdateModel(rtl::Reference<::chart::ChartModel> xModel)
+void ChartErrorBarPanel::doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel)
{
if (mbModelValid)
{
diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
index 1613006b7ea5..92f7afb0ad53 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
@@ -79,7 +79,7 @@ private:
bool mbModelValid;
void Initialize();
- void doUpdateModel(rtl::Reference<::chart::ChartModel> xModel);
+ void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
DECL_LINK(RadioBtnHdl, weld::Toggleable&, void);
DECL_LINK(ListBoxHdl, weld::ComboBox&, void);
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
index 94658d26ed2d..daa9f0645cfc 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -13,7 +13,6 @@
#include <ChartModel.hxx>
#include <svx/xlnwtit.hxx>
-#include <svx/xlinjoit.hxx>
#include <svx/xlntrit.hxx>
#include <svx/linectrl.hxx>
@@ -22,7 +21,6 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <comphelper/lok.hxx>
@@ -35,14 +33,14 @@ namespace {
SvxLineStyleToolBoxControl* getLineStyleToolBoxControl(const ToolbarUnoDispatcher& rToolBoxColor)
{
- css::uno::Reference<css::frame::XToolbarController> xController = rToolBoxColor.GetControllerForCommand(".uno:XLineStyle");
+ css::uno::Reference<css::frame::XToolbarController> xController = rToolBoxColor.GetControllerForCommand(u".uno:XLineStyle"_ustr);
SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = dynamic_cast<SvxLineStyleToolBoxControl*>(xController.get());
return pToolBoxLineStyleControl;
}
SvxColorToolBoxControl* getColorToolBoxControl(const ToolbarUnoDispatcher& rToolBoxLineStyle)
{
- css::uno::Reference<css::frame::XToolbarController> xController = rToolBoxLineStyle.GetControllerForCommand(".uno:XLineColor");
+ css::uno::Reference<css::frame::XToolbarController> xController = rToolBoxLineStyle.GetControllerForCommand(u".uno:XLineColor"_ustr);
SvxColorToolBoxControl* pToolBoxColorControl = dynamic_cast<SvxColorToolBoxControl*>(xController.get());
return pToolBoxColorControl;
}
@@ -56,10 +54,7 @@ OUString getCID(const rtl::Reference<::chart::ChartModel>& xModel)
css::uno::Any aAny = xSelectionSupplier->getSelection();
if (!aAny.hasValue())
- {
- xSelectionSupplier->select(css::uno::makeAny(OUString("CID/Page=")));
- aAny = xSelectionSupplier->getSelection();
- }
+ return OUString();
OUString aCID;
aAny >>= aCID;
@@ -114,9 +109,9 @@ std::unique_ptr<PanelLayout> ChartLinePanel::Create(
ChartController* pController)
{
if (pParent == nullptr)
- throw css::lang::IllegalArgumentException("no parent Window given to ChartAxisPanel::Create", nullptr, 0);
+ throw css::lang::IllegalArgumentException(u"no parent Window given to ChartAxisPanel::Create"_ustr, nullptr, 0);
if (!rxFrame.is())
- throw css::lang::IllegalArgumentException("no XFrame given to ChartAxisPanel::Create", nullptr, 1);
+ throw css::lang::IllegalArgumentException(u"no XFrame given to ChartAxisPanel::Create"_ustr, nullptr, 1);
return std::make_unique<ChartLinePanel>(pParent, rxFrame, pController);
}
@@ -130,7 +125,7 @@ ChartLinePanel::ChartLinePanel(weld::Widget* pParent,
mxSelectionListener(new ChartSidebarSelectionListener(this)),
mbUpdate(true),
mbModelValid(true),
- maLineColorWrapper(mxModel, getColorToolBoxControl(*mxColorDispatch), "LineColor"),
+ maLineColorWrapper(mxModel, getColorToolBoxControl(*mxColorDispatch), u"LineColor"_ustr),
maLineStyleWrapper(mxModel, getLineStyleToolBoxControl(*mxLineStyleDispatch))
{
disableArrowHead();
@@ -176,12 +171,12 @@ void ChartLinePanel::updateData()
return;
sal_uInt16 nLineTransparence = 0;
- xPropSet->getPropertyValue("LineTransparence") >>= nLineTransparence;
+ xPropSet->getPropertyValue(u"LineTransparence"_ustr) >>= nLineTransparence;
XLineTransparenceItem aLineTransparenceItem(nLineTransparence);
updateLineTransparence(false, true, &aLineTransparenceItem);
sal_uInt32 nWidth = 0;
- xPropSet->getPropertyValue("LineWidth") >>= nWidth;
+ xPropSet->getPropertyValue(u"LineWidth"_ustr) >>= nWidth;
XLineWidthItem aWidthItem(nWidth);
updateLineWidth(false, true, &aWidthItem);
@@ -200,7 +195,7 @@ void ChartLinePanel::selectionChanged(bool bCorrectType)
updateData();
}
-void ChartLinePanel::doUpdateModel(rtl::Reference<::chart::ChartModel> xModel)
+void ChartLinePanel::doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel)
{
if (mbModelValid)
{
@@ -236,23 +231,6 @@ void ChartLinePanel::updateModel(css::uno::Reference<css::frame::XModel> xModel)
doUpdateModel(pModel);
}
-void ChartLinePanel::setLineJoint(const XLineJointItem* pItem)
-{
- css::uno::Reference<css::beans::XPropertySet> xPropSet =
- getPropSet(mxModel);
-
- if (!xPropSet.is())
- return;
-
- PreventUpdate aPreventUpdate(mbUpdate);
- if (pItem)
- xPropSet->setPropertyValue("LineJoint", css::uno::Any(pItem->GetValue()));
-}
-
-void ChartLinePanel::setLineCap(const XLineCapItem* /*pItem*/)
-{
-}
-
void ChartLinePanel::setLineTransparency(const XLineTransparenceItem& rItem)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet =
@@ -262,7 +240,7 @@ void ChartLinePanel::setLineTransparency(const XLineTransparenceItem& rItem)
return;
PreventUpdate aPreventUpdate(mbUpdate);
- xPropSet->setPropertyValue("LineTransparence", css::uno::Any(rItem.GetValue()));
+ xPropSet->setPropertyValue(u"LineTransparence"_ustr, css::uno::Any(rItem.GetValue()));
}
void ChartLinePanel::setLineWidth(const XLineWidthItem& rItem)
@@ -274,7 +252,7 @@ void ChartLinePanel::setLineWidth(const XLineWidthItem& rItem)
return;
PreventUpdate aPreventUpdate(mbUpdate);
- xPropSet->setPropertyValue("LineWidth", css::uno::Any(rItem.GetValue()));
+ xPropSet->setPropertyValue(u"LineWidth"_ustr, css::uno::Any(rItem.GetValue()));
}
void ChartLinePanel::updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem)
@@ -285,7 +263,7 @@ void ChartLinePanel::updateLineWidth(bool bDisabled, bool bSetOrDefault, const S
if (comphelper::LibreOfficeKit::isActive() && pViewShell)
{
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
- (".uno:LineWidth=" + std::to_string(mnWidthCoreValue)).c_str());
+ ".uno:LineWidth=" + OString::number(mnWidthCoreValue));
}
}
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.hxx b/chart2/source/controller/sidebar/ChartLinePanel.hxx
index 10bfd5a4cf0d..4449f3678fb6 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.hxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.hxx
@@ -16,12 +16,6 @@
#include "ChartSidebarSelectionListener.hxx"
#include "ChartColorWrapper.hxx"
-class XLineCapItem;
-class XLineDashItem;
-class XLineEndItem;
-class XLineJointItem;
-class XLineStartItem;
-class XLineStyleItem;
class XLineTransparenceItem;
class XLineWidthItem;
@@ -62,8 +56,6 @@ public:
protected:
virtual void setLineTransparency(const XLineTransparenceItem& rItem) override;
- virtual void setLineJoint(const XLineJointItem* pItem) override;
- virtual void setLineCap(const XLineCapItem* pItem) override;
virtual void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem) override;
@@ -74,7 +66,7 @@ private:
rtl::Reference<ChartSidebarSelectionListener> mxSelectionListener;
void Initialize();
- void doUpdateModel(rtl::Reference<::chart::ChartModel> xModel);
+ void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
bool mbUpdate;
bool mbModelValid;
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 27878f8926cc..8795e691fbd7 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -18,14 +18,7 @@
*/
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XDataSeries.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <vcl/svapp.hxx>
#include <sal/log.hxx>
@@ -33,10 +26,12 @@
#include "ChartSeriesPanel.hxx"
#include <ChartController.hxx>
#include <ChartModel.hxx>
+#include <ChartType.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <RegressionCurveHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include <StatisticsHelper.hxx>
#include <BaseCoordinateSystem.hxx>
@@ -49,29 +44,29 @@ namespace chart::sidebar {
namespace {
-bool isDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, const OUString& rCID)
+bool isDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, std::u16string_view rCID)
{
- css::uno::Reference< css::chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xSeries.is())
return false;
- return DataSeriesHelper::hasDataLabelsAtSeries(xSeries);
+ return xSeries->hasDataLabelsAtSeries();
}
-void setDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, const OUString& rCID, bool bVisible)
+void setDataLabelVisible(const rtl::Reference<::chart::ChartModel>& xModel, std::u16string_view rCID, bool bVisible)
{
- css::uno::Reference< css::chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xSeries.is())
return;
if (bVisible)
- DataSeriesHelper::insertDataLabelsToSeriesAndAllPoints(xSeries);
+ xSeries->insertDataLabelsToSeriesAndAllPoints();
else
- DataSeriesHelper::deleteDataLabelsFromSeriesAndAllPoints(xSeries);
+ xSeries->deleteDataLabelsFromSeriesAndAllPoints();
}
struct LabelPlacementMap
@@ -90,15 +85,15 @@ LabelPlacementMap const aLabelPlacementMap[] = {
};
sal_Int32 getDataLabelPlacement(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::beans::XPropertySet > xSeries(
- ObjectIdentifier::getDataSeriesForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xSeries =
+ ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xSeries.is())
return 0;
- css::uno::Any aAny = xSeries->getPropertyValue("LabelPlacement");
+ css::uno::Any aAny = xSeries->getPropertyValue(u"LabelPlacement"_ustr);
if (!aAny.hasValue())
return 0;
@@ -115,10 +110,10 @@ sal_Int32 getDataLabelPlacement(const rtl::Reference<::chart::ChartModel>& xMode
}
void setDataLabelPlacement(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, sal_Int32 nPos)
+ std::u16string_view rCID, sal_Int32 nPos)
{
- css::uno::Reference< css::beans::XPropertySet > xSeries(
- ObjectIdentifier::getDataSeriesForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xSeries =
+ ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xSeries.is())
return;
@@ -133,26 +128,26 @@ void setDataLabelPlacement(const rtl::Reference<::chart::ChartModel>& xModel,
}
}
- xSeries->setPropertyValue("LabelPlacement", css::uno::Any(nApi));
+ xSeries->setPropertyValue(u"LabelPlacement"_ustr, css::uno::Any(nApi));
}
bool isTrendlineVisible(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::chart2::XRegressionCurveContainer > xRegressionCurveContainer(
- ObjectIdentifier::getDataSeriesForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xRegressionCurveContainer =
+ ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xRegressionCurveContainer.is())
return false;
- return xRegressionCurveContainer->getRegressionCurves().hasElements();
+ return !xRegressionCurveContainer->getRegressionCurves2().empty();
}
void setTrendlineVisible(const rtl::Reference<::chart::ChartModel>&
- xModel, const OUString& rCID, bool bVisible)
+ xModel, std::u16string_view rCID, bool bVisible)
{
- css::uno::Reference< css::chart2::XRegressionCurveContainer > xRegressionCurveContainer(
- ObjectIdentifier::getDataSeriesForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xRegressionCurveContainer =
+ ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xRegressionCurveContainer.is())
return;
@@ -170,9 +165,9 @@ void setTrendlineVisible(const rtl::Reference<::chart::ChartModel>&
}
bool isErrorBarVisible(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, bool bYError)
+ std::u16string_view rCID, bool bYError)
{
- css::uno::Reference< css::chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xSeries.is())
@@ -182,9 +177,9 @@ bool isErrorBarVisible(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setErrorBarVisible(const rtl::Reference<::chart::ChartModel>&
- xModel, const OUString& rCID, bool bYError, bool bVisible)
+ xModel, std::u16string_view rCID, bool bYError, bool bVisible)
{
- css::uno::Reference< css::chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xSeries.is())
@@ -203,48 +198,47 @@ void setErrorBarVisible(const rtl::Reference<::chart::ChartModel>&
}
bool isPrimaryAxis(const rtl::Reference<::chart::ChartModel>&
- xModel, const OUString& rCID)
+ xModel, std::u16string_view rCID)
{
- css::uno::Reference< css::chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xSeries.is())
return true;
- return DataSeriesHelper::getAttachedAxisIndex(xSeries) == 0;
+ return xSeries->getAttachedAxisIndex() == 0;
}
void setAttachedAxisType(const rtl::Reference<::chart::ChartModel>&
- xModel, const OUString& rCID, bool bPrimary)
+ xModel, std::u16string_view rCID, bool bPrimary)
{
- const uno::Reference<chart2::XDataSeries>& xDataSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
+ const rtl::Reference<DataSeries> xDataSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xDataSeries.is())
return;
- uno::Reference<chart2::XDiagram> xDiagram = xModel->getFirstDiagram();
- DiagramHelper::attachSeriesToAxis(bPrimary, xDataSeries, xDiagram, comphelper::getProcessComponentContext());
+ rtl::Reference<Diagram> xDiagram = xModel->getFirstChartDiagram();
+ xDiagram->attachSeriesToAxis(bPrimary, xDataSeries, comphelper::getProcessComponentContext());
}
-css::uno::Reference<css::chart2::XChartType> getChartType(
+rtl::Reference<ChartType> getChartType(
const rtl::Reference<::chart::ChartModel>& xModel)
{
rtl::Reference<Diagram> xDiagram = xModel->getFirstChartDiagram();
const std::vector< rtl::Reference< BaseCoordinateSystem > > xCooSysSequence( xDiagram->getBaseCoordinateSystems());
- css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > > xChartTypeSequence( xCooSysSequence[0]->getChartTypes() );
- return xChartTypeSequence[0];
+ return xCooSysSequence[0]->getChartTypes2()[0];
}
-OUString getSeriesLabel(const rtl::Reference<::chart::ChartModel>& xModel, const OUString& rCID)
+OUString getSeriesLabel(const rtl::Reference<::chart::ChartModel>& xModel, std::u16string_view rCID)
{
- css::uno::Reference< css::chart2::XDataSeries > xSeries =
+ rtl::Reference< DataSeries > xSeries =
ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
if (!xSeries.is())
return OUString();
- css::uno::Reference<css::chart2::XChartType> xChartType = getChartType(xModel);
- return DataSeriesHelper::getDataSeriesLabel(xSeries, xChartType->getRoleOfSequenceForSeriesLabel());
+ rtl::Reference<ChartType> xChartType = getChartType(xModel);
+ return xSeries->getLabelForRole(xChartType->getRoleOfSequenceForSeriesLabel());
}
OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
@@ -280,17 +274,17 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
ChartSeriesPanel::ChartSeriesPanel(
weld::Widget* pParent,
ChartController* pController)
- : PanelLayout(pParent, "ChartSeriesPanel", "modules/schart/ui/sidebarseries.ui")
- , mxCBLabel(m_xBuilder->weld_check_button("checkbutton_label"))
- , mxCBTrendline(m_xBuilder->weld_check_button("checkbutton_trendline"))
- , mxCBXError(m_xBuilder->weld_check_button("checkbutton_x_error"))
- , mxCBYError(m_xBuilder->weld_check_button("checkbutton_y_error"))
- , mxRBPrimaryAxis(m_xBuilder->weld_radio_button("radiobutton_primary_axis"))
- , mxRBSecondaryAxis(m_xBuilder->weld_radio_button("radiobutton_secondary_axis"))
- , mxBoxLabelPlacement(m_xBuilder->weld_widget("datalabel_box"))
- , mxLBLabelPlacement(m_xBuilder->weld_combo_box("comboboxtext_label"))
- , mxFTSeriesName(m_xBuilder->weld_label("label_series_name"))
- , mxFTSeriesTemplate(m_xBuilder->weld_label("label_series_tmpl"))
+ : PanelLayout(pParent, u"ChartSeriesPanel"_ustr, u"modules/schart/ui/sidebarseries.ui"_ustr)
+ , mxCBLabel(m_xBuilder->weld_check_button(u"checkbutton_label"_ustr))
+ , mxCBTrendline(m_xBuilder->weld_check_button(u"checkbutton_trendline"_ustr))
+ , mxCBXError(m_xBuilder->weld_check_button(u"checkbutton_x_error"_ustr))
+ , mxCBYError(m_xBuilder->weld_check_button(u"checkbutton_y_error"_ustr))
+ , mxRBPrimaryAxis(m_xBuilder->weld_radio_button(u"radiobutton_primary_axis"_ustr))
+ , mxRBSecondaryAxis(m_xBuilder->weld_radio_button(u"radiobutton_secondary_axis"_ustr))
+ , mxBoxLabelPlacement(m_xBuilder->weld_widget(u"datalabel_box"_ustr))
+ , mxLBLabelPlacement(m_xBuilder->weld_combo_box(u"comboboxtext_label"_ustr))
+ , mxFTSeriesName(m_xBuilder->weld_label(u"label_series_name"_ustr))
+ , mxFTSeriesTemplate(m_xBuilder->weld_label(u"label_series_tmpl"_ustr))
, mxModel(pController->getChartModel())
, mxListener(new ChartSidebarModifyListener(this))
, mxSelectionListener(new ChartSidebarSelectionListener(this, OBJECTTYPE_DATA_SERIES))
@@ -376,7 +370,7 @@ std::unique_ptr<PanelLayout> ChartSeriesPanel::Create (
ChartController* pController)
{
if (pParent == nullptr)
- throw lang::IllegalArgumentException("no parent Window given to ChartSeriesPanel::Create", nullptr, 0);
+ throw lang::IllegalArgumentException(u"no parent Window given to ChartSeriesPanel::Create"_ustr, nullptr, 0);
return std::make_unique<ChartSeriesPanel>(pParent, pController);
}
@@ -405,7 +399,7 @@ void ChartSeriesPanel::modelInvalid()
mbModelValid = false;
}
-void ChartSeriesPanel::doUpdateModel(rtl::Reference<::chart::ChartModel> xModel)
+void ChartSeriesPanel::doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel)
{
if (mbModelValid)
{
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
index b457667ec257..5b69cc3b959f 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
@@ -98,7 +98,7 @@ private:
bool mbModelValid;
void Initialize();
- void doUpdateModel(rtl::Reference<::chart::ChartModel> xModel);
+ void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
DECL_LINK(RadioBtnHdl, weld::Toggleable&, void);
diff --git a/chart2/source/controller/sidebar/ChartTypePanel.cxx b/chart2/source/controller/sidebar/ChartTypePanel.cxx
index d1d73fb3bd10..fa85ded6d4a6 100644
--- a/chart2/source/controller/sidebar/ChartTypePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartTypePanel.cxx
@@ -21,22 +21,16 @@
#include <TimerTriggeredControllerLock.hxx>
#include <ChartController.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
#include <ChartResourceGroups.hxx>
#include <ChartTypeDialogController.hxx>
#include <ChartTypeManager.hxx>
#include <ChartTypeTemplate.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <unonames.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
-
#include <svtools/valueset.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace css;
using namespace css::uno;
@@ -44,7 +38,7 @@ using namespace css::uno;
namespace chart::sidebar
{
ChartTypePanel::ChartTypePanel(weld::Widget* pParent, ::chart::ChartController* pController)
- : PanelLayout(pParent, "ChartTypePanel", "modules/schart/ui/sidebartype.ui")
+ : PanelLayout(pParent, u"ChartTypePanel"_ustr, u"modules/schart/ui/sidebartype.ui"_ustr)
, mxListener(new ChartSidebarModifyListener(this))
, mbModelValid(true)
, m_pDim3DLookResourceGroup(new Dim3DLookResourceGroup(m_xBuilder.get()))
@@ -58,9 +52,9 @@ ChartTypePanel::ChartTypePanel(weld::Widget* pParent, ::chart::ChartController*
, m_pCurrentMainType(nullptr)
, m_nChangingCalls(0)
, m_aTimerTriggeredControllerLock(m_xChartModel)
- , m_xMainTypeList(m_xBuilder->weld_combo_box("cmb_chartType"))
- , m_xSubTypeList(new ValueSet(m_xBuilder->weld_scrolled_window("subtypewin", true)))
- , m_xSubTypeListWin(new weld::CustomWeld(*m_xBuilder, "subtype", *m_xSubTypeList))
+ , m_xMainTypeList(m_xBuilder->weld_combo_box(u"cmb_chartType"_ustr))
+ , m_xSubTypeList(new ValueSet(m_xBuilder->weld_scrolled_window(u"subtypewin"_ustr, true)))
+ , m_xSubTypeListWin(new weld::CustomWeld(*m_xBuilder, u"subtype"_ustr, *m_xSubTypeList))
{
Size aSize(m_xSubTypeList->GetDrawingArea()->get_ref_device().LogicToPixel(
Size(120, 40), MapMode(MapUnit::MapAppFont)));
@@ -81,7 +75,7 @@ ChartTypePanel::ChartTypePanel(weld::Widget* pParent, ::chart::ChartController*
{
try
{
- xProps->getPropertyValue("EnableComplexChartTypes") >>= bEnableComplexChartTypes;
+ xProps->getPropertyValue(u"EnableComplexChartTypes"_ustr) >>= bEnableComplexChartTypes;
}
catch (const uno::Exception&)
{
@@ -91,7 +85,9 @@ ChartTypePanel::ChartTypePanel(weld::Widget* pParent, ::chart::ChartController*
m_aChartTypeDialogControllerList.push_back(std::make_unique<ColumnChartDialogController>());
m_aChartTypeDialogControllerList.push_back(std::make_unique<BarChartDialogController>());
+ m_aChartTypeDialogControllerList.push_back(std::make_unique<HistogramChartDialogController>());
m_aChartTypeDialogControllerList.push_back(std::make_unique<PieChartDialogController>());
+ m_aChartTypeDialogControllerList.push_back(std::make_unique<OfPieChartDialogController>());
m_aChartTypeDialogControllerList.push_back(std::make_unique<AreaChartDialogController>());
m_aChartTypeDialogControllerList.push_back(std::make_unique<LineChartDialogController>());
if (bEnableComplexChartTypes)
@@ -109,7 +105,7 @@ ChartTypePanel::ChartTypePanel(weld::Widget* pParent, ::chart::ChartController*
for (auto const& elem : m_aChartTypeDialogControllerList)
{
- m_xMainTypeList->append("", elem->getName(), elem->getImage());
+ m_xMainTypeList->append(u""_ustr, elem->getName(), elem->getImage());
elem->setChangeListener(this);
}
@@ -161,9 +157,10 @@ void ChartTypePanel::Initialize()
if (!m_xChartModel.is())
return;
rtl::Reference<::chart::ChartTypeManager> xChartTypeManager = m_xChartModel->getTypeManager();
- rtl::Reference<Diagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
- DiagramHelper::tTemplateWithServiceName aTemplate
- = DiagramHelper::getTemplateForDiagram(xDiagram, xChartTypeManager);
+ rtl::Reference<Diagram> xDiagram = m_xChartModel->getFirstChartDiagram();
+ Diagram::tTemplateWithServiceName aTemplate;
+ if (xDiagram)
+ aTemplate = xDiagram->getTemplate(xChartTypeManager);
OUString aServiceName(aTemplate.sServiceName);
bool bFound = false;
@@ -185,7 +182,7 @@ void ChartTypePanel::Initialize()
m_pCurrentMainType = getSelectedMainType();
//set ThreeDLookScheme
- aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme(xDiagram);
+ aParameter.eThreeDLookScheme = xDiagram->detectScheme();
if (!aParameter.b3DLook
&& aParameter.eThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Realistic)
aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic;
@@ -225,12 +222,13 @@ void ChartTypePanel::updateData()
if (!m_xChartModel.is())
return;
rtl::Reference<::chart::ChartTypeManager> xChartTypeManager = m_xChartModel->getTypeManager();
- rtl::Reference<Diagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
- DiagramHelper::tTemplateWithServiceName aTemplate
- = DiagramHelper::getTemplateForDiagram(xDiagram, xChartTypeManager);
+ rtl::Reference<Diagram> xDiagram = m_xChartModel->getFirstChartDiagram();
+ Diagram::tTemplateWithServiceName aTemplate;
+ if (xDiagram)
+ aTemplate = xDiagram->getTemplate(xChartTypeManager);
OUString aServiceName(aTemplate.sServiceName);
- sal_uInt16 nM = 0;
+ //sal_uInt16 nM = 0;
for (auto const& elem : m_aChartTypeDialogControllerList)
{
if (elem->isSubType(aServiceName))
@@ -239,7 +237,7 @@ void ChartTypePanel::updateData()
//m_pMainTypeList->select_entry_region(nM, nM);
break;
}
- ++nM;
+ //++nM;
}
}
@@ -263,7 +261,7 @@ void ChartTypePanel::HandleContextChange(const vcl::EnumContext& rContext)
void ChartTypePanel::modelInvalid() { mbModelValid = false; }
-void ChartTypePanel::doUpdateModel(rtl::Reference<::chart::ChartModel> xModel)
+void ChartTypePanel::doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel)
{
if (mbModelValid)
{
@@ -371,8 +369,8 @@ void ChartTypePanel::stateChanged()
commitToModel(aParameter);
//detect the new ThreeDLookScheme
- rtl::Reference<Diagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
- aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme(xDiagram);
+ rtl::Reference<Diagram> xDiagram = m_xChartModel->getFirstChartDiagram();
+ aParameter.eThreeDLookScheme = xDiagram->detectScheme();
try
{
xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= aParameter.bSortByXValues;
@@ -393,7 +391,9 @@ void ChartTypePanel::commitToModel(const ChartTypeParameter& rParameter)
return;
m_aTimerTriggeredControllerLock.startTimer();
- m_pCurrentMainType->commitToModel(rParameter, m_xChartModel);
+ uno::Reference<beans::XPropertySet> xTemplateProps(
+ static_cast<cppu::OWeakObject*>(getCurrentTemplate().get()), uno::UNO_QUERY);
+ m_pCurrentMainType->commitToModel(rParameter, m_xChartModel, xTemplateProps);
}
void ChartTypePanel::selectMainType()
@@ -415,13 +415,12 @@ void ChartTypePanel::selectMainType()
m_pCurrentMainType->adjustParameterToMainType(aParameter);
commitToModel(aParameter);
//detect the new ThreeDLookScheme
- aParameter.eThreeDLookScheme
- = ThreeDHelper::detectScheme(ChartModelHelper::findDiagram(m_xChartModel));
+ aParameter.eThreeDLookScheme = m_xChartModel->getFirstChartDiagram()->detectScheme();
if (!aParameter.b3DLook
&& aParameter.eThreeDLookScheme != ThreeDLookScheme::ThreeDLookScheme_Realistic)
aParameter.eThreeDLookScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic;
- rtl::Reference<Diagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
+ rtl::Reference<Diagram> xDiagram = m_xChartModel->getFirstChartDiagram();
try
{
xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= aParameter.bSortByXValues;
diff --git a/chart2/source/controller/sidebar/ChartTypePanel.hxx b/chart2/source/controller/sidebar/ChartTypePanel.hxx
index 5555eba2f464..8df0020431db 100644
--- a/chart2/source/controller/sidebar/ChartTypePanel.hxx
+++ b/chart2/source/controller/sidebar/ChartTypePanel.hxx
@@ -94,7 +94,7 @@ private:
bool mbModelValid;
void Initialize();
- void doUpdateModel(rtl::Reference<::chart::ChartModel> xModel);
+ void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
std::unique_ptr<Dim3DLookResourceGroup> m_pDim3DLookResourceGroup;
std::unique_ptr<StackingResourceGroup> m_pStackingResourceGroup;
diff --git a/chart2/source/controller/uitest/uiobject.cxx b/chart2/source/controller/uitest/uiobject.cxx
index ef4f4d7112c8..edc93d370f0a 100644
--- a/chart2/source/controller/uitest/uiobject.cxx
+++ b/chart2/source/controller/uitest/uiobject.cxx
@@ -11,22 +11,20 @@
#include <uiobject.hxx>
#include <ChartWindow.hxx>
+#include <ChartView.hxx>
#include <ChartController.hxx>
#include <ChartModel.hxx>
#include <ObjectHierarchy.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-
-#include <comphelper/servicehelper.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <algorithm>
#include <iterator>
ChartUIObject::ChartUIObject(const VclPtr<chart::ChartWindow>& xChartWindow,
- const OUString& rCID):
- maCID(rCID),
+ OUString aCID):
+ maCID(std::move(aCID)),
mxChartWindow(xChartWindow)
{
}
@@ -34,7 +32,7 @@ ChartUIObject::ChartUIObject(const VclPtr<chart::ChartWindow>& xChartWindow,
StringMap ChartUIObject::get_state()
{
StringMap aMap;
- aMap["CID"] = maCID;
+ aMap[u"CID"_ustr] = maCID;
return aMap;
}
@@ -47,7 +45,7 @@ void ChartUIObject::execute(const OUString& rAction,
std::unique_ptr<UIObject> pWindow = mxChartWindow->GetUITestFactory()(mxChartWindow.get());
StringMap aParams;
- aParams["NAME"] = maCID;
+ aParams[u"NAME"_ustr] = maCID;
pWindow->execute(rAction, aParams);
}
else if (rAction == "COMMAND")
@@ -56,12 +54,12 @@ void ChartUIObject::execute(const OUString& rAction,
std::unique_ptr<UIObject> pWindow = mxChartWindow->GetUITestFactory()(mxChartWindow.get());
StringMap aParams;
- aParams["NAME"] = maCID;
- pWindow->execute("SELECT", aParams);
+ aParams[u"NAME"_ustr] = maCID;
+ pWindow->execute(u"SELECT"_ustr, aParams);
- auto itr = rParameters.find("COMMAND");
+ auto itr = rParameters.find(u"COMMAND"_ustr);
if (itr == rParameters.end())
- throw css::uno::RuntimeException("missing COMMAND parameter");
+ throw css::uno::RuntimeException(u"missing COMMAND parameter"_ustr);
maCommands.emplace_back(new OUString(itr->second));
OUString* pCommand = maCommands.rbegin()->get();
@@ -93,7 +91,15 @@ std::set<OUString> ChartUIObject::get_children() const
OUString ChartUIObject::get_type() const
{
- return "ChartUIObject for type: ";
+ return u"ChartUIObject for type: "_ustr;
+}
+
+bool ChartUIObject::equals(const UIObject& rOther) const
+{
+ const ChartUIObject* pOther = dynamic_cast<const ChartUIObject*>(&rOther);
+ if (!pOther)
+ return false;
+ return mxChartWindow.get() == pOther->mxChartWindow.get();
}
ChartWindowUIObject::ChartWindowUIObject(const VclPtr<chart::ChartWindow>& xChartWindow):
@@ -112,7 +118,7 @@ StringMap ChartWindowUIObject::get_state()
css::uno::Any aAny = pController->getSelection();
OUString aSelectedObject;
aAny >>= aSelectedObject;
- aMap["SelectedObject"] = aSelectedObject;
+ aMap[u"SelectedObject"_ustr] = aSelectedObject;
}
return aMap;
@@ -123,9 +129,9 @@ void ChartWindowUIObject::execute(const OUString& rAction,
{
if (rAction == "SELECT")
{
- auto itr = rParameters.find("NAME");
+ auto itr = rParameters.find(u"NAME"_ustr);
if (itr == rParameters.end())
- throw css::uno::RuntimeException("Missing Parameter 'NAME' for action 'SELECT'");
+ throw css::uno::RuntimeException(u"Missing Parameter 'NAME' for action 'SELECT'"_ustr);
const OUString& rName = itr->second;
@@ -144,7 +150,7 @@ std::unique_ptr<UIObject> ChartWindowUIObject::get_child(const OUString& rID)
if (chart::ObjectIdentifier::isCID(rID))
return std::unique_ptr<UIObject>(new ChartUIObject(mxChartWindow, rID));
- throw css::uno::RuntimeException("unknown child");
+ throw css::uno::RuntimeException(u"unknown child"_ustr);
}
namespace {
@@ -173,10 +179,9 @@ std::set<OUString> ChartWindowUIObject::get_children() const
if (!pController)
return aChildren;
- rtl::Reference<::chart::ChartModel> xChartDoc( pController->getChartModel() );
-
- css::uno::Reference<css::uno::XInterface> xChartView = pController->getChartView();
- chart::ExplicitValueProvider* pValueProvider = comphelper::getFromUnoTunnel<chart::ExplicitValueProvider>( xChartView );
+ rtl::Reference<::chart::ChartModel> xChartDoc = pController->getChartModel();
+ rtl::Reference<::chart::ChartView> xChartView = pController->getChartView();
+ chart::ChartView* pValueProvider = xChartView.get();
chart::ObjectHierarchy aHierarchy(xChartDoc, pValueProvider);
chart::ObjectIdentifier aIdentifier = chart::ObjectHierarchy::getRootNodeOID();
aChildren.insert(aIdentifier.getObjectCID());
@@ -196,7 +201,7 @@ std::unique_ptr<UIObject> ChartWindowUIObject::create(vcl::Window* pWindow)
OUString ChartWindowUIObject::get_name() const
{
- return "ChartWindowUIObject";
+ return u"ChartWindowUIObject"_ustr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/main/Axis.hxx b/chart2/source/inc/Axis.hxx
index b85930a23456..d42832c0fb7e 100644
--- a/chart2/source/model/main/Axis.hxx
+++ b/chart2/source/inc/Axis.hxx
@@ -18,8 +18,7 @@
*/
#pragma once
-#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
+#include "OPropertySet.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
@@ -27,10 +26,13 @@
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <ModifyListenerHelper.hxx>
+#include "ModifyListenerHelper.hxx"
+#include "PropertyHelper.hxx"
namespace chart
{
+class GridProperties;
+class Title;
namespace impl
{
@@ -45,7 +47,6 @@ typedef ::cppu::WeakImplHelper<
}
class Axis final :
- public cppu::BaseMutex,
public impl::Axis_Base,
public ::property::OPropertySet
{
@@ -75,6 +76,7 @@ private:
// ____ OPropertySet ____
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
+public:
// ____ XPropertySet ____
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
@@ -101,6 +103,13 @@ private:
virtual void SAL_CALL removeModifyListener(
const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
+ rtl::Reference< ::chart::Title > getTitleObject2() const;
+ void setTitleObject( const rtl::Reference< ::chart::Title >& xNewTitle );
+
+ rtl::Reference< ::chart::GridProperties > getGridProperties2();
+ std::vector< rtl::Reference< ::chart::GridProperties > > getSubGridProperties2();
+
+private:
// ____ XModifyListener ____
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
@@ -121,13 +130,15 @@ private:
css::chart2::ScaleData m_aScaleData;
- css::uno::Reference< css::beans::XPropertySet > m_xGrid;
+ rtl::Reference< ::chart::GridProperties > m_xGrid;
- css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > > m_aSubGridProperties;
+ std::vector< rtl::Reference< ::chart::GridProperties > > m_aSubGridProperties;
- css::uno::Reference< css::chart2::XTitle > m_xTitle;
+ rtl::Reference< ::chart::Title > m_xTitle;
};
+const ::chart::tPropertyValueMap & StaticAxisDefaults();
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx
index abe9ee1e257e..eff1bb4e28c4 100644
--- a/chart2/source/inc/AxisHelper.hxx
+++ b/chart2/source/inc/AxisHelper.hxx
@@ -18,29 +18,27 @@
*/
#pragma once
-#include "charttoolsdllapi.hxx"
+#include <config_options.h>
#include <com/sun/star/chart2/ScaleData.hpp>
#include <rtl/ref.hxx>
+#include "GridProperties.hxx"
#include <vector>
namespace chart { class ChartModel; }
namespace chart { class ExplicitCategoriesProvider; }
namespace chart { class ReferenceSizeProvider; }
-namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XAxis; }
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::chart2 { class XChartType; }
-namespace com::sun::star::chart2 { class XCoordinateSystem; }
-namespace com::sun::star::chart2 { class XDiagram; }
namespace com::sun::star::chart2 { class XScaling; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
+class Axis;
class BaseCoordinateSystem;
+class ChartType;
+class Diagram;
-class OOO_DLLPUBLIC_CHARTTOOLS AxisHelper
+class AxisHelper
{
public:
static css::uno::Reference< css::chart2::XScaling > createLinearScaling();
@@ -53,152 +51,151 @@ public:
static bool isLogarithmic( const css::uno::Reference< css::chart2::XScaling >& xScaling );
static void checkDateAxis( css::chart2::ScaleData& rScale, ExplicitCategoriesProvider* pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis );
- static css::chart2::ScaleData getDateCheckedScale( const css::uno::Reference< css::chart2::XAxis >& xAxis, ChartModel& rModel );
+ static css::chart2::ScaleData getDateCheckedScale( const rtl::Reference< ::chart::Axis >& xAxis, ChartModel& rModel );
static sal_Int32 getExplicitNumberFormatKeyForAxis(
- const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XCoordinateSystem >& xCorrespondingCoordinateSystem
- , const css::uno::Reference< css::chart2::XChartDocument>& xChartDoc
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCorrespondingCoordinateSystem
+ , const rtl::Reference< ::chart::ChartModel>& xChartDoc
, bool bSearchForParallelAxisIfNothingIsFound );
- static css::uno::Reference<
- css::chart2::XAxis >
+ static rtl::Reference< ::chart::Axis >
createAxis( sal_Int32 nDimensionIndex, bool bMainAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram
+ , const rtl::Reference< ::chart::Diagram >& xDiagram
, const css::uno::Reference< css::uno::XComponentContext >& xContext
, ReferenceSizeProvider * pRefSizeProvider = nullptr );
- static css::uno::Reference< css::chart2::XAxis >
+ static rtl::Reference< ::chart::Axis >
createAxis(
sal_Int32 nDimensionIndex
, sal_Int32 nAxisIndex // 0==main or 1==secondary axis
- , const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
, const css::uno::Reference< css::uno::XComponentContext > & xContext
, ReferenceSizeProvider * pRefSizeProvider = nullptr );
static void showAxis( sal_Int32 nDimensionIndex, bool bMainAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram
+ , const rtl::Reference< ::chart::Diagram >& xDiagram
, const css::uno::Reference< css::uno::XComponentContext >& xContext
, ReferenceSizeProvider * pRefSizeProvider = nullptr );
static void showGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
static void hideAxis( sal_Int32 nDimensionIndex, bool bMainAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
static void hideGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
static bool isAxisShown( sal_Int32 nDimensionIndex, bool bMainAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
static bool isGridShown( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
- static void makeAxisVisible( const css::uno::Reference< css::chart2::XAxis >& xAxis );
- static void makeGridVisible( const css::uno::Reference< css::beans::XPropertySet >& xGridProperties );
+ static void makeAxisVisible( const rtl::Reference< ::chart::Axis >& xAxis );
+ static void makeGridVisible( const rtl::Reference< ::chart::GridProperties >& xGridProperties );
- static void makeAxisInvisible( const css::uno::Reference< css::chart2::XAxis >& xAxis );
- static void makeGridInvisible( const css::uno::Reference< css::beans::XPropertySet >& xGridProperties );
+ static void makeAxisInvisible( const rtl::Reference< ::chart::Axis >& xAxis );
+ static void makeGridInvisible( const rtl::Reference< ::chart::GridProperties >& xGridProperties );
- static void hideAxisIfNoDataIsAttached( const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram);
+ static void hideAxisIfNoDataIsAttached( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram);
- SAL_DLLPRIVATE static bool areAxisLabelsVisible( const css::uno::Reference< css::beans::XPropertySet >& xAxisProperties );
- static bool isAxisVisible( const css::uno::Reference< css::chart2::XAxis >& xAxis );
- static bool isGridVisible( const css::uno::Reference< css::beans::XPropertySet >& xGridProperties );
+ static bool areAxisLabelsVisible( const rtl::Reference< ::chart::Axis >& xAxisProperties );
+ static bool isAxisVisible( const rtl::Reference< ::chart::Axis >& xAxis );
+ static bool isGridVisible( const rtl::Reference< ::chart::GridProperties >& xGridProperties );
static rtl::Reference< ::chart::BaseCoordinateSystem >
getCoordinateSystemByIndex(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram
+ const rtl::Reference< ::chart::Diagram >& xDiagram
, sal_Int32 nIndex );
static rtl::Reference< ::chart::BaseCoordinateSystem >
getCoordinateSystemOfAxis(
- const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
- static css::uno::Reference< css::chart2::XAxis >
+ static rtl::Reference< ::chart::Axis >
getAxis( sal_Int32 nDimensionIndex, bool bMainAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
- static css::uno::Reference< css::chart2::XAxis >
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
+ static rtl::Reference< ::chart::Axis >
getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex
- , const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys );
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
- static css::uno::Reference< css::chart2::XAxis >
- getCrossingMainAxis( const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys );
+ static rtl::Reference< ::chart::Axis >
+ getCrossingMainAxis( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
- static css::uno::Reference< css::chart2::XAxis >
- getParallelAxis( const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ static rtl::Reference< ::chart::Axis >
+ getParallelAxis( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
- static css::uno::Reference< css::beans::XPropertySet >
- getGridProperties( const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys
+ static rtl::Reference< ::chart::GridProperties >
+ getGridProperties( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
, sal_Int32 nDimensionIndex
, sal_Int32 nAxisIndex //0: Primary axis, 1: secondary axis
, sal_Int32 nSubGridIndex //-1: Main Grid; 0: First SubGrid etc
);
static sal_Int32 getDimensionIndexOfAxis(
- const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram );
static bool getIndicesForAxis(
- const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex );
static bool getIndicesForAxis(
- const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XDiagram >& xDiagram
+ const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::Diagram >& xDiagram
, sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex );
/** @param bOnlyVisible if </TRUE>, only axes with property "Show" set to
</sal_True> are returned
*/
- static css::uno::Sequence< css::uno::Reference< css::chart2::XAxis > >
- getAllAxesOfDiagram( const css::uno::Reference< css::chart2::XDiagram >& xDiagram
+ static std::vector< rtl::Reference< ::chart::Axis > >
+ getAllAxesOfDiagram( const rtl::Reference< ::chart::Diagram >& xDiagram
, bool bOnlyVisible = false );
/** @param bOnlyVisible if </TRUE>, only axes with property "Show" set to
</sal_True> are returned
*/
- SAL_DLLPRIVATE static std::vector< css::uno::Reference< css::chart2::XAxis > >
- getAllAxesOfCoordinateSystem( const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys
+ static std::vector< rtl::Reference< ::chart::Axis > >
+ getAllAxesOfCoordinateSystem( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
, bool bOnlyVisible = false );
- static css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > >
- getAllGrids( const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ static std::vector< rtl::Reference< ::chart::GridProperties > >
+ getAllGrids( const rtl::Reference< ::chart::Diagram >& xDiagram );
static void getAxisOrGridPossibilities( css::uno::Sequence< sal_Bool >& rPossibilityList
- , const css::uno::Reference< css::chart2::XDiagram>& xDiagram, bool bAxis=true );
+ , const rtl::Reference< ::chart::Diagram>& xDiagram, bool bAxis=true );
static void getAxisOrGridExistence( css::uno::Sequence< sal_Bool >& rExistenceList
- , const css::uno::Reference< css::chart2::XDiagram>& xDiagram, bool bAxis=true );
+ , const rtl::Reference< ::chart::Diagram>& xDiagram, bool bAxis=true );
- static bool changeVisibilityOfGrids( const css::uno::Reference< css::chart2::XDiagram>& xDiagram
+ static bool changeVisibilityOfGrids( const rtl::Reference< ::chart::Diagram>& xDiagram
, const css::uno::Sequence< sal_Bool >& rOldExistenceList
, const css::uno::Sequence< sal_Bool >& rNewExistenceList );
- static bool changeVisibilityOfAxes( const css::uno::Reference< css::chart2::XDiagram>& xDiagram
+ static bool changeVisibilityOfAxes( const rtl::Reference< ::chart::Diagram>& xDiagram
, const css::uno::Sequence< sal_Bool >& rOldExistenceList
, const css::uno::Sequence< sal_Bool >& rNewExistenceList
, const css::uno::Reference< css::uno::XComponentContext >& xContext
, ReferenceSizeProvider * pRefSizeProvider );
- static bool shouldAxisBeDisplayed( const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys );
- static bool isSecondaryYAxisNeeded( const css::uno::Reference<
- css::chart2::XCoordinateSystem >& xCooSys );
+ static bool shouldAxisBeDisplayed( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
+ static bool isSecondaryYAxisNeeded( const rtl::Reference<
+ ::chart::BaseCoordinateSystem >& xCooSys );
- static css::uno::Reference< css::chart2::XChartType >
- getChartTypeByIndex( const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys,
+ static rtl::Reference< ::chart::ChartType >
+ getChartTypeByIndex( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys,
sal_Int32 nIndex );
- static void setRTLAxisLayout( const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys );
+ static void setRTLAxisLayout( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
- static css::uno::Reference< css::chart2::XChartType >
- getFirstChartTypeWithSeriesAttachedToAxisIndex( const css::uno::Reference< css::chart2::XDiagram >& xDiagram, const sal_Int32 nAttachedAxisIndex );
+ static rtl::Reference< ::chart::ChartType >
+ getFirstChartTypeWithSeriesAttachedToAxisIndex( const rtl::Reference< ::chart::Diagram >& xDiagram, const sal_Int32 nAttachedAxisIndex );
static bool isAxisPositioningEnabled();
};
diff --git a/chart2/source/controller/inc/ConfigurationAccess.hxx b/chart2/source/inc/BaseColorScheme.hxx
index 2fb4636d2217..e916711be357 100644
--- a/chart2/source/controller/inc/ConfigurationAccess.hxx
+++ b/chart2/source/inc/BaseColorScheme.hxx
@@ -16,23 +16,29 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#pragma once
-#include <tools/fldunit.hxx>
+#include <cppuhelper/implbase.hxx>
+#include <com/sun/star/chart2/XColorScheme.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
-namespace chart::ConfigurationAccess
+namespace chart
{
-/** @descr Retrieve the FieldUnit to be used for the UI. This unit is retrieved
- from the registry settings of the Calc application.
-
- If this setting can not be found there is a fallback to cm which is the most
- common setting worldwide (or not?)
+class BaseColorScheme
+ : public ::cppu::WeakImplHelper<css::chart2::XColorScheme, css::lang::XServiceInfo>
+{
+public:
+ explicit BaseColorScheme();
- @return the FieldUnit enum. See <vcl/fldunit.hxx> for definition
- */
-FieldUnit getFieldUnit();
+ /// declare XServiceInfo methods
+ sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
-} //namespace chart
+protected:
+ // member variables
+ mutable css::uno::Sequence<sal_Int64> m_aColorSequence;
+ mutable sal_Int32 m_nNumberOfColors;
+};
+} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/BaseCoordinateSystem.hxx b/chart2/source/inc/BaseCoordinateSystem.hxx
index 4cfa7ab42c80..e9e6f095c541 100644
--- a/chart2/source/inc/BaseCoordinateSystem.hxx
+++ b/chart2/source/inc/BaseCoordinateSystem.hxx
@@ -19,7 +19,6 @@
#pragma once
#include "OPropertySet.hxx"
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -27,12 +26,15 @@
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include "ModifyListenerHelper.hxx"
-#include "charttoolsdllapi.hxx"
#include <vector>
namespace chart
{
+class Axis;
+class ChartType;
+class ExplicitCategoriesProvider;
+class ChartModel;
namespace impl
{
@@ -48,7 +50,6 @@ typedef ::cppu::WeakImplHelper
class SAL_DLLPUBLIC_RTTI BaseCoordinateSystem :
public impl::BaseCoordinateSystem_Base,
- public cppu::BaseMutex,
public ::property::OPropertySet
{
public:
@@ -87,7 +88,7 @@ public:
const css::uno::Reference< css::chart2::XChartType >& aChartType ) override;
virtual css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > > SAL_CALL getChartTypes() override;
virtual void SAL_CALL setChartTypes(
- const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > >& aChartTypes ) override;
+ const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > >& aChartTypes ) final override;
// ____ XModifyBroadcaster ____
virtual void SAL_CALL addModifyListener(
@@ -95,6 +96,14 @@ public:
virtual void SAL_CALL removeModifyListener(
const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
+ void setAxisByDimension( sal_Int32 nDimension, const rtl::Reference< ::chart::Axis >& xAxis, sal_Int32 nIndex );
+ const rtl::Reference< ::chart::Axis > & getAxisByDimension2(sal_Int32 nDimension, sal_Int32 nIndex ) const;
+
+ void setChartTypes( const std::vector< rtl::Reference< ::chart::ChartType > >& aChartTypes );
+ const std::vector< rtl::Reference<::chart::ChartType > > & getChartTypes2() const { return m_aChartTypes; }
+
+ ExplicitCategoriesProvider& getExplicitCategoriesProvider(ChartModel& rModel);
+
protected:
// ____ XModifyListener ____
@@ -111,14 +120,14 @@ protected:
void fireModifyEvent();
-protected:
- rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
-
private:
+ rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
sal_Int32 m_nDimensionCount;
- typedef std::vector< std::vector< css::uno::Reference< css::chart2::XAxis > > > tAxisVecVecType;
+ typedef std::vector< std::vector< rtl::Reference< ::chart::Axis > > > tAxisVecVecType;
tAxisVecVecType m_aAllAxis; //outer sequence is the dimension; inner sequence is the axis index that indicates main or secondary axis
- std::vector< css::uno::Reference< css::chart2::XChartType > > m_aChartTypes;
+ std::vector< rtl::Reference<::chart::ChartType > > m_aChartTypes;
+ // cache this here so we can share it across different parts of the code, it is expensive to create
+ std::unique_ptr<ExplicitCategoriesProvider> mxExplicitCategoriesProvider;
};
} // namespace chart
diff --git a/chart2/source/inc/BaseGFXHelper.hxx b/chart2/source/inc/BaseGFXHelper.hxx
index fd24fa2b45b6..54f26896339a 100644
--- a/chart2/source/inc/BaseGFXHelper.hxx
+++ b/chart2/source/inc/BaseGFXHelper.hxx
@@ -18,6 +18,7 @@
*/
#pragma once
+#include <config_options.h>
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <basegfx/range/b2irectangle.hxx>
#include <basegfx/tuple/b3dtuple.hxx>
@@ -28,7 +29,6 @@
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
-#include "charttoolsdllapi.hxx"
namespace com::sun::star::awt { struct Rectangle; }
namespace com::sun::star::drawing { struct PolyPolygonShape3D; }
@@ -36,22 +36,24 @@ namespace com::sun::star::drawing { struct PolyPolygonShape3D; }
namespace chart::BaseGFXHelper
{
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DRange getBoundVolume( const css::drawing::PolyPolygonShape3D& rPolyPoly );
+::basegfx::B3DRange getBoundVolume( const css::drawing::PolyPolygonShape3D& rPolyPoly );
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DRange getBoundVolume( const std::vector<std::vector<css::drawing::Position3D>>& rPolyPoly );
+::basegfx::B3DRange getBoundVolume( const std::vector<std::vector<css::drawing::Position3D>>& rPolyPoly );
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B2IRectangle makeRectangle(
+::basegfx::B2IRectangle makeRectangle(
const css::awt::Point& rPosition,
const css::awt::Size& rSize );
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B2IRectangle makeRectangle( const css::awt::Rectangle& rRect );
+::basegfx::B2IRectangle makeRectangle( const css::awt::Rectangle& rRect );
-OOO_DLLPUBLIC_CHARTTOOLS css::awt::Point B2IRectangleToAWTPoint(
+css::awt::Point B2IRectangleToAWTPoint(
const ::basegfx::B2IRectangle& rB2IRectangle );
-OOO_DLLPUBLIC_CHARTTOOLS css::awt::Size B2IRectangleToAWTSize(
+css::awt::Size B2IRectangleToAWTSize(
const ::basegfx::B2IRectangle& rB2IRectangle );
+css::awt::Rectangle toAwtRectangle(const basegfx::B2IRectangle& rB2IRectangle);
+
::basegfx::B3DVector Direction3DToB3DVector(
const css::drawing::Direction3D& rDirection );
@@ -64,17 +66,16 @@ css::drawing::Direction3D B3DVectorToDirection3D(
css::drawing::Position3D B3DVectorToPosition3D(
const ::basegfx::B3DVector& rB3DVector );
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix(
+::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix(
const css::drawing::HomogenMatrix & rHomogenMatrix );
-OOO_DLLPUBLIC_CHARTTOOLS
css::drawing::HomogenMatrix B3DHomMatrixToHomogenMatrix(
const ::basegfx::B3DHomMatrix & rB3DMatrix );
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DTuple GetRotationFromMatrix(
+::basegfx::B3DTuple GetRotationFromMatrix(
const ::basegfx::B3DHomMatrix & rB3DMatrix );
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DTuple GetScaleFromMatrix(
+::basegfx::B3DTuple GetScaleFromMatrix(
const ::basegfx::B3DHomMatrix & rB3DMatrix );
void ReduceToRotationMatrix( ::basegfx::B3DHomMatrix & rB3DMatrix );
diff --git a/chart2/source/inc/CachedDataSequence.hxx b/chart2/source/inc/CachedDataSequence.hxx
index e9c1b9d50d25..513907c2429d 100644
--- a/chart2/source/inc/CachedDataSequence.hxx
+++ b/chart2/source/inc/CachedDataSequence.hxx
@@ -19,10 +19,9 @@
#pragma once
// helper classes
-#include <cppuhelper/compbase.hxx>
+#include <comphelper/compbase.hxx>
#include <comphelper/uno3.hxx>
-#include <comphelper/broadcasthelper.hxx>
-#include <comphelper/propertycontainer.hxx>
+#include <comphelper/propertycontainer2.hxx>
#include <comphelper/proparrhlp.hxx>
// interfaces and types
@@ -41,7 +40,7 @@ namespace chart
namespace impl
{
-typedef ::cppu::WeakComponentImplHelper<
+typedef ::comphelper::WeakComponentImplHelper<
css::chart2::data::XDataSequence,
css::chart2::data::XNumericalDataSequence,
css::chart2::data::XTextualDataSequence,
@@ -56,8 +55,7 @@ typedef ::cppu::WeakComponentImplHelper<
* This sequence object does store actual values within, hence "cached".
*/
class CachedDataSequence final :
- public ::comphelper::OMutexAndBroadcastHelper,
- public ::comphelper::OPropertyContainer,
+ public ::comphelper::OPropertyContainer2,
public ::comphelper::OPropertyArrayUsageHelper< CachedDataSequence >,
public impl::CachedDataSequence_Base
{
@@ -93,7 +91,7 @@ private:
/// @see css::beans::XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
/// @see ::comphelper::OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+ virtual ::cppu::IPropertyArrayHelper& getInfoHelper() override;
/// @see ::comphelper::OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
diff --git a/chart2/source/inc/ChangingResource.hxx b/chart2/source/inc/ChangingResource.hxx
index bde5b0923400..dcb2aadbb974 100644
--- a/chart2/source/inc/ChangingResource.hxx
+++ b/chart2/source/inc/ChangingResource.hxx
@@ -21,7 +21,6 @@
namespace chart
{
-class ChangingResource;
class ResourceChangeListener
{
public:
diff --git a/chart2/source/inc/CharacterProperties.hxx b/chart2/source/inc/CharacterProperties.hxx
index 4dd7a4fbd113..be3f1f989165 100644
--- a/chart2/source/inc/CharacterProperties.hxx
+++ b/chart2/source/inc/CharacterProperties.hxx
@@ -20,7 +20,6 @@
#include "PropertyHelper.hxx"
#include "FastPropertyIdRanges.hxx"
-#include "charttoolsdllapi.hxx"
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <vector>
@@ -120,14 +119,14 @@ namespace CharacterProperties
FAST_PROPERTY_ID_END_CHAR_PROP
};
- OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(
+ void AddPropertiesToVector(
std::vector< css::beans::Property > & rOutProperties );
- OOO_DLLPUBLIC_CHARTTOOLS void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
+ void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
- OOO_DLLPUBLIC_CHARTTOOLS bool IsCharacterPropertyHandle( sal_Int32 nHandle );
+ bool IsCharacterPropertyHandle( sal_Int32 nHandle );
- OOO_DLLPUBLIC_CHARTTOOLS css::awt::FontDescriptor createFontDescriptorFromPropertySet(
+ css::awt::FontDescriptor createFontDescriptorFromPropertySet(
const css::uno::Reference< css::beans::XMultiPropertySet > & xMultiPropSet );
}
diff --git a/chart2/source/inc/ChartColorPaletteHelper.hxx b/chart2/source/inc/ChartColorPaletteHelper.hxx
new file mode 100644
index 000000000000..a580f6744a07
--- /dev/null
+++ b/chart2/source/inc/ChartColorPaletteHelper.hxx
@@ -0,0 +1,47 @@
+/* -*- 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 <svx/svxdllapi.h>
+#include <svx/ChartColorPaletteType.hxx>
+#include <docmodel/theme/Theme.hxx>
+#include <tools/gen.hxx>
+
+#include <array>
+
+class OutputDevice;
+
+namespace chart
+{
+class ChartColorPaletteHelper
+{
+public:
+ static constexpr size_t ColorfulPaletteSize = 4;
+ static constexpr size_t MonotonicPaletteSize = 6;
+
+ explicit ChartColorPaletteHelper(const std::shared_ptr<model::Theme>& pTheme);
+
+ ChartColorPalette getColorPalette(ChartColorPaletteType eType, sal_uInt32 nIndex) const;
+ static void renderColorPalette(OutputDevice* pDev, const tools::Rectangle& rDrawArea,
+ const ChartColorPalette& rColorSet,
+ bool bDrawItemBorder = false);
+ static void renderNoPalette(OutputDevice* pDev, const tools::Rectangle& rDrawArea);
+
+private:
+ void createBasePaletteFromTheme(const std::shared_ptr<model::Theme>& pTheme);
+ ChartColorPalette createColorfulPalette(sal_uInt32 nIndex) const;
+ ChartColorPalette createColorfulPaletteImpl(size_t nIdx1, size_t nIdx2, size_t nIdx3) const;
+ ChartColorPalette createMonotonicPalette(sal_uInt32 nIndex) const;
+
+ ChartColorPalette mBasePalette;
+};
+} // end namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/ChartColorPalettes.hxx b/chart2/source/inc/ChartColorPalettes.hxx
new file mode 100644
index 000000000000..78e12c396c6f
--- /dev/null
+++ b/chart2/source/inc/ChartColorPalettes.hxx
@@ -0,0 +1,36 @@
+/* -*- 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 <svx/ChartColorPaletteType.hxx>
+#include <svtools/valueset.hxx>
+
+namespace chart
+{
+class ChartColorPalettes final : public ValueSet
+{
+ std::vector<ChartColorPalette> maColorSets;
+
+public:
+ ChartColorPalettes()
+ : ValueSet(nullptr)
+ {
+ }
+
+ void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+ void UserDraw(const UserDrawEvent& rUserDrawEvent) override;
+ void StyleUpdated() override;
+
+ void insert(ChartColorPalette const& rColorSet);
+ const ChartColorPalette* getPalette(sal_uInt32 nItem) const;
+};
+} // end namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/TrueGuard.hxx b/chart2/source/inc/ChartColorScheme.hxx
index 528fd28fc265..f330d31ababc 100644
--- a/chart2/source/inc/TrueGuard.hxx
+++ b/chart2/source/inc/ChartColorScheme.hxx
@@ -18,19 +18,23 @@
*/
#pragma once
+#include "BaseColorScheme.hxx"
+#include <svx/ChartColorPaletteType.hxx>
+
namespace chart
{
-/** This guard sets the given boolean reference to true in the constructor and to false in the destructor
- */
-class TrueGuard final
+class ChartColorScheme final : public BaseColorScheme
{
public:
- explicit TrueGuard(bool& rbTrueDuringGuardedTime);
- ~TrueGuard();
+ explicit ChartColorScheme(const ChartColorPalette& rPalette);
+
+ /// declare XServiceInfo methods
+ OUString SAL_CALL getImplementationName() override;
-private:
- bool& m_rbTrueDuringGuardedTime;
+protected:
+ // ____ XColorScheme ____
+ ::sal_Int32 SAL_CALL getColorByIndex(::sal_Int32 nIndex) override;
};
-}
+} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx
deleted file mode 100644
index dfe864eeb0d4..000000000000
--- a/chart2/source/inc/ChartModelHelper.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- 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 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 .
- */
-#pragma once
-
-#include <com/sun/star/awt/Size.hpp>
-#include "charttoolsdllapi.hxx"
-#include <rtl/ref.hxx>
-
-#include <vector>
-
-namespace chart { class ChartModel; }
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::chart2 { class XChartType; }
-namespace com::sun::star::chart2 { class XCoordinateSystem; }
-namespace com::sun::star::chart2 { class XDataSeries; }
-namespace com::sun::star::chart2 { class XDiagram; }
-namespace com::sun::star::chart2::data { class XDataProvider; }
-namespace com::sun::star::chart2::data { class XRangeHighlighter; }
-namespace com::sun::star::frame { class XModel; }
-namespace com::sun::star::view { class XSelectionSupplier; }
-
-namespace chart
-{
-class BaseCoordinateSystem;
-class Diagram;
-class InternalDataProvider;
-
-class OOO_DLLPUBLIC_CHARTTOOLS ChartModelHelper
-{
-public:
- static css::uno::Reference< css::chart2::data::XRangeHighlighter > createRangeHighlighter(
- const css::uno::Reference< css::view::XSelectionSupplier >& xSelectionSupplier );
-
- static rtl::Reference< InternalDataProvider > createInternalDataProvider(
- const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc, bool bConnectToModel );
-
- static rtl::Reference< Diagram >
- findDiagram( const css::uno::Reference< css::frame::XModel >& xModel );
-
- static rtl::Reference< Diagram >
- findDiagram( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
-
- static rtl::Reference< Diagram >
- findDiagram( const rtl::Reference<::chart::ChartModel>& xChartDoc );
-
- static rtl::Reference< ::chart::BaseCoordinateSystem >
- getFirstCoordinateSystem( ChartModel& rModel );
-
- static rtl::Reference< ::chart::BaseCoordinateSystem >
- getFirstCoordinateSystem( const css::uno::Reference< css::frame::XModel >& xModel );
-
- SAL_DLLPRIVATE static std::vector< css::uno::Reference< css::chart2::XDataSeries > >
- getDataSeries( ChartModel& rModel );
-
- SAL_DLLPRIVATE static std::vector< css::uno::Reference< css::chart2::XDataSeries > >
- getDataSeries( const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc );
- static std::vector< css::uno::Reference< css::chart2::XDataSeries > >
- getDataSeries( const css::uno::Reference< css::frame::XModel > & xModel );
- static std::vector< css::uno::Reference< css::chart2::XDataSeries > >
- getDataSeries( const rtl::Reference< ::chart::ChartModel > & xModel );
-
- static css::uno::Reference< css::chart2::XChartType >
- getChartTypeOfSeries(
- const css::uno::Reference< css::frame::XModel >& xModel
- , const css::uno::Reference< css::chart2::XDataSeries >& xGivenDataSeries );
-
- static css::awt::Size getDefaultPageSize();
-
- static css::awt::Size getPageSize( const css::uno::Reference< css::frame::XModel >& xModel );
-
- static void triggerRangeHighlighting( const css::uno::Reference< css::frame::XModel >& xModel );
-
- static bool isIncludeHiddenCells( const css::uno::Reference< css::frame::XModel >& xChartModel );
-
- static bool setIncludeHiddenCells( bool bIncludeHiddenCells, ChartModel& rModel);
-};
-
-} //namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/ChartResourceGroups.hxx b/chart2/source/inc/ChartResourceGroups.hxx
index 8c263a7a6a75..9b6d5ee267f7 100644
--- a/chart2/source/inc/ChartResourceGroups.hxx
+++ b/chart2/source/inc/ChartResourceGroups.hxx
@@ -27,7 +27,6 @@
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
class SplinePropertiesDialog;
class SteppedPropertiesDialog;
@@ -113,16 +112,16 @@ private:
DECL_LINK(LineTypeChangeHdl, weld::ComboBox&, void);
DECL_LINK(SplineDetailsDialogHdl, weld::Button&, void);
DECL_LINK(SteppedDetailsDialogHdl, weld::Button&, void);
- SplinePropertiesDialog& getSplinePropertiesDialog();
- SteppedPropertiesDialog& getSteppedPropertiesDialog();
+ const std::shared_ptr<SplinePropertiesDialog>& getSplinePropertiesDialog();
+ const std::shared_ptr<SteppedPropertiesDialog>& getSteppedPropertiesDialog();
private:
weld::Window* m_pParent;
std::unique_ptr<weld::Label> m_xFT_LineType;
std::unique_ptr<weld::ComboBox> m_xLB_LineType;
std::unique_ptr<weld::Button> m_xPB_DetailsDialog;
- std::unique_ptr<SplinePropertiesDialog> m_xSplinePropertiesDialog;
- std::unique_ptr<SteppedPropertiesDialog> m_xSteppedPropertiesDialog;
+ std::shared_ptr<SplinePropertiesDialog> m_xSplinePropertiesDialog;
+ std::shared_ptr<SteppedPropertiesDialog> m_xSteppedPropertiesDialog;
};
class GeometryResourceGroup final : public ChangingResource
diff --git a/chart2/source/model/template/ChartType.hxx b/chart2/source/inc/ChartType.hxx
index 74e8bcb14300..2ae78395e30e 100644
--- a/chart2/source/model/template/ChartType.hxx
+++ b/chart2/source/inc/ChartType.hxx
@@ -18,8 +18,7 @@
*/
#pragma once
-#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
+#include "OPropertySet.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -28,11 +27,25 @@
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
+#include <rtl/ref.hxx>
#include <vector>
namespace chart
{
+class BaseCoordinateSystem;
+class DataSeries;
+class ModifyEventForwarder;
+
+enum
+{
+ PROP_PIECHARTTYPE_USE_RINGS,
+ PROP_PIECHARTTYPE_3DRELATIVEHEIGHT,
+ PROP_PIECHARTTYPE_SUBTYPE, // none, of-bar, of-pie
+ PROP_PIECHARTTYPE_SPLIT_POS
+};
+
+
namespace impl
{
@@ -47,7 +60,6 @@ typedef ::cppu::WeakImplHelper<
}
class ChartType :
- public cppu::BaseMutex,
public impl::ChartType_Base,
public ::property::OPropertySet
{
@@ -58,14 +70,13 @@ public:
/// merge XInterface implementations
DECLARE_XINTERFACE()
-protected:
explicit ChartType( const ChartType & rOther );
// ____ XChartType ____
// still abstract ! implement !
virtual OUString SAL_CALL getChartType() override = 0;
virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
- createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
+ createCoordinateSystem( ::sal_Int32 DimensionCount ) final override;
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedMandatoryRoles() override;
virtual css::uno::Sequence< OUString > SAL_CALL
@@ -89,6 +100,49 @@ protected:
virtual void SAL_CALL removeModifyListener(
const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
+ virtual rtl::Reference<ChartType> cloneChartType() const = 0;
+
+ void addDataSeries(
+ const rtl::Reference< ::chart::DataSeries >& aDataSeries );
+ void removeDataSeries(
+ const rtl::Reference< ::chart::DataSeries >& aDataSeries );
+ void setDataSeries(
+ const std::vector< rtl::Reference< ::chart::DataSeries > >& aDataSeries );
+
+ const std::vector<rtl::Reference<::chart::DataSeries>>& getDataSeries2() const;
+
+ virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+ createCoordinateSystem2( sal_Int32 DimensionCount );
+
+ virtual void createCalculatedDataSeries();
+
+ void deleteSeries( const rtl::Reference< ::chart::DataSeries > & xSeries );
+
+ // Tools
+ bool isSupportingMainAxis(sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex);
+ bool isSupportingStatisticProperties(sal_Int32 nDimensionCount);
+ bool isSupportingRegressionProperties(sal_Int32 nDimensionCount);
+ bool isSupportingGeometryProperties(sal_Int32 nDimensionCount);
+ bool isSupportingAreaProperties(sal_Int32 nDimensionCount);
+ bool isSupportingSymbolProperties(sal_Int32 nDimensionCount);
+ bool isSupportingSecondaryAxis(sal_Int32 nDimensionCount);
+ bool isSupportingRightAngledAxes();
+ bool isSupportingOverlapAndGapWidthProperties(sal_Int32 nDimensionCount);
+ bool isSupportingBarConnectors(sal_Int32 nDimensionCount);
+ bool isSupportingAxisSideBySide(sal_Int32 nDimensionCount);
+ bool isSupportingBaseValue();
+ bool isSupportingAxisPositioning(sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex);
+ bool isSupportingStartingAngle();
+ bool isSupportingDateAxis(sal_Int32 nDimensionIndex);
+ bool isSupportingComplexCategory();
+ bool isSupportingCategoryPositioning(sal_Int32 nDimensionIndex);
+ bool isSupportingOnlyDeepStackingFor3D();
+ bool isSeriesInFrontOfAxisLine();
+
+ sal_Int32 getAxisType(sal_Int32 nDimensionIndex);
+
+protected:
+
// ____ XModifyListener ____
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
@@ -114,16 +168,14 @@ protected:
DECLARE_XTYPEPROVIDER()
protected:
- css::uno::Reference< css::util::XModifyListener >
- const m_xModifyEventForwarder;
+ rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
private:
void impl_addDataSeriesWithoutNotification(
- const css::uno::Reference< css::chart2::XDataSeries >& aDataSeries );
+ const rtl::Reference< ::chart::DataSeries >& aDataSeries );
-private:
- typedef
- std::vector< css::uno::Reference< css::chart2::XDataSeries > > tDataSeriesContainerType;
+protected:
+ typedef std::vector<rtl::Reference<::chart::DataSeries>> tDataSeriesContainerType;
// --- mutable members: the following members need mutex guard ---
diff --git a/chart2/source/inc/ChartTypeDialogController.hxx b/chart2/source/inc/ChartTypeDialogController.hxx
index a027c99d7ac5..d052f0d76e1c 100644
--- a/chart2/source/inc/ChartTypeDialogController.hxx
+++ b/chart2/source/inc/ChartTypeDialogController.hxx
@@ -33,18 +33,6 @@ namespace com::sun::star::beans
{
class XPropertySet;
}
-namespace com::sun::star::chart2
-{
-class XChartDocument;
-}
-namespace com::sun::star::chart2
-{
-class XChartTypeTemplate;
-}
-namespace com::sun::star::lang
-{
-class XMultiServiceFactory;
-}
class ValueSet;
@@ -134,8 +122,10 @@ public:
virtual void adjustParameterToSubType(ChartTypeParameter& rParameter);
virtual void adjustParameterToMainType(ChartTypeParameter& rParameter);
OUString getServiceNameForParameter(const ChartTypeParameter& rParameter) const;
- void commitToModel(const ChartTypeParameter& rParameter,
- const rtl::Reference<::chart::ChartModel>& xChartModel);
+ void
+ commitToModel(const ChartTypeParameter& rParameter,
+ const rtl::Reference<::chart::ChartModel>& xChartModel,
+ const css::uno::Reference<com::sun::star::beans::XPropertySet>& xTemplateProps);
rtl::Reference<::chart::ChartTypeTemplate>
getCurrentTemplate(const ChartTypeParameter& rParameter,
const rtl::Reference<::chart::ChartTypeManager>& xTemplateManager) const;
@@ -183,6 +173,20 @@ public:
const ChartTypeParameter& rParameter) override;
};
+class HistogramChartDialogController final : public ChartTypeDialogController
+{
+public:
+ HistogramChartDialogController();
+ virtual ~HistogramChartDialogController() override;
+
+ virtual OUString getName() override;
+ virtual OUString getImage() override;
+ virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override;
+ virtual void fillSubTypeList(ValueSet& rSubTypeList,
+ const ChartTypeParameter& rParameter) override;
+ virtual void adjustParameterToSubType(ChartTypeParameter& rParameter) override;
+};
+
class PieChartDialogController final : public ChartTypeDialogController
{
public:
@@ -199,6 +203,38 @@ public:
virtual bool shouldShow_3DLookControl() const override;
};
+class OfPieChartDialogController final : public ChartTypeDialogController
+{
+public:
+ OfPieChartDialogController();
+ virtual ~OfPieChartDialogController() override;
+
+ virtual OUString getName() override;
+ virtual OUString getImage() override;
+ virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override;
+ virtual void fillSubTypeList(ValueSet& rSubTypeList,
+ const ChartTypeParameter& rParameter) override;
+ virtual void adjustParameterToSubType(ChartTypeParameter& rParameter) override;
+
+ virtual bool shouldShow_3DLookControl() const override;
+
+ virtual void showExtraControls(weld::Builder* pBuilder) override;
+ virtual void hideExtraControls() const override;
+ virtual void fillExtraControls(
+ const rtl::Reference<::chart::ChartModel>& xChartModel,
+ const css::uno::Reference<css::beans::XPropertySet>& xTemplateProps) const override;
+
+ virtual void setTemplateProperties(
+ const css::uno::Reference<css::beans::XPropertySet>& xTemplateProps) const override;
+
+private:
+ DECL_LINK(ChangeCompositeSizeHdl, weld::SpinButton&, void);
+
+private:
+ std::unique_ptr<weld::Label> m_xFT_CompositeSize;
+ std::unique_ptr<weld::SpinButton> m_xMF_CompositeSize;
+};
+
class LineChartDialogController final : public ChartTypeDialogController
{
public:
diff --git a/chart2/source/inc/ChartTypeHelper.hxx b/chart2/source/inc/ChartTypeHelper.hxx
index d4917be283fb..0addc73790db 100644
--- a/chart2/source/inc/ChartTypeHelper.hxx
+++ b/chart2/source/inc/ChartTypeHelper.hxx
@@ -19,67 +19,43 @@
#pragma once
+#include <config_options.h>
#include <com/sun/star/drawing/Direction3D.hpp>
-#include "charttoolsdllapi.hxx"
-
-namespace com::sun::star::chart2 { class XChartType; }
-namespace com::sun::star::chart2 { class XDataSeries; }
+#include "ChartType.hxx"
+#include <rtl/ref.hxx>
namespace chart
{
+class ChartType;
+class DataSeries;
-class OOO_DLLPUBLIC_CHARTTOOLS ChartTypeHelper
+class ChartTypeHelper
{
public:
- static bool isSupportingGeometryProperties( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingStatisticProperties( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingRegressionProperties(const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingMainAxis( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
- static bool isSupportingSecondaryAxis( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingAreaProperties( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingSymbolProperties( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingOverlapAndGapWidthProperties( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingBarConnectors( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingRightAngledAxes( const css::uno::Reference< css::chart2::XChartType >& xChartType );
- static bool isSupportingAxisSideBySide( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool isSupportingStartingAngle( const css::uno::Reference< css::chart2::XChartType >& xChartType );
//starting value for bars or baseline for areas for example
- static bool isSupportingBaseValue( const css::uno::Reference< css::chart2::XChartType >& xChartType );
- static bool isSupportingAxisPositioning( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
- static bool isSupportingDateAxis( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionIndex );
- static bool isSupportingComplexCategory( const css::uno::Reference< css::chart2::XChartType >& xChartType );
- static bool isSupportingCategoryPositioning( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount );
- static bool shiftCategoryPosAtXAxisPerDefault( const css::uno::Reference< css::chart2::XChartType >& xChartType );
+ static bool shiftCategoryPosAtXAxisPerDefault( const rtl::Reference< ::chart::ChartType >& xChartType );
//returns sequence of css::chart::DataLabelPlacement
static css::uno::Sequence < sal_Int32 > getSupportedLabelPlacements(
- const css::uno::Reference< css::chart2::XChartType >& xChartType, bool bSwapXAndY
- , const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
+ const rtl::Reference< ::chart::ChartType >& xChartType, bool bSwapXAndY
+ , const rtl::Reference< ::chart::DataSeries >& xSeries );
//returns sequence of css::chart::MissingValueTreatment
static css::uno::Sequence < sal_Int32 > getSupportedMissingValueTreatments(
- const css::uno::Reference< css::chart2::XChartType >& xChartType );
-
- SAL_DLLPRIVATE static css::drawing::Direction3D getDefaultSimpleLightDirection( const css::uno::Reference< css::chart2::XChartType >& xChartType );
- SAL_DLLPRIVATE static css::drawing::Direction3D getDefaultRealisticLightDirection( const css::uno::Reference< css::chart2::XChartType >& xChartType );
- SAL_DLLPRIVATE static sal_Int32 getDefaultDirectLightColor( bool bSimple, const css::uno::Reference< css::chart2::XChartType >& xChartType );
- SAL_DLLPRIVATE static sal_Int32 getDefaultAmbientLightColor( bool bSimple, const css::uno::Reference< css::chart2::XChartType >& xChartType );
- static sal_Int32 getNumberOfDisplayedSeries( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nNumberOfSeries );
- SAL_DLLPRIVATE static bool noBordersForSimpleScheme( const css::uno::Reference< css::chart2::XChartType >& xChartType );
-
- static bool isSeriesInFrontOfAxisLine( const css::uno::Reference< css::chart2::XChartType >& xChartType );
-
- static sal_Int32 //one of css::chart2::AxisType
- getAxisType( const css::uno::Reference< css::chart2::XChartType >& xChartType
- , sal_Int32 nDimensionIndex );
+ const rtl::Reference< ::chart::ChartType >& xChartType );
- static OUString getRoleOfSequenceForYAxisNumberFormatDetection( const css::uno::Reference<
- css::chart2::XChartType >& xChartType );
+ static css::drawing::Direction3D getDefaultSimpleLightDirection( const rtl::Reference< ::chart::ChartType >& xChartType );
+ static css::drawing::Direction3D getDefaultRealisticLightDirection( const rtl::Reference< ::chart::ChartType >& xChartType );
+ static sal_Int32 getDefaultDirectLightColor( bool bSimple, const rtl::Reference< ::chart::ChartType >& xChartType );
+ static sal_Int32 getDefaultAmbientLightColor( bool bSimple, const rtl::Reference< ::chart::ChartType >& xChartType );
+ static sal_Int32 getNumberOfDisplayedSeries( const rtl::Reference< ::chart::ChartType >& xChartType, sal_Int32 nNumberOfSeries );
+ static bool noBordersForSimpleScheme( const rtl::Reference< ::chart::ChartType >& xChartType );
- static OUString getRoleOfSequenceForDataLabelNumberFormatDetection( const css::uno::Reference<
- css::chart2::XChartType >& xChartType );
+ static OUString getRoleOfSequenceForYAxisNumberFormatDetection( const rtl::Reference<
+ ::chart::ChartType >& xChartType );
- static bool isSupportingOnlyDeepStackingFor3D( const css::uno::Reference< css::chart2::XChartType >& xChartType );
+ static OUString getRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::Reference<
+ ::chart::ChartType >& xChartType );
};
} //namespace chart
diff --git a/chart2/source/inc/ChartTypeTemplate.hxx b/chart2/source/inc/ChartTypeTemplate.hxx
index 560fc32fd167..9e641eeaea1e 100644
--- a/chart2/source/inc/ChartTypeTemplate.hxx
+++ b/chart2/source/inc/ChartTypeTemplate.hxx
@@ -19,18 +19,27 @@
#pragma once
#include <cppuhelper/implbase.hxx>
+#include "DataInterpreter.hxx"
#include "StackMode.hxx"
#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
-#include "charttoolsdllapi.hxx"
+#include <rtl/ref.hxx>
+#include <vector>
+namespace com::sun::star::beans { struct PropertyValue; }
namespace com::sun::star::chart2 { class XChartType; }
-namespace com::sun::star::chart2 { class XCoordinateSystemContainer; }
namespace com::sun::star::chart2 { class XDataSeries; }
+namespace com::sun::star::chart2 { class XDiagram; }
+namespace com::sun::star::chart2::data { class XDataSource; }
+namespace com::sun::star::chart2::data { class XLabeledDataSequence; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
+class BaseCoordinateSystem;
+class ChartType;
+class DataSeries;
+class Diagram;
/** For creating diagrams and modifying existing diagrams. A base class that
implements XChartTypeTemplate and offers some tooling for classes that
@@ -66,45 +75,69 @@ namespace chart
* create an XLegend via the global service factory, set it at the diagram.
*/
-class SAL_DLLPUBLIC_RTTI ChartTypeTemplate : public ::cppu::WeakImplHelper<
+class ChartTypeTemplate : public ::cppu::WeakImplHelper<
css::chart2::XChartTypeTemplate,
css::lang::XServiceName >
{
public:
explicit ChartTypeTemplate( css::uno::Reference< css::uno::XComponentContext > const & xContext,
- const OUString & rServiceName );
+ OUString aServiceName );
virtual ~ChartTypeTemplate() override;
+ rtl::Reference< ::chart::Diagram > createDiagramByDataSource2(
+ const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArguments );
+
// ____ XChartTypeTemplate ____
virtual css::uno::Reference< css::chart2::XDiagram > SAL_CALL createDiagramByDataSource(
const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource,
- const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override;
+ const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override final;
/// denotes if the chart needs categories at the first scale
virtual sal_Bool SAL_CALL supportsCategories() override;
-
virtual void SAL_CALL changeDiagram(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override;
+ const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override final;
virtual void SAL_CALL changeDiagramData(
const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource,
- const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override;
+ const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override final;
virtual sal_Bool SAL_CALL matchesTemplate(
- const css::uno::Reference<
- css::chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties ) override;
- // still abstract: getChartTypeForNewSeries()
- virtual css::uno::Reference< css::chart2::XDataInterpreter > SAL_CALL getDataInterpreter() override;
+ const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
+ sal_Bool bAdaptProperties ) override final;
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getDataInterpreter() override final;
+ virtual css::uno::Reference< ::css::chart2::XChartType > SAL_CALL getChartTypeForNewSeries(
+ const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override final;
virtual void SAL_CALL applyStyle(
const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
- ::sal_Int32 nSeriesCount ) override;
+ ::sal_Int32 nSeriesCount ) override final;
virtual void SAL_CALL resetStyles(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override;
+ const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override final;
+
+ void changeDiagram(
+ const rtl::Reference< ::chart::Diagram >& xDiagram );
+ void changeDiagramData(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArguments );
+ virtual bool matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties );
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) = 0;
+ virtual rtl::Reference< ::chart::DataInterpreter > getDataInterpreter2();
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
+ ::sal_Int32 nChartTypeIndex,
+ ::sal_Int32 nSeriesIndex,
+ ::sal_Int32 nSeriesCount );
+ virtual void resetStyles2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram );
/// @throws css::uno::RuntimeException
void applyStyles(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
+ const rtl::Reference< ::chart::Diagram >& xDiagram );
// ____ XServiceName ____
virtual OUString SAL_CALL getServiceName() override;
@@ -124,7 +157,7 @@ public:
*/
virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const;
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) = 0;
virtual bool isSwapXAndY() const;
@@ -137,7 +170,7 @@ public:
changeDiagram
*/
virtual void adaptDiagram(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
/** Creates a 2d or 3d cartesian coordinate system with mathematically
oriented, linear scales with auto-min/max. If the given
@@ -147,7 +180,7 @@ public:
<p>The dimension depends on the value returned by getDimension().</p>
*/
virtual void createCoordinateSystems(
- const css::uno::Reference< css::chart2::XCoordinateSystemContainer > & xOutCooSysCnt );
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
/** Sets categories at the scales of dimension 0 and the percent stacking at
the scales of dimension 1 of all given coordinate systems.
@@ -155,7 +188,7 @@ public:
<p>Called by FillDiagram.</p>
*/
virtual void adaptScales(
- const css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > > & aCooSysSeq,
+ const std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > > & aCooSysSeq,
const css::uno::Reference< css::chart2::data::XLabeledDataSequence > & xCategories );
/** create a data series tree, that fits the requirements of the chart type.
@@ -184,16 +217,14 @@ public:
empty.</p>
*/
virtual void createChartTypes(
- const css::uno::Sequence<
- css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XDataSeries > > > & aSeriesSeq,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XCoordinateSystem > > & rCoordSys,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XChartType > > & aOldChartTypesSeq
+ const std::vector<
+ std::vector<
+ rtl::Reference<
+ ::chart::DataSeries > > > & aSeriesSeq,
+ const std::vector<
+ rtl::Reference<
+ ::chart::BaseCoordinateSystem > > & rCoordSys,
+ const std::vector< rtl::Reference< ChartType > > & aOldChartTypesSeq
);
/** create axes and add them to the given container. If there are already
@@ -205,7 +236,7 @@ public:
requesting a secondary axes a secondary y axes is added</p>
*/
void createAxes(
- const css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > > & rCoordSys );
+ const std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > > & rCoordSys );
/** Give the number of requested axis per dimension here. Default is one
axis for each dimension
@@ -215,18 +246,18 @@ public:
/** adapt properties of existing axes and remove superfluous axes
*/
virtual void adaptAxes(
- const css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > > & rCoordSys );
+ const std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > > & rCoordSys );
const css::uno::Reference< css::uno::XComponentContext >&
GetComponentContext() const { return m_xContext;}
static void copyPropertiesFromOldToNewCoordinateSystem(
- const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > > & rOldChartTypesSeq,
- const css::uno::Reference< css::chart2::XChartType > & xNewChartType );
+ const std::vector< rtl::Reference< ChartType > > & rOldChartTypesSeq,
+ const rtl::Reference< ChartType > & xNewChartType );
protected:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
- mutable css::uno::Reference< css::chart2::XDataInterpreter > m_xDataInterpreter;
+ mutable rtl::Reference< ::chart::DataInterpreter > m_xDataInterpreter;
private:
const OUString m_aServiceName;
@@ -234,17 +265,13 @@ private:
private:
/** modifies the given diagram
*/
- void FillDiagram( const css::uno::Reference<
- css::chart2::XDiagram > & xDiagram,
- const css::uno::Sequence<
- css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XDataSeries > > > & aSeriesSeq,
- const css::uno::Reference<
- css::chart2::data::XLabeledDataSequence >& xCategories,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XChartType > > & aOldChartTypesSeq);
+ void FillDiagram( const rtl::Reference< ::chart::Diagram >& xDiagram,
+ const std::vector<
+ std::vector<
+ rtl::Reference<
+ ::chart::DataSeries > > > & aSeriesSeq,
+ const css::uno::Reference< css::chart2::data::XLabeledDataSequence >& xCategories,
+ const std::vector< rtl::Reference< ChartType > > & aOldChartTypesSeq);
};
} // namespace chart
diff --git a/chart2/source/inc/ChartViewHelper.hxx b/chart2/source/inc/ChartViewHelper.hxx
index 54d23e8107a0..1a6425ffae55 100644
--- a/chart2/source/inc/ChartViewHelper.hxx
+++ b/chart2/source/inc/ChartViewHelper.hxx
@@ -18,23 +18,25 @@
*/
#pragma once
-#include "charttoolsdllapi.hxx"
+#include <config_options.h>
+#include <rtl/ref.hxx>
-namespace com::sun::star::uno
-{
-template <class interface_type> class Reference;
-}
-namespace com::sun::star::frame
+#include <com/sun/star/uno/Reference.hxx>
+
+namespace com::sun::star::chart2
{
-class XModel;
+class XChartDocument;
}
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS ChartViewHelper
+class ChartModel;
+
+namespace ChartViewHelper
{
-public:
- static void setViewToDirtyState(const css::uno::Reference<css::frame::XModel>& xChartModel);
+void setViewToDirtyState(const rtl::Reference<ChartModel>& xChartModel);
+
+void setViewToDirtyState_UNO(const css::uno::Reference<css::chart2::XChartDocument>& xChartModel);
};
} //namespace chart
diff --git a/chart2/source/inc/CloneHelper.hxx b/chart2/source/inc/CloneHelper.hxx
index d9771a2681f2..cabcdb58366f 100644
--- a/chart2/source/inc/CloneHelper.hxx
+++ b/chart2/source/inc/CloneHelper.hxx
@@ -19,8 +19,7 @@
#pragma once
#include <com/sun/star/util/XCloneable.hpp>
-
-#include <algorithm>
+#include <rtl/ref.hxx>
#include <iterator>
#include <vector>
@@ -54,6 +53,15 @@ template< class Interface >
CreateRefClone< Interface >());
}
+template< class T >
+ void CloneRefVector(
+ const std::vector< rtl::Reference< T > > & rSource,
+ std::vector< rtl::Reference< T > > & rDestination )
+{
+ for (const auto & rSourceItem : rSource)
+ rDestination.push_back(static_cast<T*>(rSourceItem->createClone().get()));
+}
+
/// clones a UNO-sequence of UNO-References
template< class Interface >
void CloneRefSequence(
diff --git a/chart2/source/inc/ColorPerPointHelper.hxx b/chart2/source/inc/ColorPerPointHelper.hxx
deleted file mode 100644
index f1665123b800..000000000000
--- a/chart2/source/inc/ColorPerPointHelper.hxx
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- 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 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 .
- */
-
-#pragma once
-
-#include "charttoolsdllapi.hxx"
-
-namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::uno { template <class interface_type> class Reference; }
-
-namespace chart
-{
-
-class OOO_DLLPUBLIC_CHARTTOOLS ColorPerPointHelper
-{
-public:
- static bool hasPointOwnColor(
- const css::uno::Reference< css::beans::XPropertySet >& xDataSeriesProperties
- , sal_Int32 nPointIndex
- , const css::uno::Reference< css::beans::XPropertySet >& xDataPointProperties //may be NULL this is just for performance
- );
-
- // returns true if AttributedDataPoints contains nPointIndex and the
- // property Color is DEFAULT
- SAL_DLLPRIVATE static bool hasPointOwnProperties(
- const css::uno::Reference< css::beans::XPropertySet >& xSeriesProperties
- , sal_Int32 nPointIndex );
-};
-
-} //namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/CommonConverters.hxx b/chart2/source/inc/CommonConverters.hxx
index d10bf91984c8..2716849ba804 100644
--- a/chart2/source/inc/CommonConverters.hxx
+++ b/chart2/source/inc/CommonConverters.hxx
@@ -30,7 +30,6 @@
#include <basegfx/point/b3dpoint.hxx>
#include <basegfx/vector/b3dvector.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include "charttoolsdllapi.hxx"
namespace com::sun::star::awt { struct Rectangle; }
namespace com::sun::star::chart2::data { class XDataSequence; }
@@ -46,173 +45,172 @@ and operations e.g drawing::Position3D + drawing::Direction3D
/** ::basegfx::B3DHomMatrix -> HomogenMatrix
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::HomogenMatrix
+css::drawing::HomogenMatrix
B3DHomMatrixToHomogenMatrix( const ::basegfx::B3DHomMatrix& rM );
/** HomogenMatrix -> ::basegfx::B3DHomMatrix
*/
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix( const css::drawing::HomogenMatrix& rHM );
+::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix( const css::drawing::HomogenMatrix& rHM );
/** ::basegfx::B3DHomMatrix -> B2DHomMatrix
*/
-OOO_DLLPUBLIC_CHARTTOOLS
+
::basegfx::B2DHomMatrix IgnoreZ( const ::basegfx::B3DHomMatrix& rM );
/** B2DHomMatrix <-> HomogenMatrix3
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::HomogenMatrix3
+css::drawing::HomogenMatrix3
B2DHomMatrixToHomogenMatrix3( const ::basegfx::B2DHomMatrix& rM );
/** Position3D -> B3DPoint
*/
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DPoint Position3DToB3DPoint( const css::drawing::Position3D& rPosition );
+::basegfx::B3DPoint Position3DToB3DPoint( const css::drawing::Position3D& rPosition );
/** B3DVector -> Direction3D
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Direction3D B3DVectorToDirection3D( const ::basegfx::B3DVector& rVector);
+css::drawing::Direction3D B3DVectorToDirection3D( const ::basegfx::B3DVector& rVector);
/** B3DPoint -> Position3D
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint);
+css::drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint);
/** Direction3D -> B3DVector
*/
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DVector Direction3DToB3DVector( const css::drawing::Direction3D& rDirection);
+::basegfx::B3DVector Direction3DToB3DVector( const css::drawing::Direction3D& rDirection);
/** PolyPolygonShape3D + drawing::Position3D -> PolyPolygonShape3D
*/
-OOO_DLLPUBLIC_CHARTTOOLS
+
void AddPointToPoly( css::drawing::PolyPolygonShape3D& rPoly
, const css::drawing::Position3D& rPos
, sal_Int32 nSequenceIndex=0 );
-OOO_DLLPUBLIC_CHARTTOOLS
+
void AddPointToPoly( std::vector<std::vector<css::drawing::Position3D>>& rPoly
, const css::drawing::Position3D& rPos
, sal_Int32 nSequenceIndex=0 );
/** get a single Point from a Polygon
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D getPointFromPoly(
+css::drawing::Position3D getPointFromPoly(
const std::vector<std::vector<css::drawing::Position3D>>& rPolygon
, sal_Int32 nPointIndex, sal_Int32 nPolyIndex );
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D getPointFromPoly(
+css::drawing::Position3D getPointFromPoly(
const css::drawing::PolyPolygonShape3D& rPolygon
, sal_Int32 nPointIndex, sal_Int32 nPolyIndex );
-OOO_DLLPUBLIC_CHARTTOOLS
+
void addPolygon( std::vector<std::vector<css::drawing::Position3D>>& rRet
, const std::vector<std::vector<css::drawing::Position3D>>& rAdd );
/** PolyPolygonShape3D + PolyPolygonShape3D -> PolyPolygonShape3D
*/
-OOO_DLLPUBLIC_CHARTTOOLS
+
void appendPoly( std::vector<std::vector<css::drawing::Position3D>>& rRet
, const std::vector<std::vector<css::drawing::Position3D>>& rAdd );
/** PolyPolygonBezierCoords -> PolyPolygonShape3D
*/
-OOO_DLLPUBLIC_CHARTTOOLS
+
css::drawing::PolyPolygonShape3D BezierToPoly(
const css::drawing::PolyPolygonBezierCoords& rBezier );
/** PolyPolygonShape3D -> drawing::PointSequenceSequence (2D)
*/
-OOO_DLLPUBLIC_CHARTTOOLS
+
css::drawing::PointSequenceSequence PolyToPointSequence(
const css::drawing::PolyPolygonShape3D& rPolyPolygon );
-OOO_DLLPUBLIC_CHARTTOOLS
+
css::drawing::PointSequenceSequence PolyToPointSequence(
const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon );
/** PolyPolygonShape3D -> basegfx::B2DPolyPolygon (2D)
*/
-OOO_DLLPUBLIC_CHARTTOOLS
+
basegfx::B2DPolyPolygon PolyToB2DPolyPolygon(
const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon );
/** drawing::PointSequenceSequence + drawing::PointSequenceSequence
*/
-OOO_DLLPUBLIC_CHARTTOOLS
+
void appendPointSequence( css::drawing::PointSequenceSequence& rTarget
- , css::drawing::PointSequenceSequence& rAdd );
+ , const css::drawing::PointSequenceSequence& rAdd );
/** Position3D + Direction3D == Position3D
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D
+css::drawing::Position3D
operator+( const css::drawing::Position3D& rPos
, const css::drawing::Direction3D& rDirection);
/** Position3D - Position3D == Direction3D
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Direction3D
+css::drawing::Direction3D
operator-( const css::drawing::Position3D& rPos1
, const css::drawing::Position3D& rPos2);
/** awt::Rect --> awt::Point (2D)
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::awt::Point ToPoint( const css::awt::Rectangle& rRectangle );
+css::awt::Point ToPoint( const css::awt::Rectangle& rRectangle );
/** awt::Rect --> awt::Size (2D)
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::awt::Size ToSize( const css::awt::Rectangle& rRectangle );
+css::awt::Size ToSize( const css::awt::Rectangle& rRectangle );
/** Position3D --> awt::Point (2D)
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::awt::Point Position3DToAWTPoint( const css::drawing::Position3D& rPos );
+css::awt::Point Position3DToAWTPoint( const css::drawing::Position3D& rPos );
/** Direction3D --> awt::Size (2D)
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::awt::Size Direction3DToAWTSize( const css::drawing::Direction3D& rDirection );
+css::awt::Size Direction3DToAWTSize( const css::drawing::Direction3D& rDirection );
/** Sequence<double> -> drawing::Position3D
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D
+css::drawing::Position3D
SequenceToPosition3D( const css::uno::Sequence< double >& rSeq );
/** chart2::XDataSequence -> uno::Sequence< double >
*/
-OOO_DLLPUBLIC_CHARTTOOLS
+
css::uno::Sequence< double > DataSequenceToDoubleSequence(
const css::uno::Reference< css::chart2::data::XDataSequence > & xDataSequence );
-OOO_DLLPUBLIC_CHARTTOOLS
+
css::uno::Sequence< OUString > DataSequenceToStringSequence(
const css::uno::Reference< css::chart2::data::XDataSequence > & xDataSequence );
-/** uno::Sequence< uno::Sequence< T > > -> uno::Sequence< T >
+/** std::vector< std::vector< T > > -> std::vector< T >
*/
template< typename T >
-css::uno::Sequence< T >
- FlattenSequence( const css::uno::Sequence< css::uno::Sequence< T > > & aSeqSeq )
+std::vector< T >
+ FlattenSequence( const std::vector< std::vector< T > > & aSeqSeq )
{
sal_Int32 nOuter, nInner, nCount = 0,
nResultSize = 0;
- const sal_Int32 nOuterSize = aSeqSeq.getLength();
+ const sal_Int32 nOuterSize = aSeqSeq.size();
for( nOuter=0; nOuter<nOuterSize; ++nOuter )
- nResultSize += aSeqSeq[nOuter].getLength();
- css::uno::Sequence< T > aResult( nResultSize );
- auto aResultRange = asNonConstRange(aResult);
+ nResultSize += aSeqSeq[nOuter].size();
+ std::vector< T > aResult( nResultSize );
for( nOuter=0; nOuter<nOuterSize; ++nOuter )
{
- const sal_Int32 nInnerSize = aSeqSeq[nOuter].getLength();
+ const sal_Int32 nInnerSize = aSeqSeq[nOuter].size();
for( nInner=0; nInner<nInnerSize; ++nInner, ++nCount )
- aResultRange[nCount] = aSeqSeq[nOuter][nInner];
+ aResult[nCount] = aSeqSeq[nOuter][nInner];
}
return aResult;
}
-OOO_DLLPUBLIC_CHARTTOOLS
+
bool hasDoubleValue( const css::uno::Any& rAny );
-OOO_DLLPUBLIC_CHARTTOOLS
+
bool hasLongOrShortValue( const css::uno::Any& rAny );
-OOO_DLLPUBLIC_CHARTTOOLS
+
sal_Int16 getShortForLongAlso( const css::uno::Any& rAny );
-OOO_DLLPUBLIC_CHARTTOOLS
+
bool replaceParamterInString( OUString & rInOutResourceString,
- const OUString & rParamToReplace,
+ std::u16string_view rParamToReplace,
std::u16string_view rReplaceWith );
} //namespace chart
diff --git a/chart2/source/inc/CommonFunctors.hxx b/chart2/source/inc/CommonFunctors.hxx
index 0340c82b692e..bbbdce3ed960 100644
--- a/chart2/source/inc/CommonFunctors.hxx
+++ b/chart2/source/inc/CommonFunctors.hxx
@@ -21,9 +21,10 @@
#include <o3tl/any.hxx>
#include <rtl/math.hxx>
#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
#include <rtl/ustring.hxx>
-#include "charttoolsdllapi.hxx"
+#include <algorithm>
#include <limits>
namespace chart::CommonFunctors
@@ -34,20 +35,21 @@ namespace chart::CommonFunctors
<p>uno::makeAny is an inline function. Thus is cannot be taken directly
(via mem_fun_ptr)</p>
*/
-template< typename T >
- struct makeAny
+struct makeAny
{
+ template< typename T >
css::uno::Any operator() ( const T & aVal )
{
- return css::uno::makeAny( aVal );
+ return css::uno::Any( aVal );
}
};
-/** unary function to convert css::uno::Any into a double number.
+/** unary function to convert an OUString or css::uno::Any into a double number.
+ <p>For conversion of OUString, rtl::math::StringToDouble is used.</p>
<p>In case no number can be generated from the Any, NaN is returned.</p>
-*/
-struct OOO_DLLPUBLIC_CHARTTOOLS AnyToDouble
+ */
+struct ToDouble
{
double operator() ( const css::uno::Any & rAny )
{
@@ -55,12 +57,24 @@ struct OOO_DLLPUBLIC_CHARTTOOLS AnyToDouble
rAny >>= fResult;
return fResult;
}
+
+ double operator() ( std::u16string_view rStr )
+ {
+ rtl_math_ConversionStatus eConversionStatus;
+ double fResult = ::rtl::math::stringToDouble( rStr, '.', ',', & eConversionStatus );
+
+ if( eConversionStatus != rtl_math_ConversionStatus_Ok )
+ return std::numeric_limits<double>::quiet_NaN();
+
+ return fResult;
+ }
};
-/** unary function to convert css::uno::Any into an
- OUString.
-*/
-struct OOO_DLLPUBLIC_CHARTTOOLS AnyToString
+/** unary function to convert a double number or css::uno::Any into an OUString.
+
+ <p>For conversion of doubles, rtl::math::DoubleToOUString is used.</p>
+ */
+struct ToString
{
OUString operator() ( const css::uno::Any & rAny )
{
@@ -83,32 +97,7 @@ struct OOO_DLLPUBLIC_CHARTTOOLS AnyToString
return OUString();
}
-};
-/** unary function to convert an OUString into a double number.
-
- <p>For conversion rtl::math::StringToDouble is used.</p>
- */
-struct OOO_DLLPUBLIC_CHARTTOOLS OUStringToDouble
-{
- double operator() ( const OUString & rStr )
- {
- rtl_math_ConversionStatus eConversionStatus;
- double fResult = ::rtl::math::stringToDouble( rStr, '.', ',', & eConversionStatus );
-
- if( eConversionStatus != rtl_math_ConversionStatus_Ok )
- return std::numeric_limits<double>::quiet_NaN();
-
- return fResult;
- }
-};
-
-/** unary function to convert a double number into an OUString.
-
- <p>For conversion rtl::math::DoubleToOUString is used.</p>
- */
-struct OOO_DLLPUBLIC_CHARTTOOLS DoubleToOUString
-{
OUString operator() ( double fNumber )
{
return ::rtl::math::doubleToUString(
@@ -121,6 +110,13 @@ struct OOO_DLLPUBLIC_CHARTTOOLS DoubleToOUString
}
};
+template <class Container, class Func> auto convertToSequence(const Container& container, Func f)
+{
+ css::uno::Sequence<decltype(f(container[0]))> result(container.size());
+ std::transform(container.begin(), container.end(), result.getArray(), f);
+ return result;
+}
+
} // namespace chart::CommonFunctors
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/ConfigColorScheme.hxx b/chart2/source/inc/ConfigColorScheme.hxx
index 0cf65d0307ec..f1302a4e271f 100644
--- a/chart2/source/inc/ConfigColorScheme.hxx
+++ b/chart2/source/inc/ConfigColorScheme.hxx
@@ -18,20 +18,16 @@
*/
#pragma once
-#include "charttoolsdllapi.hxx"
-#include <cppuhelper/implbase.hxx>
-#include <com/sun/star/chart2/XColorScheme.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
+#include "BaseColorScheme.hxx"
#include <memory>
-#include <string_view>
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
-OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::XColorScheme > createConfigColorScheme(
+css::uno::Reference< css::chart2::XColorScheme > createConfigColorScheme(
const css::uno::Reference< css::uno::XComponentContext > & xContext );
namespace impl
@@ -39,22 +35,17 @@ namespace impl
class ChartConfigItem;
}
-class ConfigColorScheme final :
- public ::cppu::WeakImplHelper<
- css::chart2::XColorScheme,
- css::lang::XServiceInfo >
+class ConfigColorScheme final : public BaseColorScheme
{
public:
explicit ConfigColorScheme( const css::uno::Reference< css::uno::XComponentContext > & xContext );
virtual ~ConfigColorScheme() override;
+ // ____ ConfigItemListener ____
+ void notify();
+
/// declare XServiceInfo methods
virtual OUString SAL_CALL getImplementationName() override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
-
- // ____ ConfigItemListener ____
- void notify( std::u16string_view rPropertyName );
protected:
// ____ XColorScheme ____
@@ -66,8 +57,6 @@ private:
// member variables
css::uno::Reference< css::uno::XComponentContext > m_xContext;
std::unique_ptr< impl::ChartConfigItem > m_apChartConfigItem;
- mutable css::uno::Sequence< sal_Int64 > m_aColorSequence;
- mutable sal_Int32 m_nNumberOfColors;
bool m_bNeedsUpdate;
};
diff --git a/chart2/source/inc/ControllerLockGuard.hxx b/chart2/source/inc/ControllerLockGuard.hxx
index c84e87af36ad..41fc545c4681 100644
--- a/chart2/source/inc/ControllerLockGuard.hxx
+++ b/chart2/source/inc/ControllerLockGuard.hxx
@@ -18,17 +18,14 @@
*/
#pragma once
-#include "charttoolsdllapi.hxx"
-#include <com/sun/star/uno/Reference.h>
+#include <config_options.h>
+
+#include <rtl/ref.hxx>
namespace chart
{
class ChartModel;
}
-namespace com::sun::star::frame
-{
-class XModel;
-}
namespace chart
{
@@ -36,14 +33,14 @@ namespace chart
unlockControllers in the DTOR. Using this ensures that controllers do not
remain locked when leaving a function even in case an exception is thrown.
*/
-class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockGuardUNO
+class ControllerLockGuardUNO
{
public:
- explicit ControllerLockGuardUNO(const css::uno::Reference<css::frame::XModel>& xModel);
+ explicit ControllerLockGuardUNO(rtl::Reference<::chart::ChartModel> xModel);
~ControllerLockGuardUNO();
private:
- css::uno::Reference<css::frame::XModel> mxModel;
+ rtl::Reference<::chart::ChartModel> mxModel;
};
class ControllerLockGuard
@@ -62,17 +59,17 @@ private:
Use the ControllerLockHelperGuard to lock/unlock the model during a block of
instructions.
*/
-class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockHelper
+class ControllerLockHelper
{
public:
- explicit ControllerLockHelper(const css::uno::Reference<css::frame::XModel>& xModel);
+ explicit ControllerLockHelper(rtl::Reference<::chart::ChartModel> xModel);
~ControllerLockHelper();
- SAL_DLLPRIVATE void lockControllers();
- SAL_DLLPRIVATE void unlockControllers();
+ void lockControllers();
+ void unlockControllers();
private:
- css::uno::Reference<css::frame::XModel> m_xModel;
+ rtl::Reference<::chart::ChartModel> m_xModel;
};
/** This guard calls lockControllers at the given ControllerLockHelper in the
@@ -80,7 +77,7 @@ private:
do not remain locked when leaving a function even in case an exception is
thrown.
*/
-class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockHelperGuard
+class ControllerLockHelperGuard
{
public:
explicit ControllerLockHelperGuard(ControllerLockHelper& rHelper);
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.hxx b/chart2/source/inc/DataBrowserModel.hxx
index d7c7be071f66..53aff9ade60e 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.hxx
+++ b/chart2/source/inc/DataBrowserModel.hxx
@@ -18,18 +18,18 @@
*/
#pragma once
+#include "DataSeries.hxx"
+#include "ChartType.hxx"
+
#include <com/sun/star/uno/Reference.hxx>
#include <rtl/ref.hxx>
#include <memory>
+#include <utility>
#include <vector>
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::uno { class XComponentContext; }
-
namespace com::sun::star::chart2 {
class XDataSeries;
- class XChartType;
}
namespace chart
@@ -42,8 +42,7 @@ class DataBrowserModel final
{
public:
explicit DataBrowserModel(
- const rtl::Reference<::chart::ChartModel> & xChartDoc,
- const css::uno::Reference< css::uno::XComponentContext > & xContext );
+ const rtl::Reference<::chart::ChartModel> & xChartDoc );
~DataBrowserModel();
/** Inserts a new data series after the data series to which the data column
@@ -93,13 +92,13 @@ public:
sal_Int32 getMaxRowCount() const;
// returns the UI string of the corresponding role
- OUString getRoleOfColumn( sal_Int32 nColumnIndex ) const;
+ const OUString & getRoleOfColumn( sal_Int32 nColumnIndex ) const;
bool isCategoriesColumn( sal_Int32 nColumnIndex ) const;
struct tDataHeader
{
- css::uno::Reference< css::chart2::XDataSeries > m_xDataSeries;
- css::uno::Reference< css::chart2::XChartType > m_xChartType;
+ rtl::Reference< ::chart::DataSeries > m_xDataSeries;
+ rtl::Reference< ::chart::ChartType > m_xChartType;
bool m_bSwapXAndYAxis;
sal_Int32 m_nStartColumn;
sal_Int32 m_nEndColumn;
@@ -112,13 +111,13 @@ public:
{}
// "full" CTOR
tDataHeader(
- css::uno::Reference< css::chart2::XDataSeries > const & xDataSeries,
- css::uno::Reference< css::chart2::XChartType > const &xChartType,
+ rtl::Reference< ::chart::DataSeries > xDataSeries,
+ rtl::Reference< ::chart::ChartType > xChartType,
bool bSwapXAndYAxis,
sal_Int32 nStartColumn,
sal_Int32 nEndColumn ) :
- m_xDataSeries( xDataSeries ),
- m_xChartType( xChartType ),
+ m_xDataSeries(std::move( xDataSeries )),
+ m_xChartType(std::move( xChartType )),
m_bSwapXAndYAxis( bSwapXAndYAxis ),
m_nStartColumn( nStartColumn ),
m_nEndColumn( nEndColumn )
@@ -132,7 +131,7 @@ public:
tDataHeader getHeaderForSeries(
const css::uno::Reference< css::chart2::XDataSeries > &xSeries ) const;
- css::uno::Reference< css::chart2::XDataSeries >
+ rtl::Reference< ::chart::DataSeries >
getDataSeriesByColumn( sal_Int32 nColumn ) const;
private:
@@ -141,7 +140,7 @@ private:
void removeComplexCategoryLevel( sal_Int32 nAtColumnIndex );
void addErrorBarRanges(
- const css::uno::Reference<css::chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference<::chart::DataSeries > & xDataSeries,
sal_Int32 nNumberFormatKey,
sal_Int32 & rInOutSequenceIndex,
sal_Int32 & rInOutHeaderEnd, bool bYError );
diff --git a/chart2/source/inc/DataInterpreter.hxx b/chart2/source/inc/DataInterpreter.hxx
new file mode 100644
index 000000000000..91513e25f31e
--- /dev/null
+++ b/chart2/source/inc/DataInterpreter.hxx
@@ -0,0 +1,152 @@
+/* -*- 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 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 .
+ */
+#pragma once
+
+#include "DataSeries.hxx"
+#include <cppuhelper/implbase.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/chart2/data/XDataSource.hpp>
+#include <rtl/ref.hxx>
+#include <vector>
+
+namespace chart
+{
+class DataSource;
+
+/** offers tooling to interpret different data sources in a structural
+ and chart-type-dependent way.
+ */
+struct InterpretedData
+{
+ std::vector< std::vector< rtl::Reference<::chart::DataSeries> > > Series;
+ css::uno::Reference< css::chart2::data::XLabeledDataSequence > Categories;
+};
+
+/** offers tooling to interpret different data sources in a structural
+ and chart-type-dependent way.
+ */
+class SAL_DLLPUBLIC_RTTI DataInterpreter : public ::cppu::WeakImplHelper<
+ css::lang::XServiceInfo >
+{
+public:
+ explicit DataInterpreter();
+ virtual ~DataInterpreter() override;
+
+ /// XServiceInfo declarations
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+
+ // convenience methods
+ static OUString GetRole( const css::uno::Reference< css::chart2::data::XDataSequence > & xSeq );
+
+ static void SetRole(
+ const css::uno::Reference< css::chart2::data::XDataSequence > & xSeq,
+ const OUString & rRole );
+
+ static css::uno::Any GetProperty(
+ const css::uno::Sequence<css::beans::PropertyValue > & aArguments,
+ std::u16string_view rName );
+
+ static bool HasCategories(
+ const css::uno::Sequence< css::beans::PropertyValue > & rArguments,
+ const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & rData );
+
+ static bool UseCategoriesAsX(
+ const css::uno::Sequence< css::beans::PropertyValue > & rArguments );
+
+ static std::vector<css::uno::Reference< css::chart2::data::XLabeledDataSequence >> getDataSequences(
+ const css::uno::Reference< css::chart2::data::XDataSource >& xSource);
+
+ // ____ DataInterpreter ____
+ /** Interprets the given data.
+
+ @param xSource
+ the data source.
+
+ @param aArguments
+ Arguments that tell the template how to slice the given
+ range. The properties should be defined in a separate
+ service.
+
+ <p>For standard parameters that may be used, see the
+ service StandardDiagramCreationParameters.
+ </p>
+
+ @param aSeriesToReUse
+ use all the data series given here for the result before
+ creating new ones.
+ */
+ virtual InterpretedData interpretDataSource(
+ const css::uno::Reference< css::chart2::data::XDataSource >& xSource,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArguments,
+ const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse );
+
+ /** Re-interprets the data given in <code>aInterpretedData</code>
+ while keeping the number of data series and the categories.
+ */
+ virtual InterpretedData reinterpretDataSeries(
+ const InterpretedData& aInterpretedData );
+
+ /** parses the given data and states, if a
+ reinterpretDataSeries() call can be done
+ without data loss.
+
+ @return
+ `TRUE`, if the data given in
+ <code>aInterpretedData</code> has a similar structure than
+ the one required is used as output of the data interpreter.
+ */
+ virtual bool isDataCompatible(
+ const InterpretedData& aInterpretedData );
+
+ /** Try to reverse the operation done in
+ interpretDataSource().
+
+ <p>In case <code>aInterpretedData</code> is the result of
+ interpretDataSource()( <code>xSource</code> ),
+ the result of this method should be <code>xSource</code>.</p>
+ */
+ static rtl::Reference< ::chart::DataSource > mergeInterpretedData(
+ const InterpretedData& aInterpretedData );
+
+ /** Get chart information that is specific to a particular chart
+ type, by key.
+
+ @param sKey
+ name of the piece of data to retrieve.
+
+ <p>Supported key strings:</p>
+ <ul>
+ <li><tt>"stock variant"</tt>: stock chart variant,
+ with 0 = neither Open Values nor volume, 1 = Open Values,
+ 2 = volume, 3 = both. Valid for candlestick charts.</li>
+ </ul>
+
+ @return
+ The value requested, or nothing if not present.
+ */
+ virtual css::uno::Any getChartTypeSpecificData(
+ const OUString& sKey );
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/inc/DataSeries.hxx b/chart2/source/inc/DataSeries.hxx
index eae00d7da153..10dfb0e45840 100644
--- a/chart2/source/model/inc/DataSeries.hxx
+++ b/chart2/source/inc/DataSeries.hxx
@@ -27,21 +27,23 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
// helper classes
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
-#include <ModifyListenerHelper.hxx>
+#include "ModifyListenerHelper.hxx"
+#include "PropertyHelper.hxx"
// STL
#include <vector>
#include <map>
-#include <OPropertySet.hxx>
+#include "OPropertySet.hxx"
namespace com::sun::star::beans { class XPropertySet; }
namespace chart
{
+class LabeledDataSequence;
+class RegressionCurveModel;
namespace impl
{
@@ -57,10 +59,10 @@ typedef ::cppu::WeakImplHelper<
DataSeries_Base;
}
-class DataSeries final :
- public cppu::BaseMutex,
- public impl::DataSeries_Base,
- public ::property::OPropertySet
+class DataSeries
+ final
+ : public impl::DataSeries_Base
+ , public ::property::OPropertySet
{
public:
explicit DataSeries();
@@ -76,12 +78,8 @@ public:
/// merge XTypeProvider implementations
DECLARE_XTYPEPROVIDER()
-private:
explicit DataSeries( const DataSeries & rOther );
- // late initialization to call after copy-constructing
- void Init( const DataSeries & rOther );
-
// ____ XDataSeries ____
/// @see css::chart2::XDataSeries
virtual css::uno::Reference< css::beans::XPropertySet >
@@ -133,6 +131,72 @@ private:
virtual void SAL_CALL removeModifyListener(
const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
+ typedef std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tDataSequenceContainer;
+
+ void setData( const tDataSequenceContainer& aData );
+ const tDataSequenceContainer & getDataSequences2() const { return m_aDataSequences; }
+ void addDataSequence(css::uno::Reference<css::chart2::data::XLabeledDataSequence> const& rSequence);
+
+ typedef
+ std::vector< rtl::Reference< ::chart::RegressionCurveModel > >
+ tRegressionCurveContainerType;
+
+ const tRegressionCurveContainerType & getRegressionCurves2() const { return m_aRegressionCurves; }
+
+ /** Get the label of a series (e.g. for the legend)
+
+ @param rLabelSequenceRole
+ The data sequence contained in xSeries that has this role will be used
+ to take its label.
+ */
+ OUString getLabelForRole( const OUString & rLabelSequenceRole );
+
+ bool hasUnhiddenData();
+
+ bool hasPointOwnColor(
+ sal_Int32 nPointIndex
+ , const css::uno::Reference< css::beans::XPropertySet >& xDataPointProperties //may be NULL this is just for performance
+ );
+
+ // returns true if AttributedDataPoints contains nPointIndex and the
+ // property Color is DEFAULT
+ bool hasPointOwnProperties( sal_Int32 nPointIndex );
+
+ sal_Int32 getAttachedAxisIndex();
+
+ bool isAttachedToMainAxis() { return getAttachedAxisIndex() == 0; }
+
+ void switchSymbolsOnOrOff( bool bSymbolsOn, sal_Int32 nSeriesIndex );
+
+ void switchLinesOnOrOff( bool bLinesOn );
+
+ void makeLinesThickOrThin( bool bThick );
+
+ bool hasAttributedDataPointDifferentValue(
+ const OUString& rPropertyName,
+ const css::uno::Any& rPropertyValue );
+
+ void setPropertyAlsoToAllAttributedDataPoints(
+ const OUString& rPropertyName,
+ const css::uno::Any& rPropertyValue );
+
+ bool hasDataLabelsAtSeries();
+
+ bool hasDataLabelsAtPoints();
+
+ bool hasDataLabelAtPoint( sal_Int32 nPointIndex );
+
+ void insertDataLabelsToSeriesAndAllPoints();
+
+ void deleteDataLabelsFromSeriesAndAllPoints();
+
+ sal_Int32 getExplicitNumberFormatKeyForDataLabel();
+
+private:
+
+ // late initialization to call after copy-constructing
+ void Init( const DataSeries & rOther );
+
// ____ XModifyListener ____
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
@@ -147,21 +211,21 @@ private:
void fireModifyEvent();
- typedef std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tDataSequenceContainer;
+ void impl_insertOrDeleteDataLabelsToSeriesAndAllPoints( bool bInsert );
+
tDataSequenceContainer m_aDataSequences;
typedef std::map< sal_Int32,
css::uno::Reference< css::beans::XPropertySet > > tDataPointAttributeContainer;
tDataPointAttributeContainer m_aAttributedDataPoints;
- typedef
- std::vector< css::uno::Reference< css::chart2::XRegressionCurve > >
- tRegressionCurveContainerType;
tRegressionCurveContainerType m_aRegressionCurves;
rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
};
+const tPropertyValueMap & StaticDataSeriesDefaults();
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/DataSeriesHelper.hxx b/chart2/source/inc/DataSeriesHelper.hxx
index bda6d4f0796c..1bde79c29fdb 100644
--- a/chart2/source/inc/DataSeriesHelper.hxx
+++ b/chart2/source/inc/DataSeriesHelper.hxx
@@ -18,8 +18,8 @@
*/
#pragma once
+#include <config_options.h>
#include "StackMode.hxx"
-#include "charttoolsdllapi.hxx"
#include <com/sun/star/uno/Reference.h>
#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
@@ -27,22 +27,22 @@
#include <vector>
namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XChartType; }
-namespace com::sun::star::chart2 { class XCoordinateSystem; }
-namespace com::sun::star::chart2 { class XDataSeries; }
-namespace com::sun::star::chart2 { class XDiagram; }
namespace com::sun::star::chart2::data { class XDataSequence; }
namespace com::sun::star::chart2::data { class XDataSource; }
namespace com::sun::star::chart2::data { class XLabeledDataSequence; }
namespace com::sun::star::uno { class Any; }
namespace com::sun::star::uno { template <class E> class Sequence; }
namespace chart { class BaseCoordinateSystem; }
+namespace chart { class ChartType; }
+namespace chart { class DataSource; }
+namespace chart { class Diagram; }
+namespace chart { class DataSeries; }
+namespace chart { class ChartModel; }
namespace chart::DataSeriesHelper
{
-OOO_DLLPUBLIC_CHARTTOOLS OUString
- getRole( const css::uno::Reference<css::chart2::data::XLabeledDataSequence>& xLabeledDataSequence );
+OUString getRole( const css::uno::Reference<css::chart2::data::XLabeledDataSequence>& xLabeledDataSequence );
/** Retrieves the data sequence in the given data source that matches the
given role. If more than one sequences match the role, the first match
@@ -54,7 +54,7 @@ OOO_DLLPUBLIC_CHARTTOOLS OUString
@param aRole
The role that is to be filtered out.
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSequence >
+css::uno::Reference< css::chart2::data::XLabeledDataSequence >
getDataSequenceByRole( const css::uno::Reference< css::chart2::data::XDataSource > & xSource,
const OUString& aRole,
bool bMatchPrefix = false );
@@ -68,110 +68,54 @@ OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSeq
@param aRole
The role that is to be filtered out.
*/
-OOO_DLLPUBLIC_CHARTTOOLS std::vector<
+std::vector<
css::uno::Reference< css::chart2::data::XLabeledDataSequence > >
getAllDataSequencesByRole( const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & aDataSequences,
const OUString& aRole );
+std::vector<
+ css::uno::Reference< css::chart2::data::XLabeledDataSequence > >
+ getAllDataSequencesByRole( const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & aDataSequences,
+ const OUString& aRole );
-OOO_DLLPUBLIC_CHARTTOOLS
-std::vector<css::uno::Reference<css::chart2::data::XLabeledDataSequence> >
+std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > >
getAllDataSequences(
- const css::uno::Sequence<css::uno::Reference<css::chart2::XDataSeries> >& aSeries );
+ const std::vector<rtl::Reference<::chart::DataSeries> >& aSeries );
/** Retrieves all data sequences found in the given data series and puts them
into a data source. The order of sequences will match the order of the data
series.
*/
-OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XDataSource >
- getDataSource( const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > > & aSeries );
-
-/** Get the label of a series (e.g. for the legend)
-
- @param rLabelSequenceRole
- The data sequence contained in xSeries that has this role will be used
- to take its label.
- */
-OOO_DLLPUBLIC_CHARTTOOLS OUString getDataSeriesLabel(
- const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
- const OUString & rLabelSequenceRole );
+rtl::Reference< ::chart::DataSource >
+ getDataSource( const std::vector< rtl::Reference< ::chart::DataSeries > > & aSeries );
-/** Get the label of a labeled sequence including necessary automatic generation
- */
-OOO_DLLPUBLIC_CHARTTOOLS OUString getLabelForLabeledDataSequence(
- const css::uno::Reference< css::chart2::data::XLabeledDataSequence > & xLabeledSeq );
-
-OOO_DLLPUBLIC_CHARTTOOLS void setStackModeAtSeries(
- const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > > & aSeries,
- const css::uno::Reference< css::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
+void setStackModeAtSeries(
+ const std::vector< rtl::Reference< ::chart::DataSeries > > & aSeries,
+ const rtl::Reference< ::chart::BaseCoordinateSystem > & xCorrespondingCoordinateSystem,
StackMode eStackMode );
-OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getAttachedAxisIndex(
- const css::uno::Reference< css::chart2::XDataSeries > & xSeries );
-
/// @param nAxisIndex, if -1 it is determined by the given data series via getAttachedAxisIndex
-OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getNumberFormatKeyFromAxis(
- const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
- const css::uno::Reference< css::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
+sal_Int32 getNumberFormatKeyFromAxis(
+ const rtl::Reference< ::chart::DataSeries > & xSeries,
+ const rtl::Reference< ::chart::BaseCoordinateSystem > & xCorrespondingCoordinateSystem,
sal_Int32 nDimensionIndex,
sal_Int32 nAxisIndex = -1 );
-OOO_DLLPUBLIC_CHARTTOOLS
rtl::Reference< ::chart::BaseCoordinateSystem >
getCoordinateSystemOfSeries(
- const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+ const rtl::Reference< ::chart::DataSeries > & xSeries,
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
-OOO_DLLPUBLIC_CHARTTOOLS
-css::uno::Reference< css::chart2::XChartType >
+rtl::Reference< ::chart::ChartType >
getChartTypeOfSeries(
- const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
-
-OOO_DLLPUBLIC_CHARTTOOLS void deleteSeries(
- const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
- const css::uno::Reference< css::chart2::XChartType > & xChartType );
-
-OOO_DLLPUBLIC_CHARTTOOLS void switchSymbolsOnOrOff(
- const css::uno::Reference< css::beans::XPropertySet > & xSeriesProperties,
- bool bSymbolsOn, sal_Int32 nSeriesIndex );
+ const rtl::Reference< ::chart::DataSeries > & xSeries,
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
-OOO_DLLPUBLIC_CHARTTOOLS void switchLinesOnOrOff(
- const css::uno::Reference< css::beans::XPropertySet > & xSeriesProperties,
- bool bLinesOn );
-
-OOO_DLLPUBLIC_CHARTTOOLS
-void makeLinesThickOrThin( const css::uno::Reference< css::beans::XPropertySet > & xSeriesProperties, bool bThick );
-
-OOO_DLLPUBLIC_CHARTTOOLS void setPropertyAlsoToAllAttributedDataPoints(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
- const OUString& rPropertyName,
- const css::uno::Any& rPropertyValue );
-
-OOO_DLLPUBLIC_CHARTTOOLS bool hasAttributedDataPointDifferentValue(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
- const OUString& rPropertyName,
- const css::uno::Any& rPropertyValue );
-
-OOO_DLLPUBLIC_CHARTTOOLS bool hasUnhiddenData( const css::uno::Reference<
- css::chart2::XDataSeries >& xSeries );
-
-OOO_DLLPUBLIC_CHARTTOOLS
sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nClippedIndex, const css::uno::Reference<
css::chart2::data::XDataSequence >& xDataSequence, bool bTranslate );
-OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtSeries( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
-
-OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtPoints( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
-
-OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelAtPoint( const css::uno::Reference< css::chart2::XDataSeries >& xSeries, sal_Int32 nPointIndex );
-
-OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelsToSeriesAndAllPoints( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
-
-OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelToPoint( const css::uno::Reference< css::beans::XPropertySet >& xPointPropertySet );
-
-OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromSeriesAndAllPoints( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
+void insertDataLabelToPoint( const css::uno::Reference< css::beans::XPropertySet >& xPointPropertySet );
-OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromPoint( const css::uno::Reference< css::beans::XPropertySet >& xPointPropertySet );
+void deleteDataLabelsFromPoint( const css::uno::Reference< css::beans::XPropertySet >& xPointPropertySet );
} // namespace chart::DataSeriesHelper
diff --git a/chart2/source/model/main/DataSeriesProperties.hxx b/chart2/source/inc/DataSeriesProperties.hxx
index 13636d442fb5..d0c19d07bf23 100644
--- a/chart2/source/model/main/DataSeriesProperties.hxx
+++ b/chart2/source/inc/DataSeriesProperties.hxx
@@ -18,8 +18,8 @@
*/
#pragma once
-#include <PropertyHelper.hxx>
-#include <FastPropertyIdRanges.hxx>
+#include "PropertyHelper.hxx"
+#include "FastPropertyIdRanges.hxx"
#include <vector>
@@ -35,7 +35,8 @@ namespace chart::DataSeriesProperties
PROP_DATASERIES_ATTACHED_AXIS_INDEX,
PROP_DATASERIES_SHOW_LEGEND_ENTRY,
PROP_DATASERIES_DELETED_LEGEND_ENTRIES,
- PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES
+ PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES,
+ PROP_DATASERIES_INVERT_NEGATIVE
};
void AddPropertiesToVector(
diff --git a/chart2/source/inc/DataSource.hxx b/chart2/source/inc/DataSource.hxx
index 56c740bc0d2c..f7f837d90b17 100644
--- a/chart2/source/inc/DataSource.hxx
+++ b/chart2/source/inc/DataSource.hxx
@@ -18,10 +18,12 @@
*/
#pragma once
+#include <config_options.h>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <cppuhelper/implbase.hxx>
+#include <vector>
namespace chart
{
@@ -36,6 +38,8 @@ public:
explicit DataSource();
explicit DataSource(
const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & rSequences );
+ explicit DataSource(
+ const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & rSequences );
virtual ~DataSource() override;
@@ -44,7 +48,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
-protected:
// ____ XDataSource ____
virtual css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > SAL_CALL
getDataSequences() override;
diff --git a/chart2/source/inc/DataSourceHelper.hxx b/chart2/source/inc/DataSourceHelper.hxx
index 2c866091b21a..a683c6a1c4b6 100644
--- a/chart2/source/inc/DataSourceHelper.hxx
+++ b/chart2/source/inc/DataSourceHelper.hxx
@@ -19,45 +19,42 @@
#pragma once
-#include "charttoolsdllapi.hxx"
+#include <config_options.h>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ref.hxx>
namespace chart { class ChartModel; }
namespace com::sun::star::beans { struct PropertyValue; }
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::chart2 { class XDiagram; }
namespace com::sun::star::chart2::data { class XDataSequence; }
namespace com::sun::star::chart2::data { class XDataSource; }
namespace com::sun::star::chart2::data { class XLabeledDataSequence; }
-namespace com::sun::star::frame { class XModel; }
namespace chart
{
+class DataSource;
+class Diagram;
+class LabeledDataSequence;
-class OOO_DLLPUBLIC_CHARTTOOLS DataSourceHelper
+class DataSourceHelper
{
public:
- static css::uno::Reference< css::chart2::data::XDataSource >
- createDataSource( const css::uno::Sequence<
- css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & rSequences );
-
static css::uno::Reference< css::chart2::data::XDataSequence >
createCachedDataSequence();
static css::uno::Reference< css::chart2::data::XDataSequence >
createCachedDataSequence( const OUString & rSingleText );
- static css::uno::Reference< css::chart2::data::XLabeledDataSequence >
+ static rtl::Reference< LabeledDataSequence >
createLabeledDataSequence(
const css::uno::Reference< css::chart2::data::XDataSequence >& xValues ,
const css::uno::Reference< css::chart2::data::XDataSequence >& xLabels );
- static css::uno::Reference< css::chart2::data::XLabeledDataSequence >
+ static rtl::Reference< LabeledDataSequence >
createLabeledDataSequence(
const css::uno::Reference< css::chart2::data::XDataSequence >& xValues );
- static css::uno::Reference< css::chart2::data::XLabeledDataSequence >
+ static rtl::Reference< LabeledDataSequence >
createLabeledDataSequence();
static css::uno::Sequence< css::beans::PropertyValue >
@@ -70,30 +67,24 @@ public:
const css::uno::Sequence< sal_Int32 >& rSequenceMapping,
bool bUseColumns, bool bFirstCellAsLabel, bool bHasCategories );
- SAL_DLLPRIVATE static void readArguments( const css::uno::Sequence< css::beans::PropertyValue >& rArguments
+ static void readArguments( const css::uno::Sequence< css::beans::PropertyValue >& rArguments
, OUString & rRangeRepresentation, css::uno::Sequence< sal_Int32 >& rSequenceMapping
, bool& bUseColumns, bool& bFirstCellAsLabel, bool& bHasCategories );
- static css::uno::Reference< css::chart2::data::XDataSource >
- pressUsedDataIntoRectangularFormat( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc );
+ static rtl::Reference< ::chart::DataSource >
+ pressUsedDataIntoRectangularFormat( const rtl::Reference< ::chart::ChartModel >& xChartDoc );
- SAL_DLLPRIVATE static css::uno::Sequence< OUString > getUsedDataRanges(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+ static std::vector< OUString > getUsedDataRanges(
+ const rtl::Reference< ::chart::Diagram > & xDiagram );
- static css::uno::Sequence< OUString > getUsedDataRanges(
- const css::uno::Reference< css::frame::XModel > & xChartModel );
+ static std::vector< OUString > getUsedDataRanges(
+ const rtl::Reference<::chart::ChartModel> & xChartModel );
- static css::uno::Reference< css::chart2::data::XDataSource > getUsedData(
+ static rtl::Reference< ::chart::DataSource > getUsedData(
ChartModel& rModel );
- static css::uno::Reference< css::chart2::data::XDataSource > getUsedData(
- const css::uno::Reference< css::frame::XModel >& xChartModel );
-
- static css::uno::Reference< css::chart2::data::XDataSource > getUsedData(
- const css::uno::Reference<css::chart2::XChartDocument >& xChartDoc );
-
static bool detectRangeSegmentation(
- const css::uno::Reference< css::frame::XModel >& xChartModel
+ const rtl::Reference<::chart::ChartModel>& xChartModel
, OUString& rOutRangeString
, css::uno::Sequence< sal_Int32 >& rSequenceMapping
, bool& rOutUseColumns
@@ -101,7 +92,7 @@ public:
, bool& rOutHasCategories );
static void setRangeSegmentation(
- const css::uno::Reference< css::frame::XModel >& xChartModel
+ const rtl::Reference<::chart::ChartModel>& xChartModel
, const css::uno::Sequence< sal_Int32 >& rSequenceMapping
, bool bUseColumns
, bool bFirstCellAsLabel
@@ -115,15 +106,15 @@ public:
HasCategories and FirstCellAsLabel.
*/
static bool allArgumentsForRectRangeDetected(
- const css::uno::Reference< css::chart2::XChartDocument >& xChartDocument );
+ const rtl::Reference<::chart::ChartModel>& xChartDocument );
- SAL_DLLPRIVATE static css::uno::Sequence< OUString > getRangesFromLabeledDataSequence(
+ static std::vector< OUString > getRangesFromLabeledDataSequence(
const css::uno::Reference< css::chart2::data::XLabeledDataSequence > & xLSeq );
- SAL_DLLPRIVATE static OUString getRangeFromValues(
+ static OUString getRangeFromValues(
const css::uno::Reference< css::chart2::data::XLabeledDataSequence > & xLSeq );
- SAL_DLLPRIVATE static css::uno::Sequence< OUString > getRangesFromDataSource(
+ static std::vector< OUString > getRangesFromDataSource(
const css::uno::Reference< css::chart2::data::XDataSource > & xSource );
};
diff --git a/chart2/source/inc/DataTable.hxx b/chart2/source/inc/DataTable.hxx
new file mode 100644
index 000000000000..849c2303de60
--- /dev/null
+++ b/chart2/source/inc/DataTable.hxx
@@ -0,0 +1,85 @@
+/* -*- 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 "OPropertySet.hxx"
+#include <cppuhelper/implbase.hxx>
+#include <comphelper/uno3.hxx>
+
+#include <com/sun/star/chart2/XDataTable.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include "ModifyListenerHelper.hxx"
+
+namespace chart
+{
+typedef cppu::WeakImplHelper<css::chart2::XDataTable, css::lang::XServiceInfo,
+ css::util::XCloneable, css::util::XModifyBroadcaster,
+ css::util::XModifyListener>
+ DataTable_Base;
+
+/** Data table implementation */
+class DataTable final : public DataTable_Base, public ::property::OPropertySet
+{
+public:
+ explicit DataTable();
+ virtual ~DataTable() override;
+
+ /// XServiceInfo declarations
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ /// merge XInterface implementations
+ DECLARE_XINTERFACE()
+
+ /// merge XTypeProvider implementations
+ DECLARE_XTYPEPROVIDER()
+
+ explicit DataTable(DataTable const& rOther);
+
+private:
+ // ____ OPropertySet ____
+ virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any& rAny) const override;
+
+ // ____ OPropertySet ____
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+
+public:
+ // ____ XPropertySet ____
+ virtual css::uno::Reference<css::beans::XPropertySetInfo>
+ SAL_CALL getPropertySetInfo() override;
+
+ // ____ XCloneable ____
+ virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() override;
+
+ // ____ XModifyBroadcaster ____
+ virtual void SAL_CALL
+ addModifyListener(const css::uno::Reference<css::util::XModifyListener>& aListener) override;
+ virtual void SAL_CALL
+ removeModifyListener(const css::uno::Reference<css::util::XModifyListener>& aListener) override;
+
+private:
+ // ____ XModifyListener ____
+ virtual void SAL_CALL modified(const css::lang::EventObject& aEvent) override;
+
+ // ____ XEventListener (base of XModifyListener) ____
+ virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
+
+ // ____ OPropertySet ____
+ virtual void firePropertyChangeEvent() override;
+ using OPropertySet::disposing;
+
+ rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/Diagram.hxx b/chart2/source/inc/Diagram.hxx
index 5d6dc79a1ee1..4945c7bde95b 100644
--- a/chart2/source/inc/Diagram.hxx
+++ b/chart2/source/inc/Diagram.hxx
@@ -19,28 +19,43 @@
#pragma once
#include "OPropertySet.hxx"
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart/X3DDefaultSetter.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include "ModifyListenerHelper.hxx"
-#include "charttoolsdllapi.hxx"
#include <vector>
namespace com::sun::star::beans { struct PropertyValue; }
+namespace com::sun::star::chart2 { class XDataSeries; }
namespace com::sun::star::chart2::data { class XDataSource; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
-class Wall;
+class Axis;
class BaseCoordinateSystem;
+class ChartType;
+class ChartTypeManager;
+class ChartTypeTemplate;
+class DataSeries;
+class Legend;
+class DataTable;
+class RegressionCurveModel;
+enum class StackMode;
+class Wall;
+enum class ThreeDLookScheme;
+
+enum class DiagramPositioningMode
+{
+ Auto, Excluding, Including
+};
+
namespace impl
{
@@ -56,13 +71,13 @@ typedef ::cppu::WeakImplHelper<
Diagram_Base;
}
-class OOO_DLLPUBLIC_CHARTTOOLS Diagram final :
- public cppu::BaseMutex,
- public impl::Diagram_Base,
- public ::property::OPropertySet
+class Diagram
+ final
+ : public impl::Diagram_Base
+ , public ::property::OPropertySet
{
public:
- Diagram( css::uno::Reference< css::uno::XComponentContext > const & xContext );
+ Diagram( css::uno::Reference< css::uno::XComponentContext > xContext );
virtual ~Diagram() override;
/// XServiceInfo declarations
@@ -88,7 +103,7 @@ public:
getPropertySetInfo() override;
// ____ XFastPropertySet ____
- virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
/// make original interface function visible again
using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue;
@@ -109,6 +124,9 @@ public:
const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource,
const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override;
+ virtual css::uno::Reference<css::chart2::XDataTable> SAL_CALL getDataTable() override;
+ virtual void SAL_CALL setDataTable(const css::uno::Reference<css::chart2::XDataTable>& xDataTable) override;
+
// ____ XCoordinateSystemContainer ____
virtual void SAL_CALL addCoordinateSystem(
const css::uno::Reference< css::chart2::XCoordinateSystem >& aCoordSys ) override;
@@ -142,10 +160,192 @@ public:
std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > >
tCoordinateSystemContainerType;
- const tCoordinateSystemContainerType & getBaseCoordinateSystems() { return m_aCoordSystems; }
+ tCoordinateSystemContainerType getBaseCoordinateSystems() const;
+ void setCoordinateSystems(
+ const std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > >& aCoordinateSystems );
+
+ rtl::Reference< ::chart::Legend > getLegend2() const;
+ void setLegend(const rtl::Reference< ::chart::Legend > &);
+
+ void setDataTable(const rtl::Reference<::chart::DataTable>& xNewDataTable);
+ rtl::Reference<::chart::DataTable> getDataTableRef() const;
+
+ DiagramPositioningMode getDiagramPositioningMode();
+
+ //returns integer from constant group css::chart::MissingValueTreatment
+ sal_Int32 getCorrectedMissingValueTreatment(
+ const rtl::Reference< ::chart::ChartType >& xChartType );
+
+ void setGeometry3D( sal_Int32 nNewGeometry );
+
+ sal_Int32 getGeometry3D( bool& rbFound, bool& rbAmbiguous );
+
+ bool isPieOrDonutChart();
+
+ bool isSupportingFloorAndWall();
+
+ /**
+ * Move a series forward or backward.
+ *
+ * @param xDiagram
+ * Reference to the diagram that contains the series.
+ *
+ * @param xGivenDataSeries
+ * Reference to the series that should be moved.
+ *
+ * @param bForward
+ * Direction in which the series should be moved.
+ *
+ * @returns </sal_True> if the series was moved successfully.
+ *
+ */
+ bool moveSeries(
+ const rtl::Reference< DataSeries >& xGivenDataSeries,
+ bool bForward );
+
+ /**
+ * Test if a series can be moved.
+ *
+ * @param xDiagram
+ * Reference to the diagram that contains the series.
+ *
+ * @param xGivenDataSeries
+ * Reference to the series that should be tested for moving.
+ *
+ * @param bForward
+ * Direction of the move to be checked.
+ *
+ * @returns </sal_True> if the series can be moved.
+ *
+ */
+ bool isSeriesMoveable(
+ const rtl::Reference< DataSeries >& xGivenDataSeries,
+ bool bForward );
+
+ std::vector< rtl::Reference< ChartType > > getChartTypes();
+
+ rtl::Reference< ChartType > getChartTypeByIndex( sal_Int32 nIndex );
+
+ bool isSupportingDateAxis();
+
+ css::uno::Reference< css::chart2::data::XLabeledDataSequence >
+ getCategories();
+
+ void setCategories(
+ const css::uno::Reference< css::chart2::data::XLabeledDataSequence >& xCategories,
+ bool bSetAxisType = false, // when this flag is true ...
+ bool bCategoryAxis = true);// set the AxisType to CATEGORY or back to REALNUMBER
+
+ bool isCategory();
+
+ /** return all data series in this diagram grouped by chart-types
+ */
+ std::vector<
+ std::vector<
+ rtl::Reference< ::chart::DataSeries > > >
+ getDataSeriesGroups();
+
+ std::vector< rtl::Reference< ::chart::DataSeries > >
+ getDataSeries();
+
+ rtl::Reference< ChartType >
+ getChartTypeOfSeries( const rtl::Reference< DataSeries >& xSeries );
+
+ rtl::Reference< ::chart::Axis > getAttachedAxis(
+ const rtl::Reference< ::chart::DataSeries >& xSeries );
+
+ bool attachSeriesToAxis( bool bMainAxis,
+ const rtl::Reference< DataSeries >& xSeries,
+ const css::uno::Reference< css::uno::XComponentContext > & xContext,
+ bool bAdaptAxes=true );
+
+ /** Replaces all occurrences of xCooSysToReplace in the tree with
+ xReplacement in the diagram's tree
+ */
+ void replaceCoordinateSystem(
+ const rtl::Reference< ::chart::BaseCoordinateSystem > & xCooSysToReplace,
+ const rtl::Reference< ::chart::BaseCoordinateSystem > & xReplacement );
+
+
+ /** Returns the dimension found for all chart types in the tree. If the
+ dimension is not unique, 0 is returned.
+ */
+ sal_Int32 getDimension();
+
+ /** Sets the dimension of the diagram given.
+
+ 1. Sets the dimension of all used ChartTypes
+ 2. Adapts the DataSeriesTree to reflect the new dimension
+ 3. If new coordinate-systems have to be created, adapts the
+ XCoordinateSystemContainer of the diagram.
+ */
+ void setDimension( sal_Int32 nNewDimensionCount );
+
+
+ StackMode getStackMode(bool& rbFound, bool& rbAmbiguous);
+
+ /** The stacking mode is only set at the series found inside
+ the first chart type. This is the standard for all current
+ templates (the only template that has more than one chart-type and
+ allows stacking is bar/line combi, and for this the stacking only
+ applies to the first chart type/the bars)
+ */
+ void setStackMode(StackMode eStackMode);
+
+
+ /** Sets the "SwapXAndYAxis" property at all coordinate systems found in the
+ given diagram.
+
+ "vertical==true" for bar charts, "vertical==false" for column charts
+ */
+ void setVertical( bool bVertical );
+
+ /** Gets the "SwapXAndYAxis" property at all coordinate systems found in the
+ given diagram.
-private:
+ "vertical==true" for bar charts, "vertical==false" for column charts
+ */
+ bool getVertical( bool& rbOutFoundResult, bool& rbOutAmbiguousResult );
+
+ struct tTemplateWithServiceName {
+ rtl::Reference< ::chart::ChartTypeTemplate > xChartTypeTemplate;
+ OUString sServiceName;
+ };
+
+ /** tries to find a template in the chart-type manager that matches this
+ diagram.
+
+ @return
+ A pair containing a template with the correct properties set as
+ first entry and the service name of the templates second entry. If
+ no template was found both elements are empty.
+ */
+ tTemplateWithServiceName
+ getTemplate(const rtl::Reference< ::chart::ChartTypeManager > & xChartTypeManager);
+ std::vector<rtl::Reference<::chart::RegressionCurveModel> >
+ getAllRegressionCurvesNotMeanValueLine();
+
+ double getCameraDistance();
+ void setCameraDistance( double fCameraDistance );
+
+ void getRotation(
+ sal_Int32& rnHorizontalAngleDegree, sal_Int32& rnVerticalAngleDegree );
+ void setRotation(
+ sal_Int32 nHorizontalAngleDegree, sal_Int32 nVerticalYAngleDegree );
+ void getRotationAngle(
+ double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad );
+ void setRotationAngle(
+ double fXAngleRad, double fYAngleRad, double fZAngleRad );
+
+ ThreeDLookScheme detectScheme();
+ void setScheme( ThreeDLookScheme aScheme );
+
+ void setDefaultRotation( bool bPieOrDonut );
+
+ void switchRightAngledAxes( bool bRightAngledAxes );
+
+private:
// ____ XModifyListener ____
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
@@ -160,24 +360,19 @@ private:
void fireModifyEvent();
- css::uno::Reference< css::uno::XComponentContext > m_xContext;
-
+ css::uno::Reference<css::uno::XComponentContext> m_xContext;
tCoordinateSystemContainerType m_aCoordSystems;
- rtl::Reference< Wall > m_xWall;
-
- rtl::Reference< Wall > m_xFloor;
+ rtl::Reference<Wall> m_xWall;
+ rtl::Reference<Wall> m_xFloor;
- css::uno::Reference< css::chart2::XTitle >
- m_xTitle;
-
- css::uno::Reference< css::chart2::XLegend >
- m_xLegend;
-
- css::uno::Reference< css::chart2::XColorScheme >
- m_xColorScheme;
+ css::uno::Reference<css::chart2::XTitle> m_xTitle;
+ rtl::Reference<::chart::Legend> m_xLegend;
+ rtl::Reference<::chart::DataTable> m_xDataTable;
+ css::uno::Reference<css::chart2::XColorScheme> m_xColorScheme;
rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
+
};
} // namespace chart
diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx
index 57372a1c072e..10c9e6de5b2e 100644
--- a/chart2/source/inc/DiagramHelper.hxx
+++ b/chart2/source/inc/DiagramHelper.hxx
@@ -19,89 +19,23 @@
#pragma once
#include "StackMode.hxx"
-#include "charttoolsdllapi.hxx"
+#include "ChartTypeTemplate.hxx"
#include <com/sun/star/awt/Rectangle.hpp>
-#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
#include <rtl/ref.hxx>
-#include <utility>
-#include <vector>
-
namespace chart { class ChartModel; }
-namespace com::sun::star::chart2 { class XAxis; }
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::chart2 { class XCoordinateSystem; }
-namespace com::sun::star::chart2 { class XDiagram; }
-namespace com::sun::star::frame { class XModel; }
-namespace com::sun::star::lang { class XMultiServiceFactory; }
-namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::util { class XNumberFormats; }
namespace com::sun::star::util { class XNumberFormatsSupplier; }
namespace chart
{
-class ChartTypeManager;
-class ChartTypeTemplate;
-
-enum DiagramPositioningMode
-{
- DiagramPositioningMode_AUTO,
- DiagramPositioningMode_EXCLUDING,
- DiagramPositioningMode_INCLUDING
-};
+class BaseCoordinateSystem;
+class ChartType;
+class DataSeries;
-class OOO_DLLPUBLIC_CHARTTOOLS DiagramHelper
+class DiagramHelper
{
public:
- struct tTemplateWithServiceName {
- rtl::Reference< ::chart::ChartTypeTemplate > xChartTypeTemplate;
- OUString sServiceName;
- };
-
- /** tries to find a template in the chart-type manager that matches the
- given diagram.
-
- @return
- A pair containing a template with the correct properties set as
- first entry and the service name of the templates second entry. If
- no template was found both elements are empty.
- */
- static tTemplateWithServiceName
- getTemplateForDiagram(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- const rtl::Reference< ::chart::ChartTypeManager > & xChartTypeManager);
-
- /** Sets the "SwapXAndYAxis" property at all coordinate systems found in the
- given diagram.
-
- "vertical==true" for bar charts, "vertical==false" for column charts
- */
- static void setVertical( const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- bool bVertical );
-
- /** Gets the "SwapXAndYAxis" property at all coordinate systems found in the
- given diagram.
-
- "vertical==true" for bar charts, "vertical==false" for column charts
- */
- static bool getVertical( const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- bool& rbOutFoundResult, bool& rbOutAmbiguousResult );
-
- static StackMode getStackMode(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- bool& rbFound, bool& rbAmbiguous
- );
-
- /** The stacking mode is only set at the series found inside
- the first chart type. This is the standard for all current
- templates (the only template that has more than one chart-type and
- allows stacking is bar/line combi, and for this the stacking only
- applies to the first chart type/the bars)
- */
- static void setStackMode(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- StackMode eStackMode
- );
/** Retrieves the stackmode of the first DataSeries or none. If the series have differing stack
modes, rbAmbiguous is set to true. If no series is there rbFound is set to false.
@@ -113,93 +47,24 @@ public:
"ambiguous")
*/
static StackMode getStackModeFromChartType(
- const css::uno::Reference< css::chart2::XChartType > & xChartType,
+ const rtl::Reference< ::chart::ChartType > & xChartType,
bool& rbFound, bool& rbAmbiguous,
- const css::uno::Reference< css::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
+ const rtl::Reference< ::chart::BaseCoordinateSystem > & xCorrespondingCoordinateSystem
);
- /** Returns the dimension found for all chart types in the tree. If the
- dimension is not unique, 0 is returned.
- */
- static sal_Int32 getDimension(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
-
- /** Sets the dimension of the diagram given.
-
- 1. Sets the dimension of all used ChartTypes
- 2. Adapts the DataSeriesTree to reflect the new dimension
- 3. If new coordinate-systems have to be created, adapts the
- XCoordinateSystemContainer of the diagram.
- */
- static void setDimension(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- sal_Int32 nNewDimensionCount );
-
- /** Replaces all occurrences of xCooSysToReplace in the tree with
- xReplacement in the diagram's tree
- */
- SAL_DLLPRIVATE static void replaceCoordinateSystem(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- const css::uno::Reference< css::chart2::XCoordinateSystem > & xCooSysToReplace,
- const css::uno::Reference< css::chart2::XCoordinateSystem > & xReplacement );
-
- static bool isSeriesAttachedToMainAxis(
- const css::uno::Reference< css::chart2::XDataSeries >& xDataSeries );
-
- static bool attachSeriesToAxis( bool bMainAxis,
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- const css::uno::Reference< css::uno::XComponentContext > & xContext,
- bool bAdaptAxes=true );
-
- static css::uno::Reference< css::chart2::XAxis > getAttachedAxis(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
-
- static css::uno::Reference< css::chart2::XChartType >
- getChartTypeOfSeries(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
-
- static std::vector< css::uno::Reference< css::chart2::XDataSeries > >
- getDataSeriesFromDiagram(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
-
- /** return all data series in this diagram grouped by chart-types
- */
- static css::uno::Sequence<
- css::uno::Sequence<
- css::uno::Reference< css::chart2::XDataSeries > > >
- getDataSeriesGroups(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
-
- static bool isCategoryDiagram(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
-
- static void setCategoriesToDiagram(
- const css::uno::Reference< css::chart2::data::XLabeledDataSequence >& xCategories,
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- bool bSetAxisType = false, // when this flag is true ...
- bool bCategoryAxis = true);// set the AxisType to CATEGORY or back to REALNUMBER
-
- static css::uno::Reference< css::chart2::data::XLabeledDataSequence >
- getCategoriesFromDiagram(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
-
static css::uno::Sequence< OUString >
getExplicitSimpleCategories( ChartModel& rModel );
- SAL_DLLPRIVATE static css::uno::Sequence< OUString >
+ static css::uno::Sequence< OUString >
generateAutomaticCategoriesFromCooSys(
- const css::uno::Reference< css::chart2::XCoordinateSystem > & xCooSys );
+ const rtl::Reference< ::chart::BaseCoordinateSystem > & xCooSys );
static void switchToDateCategories(
- const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc );
+ const rtl::Reference<::chart::ChartModel> & xChartDoc );
static void switchToTextCategories(
- const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc );
+ const rtl::Reference<::chart::ChartModel> & xChartDoc );
- static bool isSupportingDateAxis( const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
static bool isDateNumberFormat( sal_Int32 nNumberFormat, const css::uno::Reference< css::util::XNumberFormats >& xNumberFormats );
static sal_Int32 getDateNumberFormat( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
static sal_Int32 getDateTimeInputNumberFormat( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier, double fNumber );
@@ -207,81 +72,14 @@ public:
static sal_Int32 getPercentNumberFormat( const css::uno::Reference<
css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
- static css::uno::Reference< css::chart2::XChartType >
- getChartTypeByIndex( const css::uno::Reference< css::chart2::XDiagram >& xDiagram, sal_Int32 nIndex );
-
- static css::uno::Sequence<
- css::uno::Reference< css::chart2::XChartType > >
- getChartTypesFromDiagram(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
-
- SAL_DLLPRIVATE static bool areChartTypesCompatible( const css::uno::Reference<
- css::chart2::XChartType >& xFirstType,
- const css::uno::Reference< css::chart2::XChartType >& xSecondType );
-
- /**
- * Test if a series can be moved.
- *
- * @param xDiagram
- * Reference to the diagram that contains the series.
- *
- * @param xGivenDataSeries
- * Reference to the series that should be tested for moving.
- *
- * @param bForward
- * Direction of the move to be checked.
- *
- * @returns </sal_True> if the series can be moved.
- *
- */
- static bool isSeriesMoveable(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- const css::uno::Reference< css::chart2::XDataSeries >& xGivenDataSeries,
- bool bForward );
-
- /**
- * Move a series forward or backward.
- *
- * @param xDiagram
- * Reference to the diagram that contains the series.
- *
- * @param xGivenDataSeries
- * Reference to the series that should be moved.
- *
- * @param bForward
- * Direction in which the series should be moved.
- *
- * @returns </sal_True> if the series was moved successfully.
- *
- */
- static bool moveSeries(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- const css::uno::Reference< css::chart2::XDataSeries >& xGivenDataSeries,
- bool bForward );
-
- static bool isSupportingFloorAndWall( const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
-
- static bool isPieOrDonutChart( const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
-
- static sal_Int32 getGeometry3D(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- bool& rbFound, bool& rbAmbiguous );
-
- static void setGeometry3D(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- sal_Int32 nNewGeometry );
-
- //returns integer from constant group css::chart::MissingValueTreatment
- static sal_Int32 getCorrectedMissingValueTreatment(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram,
- const css::uno::Reference< css::chart2::XChartType >& xChartType );
-
- static DiagramPositioningMode getDiagramPositioningMode( const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+ static bool areChartTypesCompatible(
+ const rtl::Reference< ::chart::ChartType >& xFirstType,
+ const rtl::Reference< ::chart::ChartType >& xSecondType );
- static bool setDiagramPositioning( const css::uno::Reference< css::frame::XModel >& xChartModel,
+ static bool setDiagramPositioning( const rtl::Reference<::chart::ChartModel>& xChartModel,
const css::awt::Rectangle& rPosRect /*100th mm*/ );
- static css::awt::Rectangle getDiagramRectangleFromModel( const css::uno::Reference< css::frame::XModel >& xChartModel );
+ static css::awt::Rectangle getDiagramRectangleFromModel( const rtl::Reference<::chart::ChartModel>& xChartModel );
static bool switchDiagramPositioningToExcludingPositioning( ChartModel& rModel
, bool bResetModifiedState //set model back to unchanged if it was unchanged before
diff --git a/chart2/source/inc/DisposeHelper.hxx b/chart2/source/inc/DisposeHelper.hxx
index 8c9b0b7d47f3..e39c88760dcc 100644
--- a/chart2/source/inc/DisposeHelper.hxx
+++ b/chart2/source/inc/DisposeHelper.hxx
@@ -33,7 +33,16 @@ template <class T> void Dispose(const T& xInterface)
template <class T> void DisposeAndClear(css::uno::Reference<T>& rInterface)
{
Dispose<css::uno::Reference<T>>(rInterface);
- rInterface.set(nullptr);
+ rInterface.clear();
+}
+
+template <class T> void DisposeAndClear(rtl::Reference<T>& rInterface)
+{
+ if (rInterface)
+ {
+ rInterface->dispose();
+ rInterface.clear();
+ }
}
template <class Container> void DisposeAllElements(Container& rContainer)
diff --git a/chart2/source/inc/ErrorBar.hxx b/chart2/source/inc/ErrorBar.hxx
index bf31ed364d72..869b3e306fdc 100644
--- a/chart2/source/inc/ErrorBar.hxx
+++ b/chart2/source/inc/ErrorBar.hxx
@@ -18,8 +18,7 @@
*/
#pragma once
-#include <cppuhelper/basemutex.hxx>
-#include "charttoolsdllapi.hxx"
+#include <config_options.h>
#include <cppuhelper/implbase.hxx>
@@ -57,9 +56,7 @@ typedef ::cppu::WeakImplHelper<
ErrorBar_Base;
}
-class ErrorBar final :
- public cppu::BaseMutex,
- public impl::ErrorBar_Base
+class ErrorBar final : public impl::ErrorBar_Base
{
private:
OUString maDashName;
@@ -77,7 +74,7 @@ private:
sal_Int32 meStyle;
public:
- OOO_DLLPUBLIC_CHARTTOOLS explicit ErrorBar();
+ explicit ErrorBar();
virtual ~ErrorBar() override;
/// XServiceInfo declarations
diff --git a/chart2/source/inc/EventListenerHelper.hxx b/chart2/source/inc/EventListenerHelper.hxx
index a042c006716d..dcf3256d46b5 100644
--- a/chart2/source/inc/EventListenerHelper.hxx
+++ b/chart2/source/inc/EventListenerHelper.hxx
@@ -20,7 +20,7 @@
#include <com/sun/star/lang/XComponent.hpp>
-#include <algorithm>
+#include <utility>
namespace com::sun::star::lang { class XEventListener; }
@@ -35,8 +35,8 @@ namespace impl
template< class InterfaceRef >
struct addListenerFunctor
{
- explicit addListenerFunctor( const css::uno::Reference< css::lang::XEventListener > & xListener ) :
- m_xListener( xListener )
+ explicit addListenerFunctor( css::uno::Reference< css::lang::XEventListener > xListener ) :
+ m_xListener(std::move( xListener ))
{}
void operator() ( const InterfaceRef & xObject )
@@ -53,8 +53,8 @@ private:
template< class InterfaceRef >
struct removeListenerFunctor
{
- explicit removeListenerFunctor( const css::uno::Reference< css::lang::XEventListener > & xListener ) :
- m_xListener( xListener )
+ explicit removeListenerFunctor( css::uno::Reference< css::lang::XEventListener > xListener ) :
+ m_xListener(std::move( xListener ))
{}
void operator() ( const InterfaceRef & xObject )
diff --git a/chart2/source/inc/ExplicitCategoriesProvider.hxx b/chart2/source/inc/ExplicitCategoriesProvider.hxx
index 63097a3aea11..9e43abfc268e 100644
--- a/chart2/source/inc/ExplicitCategoriesProvider.hxx
+++ b/chart2/source/inc/ExplicitCategoriesProvider.hxx
@@ -18,28 +18,30 @@
*/
#pragma once
-#include "charttoolsdllapi.hxx"
-#include <cppuhelper/weakref.hxx>
+#include <config_options.h>
+#include <unotools/weakref.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
+#include <utility>
#include <vector>
namespace chart { class ChartModel; }
-namespace com::sun::star::chart2 { class XCoordinateSystem; }
+namespace com::sun::star::chart2::data { class XDataProvider; }
namespace com::sun::star::chart2::data { class XDataSequence; }
namespace com::sun::star::chart2::data { class XLabeledDataSequence; }
namespace com::sun::star::uno { class Any; }
namespace chart
{
+class BaseCoordinateSystem;
-struct OOO_DLLPUBLIC_CHARTTOOLS ComplexCategory
+struct ComplexCategory
{
OUString Text;
sal_Int32 Count;
- ComplexCategory( const OUString& rText, sal_Int32 nCount ) : Text( rText ), Count (nCount)
+ ComplexCategory( OUString aText, sal_Int32 nCount ) : Text(std::move( aText )), Count (nCount)
{}
};
@@ -52,10 +54,10 @@ public:
virtual css::uno::Sequence< OUString > getStringsForLevel( sal_Int32 nIndex ) const = 0;
};
-class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider final
+class ExplicitCategoriesProvider final
{
public:
- ExplicitCategoriesProvider( const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSysModel
+ ExplicitCategoriesProvider( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSysModel
, ChartModel& rChartModel
);
~ExplicitCategoriesProvider();
@@ -68,7 +70,7 @@ public:
const std::vector<ComplexCategory>* getCategoriesByLevel( sal_Int32 nLevel );
static OUString getCategoryByIndex(
- const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSysModel
+ const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSysModel
, ChartModel& rModel
, sal_Int32 nIndex );
@@ -82,8 +84,8 @@ public:
bool hasComplexCategories() const;
sal_Int32 getCategoryLevelCount() const;
- const css::uno::Sequence< css::uno::Reference<
- css::chart2::data::XLabeledDataSequence> >& getSplitCategoriesList() const { return m_aSplitCategoriesList;}
+ const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence> >&
+ getSplitCategoriesList() const { return m_aSplitCategoriesList;}
bool isDateAxis();
const std::vector< double >& getDateCategories();
@@ -92,16 +94,17 @@ private:
ExplicitCategoriesProvider(ExplicitCategoriesProvider const &) = delete;
ExplicitCategoriesProvider& operator =(ExplicitCategoriesProvider const &) = delete;
+ void implInitSplit();
+
bool volatile m_bDirty;
- css::uno::WeakReference< css::chart2::XCoordinateSystem > m_xCooSysModel;
+ unotools::WeakReference< ::chart::BaseCoordinateSystem > m_xCooSysModel;
ChartModel& mrModel;
css::uno::Reference< css::chart2::data::XLabeledDataSequence> m_xOriginalCategories;
bool m_bIsExplicitCategoriesInited;
css::uno::Sequence< OUString > m_aExplicitCategories;
std::vector< std::vector< ComplexCategory > > m_aComplexCats;
- css::uno::Sequence< css::uno::Reference<
- css::chart2::data::XLabeledDataSequence> > m_aSplitCategoriesList;
+ std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence> > m_aSplitCategoriesList;
bool m_bIsDateAxis;
bool m_bIsAutoDate;
diff --git a/chart2/source/inc/FillProperties.hxx b/chart2/source/inc/FillProperties.hxx
index 84759cfa0ced..c76ee51d1a2f 100644
--- a/chart2/source/inc/FillProperties.hxx
+++ b/chart2/source/inc/FillProperties.hxx
@@ -20,7 +20,6 @@
#include "PropertyHelper.hxx"
#include "FastPropertyIdRanges.hxx"
-#include "charttoolsdllapi.hxx"
#include <vector>
@@ -63,10 +62,10 @@ namespace FillProperties
, PROP_FILL_BACKGROUND
};
- OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(
+ void AddPropertiesToVector(
std::vector< css::beans::Property > & rOutProperties );
- OOO_DLLPUBLIC_CHARTTOOLS void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
+ void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
}
} // namespace chart
diff --git a/chart2/source/model/main/FormattedString.hxx b/chart2/source/inc/FormattedString.hxx
index 878c300156b4..cf3c68dd0a56 100644
--- a/chart2/source/model/main/FormattedString.hxx
+++ b/chart2/source/inc/FormattedString.hxx
@@ -18,14 +18,14 @@
*/
#pragma once
-#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
+#include "OPropertySet.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/chart2/XDataPointCustomLabelField.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <ModifyListenerHelper.hxx>
+#include "ModifyListenerHelper.hxx"
+#include "PropertyHelper.hxx"
namespace chart
{
@@ -42,7 +42,6 @@ typedef ::cppu::WeakImplHelper<
}
class FormattedString final :
- public cppu::BaseMutex,
public impl::FormattedString_Base,
public ::property::OPropertySet
{
@@ -73,7 +72,6 @@ public:
virtual void SAL_CALL removeVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) override
{ ::property::OPropertySet::removeVetoableChangeListener(p1, p2); }
-private:
explicit FormattedString( const FormattedString & rOther );
// ____ XFormattedString ____
@@ -118,6 +116,7 @@ private:
virtual void SAL_CALL disposing(
const css::lang::EventObject& Source ) override;
+private:
// ____ OPropertySet ____
virtual void firePropertyChangeEvent() override;
using OPropertySet::disposing;
@@ -136,6 +135,8 @@ private:
rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
};
+const ::chart::tPropertyValueMap & StaticFormattedStringDefaults();
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/FormattedStringHelper.hxx b/chart2/source/inc/FormattedStringHelper.hxx
index 45ce0b30142e..31706b55ffc1 100644
--- a/chart2/source/inc/FormattedStringHelper.hxx
+++ b/chart2/source/inc/FormattedStringHelper.hxx
@@ -18,24 +18,22 @@
*/
#pragma once
-#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ref.hxx>
+#include <rtl/ustring.hxx>
namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XFormattedString2; }
-namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::uno { template <class interface_type> class Reference; }
namespace chart
{
+class FormattedString;
class FormattedStringHelper
{
public:
- static css::uno::Sequence<
- css::uno::Reference< css::chart2::XFormattedString2 > >
- createFormattedStringSequence(
- const css::uno::Reference< css::uno::XComponentContext > & xContext
- , const OUString & rString
+ static rtl::Reference< ::chart::FormattedString >
+ createFormattedString(
+ const OUString & rString
, const css::uno::Reference< css::beans::XPropertySet > & xTextProperties ) noexcept;
};
diff --git a/chart2/source/model/main/GridProperties.hxx b/chart2/source/inc/GridProperties.hxx
index 43ab136c8332..05108f739473 100644
--- a/chart2/source/model/main/GridProperties.hxx
+++ b/chart2/source/inc/GridProperties.hxx
@@ -18,14 +18,13 @@
*/
#pragma once
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <ModifyListenerHelper.hxx>
+#include "ModifyListenerHelper.hxx"
-#include <OPropertySet.hxx>
+#include "OPropertySet.hxx"
namespace chart
{
@@ -41,12 +40,12 @@ typedef ::cppu::WeakImplHelper<
}
class GridProperties final :
- public cppu::BaseMutex,
public impl::GridProperties_Base,
public ::property::OPropertySet
{
public:
explicit GridProperties();
+ explicit GridProperties( const GridProperties & rOther );
virtual ~GridProperties() override;
/// XServiceInfo declarations
@@ -59,9 +58,6 @@ public:
/// merge XTypeProvider implementations
DECLARE_XTYPEPROVIDER()
-private:
- explicit GridProperties( const GridProperties & rOther );
-
// ____ OPropertySet ____
virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
@@ -80,6 +76,8 @@ private:
virtual void SAL_CALL removeModifyListener(
const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
+private:
+
// ____ XModifyListener ____
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
diff --git a/chart2/source/inc/HistogramDataSequence.hxx b/chart2/source/inc/HistogramDataSequence.hxx
new file mode 100644
index 000000000000..3a8ac0233476
--- /dev/null
+++ b/chart2/source/inc/HistogramDataSequence.hxx
@@ -0,0 +1,104 @@
+/* -*- 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
+
+// helper classes
+#include <comphelper/compbase.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/propertycontainer2.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <rtl/ref.hxx>
+
+#include "ModifyListenerHelper.hxx"
+
+// interfaces and types
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/chart2/data/XDataSequence.hpp>
+#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
+#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+
+namespace chart
+{
+typedef ::comphelper::WeakComponentImplHelper<
+ css::chart2::data::XDataSequence, css::chart2::data::XNumericalDataSequence,
+ css::chart2::data::XTextualDataSequence, css::util::XCloneable, css::util::XModifyBroadcaster,
+ css::lang::XServiceInfo>
+ HistogramDataSequence_Base;
+
+class HistogramDataSequence final
+ : public HistogramDataSequence_Base,
+ public ::comphelper::OPropertyContainer2,
+ public ::comphelper::OPropertyArrayUsageHelper<HistogramDataSequence>
+{
+public:
+ HistogramDataSequence();
+ virtual ~HistogramDataSequence() override;
+
+ /// declare XServiceInfo methods
+ OUString SAL_CALL getImplementationName() override;
+ sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ /// merge XInterface implementations
+ DECLARE_XINTERFACE()
+
+ /// merge XTypeProvider implementations
+ DECLARE_XTYPEPROVIDER()
+
+ // XPropertySet
+ /// @see css::beans::XPropertySet
+ virtual css::uno::Reference<css::beans::XPropertySetInfo>
+ SAL_CALL getPropertySetInfo() override;
+ /// @see ::comphelper::OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+ /// @see ::comphelper::OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
+
+ // XDataSequence
+ css::uno::Sequence<css::uno::Any> SAL_CALL getData() override;
+ OUString SAL_CALL getSourceRangeRepresentation() override;
+ css::uno::Sequence<OUString>
+ SAL_CALL generateLabel(css::chart2::data::LabelOrigin nLabelOrigin) override;
+ sal_Int32 SAL_CALL getNumberFormatKeyByIndex(sal_Int32 nIndex) override;
+
+ // XNumericalDataSequence
+ /// @see css::chart::data::XNumericalDataSequence
+ virtual css::uno::Sequence<double> SAL_CALL getNumericalData() override;
+
+ // XTextualDataSequence
+ /// @see css::chart::data::XTextualDataSequence
+ virtual css::uno::Sequence<OUString> SAL_CALL getTextualData() override;
+
+ // XCloneable
+ virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() override;
+
+ // XModifyBroadcaster
+ virtual void SAL_CALL
+ addModifyListener(const css::uno::Reference<css::util::XModifyListener>& aListener) override;
+ virtual void SAL_CALL
+ removeModifyListener(const css::uno::Reference<css::util::XModifyListener>& aListener) override;
+
+ void setLabels(css::uno::Sequence<OUString> const& xLabels) { mxLabels = xLabels; }
+
+ void setValues(css::uno::Sequence<double> const& xValues) { mxValues = xValues; }
+
+private:
+ rtl::Reference<chart::ModifyEventForwarder> m_xModifyEventForwarder;
+ OUString m_sRole;
+ css::uno::Sequence<OUString> mxLabels;
+ css::uno::Sequence<double> mxValues;
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/InternalData.hxx b/chart2/source/inc/InternalData.hxx
index 9d9abeb3a7c0..1d52df4566c7 100644
--- a/chart2/source/inc/InternalData.hxx
+++ b/chart2/source/inc/InternalData.hxx
@@ -44,6 +44,7 @@ public:
void setComplexColumnLabel( sal_Int32 nColumnIndex, std::vector< css::uno::Any >&& rComplexLabel );
void setComplexRowLabel( sal_Int32 nRowIndex, std::vector< css::uno::Any >&& rComplexLabel );
+ void setComplexCategoryLabel( sal_Int32 nRowIndex, std::vector< css::uno::Any >&& rComplexLabel );
std::vector< css::uno::Any > getComplexColumnLabel( sal_Int32 nColumnIndex ) const;
std::vector< css::uno::Any > getComplexRowLabel( sal_Int32 nRowIndex ) const;
diff --git a/chart2/source/inc/InternalDataProvider.hxx b/chart2/source/inc/InternalDataProvider.hxx
index 0fa2bdf8b855..26a759c56865 100644
--- a/chart2/source/inc/InternalDataProvider.hxx
+++ b/chart2/source/inc/InternalDataProvider.hxx
@@ -19,6 +19,7 @@
#pragma once
#include "InternalData.hxx"
+#include <ChartModel.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/chart/XDateCategories.hpp>
@@ -30,6 +31,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/weakref.hxx>
#include <rtl/ref.hxx>
+#include <unotools/weakref.hxx>
#include <map>
@@ -37,6 +39,7 @@ namespace com::sun::star::chart2 { class XChartDocument; }
namespace chart
{
+class ChartModel;
class UncachedDataSequence;
namespace impl
@@ -72,7 +75,7 @@ public:
// #i120559# allow handing over a default for data orientation
// (DataInColumns) that will be used when no data is available
explicit InternalDataProvider(
- const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc,
+ const rtl::Reference< ::chart::ChartModel > & xChartDoc,
bool bConnectToModel,
bool bDefaultDataInColumns );
explicit InternalDataProvider( const InternalDataProvider & rOther );
@@ -100,6 +103,7 @@ public:
virtual void SAL_CALL swapDataPointWithNextOneForAllSequences( ::sal_Int32 nAtIndex ) override;
virtual void SAL_CALL registerDataSequenceForChanges(
const css::uno::Reference< css::chart2::data::XDataSequence >& xSeq ) override;
+ virtual void SAL_CALL insertDataSeries( ::sal_Int32 nAfterIndex ) override;
// ____ XDataProvider (base of XInternalDataProvider) ____
virtual sal_Bool SAL_CALL createDataSourcePossible(
@@ -174,6 +178,8 @@ public:
// css::lang::XInitialization:
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > & aArguments) override;
+ void setChartModel(ChartModel* pChartModel);
+
private:
void addDataSequenceToMap(
const OUString & rRangeRepresentation,
@@ -212,6 +218,9 @@ private:
tSequenceMap m_aSequenceMap;
InternalData m_aInternalData;
bool m_bDataInColumns;
+
+ // keep a weak reference to the owning m_xChartModel for insertDataSeries
+ unotools::WeakReference<ChartModel> m_xChartModel;
};
} // namespace chart
diff --git a/chart2/source/inc/LabeledDataSequence.hxx b/chart2/source/inc/LabeledDataSequence.hxx
index 811eb1997e49..c36f1918cfa5 100644
--- a/chart2/source/inc/LabeledDataSequence.hxx
+++ b/chart2/source/inc/LabeledDataSequence.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include <cppuhelper/basemutex.hxx>
+#include <config_options.h>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp>
@@ -41,16 +41,16 @@ typedef cppu::WeakImplHelper<
}
class LabeledDataSequence final :
- public cppu::BaseMutex,
public impl::LabeledDataSequence_Base
{
public:
explicit LabeledDataSequence();
+ explicit LabeledDataSequence(const LabeledDataSequence &);
explicit LabeledDataSequence(
- const css::uno::Reference< css::chart2::data::XDataSequence > & rValues );
+ css::uno::Reference< css::chart2::data::XDataSequence > xValues );
explicit LabeledDataSequence(
- const css::uno::Reference< css::chart2::data::XDataSequence > & rValues,
- const css::uno::Reference< css::chart2::data::XDataSequence > & rLabels );
+ css::uno::Reference< css::chart2::data::XDataSequence > xValues,
+ css::uno::Reference< css::chart2::data::XDataSequence > xLabels );
virtual ~LabeledDataSequence() override;
@@ -59,7 +59,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
-protected:
// ____ XLabeledDataSequence ____
virtual css::uno::Reference< css::chart2::data::XDataSequence > SAL_CALL getValues() override;
virtual void SAL_CALL setValues(
diff --git a/chart2/source/model/main/Legend.hxx b/chart2/source/inc/Legend.hxx
index 8748a4592393..7927f20fcc3b 100644
--- a/chart2/source/model/main/Legend.hxx
+++ b/chart2/source/inc/Legend.hxx
@@ -18,14 +18,14 @@
*/
#pragma once
-#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
+#include "OPropertySet.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <ModifyListenerHelper.hxx>
+#include "ModifyListenerHelper.hxx"
+#include "PropertyHelper.hxx"
namespace chart
{
@@ -42,7 +42,6 @@ typedef ::cppu::WeakImplHelper<
}
class Legend final :
- public cppu::BaseMutex,
public impl::Legend_Base,
public ::property::OPropertySet
{
@@ -60,15 +59,16 @@ public:
/// merge XTypeProvider implementations
DECLARE_XTYPEPROVIDER()
-private:
explicit Legend( const Legend & rOther );
+private:
// ____ OPropertySet ____
virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
// ____ OPropertySet ____
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
+public:
// ____ XPropertySet ____
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
@@ -82,6 +82,7 @@ private:
virtual void SAL_CALL removeModifyListener(
const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
+private:
// ____ XModifyListener ____
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
@@ -97,6 +98,8 @@ private:
rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
};
+const ::chart::tPropertyValueMap& StaticLegendDefaults();
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/LegendHelper.hxx b/chart2/source/inc/LegendHelper.hxx
index d0f19ebb8385..577047888ee8 100644
--- a/chart2/source/inc/LegendHelper.hxx
+++ b/chart2/source/inc/LegendHelper.hxx
@@ -18,27 +18,28 @@
*/
#pragma once
+#include <config_options.h>
#include <com/sun/star/uno/Reference.hxx>
-#include "charttoolsdllapi.hxx"
+#include <rtl/ref.hxx>
namespace chart { class ChartModel; }
-namespace com::sun::star::chart2 { class XDiagram; }
-namespace com::sun::star::chart2 { class XLegend; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
+class Diagram;
+class Legend;
-class OOO_DLLPUBLIC_CHARTTOOLS LegendHelper
+class LegendHelper
{
public:
- static css::uno::Reference< css::chart2::XLegend >
+ static rtl::Reference< ::chart::Legend >
showLegend( ChartModel& rModel
, const css::uno::Reference< css::uno::XComponentContext >& xContext );
static void hideLegend( ChartModel& rModel );
- static css::uno::Reference< css::chart2::XLegend >
+ static rtl::Reference< ::chart::Legend >
getLegend( ChartModel& rModel
, const css::uno::Reference< css::uno::XComponentContext >& xContext = nullptr
, bool bCreate = false );
@@ -47,7 +48,7 @@ public:
is a legend which has a "Show" property of value <FALSE/>. Otherwise,
<TRUE/> is returned.
*/
- static bool hasLegend( const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
+ static bool hasLegend( const rtl::Reference< ::chart::Diagram > & xDiagram );
};
} //namespace chart
diff --git a/chart2/source/inc/LifeTime.hxx b/chart2/source/inc/LifeTime.hxx
index 613d92314f96..1e3e2cee26ab 100644
--- a/chart2/source/inc/LifeTime.hxx
+++ b/chart2/source/inc/LifeTime.hxx
@@ -18,24 +18,26 @@
*/
#pragma once
-#include <osl/mutex.hxx>
+#include <config_options.h>
+#include <mutex>
#include <osl/conditn.hxx>
-#include <comphelper/multicontainer2.hxx>
-#include "charttoolsdllapi.hxx"
+#include <comphelper/interfacecontainer4.hxx>
+namespace com::sun::star::document { class XStorageChangeListener; }
namespace com::sun::star::lang { class XComponent; }
+namespace com::sun::star::lang { class XEventListener; }
namespace com::sun::star::util { class CloseVetoException; }
namespace com::sun::star::util { class XCloseListener; }
namespace com::sun::star::util { class XCloseable; }
+namespace com::sun::star::util { class XModifyListener; }
+namespace com::sun::star::view { class XSelectionChangeListener; }
namespace apphelper
{
-class OOO_DLLPUBLIC_CHARTTOOLS LifeTimeManager
+class LifeTimeManager
{
friend class LifeTimeGuard;
-protected:
- mutable ::osl::Mutex m_aAccessMutex;
public:
LifeTimeManager( css::lang::XComponent* pComponent );
virtual ~LifeTimeManager();
@@ -44,25 +46,25 @@ public:
/// @throws css::uno::RuntimeException
bool dispose();
-public:
- ::comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer;
+ mutable std::mutex m_aAccessMutex;
+ ::comphelper::OInterfaceContainerHelper4<css::util::XCloseListener> m_aCloseListeners;
+ ::comphelper::OInterfaceContainerHelper4<css::util::XModifyListener> m_aModifyListeners;
+ ::comphelper::OInterfaceContainerHelper4<css::document::XStorageChangeListener> m_aStorageChangeListeners;
+ ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_aEventListeners;
+ ::comphelper::OInterfaceContainerHelper4<css::view::XSelectionChangeListener> m_aSelectionChangeListeners;
protected:
- SAL_DLLPRIVATE virtual bool impl_canStartApiCall();
- SAL_DLLPRIVATE virtual void impl_apiCallCountReachedNull(){}
+ virtual bool impl_canStartApiCall();
+ virtual void impl_apiCallCountReachedNull(std::unique_lock<std::mutex>& /*rGuard*/){}
- SAL_DLLPRIVATE void impl_registerApiCall(bool bLongLastingCall);
- SAL_DLLPRIVATE void impl_unregisterApiCall(bool bLongLastingCall);
+ void impl_registerApiCall(bool bLongLastingCall);
+ void impl_unregisterApiCall(std::unique_lock<std::mutex>& rGuard, bool bLongLastingCall);
-protected:
css::lang::XComponent* m_pComponent;
-
::osl::Condition m_aNoAccessCountCondition;
sal_Int32 m_nAccessCount;
-
bool volatile m_bDisposed;
bool volatile m_bInDispose;
-
::osl::Condition m_aNoLongLastingCallCountCondition;
sal_Int32 m_nLongLastingCallCount;
};
@@ -72,12 +74,12 @@ class CloseableLifeTimeManager final : public LifeTimeManager
css::util::XCloseable* m_pCloseable;
::osl::Condition m_aEndTryClosingCondition;
- bool volatile m_bClosed;
- bool volatile m_bInTryClose;
+ bool m_bClosed;
+ bool m_bInTryClose;
//the ownership between model and controller is not clear at first
//each controller might consider him as owner of the model first
//at start the model is not considered as owner of itself
- bool volatile m_bOwnership;
+ bool m_bOwnership;
public:
CloseableLifeTimeManager( css::util::XCloseable* pCloseable
@@ -89,17 +91,16 @@ public:
bool g_close_startTryClose(bool bDeliverOwnership);
/// @throws css::util::CloseVetoException
void g_close_isNeedToCancelLongLastingCalls( bool bDeliverOwnership, css::util::CloseVetoException const & ex );
- void g_close_endTryClose(bool bDeliverOwnership );
+ void g_close_endTryClose();
void g_close_endTryClose_doClose();
/// @throws css::uno::RuntimeException
void g_addCloseListener( const css::uno::Reference< css::util::XCloseListener > & xListener );
private:
virtual bool impl_canStartApiCall() override;
- virtual void impl_apiCallCountReachedNull() override;
+ virtual void impl_apiCallCountReachedNull(std::unique_lock<std::mutex>& rGuard) override;
- void impl_setOwnership( bool bDeliverOwnership, bool bMyVeto );
- void impl_doClose();
+ void impl_doClose(std::unique_lock<std::mutex>& rGuard);
};
/*
@@ -178,10 +179,10 @@ public:
}
bool startApiCall(bool bLongLastingCall=false);
~LifeTimeGuard();
- void clear() { m_guard.clear(); }
+ void clear() { m_guard.unlock(); }
private:
- osl::ClearableMutexGuard m_guard;
+ std::unique_lock<std::mutex> m_guard;
LifeTimeManager& m_rManager;
bool m_bCallRegistered;
bool m_bLongLastingCallRegistered;
@@ -191,23 +192,6 @@ private:
LifeTimeGuard& operator= ( const LifeTimeGuard& ) = delete;
};
-template<class T>
-class NegativeGuard final
-{
- T * m_pT;
-public:
-
- NegativeGuard(T & t) : m_pT(&t)
- {
- m_pT->release();
- }
-
- ~NegativeGuard()
- {
- m_pT->acquire();
- }
-};
-
}//end namespace apphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/LinePropertiesHelper.hxx b/chart2/source/inc/LinePropertiesHelper.hxx
index 2999de81a76f..d664273916b3 100644
--- a/chart2/source/inc/LinePropertiesHelper.hxx
+++ b/chart2/source/inc/LinePropertiesHelper.hxx
@@ -20,7 +20,6 @@
#include "PropertyHelper.hxx"
#include "FastPropertyIdRanges.hxx"
-#include "charttoolsdllapi.hxx"
#include <vector>
@@ -48,10 +47,10 @@ namespace LinePropertiesHelper
PROP_LINE_CAP
};
- OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(
+ void AddPropertiesToVector(
std::vector< css::beans::Property > & rOutProperties );
- OOO_DLLPUBLIC_CHARTTOOLS void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
+ void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
bool IsLineVisible( const css::uno::Reference<
css::beans::XPropertySet >& xLineProperties );
diff --git a/chart2/source/inc/MediaDescriptorHelper.hxx b/chart2/source/inc/MediaDescriptorHelper.hxx
index cfef8fc14f68..49893e543241 100644
--- a/chart2/source/inc/MediaDescriptorHelper.hxx
+++ b/chart2/source/inc/MediaDescriptorHelper.hxx
@@ -18,10 +18,10 @@
*/
#pragma once
+#include <config_options.h>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include "charttoolsdllapi.hxx"
namespace com::sun::star::beans { struct PropertyValue; }
namespace com::sun::star::embed { class XStorage; }
@@ -43,7 +43,7 @@ namespace com::sun::star::io { class XStream; }
namespace apphelper
{
-class OOO_DLLPUBLIC_CHARTTOOLS MediaDescriptorHelper final
+class MediaDescriptorHelper final
{
public:
MediaDescriptorHelper( const css::uno::Sequence< css::beans::PropertyValue > & rMediaDescriptor );
@@ -82,7 +82,7 @@ public:
bool ISSET_Stream;
private:
- SAL_DLLPRIVATE void impl_init();
+ void impl_init();
};
}
diff --git a/chart2/source/inc/ModifyListenerCallBack.hxx b/chart2/source/inc/ModifyListenerCallBack.hxx
index 406804189e73..433512bb8244 100644
--- a/chart2/source/inc/ModifyListenerCallBack.hxx
+++ b/chart2/source/inc/ModifyListenerCallBack.hxx
@@ -19,10 +19,10 @@
#pragma once
+#include <config_options.h>
#include <tools/link.hxx>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
-#include "charttoolsdllapi.hxx"
namespace chart
{
@@ -32,17 +32,15 @@ without becoming a XModifyListener yourself
class ModifyListenerCallBack_impl;
-class OOO_DLLPUBLIC_CHARTTOOLS ModifyListenerCallBack final
+class ModifyListenerCallBack final
{
public:
explicit ModifyListenerCallBack(const Link<void*, void>& rCallBack);
~ModifyListenerCallBack();
- void startListening(
- const ::com::sun::star::uno::Reference<::com::sun::star::util::XModifyBroadcaster>&
- xBroadcaster);
- SAL_DLLPRIVATE void stopListening();
+ void startListening(const css::uno::Reference<css::util::XModifyBroadcaster>& xBroadcaster);
+ void stopListening();
private: //methods
ModifyListenerCallBack(const ModifyListenerCallBack&) = delete;
diff --git a/chart2/source/inc/ModifyListenerHelper.hxx b/chart2/source/inc/ModifyListenerHelper.hxx
index b65530d9f229..ee90d407a66f 100644
--- a/chart2/source/inc/ModifyListenerHelper.hxx
+++ b/chart2/source/inc/ModifyListenerHelper.hxx
@@ -75,8 +75,8 @@ namespace impl
template< class InterfaceRef >
struct addListenerFunctor
{
- explicit addListenerFunctor( const css::uno::Reference< css::util::XModifyListener > & xListener ) :
- m_xListener( xListener )
+ explicit addListenerFunctor( css::uno::Reference< css::util::XModifyListener > xListener ) :
+ m_xListener(std::move( xListener ))
{}
void operator() ( const InterfaceRef & xObject )
@@ -93,8 +93,8 @@ private:
template< class InterfaceRef >
struct removeListenerFunctor
{
- explicit removeListenerFunctor( const css::uno::Reference< css::util::XModifyListener > & xListener ) :
- m_xListener( xListener )
+ explicit removeListenerFunctor( css::uno::Reference< css::util::XModifyListener > xListener ) :
+ m_xListener(std::move( xListener ))
{}
void operator() ( const InterfaceRef & xObject )
@@ -111,8 +111,8 @@ private:
template< class Pair >
struct addListenerToMappedElementFunctor
{
- explicit addListenerToMappedElementFunctor( const css::uno::Reference< css::util::XModifyListener > & xListener ) :
- m_xListener( xListener )
+ explicit addListenerToMappedElementFunctor( css::uno::Reference< css::util::XModifyListener > xListener ) :
+ m_xListener(std::move( xListener ))
{}
void operator() ( const Pair & aPair )
@@ -129,8 +129,8 @@ private:
template< class Pair >
struct removeListenerFromMappedElementFunctor
{
- explicit removeListenerFromMappedElementFunctor( const css::uno::Reference< css::util::XModifyListener > & xListener ) :
- m_xListener( xListener )
+ explicit removeListenerFromMappedElementFunctor( css::uno::Reference< css::util::XModifyListener > xListener ) :
+ m_xListener(std::move( xListener ))
{}
void operator() ( const Pair & aPair )
@@ -157,6 +157,14 @@ void addListener(
aFunctor( xObject );
}
}
+template< class T >
+void addListener(
+ const rtl::Reference<T> & xBroadcaster,
+ const css::uno::Reference< css::util::XModifyListener > & xListener )
+{
+ if( xBroadcaster && xListener )
+ xBroadcaster->addModifyListener( xListener );
+}
template< class Container >
void addListenerToAllElements(
@@ -168,6 +176,17 @@ void addListenerToAllElements(
impl::addListenerFunctor< typename Container::value_type >( xListener ));
}
+template< class T >
+void addListenerToAllElements(
+ const std::vector<rtl::Reference<T>> & rContainer,
+ const css::uno::Reference< css::util::XModifyListener > & xListener )
+{
+ if( !xListener )
+ return;
+ for (auto const & i : rContainer)
+ i->addModifyListener(xListener);
+}
+
template< class Container >
void addListenerToAllMapElements(
const Container & rContainer,
@@ -178,16 +197,6 @@ void addListenerToAllMapElements(
impl::addListenerToMappedElementFunctor< typename Container::value_type >( xListener ));
}
-template< typename T >
-void addListenerToAllSequenceElements(
- const css::uno::Sequence< T > & rSequence,
- const css::uno::Reference< css::util::XModifyListener > & xListener )
-{
- if( xListener.is())
- std::for_each( rSequence.begin(), rSequence.end(),
- impl::addListenerFunctor< T >( xListener ));
-}
-
template< class InterfaceRef >
void removeListener(
const InterfaceRef & xObject,
@@ -200,6 +209,15 @@ void removeListener(
}
}
+template< class T >
+void removeListener(
+ const rtl::Reference<T> & xBroadcaster,
+ const css::uno::Reference< css::util::XModifyListener > & xListener )
+{
+ if( xBroadcaster && xListener )
+ xBroadcaster->removeModifyListener( xListener );
+}
+
template< class Container >
void removeListenerFromAllElements(
const Container & rContainer,
@@ -210,6 +228,17 @@ void removeListenerFromAllElements(
impl::removeListenerFunctor< typename Container::value_type >( xListener ));
}
+template< class T >
+void removeListenerFromAllElements(
+ const std::vector<rtl::Reference<T>> & rContainer,
+ const css::uno::Reference< css::util::XModifyListener > & xListener )
+{
+ if( !xListener )
+ return;
+ for (auto const & i : rContainer)
+ i->removeModifyListener(xListener);
+}
+
template< class Container >
void removeListenerFromAllMapElements(
const Container & rContainer,
@@ -220,16 +249,6 @@ void removeListenerFromAllMapElements(
impl::removeListenerFromMappedElementFunctor< typename Container::value_type >( xListener ));
}
-template< typename T >
-void removeListenerFromAllSequenceElements(
- const css::uno::Sequence< T > & rSequence,
- const css::uno::Reference< css::util::XModifyListener > & xListener )
-{
- if( xListener.is())
- std::for_each( rSequence.begin(), rSequence.end(),
- impl::removeListenerFunctor< T >( xListener ));
-}
-
} // namespace chart::ModifyListenerHelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx b/chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx
index f7e25fe51348..abb74ded2294 100644
--- a/chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx
@@ -52,8 +52,8 @@ private:
const css::uno::Reference<css::chart2::XScaling>& xScalingY,
sal_Bool bMaySkipPointsInCalculation ) override;
- void calculateValues(RegressionCalculationHelper::tDoubleVectorPair aValues, bool bUseXAvg);
- void calculateValuesCentral(RegressionCalculationHelper::tDoubleVectorPair aValues);
+ void calculateValues(const RegressionCalculationHelper::tDoubleVectorPair& aValues, bool bUseXAvg);
+ void calculateValuesCentral(const RegressionCalculationHelper::tDoubleVectorPair& aValues);
std::vector<double> aYList;
std::vector<double> aXList;
};
diff --git a/chart2/source/inc/NameContainer.hxx b/chart2/source/inc/NameContainer.hxx
index 66d0fde1a70f..12fc76978b0d 100644
--- a/chart2/source/inc/NameContainer.hxx
+++ b/chart2/source/inc/NameContainer.hxx
@@ -23,7 +23,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <cppuhelper/implbase.hxx>
-#include "charttoolsdllapi.hxx"
#include <map>
diff --git a/chart2/source/inc/NumberFormatterWrapper.hxx b/chart2/source/inc/NumberFormatterWrapper.hxx
index c3412fc9c91c..a229beafcda2 100644
--- a/chart2/source/inc/NumberFormatterWrapper.hxx
+++ b/chart2/source/inc/NumberFormatterWrapper.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "charttoolsdllapi.hxx"
+#include <config_options.h>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <tools/date.hxx>
@@ -28,7 +28,7 @@ class Color;
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS NumberFormatterWrapper final
+class NumberFormatterWrapper final
{
public:
NumberFormatterWrapper( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xSupplier );
diff --git a/chart2/source/inc/OPropertySet.hxx b/chart2/source/inc/OPropertySet.hxx
index 0a810fc6d2d8..037d626fcf83 100644
--- a/chart2/source/inc/OPropertySet.hxx
+++ b/chart2/source/inc/OPropertySet.hxx
@@ -18,7 +18,10 @@
*/
#pragma once
+
+#include <config_options.h>
// helper classes
+#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/propshlp.hxx>
// interfaces and types
@@ -26,14 +29,14 @@
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/beans/XMultiPropertyStates.hpp>
#include <com/sun/star/style/XStyleSupplier.hpp>
-#include "charttoolsdllapi.hxx"
-#include <map>
+#include <unordered_map>
namespace property
{
class SAL_DLLPUBLIC_RTTI OPropertySet :
+ protected cppu::BaseMutex,
public ::cppu::OBroadcastHelper,
// includes beans::XPropertySet, XMultiPropertySet and XFastPropertySet
public ::cppu::OPropertySetHelper,
@@ -45,11 +48,11 @@ class SAL_DLLPUBLIC_RTTI OPropertySet :
public css::style::XStyleSupplier
{
public:
- OPropertySet( ::osl::Mutex & rMutex );
+ OPropertySet();
virtual ~OPropertySet();
protected:
- explicit OPropertySet( const OPropertySet & rOther, ::osl::Mutex & rMutex );
+ explicit OPropertySet( const OPropertySet & rOther );
void SetNewValuesExplicitlyEvenIfTheyEqualDefault();
@@ -103,7 +106,7 @@ protected:
( css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
- const css::uno::Any& rValue ) override;
+ const css::uno::Any& rValue ) override final;
/** The same as setFastPropertyValue; nHandle is always valid.
The changes must not be broadcasted in this method.
@@ -136,15 +139,15 @@ protected:
( css::uno::Any& rValue,
sal_Int32 nHandle ) const override;
- /// make original interface function visible again
- using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue;
-
/** implement this method in derived classes to get called when properties
change.
*/
virtual void firePropertyChangeEvent();
public:
+ /// make original interface function visible again
+ using ::cppu::OPropertySetHelper::getFastPropertyValue;
+
// Interfaces
// ____ XInterface ____
@@ -158,36 +161,35 @@ public:
// ____ XPropertyState ____
virtual css::beans::PropertyState SAL_CALL
- getPropertyState( const OUString& PropertyName ) override;
+ getPropertyState( const OUString& PropertyName ) override final;
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL
- getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
- OOO_DLLPUBLIC_CHARTTOOLS
+ getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override final;
virtual void SAL_CALL
- setPropertyToDefault( const OUString& PropertyName ) override;
+ setPropertyToDefault( const OUString& PropertyName ) override final;
virtual css::uno::Any SAL_CALL
- getPropertyDefault( const OUString& aPropertyName ) override;
+ getPropertyDefault( const OUString& aPropertyName ) override final;
// ____ XMultiPropertyStates ____
// Note: getPropertyStates() is already implemented in XPropertyState with the
// same signature
virtual void SAL_CALL
- setAllPropertiesToDefault() override;
+ setAllPropertiesToDefault() override final;
virtual void SAL_CALL
- setPropertiesToDefault( const css::uno::Sequence< OUString >& aPropertyNames ) override;
+ setPropertiesToDefault( const css::uno::Sequence< OUString >& aPropertyNames ) override final;
virtual css::uno::Sequence< css::uno::Any > SAL_CALL
- getPropertyDefaults( const css::uno::Sequence< OUString >& aPropertyNames ) override;
+ getPropertyDefaults( const css::uno::Sequence< OUString >& aPropertyNames ) override final;
// ____ XStyleSupplier ____
- virtual css::uno::Reference< css::style::XStyle > SAL_CALL getStyle() override;
- virtual void SAL_CALL setStyle( const css::uno::Reference< css::style::XStyle >& xStyle ) override;
+ virtual css::uno::Reference< css::style::XStyle > SAL_CALL getStyle() override final;
+ virtual void SAL_CALL setStyle( const css::uno::Reference< css::style::XStyle >& xStyle ) override final;
// ____ XMultiPropertySet ____
virtual void SAL_CALL setPropertyValues(
const css::uno::Sequence< OUString >& PropertyNames,
- const css::uno::Sequence< css::uno::Any >& Values ) override;
+ const css::uno::Sequence< css::uno::Any >& Values ) override final;
// ____ XFastPropertySet ____
- virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
+ virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const css::uno::Any& rValue ) override final;
// Note: it is assumed that the base class implements setPropertyValue by
// using setFastPropertyValue
@@ -222,12 +224,8 @@ private:
bool SetStyle( const css::uno::Reference< css::style::XStyle > & xStyle );
- /// reference to mutex of class deriving from here
- ::osl::Mutex & m_rMutex;
-
bool m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault;
- typedef std::map< sal_Int32, css::uno::Any > tPropertyMap;
- tPropertyMap m_aProperties;
+ std::unordered_map< sal_Int32, css::uno::Any > m_aProperties;
css::uno::Reference< css::style::XStyle > m_xStyle;
};
diff --git a/chart2/source/inc/ObjectIdentifier.hxx b/chart2/source/inc/ObjectIdentifier.hxx
index e429e3eb2105..2376d7073b79 100644
--- a/chart2/source/inc/ObjectIdentifier.hxx
+++ b/chart2/source/inc/ObjectIdentifier.hxx
@@ -23,7 +23,6 @@
#include <string_view>
#include "TitleHelper.hxx"
-#include "charttoolsdllapi.hxx"
#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
@@ -32,17 +31,16 @@ namespace chart { class ChartModel; }
namespace com::sun::star::awt { struct Point; }
namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::chart2 { class XAxis; }
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::chart2 { class XCoordinateSystem; }
-namespace com::sun::star::chart2 { class XDataSeries; }
-namespace com::sun::star::chart2 { class XDiagram; }
namespace com::sun::star::drawing { class XShape; }
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::uno { class XInterface; }
namespace chart
{
+class Axis;
+class BaseCoordinateSystem;
+class DataSeries;
class Diagram;
+class Legend;
enum ObjectType
{
@@ -70,11 +68,12 @@ enum ObjectType
OBJECTTYPE_DATA_STOCK_RANGE,
OBJECTTYPE_DATA_STOCK_LOSS,
OBJECTTYPE_DATA_STOCK_GAIN,
+ OBJECTTYPE_DATA_TABLE,
OBJECTTYPE_SHAPE,
OBJECTTYPE_UNKNOWN
};
-class OOO_DLLPUBLIC_CHARTTOOLS ObjectIdentifier
+class ObjectIdentifier
{
//CID == ClassifiedIdentifier <--> name of shape
//semicolon, colon, equal sign and slash have special meanings in a CID
@@ -95,45 +94,45 @@ class OOO_DLLPUBLIC_CHARTTOOLS ObjectIdentifier
public:
ObjectIdentifier();
- ObjectIdentifier( const OUString& rObjectCID );
+ ObjectIdentifier( OUString aObjectCID );
ObjectIdentifier( const css::uno::Reference< css::drawing::XShape >& rxShape );
ObjectIdentifier( const css::uno::Any& rAny );
bool operator==( const ObjectIdentifier& rOID ) const;
- bool operator!=( const ObjectIdentifier& rOID ) const;
bool operator<( const ObjectIdentifier& rOID ) const;
static OUString createClassifiedIdentifierForObject(
const css::uno::Reference< css::uno::XInterface >& xObject
- , ChartModel& rModel);
-
+ , const rtl::Reference<::chart::ChartModel>& xChartModel );
static OUString createClassifiedIdentifierForObject(
- const css::uno::Reference< css::uno::XInterface >& xObject
- , const css::uno::Reference< css::frame::XModel >& xChartModel );
+ const rtl::Reference< ::chart::Title >& xObject
+ , const rtl::Reference<::chart::ChartModel>& xChartModel );
+ static OUString createClassifiedIdentifierForObject(
+ const rtl::Reference< ::chart::Legend >& xObject
+ , const rtl::Reference<::chart::ChartModel>& xChartModel );
+ static OUString createClassifiedIdentifierForObject(
+ const rtl::Reference< ::chart::Axis >& xObject
+ , const rtl::Reference<::chart::ChartModel>& xChartModel );
static OUString createClassifiedIdentifierForParticle(
- const OUString& rParticle );
+ std::u16string_view rParticle );
static OUString createClassifiedIdentifierForParticles(
- const OUString& rParentParticle
- , const OUString& rChildParticle
+ std::u16string_view rParentParticle
+ , std::u16string_view rChildParticle
, std::u16string_view rDragMethodServiceName = std::u16string_view()
, std::u16string_view rDragParameterString = std::u16string_view() );
static OUString createClassifiedIdentifierForGrid(
const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::frame::XModel >& xChartModel
+ , const rtl::Reference<::chart::ChartModel>& xChartModel
, sal_Int32 nSubIndex = -1 );//-1: main grid, 0: first subgrid etc
- SAL_DLLPRIVATE static OUString createParticleForDiagram();
-
- static OUString createParticleForCoordinateSystem(
- const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys
- , ChartModel& rModel );
+ static OUString createParticleForDiagram();
static OUString createParticleForCoordinateSystem(
- const css::uno::Reference< css::chart2::XCoordinateSystem >& xCooSys
- , const css::uno::Reference< css::frame::XModel >& xChartModel );
+ const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys
+ , const rtl::Reference<::chart::ChartModel>& xChartModel );
static OUString createParticleForAxis(
sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
@@ -144,14 +143,16 @@ public:
static OUString createParticleForSeries( sal_Int32 nDiagramIndex, sal_Int32 nCooSysIndex
, sal_Int32 nChartTypeIndex, sal_Int32 nSeriesIndex );
- static OUString createParticleForLegend( ChartModel& rModel );
-
static OUString createParticleForLegend(
- const css::uno::Reference< css::frame::XModel >& xChartModel );
+ const rtl::Reference<::chart::ChartModel>& xChartModel );
+
+ /** Creates an identifier for the data table */
+ static OUString createParticleForDataTable(
+ const rtl::Reference<::chart::ChartModel>& xChartModel );
static OUString addChildParticle( std::u16string_view rParticle, std::u16string_view rChildParticle );
static OUString createChildParticleWithIndex( ObjectType eObjectType, sal_Int32 nIndex );
- static sal_Int32 getIndexFromParticleOrCID( const OUString& rParticleOrCID );
+ static sal_Int32 getIndexFromParticleOrCID( std::u16string_view rParticleOrCID );
static OUString createClassifiedIdentifier(
enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_SERIES
@@ -165,22 +166,22 @@ public:
, std::u16string_view rDragParameterString = std::u16string_view()
);
- static bool isCID( const OUString& rName );
- static OUString getDragMethodServiceName( const OUString& rClassifiedIdentifier );
- static OUString getDragParameterString( const OUString& rCID );
- static bool isDragableObject( const OUString& rClassifiedIdentifier );
+ static bool isCID( std::u16string_view rName );
+ static std::u16string_view getDragMethodServiceName( std::u16string_view rClassifiedIdentifier );
+ static std::u16string_view getDragParameterString( std::u16string_view rCID );
+ static bool isDragableObject( std::u16string_view rClassifiedIdentifier );
bool isDragableObject() const;
- static bool isRotateableObject( const OUString& rClassifiedIdentifier );
- static bool isMultiClickObject( const OUString& rClassifiedIdentifier );
- static bool areSiblings( const OUString& rCID1, const OUString& rCID2 );//identical object is no sibling
- static bool areIdenticalObjects( const OUString& rCID1, const OUString& rCID2 );
+ static bool isRotateableObject( std::u16string_view rClassifiedIdentifier );
+ static bool isMultiClickObject( std::u16string_view rClassifiedIdentifier );
+ static bool areSiblings( std::u16string_view rCID1, std::u16string_view rCID2 );//identical object is no sibling
+ static bool areIdenticalObjects( std::u16string_view rCID1, std::u16string_view rCID2 );
static OUString getStringForType( ObjectType eObjectType );
- static ObjectType getObjectType( const OUString& rCID );
+ static ObjectType getObjectType( std::u16string_view rCID );
ObjectType getObjectType() const;
static OUString createSeriesSubObjectStub( ObjectType eSubObjectType
- , const OUString& rSeriesParticle
+ , std::u16string_view rSeriesParticle
, std::u16string_view rDragMethodServiceName = std::u16string_view()
, std::u16string_view rDragParameterString = std::u16string_view() );
static OUString createPointCID( std::u16string_view rPointCID_Stub, sal_Int32 nIndex );
@@ -188,57 +189,49 @@ public:
static OUString createDataCurveCID( std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex, bool bAverageLine );
static OUString createDataCurveEquationCID( std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex );
- SAL_DLLPRIVATE static OUString getObjectID( const OUString& rCID );
- static OUString getParticleID( const OUString& rCID );
- static OUString getFullParentParticle( const OUString& rCID );
+ static OUString getObjectID( std::u16string_view rCID );
+ static std::u16string_view getParticleID( std::u16string_view rCID );
+ static std::u16string_view getFullParentParticle( std::u16string_view rCID );
//returns the series particle of a CID when the CID is a child of the series
- static OUString getSeriesParticleFromCID( const OUString& rCID );
+ static OUString getSeriesParticleFromCID( std::u16string_view rCID );
//return the model object that is indicated by rObjectCID
static css::uno::Reference< css::beans::XPropertySet >
getObjectPropertySet(
- const OUString& rObjectCID
- , const css::uno::Reference< css::frame::XModel >& xChartModel );
- static css::uno::Reference< css::beans::XPropertySet >
- getObjectPropertySet(
- const OUString& rObjectCID
- , const css::uno::Reference< css::chart2::XChartDocument >& xChartDocument );
- static css::uno::Reference< css::beans::XPropertySet >
- getObjectPropertySet(
- const OUString& rObjectCID
+ std::u16string_view rObjectCID
, const rtl::Reference< ::chart::ChartModel >& xChartDocument );
//return the axis object that belongs to rObjectCID if any
- static css::uno::Reference< css::chart2::XAxis >
+ static rtl::Reference< ::chart::Axis >
getAxisForCID(
- const OUString& rObjectCID
- , const css::uno::Reference< css::frame::XModel >& xChartModel );
+ std::u16string_view rObjectCID
+ , const rtl::Reference<::chart::ChartModel>& xChartModel );
//return the series object that belongs to rObjectCID if any
- static css::uno::Reference< css::chart2::XDataSeries >
+ static rtl::Reference< ::chart::DataSeries >
getDataSeriesForCID(
- const OUString& rObjectCID
- , const css::uno::Reference< css::frame::XModel >& xChartModel );
+ std::u16string_view rObjectCID
+ , const rtl::Reference<::chart::ChartModel>& xChartModel );
static rtl::Reference< ::chart::Diagram >
getDiagramForCID(
- const OUString& rObjectCID
- , const css::uno::Reference< css::frame::XModel >& xChartModel );
+ std::u16string_view rObjectCID
+ , const rtl::Reference<::chart::ChartModel>& xChartModel );
static const OUString& getPieSegmentDragMethodServiceName();
static OUString createPieSegmentDragParameterString(
sal_Int32 nOffsetPercent
, const css::awt::Point& rMinimumPosition
, const css::awt::Point& rMaximumPosition );
- static bool parsePieSegmentDragParameterString( const OUString& rDragParameterString
+ static bool parsePieSegmentDragParameterString( std::u16string_view rDragParameterString
, sal_Int32& rOffsetPercent
, css::awt::Point& rMinimumPosition
, css::awt::Point& rMaximumPosition );
- static TitleHelper::eTitleType getTitleTypeForCID( const OUString& rCID );
+ static TitleHelper::eTitleType getTitleTypeForCID( std::u16string_view rCID );
- static OUString getMovedSeriesCID( const OUString& rObjectCID, bool bForward );
+ static OUString getMovedSeriesCID( std::u16string_view rObjectCID, bool bForward );
bool isValid() const;
bool isAutoGeneratedObject() const;
diff --git a/chart2/source/inc/PopupRequest.hxx b/chart2/source/inc/PopupRequest.hxx
index a755fdfa3c85..3caeffc0d98a 100644
--- a/chart2/source/inc/PopupRequest.hxx
+++ b/chart2/source/inc/PopupRequest.hxx
@@ -9,7 +9,7 @@
#pragma once
-#include "charttoolsdllapi.hxx"
+#include <config_options.h>
#include <comphelper/compbase.hxx>
#include <com/sun/star/awt/XRequestCallback.hpp>
@@ -21,7 +21,7 @@ namespace impl
typedef comphelper::WeakComponentImplHelper<css::awt::XRequestCallback> PopupRequest_Base;
}
-class OOO_DLLPUBLIC_CHARTTOOLS PopupRequest final : public impl::PopupRequest_Base
+class PopupRequest final : public impl::PopupRequest_Base
{
public:
explicit PopupRequest();
diff --git a/chart2/source/inc/PropertyHelper.hxx b/chart2/source/inc/PropertyHelper.hxx
index 14aa57609534..26f395fa1b06 100644
--- a/chart2/source/inc/PropertyHelper.hxx
+++ b/chart2/source/inc/PropertyHelper.hxx
@@ -18,9 +18,9 @@
*/
#pragma once
+#include <config_options.h>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/uno/Any.hxx>
-#include "charttoolsdllapi.hxx"
#include <unordered_map>
@@ -41,7 +41,7 @@ namespace PropertyHelper
@return The name used for storing this element in the table
*/
-OOO_DLLPUBLIC_CHARTTOOLS OUString addLineDashUniqueNameToTable(
+OUString addLineDashUniqueNameToTable(
const css::uno::Any & rValue,
const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
const OUString & rPreferredName );
@@ -51,7 +51,7 @@ OOO_DLLPUBLIC_CHARTTOOLS OUString addLineDashUniqueNameToTable(
@return The name used for storing this element in the table
*/
-OOO_DLLPUBLIC_CHARTTOOLS OUString addGradientUniqueNameToTable(
+OUString addGradientUniqueNameToTable(
const css::uno::Any & rValue,
const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
const OUString & rPreferredName );
@@ -61,7 +61,6 @@ OOO_DLLPUBLIC_CHARTTOOLS OUString addGradientUniqueNameToTable(
@return The name used for storing this element in the table
*/
-OOO_DLLPUBLIC_CHARTTOOLS
OUString addTransparencyGradientUniqueNameToTable(
const css::uno::Any & rValue,
const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
@@ -72,7 +71,7 @@ OUString addTransparencyGradientUniqueNameToTable(
@return The name used for storing this element in the table
*/
-OOO_DLLPUBLIC_CHARTTOOLS OUString addHatchUniqueNameToTable(
+OUString addHatchUniqueNameToTable(
const css::uno::Any & rValue,
const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
const OUString & rPreferredName );
@@ -82,7 +81,7 @@ OOO_DLLPUBLIC_CHARTTOOLS OUString addHatchUniqueNameToTable(
@return The name used for storing this element in the table
*/
-OOO_DLLPUBLIC_CHARTTOOLS OUString addBitmapUniqueNameToTable(
+OUString addBitmapUniqueNameToTable(
const css::uno::Any & rValue,
const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
const OUString & rPreferredName );
@@ -92,7 +91,6 @@ OOO_DLLPUBLIC_CHARTTOOLS OUString addBitmapUniqueNameToTable(
@param any is the value encapsulated in the variant type Any
*/
-OOO_DLLPUBLIC_CHARTTOOLS
void setPropertyValueAny( tPropertyValueMap & rOutMap, tPropertyValueMapKey key,
const css::uno::Any & rAny );
@@ -111,7 +109,7 @@ template< typename Value >
template<>
void setPropertyValue< css::uno::Any >( tPropertyValueMap & rOutMap, tPropertyValueMapKey key, const css::uno::Any & rAny );
-OOO_DLLPUBLIC_CHARTTOOLS void setPropertyValueDefaultAny( tPropertyValueMap & rOutMap, tPropertyValueMapKey key, const css::uno::Any & rAny );
+void setPropertyValueDefaultAny( tPropertyValueMap & rOutMap, tPropertyValueMapKey key, const css::uno::Any & rAny );
/** Calls setPropertyValue() but asserts that the given property hasn't been set
before.
@@ -130,11 +128,11 @@ template<>
/** Calls setPropertyValueDefault() with an empty Any as value
*/
-OOO_DLLPUBLIC_CHARTTOOLS void setEmptyPropertyValueDefault( tPropertyValueMap & rOutMap, tPropertyValueMapKey key );
+void setEmptyPropertyValueDefault( tPropertyValueMap & rOutMap, tPropertyValueMapKey key );
} // namespace PropertyHelper
-struct OOO_DLLPUBLIC_CHARTTOOLS PropertyNameLess
+struct PropertyNameLess
{
bool operator() ( const css::beans::Property & first,
const css::beans::Property & second )
diff --git a/chart2/source/inc/RangeHighlighter.hxx b/chart2/source/inc/RangeHighlighter.hxx
index 8642d66f7e88..9ec39e9977ec 100644
--- a/chart2/source/inc/RangeHighlighter.hxx
+++ b/chart2/source/inc/RangeHighlighter.hxx
@@ -26,7 +26,6 @@
namespace com::sun::star {
namespace chart2 {
- class XDiagram;
class XDataSeries;
class XAxis;
}
@@ -36,6 +35,8 @@ namespace com::sun::star::view { class XSelectionSupplier; }
namespace chart
{
+class ChartModel;
+class DataSeries;
class Diagram;
namespace impl
@@ -52,7 +53,7 @@ class RangeHighlighter final :
{
public:
explicit RangeHighlighter(
- const css::uno::Reference< css::view::XSelectionSupplier > & xSelectionSupplier );
+ const rtl::Reference< ::chart::ChartModel > & xSelectionSupplier );
virtual ~RangeHighlighter() override;
protected:
@@ -81,16 +82,16 @@ private:
void stopListening();
void determineRanges();
- void fillRangesForDiagram( const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
void fillRangesForDiagram( const rtl::Reference< ::chart::Diagram > & xDiagram );
void fillRangesForDataSeries( const css::uno::Reference< css::chart2::XDataSeries > & xSeries );
void fillRangesForCategories( const css::uno::Reference< css::chart2::XAxis > & xAxis );
- void fillRangesForDataPoint( const css::uno::Reference< css::uno::XInterface > & xDataSeries, sal_Int32 nIndex );
+ void fillRangesForDataPoint( const rtl::Reference< ::chart::DataSeries > & xDataSeries, sal_Int32 nIndex );
void fillRangesForErrorBars( const css::uno::Reference< css::beans::XPropertySet > & xErrorBar,
const css::uno::Reference< css::chart2::XDataSeries > & xDataSeries );
css::uno::Reference< css::view::XSelectionSupplier >
m_xSelectionSupplier;
+ rtl::Reference< ::chart::ChartModel > m_xChartModel;
css::uno::Reference< css::view::XSelectionChangeListener >
m_xListener;
css::uno::Sequence< css::chart2::data::HighlightedRange >
diff --git a/chart2/source/controller/inc/RangeSelectionHelper.hxx b/chart2/source/inc/RangeSelectionHelper.hxx
index 02db335a1fc0..d71c861d0314 100644
--- a/chart2/source/controller/inc/RangeSelectionHelper.hxx
+++ b/chart2/source/inc/RangeSelectionHelper.hxx
@@ -24,7 +24,6 @@
#include <rtl/ref.hxx>
namespace com::sun::star::beans { struct PropertyValue; }
-namespace com::sun::star::chart2 { class XChartDocument; }
namespace com::sun::star {
namespace sheet{
@@ -42,7 +41,7 @@ class RangeSelectionHelper
{
public:
explicit RangeSelectionHelper(
- const rtl::Reference<::chart::ChartModel> & xChartDocument );
+ rtl::Reference<::chart::ChartModel> xChartDocument );
~RangeSelectionHelper();
bool hasRangeSelection();
diff --git a/chart2/source/controller/inc/RangeSelectionListener.hxx b/chart2/source/inc/RangeSelectionListener.hxx
index 29bea261c820..873043f9b4a5 100644
--- a/chart2/source/controller/inc/RangeSelectionListener.hxx
+++ b/chart2/source/inc/RangeSelectionListener.hxx
@@ -18,14 +18,14 @@
*/
#pragma once
-#include <ControllerLockGuard.hxx>
+#include "ControllerLockGuard.hxx"
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/sheet/XRangeSelectionListener.hpp>
#include <rtl/ref.hxx>
-namespace com::sun::star::frame
+namespace weld
{
-class XModel;
+class DialogController;
}
namespace chart
@@ -38,8 +38,13 @@ public:
virtual void listeningFinished(const OUString& rNewRange) = 0;
virtual void disposingRangeSelection() = 0;
+ void enableRangeChoosing(bool bEnable, weld::DialogController* pDialog);
+
protected:
~RangeSelectionListenerParent() {}
+
+private:
+ OUString m_sRestorePageIdent;
};
class RangeSelectionListener final
@@ -47,7 +52,7 @@ class RangeSelectionListener final
{
public:
explicit RangeSelectionListener(
- RangeSelectionListenerParent& rParent, const OUString& rInitialRange,
+ RangeSelectionListenerParent& rParent, OUString aInitialRange,
const rtl::Reference<::chart::ChartModel>& xModelToLockController);
virtual ~RangeSelectionListener() override;
diff --git a/chart2/source/inc/ReferenceSizeProvider.hxx b/chart2/source/inc/ReferenceSizeProvider.hxx
index 3db11e5327b1..006618dd5dba 100644
--- a/chart2/source/inc/ReferenceSizeProvider.hxx
+++ b/chart2/source/inc/ReferenceSizeProvider.hxx
@@ -20,13 +20,13 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/awt/Size.hpp>
-#include "charttoolsdllapi.hxx"
+#include <rtl/ref.hxx>
+#include <ChartModel.hxx>
namespace com::sun::star {
namespace chart2 {
class XTitle;
class XTitled;
- class XChartDocument;
}
namespace beans {
class XPropertySet;
@@ -36,7 +36,7 @@ namespace com::sun::star {
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS ReferenceSizeProvider
+class ReferenceSizeProvider
{
public:
@@ -50,7 +50,7 @@ public:
ReferenceSizeProvider(
css::awt::Size aPageSize,
- const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc );
+ const rtl::Reference<::chart::ChartModel> & xChartDoc );
const css::awt::Size& getPageSize() const { return m_aPageSize;}
@@ -63,7 +63,7 @@ public:
with state NO, AUTO_RESIZE_AMBIGUOUS is returned.
*/
static AutoResizeState getAutoResizeState(
- const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc );
+ const rtl::Reference<::chart::ChartModel> & xChartDoc );
/** sets or resets the auto-resize at all objects that support this feature
for text to the opposite of the current setting. If the current state
@@ -76,7 +76,7 @@ public:
class at the XPropertySet, and the adapted font sizes if bAdaptFontSizes
is </sal_True>.
*/
- SAL_DLLPRIVATE void setValuesAtPropertySet(
+ void setValuesAtPropertySet(
const css::uno::Reference< css::beans::XPropertySet > & xProp,
bool bAdaptFontSizes = true );
@@ -84,7 +84,7 @@ public:
class at the XTitle, and the adapted font sizes at the contained
XFormattedStrings
*/
- SAL_DLLPRIVATE void setValuesAtTitle(
+ void setValuesAtTitle(
const css::uno::Reference< css::chart2::XTitle > & xTitle );
/** Sets the internal value at all data series in the currently set model.
@@ -94,12 +94,12 @@ public:
void setValuesAtAllDataSeries();
private:
- SAL_DLLPRIVATE bool useAutoScale() const { return m_bUseAutoScale;}
+ bool useAutoScale() const { return m_bUseAutoScale;}
/** sets the auto-resize at all objects that support this feature for text.
eNewState must be either AUTO_RESIZE_YES or AUTO_RESIZE_NO
*/
- SAL_DLLPRIVATE void setAutoResizeState( AutoResizeState eNewState );
+ void setAutoResizeState( AutoResizeState eNewState );
/** Retrieves the auto-resize state from the given propertyset. The result
will be put into eInOutState. If you initialize eInOutState with
@@ -108,18 +108,18 @@ private:
esp. AUTO_RESIZE_AMBIGUOUS, if the value was NO before, and is YES for
the current property set, or the other way round.
*/
- SAL_DLLPRIVATE static void getAutoResizeFromPropSet(
+ static void getAutoResizeFromPropSet(
const css::uno::Reference< css::beans::XPropertySet > & xProp,
AutoResizeState & rInOutState );
- SAL_DLLPRIVATE void impl_setValuesAtTitled(
+ void impl_setValuesAtTitled(
const css::uno::Reference< css::chart2::XTitled > & xTitled );
- SAL_DLLPRIVATE static void impl_getAutoResizeFromTitled(
+ static void impl_getAutoResizeFromTitled(
const css::uno::Reference< css::chart2::XTitled > & xTitled,
AutoResizeState & rInOutState );
css::awt::Size m_aPageSize;
- css::uno::Reference< css::chart2::XChartDocument > m_xChartDoc;
+ rtl::Reference<::chart::ChartModel> m_xChartDoc;
bool m_bUseAutoScale;
};
diff --git a/chart2/source/inc/RegressionCurveCalculator.hxx b/chart2/source/inc/RegressionCurveCalculator.hxx
index 6cf1f2914d5b..ebb3ad40f616 100644
--- a/chart2/source/inc/RegressionCurveCalculator.hxx
+++ b/chart2/source/inc/RegressionCurveCalculator.hxx
@@ -42,28 +42,6 @@ public:
static bool isLogarithmicScaling(
const css::uno::Reference< css::chart2::XScaling >& xScaling );
-protected:
- virtual OUString ImplGetRepresentation(
- const css::uno::Reference< css::util::XNumberFormatter >& xNumFormatter,
- sal_Int32 nNumberFormatKey, sal_Int32* pFormulaLength = nullptr ) const = 0;
-
- static OUString getFormattedString(
- const css::uno::Reference< css::util::XNumberFormatter >& xNumFormatter,
- sal_Int32 nNumberFormatKey,
- double fNumber,
- const sal_Int32* pStringLength );
-
- static void addStringToEquation( OUStringBuffer& aStrEquation, sal_Int32& nLineLength, OUStringBuffer const & aAddString, const sal_Int32* pMaxLength );
-
- double m_fCorrelationCoefficient;
-
- sal_Int32 mDegree;
- bool mForceIntercept;
- double mInterceptValue;
- sal_Int32 mPeriod;
- OUString mXName, mYName;
- sal_Int32 mnMovingType;
-
// ____ XRegressionCurveCalculator ____
virtual void SAL_CALL setRegressionProperties(
sal_Int32 aDegree,
@@ -96,6 +74,28 @@ protected:
virtual void SAL_CALL setXYNames(
const OUString& aXName, const OUString& aYName ) override;
+
+protected:
+ virtual OUString ImplGetRepresentation(
+ const css::uno::Reference< css::util::XNumberFormatter >& xNumFormatter,
+ sal_Int32 nNumberFormatKey, sal_Int32* pFormulaLength = nullptr ) const = 0;
+
+ static OUString getFormattedString(
+ const css::uno::Reference< css::util::XNumberFormatter >& xNumFormatter,
+ sal_Int32 nNumberFormatKey,
+ double fNumber,
+ const sal_Int32* pStringLength );
+
+ static void addStringToEquation( OUStringBuffer& aStrEquation, sal_Int32& nLineLength, OUStringBuffer const & aAddString, const sal_Int32* pMaxLength );
+
+ double m_fCorrelationCoefficient;
+
+ sal_Int32 mDegree;
+ bool mForceIntercept;
+ double mInterceptValue;
+ sal_Int32 mPeriod;
+ OUString mXName, mYName;
+ sal_Int32 mnMovingType;
};
} // namespace chart
diff --git a/chart2/source/inc/RegressionCurveHelper.hxx b/chart2/source/inc/RegressionCurveHelper.hxx
index 83fc72e65649..a730b91d900d 100644
--- a/chart2/source/inc/RegressionCurveHelper.hxx
+++ b/chart2/source/inc/RegressionCurveHelper.hxx
@@ -18,72 +18,89 @@
*/
#pragma once
+#include <config_options.h>
#include <svx/chrtitem.hxx>
-#include "charttoolsdllapi.hxx"
+#include <rtl/ref.hxx>
#include <vector>
namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XDataSeries; }
-namespace com::sun::star::chart2 { class XDiagram; }
namespace com::sun::star::chart2 { class XRegressionCurve; }
namespace com::sun::star::chart2 { class XRegressionCurveCalculator; }
namespace com::sun::star::chart2 { class XRegressionCurveContainer; }
namespace com::sun::star::chart2::data { class XDataSource; }
-namespace com::sun::star::frame { class XModel; }
+namespace chart { class ChartModel; }
+namespace chart { class DataSeries; }
+namespace chart { class RegressionCurveModel; }
+namespace chart { class RegressionCurveCalculator; }
namespace chart::RegressionCurveHelper
{
/// returns a model mean-value line
- css::uno::Reference<css::chart2::XRegressionCurve> createMeanValueLine();
+ rtl::Reference<::chart::RegressionCurveModel> createMeanValueLine();
/// returns a model regression curve
- css::uno::Reference<css::chart2::XRegressionCurve>
+ rtl::Reference<::chart::RegressionCurveModel>
createRegressionCurveByServiceName( std::u16string_view aServiceName );
- OOO_DLLPUBLIC_CHARTTOOLS bool hasMeanValueLine(
+ bool hasMeanValueLine(
const css::uno::Reference<css::chart2::XRegressionCurveContainer> & xRegCnt );
+ bool hasMeanValueLine(
+ const rtl::Reference<::chart::DataSeries> & xRegCnt );
- OOO_DLLPUBLIC_CHARTTOOLS bool isMeanValueLine(
+ bool isMeanValueLine(
const css::uno::Reference<css::chart2::XRegressionCurve> & xRegCurve );
+ bool isMeanValueLine(
+ const rtl::Reference<::chart::RegressionCurveModel> & xRegCurve );
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference<css::chart2::XRegressionCurve>
+ rtl::Reference<::chart::RegressionCurveModel>
getMeanValueLine(
const css::uno::Reference<css::chart2::XRegressionCurveContainer> & xRegCnt );
+ rtl::Reference<::chart::RegressionCurveModel>
+ getMeanValueLine(
+ const rtl::Reference<::chart::DataSeries> & xRegCnt );
/** creates a mean-value line and adds it to the container.
@param xSeriesProp
If set, this property-set will be used to apply a line color
*/
- OOO_DLLPUBLIC_CHARTTOOLS void addMeanValueLine(
+ void addMeanValueLine(
css::uno::Reference<css::chart2::XRegressionCurveContainer> const & xRegCnt,
const css::uno::Reference<css::beans::XPropertySet>& xSeriesProp );
+ void addMeanValueLine(
+ rtl::Reference<::chart::DataSeries> const & xRegCnt,
+ const css::uno::Reference<css::beans::XPropertySet>& xSeriesProp );
- OOO_DLLPUBLIC_CHARTTOOLS void removeMeanValueLine(
+ void removeMeanValueLine(
css::uno::Reference<css::chart2::XRegressionCurveContainer> const & xRegCnt );
+ void removeMeanValueLine(
+ rtl::Reference<::chart::DataSeries> const & xRegCnt );
/** Returns the first regression curve found that is not of type
mean-value line
*/
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference<css::chart2::XRegressionCurve>
+ rtl::Reference<::chart::RegressionCurveModel>
getFirstCurveNotMeanValueLine(
const css::uno::Reference<css::chart2::XRegressionCurveContainer>& xCurveContainer );
+ rtl::Reference<::chart::RegressionCurveModel>
+ getFirstCurveNotMeanValueLine(
+ const rtl::Reference<::chart::DataSeries>& xCurveContainer );
/** Returns the regression curve found at the index provided.
*/
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference<css::chart2::XRegressionCurve>
+ rtl::Reference<::chart::RegressionCurveModel>
getRegressionCurveAtIndex(
- const css::uno::Reference<css::chart2::XRegressionCurveContainer>& xCurveContainer,
+ const rtl::Reference<::chart::DataSeries>& xCurveContainer,
sal_Int32 aIndex);
/** Returns the type of the first regression curve found that is not of type
mean-value line
*/
- OOO_DLLPUBLIC_CHARTTOOLS SvxChartRegress getFirstRegressTypeNotMeanValueLine(
+ SvxChartRegress getFirstRegressTypeNotMeanValueLine(
const css::uno::Reference<css::chart2::XRegressionCurveContainer>& xCurveContainer );
- OOO_DLLPUBLIC_CHARTTOOLS SvxChartRegress getRegressionType(
+ SvxChartRegress getRegressionType(
const css::uno::Reference<css::chart2::XRegressionCurve>& xCurve );
/** @param xPropertySource is taken as source to copy all properties from if
@@ -91,7 +108,7 @@ namespace chart::RegressionCurveHelper
@param xEquationProperties is set at the new regression curve as
equation properties if not null
*/
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference<css::chart2::XRegressionCurve>
+ rtl::Reference<::chart::RegressionCurveModel>
addRegressionCurve(
SvxChartRegress eType,
css::uno::Reference<css::chart2::XRegressionCurveContainer> const & xCurveContainer,
@@ -99,25 +116,33 @@ namespace chart::RegressionCurveHelper
css::uno::Reference<css::beans::XPropertySet>(),
const css::uno::Reference<css::beans::XPropertySet>& xEquationProperties =
css::uno::Reference<css::beans::XPropertySet>() );
+ rtl::Reference<::chart::RegressionCurveModel>
+ addRegressionCurve(
+ SvxChartRegress eType,
+ rtl::Reference<::chart::DataSeries> const & xCurveContainer,
+ const css::uno::Reference<css::beans::XPropertySet >& xPropertySource =
+ css::uno::Reference<css::beans::XPropertySet>(),
+ const css::uno::Reference<css::beans::XPropertySet>& xEquationProperties =
+ css::uno::Reference<css::beans::XPropertySet>() );
- OOO_DLLPUBLIC_CHARTTOOLS bool removeAllExceptMeanValueLine(
- css::uno::Reference<css::chart2::XRegressionCurveContainer> const & xCurveContainer );
+ bool removeAllExceptMeanValueLine(
+ rtl::Reference<::chart::DataSeries> const & xCurveContainer );
- OOO_DLLPUBLIC_CHARTTOOLS void removeEquations(
- css::uno::Reference<css::chart2::XRegressionCurveContainer> const & xCurveContainer );
+ void removeEquations(
+ rtl::Reference<::chart::DataSeries> const & xCurveContainer );
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference<css::chart2::XRegressionCurve>
+ rtl::Reference<::chart::RegressionCurveModel>
changeRegressionCurveType(
SvxChartRegress eType,
css::uno::Reference<css::chart2::XRegressionCurveContainer> const & xRegressionCurveContainer,
css::uno::Reference<css::chart2::XRegressionCurve> const & xRegressionCurve );
/// returns a calculator object for regression curves (used by the view)
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference<css::chart2::XRegressionCurveCalculator>
+ rtl::Reference<::chart::RegressionCurveCalculator>
createRegressionCurveCalculatorByServiceName( std::u16string_view aServiceName );
/** recalculates the regression parameters according to the data given in
- the data source.
+ the data series.
A sequence having the role "values-x" will be used as x-values for the
calculation if found. Otherwise a sequence (1, 2, 3, ...) of category
@@ -127,50 +152,34 @@ namespace chart::RegressionCurveHelper
The first sequence having the role "values-y" will be used as y-values
for the recalculateRegression() method of the regression curve.
- @param bUseXValuesIfAvailable
- If false, the sequence (1, 2, 3, ...) will always be used, even if
- there is a data-sequence with role "values-x"
*/
void initializeCurveCalculator(
- const css::uno::Reference<css::chart2::XRegressionCurveCalculator>& xOutCurveCalculator,
- const css::uno::Reference<css::chart2::data::XDataSource>& xSource,
- bool bUseXValuesIfAvailable );
-
- /** Same method as above, but uses the given XModel to determine the
- parameter bUseXValuesIfAvailable in the above function. It is also
- necessary that the data::XDataSource is an XDataSeries, thus this parameter
- also changed.
- */
- OOO_DLLPUBLIC_CHARTTOOLS void initializeCurveCalculator(
- const css::uno::Reference<css::chart2::XRegressionCurveCalculator>& xOutCurveCalculator,
- const css::uno::Reference<css::chart2::XDataSeries>& xSeries,
- const css::uno::Reference<css::frame::XModel>& xModel );
-
- OOO_DLLPUBLIC_CHARTTOOLS OUString getUINameForRegressionCurve(
- const css::uno::Reference<css::chart2::XRegressionCurve>& xCurve );
+ const rtl::Reference<RegressionCurveCalculator>& xOutCurveCalculator,
+ const rtl::Reference<::chart::DataSeries>& xSeries,
+ const rtl::Reference<::chart::ChartModel>& xModel );
- OOO_DLLPUBLIC_CHARTTOOLS OUString getRegressionCurveName(
- const css::uno::Reference<css::chart2::XRegressionCurve>& xCurve );
+ OUString getUINameForRegressionCurve(
+ const rtl::Reference<RegressionCurveModel>& xCurve );
- OOO_DLLPUBLIC_CHARTTOOLS OUString getRegressionCurveGenericName(
- const css::uno::Reference<css::chart2::XRegressionCurve>& xCurve );
+ OUString getRegressionCurveName(
+ const rtl::Reference<RegressionCurveModel>& xCurve );
- OOO_DLLPUBLIC_CHARTTOOLS OUString getRegressionCurveSpecificName(
- const css::uno::Reference<css::chart2::XRegressionCurve>& xCurve );
+ OUString getRegressionCurveGenericName(
+ const rtl::Reference<RegressionCurveModel>& xCurve );
- OOO_DLLPUBLIC_CHARTTOOLS std::vector<css::uno::Reference<css::chart2::XRegressionCurve> >
- getAllRegressionCurvesNotMeanValueLine(
- const css::uno::Reference<css::chart2::XDiagram>& xDiagram );
+ OUString getRegressionCurveSpecificName(
+ const rtl::Reference<RegressionCurveModel>& xCurve );
- OOO_DLLPUBLIC_CHARTTOOLS void resetEquationPosition(
+ void resetEquationPosition(
const css::uno::Reference<css::chart2::XRegressionCurve>& xCurve );
/// @return the index of the given curve in the given container. -1 if not contained
- OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getRegressionCurveIndex(
- const css::uno::Reference<css::chart2::XRegressionCurveContainer>& xContainer,
- const css::uno::Reference<css::chart2::XRegressionCurve>& xCurve );
+ sal_Int32 getRegressionCurveIndex(
+ const rtl::Reference<::chart::DataSeries>& xContainer,
+ const rtl::Reference<::chart::RegressionCurveModel>& xCurve );
- OOO_DLLPUBLIC_CHARTTOOLS bool hasEquation(const css::uno::Reference<css::chart2::XRegressionCurve>& xCurve );
+ bool hasEquation(const rtl::Reference<RegressionCurveModel>& xCurve );
+ bool MayHaveCorrelationCoefficient(const rtl::Reference<RegressionCurveModel>& xCurve );
} // namespace chart
diff --git a/chart2/source/tools/RegressionCurveModel.hxx b/chart2/source/inc/RegressionCurveModel.hxx
index 73c2439f01e7..25729f849bb8 100644
--- a/chart2/source/tools/RegressionCurveModel.hxx
+++ b/chart2/source/inc/RegressionCurveModel.hxx
@@ -18,21 +18,22 @@
*/
#pragma once
-#include <OPropertySet.hxx>
+#include "OPropertySet.hxx"
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
+#include <sal/types.h>
#include <com/sun/star/chart2/XRegressionCurve.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <ModifyListenerHelper.hxx>
+#include "ModifyListenerHelper.hxx"
namespace chart
{
+class RegressionCurveCalculator;
namespace impl
{
@@ -46,8 +47,7 @@ typedef ::cppu::WeakImplHelper<
RegressionCurveModel_Base;
}
-class RegressionCurveModel :
- public cppu::BaseMutex,
+class SAL_DLLPUBLIC_RTTI RegressionCurveModel :
public impl::RegressionCurveModel_Base,
public ::property::OPropertySet
{
@@ -83,6 +83,7 @@ protected:
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
+public:
// ____ XRegressionCurve ____
virtual css::uno::Reference< css::chart2::XRegressionCurveCalculator > SAL_CALL getCalculator() override;
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getEquationProperties() override;
@@ -98,6 +99,9 @@ protected:
virtual void SAL_CALL removeModifyListener(
const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
+ rtl::Reference< RegressionCurveCalculator > getCurveCalculator();
+
+protected:
// ____ XModifyListener ____
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
@@ -118,6 +122,7 @@ private:
rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties;
+ void setPropertyMayHaveR2();
};
// implementations for factory instantiation
diff --git a/chart2/source/inc/RelativePositionHelper.hxx b/chart2/source/inc/RelativePositionHelper.hxx
index 5a6bcbbc85af..71b25fc153b1 100644
--- a/chart2/source/inc/RelativePositionHelper.hxx
+++ b/chart2/source/inc/RelativePositionHelper.hxx
@@ -19,10 +19,10 @@
#pragma once
+#include <config_options.h>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/drawing/Alignment.hpp>
#include <com/sun/star/awt/Point.hpp>
-#include "charttoolsdllapi.hxx"
namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::chart2 { struct RelativeSize; }
@@ -30,7 +30,7 @@ namespace com::sun::star::chart2 { struct RelativeSize; }
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS RelativePositionHelper
+class RelativePositionHelper
{
public:
/** returns the upper left corner of an object that has size aObjectSize and
@@ -60,7 +60,7 @@ public:
been changed to the given one. The passed object size is taken into
account for shifting the position.
*/
- SAL_DLLPRIVATE static css::chart2::RelativePosition
+ static css::chart2::RelativePosition
getReanchoredPosition(
const css::chart2::RelativePosition & rPosition,
const css::chart2::RelativeSize & rObjectSize,
diff --git a/chart2/source/inc/RelativeSizeHelper.hxx b/chart2/source/inc/RelativeSizeHelper.hxx
index b07876bb67d3..753d4deabe83 100644
--- a/chart2/source/inc/RelativeSizeHelper.hxx
+++ b/chart2/source/inc/RelativeSizeHelper.hxx
@@ -18,17 +18,18 @@
*/
#pragma once
-#include "charttoolsdllapi.hxx"
+#include <config_options.h>
namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::uno { template <class interface_type> class Reference; }
+namespace css = ::com::sun::star;
class SvxShapeText;
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS RelativeSizeHelper
+class RelativeSizeHelper
{
public:
static double calculate(
diff --git a/chart2/source/inc/ResId.hxx b/chart2/source/inc/ResId.hxx
index 48baf852ab04..816b4b2471a7 100644
--- a/chart2/source/inc/ResId.hxx
+++ b/chart2/source/inc/ResId.hxx
@@ -19,12 +19,11 @@
#pragma once
#include <rtl/ustring.hxx>
-#include "charttoolsdllapi.hxx"
#include <unotools/resmgr.hxx>
namespace chart
{
-OUString OOO_DLLPUBLIC_CHARTTOOLS SchResId(TranslateId aId);
+OUString SchResId(TranslateId aId);
} // namespace chart
diff --git a/chart2/source/inc/SceneProperties.hxx b/chart2/source/inc/SceneProperties.hxx
index ab7d89711af4..69eaec2b4c16 100644
--- a/chart2/source/inc/SceneProperties.hxx
+++ b/chart2/source/inc/SceneProperties.hxx
@@ -18,9 +18,9 @@
*/
#pragma once
+#include <config_options.h>
#include "PropertyHelper.hxx"
#include "FastPropertyIdRanges.hxx"
-#include "charttoolsdllapi.hxx"
#include <vector>
@@ -71,10 +71,10 @@ namespace SceneProperties
PROP_SCENE_LIGHT_ON_8
};
- OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(
+ void AddPropertiesToVector(
std::vector< css::beans::Property > & rOutProperties );
- OOO_DLLPUBLIC_CHARTTOOLS void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
+ void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
}
} // namespace chart
diff --git a/chart2/source/inc/StatisticsHelper.hxx b/chart2/source/inc/StatisticsHelper.hxx
index 7a6a96c5e5bd..44fcb600d38c 100644
--- a/chart2/source/inc/StatisticsHelper.hxx
+++ b/chart2/source/inc/StatisticsHelper.hxx
@@ -18,17 +18,18 @@
*/
#pragma once
+#include <config_options.h>
#include <com/sun/star/uno/Reference.h>
#include <rtl/ustring.hxx>
-#include "charttoolsdllapi.hxx"
+#include <rtl/ref.hxx>
namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XDataSeries; }
namespace com::sun::star::chart2::data { class XDataProvider; }
namespace com::sun::star::chart2::data { class XDataSequence; }
namespace com::sun::star::chart2::data { class XDataSource; }
namespace com::sun::star::chart2::data { class XLabeledDataSequence; }
namespace com::sun::star::uno { template <typename > class Sequence; }
+namespace chart { class DataSeries; }
namespace chart::StatisticsHelper
{
@@ -36,33 +37,33 @@ namespace chart::StatisticsHelper
@see http://mathworld.wolfram.com/Variance.html
*/
- OOO_DLLPUBLIC_CHARTTOOLS double getVariance( const css::uno::Sequence< double > & rData );
+ double getVariance( const css::uno::Sequence< double > & rData );
// square root of the variance
- OOO_DLLPUBLIC_CHARTTOOLS double getStandardDeviation( const css::uno::Sequence< double > & rData );
+ double getStandardDeviation( const css::uno::Sequence< double > & rData );
// also called "Standard deviation of the mean (SDOM)"
- OOO_DLLPUBLIC_CHARTTOOLS double getStandardError( const css::uno::Sequence< double > & rData );
+ double getStandardError( const css::uno::Sequence< double > & rData );
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSequence >
+ css::uno::Reference< css::chart2::data::XLabeledDataSequence >
getErrorLabeledDataSequenceFromDataSource(
const css::uno::Reference< css::chart2::data::XDataSource > & xDataSource,
bool bPositiveValue,
bool bYError = true );
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XDataSequence >
+ css::uno::Reference< css::chart2::data::XDataSequence >
getErrorDataSequenceFromDataSource(
const css::uno::Reference< css::chart2::data::XDataSource > & xDataSource,
bool bPositiveValue,
bool bYError = true );
- OOO_DLLPUBLIC_CHARTTOOLS double getErrorFromDataSource(
+ double getErrorFromDataSource(
const css::uno::Reference< css::chart2::data::XDataSource > & xDataSource,
sal_Int32 nIndex,
bool bPositiveValue,
bool bYError = true );
- OOO_DLLPUBLIC_CHARTTOOLS void setErrorDataSequence(
+ void setErrorDataSequence(
const css::uno::Reference< css::chart2::data::XDataSource > & xDataSource,
const css::uno::Reference< css::chart2::data::XDataProvider > & xDataProvider,
const OUString & rNewRange,
@@ -71,27 +72,27 @@ namespace chart::StatisticsHelper
OUString const * pXMLRange = nullptr );
/// @return the newly created or existing error bar object
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::beans::XPropertySet >
+ css::uno::Reference< css::beans::XPropertySet >
addErrorBars(
- const css::uno::Reference< css::chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference< ::chart::DataSeries > & xDataSeries,
sal_Int32 nStyle,
bool bYError = true );
- OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::beans::XPropertySet >
+ css::uno::Reference< css::beans::XPropertySet >
getErrorBars(
- const css::uno::Reference< css::chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference< ::chart::DataSeries > & xDataSeries,
bool bYError = true );
- OOO_DLLPUBLIC_CHARTTOOLS bool hasErrorBars(
- const css::uno::Reference< css::chart2::XDataSeries > & xDataSeries,
+ bool hasErrorBars(
+ const rtl::Reference< ::chart::DataSeries > & xDataSeries,
bool bYError = true );
- OOO_DLLPUBLIC_CHARTTOOLS void removeErrorBars(
- const css::uno::Reference< css::chart2::XDataSeries > & xDataSeries,
+ void removeErrorBars(
+ const rtl::Reference< ::chart::DataSeries > & xDataSeries,
bool bYError = true );
- OOO_DLLPUBLIC_CHARTTOOLS bool usesErrorBarRanges(
- const css::uno::Reference< css::chart2::XDataSeries > & xDataSeries,
+ bool usesErrorBarRanges(
+ const rtl::Reference< ::chart::DataSeries > & xDataSeries,
bool bYError = true );
} // namespace chart
diff --git a/chart2/source/inc/ThreeDHelper.hxx b/chart2/source/inc/ThreeDHelper.hxx
index 93b1c995f388..04df1f8a22a3 100644
--- a/chart2/source/inc/ThreeDHelper.hxx
+++ b/chart2/source/inc/ThreeDHelper.hxx
@@ -19,14 +19,13 @@
#pragma once
+#include <config_options.h>
#include <com/sun/star/drawing/CameraGeometry.hpp>
-#include "charttoolsdllapi.hxx"
-
-namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XDiagram; }
+#include <rtl/ref.hxx>
namespace chart
{
+class Diagram;
enum class ThreeDLookScheme
{
@@ -45,7 +44,7 @@ enum CuboidPlanePosition
CuboidPlanePosition_Back
};
-class OOO_DLLPUBLIC_CHARTTOOLS ThreeDHelper
+class ThreeDHelper
{
public:
@@ -57,23 +56,6 @@ public:
*/
static css::drawing::CameraGeometry getDefaultCameraGeometry( bool bPie=false );
- static void getRotationAngleFromDiagram(
- const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties
- , double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad );
- static void setRotationAngleToDiagram(
- const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties
- , double fXAngleRad, double fYAngleRad, double fZAngleRad );
-
- static void getRotationFromDiagram(
- const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties
- , sal_Int32& rnHorizontalAngleDegree, sal_Int32& rnVerticalAngleDegree );
- static void setRotationToDiagram(
- const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties
- , sal_Int32 nHorizontalAngleDegree, sal_Int32 nVerticalYAngleDegree );
-
- static void switchRightAngledAxes( const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties
- , bool bRightAngledAxes );
-
static void adaptRadAnglesForRightAngledAxes( double& rfXAngleRad, double& rfYAngleRad );
static double getXDegreeAngleLimitForRightAngledAxes() { return 90.0; }
static double getYDegreeAngleLimitForRightAngledAxes() { return 45.0; }
@@ -84,44 +66,29 @@ public:
sal_Int32 nElevationDeg, sal_Int32 nRotationDeg
, double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad );
- SAL_DLLPRIVATE static void convertXYZAngleRadToElevationRotationDeg(
+ static void convertXYZAngleRadToElevationRotationDeg(
sal_Int32& rnElevationDeg, sal_Int32& rnRotationDeg
, double fXRad, double fYRad, double fZRad );
- static double getCameraDistance(
- const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties );
- static void setCameraDistance(
- const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties
- , double fCameraDistance );
- SAL_DLLPRIVATE static void ensureCameraDistanceRange( double& rfCameraDistance );
- SAL_DLLPRIVATE static void getCameraDistanceRange( double& rfMinimumDistance, double& rfMaximumDistance );
+ static void ensureCameraDistanceRange( double& rfCameraDistance );
+ static void getCameraDistanceRange( double& rfMinimumDistance, double& rfMaximumDistance );
static double CameraDistanceToPerspective( double fCameraDistance );
static double PerspectiveToCameraDistance( double fPerspective );
- static void set3DSettingsToDefault( const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties );
- static void setDefaultRotation( const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties );
- static void setDefaultIllumination( const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties );
-
- static void setDefaultRotation( const css::uno::Reference< css::beans::XPropertySet >& xSceneProperties, bool bPieOrDonut );
-
- static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardLeftWall( const css::uno::Reference<
- css::beans::XPropertySet >& xSceneProperties );
- static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBackWall(const css::uno::Reference<
- css::beans::XPropertySet >& xSceneProperties );
- static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBottom(const css::uno::Reference<
- css::beans::XPropertySet >& xSceneProperties );
-
- static ThreeDLookScheme detectScheme( const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
- static void setScheme( const css::uno::Reference< css::chart2::XDiagram >& xDiagram
- , ThreeDLookScheme aScheme );
+ static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardLeftWall( const rtl::Reference<
+ ::chart::Diagram >& xDiagram );
+ static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBackWall(const rtl::Reference<
+ ::chart::Diagram >& xDiagram );
+ static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBottom(const rtl::Reference<
+ ::chart::Diagram >& xDiagram );
//sal_Int32 nRoundedEdges: <0 or >100 -> mixed state
//sal_Int32 nObjectLines: 0->no lines; 1->all lines on; other->mixed state
- static void getRoundedEdgesAndObjectLines( const css::uno::Reference< css::chart2::XDiagram >& xDiagram
+ static void getRoundedEdgesAndObjectLines( const rtl::Reference< ::chart::Diagram >& xDiagram
, sal_Int32& rnRoundedEdges, sal_Int32& rnObjectLines );
- static void setRoundedEdgesAndObjectLines( const css::uno::Reference< css::chart2::XDiagram >& xDiagram
+ static void setRoundedEdgesAndObjectLines( const rtl::Reference< ::chart::Diagram >& xDiagram
, sal_Int32 nRoundedEdges, sal_Int32 nObjectLines );
};
diff --git a/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx b/chart2/source/inc/TimerTriggeredControllerLock.hxx
index 4952e112db88..d7a5d7652ce9 100644
--- a/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx
+++ b/chart2/source/inc/TimerTriggeredControllerLock.hxx
@@ -19,16 +19,11 @@
#pragma once
-#include <com/sun/star/uno/Reference.h>
#include <vcl/timer.hxx>
#include <rtl/ref.hxx>
#include <memory>
-namespace com::sun::star::frame
-{
-class XModel;
-}
namespace chart
{
class ControllerLockGuardUNO;
@@ -41,7 +36,7 @@ class ChartModel;
class TimerTriggeredControllerLock final
{
public:
- TimerTriggeredControllerLock(const rtl::Reference<::chart::ChartModel>& xModel);
+ TimerTriggeredControllerLock(rtl::Reference<::chart::ChartModel> xModel);
~TimerTriggeredControllerLock();
void startTimer();
diff --git a/chart2/source/model/main/Title.hxx b/chart2/source/inc/Title.hxx
index 426fd5ef4219..ba16c5377617 100644
--- a/chart2/source/model/main/Title.hxx
+++ b/chart2/source/inc/Title.hxx
@@ -18,14 +18,13 @@
*/
#pragma once
-#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
+#include "OPropertySet.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <ModifyListenerHelper.hxx>
+#include "ModifyListenerHelper.hxx"
namespace chart
{
@@ -42,7 +41,6 @@ typedef ::cppu::WeakImplHelper<
}
class Title final :
- public cppu::BaseMutex,
public impl::Title_Base,
public ::property::OPropertySet
{
@@ -60,7 +58,6 @@ public:
/// merge XTypeProvider implementations
DECLARE_XTYPEPROVIDER()
-private:
explicit Title( const Title & rOther );
// ____ OPropertySet ____
@@ -86,6 +83,8 @@ private:
virtual void SAL_CALL removeModifyListener(
const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
+private:
+
// ____ XModifyListener ____
virtual void SAL_CALL modified(
const css::lang::EventObject& aEvent ) override;
diff --git a/chart2/source/inc/TitleHelper.hxx b/chart2/source/inc/TitleHelper.hxx
index c85b5ce1a3ff..3f52ab105f8d 100644
--- a/chart2/source/inc/TitleHelper.hxx
+++ b/chart2/source/inc/TitleHelper.hxx
@@ -19,19 +19,18 @@
#pragma once
#include <com/sun/star/uno/Reference.h>
+#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
-#include "charttoolsdllapi.hxx"
+#include "Title.hxx"
namespace chart { class ChartModel; }
namespace chart { class ReferenceSizeProvider; }
-namespace com::sun::star::chart2 { class XTitle; }
-namespace com::sun::star::frame { class XModel; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS TitleHelper
+class TitleHelper
{
public:
enum eTitleType
@@ -51,46 +50,44 @@ public:
TITLE_AT_STANDARD_Y_AXIS_POSITION //equals the X_AXIS_TITLE for barchart
};
- static css::uno::Reference< css::chart2::XTitle >
+ static rtl::Reference< ::chart::Title >
getTitle( eTitleType nTitleIndex
, ChartModel& rModel );
- static css::uno::Reference< css::chart2::XTitle >
+ static rtl::Reference< ::chart::Title >
getTitle( eTitleType nTitleIndex
- , const css::uno::Reference< css::frame::XModel >& xModel );
+ , const rtl::Reference< ::chart::ChartModel >& xModel );
- static css::uno::Reference<
- css::chart2::XTitle >
+ static rtl::Reference< ::chart::Title >
createTitle( eTitleType nTitleIndex
, const OUString& rTitleText
- , const css::uno::Reference< css::frame::XModel >& xModel
+ , const rtl::Reference< ::chart::ChartModel >& xModel
, const css::uno::Reference< css::uno::XComponentContext > & xContext
, ReferenceSizeProvider * pRefSizeProvider = nullptr );
- static css::uno::Reference<
- css::chart2::XTitle >
+ static rtl::Reference< ::chart::Title >
createOrShowTitle( eTitleType nTitleIndex
, const OUString& rTitleText
- , const css::uno::Reference< css::frame::XModel >& xModel
+ , const rtl::Reference< ::chart::ChartModel >& xModel
, const css::uno::Reference< css::uno::XComponentContext > & xContex );
static void removeTitle( eTitleType nTitleIndex
- , const css::uno::Reference< css::frame::XModel >& xModel );
+ , const rtl::Reference< ::chart::ChartModel >& xModel );
- static OUString getCompleteString( const css::uno::Reference< css::chart2::XTitle >& xTitle );
+ static OUString getCompleteString( const rtl::Reference< ::chart::Title >& xTitle );
+ static OUString getUnstackedStr( const OUString& rNewText );
+ static void setFormattedString( const rtl::Reference< ::chart::Title >& xTitle,
+ const css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& aNewFormattedTitle );
static void setCompleteString( const OUString& rNewText
- , const css::uno::Reference< css::chart2::XTitle >& xTitle
+ , const rtl::Reference< ::chart::Title >& xTitle
, const css::uno::Reference< css::uno::XComponentContext > & xContext
- , const float * pDefaultCharHeight = nullptr );
+ , const float * pDefaultCharHeight = nullptr
+ , bool bDialogTitle = false );
static bool getTitleType( eTitleType& rType
- , const css::uno::Reference< css::chart2::XTitle >& xTitle
- , ChartModel& rModel);
-
- static bool getTitleType( eTitleType& rType
- , const css::uno::Reference< css::chart2::XTitle >& xTitle
- , const css::uno::Reference< css::frame::XModel >& xModel );
+ , const rtl::Reference< ::chart::Title >& xTitle
+ , const rtl::Reference< ::chart::ChartModel >& xModel );
static void hideTitle( eTitleType nTitleIndex,
- const css::uno::Reference< css::frame::XModel > & xModel);
+ const rtl::Reference< ::chart::ChartModel > & xModel);
};
} //namespace chart
diff --git a/chart2/source/inc/UncachedDataSequence.hxx b/chart2/source/inc/UncachedDataSequence.hxx
index e3a51f55727a..5691413af528 100644
--- a/chart2/source/inc/UncachedDataSequence.hxx
+++ b/chart2/source/inc/UncachedDataSequence.hxx
@@ -19,10 +19,10 @@
#pragma once
// helper classes
-#include <cppuhelper/compbase.hxx>
+#include <comphelper/compbase.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/broadcasthelper.hxx>
-#include <comphelper/propertycontainer.hxx>
+#include <comphelper/propertycontainer2.hxx>
#include <comphelper/proparrhlp.hxx>
#include <rtl/ref.hxx>
@@ -37,15 +37,15 @@
#include <com/sun/star/util/XModifiable.hpp>
namespace com::sun::star::beans { class XPropertySetInfo; }
-namespace com::sun::star::chart2 { class XInternalDataProvider; }
namespace chart
{
class InternalDataProvider;
+class ModifyEventForwarder;
namespace impl
{
-typedef ::cppu::WeakComponentImplHelper<
+typedef ::comphelper::WeakComponentImplHelper<
css::chart2::data::XDataSequence,
css::chart2::data::XNumericalDataSequence,
css::chart2::data::XTextualDataSequence,
@@ -68,8 +68,7 @@ typedef ::cppu::WeakComponentImplHelper<
* 'label 2', ...</p>
*/
class UncachedDataSequence final :
- public ::comphelper::OMutexAndBroadcastHelper,
- public ::comphelper::OPropertyContainer,
+ public ::comphelper::OPropertyContainer2,
public ::comphelper::OPropertyArrayUsageHelper< UncachedDataSequence >,
public impl::UncachedDataSequence_Base
{
@@ -78,11 +77,11 @@ public:
lifetime is at least as long as the one of this object.
*/
UncachedDataSequence(
- const rtl::Reference< InternalDataProvider > & xIntDataProv,
- const OUString & rRangeRepresentation );
+ rtl::Reference< InternalDataProvider > xIntDataProv,
+ OUString aRangeRepresentation );
UncachedDataSequence(
- const rtl::Reference< InternalDataProvider > & xIntDataProv,
- const OUString & rRangeRepresentation,
+ rtl::Reference< InternalDataProvider > xIntDataProv,
+ OUString aRangeRepresentation,
const OUString & rRole );
UncachedDataSequence( const UncachedDataSequence & rSource );
virtual ~UncachedDataSequence() override;
@@ -102,7 +101,7 @@ private:
/// @see css::beans::XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
/// @see ::comphelper::OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+ virtual ::cppu::IPropertyArrayHelper& getInfoHelper() override;
/// @see ::comphelper::OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
@@ -164,7 +163,7 @@ private:
rtl::Reference< InternalDataProvider > m_xDataProvider;
OUString m_aSourceRepresentation;
- css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder;
+ rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
};
} // namespace chart
diff --git a/chart2/source/inc/UserDefinedProperties.hxx b/chart2/source/inc/UserDefinedProperties.hxx
index 07ab7b5bbcef..0254cafe7035 100644
--- a/chart2/source/inc/UserDefinedProperties.hxx
+++ b/chart2/source/inc/UserDefinedProperties.hxx
@@ -18,12 +18,13 @@
*/
#pragma once
+#include <config_options.h>
#include "FastPropertyIdRanges.hxx"
-#include "charttoolsdllapi.hxx"
#include <vector>
namespace com::sun::star::beans { struct Property; }
+namespace css = ::com::sun::star;
namespace chart
{
@@ -45,7 +46,7 @@ namespace UserDefinedProperties
PROP_XML_USERDEF
};
- OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(
+ void AddPropertiesToVector(
std::vector< css::beans::Property > & rOutProperties );
}
diff --git a/chart2/source/inc/WeakListenerAdapter.hxx b/chart2/source/inc/WeakListenerAdapter.hxx
index 7240a5363f85..e312f7bee56f 100644
--- a/chart2/source/inc/WeakListenerAdapter.hxx
+++ b/chart2/source/inc/WeakListenerAdapter.hxx
@@ -19,7 +19,6 @@
#pragma once
#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/view/XSelectionChangeListener.hpp>
#include <cppuhelper/weakref.hxx>
#include <cppuhelper/implbase.hxx>
@@ -39,63 +38,31 @@ namespace chart
the same wrapper that you added, i.e., you should store the adapter as a
member in the adapted class for later use.</p>
*/
-template< class Listener >
- class WeakListenerAdapter : public
- ::cppu::WeakImplHelper< Listener >
+class WeakSelectionChangeListenerAdapter final :
+ public ::cppu::WeakImplHelper< css::view::XSelectionChangeListener >
{
public:
- explicit WeakListenerAdapter( const css::uno::Reference< Listener > & xListener ) :
- m_xListener( xListener )
- {}
- explicit WeakListenerAdapter( const css::uno::WeakReference< Listener > & xListener ) :
- m_xListener( xListener )
- {}
+ explicit WeakSelectionChangeListenerAdapter(
+ const css::uno::Reference< css::view::XSelectionChangeListener > & xListener )
+ : m_xListener( xListener ) {}
+ virtual ~WeakSelectionChangeListenerAdapter() override;
protected:
+ // ____ XSelectionChangeListener ____
+ virtual void SAL_CALL selectionChanged(
+ const css::lang::EventObject& aEvent ) override;
+
// ____ XEventListener (base of all listeners) ____
virtual void SAL_CALL disposing(
const css::lang::EventObject& Source ) override
{
- css::uno::Reference< css::lang::XEventListener > xEventListener(
- css::uno::Reference< Listener >( m_xListener), css::uno::UNO_QUERY );
+ css::uno::Reference< css::view::XSelectionChangeListener > xEventListener( m_xListener );
if( xEventListener.is())
xEventListener->disposing( Source );
}
- css::uno::Reference< Listener > getListener() const
- {
- return m_xListener;
- }
-
private:
- css::uno::WeakReference< Listener > m_xListener;
-};
-
-class WeakModifyListenerAdapter final :
- public WeakListenerAdapter< css::util::XModifyListener >
-{
-public:
- explicit WeakModifyListenerAdapter(
- const css::uno::WeakReference< css::util::XModifyListener > & xListener );
- virtual ~WeakModifyListenerAdapter() override;
-
-protected:
- // ____ XModifyListener ____
- virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override;
-};
-
-class WeakSelectionChangeListenerAdapter final :
- public WeakListenerAdapter< css::view::XSelectionChangeListener >
-{
-public:
- explicit WeakSelectionChangeListenerAdapter(
- const css::uno::Reference< css::view::XSelectionChangeListener > & xListener );
- virtual ~WeakSelectionChangeListenerAdapter() override;
-
-protected:
- // ____ XSelectionChangeListener ____
- virtual void SAL_CALL selectionChanged(
- const css::lang::EventObject& aEvent ) override;
+ css::uno::WeakReference< css::view::XSelectionChangeListener > m_xListener;
};
} // namespace chart
diff --git a/chart2/source/inc/WrappedDefaultProperty.hxx b/chart2/source/inc/WrappedDefaultProperty.hxx
index 08a11ce032eb..d793cfdd15fe 100644
--- a/chart2/source/inc/WrappedDefaultProperty.hxx
+++ b/chart2/source/inc/WrappedDefaultProperty.hxx
@@ -19,17 +19,16 @@
#pragma once
#include "WrappedProperty.hxx"
-#include "charttoolsdllapi.hxx"
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS WrappedDefaultProperty : public WrappedProperty
+class WrappedDefaultProperty : public WrappedProperty
{
public:
explicit WrappedDefaultProperty(
const OUString& rOuterName, const OUString& rInnerName,
- const css::uno::Any& rNewOuterDefault );
+ css::uno::Any aNewOuterDefault );
virtual ~WrappedDefaultProperty() override;
virtual void setPropertyToDefault(
diff --git a/chart2/source/inc/WrappedDirectStateProperty.hxx b/chart2/source/inc/WrappedDirectStateProperty.hxx
index 28398efd8155..afc1237f7d17 100644
--- a/chart2/source/inc/WrappedDirectStateProperty.hxx
+++ b/chart2/source/inc/WrappedDirectStateProperty.hxx
@@ -19,11 +19,10 @@
#pragma once
#include "WrappedProperty.hxx"
-#include "charttoolsdllapi.hxx"
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS WrappedDirectStateProperty : public WrappedProperty
+class WrappedDirectStateProperty : public WrappedProperty
{
public:
explicit WrappedDirectStateProperty(const OUString& rOuterName, const OUString& rInnerName);
diff --git a/chart2/source/inc/WrappedIgnoreProperty.hxx b/chart2/source/inc/WrappedIgnoreProperty.hxx
index a031097bda01..0340358c8122 100644
--- a/chart2/source/inc/WrappedIgnoreProperty.hxx
+++ b/chart2/source/inc/WrappedIgnoreProperty.hxx
@@ -19,14 +19,13 @@
#pragma once
#include "WrappedProperty.hxx"
-#include "charttoolsdllapi.hxx"
#include <vector>
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS WrappedIgnoreProperty final : public WrappedProperty
+class WrappedIgnoreProperty final : public WrappedProperty
{
public:
WrappedIgnoreProperty( const OUString& rOuterName, const css::uno::Any& rDefaultValue );
@@ -36,25 +35,25 @@ public:
virtual css::uno::Any getPropertyValue( const css::uno::Reference< css::beans::XPropertySet >& xInnerPropertySet ) const override;
-SAL_DLLPRIVATE virtual void setPropertyToDefault( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const override;
+virtual void setPropertyToDefault( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const override;
-SAL_DLLPRIVATE virtual css::uno::Any getPropertyDefault( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const override;
+virtual css::uno::Any getPropertyDefault( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const override;
-SAL_DLLPRIVATE virtual css::beans::PropertyState getPropertyState( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const override;
+virtual css::beans::PropertyState getPropertyState( const css::uno::Reference< css::beans::XPropertyState >& xInnerPropertyState ) const override;
private:
css::uno::Any m_aDefaultValue;
mutable css::uno::Any m_aCurrentValue;
};
-class OOO_DLLPUBLIC_CHARTTOOLS WrappedIgnoreProperties
+class WrappedIgnoreProperties
{
public:
static void addIgnoreLineProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList );
static void addIgnoreFillProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList );
- SAL_DLLPRIVATE static void addIgnoreFillProperties_without_BitmapProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList );
- SAL_DLLPRIVATE static void addIgnoreFillProperties_only_BitmapProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList );
+ static void addIgnoreFillProperties_without_BitmapProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList );
+ static void addIgnoreFillProperties_only_BitmapProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList );
};
} //namespace chart
diff --git a/chart2/source/inc/WrappedProperty.hxx b/chart2/source/inc/WrappedProperty.hxx
index 6bd13936c732..d2560cfa783d 100644
--- a/chart2/source/inc/WrappedProperty.hxx
+++ b/chart2/source/inc/WrappedProperty.hxx
@@ -18,10 +18,10 @@
*/
#pragma once
+#include <config_options.h>
#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <rtl/ustring.hxx>
-#include "charttoolsdllapi.hxx"
#include <map>
#include <memory>
@@ -33,13 +33,13 @@ namespace com::sun::star::uno { template <class interface_type> class Reference;
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS WrappedProperty
+class WrappedProperty
{
/** The property visible to the outer PropertySet in the PropertySetWrapper may have a different name, type and value than
a corresponding property of the inner PropertySet. Use this class to do the conversion between the two.
*/
public:
- WrappedProperty( const OUString& rOuterName, const OUString& rInnerName );
+ WrappedProperty( OUString aOuterName, OUString aInnerName );
virtual ~WrappedProperty();
const OUString& getOuterName() const { return m_aOuterName;}
diff --git a/chart2/source/inc/WrappedPropertySet.hxx b/chart2/source/inc/WrappedPropertySet.hxx
index 30ac421b3f5c..88dd8248d6e9 100644
--- a/chart2/source/inc/WrappedPropertySet.hxx
+++ b/chart2/source/inc/WrappedPropertySet.hxx
@@ -18,16 +18,16 @@
*/
#pragma once
+#include <config_options.h>
#include "WrappedProperty.hxx"
-#include "charttoolsdllapi.hxx"
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertyStates.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <memory>
+#include <mutex>
#include <vector>
namespace cppu { class IPropertyArrayHelper; }
@@ -36,9 +36,8 @@ namespace cppu { class OPropertyArrayHelper; }
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS WrappedPropertySet :
- public cppu::BaseMutex
- , public ::cppu::WeakImplHelper
+class WrappedPropertySet :
+ public ::cppu::WeakImplHelper
< css::beans::XPropertySet
, css::beans::XMultiPropertySet
, css::beans::XPropertyState
@@ -95,15 +94,17 @@ protected: //methods
virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties()=0;
virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() = 0;
- SAL_DLLPRIVATE css::uno::Reference< css::beans::XPropertyState > getInnerPropertyState();
+ css::uno::Reference< css::beans::XPropertyState > getInnerPropertyState();
::cppu::IPropertyArrayHelper& getInfoHelper();
- SAL_DLLPRIVATE tWrappedPropertyMap& getWrappedPropertyMap();
+ tWrappedPropertyMap& getWrappedPropertyMap();
const WrappedProperty* getWrappedProperty( const OUString& rOuterName );
const WrappedProperty* getWrappedProperty( sal_Int32 nHandle );
-protected: //member
+ std::mutex m_aMutex;
+
+private:
css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo;//outer PropertySetInfo
std::unique_ptr<::cppu::OPropertyArrayHelper> m_pPropertyArrayHelper;//holds all possible outer properties
diff --git a/chart2/source/inc/XMLRangeHelper.hxx b/chart2/source/inc/XMLRangeHelper.hxx
index 519c9b772271..ba8ac8481e0f 100644
--- a/chart2/source/inc/XMLRangeHelper.hxx
+++ b/chart2/source/inc/XMLRangeHelper.hxx
@@ -20,12 +20,11 @@
#include <sal/types.h>
#include <rtl/ustring.hxx>
-#include "charttoolsdllapi.hxx"
namespace chart::XMLRangeHelper
{
-struct OOO_DLLPUBLIC_CHARTTOOLS Cell
+struct Cell
{
sal_Int32 nColumn;
sal_Int32 nRow;
@@ -44,7 +43,7 @@ struct OOO_DLLPUBLIC_CHARTTOOLS Cell
bool empty() const { return bIsEmpty; }
};
-struct OOO_DLLPUBLIC_CHARTTOOLS CellRange
+struct CellRange
{
Cell aUpperLeft;
Cell aLowerRight;
diff --git a/chart2/source/inc/charttoolsdllapi.hxx b/chart2/source/inc/charttoolsdllapi.hxx
deleted file mode 100644
index 96336e1012ae..000000000000
--- a/chart2/source/inc/charttoolsdllapi.hxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- 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 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 .
- */
-
-#pragma once
-
-#include <sal/config.h>
-
-#include <sal/types.h>
-
-#if defined OOO_DLLIMPLEMENTATION_CHARTTOOLS
-#define OOO_DLLPUBLIC_CHARTTOOLS SAL_DLLPUBLIC_EXPORT
-#else
-#define OOO_DLLPUBLIC_CHARTTOOLS SAL_DLLPUBLIC_IMPORT
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/chartview/ChartSfxItemIds.hxx b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
index 55fec55872f3..43341728d4da 100644
--- a/chart2/source/inc/chartview/ChartSfxItemIds.hxx
+++ b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
@@ -33,168 +33,180 @@ class SvxChartKindErrorItem;
class SvxChartTextOrderItem;
class SvxChartRegressItem;
class SdrAngleItem;
+class SvxChartColorPaletteItem;
// SCHATTR
// can't this be changed to 0?
-constexpr sal_uInt16 SCHATTR_START = 1;
-
-constexpr sal_uInt16 SCHATTR_DATADESCR_START (SCHATTR_START);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_NUMBER (SCHATTR_DATADESCR_START);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_PERCENTAGE (SCHATTR_DATADESCR_START + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_CATEGORY (SCHATTR_DATADESCR_START + 2);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_SYMBOL (SCHATTR_DATADESCR_START + 3);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_WRAP_TEXT (SCHATTR_DATADESCR_START + 4);
-constexpr TypedWhichId<SfxStringItem> SCHATTR_DATADESCR_SEPARATOR (SCHATTR_DATADESCR_START + 5);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_DATADESCR_PLACEMENT (SCHATTR_DATADESCR_START + 6);
-constexpr TypedWhichId<SfxIntegerListItem> SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS (SCHATTR_DATADESCR_START + 7);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_NO_PERCENTVALUE (SCHATTR_DATADESCR_START + 8); //percentage values should not be offered
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_CUSTOM_LEADER_LINES (SCHATTR_DATADESCR_START + 9);
-constexpr TypedWhichId<SfxUInt32Item> SCHATTR_PERCENT_NUMBERFORMAT_VALUE (SCHATTR_DATADESCR_START + 10);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_PERCENT_NUMBERFORMAT_SOURCE (SCHATTR_DATADESCR_START + 11);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME (SCHATTR_DATADESCR_START + 12);
-constexpr sal_uInt16 SCHATTR_DATADESCR_END (SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME);
+inline constexpr sal_uInt16 SCHATTR_START = 1;
+
+inline constexpr sal_uInt16 SCHATTR_DATADESCR_START (SCHATTR_START);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_NUMBER (SCHATTR_DATADESCR_START);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_PERCENTAGE (SCHATTR_DATADESCR_START + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_CATEGORY (SCHATTR_DATADESCR_START + 2);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_SYMBOL (SCHATTR_DATADESCR_START + 3);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_WRAP_TEXT (SCHATTR_DATADESCR_START + 4);
+inline constexpr TypedWhichId<SfxStringItem> SCHATTR_DATADESCR_SEPARATOR (SCHATTR_DATADESCR_START + 5);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_DATADESCR_PLACEMENT (SCHATTR_DATADESCR_START + 6);
+inline constexpr TypedWhichId<SfxIntegerListItem> SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS (SCHATTR_DATADESCR_START + 7);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_NO_PERCENTVALUE (SCHATTR_DATADESCR_START + 8); //percentage values should not be offered
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_CUSTOM_LEADER_LINES (SCHATTR_DATADESCR_START + 9);
+inline constexpr TypedWhichId<SfxUInt32Item> SCHATTR_PERCENT_NUMBERFORMAT_VALUE (SCHATTR_DATADESCR_START + 10);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_PERCENT_NUMBERFORMAT_SOURCE (SCHATTR_DATADESCR_START + 11);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME (SCHATTR_DATADESCR_START + 12);
+inline constexpr sal_uInt16 SCHATTR_DATADESCR_END (SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME);
//legend
-constexpr sal_uInt16 SCHATTR_LEGEND_START (SCHATTR_DATADESCR_END + 1);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_LEGEND_POS (SCHATTR_LEGEND_START);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_LEGEND_SHOW (SCHATTR_LEGEND_START + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_LEGEND_NO_OVERLAY (SCHATTR_LEGEND_START + 2);
-constexpr sal_uInt16 SCHATTR_LEGEND_END (SCHATTR_LEGEND_NO_OVERLAY);
+inline constexpr sal_uInt16 SCHATTR_LEGEND_START (SCHATTR_DATADESCR_END + 1);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_LEGEND_POS (SCHATTR_LEGEND_START);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_LEGEND_SHOW (SCHATTR_LEGEND_START + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_LEGEND_NO_OVERLAY (SCHATTR_LEGEND_START + 2);
+inline constexpr sal_uInt16 SCHATTR_LEGEND_END (SCHATTR_LEGEND_NO_OVERLAY);
//text
-constexpr sal_uInt16 SCHATTR_TEXT_START (SCHATTR_LEGEND_END + 1);
-constexpr TypedWhichId<SdrAngleItem> SCHATTR_TEXT_DEGREES (SCHATTR_TEXT_START);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_TEXT_STACKED (SCHATTR_TEXT_START + 1);
-constexpr sal_uInt16 SCHATTR_TEXT_END (SCHATTR_TEXT_STACKED);
+inline constexpr sal_uInt16 SCHATTR_TEXT_START (SCHATTR_LEGEND_END + 1);
+inline constexpr TypedWhichId<SdrAngleItem> SCHATTR_TEXT_DEGREES (SCHATTR_TEXT_START);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_TEXT_STACKED (SCHATTR_TEXT_START + 1);
+inline constexpr sal_uInt16 SCHATTR_TEXT_END (SCHATTR_TEXT_STACKED);
// statistic
-constexpr sal_uInt16 SCHATTR_STAT_START (SCHATTR_TEXT_END + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STAT_AVERAGE (SCHATTR_STAT_START);
-constexpr TypedWhichId<SvxChartKindErrorItem> SCHATTR_STAT_KIND_ERROR (SCHATTR_STAT_START + 1);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_PERCENT (SCHATTR_STAT_START + 2);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_BIGERROR (SCHATTR_STAT_START + 3);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_CONSTPLUS (SCHATTR_STAT_START + 4);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_CONSTMINUS (SCHATTR_STAT_START + 5);
-constexpr TypedWhichId<SvxChartIndicateItem> SCHATTR_STAT_INDICATE (SCHATTR_STAT_START + 6);
-constexpr TypedWhichId<SfxStringItem> SCHATTR_STAT_RANGE_POS (SCHATTR_STAT_START + 7);
-constexpr TypedWhichId<SfxStringItem> SCHATTR_STAT_RANGE_NEG (SCHATTR_STAT_START + 8);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STAT_ERRORBAR_TYPE (SCHATTR_STAT_START + 9);
-constexpr sal_uInt16 SCHATTR_STAT_END (SCHATTR_STAT_ERRORBAR_TYPE);
+inline constexpr sal_uInt16 SCHATTR_STAT_START (SCHATTR_TEXT_END + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STAT_AVERAGE (SCHATTR_STAT_START);
+inline constexpr TypedWhichId<SvxChartKindErrorItem> SCHATTR_STAT_KIND_ERROR (SCHATTR_STAT_START + 1);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_PERCENT (SCHATTR_STAT_START + 2);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_BIGERROR (SCHATTR_STAT_START + 3);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_CONSTPLUS (SCHATTR_STAT_START + 4);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_STAT_CONSTMINUS (SCHATTR_STAT_START + 5);
+inline constexpr TypedWhichId<SvxChartIndicateItem> SCHATTR_STAT_INDICATE (SCHATTR_STAT_START + 6);
+inline constexpr TypedWhichId<SfxStringItem> SCHATTR_STAT_RANGE_POS (SCHATTR_STAT_START + 7);
+inline constexpr TypedWhichId<SfxStringItem> SCHATTR_STAT_RANGE_NEG (SCHATTR_STAT_START + 8);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STAT_ERRORBAR_TYPE (SCHATTR_STAT_START + 9);
+inline constexpr sal_uInt16 SCHATTR_STAT_END (SCHATTR_STAT_ERRORBAR_TYPE);
// these attributes are for replacement of enum eChartStyle
-constexpr sal_uInt16 SCHATTR_STYLE_START (SCHATTR_STAT_END + 1);
+inline constexpr sal_uInt16 SCHATTR_STYLE_START (SCHATTR_STAT_END + 1);
// for whole chart
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_DEEP (SCHATTR_STYLE_START );
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_3D (SCHATTR_STYLE_START + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_VERTICAL (SCHATTR_STYLE_START + 2);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_DEEP (SCHATTR_STYLE_START );
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_3D (SCHATTR_STYLE_START + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_VERTICAL (SCHATTR_STYLE_START + 2);
// also for series
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_BASETYPE (SCHATTR_STYLE_START + 3);// Line,Area,...,Pie
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_LINES (SCHATTR_STYLE_START + 4);// draw line
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_PERCENT (SCHATTR_STYLE_START + 5);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_STACKED (SCHATTR_STYLE_START + 6);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SPLINES (SCHATTR_STYLE_START + 7);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_BASETYPE (SCHATTR_STYLE_START + 3);// Line,Area,...,Pie
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_LINES (SCHATTR_STYLE_START + 4);// draw line
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_PERCENT (SCHATTR_STYLE_START + 5);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STYLE_STACKED (SCHATTR_STYLE_START + 6);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SPLINES (SCHATTR_STYLE_START + 7);
// also for data point
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SYMBOL (SCHATTR_STYLE_START + 8);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SHAPE (SCHATTR_STYLE_START + 9);
-constexpr sal_uInt16 SCHATTR_STYLE_END (SCHATTR_STYLE_SHAPE );
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SYMBOL (SCHATTR_STYLE_START + 8);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_STYLE_SHAPE (SCHATTR_STYLE_START + 9);
+inline constexpr sal_uInt16 SCHATTR_STYLE_END (SCHATTR_STYLE_SHAPE );
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS (SCHATTR_STYLE_END + 1); // see chtmodel.hxx defines CHART_AXIS_PRIMARY_X, etc.
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS (SCHATTR_STYLE_END + 1); // see chtmodel.hxx defines CHART_AXIS_PRIMARY_X, etc.
//Re-mapped:
-constexpr sal_uInt16 SCHATTR_AXIS_START (SCHATTR_AXIS + 1);
+inline constexpr sal_uInt16 SCHATTR_AXIS_START (SCHATTR_AXIS + 1);
//axis scale
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXISTYPE (SCHATTR_AXIS_START);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_MIN (SCHATTR_AXIS_START + 2);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 3);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_MAX (SCHATTR_AXIS_START + 4);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_MAX (SCHATTR_AXIS_START + 5);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_STEP_MAIN (SCHATTR_AXIS_START + 6);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_STEP_MAIN (SCHATTR_AXIS_START + 7);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_MAIN_TIME_UNIT (SCHATTR_AXIS_START + 8);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_STEP_HELP (SCHATTR_AXIS_START + 9);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_STEP_HELP (SCHATTR_AXIS_START + 10);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_HELP_TIME_UNIT (SCHATTR_AXIS_START + 11);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_TIME_RESOLUTION (SCHATTR_AXIS_START + 12);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_TIME_RESOLUTION (SCHATTR_AXIS_START + 13);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 14);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_DATEAXIS (SCHATTR_AXIS_START + 15);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_ALLOW_DATEAXIS (SCHATTR_AXIS_START + 16);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 17);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 18);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXISTYPE (SCHATTR_AXIS_START);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_MIN (SCHATTR_AXIS_START + 2);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 3);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_MAX (SCHATTR_AXIS_START + 4);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_MAX (SCHATTR_AXIS_START + 5);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_STEP_MAIN (SCHATTR_AXIS_START + 6);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_STEP_MAIN (SCHATTR_AXIS_START + 7);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_MAIN_TIME_UNIT (SCHATTR_AXIS_START + 8);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_STEP_HELP (SCHATTR_AXIS_START + 9);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_STEP_HELP (SCHATTR_AXIS_START + 10);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_HELP_TIME_UNIT (SCHATTR_AXIS_START + 11);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_TIME_RESOLUTION (SCHATTR_AXIS_START + 12);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_TIME_RESOLUTION (SCHATTR_AXIS_START + 13);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 14);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_DATEAXIS (SCHATTR_AXIS_START + 15);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_ALLOW_DATEAXIS (SCHATTR_AXIS_START + 16);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 17);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 18);
//axis position
-constexpr sal_uInt16 SCHATTR_AXIS_POSITION_START (SCHATTR_AXIS_ORIGIN + 1);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_TICKS (SCHATTR_AXIS_POSITION_START);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_POSITION_START + 1);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_POSITION (SCHATTR_AXIS_POSITION_START + 2);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_POSITION_VALUE (SCHATTR_AXIS_POSITION_START + 3);
-constexpr TypedWhichId<SfxUInt32Item> SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT (SCHATTR_AXIS_POSITION_START + 4);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION (SCHATTR_AXIS_POSITION_START + 5);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_LABEL_POSITION (SCHATTR_AXIS_POSITION_START + 6);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_MARK_POSITION (SCHATTR_AXIS_POSITION_START + 7);
+inline constexpr sal_uInt16 SCHATTR_AXIS_POSITION_START (SCHATTR_AXIS_ORIGIN + 1);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_TICKS (SCHATTR_AXIS_POSITION_START);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_POSITION_START + 1);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_POSITION (SCHATTR_AXIS_POSITION_START + 2);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_AXIS_POSITION_VALUE (SCHATTR_AXIS_POSITION_START + 3);
+inline constexpr TypedWhichId<SfxUInt32Item> SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT (SCHATTR_AXIS_POSITION_START + 4);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION (SCHATTR_AXIS_POSITION_START + 5);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_LABEL_POSITION (SCHATTR_AXIS_POSITION_START + 6);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_MARK_POSITION (SCHATTR_AXIS_POSITION_START + 7);
//axis label
-constexpr sal_uInt16 SCHATTR_AXIS_LABEL_START (SCHATTR_AXIS_MARK_POSITION + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_SHOWDESCR (SCHATTR_AXIS_LABEL_START);
-constexpr TypedWhichId<SvxChartTextOrderItem> SCHATTR_AXIS_LABEL_ORDER (SCHATTR_AXIS_LABEL_START + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LABEL_OVERLAP (SCHATTR_AXIS_LABEL_START + 2);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LABEL_BREAK (SCHATTR_AXIS_LABEL_START + 3);
-constexpr sal_uInt16 SCHATTR_AXIS_LABEL_END (SCHATTR_AXIS_LABEL_BREAK);
+inline constexpr sal_uInt16 SCHATTR_AXIS_LABEL_START (SCHATTR_AXIS_MARK_POSITION + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_SHOWDESCR (SCHATTR_AXIS_LABEL_START);
+inline constexpr TypedWhichId<SvxChartTextOrderItem> SCHATTR_AXIS_LABEL_ORDER (SCHATTR_AXIS_LABEL_START + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LABEL_OVERLAP (SCHATTR_AXIS_LABEL_START + 2);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_AXIS_LABEL_BREAK (SCHATTR_AXIS_LABEL_START + 3);
+inline constexpr sal_uInt16 SCHATTR_AXIS_LABEL_END (SCHATTR_AXIS_LABEL_BREAK);
-constexpr sal_uInt16 SCHATTR_AXIS_END (SCHATTR_AXIS_LABEL_END);
+inline constexpr sal_uInt16 SCHATTR_AXIS_END (SCHATTR_AXIS_LABEL_END);
-constexpr TypedWhichId<SvxBrushItem> SCHATTR_SYMBOL_BRUSH (SCHATTR_AXIS_END + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STOCK_VOLUME (SCHATTR_AXIS_END + 2);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_STOCK_UPDOWN (SCHATTR_AXIS_END + 3);
-constexpr TypedWhichId<SvxSizeItem> SCHATTR_SYMBOL_SIZE (SCHATTR_AXIS_END + 4);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY (SCHATTR_AXIS_END + 5);
+inline constexpr TypedWhichId<SvxBrushItem> SCHATTR_SYMBOL_BRUSH (SCHATTR_AXIS_END + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STOCK_VOLUME (SCHATTR_AXIS_END + 2);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_STOCK_UPDOWN (SCHATTR_AXIS_END + 3);
+inline constexpr TypedWhichId<SvxSizeItem> SCHATTR_SYMBOL_SIZE (SCHATTR_AXIS_END + 4);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY (SCHATTR_AXIS_END + 5);
// non persistent items (binary format)
-constexpr sal_uInt16 SCHATTR_CHARTTYPE_START (SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY + 1);
+inline constexpr sal_uInt16 SCHATTR_CHARTTYPE_START (SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY + 1);
// new from New Chart
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_BAR_OVERLAP (SCHATTR_CHARTTYPE_START );
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_BAR_GAPWIDTH (SCHATTR_CHARTTYPE_START + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_BAR_CONNECT (SCHATTR_CHARTTYPE_START + 2);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_NUM_OF_LINES_FOR_BAR (SCHATTR_CHARTTYPE_START + 3);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_SPLINE_ORDER (SCHATTR_CHARTTYPE_START + 4);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_SPLINE_RESOLUTION (SCHATTR_CHARTTYPE_START + 5);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_GROUP_BARS_PER_AXIS (SCHATTR_CHARTTYPE_START + 6);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_STARTING_ANGLE (SCHATTR_CHARTTYPE_START + 7);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_CLOCKWISE (SCHATTR_CHARTTYPE_START + 8);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_MISSING_VALUE_TREATMENT (SCHATTR_CHARTTYPE_START + 9);
-constexpr TypedWhichId<SfxIntegerListItem> SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 10);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_INCLUDE_HIDDEN_CELLS (SCHATTR_CHARTTYPE_START + 11);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_HIDE_LEGEND_ENTRY (SCHATTR_CHARTTYPE_START + 12);
-
-constexpr sal_uInt16 SCHATTR_CHARTTYPE_END (SCHATTR_HIDE_LEGEND_ENTRY);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_BAR_OVERLAP (SCHATTR_CHARTTYPE_START );
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_BAR_GAPWIDTH (SCHATTR_CHARTTYPE_START + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_BAR_CONNECT (SCHATTR_CHARTTYPE_START + 2);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_NUM_OF_LINES_FOR_BAR (SCHATTR_CHARTTYPE_START + 3);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_SPLINE_ORDER (SCHATTR_CHARTTYPE_START + 4);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_SPLINE_RESOLUTION (SCHATTR_CHARTTYPE_START + 5);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_GROUP_BARS_PER_AXIS (SCHATTR_CHARTTYPE_START + 6);
+inline constexpr TypedWhichId<SdrAngleItem> SCHATTR_STARTING_ANGLE (SCHATTR_CHARTTYPE_START + 7);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_CLOCKWISE (SCHATTR_CHARTTYPE_START + 8);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_MISSING_VALUE_TREATMENT (SCHATTR_CHARTTYPE_START + 9);
+inline constexpr TypedWhichId<SfxIntegerListItem> SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 10);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_INCLUDE_HIDDEN_CELLS (SCHATTR_CHARTTYPE_START + 11);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_HIDE_LEGEND_ENTRY (SCHATTR_CHARTTYPE_START + 12);
+
+inline constexpr sal_uInt16 SCHATTR_CHARTTYPE_END (SCHATTR_HIDE_LEGEND_ENTRY);
// items for transporting information to dialogs
-constexpr sal_uInt16 SCHATTR_MISC_START (SCHATTR_CHARTTYPE_END + 1);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_FOR_ALL_SERIES (SCHATTR_MISC_START);
-constexpr sal_uInt16 SCHATTR_MISC_END (SCHATTR_AXIS_FOR_ALL_SERIES);
+inline constexpr sal_uInt16 SCHATTR_MISC_START (SCHATTR_CHARTTYPE_END + 1);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_AXIS_FOR_ALL_SERIES (SCHATTR_MISC_START);
+inline constexpr sal_uInt16 SCHATTR_MISC_END (SCHATTR_AXIS_FOR_ALL_SERIES);
// regression curve
-constexpr sal_uInt16 SCHATTR_REGRESSION_START (SCHATTR_MISC_END + 1);
-constexpr TypedWhichId<SvxChartRegressItem> SCHATTR_REGRESSION_TYPE (SCHATTR_REGRESSION_START);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SHOW_EQUATION (SCHATTR_REGRESSION_START + 1);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SHOW_COEFF (SCHATTR_REGRESSION_START + 2);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_DEGREE (SCHATTR_REGRESSION_START + 3);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_PERIOD (SCHATTR_REGRESSION_START + 4);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD (SCHATTR_REGRESSION_START + 5);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD (SCHATTR_REGRESSION_START + 6);
-constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SET_INTERCEPT (SCHATTR_REGRESSION_START + 7);
-constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_INTERCEPT_VALUE (SCHATTR_REGRESSION_START + 8);
-constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_CURVE_NAME (SCHATTR_REGRESSION_START + 9);
-constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_XNAME (SCHATTR_REGRESSION_START + 10);
-constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_YNAME (SCHATTR_REGRESSION_START + 11);
-constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_MOVING_TYPE (SCHATTR_REGRESSION_START + 12);
-constexpr sal_uInt16 SCHATTR_REGRESSION_END (SCHATTR_REGRESSION_MOVING_TYPE);
-
-constexpr sal_uInt16 SCHATTR_END (SCHATTR_REGRESSION_END);
+inline constexpr sal_uInt16 SCHATTR_REGRESSION_START (SCHATTR_MISC_END + 1);
+inline constexpr TypedWhichId<SvxChartRegressItem> SCHATTR_REGRESSION_TYPE (SCHATTR_REGRESSION_START);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SHOW_EQUATION (SCHATTR_REGRESSION_START + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SHOW_COEFF (SCHATTR_REGRESSION_START + 2);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_DEGREE (SCHATTR_REGRESSION_START + 3);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_PERIOD (SCHATTR_REGRESSION_START + 4);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD (SCHATTR_REGRESSION_START + 5);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD (SCHATTR_REGRESSION_START + 6);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_REGRESSION_SET_INTERCEPT (SCHATTR_REGRESSION_START + 7);
+inline constexpr TypedWhichId<SvxDoubleItem> SCHATTR_REGRESSION_INTERCEPT_VALUE (SCHATTR_REGRESSION_START + 8);
+inline constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_CURVE_NAME (SCHATTR_REGRESSION_START + 9);
+inline constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_XNAME (SCHATTR_REGRESSION_START + 10);
+inline constexpr TypedWhichId<SfxStringItem> SCHATTR_REGRESSION_YNAME (SCHATTR_REGRESSION_START + 11);
+inline constexpr TypedWhichId<SfxInt32Item> SCHATTR_REGRESSION_MOVING_TYPE (SCHATTR_REGRESSION_START + 12);
+inline constexpr sal_uInt16 SCHATTR_REGRESSION_END (SCHATTR_REGRESSION_MOVING_TYPE);
+
+inline constexpr sal_uInt16 SCHATTR_DATA_TABLE_START (SCHATTR_REGRESSION_END + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_HORIZONTAL_BORDER (SCHATTR_DATA_TABLE_START + 0);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_VERTICAL_BORDER (SCHATTR_DATA_TABLE_START + 1);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_OUTLINE (SCHATTR_DATA_TABLE_START + 2);
+inline constexpr TypedWhichId<SfxBoolItem> SCHATTR_DATA_TABLE_KEYS (SCHATTR_DATA_TABLE_START + 3);
+inline constexpr sal_uInt16 SCHATTR_DATA_TABLE_END (SCHATTR_DATA_TABLE_KEYS);
+
+inline constexpr sal_uInt16 SCHATTR_COLOR_PALETTE_START (SCHATTR_DATA_TABLE_END + 1);
+inline constexpr TypedWhichId<SvxChartColorPaletteItem> SCHATTR_COLOR_PALETTE (SCHATTR_COLOR_PALETTE_START);
+inline constexpr sal_uInt16 SCHATTR_COLOR_PALETTE_END (SCHATTR_COLOR_PALETTE);
+
+inline constexpr sal_uInt16 SCHATTR_END (SCHATTR_COLOR_PALETTE_END);
// values for Items
diff --git a/chart2/source/inc/chartview/DataPointSymbolSupplier.hxx b/chart2/source/inc/chartview/DataPointSymbolSupplier.hxx
index 58d8a9ff2e4d..8c10bd098cc6 100644
--- a/chart2/source/inc/chartview/DataPointSymbolSupplier.hxx
+++ b/chart2/source/inc/chartview/DataPointSymbolSupplier.hxx
@@ -19,17 +19,15 @@
#pragma once
-#include <chartview/chartviewdllapi.hxx>
#include <rtl/ref.hxx>
#include <svx/unoshape.hxx>
-namespace com::sun::star::drawing { class XShapes; }
namespace com::sun::star::drawing { struct Direction3D; }
namespace chart
{
-class OOO_DLLPUBLIC_CHARTVIEW DataPointSymbolSupplier
+class DataPointSymbolSupplier
{
public:
static rtl::Reference< SvxShapeGroup >
diff --git a/chart2/source/inc/chartview/DrawModelWrapper.hxx b/chart2/source/inc/chartview/DrawModelWrapper.hxx
index 0b4da35435d4..c5101899087d 100644
--- a/chart2/source/inc/chartview/DrawModelWrapper.hxx
+++ b/chart2/source/inc/chartview/DrawModelWrapper.hxx
@@ -21,13 +21,9 @@
#include <svx/svdmodel.hxx>
#include <svx/unopage.hxx>
#include <svx/unoshape.hxx>
-#include <chartview/chartviewdllapi.hxx>
namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace com::sun::star::frame { class XModel; }
-namespace com::sun::star::drawing { class XDrawPage; }
-namespace com::sun::star::drawing { class XShape; }
-namespace com::sun::star::drawing { class XShapes; }
class SdrObjList;
class SdrObject;
@@ -35,23 +31,23 @@ class SdrObject;
namespace chart
{
-class OOO_DLLPUBLIC_CHARTVIEW DrawModelWrapper final : private SdrModel
+class DrawModelWrapper final : private SdrModel
{
private:
rtl::Reference<SvxDrawPage> m_xMainDrawPage;
rtl::Reference<SvxDrawPage> m_xHiddenDrawPage;
-
+ rtl::Reference<SfxItemPool> m_xChartItemPool;
VclPtr<OutputDevice> m_pRefDevice;
public:
- SAL_DLLPRIVATE DrawModelWrapper();
- SAL_DLLPRIVATE virtual ~DrawModelWrapper() override;
+ DrawModelWrapper();
+ virtual ~DrawModelWrapper() override;
css::uno::Reference< css::lang::XMultiServiceFactory > getShapeFactory();
// the main page will contain the normal view objects
const rtl::Reference<SvxDrawPage> & getMainDrawPage();
- SAL_DLLPRIVATE void clearMainDrawPage();
+ void clearMainDrawPage();
// the extra page is not visible, but contains some extras like the symbols for data points
const rtl::Reference<SvxDrawPage> & getHiddenDrawPage();
@@ -59,16 +55,16 @@ public:
static rtl::Reference<SvxShapeGroupAnyD>
getChartRootShape( const rtl::Reference<SvxDrawPage>& xPage );
- SAL_DLLPRIVATE void lockControllers();
- SAL_DLLPRIVATE void unlockControllers();
+ void lockControllers();
+ void unlockControllers();
OutputDevice* getReferenceDevice() const;
SfxItemPool& GetItemPool();
- SAL_DLLPRIVATE virtual css::uno::Reference< css::uno::XInterface >
+ virtual css::uno::Reference< css::frame::XModel >
createUnoModel() override;
- SAL_DLLPRIVATE css::uno::Reference< css::frame::XModel >
+ const css::uno::Reference< css::frame::XModel > &
getUnoModel();
SdrModel& getSdrModel();
diff --git a/chart2/source/inc/chartview/ExplicitScaleValues.hxx b/chart2/source/inc/chartview/ExplicitScaleValues.hxx
index a49dddeb6658..350d6e35ef67 100644
--- a/chart2/source/inc/chartview/ExplicitScaleValues.hxx
+++ b/chart2/source/inc/chartview/ExplicitScaleValues.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include <chartview/chartviewdllapi.hxx>
+#include <config_options.h>
#include <com/sun/star/chart/TimeInterval.hpp>
#include <com/sun/star/chart2/AxisOrientation.hpp>
#include <com/sun/star/chart2/XScaling.hpp>
@@ -35,7 +35,7 @@ namespace chart
/** This structure contains the explicit values for a scale like Minimum and Maximum.
See also css::chart2::ScaleData.
*/
-struct OOO_DLLPUBLIC_CHARTVIEW ExplicitScaleData
+struct ExplicitScaleData
{
ExplicitScaleData();
@@ -73,7 +73,7 @@ struct ExplicitSubIncrement
/** describes how tickmarks are positioned on the scale of an axis.
*/
-struct OOO_DLLPUBLIC_CHARTVIEW ExplicitIncrementData
+struct ExplicitIncrementData
{
ExplicitIncrementData();
diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
deleted file mode 100644
index f367271e3b80..000000000000
--- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- 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 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 .
- */
-#pragma once
-
-#include <com/sun/star/awt/Rectangle.hpp>
-#include <chartview/chartviewdllapi.hxx>
-
-#include <memory>
-
-namespace chart { class ChartModel; }
-namespace chart { struct ExplicitIncrementData; }
-namespace chart { struct ExplicitScaleData; }
-namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XAxis; }
-namespace com::sun::star::chart2 { class XChartDocument; }
-namespace com::sun::star::chart2 { class XCoordinateSystem; }
-namespace com::sun::star::chart2 { class XDataSeries; }
-namespace com::sun::star::chart2 { class XDiagram; }
-namespace com::sun::star::drawing { class XShape; }
-namespace com::sun::star::uno { class XInterface; }
-namespace com::sun::star::uno { template <typename > class Reference; }
-namespace com::sun::star::uno { template <typename > class Sequence; }
-namespace com::sun::star::util { class XNumberFormatsSupplier; }
-
-namespace chart
-{
-
-class DrawModelWrapper;
-class OOO_DLLPUBLIC_CHARTVIEW ExplicitValueProvider
-{
-public:
- /** Gives calculated scale and increment values for a given xAxis in the current view.
- In contrast to the model data these explicit values are always complete as missing auto properties are calculated.
- If the given Axis could not be found or for another reason no correct output can be given false is returned.
- */
- virtual bool getExplicitValuesForAxis(
- css::uno::Reference< css::chart2::XAxis > xAxis
- , ExplicitScaleData& rExplicitScale
- , ExplicitIncrementData& rExplicitIncrement )=0;
-
- /** for rotated objects the shape size and position differs from the visible rectangle
- if bSnapRect is set to true you get the resulting visible position (left-top) and size
- */
- virtual css::awt::Rectangle
- getRectangleOfObject( const OUString& rObjectCID, bool bSnapRect=false )=0;
-
- virtual css::awt::Rectangle getDiagramRectangleExcludingAxes()=0;
-
- virtual css::uno::Reference< css::drawing::XShape >
- getShapeForCID( const OUString& rObjectCID )=0;
-
- virtual std::shared_ptr< DrawModelWrapper > getDrawModelWrapper() = 0;
-
- static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
-
- static css::awt::Rectangle
- AddSubtractAxisTitleSizes(
- ChartModel& rModel
- , ExplicitValueProvider* pChartView
- , const css::awt::Rectangle& rPositionAndSize, bool bSubtract );
-
- static sal_Int32 getExplicitNumberFormatKeyForAxis(
- const css::uno::Reference< css::chart2::XAxis >& xAxis
- , const css::uno::Reference< css::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
- , const css::uno::Reference< css::chart2::XChartDocument>& xChartDoc);
-
- static sal_Int32 getExplicitNumberFormatKeyForDataLabel(
- const css::uno::Reference< css::beans::XPropertySet >& xSeriesOrPointProp );
-
- static sal_Int32 getExplicitPercentageNumberFormatKeyForDataLabel(
- const css::uno::Reference< css::beans::XPropertySet >& xSeriesOrPointProp
- , const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
-
-protected:
- ~ExplicitValueProvider() {}
-};
-
-} //namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/chartview/chartviewdllapi.hxx b/chart2/source/inc/chartview/chartviewdllapi.hxx
deleted file mode 100644
index 533a5cb8338e..000000000000
--- a/chart2/source/inc/chartview/chartviewdllapi.hxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- 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 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 .
- */
-
-#pragma once
-
-#include <sal/config.h>
-
-#include <sal/types.h>
-
-#if defined OOO_DLLIMPLEMENTATION_CHARTVIEW
-#define OOO_DLLPUBLIC_CHARTVIEW SAL_DLLPUBLIC_EXPORT
-#else
-#define OOO_DLLPUBLIC_CHARTVIEW SAL_DLLPUBLIC_IMPORT
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/defines.hxx b/chart2/source/inc/defines.hxx
index bf003b6c6520..1eb464bc203a 100644
--- a/chart2/source/inc/defines.hxx
+++ b/chart2/source/inc/defines.hxx
@@ -19,6 +19,6 @@
#pragma once
-#define FIXED_SIZE_FOR_3D_CHART_VOLUME 10000.0
+constexpr double FIXED_SIZE_FOR_3D_CHART_VOLUME = 10000.0;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/servicenames.hxx b/chart2/source/inc/servicenames.hxx
index 30e9b40f5efa..ebc6c18a77c3 100644
--- a/chart2/source/inc/servicenames.hxx
+++ b/chart2/source/inc/servicenames.hxx
@@ -20,44 +20,10 @@
#include <rtl/ustring.hxx>
-inline constexpr OUStringLiteral CHART_MODEL_SERVICE_IMPLEMENTATION_NAME
- = u"com.sun.star.comp.chart2.ChartModel";
-inline constexpr OUStringLiteral CHART_MODEL_SERVICE_NAME = u"com.sun.star.chart2.ChartDocument";
//@todo create your own service containing the service com.sun.star.document.OfficeDocument
-inline constexpr OUStringLiteral CHART_CONTROLLER_SERVICE_IMPLEMENTATION_NAME
- = u"com.sun.star.comp.chart2.ChartController";
-inline constexpr OUStringLiteral CHART_CONTROLLER_SERVICE_NAME
- = u"com.sun.star.chart2.ChartController";
-//@todo create your own service containing the service com.sun.star.frame.Controller
-
-inline constexpr OUStringLiteral CHART_VIEW_SERVICE_IMPLEMENTATION_NAME
- = u"com.sun.star.comp.chart2.ChartView";
-inline constexpr OUStringLiteral CHART_VIEW_SERVICE_NAME = u"com.sun.star.chart2.ChartView";
-
-inline constexpr OUStringLiteral CHART_FRAMELOADER_SERVICE_IMPLEMENTATION_NAME
- = u"com.sun.star.comp.chart2.ChartFrameLoader";
-inline constexpr OUStringLiteral CHART_FRAMELOADER_SERVICE_NAME
- = u"com.sun.star.frame.SynchronousFrameLoader";
-
-inline constexpr OUStringLiteral CHART_WIZARD_DIALOG_SERVICE_IMPLEMENTATION_NAME
- = u"com.sun.star.comp.chart2.WizardDialog";
-inline constexpr OUStringLiteral CHART_WIZARD_DIALOG_SERVICE_NAME
- = u"com.sun.star.chart2.WizardDialog";
-
-inline constexpr OUStringLiteral CHART_TYPE_DIALOG_SERVICE_IMPLEMENTATION_NAME
- = u"com.sun.star.comp.chart2.ChartTypeDialog";
-inline constexpr OUStringLiteral CHART_TYPE_DIALOG_SERVICE_NAME
- = u"com.sun.star.chart2.ChartTypeDialog";
-
-// wrapper for old UNO API (com.sun.star.chart)
-inline constexpr OUStringLiteral CHART_CHARTAPIWRAPPER_IMPLEMENTATION_NAME
- = u"com.sun.star.comp.chart2.ChartDocumentWrapper";
-inline constexpr OUStringLiteral CHART_CHARTAPIWRAPPER_SERVICE_NAME
- = u"com.sun.star.chart2.ChartDocumentWrapper";
-
-// accessibility
-inline constexpr OUStringLiteral CHART_ACCESSIBLE_TEXT_SERVICE_NAME
- = u"com.sun.star.accessibility.AccessibleTextComponent";
+inline constexpr OUString CHART_VIEW_SERVICE_IMPLEMENTATION_NAME
+ = u"com.sun.star.comp.chart2.ChartView"_ustr;
+inline constexpr OUString CHART_VIEW_SERVICE_NAME = u"com.sun.star.chart2.ChartView"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/servicenames_charttypes.hxx b/chart2/source/inc/servicenames_charttypes.hxx
index 0c06c2d3ea57..fe4bcb1126bf 100644
--- a/chart2/source/inc/servicenames_charttypes.hxx
+++ b/chart2/source/inc/servicenames_charttypes.hxx
@@ -20,25 +20,29 @@
#include <rtl/ustring.hxx>
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_AREA
- = u"com.sun.star.chart2.AreaChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_BAR
- = u"com.sun.star.chart2.BarChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
- = u"com.sun.star.chart2.ColumnChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_LINE
- = u"com.sun.star.chart2.LineChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
- = u"com.sun.star.chart2.ScatterChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_PIE
- = u"com.sun.star.chart2.PieChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_NET
- = u"com.sun.star.chart2.NetChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
- = u"com.sun.star.chart2.FilledNetChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
- = u"com.sun.star.chart2.CandleStickChartType";
-inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
- = u"com.sun.star.chart2.BubbleChartType";
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_AREA
+ = u"com.sun.star.chart2.AreaChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_BAR
+ = u"com.sun.star.chart2.BarChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
+ = u"com.sun.star.chart2.ColumnChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM
+ = u"com.sun.star.chart2.HistogramChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_LINE
+ = u"com.sun.star.chart2.LineChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
+ = u"com.sun.star.chart2.ScatterChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_PIE
+ = u"com.sun.star.chart2.PieChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_NET
+ = u"com.sun.star.chart2.NetChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
+ = u"com.sun.star.chart2.FilledNetChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
+ = u"com.sun.star.chart2.CandleStickChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
+ = u"com.sun.star.chart2.BubbleChartType"_ustr;
+inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_FUNNEL
+ = u"com.sun.star.chart2.FunnelChartType"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/servicenames_coosystems.hxx b/chart2/source/inc/servicenames_coosystems.hxx
index f8472a3dfeec..065155a8bb37 100644
--- a/chart2/source/inc/servicenames_coosystems.hxx
+++ b/chart2/source/inc/servicenames_coosystems.hxx
@@ -20,7 +20,7 @@
#include <rtl/ustring.hxx>
-inline constexpr OUStringLiteral CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.CartesianView";
-inline constexpr OUStringLiteral CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.PolarView";
+inline constexpr OUString CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.CartesianView"_ustr;
+inline constexpr OUString CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.PolarView"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index 0f061c66121b..f68081330347 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -47,7 +47,7 @@
#include <com/sun/star/xml/sax/XFastParser.hpp>
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/document/GraphicStorageHandler.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
using namespace ::com::sun::star;
@@ -58,9 +58,9 @@ using ::osl::MutexGuard;
namespace
{
-constexpr OUStringLiteral sXML_metaStreamName = u"meta.xml";
-constexpr OUStringLiteral sXML_styleStreamName = u"styles.xml";
-constexpr OUStringLiteral sXML_contentStreamName = u"content.xml";
+constexpr OUString sXML_metaStreamName = u"meta.xml"_ustr;
+constexpr OUString sXML_styleStreamName = u"styles.xml"_ustr;
+constexpr OUString sXML_contentStreamName = u"content.xml"_ustr;
uno::Reference< embed::XStorage > lcl_getWriteStorage(
@@ -91,31 +91,26 @@ uno::Reference< embed::XStorage > lcl_getWriteStorage(
}
}
- if( aMDHelper.ISSET_Storage )
- xStorage.set( aMDHelper.Storage );
- else
- {
- Sequence< uno::Any > aStorageArgs{
- aMDHelper.ISSET_OutputStream ? uno::Any(aMDHelper.OutputStream)
- : uno::Any(aMDHelper.URL),
- uno::Any(embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE),
- uno::Any(comphelper::containerToSequence( aPropertiesForStorage ))
- };
+ Sequence< uno::Any > aStorageArgs{
+ aMDHelper.ISSET_OutputStream ? uno::Any(aMDHelper.OutputStream)
+ : uno::Any(aMDHelper.URL),
+ uno::Any(embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE),
+ uno::Any(comphelper::containerToSequence( aPropertiesForStorage ))
+ };
- xStorage.set(
- xStorageFact->createInstanceWithArguments( aStorageArgs ),
- uno::UNO_QUERY_THROW );
- }
+ xStorage.set(
+ xStorageFact->createInstanceWithArguments( aStorageArgs ),
+ uno::UNO_QUERY_THROW );
}
// set correct media type at storage
uno::Reference<beans::XPropertySet> xProp(xStorage,uno::UNO_QUERY);
OUString aMediaType;
if ( ! xProp.is() ||
- ! ( xProp->getPropertyValue( "MediaType") >>= aMediaType ) ||
+ ! ( xProp->getPropertyValue( u"MediaType"_ustr) >>= aMediaType ) ||
( aMediaType.isEmpty() ))
{
- xProp->setPropertyValue( "MediaType", uno::Any( _sMediaType ));
+ xProp->setPropertyValue( u"MediaType"_ustr, uno::Any( _sMediaType ));
}
}
catch (const uno::Exception&)
@@ -186,8 +181,7 @@ namespace chart
{
XMLFilter::XMLFilter( Reference< uno::XComponentContext > const & xContext ) :
- m_xContext( xContext ),
- m_bCancelOperation( false )
+ m_xContext( xContext )
{}
XMLFilter::~XMLFilter()
@@ -201,11 +195,6 @@ sal_Bool SAL_CALL XMLFilter::filter(
MutexGuard aGuard( m_aMutex );
- // ignore cancel flag at start of function
- // note: is currently ignored during import/export
- if( m_bCancelOperation )
- m_bCancelOperation = false;
-
if( m_xSourceDoc.is())
{
OSL_ENSURE( ! m_xTargetDoc.is(), "source doc is set -> target document should not be set" );
@@ -235,12 +224,6 @@ sal_Bool SAL_CALL XMLFilter::filter(
void SAL_CALL XMLFilter::cancel()
{
- // if mutex is locked set "cancel state"
- // note: is currently ignored in filter-method
- if( ! m_aMutex.tryToAcquire())
- {
- m_bCancelOperation = true;
- }
}
// ____ XImporter ____
@@ -279,7 +262,7 @@ ErrCode XMLFilter::impl_Import(
try
{
Reference< lang::XServiceInfo > xServInfo( xDocumentComp, uno::UNO_QUERY_THROW );
- if( ! xServInfo->supportsService( "com.sun.star.chart2.ChartDocument"))
+ if( ! xServInfo->supportsService( u"com.sun.star.chart2.ChartDocument"_ustr))
{
OSL_FAIL( "Import: No ChartDocument" );
return ERRCODE_SFX_GENERAL;
@@ -303,23 +286,22 @@ ErrCode XMLFilter::impl_Import(
uno::Sequence<uno::Any> aArgs{ uno::Any(xStorage) };
xGraphicStorageHandler.set(
xServiceFactory->createInstanceWithArguments(
- "com.sun.star.comp.Svx.GraphicImportHelper", aArgs), uno::UNO_QUERY);
+ u"com.sun.star.comp.Svx.GraphicImportHelper"_ustr, aArgs), uno::UNO_QUERY);
}
// create XPropertySet with extra information for the filter
/** property map for import info set */
- comphelper::PropertyMapEntry const aImportInfoMap[] =
+ static comphelper::PropertyMapEntry const aImportInfoMap[] =
{
// necessary properties for XML progress bar at load time
- { OUString("ProgressRange"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
- { OUString("ProgressMax"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
- { OUString("ProgressCurrent"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
- { OUString("PrivateData"), 0, cppu::UnoType<XInterface>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("BaseURI"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("StreamRelPath"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("StreamName"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("BuildId"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString(), 0, css::uno::Type(), 0, 0 }
+ { u"ProgressRange"_ustr, 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
+ { u"ProgressMax"_ustr, 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
+ { u"ProgressCurrent"_ustr, 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
+ { u"PrivateData"_ustr, 0, cppu::UnoType<XInterface>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
+ { u"BaseURI"_ustr, 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
+ { u"StreamRelPath"_ustr, 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
+ { u"StreamName"_ustr, 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
+ { u"BuildId"_ustr, 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
};
uno::Reference< beans::XPropertySet > xImportInfo(
comphelper::GenericPropertySet_CreateInstance(
@@ -349,24 +331,24 @@ ErrCode XMLFilter::impl_Import(
// needed for relative URLs, but in clipboard copy/paste there may be none
SAL_INFO_IF(aBaseUri.isEmpty(), "chart2", "chart::XMLFilter: no base URL");
if( !aBaseUri.isEmpty() )
- xImportInfo->setPropertyValue( "BaseURI", uno::Any( aBaseUri ) );
+ xImportInfo->setPropertyValue( u"BaseURI"_ustr, uno::Any( aBaseUri ) );
if( !aHierarchName.isEmpty() )
- xImportInfo->setPropertyValue( "StreamRelPath", uno::Any( aHierarchName ) );
+ xImportInfo->setPropertyValue( u"StreamRelPath"_ustr, uno::Any( aHierarchName ) );
// import meta information
if( bOasis )
nWarning = impl_ImportStream(
sXML_metaStreamName,
- "com.sun.star.comp.Chart.XMLOasisMetaImporter",
+ u"com.sun.star.comp.Chart.XMLOasisMetaImporter"_ustr,
xStorage, xFactory, xGraphicStorageHandler, xImportInfo );
// import styles
ErrCode nTmpErr = impl_ImportStream(
sXML_styleStreamName,
bOasis
- ? OUString("com.sun.star.comp.Chart.XMLOasisStylesImporter")
- : OUString("com.sun.star.comp.Chart.XMLStylesImporter"),
+ ? u"com.sun.star.comp.Chart.XMLOasisStylesImporter"_ustr
+ : u"com.sun.star.comp.Chart.XMLStylesImporter"_ustr,
xStorage, xFactory, xGraphicStorageHandler, xImportInfo );
nWarning = nWarning != ERRCODE_NONE ? nWarning : nTmpErr;
@@ -374,8 +356,8 @@ ErrCode XMLFilter::impl_Import(
ErrCode nContentWarning = impl_ImportStream(
sXML_contentStreamName,
bOasis
- ? OUString("com.sun.star.comp.Chart.XMLOasisContentImporter")
- : OUString("com.sun.star.comp.Chart.XMLContentImporter"),
+ ? u"com.sun.star.comp.Chart.XMLOasisContentImporter"_ustr
+ : u"com.sun.star.comp.Chart.XMLContentImporter"_ustr,
xStorage, xFactory, xGraphicStorageHandler, xImportInfo );
nWarning = nWarning != ERRCODE_NONE ? nWarning : nContentWarning;
}
@@ -405,7 +387,7 @@ ErrCode XMLFilter::impl_ImportStream(
return ERRCODE_NONE;
if( xImportInfo.is() )
- xImportInfo->setPropertyValue( "StreamName", uno::Any( rStreamName ) );
+ xImportInfo->setPropertyValue( u"StreamName"_ustr, uno::Any( rStreamName ) );
if( xStorage.is() &&
xStorage->isStreamElement( rStreamName ) )
@@ -449,8 +431,8 @@ ErrCode XMLFilter::impl_ImportStream(
try
{
uno::Sequence< uno::Any > aArgs{
- uno::Any(beans::NamedValue("DocumentHandler", uno::Any(xFilter))),
- uno::Any(beans::NamedValue("Model", uno::Any(m_xTargetDoc)))
+ uno::Any(beans::NamedValue(u"DocumentHandler"_ustr, uno::Any(xFilter))),
+ uno::Any(beans::NamedValue(u"Model"_ustr, uno::Any(m_xTargetDoc)))
};
xFilter = xFactory->createInstanceWithArgumentsAndContext(m_sDocumentHandler,aArgs,m_xContext);
@@ -521,7 +503,7 @@ ErrCode XMLFilter::impl_Export(
try
{
Reference< lang::XServiceInfo > xServInfo( xDocumentComp, uno::UNO_QUERY_THROW );
- if( ! xServInfo->supportsService( "com.sun.star.chart2.ChartDocument"))
+ if( ! xServInfo->supportsService( u"com.sun.star.chart2.ChartDocument"_ustr))
{
OSL_FAIL( "Export: No ChartDocument" );
return ERRCODE_SFX_GENERAL;
@@ -552,8 +534,8 @@ ErrCode XMLFilter::impl_Export(
try
{
uno::Sequence< uno::Any > aArgs{
- uno::Any(beans::NamedValue("DocumentHandler", uno::Any(xDocHandler))),
- uno::Any(beans::NamedValue("Model", uno::Any(xDocumentComp)))
+ uno::Any(beans::NamedValue(u"DocumentHandler"_ustr, uno::Any(xDocHandler))),
+ uno::Any(beans::NamedValue(u"Model"_ustr, uno::Any(xDocumentComp)))
};
xDocHandler.set(xServiceFactory->createInstanceWithArguments(m_sDocumentHandler,aArgs), uno::UNO_QUERY );
@@ -569,23 +551,22 @@ ErrCode XMLFilter::impl_Export(
xGraphicStorageHandler.set(document::GraphicStorageHandler::createWithStorage(m_xContext, xStorage));
// property map for export info set
- comphelper::PropertyMapEntry const aExportInfoMap[] =
+ static comphelper::PropertyMapEntry const aExportInfoMap[] =
{
- { OUString("UsePrettyPrinting"), 0, cppu::UnoType<bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
- { OUString("BaseURI"), 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("StreamRelPath"), 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("StreamName"), 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("ExportTableNumberList"), 0, cppu::UnoType<bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString(), 0, css::uno::Type(), 0, 0 }
+ { u"UsePrettyPrinting"_ustr, 0, cppu::UnoType<bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0},
+ { u"BaseURI"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { u"StreamRelPath"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { u"StreamName"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { u"ExportTableNumberList"_ustr, 0, cppu::UnoType<bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
};
uno::Reference< beans::XPropertySet > xInfoSet =
comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) );
bool bUsePrettyPrinting( officecfg::Office::Common::Save::Document::PrettyPrinting::get() );
- xInfoSet->setPropertyValue( "UsePrettyPrinting", uno::Any( bUsePrettyPrinting ) );
+ xInfoSet->setPropertyValue( u"UsePrettyPrinting"_ustr, uno::Any( bUsePrettyPrinting ) );
if( ! bOasis )
- xInfoSet->setPropertyValue( "ExportTableNumberList", uno::Any( true ));
+ xInfoSet->setPropertyValue( u"ExportTableNumberList"_ustr, uno::Any( true ));
sal_Int32 nArgs = 2;
if( xGraphicStorageHandler.is())
@@ -605,15 +586,15 @@ ErrCode XMLFilter::impl_Export(
if( bOasis )
nWarning = impl_ExportStream(
sXML_metaStreamName,
- "com.sun.star.comp.Chart.XMLOasisMetaExporter",
+ u"com.sun.star.comp.Chart.XMLOasisMetaExporter"_ustr,
xStorage, xSaxWriter, xServiceFactory, aFilterProperties );
// export styles
ErrCode nTmp = impl_ExportStream(
sXML_styleStreamName,
bOasis
- ? OUString("com.sun.star.comp.Chart.XMLOasisStylesExporter")
- : OUString("com.sun.star.comp.Chart.XMLStylesExporter"), // soffice 6/7
+ ? u"com.sun.star.comp.Chart.XMLOasisStylesExporter"_ustr
+ : u"com.sun.star.comp.Chart.XMLStylesExporter"_ustr, // soffice 6/7
xStorage, xSaxWriter, xServiceFactory, aFilterProperties );
nWarning = nWarning != ERRCODE_NONE ? nWarning : nTmp;
@@ -621,8 +602,8 @@ ErrCode XMLFilter::impl_Export(
ErrCode nContentWarning = impl_ExportStream(
sXML_contentStreamName,
bOasis
- ? OUString("com.sun.star.comp.Chart.XMLOasisContentExporter")
- : OUString("com.sun.star.comp.Chart.XMLContentExporter"),
+ ? u"com.sun.star.comp.Chart.XMLOasisContentExporter"_ustr
+ : u"com.sun.star.comp.Chart.XMLContentExporter"_ustr,
xStorage, xSaxWriter, xServiceFactory, aFilterProperties );
nWarning = nWarning != ERRCODE_NONE ? nWarning : nContentWarning;
@@ -673,9 +654,9 @@ ErrCode XMLFilter::impl_ExportStream(
uno::Reference< beans::XPropertySet > xStreamProp( xOutputStream, uno::UNO_QUERY );
if(xStreamProp.is()) try
{
- xStreamProp->setPropertyValue( "MediaType", uno::Any( OUString("text/xml") ) );
- xStreamProp->setPropertyValue( "Compressed", uno::Any( true ) );//@todo?
- xStreamProp->setPropertyValue( "UseCommonStoragePasswordEncryption", uno::Any( true ) );
+ xStreamProp->setPropertyValue( u"MediaType"_ustr, uno::Any( u"text/xml"_ustr ) );
+ xStreamProp->setPropertyValue( u"Compressed"_ustr, uno::Any( true ) );//@todo?
+ xStreamProp->setPropertyValue( u"UseCommonStoragePasswordEncryption"_ustr, uno::Any( true ) );
}
catch (const uno::Exception&)
{
@@ -688,10 +669,10 @@ ErrCode XMLFilter::impl_ExportStream(
{
uno::Reference< beans::XPropertySet > xInfoSet;
if( rFilterProperties.hasElements() )
- rFilterProperties.getConstArray()[0] >>= xInfoSet;
+ rFilterProperties[0] >>= xInfoSet;
OSL_ENSURE( xInfoSet.is(), "missing infoset for export" );
if( xInfoSet.is() )
- xInfoSet->setPropertyValue( "StreamName", uno::Any( rStreamName ) );
+ xInfoSet->setPropertyValue( u"StreamName"_ustr, uno::Any( rStreamName ) );
}
Reference< XExporter > xExporter( xServiceFactory->createInstanceWithArguments(
@@ -722,12 +703,12 @@ void XMLFilter::isOasisFormat(const Sequence< beans::PropertyValue >& _rMediaDes
}
OUString XMLFilter::getMediaType(bool _bOasis)
{
- return _bOasis ? OUString(MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII) : OUString(MIMETYPE_VND_SUN_XML_CHART_ASCII);
+ return _bOasis ? MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII : MIMETYPE_VND_SUN_XML_CHART_ASCII;
}
OUString SAL_CALL XMLFilter::getImplementationName()
{
- return "com.sun.star.comp.chart2.XMLFilter";
+ return u"com.sun.star.comp.chart2.XMLFilter"_ustr;
}
sal_Bool SAL_CALL XMLFilter::supportsService( const OUString& rServiceName )
@@ -738,8 +719,8 @@ sal_Bool SAL_CALL XMLFilter::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL XMLFilter::getSupportedServiceNames()
{
return {
- "com.sun.star.document.ImportFilter",
- "com.sun.star.document.ExportFilter"
+ u"com.sun.star.document.ImportFilter"_ustr,
+ u"com.sun.star.document.ExportFilter"_ustr
};
// todo: services are incomplete. Missing:
// XInitialization, XNamed
diff --git a/chart2/source/model/inc/StockBar.hxx b/chart2/source/model/inc/StockBar.hxx
index dd8160574fd2..38f5c2629b4a 100644
--- a/chart2/source/model/inc/StockBar.hxx
+++ b/chart2/source/model/inc/StockBar.hxx
@@ -21,7 +21,6 @@
#include <com/sun/star/util/XCloneable.hpp>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <ModifyListenerHelper.hxx>
@@ -39,7 +38,6 @@ typedef ::cppu::WeakImplHelper<
}
class StockBar final :
- public cppu::BaseMutex,
public impl::StockBar_Base,
public ::property::OPropertySet
{
@@ -53,6 +51,9 @@ public:
private:
explicit StockBar( const StockBar & rOther );
+ // ____ XTypeProvider ____
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
+
// ____ OPropertySet ____
virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
diff --git a/chart2/source/model/inc/XMLFilter.hxx b/chart2/source/model/inc/XMLFilter.hxx
index b189ce0b3530..d1eea04da653 100644
--- a/chart2/source/model/inc/XMLFilter.hxx
+++ b/chart2/source/model/inc/XMLFilter.hxx
@@ -24,9 +24,8 @@
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
#include <osl/mutex.hxx>
-#include <vcl/errcode.hxx>
+#include <comphelper/errcode.hxx>
namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::uno { class XComponentContext; }
@@ -37,9 +36,6 @@ namespace com::sun::star {
namespace embed {
class XStorage;
}
- namespace xml::sax {
- class XFastParser;
- }
namespace document {
class XGraphicStorageHandler;
}
@@ -124,8 +120,6 @@ private:
css::uno::Sequence<css::beans::PropertyValue> m_aMediaDescriptor;
OUString m_sDocumentHandler; // when set it will be set as doc handler
-
- volatile bool m_bCancelOperation;
::osl::Mutex m_aMutex;
};
@@ -141,13 +135,13 @@ protected:
virtual OUString SAL_CALL
getImplementationName() override
{
- return "com.sun.star.comp.chart2.report.XMLFilter";
+ return u"com.sun.star.comp.chart2.report.XMLFilter"_ustr;
}
// ____ XImporter ____
virtual void SAL_CALL setTargetDocument(
const css::uno::Reference< css::lang::XComponent >& Document ) override
{
- setDocumentHandler( "com.sun.star.comp.report.ImportDocumentHandler" );
+ setDocumentHandler( u"com.sun.star.comp.report.ImportDocumentHandler"_ustr );
XMLFilter::setTargetDocument(Document);
}
@@ -155,7 +149,7 @@ protected:
virtual void SAL_CALL setSourceDocument(
const css::uno::Reference< css::lang::XComponent >& Document ) override
{
- setDocumentHandler( "com.sun.star.comp.report.ExportDocumentHandler" );
+ setDocumentHandler( u"com.sun.star.comp.report.ExportDocumentHandler"_ustr );
XMLFilter::setSourceDocument(Document);
}
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index 9bae79cf8adc..9fe2333776bf 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -17,16 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Axis.hxx"
-#include "GridProperties.hxx"
+#include <Axis.hxx>
+#include <GridProperties.hxx>
#include <CharacterProperties.hxx>
#include <LinePropertiesHelper.hxx>
#include <UserDefinedProperties.hxx>
#include <PropertyHelper.hxx>
-#include <CloneHelper.hxx>
#include <AxisHelper.hxx>
#include <EventListenerHelper.hxx>
#include <ModifyListenerHelper.hxx>
+#include <Title.hxx>
#include <unonames.hxx>
#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
@@ -36,7 +36,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <rtl/ref.hxx>
#include <vector>
@@ -204,116 +204,75 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID );
}
+} // namespace
-struct StaticAxisDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
- ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
-
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, css::chart::ChartAxisPosition_ZERO );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, css::chart::ChartAxisLabelPosition_NEAR_AXIS );
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_AXIS_TEXT_ROTATION, 0.0 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_BREAK, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_OVERLAP, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_STACKED, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_ARRANGE_ORDER, css::chart::ChartAxisArrangeOrderType_AUTO );
-
- float fDefaultCharHeight = 10.0;
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight );
-
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MAJOR_TICKMARKS, 2 /* CHAXIS_MARK_OUTER */ );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MINOR_TICKMARKS, 0 /* CHAXIS_MARK_NONE */ );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_MARK_POSITION, css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_UNITS, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TRY_STAGGERING_FIRST, false );
- }
-};
-
-struct StaticAxisDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticAxisDefaults_Initializer >
-{
-};
-
-struct StaticAxisInfoHelper_Initializer
+namespace chart
{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticAxisInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticAxisInfoHelper_Initializer >
+const ::chart::tPropertyValueMap & StaticAxisDefaults()
{
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aMap;
+ ::chart::CharacterProperties::AddDefaultsToMap( aMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aMap );
+
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_SHOW, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_CROSSOVER_POSITION, css::chart::ChartAxisPosition_ZERO );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_DISPLAY_LABELS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_LABEL_POSITION, css::chart::ChartAxisLabelPosition_NEAR_AXIS );
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( aMap, PROP_AXIS_TEXT_ROTATION, 0.0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_TEXT_BREAK, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_TEXT_OVERLAP, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_TEXT_STACKED, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_TEXT_ARRANGE_ORDER, css::chart::ChartAxisArrangeOrderType_AUTO );
+
+ float fDefaultCharHeight = 10.0;
+ ::chart::PropertyHelper::setPropertyValue( aMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( aMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( aMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight );
+
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_AXIS_MAJOR_TICKMARKS, 2 /* CHAXIS_MARK_OUTER */ );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_AXIS_MINOR_TICKMARKS, 0 /* CHAXIS_MARK_NONE */ );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_MARK_POSITION, css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_DISPLAY_UNITS, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_AXIS_TRY_STAGGERING_FIRST, false );
+ return aMap;
+ }();
+ return aStaticDefaults;
};
+} // namespace chart
-struct StaticAxisInfo_Initializer
+namespace
{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAxisInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticAxisInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticAxisInfo_Initializer >
+::cppu::OPropertyArrayHelper& StaticAxisInfoHelper()
{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
-typedef uno::Reference< beans::XPropertySet > lcl_tSubGridType;
-
-void lcl_CloneSubGrids(
- const uno::Sequence< lcl_tSubGridType > & rSource, uno::Sequence< lcl_tSubGridType > & rDestination )
+std::vector< rtl::Reference< ::chart::GridProperties > > lcl_CloneSubGrids(
+ const std::vector< rtl::Reference< ::chart::GridProperties > > & rSource )
{
- rDestination.realloc( rSource.getLength());
- lcl_tSubGridType * pDestBegin = rDestination.getArray();
- lcl_tSubGridType * pDestEnd = pDestBegin + rDestination.getLength();
- lcl_tSubGridType * pDestIt = pDestBegin;
-
- for( Reference< beans::XPropertySet > const & i : rSource )
+ std::vector< rtl::Reference< ::chart::GridProperties > > aDestination;
+ aDestination.reserve( rSource.size());
+ for( rtl::Reference< ::chart::GridProperties > const & i : rSource )
{
- Reference< beans::XPropertySet > xSubGrid( i );
- if( xSubGrid.is())
- {
- Reference< util::XCloneable > xCloneable( xSubGrid, uno::UNO_QUERY );
- if( xCloneable.is())
- xSubGrid.set( xCloneable->createClone(), uno::UNO_QUERY );
- }
-
- (*pDestIt) = xSubGrid;
- OSL_ASSERT( pDestIt != pDestEnd );
- ++pDestIt;
+ aDestination.push_back(new ::chart::GridProperties(*i));
}
- OSL_ASSERT( pDestIt == pDestEnd );
+ return aDestination;
}
} // anonymous namespace
@@ -322,7 +281,6 @@ namespace chart
{
Axis::Axis() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_aScaleData( AxisHelper::createDefaultScale() ),
m_xGrid( new GridProperties() )
@@ -342,22 +300,24 @@ Axis::Axis() :
Axis::Axis( const Axis & rOther ) :
impl::Axis_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_aScaleData( rOther.m_aScaleData )
{
- m_xGrid.set( CloneHelper::CreateRefClone< beans::XPropertySet >()( rOther.m_xGrid ));
+ if (rOther.m_xGrid)
+ m_xGrid = new ::chart::GridProperties(*rOther.m_xGrid);
if( m_xGrid.is())
ModifyListenerHelper::addListener( m_xGrid, m_xModifyEventForwarder );
if( m_aScaleData.Categories.is())
ModifyListenerHelper::addListener( m_aScaleData.Categories, m_xModifyEventForwarder );
- if( rOther.m_aSubGridProperties.hasElements() )
- lcl_CloneSubGrids( rOther.m_aSubGridProperties, m_aSubGridProperties );
- ModifyListenerHelper::addListenerToAllSequenceElements( m_aSubGridProperties, m_xModifyEventForwarder );
+ if( !rOther.m_aSubGridProperties.empty() )
+ m_aSubGridProperties = lcl_CloneSubGrids( rOther.m_aSubGridProperties );
+ ModifyListenerHelper::addListenerToAllElements( m_aSubGridProperties, m_xModifyEventForwarder );
- m_xTitle.set( CloneHelper::CreateRefClone< chart2::XTitle >()( rOther.m_xTitle ));
+ if ( rOther.m_xTitle )
+ m_xTitle = new Title( *rOther.m_xTitle );
if( m_xTitle.is())
ModifyListenerHelper::addListener( m_xTitle, m_xModifyEventForwarder );
}
@@ -374,12 +334,12 @@ Axis::~Axis()
try
{
ModifyListenerHelper::removeListener( m_xGrid, m_xModifyEventForwarder );
- ModifyListenerHelper::removeListenerFromAllSequenceElements( m_aSubGridProperties, m_xModifyEventForwarder );
+ ModifyListenerHelper::removeListenerFromAllElements( m_aSubGridProperties, m_xModifyEventForwarder );
ModifyListenerHelper::removeListener( m_xTitle, m_xModifyEventForwarder );
if( m_aScaleData.Categories.is())
{
ModifyListenerHelper::removeListener( m_aScaleData.Categories, m_xModifyEventForwarder );
- m_aScaleData.Categories.set(nullptr);
+ m_aScaleData.Categories.clear();
}
}
catch( const uno::Exception & )
@@ -387,41 +347,40 @@ Axis::~Axis()
DBG_UNHANDLED_EXCEPTION("chart2");
}
- m_aSubGridProperties.realloc(0);
+ m_aSubGridProperties.clear();
m_xGrid = nullptr;
m_xTitle = nullptr;
}
void Axis::AllocateSubGrids()
{
- Reference< util::XModifyListener > xModifyEventForwarder;
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
Reference< lang::XEventListener > xEventListener;
- std::vector< Reference< beans::XPropertySet > > aOldBroadcasters;
- std::vector< Reference< beans::XPropertySet > > aNewBroadcasters;
+ std::vector< rtl::Reference< GridProperties > > aOldBroadcasters;
+ std::vector< rtl::Reference< GridProperties > > aNewBroadcasters;
{
MutexGuard aGuard( m_aMutex );
xModifyEventForwarder = m_xModifyEventForwarder;
xEventListener = this;
sal_Int32 nNewSubIncCount = m_aScaleData.IncrementData.SubIncrements.getLength();
- sal_Int32 nOldSubIncCount = m_aSubGridProperties.getLength();
+ sal_Int32 nOldSubIncCount = m_aSubGridProperties.size();
if( nOldSubIncCount > nNewSubIncCount )
{
// remove superfluous entries
for( sal_Int32 i = nNewSubIncCount; i < nOldSubIncCount; ++i )
aOldBroadcasters.push_back( m_aSubGridProperties[ i ] );
- m_aSubGridProperties.realloc( nNewSubIncCount );
+ m_aSubGridProperties.resize( nNewSubIncCount );
}
else if( nOldSubIncCount < nNewSubIncCount )
{
- m_aSubGridProperties.realloc( nNewSubIncCount );
- auto pSubGridProperties = m_aSubGridProperties.getArray();
+ m_aSubGridProperties.resize( nNewSubIncCount );
// allocate new entries
for( sal_Int32 i = nOldSubIncCount; i < nNewSubIncCount; ++i )
{
- pSubGridProperties[ i ] = new GridProperties();
+ m_aSubGridProperties[ i ] = new GridProperties();
LinePropertiesHelper::SetLineInvisible( m_aSubGridProperties[ i ] );
LinePropertiesHelper::SetLineColor( m_aSubGridProperties[ i ], static_cast<sal_Int32>(0xdddddd) ); //gray2
aNewBroadcasters.push_back( m_aSubGridProperties[ i ] );
@@ -438,7 +397,7 @@ void Axis::AllocateSubGrids()
// ____ XAxis ____
void SAL_CALL Axis::setScaleData( const chart2::ScaleData& rScaleData )
{
- Reference< util::XModifyListener > xModifyEventForwarder;
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
Reference< lang::XEventListener > xEventListener;
Reference< chart2::data::XLabeledDataSequence > xOldCategories;
Reference< chart2::data::XLabeledDataSequence > xNewCategories = rScaleData.Categories;
@@ -476,9 +435,20 @@ Reference< beans::XPropertySet > SAL_CALL Axis::getGridProperties()
MutexGuard aGuard( m_aMutex );
return m_xGrid;
}
+rtl::Reference< ::chart::GridProperties > Axis::getGridProperties2()
+{
+ MutexGuard aGuard( m_aMutex );
+ return m_xGrid;
+}
Sequence< Reference< beans::XPropertySet > > SAL_CALL Axis::getSubGridProperties()
{
MutexGuard aGuard( m_aMutex );
+ return comphelper::containerToSequence<Reference< beans::XPropertySet >>(m_aSubGridProperties);
+}
+
+std::vector< rtl::Reference< GridProperties > > Axis::getSubGridProperties2()
+{
+ MutexGuard aGuard( m_aMutex );
return m_aSubGridProperties;
}
@@ -495,10 +465,23 @@ Reference< chart2::XTitle > SAL_CALL Axis::getTitleObject()
return m_xTitle;
}
+rtl::Reference< Title > Axis::getTitleObject2() const
+{
+ MutexGuard aGuard( m_aMutex );
+ return m_xTitle;
+}
+
void SAL_CALL Axis::setTitleObject( const Reference< chart2::XTitle >& xNewTitle )
{
- Reference< util::XModifyListener > xModifyEventForwarder;
- Reference< chart2::XTitle > xOldTitle;
+ rtl::Reference<Title> xTitle = dynamic_cast<Title*>(xNewTitle.get());
+ assert(!xNewTitle || xTitle);
+ setTitleObject(xTitle);
+}
+
+void Axis::setTitleObject( const rtl::Reference< Title >& xNewTitle )
+{
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
+ rtl::Reference< Title > xOldTitle;
{
MutexGuard aGuard( m_aMutex );
xOldTitle = m_xTitle;
@@ -561,7 +544,7 @@ void Axis::fireModifyEvent()
// ____ OPropertySet ____
void Axis::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticAxisDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticAxisDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -571,13 +554,15 @@ void Axis::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL Axis::getInfoHelper()
{
- return *StaticAxisInfoHelper::get();
+ return StaticAxisInfoHelper();
}
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL Axis::getPropertySetInfo()
{
- return *StaticAxisInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticAxisInfoHelper() ) );
+ return xPropertySetInfo;
}
using impl::Axis_Base;
@@ -588,7 +573,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( Axis, Axis_Base, ::property::OPropertySet )
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
OUString SAL_CALL Axis::getImplementationName()
{
- return "com.sun.star.comp.chart2.Axis";
+ return u"com.sun.star.comp.chart2.Axis"_ustr;
}
sal_Bool SAL_CALL Axis::supportsService( const OUString& rServiceName )
@@ -599,8 +584,8 @@ sal_Bool SAL_CALL Axis::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL Axis::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.Axis",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.Axis"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx
index 3729c32bd281..607c04af0073 100644
--- a/chart2/source/model/main/BaseCoordinateSystem.cxx
+++ b/chart2/source/model/main/BaseCoordinateSystem.cxx
@@ -22,12 +22,14 @@
#include <UserDefinedProperties.hxx>
#include <CloneHelper.hxx>
#include <ModifyListenerHelper.hxx>
-#include "Axis.hxx"
+#include <Axis.hxx>
+#include <ChartType.hxx>
+#include <ExplicitCategoriesProvider.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <o3tl/safeint.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
@@ -55,58 +57,31 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID );
}
-struct StaticCooSysDefaults_Initializer
+const ::chart::tPropertyValueMap & StaticCooSysDefaults()
{
- ::chart::tPropertyValueMap* operator()()
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
{
- static ::chart::tPropertyValueMap aStaticDefaults;
- ::chart::PropertyHelper::setPropertyValueDefault( aStaticDefaults, PROP_COORDINATESYSTEM_SWAPXANDYAXIS, false );
- return &aStaticDefaults;
- }
-};
-
-struct StaticCooSysDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticCooSysDefaults_Initializer >
-{
-};
-
-struct StaticCooSysInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
+ ::chart::tPropertyValueMap aMap;
+ ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_COORDINATESYSTEM_SWAPXANDYAXIS, false );
+ return aMap;
+ }();
+ return aStaticDefaults;
};
-struct StaticCooSysInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticCooSysInfoHelper_Initializer >
+::cppu::OPropertyArrayHelper& StaticCooSysInfoHelper()
{
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-struct StaticCooSysInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticCooSysInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticCooSysInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticCooSysInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -116,7 +91,6 @@ namespace chart
BaseCoordinateSystem::BaseCoordinateSystem(
sal_Int32 nDimensionCount /* = 2 */ ) :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_nDimensionCount( nDimensionCount )
{
@@ -124,7 +98,7 @@ BaseCoordinateSystem::BaseCoordinateSystem(
for( sal_Int32 nN=0; nN<m_nDimensionCount; nN++ )
{
m_aAllAxis[nN].resize( 1 );
- Reference< chart2::XAxis > xAxis( new Axis );
+ rtl::Reference< Axis > xAxis( new Axis );
m_aAllAxis[nN][0] = xAxis;
ModifyListenerHelper::addListenerToAllElements( m_aAllAxis[nN], m_xModifyEventForwarder );
@@ -151,19 +125,21 @@ BaseCoordinateSystem::BaseCoordinateSystem(
BaseCoordinateSystem::BaseCoordinateSystem(
const BaseCoordinateSystem & rSource ) :
impl::BaseCoordinateSystem_Base(rSource),
- ::property::OPropertySet( rSource, m_aMutex ),
+ ::property::OPropertySet( rSource ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_nDimensionCount( rSource.m_nDimensionCount )
{
m_aAllAxis.resize(rSource.m_aAllAxis.size());
tAxisVecVecType::size_type nN=0;
for( nN=0; nN<m_aAllAxis.size(); nN++ )
- CloneHelper::CloneRefVector<chart2::XAxis>( rSource.m_aAllAxis[nN], m_aAllAxis[nN] );
- CloneHelper::CloneRefVector<chart2::XChartType>( rSource.m_aChartTypes, m_aChartTypes );
+ CloneHelper::CloneRefVector( rSource.m_aAllAxis[nN], m_aAllAxis[nN] );
+ for (const auto & rxChartType : rSource.m_aChartTypes)
+ m_aChartTypes.push_back(rxChartType->cloneChartType());
for( nN=0; nN<m_aAllAxis.size(); nN++ )
ModifyListenerHelper::addListenerToAllElements( m_aAllAxis[nN], m_xModifyEventForwarder );
- ModifyListenerHelper::addListenerToAllElements( m_aChartTypes, m_xModifyEventForwarder );
+ for (const auto & rxChartType : m_aChartTypes)
+ rxChartType->addModifyListener( m_xModifyEventForwarder );
}
BaseCoordinateSystem::~BaseCoordinateSystem()
@@ -172,7 +148,8 @@ BaseCoordinateSystem::~BaseCoordinateSystem()
{
for(const tAxisVecVecType::value_type & i : m_aAllAxis)
ModifyListenerHelper::removeListenerFromAllElements( i, m_xModifyEventForwarder );
- ModifyListenerHelper::removeListenerFromAllElements( m_aChartTypes, m_xModifyEventForwarder );
+ for (const auto & rxChartType : m_aChartTypes)
+ rxChartType->removeModifyListener( m_xModifyEventForwarder );
}
catch( const uno::Exception & )
{
@@ -197,13 +174,41 @@ void SAL_CALL BaseCoordinateSystem::setAxisByDimension(
if( nIndex < 0 )
throw lang::IndexOutOfBoundsException();
+ assert(!xAxis || dynamic_cast<Axis*>(xAxis.get()));
+
if( m_aAllAxis[ nDimensionIndex ].size() < o3tl::make_unsigned( nIndex+1 ))
{
m_aAllAxis[ nDimensionIndex ].resize( nIndex+1 );
m_aAllAxis[ nDimensionIndex ][nIndex] = nullptr;
}
- Reference< chart2::XAxis > xOldAxis( m_aAllAxis[ nDimensionIndex ][nIndex] );
+ rtl::Reference< Axis > xOldAxis( m_aAllAxis[ nDimensionIndex ][nIndex] );
+ if( xOldAxis.is())
+ ModifyListenerHelper::removeListener( xOldAxis, m_xModifyEventForwarder );
+ m_aAllAxis[ nDimensionIndex ][nIndex] = dynamic_cast<Axis*>(xAxis.get());
+ if( xAxis.is())
+ ModifyListenerHelper::addListener( xAxis, m_xModifyEventForwarder );
+ fireModifyEvent();
+}
+
+void BaseCoordinateSystem::setAxisByDimension(
+ sal_Int32 nDimensionIndex,
+ const rtl::Reference< Axis >& xAxis,
+ sal_Int32 nIndex )
+{
+ if( nDimensionIndex < 0 || nDimensionIndex >= getDimension() )
+ throw lang::IndexOutOfBoundsException();
+
+ if( nIndex < 0 )
+ throw lang::IndexOutOfBoundsException();
+
+ if( m_aAllAxis[ nDimensionIndex ].size() < o3tl::make_unsigned( nIndex+1 ))
+ {
+ m_aAllAxis[ nDimensionIndex ].resize( nIndex+1 );
+ m_aAllAxis[ nDimensionIndex ][nIndex] = nullptr;
+ }
+
+ rtl::Reference< Axis > xOldAxis( m_aAllAxis[ nDimensionIndex ][nIndex] );
if( xOldAxis.is())
ModifyListenerHelper::removeListener( xOldAxis, m_xModifyEventForwarder );
m_aAllAxis[ nDimensionIndex ][nIndex] = xAxis;
@@ -226,6 +231,20 @@ Reference< chart2::XAxis > SAL_CALL BaseCoordinateSystem::getAxisByDimension(
return m_aAllAxis[ nDimensionIndex ][nAxisIndex];
}
+const rtl::Reference< Axis > & BaseCoordinateSystem::getAxisByDimension2(
+ sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
+{
+ if( nDimensionIndex < 0 || nDimensionIndex >= m_nDimensionCount )
+ throw lang::IndexOutOfBoundsException();
+
+ OSL_ASSERT( m_aAllAxis.size() == static_cast< size_t >( m_nDimensionCount));
+
+ if( nAxisIndex < 0 || o3tl::make_unsigned(nAxisIndex) > m_aAllAxis[ nDimensionIndex ].size() )
+ throw lang::IndexOutOfBoundsException();
+
+ return m_aAllAxis[ nDimensionIndex ][nAxisIndex];
+}
+
sal_Int32 SAL_CALL BaseCoordinateSystem::getMaximumAxisIndexByDimension( sal_Int32 nDimensionIndex )
{
if( nDimensionIndex < 0 || nDimensionIndex >= getDimension() )
@@ -243,22 +262,26 @@ sal_Int32 SAL_CALL BaseCoordinateSystem::getMaximumAxisIndexByDimension( sal_Int
// ____ XChartTypeContainer ____
void SAL_CALL BaseCoordinateSystem::addChartType( const Reference< chart2::XChartType >& aChartType )
{
- if( std::find( m_aChartTypes.begin(), m_aChartTypes.end(), aChartType )
+ auto pChartType = dynamic_cast<ChartType*>(aChartType.get());
+ assert(pChartType);
+
+ if( std::find( m_aChartTypes.begin(), m_aChartTypes.end(), pChartType )
!= m_aChartTypes.end())
- throw lang::IllegalArgumentException("type not found", static_cast<cppu::OWeakObject*>(this), 1);
+ throw lang::IllegalArgumentException(u"type not found"_ustr, static_cast<cppu::OWeakObject*>(this), 1);
- m_aChartTypes.push_back( aChartType );
+ m_aChartTypes.push_back( pChartType );
ModifyListenerHelper::addListener( aChartType, m_xModifyEventForwarder );
fireModifyEvent();
}
void SAL_CALL BaseCoordinateSystem::removeChartType( const Reference< chart2::XChartType >& aChartType )
{
- std::vector< uno::Reference< chart2::XChartType > >::iterator
- aIt( std::find( m_aChartTypes.begin(), m_aChartTypes.end(), aChartType ));
+ auto pChartType = dynamic_cast<ChartType*>(aChartType.get());
+ assert(pChartType);
+ auto aIt( std::find( m_aChartTypes.begin(), m_aChartTypes.end(), pChartType ));
if( aIt == m_aChartTypes.end())
throw container::NoSuchElementException(
- "The given chart type is no element of the container",
+ u"The given chart type is no element of the container"_ustr,
static_cast< uno::XWeak * >( this ));
m_aChartTypes.erase( aIt );
@@ -268,17 +291,41 @@ void SAL_CALL BaseCoordinateSystem::removeChartType( const Reference< chart2::XC
Sequence< Reference< chart2::XChartType > > SAL_CALL BaseCoordinateSystem::getChartTypes()
{
- return comphelper::containerToSequence( m_aChartTypes );
+ return comphelper::containerToSequence< Reference< chart2::XChartType > >( m_aChartTypes );
}
void SAL_CALL BaseCoordinateSystem::setChartTypes( const Sequence< Reference< chart2::XChartType > >& aChartTypes )
{
- ModifyListenerHelper::removeListenerFromAllElements( m_aChartTypes, m_xModifyEventForwarder );
- m_aChartTypes = comphelper::sequenceToContainer<std::vector< css::uno::Reference< css::chart2::XChartType > >>( aChartTypes );
- ModifyListenerHelper::addListenerToAllElements( m_aChartTypes, m_xModifyEventForwarder );
+ for (auto const & aChartType : m_aChartTypes)
+ aChartType->removeModifyListener( m_xModifyEventForwarder );
+ m_aChartTypes.clear();
+ for (auto const & aChartType : aChartTypes)
+ {
+ auto pChartType = dynamic_cast<ChartType*>(aChartType.get());
+ assert(pChartType);
+ m_aChartTypes.push_back(pChartType);
+ pChartType->addModifyListener( m_xModifyEventForwarder );
+ }
fireModifyEvent();
}
+void BaseCoordinateSystem::setChartTypes( const std::vector< rtl::Reference< ChartType > >& aChartTypes )
+{
+ for (auto const & aChartType : m_aChartTypes)
+ aChartType->removeModifyListener( m_xModifyEventForwarder );
+ m_aChartTypes = aChartTypes;
+ for (auto const & aChartType : m_aChartTypes)
+ aChartType->addModifyListener( m_xModifyEventForwarder );
+ fireModifyEvent();
+}
+
+ExplicitCategoriesProvider& BaseCoordinateSystem::getExplicitCategoriesProvider(ChartModel& rModel)
+{
+ if (!mxExplicitCategoriesProvider)
+ mxExplicitCategoriesProvider = std::make_unique<ExplicitCategoriesProvider>(this, rModel);
+ return *mxExplicitCategoriesProvider;
+}
+
// ____ XModifyBroadcaster ____
void SAL_CALL BaseCoordinateSystem::addModifyListener( const Reference< util::XModifyListener >& aListener )
{
@@ -316,7 +363,7 @@ void BaseCoordinateSystem::fireModifyEvent()
// ____ OPropertySet ____
void BaseCoordinateSystem::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticCooSysDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticCooSysDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -327,13 +374,15 @@ void BaseCoordinateSystem::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL BaseCoordinateSystem::getInfoHelper()
{
- return *StaticCooSysInfoHelper::get();
+ return StaticCooSysInfoHelper();
}
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL BaseCoordinateSystem::getPropertySetInfo()
{
- return *StaticCooSysInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticCooSysInfoHelper() ) );
+ return xPropertySetInfo;
}
using impl::BaseCoordinateSystem_Base;
diff --git a/chart2/source/model/main/CartesianCoordinateSystem.cxx b/chart2/source/model/main/CartesianCoordinateSystem.cxx
index c65adee25829..a655ee14aa7a 100644
--- a/chart2/source/model/main/CartesianCoordinateSystem.cxx
+++ b/chart2/source/model/main/CartesianCoordinateSystem.cxx
@@ -31,7 +31,7 @@ namespace com::sun::star::uno { class XComponentContext; }
namespace
{
-constexpr OUStringLiteral CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.Cartesian";
+constexpr OUString CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.Cartesian"_ustr;
}
@@ -72,7 +72,7 @@ uno::Reference< util::XCloneable > SAL_CALL CartesianCoordinateSystem::createClo
// ____ XServiceInfo ____
OUString SAL_CALL CartesianCoordinateSystem::getImplementationName()
{
- return "com.sun.star.comp.chart.CartesianCoordinateSystem";
+ return u"com.sun.star.comp.chart.CartesianCoordinateSystem"_ustr;
}
sal_Bool SAL_CALL CartesianCoordinateSystem::supportsService( const OUString& rServiceName )
@@ -97,7 +97,7 @@ CartesianCoordinateSystem2d::~CartesianCoordinateSystem2d()
// ____ XServiceInfo ____
OUString SAL_CALL CartesianCoordinateSystem2d::getImplementationName()
{
- return "com.sun.star.comp.chart2.CartesianCoordinateSystem2d";
+ return u"com.sun.star.comp.chart2.CartesianCoordinateSystem2d"_ustr;
}
sal_Bool SAL_CALL CartesianCoordinateSystem2d::supportsService( const OUString& rServiceName )
@@ -109,7 +109,7 @@ css::uno::Sequence< OUString > SAL_CALL CartesianCoordinateSystem2d::getSupporte
{
return {
CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME,
- "com.sun.star.chart2.CartesianCoordinateSystem2d"
+ u"com.sun.star.chart2.CartesianCoordinateSystem2d"_ustr
};
}
@@ -125,7 +125,7 @@ CartesianCoordinateSystem3d::~CartesianCoordinateSystem3d()
// ____ XServiceInfo ____
OUString SAL_CALL CartesianCoordinateSystem3d::getImplementationName()
{
- return "com.sun.star.comp.chart2.CartesianCoordinateSystem3d";
+ return u"com.sun.star.comp.chart2.CartesianCoordinateSystem3d"_ustr;
}
sal_Bool SAL_CALL CartesianCoordinateSystem3d::supportsService( const OUString& rServiceName )
@@ -137,7 +137,7 @@ css::uno::Sequence< OUString > SAL_CALL CartesianCoordinateSystem3d::getSupporte
{
return {
CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME,
- "com.sun.star.chart2.CartesianCoordinateSystem3d"
+ u"com.sun.star.chart2.CartesianCoordinateSystem3d"_ustr
};
}
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index b05db28661dd..ee6c483a09e6 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -19,21 +19,29 @@
#include <ChartModel.hxx>
#include <ChartTypeManager.hxx>
+#include <ChartTypeTemplate.hxx>
#include <servicenames.hxx>
+#include <DataSource.hxx>
#include <DataSourceHelper.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
#include <DisposeHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <InternalDataProvider.hxx>
#include <ObjectIdentifier.hxx>
+#include <BaseCoordinateSystem.hxx>
#include "PageBackground.hxx"
#include <CloneHelper.hxx>
#include <NameContainer.hxx>
#include "UndoManager.hxx"
+
+#include <ChartColorPaletteHelper.hxx>
#include <ChartView.hxx>
#include <PopupRequest.hxx>
#include <ModifyListenerHelper.hxx>
+#include <RangeHighlighter.hxx>
#include <Diagram.hxx>
+#include <ChartDocumentWrapper.hxx>
+#include <comphelper/dumpxmltostring.hxx>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp>
@@ -45,22 +53,30 @@
#include <svl/numformat.hxx>
#include <svl/numuno.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/embed/EmbedMapUnits.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/document/DocumentProperties.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/util/CloseVetoException.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
-#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
#include <sal/log.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
#include <libxml/xmlwriter.h>
+#include <sfx2/objsh.hxx>
+#include <com/sun/star/util/XTheme.hpp>
+#include <docmodel/uno/UnoTheme.hxx>
+#include <docmodel/theme/Theme.hxx>
+
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
@@ -68,14 +84,13 @@ using ::osl::MutexGuard;
using namespace ::com::sun::star;
using namespace ::apphelper;
-using namespace ::chart::CloneHelper;
namespace
{
-constexpr OUStringLiteral lcl_aGDIMetaFileMIMEType(
- u"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"");
-constexpr OUStringLiteral lcl_aGDIMetaFileMIMETypeHighContrast(
- u"application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"");
+constexpr OUString lcl_aGDIMetaFileMIMEType(
+ u"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\""_ustr);
+constexpr OUString lcl_aGDIMetaFileMIMETypeHighContrast(
+ u"application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\""_ustr);
} // anonymous namespace
@@ -84,7 +99,20 @@ constexpr OUStringLiteral lcl_aGDIMetaFileMIMETypeHighContrast(
namespace chart
{
-ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
+namespace
+{
+SfxObjectShell* getParentShell(const uno::Reference<frame::XModel>& xDocModel)
+{
+ uno::Reference<lang::XUnoTunnel> xUnoTunnel(xDocModel, uno::UNO_QUERY);
+ if (xUnoTunnel.is())
+ {
+ return comphelper::getFromUnoTunnel<SfxObjectShell>(xUnoTunnel);
+ }
+ return nullptr;
+}
+}
+
+ChartModel::ChartModel(uno::Reference<uno::XComponentContext > xContext)
: m_aLifeTimeManager( this, this )
, m_bReadOnly( false )
, m_bModified( false )
@@ -93,19 +121,18 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
, mbTimeBased(false)
, m_aControllers( m_aModelMutex )
, m_nControllerLockCount(0)
- , m_xContext( xContext )
- , m_aVisualAreaSize( ChartModelHelper::getDefaultPageSize() )
+ , m_xContext(std::move( xContext ))
+ , m_aVisualAreaSize( ChartModel::getDefaultPageSize() )
, m_xPageBackground( new PageBackground )
, m_xXMLNamespaceMap( new NameContainer() )
+ , m_eColorPaletteType(ChartColorPaletteType::Unknown)
+ , m_nColorPaletteIndex(0)
, mnStart(0)
, mnEnd(0)
{
osl_atomic_increment(&m_refCount);
{
- m_xOldModelAgg.set(
- m_xContext->getServiceManager()->createInstanceWithContext(
- CHART_CHARTAPIWRAPPER_SERVICE_NAME,
- m_xContext ), uno::UNO_QUERY_THROW );
+ m_xOldModelAgg = new wrapper::ChartDocumentWrapper(m_xContext);
m_xOldModelAgg->setDelegator( *this );
}
@@ -118,6 +145,8 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
ChartModel::ChartModel( const ChartModel & rOther )
: impl::ChartModel_Base(rOther)
+ // not copy the listener
+ , SfxListener()
, m_aLifeTimeManager( this, this )
, m_bReadOnly( rOther.m_bReadOnly )
, m_bModified( rOther.m_bModified )
@@ -137,32 +166,38 @@ ChartModel::ChartModel( const ChartModel & rOther )
, m_aGraphicObjectVector( rOther.m_aGraphicObjectVector )
, m_xDataProvider( rOther.m_xDataProvider )
, m_xInternalDataProvider( rOther.m_xInternalDataProvider )
+ , m_eColorPaletteType(ChartColorPaletteType::Unknown)
+ , m_nColorPaletteIndex(0)
, mnStart(rOther.mnStart)
, mnEnd(rOther.mnEnd)
{
osl_atomic_increment(&m_refCount);
{
- m_xOldModelAgg.set(
- m_xContext->getServiceManager()->createInstanceWithContext(
- CHART_CHARTAPIWRAPPER_SERVICE_NAME,
- m_xContext ), uno::UNO_QUERY_THROW );
+ m_xOldModelAgg = new wrapper::ChartDocumentWrapper(m_xContext);
m_xOldModelAgg->setDelegator( *this );
Reference< util::XModifyListener > xListener;
- Reference< chart2::XTitle > xNewTitle = CreateRefClone< chart2::XTitle >()( rOther.m_xTitle );
- rtl::Reference< ::chart::Diagram > xNewDiagram = new ::chart::Diagram( *rOther.m_xDiagram );
+ rtl::Reference< Title > xNewTitle;
+ if ( rOther.m_xTitle )
+ xNewTitle = new Title(*rOther.m_xTitle);
+ rtl::Reference< ::chart::Diagram > xNewDiagram;
+ if (rOther.m_xDiagram.is())
+ xNewDiagram = new ::chart::Diagram( *rOther.m_xDiagram );
rtl::Reference< ::chart::PageBackground > xNewPageBackground = new PageBackground( *rOther.m_xPageBackground );
- rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager; // does not implement XCloneable
- rtl::Reference< ::chart::NameContainer > xXMLNamespaceMap = new NameContainer( *rOther.m_xXMLNamespaceMap );
{
- MutexGuard aGuard( m_aModelMutex );
- xListener = this;
- m_xTitle = xNewTitle;
- m_xDiagram = xNewDiagram;
- m_xPageBackground = xNewPageBackground;
- m_xChartTypeManager = xChartTypeManager;
- m_xXMLNamespaceMap = xXMLNamespaceMap;
+ rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager; // does not implement XCloneable
+ rtl::Reference< ::chart::NameContainer > xXMLNamespaceMap = new NameContainer( *rOther.m_xXMLNamespaceMap );
+
+ {
+ MutexGuard aGuard( m_aModelMutex );
+ xListener = this;
+ m_xTitle = xNewTitle;
+ m_xDiagram = xNewDiagram;
+ m_xPageBackground = xNewPageBackground;
+ m_xChartTypeManager = std::move(xChartTypeManager);
+ m_xXMLNamespaceMap = std::move(xXMLNamespaceMap);
+ }
}
ModifyListenerHelper::addListener( xNewTitle, xListener );
@@ -177,6 +212,8 @@ ChartModel::ChartModel( const ChartModel & rOther )
ChartModel::~ChartModel()
{
+ if (SfxObjectShell* pShell = getParentShell(m_xParent))
+ EndListening(*pShell);
if( m_xOldModelAgg.is())
m_xOldModelAgg->setDelegator( nullptr );
}
@@ -246,16 +283,11 @@ uno::Reference< frame::XController > ChartModel::impl_getCurrentController()
void ChartModel::impl_notifyCloseListeners()
{
- ::comphelper::OInterfaceContainerHelper2* pIC = m_aLifeTimeManager.m_aListenerContainer
- .getContainer( cppu::UnoType<util::XCloseListener>::get());
- if( pIC )
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ if( m_aLifeTimeManager.m_aCloseListeners.getLength(aGuard) )
{
lang::EventObject aEvent( static_cast< lang::XComponent*>(this) );
- ::comphelper::OInterfaceIteratorHelper2 aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- static_cast< util::XCloseListener* >( aIt.next() )->notifyClosing( aEvent );
- }
+ m_aLifeTimeManager.m_aCloseListeners.notifyEach(aGuard, &util::XCloseListener::notifyClosing, aEvent);
}
}
@@ -266,7 +298,7 @@ void ChartModel::impl_adjustAdditionalShapesPositionAndSize( const awt::Size& aV
return;
uno::Reference< drawing::XShapes > xShapes;
- xProperties->getPropertyValue( "AdditionalShapes" ) >>= xShapes;
+ xProperties->getPropertyValue( u"AdditionalShapes"_ustr ) >>= xShapes;
if ( !xShapes.is() )
return;
@@ -300,7 +332,7 @@ void ChartModel::impl_adjustAdditionalShapesPositionAndSize( const awt::Size& aV
OUString SAL_CALL ChartModel::getImplementationName()
{
- return CHART_MODEL_SERVICE_IMPLEMENTATION_NAME;
+ return u"com.sun.star.comp.chart2.ChartModel"_ustr;
}
sal_Bool SAL_CALL ChartModel::supportsService( const OUString& rServiceName )
@@ -311,9 +343,9 @@ sal_Bool SAL_CALL ChartModel::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL ChartModel::getSupportedServiceNames()
{
return {
- CHART_MODEL_SERVICE_NAME,
- "com.sun.star.document.OfficeDocument",
- "com.sun.star.chart.ChartDocument"
+ u"com.sun.star.chart2.ChartDocument"_ustr,
+ u"com.sun.star.document.OfficeDocument"_ustr,
+ u"com.sun.star.chart.ChartDocument"_ustr
};
}
@@ -393,7 +425,11 @@ void SAL_CALL ChartModel::disconnectController( const uno::Reference< frame::XCo
if( m_xCurrentController == xController )
m_xCurrentController.clear();
- DisposeHelper::DisposeAndClear( m_xRangeHighlighter );
+ if (m_xRangeHighlighter)
+ {
+ m_xRangeHighlighter->dispose();
+ m_xRangeHighlighter.clear();
+ }
DisposeHelper::DisposeAndClear(m_xPopupRequest);
}
@@ -456,7 +492,7 @@ uno::Reference< frame::XController > SAL_CALL ChartModel::getCurrentController()
LifeTimeGuard aGuard(m_aLifeTimeManager);
if(!aGuard.startApiCall())
throw lang::DisposedException(
- "getCurrentController was called on an already disposed or closed model",
+ u"getCurrentController was called on an already disposed or closed model"_ustr,
static_cast< ::cppu::OWeakObject* >(this) );
return impl_getCurrentController();
@@ -467,18 +503,22 @@ void SAL_CALL ChartModel::setCurrentController( const uno::Reference< frame::XCo
LifeTimeGuard aGuard(m_aLifeTimeManager);
if(!aGuard.startApiCall())
throw lang::DisposedException(
- "setCurrentController was called on an already disposed or closed model",
+ u"setCurrentController was called on an already disposed or closed model"_ustr,
static_cast< ::cppu::OWeakObject* >(this) );
//OSL_ENSURE( impl_isControllerConnected(xController), "setCurrentController is called with a Controller which is not connected" );
if(!impl_isControllerConnected(xController))
throw container::NoSuchElementException(
- "setCurrentController is called with a Controller which is not connected",
+ u"setCurrentController is called with a Controller which is not connected"_ustr,
static_cast< ::cppu::OWeakObject* >(this) );
m_xCurrentController = xController;
- DisposeHelper::DisposeAndClear( m_xRangeHighlighter );
+ if (m_xRangeHighlighter)
+ {
+ m_xRangeHighlighter->dispose();
+ m_xRangeHighlighter.clear();
+ }
DisposeHelper::DisposeAndClear(m_xPopupRequest);
}
@@ -487,7 +527,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartModel::getCurrentSelection()
LifeTimeGuard aGuard(m_aLifeTimeManager);
if(!aGuard.startApiCall())
throw lang::DisposedException(
- "getCurrentSelection was called on an already disposed or closed model",
+ u"getCurrentSelection was called on an already disposed or closed model"_ustr,
static_cast< ::cppu::OWeakObject* >(this) );
uno::Reference< uno::XInterface > xReturn;
@@ -502,7 +542,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartModel::getCurrentSelection()
uno::Any aSel = xSelectionSupl->getSelection();
OUString aObjectCID;
if( aSel >>= aObjectCID )
- xReturn.set( ObjectIdentifier::getObjectPropertySet( aObjectCID, Reference< XChartDocument >(this)));
+ xReturn.set( ObjectIdentifier::getObjectPropertySet( aObjectCID, this));
}
}
return xReturn;
@@ -541,7 +581,7 @@ void SAL_CALL ChartModel::dispose()
m_xOwnNumberFormatsSupplier.clear();
m_xChartTypeManager.clear();
m_xDiagram.clear();
- DisposeHelper::DisposeAndClear( m_xTitle );
+ m_xTitle.clear();
m_xPageBackground.clear();
m_xXMLNamespaceMap.clear();
@@ -559,7 +599,11 @@ void SAL_CALL ChartModel::dispose()
m_aControllers.disposeAndClear( lang::EventObject( static_cast< cppu::OWeakObject * >( this )));
m_xCurrentController.clear();
- DisposeHelper::DisposeAndClear( m_xRangeHighlighter );
+ if (m_xRangeHighlighter)
+ {
+ m_xRangeHighlighter->dispose();
+ m_xRangeHighlighter.clear();
+ }
DisposeHelper::DisposeAndClear(m_xPopupRequest);
if( m_xOldModelAgg.is())
@@ -571,7 +615,8 @@ void SAL_CALL ChartModel::addEventListener( const uno::Reference< lang::XEventLi
if( m_aLifeTimeManager.impl_isDisposedOrClosed() )
return; //behave passive if already disposed or closed
- m_aLifeTimeManager.m_aListenerContainer.addInterface( cppu::UnoType<lang::XEventListener>::get(), xListener );
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aEventListeners.addInterface( aGuard, xListener );
}
void SAL_CALL ChartModel::removeEventListener( const uno::Reference< lang::XEventListener > & xListener )
@@ -579,7 +624,8 @@ void SAL_CALL ChartModel::removeEventListener( const uno::Reference< lang::XEven
if( m_aLifeTimeManager.impl_isDisposedOrClosed(false) )
return; //behave passive if already disposed or closed
- m_aLifeTimeManager.m_aListenerContainer.removeInterface( cppu::UnoType<lang::XEventListener>::get(), xListener );
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aEventListeners.removeInterface( aGuard, xListener );
}
// util::XCloseBroadcaster (base of XCloseable)
@@ -593,7 +639,8 @@ void SAL_CALL ChartModel::removeCloseListener( const uno::Reference< util::XClos
if( m_aLifeTimeManager.impl_isDisposedOrClosed(false) )
return; //behave passive if already disposed or closed
- m_aLifeTimeManager.m_aListenerContainer.removeInterface( cppu::UnoType<util::XCloseListener>::get(), xListener );
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aCloseListeners.removeInterface( aGuard, xListener );
}
// util::XCloseable
@@ -614,7 +661,7 @@ void SAL_CALL ChartModel::close( sal_Bool bDeliverOwnership )
//check whether we self can close
{
util::CloseVetoException aVetoException(
- "the model itself could not be closed",
+ u"the model itself could not be closed"_ustr,
static_cast< ::cppu::OWeakObject* >(this) );
m_aLifeTimeManager.g_close_isNeedToCancelLongLastingCalls( bDeliverOwnership, aVetoException );
@@ -696,13 +743,13 @@ Reference< chart2::data::XDataSource > ChartModel::impl_createDefaultData()
{
//init internal dataprovider
{
- beans::NamedValue aParam( "CreateDefaultData" ,uno::Any(true) );
+ beans::NamedValue aParam( u"CreateDefaultData"_ustr ,uno::Any(true) );
uno::Sequence< uno::Any > aArgs{ uno::Any(aParam) };
m_xInternalDataProvider->initialize(aArgs);
}
//create data
uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
- { "CellRangeRepresentation", uno::Any( OUString("all") ) },
+ { "CellRangeRepresentation", uno::Any( u"all"_ustr ) },
{ "HasCategories", uno::Any( true ) },
{ "FirstCellAsLabel", uno::Any( true ) },
{ "DataRowSource", uno::Any( css::chart::ChartDataRowSource_COLUMNS ) }
@@ -721,9 +768,12 @@ void SAL_CALL ChartModel::createInternalDataProvider( sal_Bool bCloneExistingDat
if( !hasInternalDataProvider() )
{
if( bCloneExistingData )
- m_xInternalDataProvider = ChartModelHelper::createInternalDataProvider( this, true );
+ m_xInternalDataProvider = new InternalDataProvider( this, /*bConnectToModel*/true, /*bDefaultDataInColumns*/ true );
else
- m_xInternalDataProvider = ChartModelHelper::createInternalDataProvider( Reference<XChartDocument>(), true );
+ {
+ m_xInternalDataProvider = new InternalDataProvider( nullptr, /*bConnectToModel*/true, /*bDefaultDataInColumns*/ true );
+ m_xInternalDataProvider->setChartModel(this);
+ }
m_xDataProvider.set( m_xInternalDataProvider );
}
setModified( true );
@@ -772,8 +822,8 @@ void SAL_CALL ChartModel::attachDataProvider( const uno::Reference< chart2::data
{
try
{
- bool bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( Reference< frame::XModel >(this) );
- xProp->setPropertyValue("IncludeHiddenCells", uno::Any(bIncludeHiddenCells));
+ bool bIncludeHiddenCells = isIncludeHiddenCells();
+ xProp->setPropertyValue(u"IncludeHiddenCells"_ustr, uno::Any(bIncludeHiddenCells));
}
catch (const beans::UnknownPropertyException&)
{
@@ -797,6 +847,7 @@ void SAL_CALL ChartModel::attachDataProvider( const uno::Reference< chart2::data
void SAL_CALL ChartModel::attachNumberFormatsSupplier( const uno::Reference< util::XNumberFormatsSupplier >& xNewSupplier )
{
{
+ // Mostly the supplier is SvNumberFormatsSupplierObj, but sometimes it is reportdesign::OReportDefinition
MutexGuard aGuard( m_aModelMutex );
if( xNewSupplier == m_xNumberFormatsSupplier )
return;
@@ -836,10 +887,10 @@ void SAL_CALL ChartModel::setArguments( const Sequence< beans::PropertyValue >&
Reference< chart2::data::XDataSource > xDataSource( m_xDataProvider->createDataSource( aArguments ) );
if( xDataSource.is() )
{
- Reference< chart2::XDiagram > xDia( getFirstDiagram() );
+ rtl::Reference< Diagram > xDia = getFirstChartDiagram();
if( !xDia.is() )
{
- Reference< chart2::XChartTypeTemplate > xTemplate( impl_createDefaultChartTypeTemplate() );
+ rtl::Reference< ::chart::ChartTypeTemplate > xTemplate( impl_createDefaultChartTypeTemplate() );
if( xTemplate.is())
setFirstDiagram( xTemplate->createDiagramByDataSource( xDataSource, aArguments ) );
}
@@ -862,22 +913,18 @@ void SAL_CALL ChartModel::setArguments( const Sequence< beans::PropertyValue >&
Sequence< OUString > SAL_CALL ChartModel::getUsedRangeRepresentations()
{
- return DataSourceHelper::getUsedDataRanges( Reference< frame::XModel >(this));
+ return comphelper::containerToSequence(DataSourceHelper::getUsedDataRanges( this ));
}
Reference< chart2::data::XDataSource > SAL_CALL ChartModel::getUsedData()
{
- return DataSourceHelper::getUsedData( Reference< chart2::XChartDocument >(this));
+ return DataSourceHelper::getUsedData( *this );
}
Reference< chart2::data::XRangeHighlighter > SAL_CALL ChartModel::getRangeHighlighter()
{
if( ! m_xRangeHighlighter.is())
- {
- uno::Reference< view::XSelectionSupplier > xSelSupp( getCurrentController(), uno::UNO_QUERY );
- if( xSelSupp.is() )
- m_xRangeHighlighter.set( ChartModelHelper::createRangeHighlighter( xSelSupp ));
- }
+ m_xRangeHighlighter = new RangeHighlighter( this );
return m_xRangeHighlighter;
}
@@ -888,11 +935,11 @@ Reference<awt::XRequestCallback> SAL_CALL ChartModel::getPopupRequest()
return m_xPopupRequest;
}
-Reference< chart2::XChartTypeTemplate > ChartModel::impl_createDefaultChartTypeTemplate()
+rtl::Reference< ::chart::ChartTypeTemplate > ChartModel::impl_createDefaultChartTypeTemplate()
{
- Reference< chart2::XChartTypeTemplate > xTemplate;
+ rtl::Reference< ::chart::ChartTypeTemplate > xTemplate;
if( m_xChartTypeManager.is() )
- xTemplate.set( m_xChartTypeManager->createInstance( "com.sun.star.chart2.template.Column" ), uno::UNO_QUERY );
+ xTemplate = m_xChartTypeManager->createTemplate( u"com.sun.star.chart2.template.Column"_ustr );
return xTemplate;
}
@@ -930,7 +977,20 @@ uno::Reference< chart2::XTitle > SAL_CALL ChartModel::getTitleObject()
return m_xTitle;
}
-void SAL_CALL ChartModel::setTitleObject( const uno::Reference< chart2::XTitle >& xTitle )
+rtl::Reference< Title > ChartModel::getTitleObject2() const
+{
+ MutexGuard aGuard( m_aModelMutex );
+ return m_xTitle;
+}
+
+void SAL_CALL ChartModel::setTitleObject( const uno::Reference< chart2::XTitle >& xNewTitle )
+{
+ rtl::Reference<Title> xTitle = dynamic_cast<Title*>(xNewTitle.get());
+ assert(!xNewTitle || xTitle);
+ setTitleObject(xTitle);
+}
+
+void ChartModel::setTitleObject( const rtl::Reference< Title >& xTitle )
{
{
MutexGuard aGuard( m_aModelMutex );
@@ -967,6 +1027,7 @@ uno::Any SAL_CALL ChartModel::queryInterface( const uno::Type& aType )
// ____ XCloneable ____
Reference< util::XCloneable > SAL_CALL ChartModel::createClone()
{
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
return Reference< util::XCloneable >( new ChartModel( *this ));
}
@@ -1017,12 +1078,11 @@ embed::VisualRepresentation SAL_CALL ChartModel::getPreferredVisualRepresentatio
Sequence< sal_Int8 > aMetafile;
//get view from old api wrapper
- Reference< datatransfer::XTransferable > xTransferable(
- createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
+ Reference< datatransfer::XTransferable > xTransferable( createChartView() );
if( xTransferable.is() )
{
datatransfer::DataFlavor aDataFlavor( lcl_aGDIMetaFileMIMEType,
- "GDIMetaFile",
+ u"GDIMetaFile"_ustr,
cppu::UnoType<uno::Sequence< sal_Int8 >>::get() );
uno::Any aData( xTransferable->getTransferData( aDataFlavor ) );
@@ -1060,8 +1120,7 @@ uno::Any SAL_CALL ChartModel::getTransferData( const datatransfer::DataFlavor& a
try
{
//get view from old api wrapper
- Reference< datatransfer::XTransferable > xTransferable(
- createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
+ Reference< datatransfer::XTransferable > xTransferable( createChartView() );
if( xTransferable.is() &&
xTransferable->isDataFlavorSupported( aFlavor ))
{
@@ -1079,7 +1138,7 @@ uno::Any SAL_CALL ChartModel::getTransferData( const datatransfer::DataFlavor& a
Sequence< datatransfer::DataFlavor > SAL_CALL ChartModel::getTransferDataFlavors()
{
return { datatransfer::DataFlavor( lcl_aGDIMetaFileMIMETypeHighContrast,
- "GDIMetaFile",
+ u"GDIMetaFile"_ustr,
cppu::UnoType<uno::Sequence< sal_Int8 >>::get() ) };
}
@@ -1146,12 +1205,7 @@ Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString
}
else if(rServiceSpecifier == CHART_VIEW_SERVICE_NAME)
{
- if(!mxChartView.is())
- {
- mxChartView = new ChartView( m_xContext, *this);
- }
-
- return static_cast< ::cppu::OWeakObject* >( mxChartView.get() );
+ return static_cast< ::cppu::OWeakObject* >( createChartView().get() );
}
else
{
@@ -1168,6 +1222,13 @@ Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString
return nullptr;
}
+const rtl::Reference<ChartView>& ChartModel::createChartView()
+{
+ if(!mxChartView.is())
+ mxChartView = new ChartView( m_xContext, *this);
+ return mxChartView;
+}
+
Reference< uno::XInterface > SAL_CALL ChartModel::createInstanceWithArguments(
const OUString& rServiceSpecifier , const Sequence< Any >& Arguments )
{
@@ -1244,14 +1305,19 @@ Reference< uno::XInterface > SAL_CALL ChartModel::getParent()
void SAL_CALL ChartModel::setParent( const Reference< uno::XInterface >& Parent )
{
if( Parent != m_xParent )
+ {
+ if (SfxObjectShell* pShell = getParentShell(m_xParent))
+ EndListening(*pShell);
m_xParent.set( Parent, uno::UNO_QUERY );
+ if (SfxObjectShell* pShell = getParentShell(m_xParent))
+ StartListening(*pShell);
+ }
}
// ____ XDataSource ____
uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ChartModel::getDataSequences()
{
- Reference< chart2::data::XDataSource > xSource(
- DataSourceHelper::getUsedData( uno::Reference< frame::XModel >(this) ) );
+ rtl::Reference< DataSource > xSource = DataSourceHelper::getUsedData( *this );
if( xSource.is())
return xSource->getDataSequences();
@@ -1259,12 +1325,16 @@ uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ChartM
}
//XDumper
-OUString SAL_CALL ChartModel::dump()
+OUString SAL_CALL ChartModel::dump(OUString const & kind)
{
- uno::Reference< qa::XDumper > xDumper(
- createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
+ if (kind.isEmpty()) {
+ return comphelper::dumpXmlToString([this](auto writer) { return dumpAsXml(writer); });
+ }
+
+ // kind == "shapes":
+ uno::Reference< qa::XDumper > xDumper( createChartView() );
if (xDumper.is())
- return xDumper->dump();
+ return xDumper->dump(kind);
return OUString();
}
@@ -1297,6 +1367,238 @@ bool ChartModel::isDataFromPivotTable() const
return xPivotTableDataProvider.is();
}
+rtl::Reference< BaseCoordinateSystem > ChartModel::getFirstCoordinateSystem()
+{
+ if( m_xDiagram )
+ {
+ auto aCooSysSeq( m_xDiagram->getBaseCoordinateSystems() );
+ if( !aCooSysSeq.empty() )
+ return aCooSysSeq[0];
+ }
+ return nullptr;
+}
+
+std::vector< rtl::Reference< DataSeries > > ChartModel::getDataSeries()
+{
+ if( m_xDiagram)
+ return m_xDiagram->getDataSeries();
+
+ return {};
+}
+
+rtl::Reference< ChartType > ChartModel::getChartTypeOfSeries( const rtl::Reference< DataSeries >& xGivenDataSeries )
+{
+ return m_xDiagram ? m_xDiagram->getChartTypeOfSeries( xGivenDataSeries ) : nullptr;
+}
+
+// static
+awt::Size ChartModel::getDefaultPageSize()
+{
+ return awt::Size( 16000, 9000 );
+}
+
+awt::Size ChartModel::getPageSize()
+{
+ return getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
+}
+
+void ChartModel::triggerRangeHighlighting()
+{
+ getRangeHighlighter();
+ uno::Reference< view::XSelectionChangeListener > xSelectionChangeListener( m_xRangeHighlighter );
+ //trigger selection of cell range
+ lang::EventObject aEvent( xSelectionChangeListener );
+ xSelectionChangeListener->selectionChanged( aEvent );
+}
+
+bool ChartModel::isIncludeHiddenCells()
+{
+ bool bIncluded = true; // hidden cells are included by default.
+
+ if (!m_xDiagram)
+ return bIncluded;
+
+ try
+ {
+ m_xDiagram->getPropertyValue(u"IncludeHiddenCells"_ustr) >>= bIncluded;
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ }
+
+ return bIncluded;
+}
+
+bool ChartModel::setIncludeHiddenCells( bool bIncludeHiddenCells )
+{
+ bool bChanged = false;
+ try
+ {
+ ControllerLockGuard aLockedControllers( *this );
+
+ uno::Reference< beans::XPropertySet > xDiagramProperties( getFirstDiagram(), uno::UNO_QUERY );
+ if (!xDiagramProperties)
+ return false;
+
+ bool bOldValue = bIncludeHiddenCells;
+ xDiagramProperties->getPropertyValue( u"IncludeHiddenCells"_ustr ) >>= bOldValue;
+ if( bOldValue == bIncludeHiddenCells )
+ bChanged = true;
+
+ //set the property on all instances in all cases to get the different objects in sync!
+
+ uno::Any aNewValue(bIncludeHiddenCells);
+
+ try
+ {
+ uno::Reference< beans::XPropertySet > xDataProviderProperties( getDataProvider(), uno::UNO_QUERY );
+ if( xDataProviderProperties.is() )
+ xDataProviderProperties->setPropertyValue(u"IncludeHiddenCells"_ustr, aNewValue );
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ //the property is optional!
+ }
+
+ try
+ {
+ rtl::Reference< DataSource > xUsedData = DataSourceHelper::getUsedData( *this );
+ if( xUsedData.is() )
+ {
+ uno::Reference< beans::XPropertySet > xProp;
+ const uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
+ for( uno::Reference< chart2::data::XLabeledDataSequence > const & labeledData : aData )
+ {
+ xProp.set( uno::Reference< beans::XPropertySet >( labeledData->getValues(), uno::UNO_QUERY ) );
+ if(xProp.is())
+ xProp->setPropertyValue(u"IncludeHiddenCells"_ustr, aNewValue );
+ xProp.set( uno::Reference< beans::XPropertySet >( labeledData->getLabel(), uno::UNO_QUERY ) );
+ if(xProp.is())
+ xProp->setPropertyValue(u"IncludeHiddenCells"_ustr, aNewValue );
+ }
+ }
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ //the property is optional!
+ }
+
+ xDiagramProperties->setPropertyValue( u"IncludeHiddenCells"_ustr, aNewValue);
+ }
+ catch (const uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
+ return bChanged;
+}
+
+void ChartModel::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+{
+ if (rHint.GetId() == SfxHintId::ThemeColorsChanged)
+ {
+ onDocumentThemeChanged();
+ }
+}
+
+std::shared_ptr<model::Theme> ChartModel::getDocumentTheme() const
+{
+ std::shared_ptr<model::Theme> pTheme;
+ uno::Any aThemeValue;
+
+ auto pParent = const_cast<ChartModel*>(this)->getParent();
+ uno::Reference<frame::XModel> xDocModel(pParent, uno::UNO_QUERY);
+ uno::Reference<text::XTextDocument> xTextDoc(xDocModel, uno::UNO_QUERY);
+
+ if (!xTextDoc.is()) // Calc, Impress
+ {
+ uno::Reference<beans::XPropertySet> xPropSet(xDocModel, uno::UNO_QUERY);
+ if (xPropSet.is())
+ {
+ aThemeValue = xPropSet->getPropertyValue("Theme");
+ }
+ }
+ else // Writer
+ {
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xDocModel, uno::UNO_QUERY);
+ if (xDrawPageSupplier.is())
+ {
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ if (xDrawPage.is())
+ {
+ uno::Reference<beans::XPropertySet> xPropSet(xDrawPage, uno::UNO_QUERY);
+ if (xPropSet.is())
+ {
+ aThemeValue = xPropSet->getPropertyValue("Theme");
+ }
+ }
+ }
+ }
+
+ uno::Reference<util::XTheme> xTheme(aThemeValue, uno::UNO_QUERY);
+ if (xTheme.is())
+ {
+ if (auto* pUnoTheme = dynamic_cast<UnoTheme*>(xTheme.get()))
+ {
+ pTheme = pUnoTheme->getTheme();
+ }
+ }
+ else
+ {
+ pTheme = model::Theme::FromAny(aThemeValue);
+ }
+
+ return pTheme;
+}
+
+void ChartModel::setColorPalette(ChartColorPaletteType eType, sal_uInt32 nIndex)
+{
+ m_eColorPaletteType = eType;
+ m_nColorPaletteIndex = nIndex;
+}
+
+void ChartModel::clearColorPalette() { setColorPalette(ChartColorPaletteType::Unknown, 0); }
+
+bool ChartModel::usesColorPalette() const
+{
+ return m_eColorPaletteType != ChartColorPaletteType::Unknown;
+}
+
+std::optional<ChartColorPalette> ChartModel::getCurrentColorPalette() const
+{
+ if (!usesColorPalette())
+ {
+ SAL_WARN("chart2", "ChartModel::getCurrentColorPalette: no palette is in use");
+ return std::nullopt;
+ }
+
+ const std::shared_ptr<model::Theme> pTheme = getDocumentTheme();
+ // when pTheme is null, ChartColorPaletteHelper uses a default theme
+ const ChartColorPaletteHelper aColorPaletteHelper(pTheme);
+ return aColorPaletteHelper.getColorPalette(getColorPaletteType(), getColorPaletteIndex());
+}
+
+void ChartModel::applyColorPaletteToDataSeries(const ChartColorPalette& rColorPalette)
+{
+ const rtl::Reference<Diagram> xDiagram = getFirstChartDiagram();
+ const auto xDataSeriesArray = xDiagram->getDataSeries();
+ for (size_t i = 0; i < xDataSeriesArray.size(); ++i)
+ {
+ const uno::Reference<beans::XPropertySet> xPropSet = xDataSeriesArray[i];
+ const size_t nPaletteIndex = i % rColorPalette.size();
+ xPropSet->setPropertyValue("FillStyle", uno::Any(drawing::FillStyle_SOLID));
+ xPropSet->setPropertyValue("FillColor", uno::Any(rColorPalette[nPaletteIndex]));
+ }
+}
+
+void ChartModel::onDocumentThemeChanged()
+{
+ if (const auto oColorPalette = getCurrentColorPalette())
+ {
+ applyColorPaletteToDataSeries(*oColorPalette);
+ setModified(true);
+ }
+}
+
} // namespace chart
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index 458d23b6283a..c819fab153c2 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -21,14 +21,15 @@
#include <ChartModel.hxx>
#include <MediaDescriptorHelper.hxx>
#include <ChartViewHelper.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartTypeManager.hxx>
#include <ChartTypeTemplate.hxx>
#include <DataSourceHelper.hxx>
#include <AxisHelper.hxx>
#include <ThreeDHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <Diagram.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <Legend.hxx>
+#include <XMLFilter.hxx>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -44,8 +45,6 @@
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/io/TempFile.hpp>
-#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/ucb/CommandFailedException.hpp>
#include <com/sun/star/ucb/ContentCreationException.hpp>
@@ -53,12 +52,14 @@
#include <ucbhelper/content.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <unotools/tempfile.hxx>
+#include <utility>
#include <vcl/cvtgrf.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
#include <sfx2/objsh.hxx>
@@ -72,19 +73,6 @@ using ::osl::MutexGuard;
namespace
{
-struct lcl_PropNameEquals
-{
- explicit lcl_PropNameEquals( const OUString & rStrToCompareWith ) :
- m_aStr( rStrToCompareWith )
- {}
- bool operator() ( const beans::PropertyValue & rProp )
- {
- return rProp.Name == m_aStr;
- }
-private:
- OUString m_aStr;
-};
-
template< typename T >
T lcl_getProperty(
const Sequence< beans::PropertyValue > & rMediaDescriptor,
@@ -93,10 +81,9 @@ T lcl_getProperty(
T aResult;
if( rMediaDescriptor.hasElements())
{
- const beans::PropertyValue * pIt = rMediaDescriptor.getConstArray();
- const beans::PropertyValue * pEndIt = pIt + + rMediaDescriptor.getLength();
- pIt = std::find_if( pIt, pEndIt, lcl_PropNameEquals( rPropName ));
- if( pIt != pEndIt )
+ auto pIt = std::find_if(rMediaDescriptor.begin(), rMediaDescriptor.end(),
+ [&rPropName](auto& prop) { return prop.Name == rPropName; });
+ if (pIt != rMediaDescriptor.end())
(*pIt).Value >>= aResult;
}
return aResult;
@@ -108,7 +95,7 @@ void lcl_addStorageToMediaDescriptor(
{
rOutMD.realloc( rOutMD.getLength() + 1 );
rOutMD.getArray()[rOutMD.getLength() - 1] = beans::PropertyValue(
- "Storage", -1, uno::Any( xStorage ), beans::PropertyState_DIRECT_VALUE );
+ u"Storage"_ustr, -1, uno::Any( xStorage ), beans::PropertyState_DIRECT_VALUE );
}
Reference< embed::XStorage > lcl_createStorage(
@@ -158,7 +145,7 @@ Reference< document::XFilter > ChartModel::impl_createFilter(
// find FilterName in MediaDescriptor
OUString aFilterName(
- lcl_getProperty< OUString >( rMediaDescriptor, "FilterName" ) );
+ lcl_getProperty< OUString >( rMediaDescriptor, u"FilterName"_ustr ) );
// if FilterName was found, get Filter from factory
if( !aFilterName.isEmpty() )
@@ -167,7 +154,7 @@ Reference< document::XFilter > ChartModel::impl_createFilter(
{
Reference< container::XNameAccess > xFilterFact(
m_xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.document.FilterFactory", m_xContext ),
+ u"com.sun.star.document.FilterFactory"_ustr, m_xContext ),
uno::UNO_QUERY_THROW );
uno::Any aFilterProps( xFilterFact->getByName( aFilterName ));
Sequence< beans::PropertyValue > aProps;
@@ -176,7 +163,7 @@ Reference< document::XFilter > ChartModel::impl_createFilter(
(aFilterProps >>= aProps))
{
OUString aFilterServiceName(
- lcl_getProperty< OUString >( aProps, "FilterService" ) );
+ lcl_getProperty< OUString >( aProps, u"FilterService"_ustr ) );
if( !aFilterServiceName.isEmpty())
{
@@ -198,10 +185,7 @@ Reference< document::XFilter > ChartModel::impl_createFilter(
if( ! xFilter.is())
{
SAL_WARN("chart2", "No FilterName passed in MediaDescriptor" );
- xFilter.set(
- m_xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.comp.chart2.XMLFilter", m_xContext ),
- uno::UNO_QUERY_THROW );
+ xFilter = new XMLFilter(m_xContext);
}
return xFilter;
@@ -221,7 +205,7 @@ void SAL_CALL ChartModel::storeSelf( const Sequence< beans::PropertyValue >& rMe
// frame::XStorable (base of XStorable2)
sal_Bool SAL_CALL ChartModel::hasLocation()
{
- //@todo guard
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
return !m_aResource.isEmpty();
}
@@ -245,10 +229,10 @@ void SAL_CALL ChartModel::store()
OUString aLocation = m_aResource;
if( aLocation.isEmpty() )
- throw io::IOException( "no location specified", static_cast< ::cppu::OWeakObject* >(this));
+ throw io::IOException( u"no location specified"_ustr, static_cast< ::cppu::OWeakObject* >(this));
//@todo check whether aLocation is something like private:factory...
if( m_bReadOnly )
- throw io::IOException( "document is read only", static_cast< ::cppu::OWeakObject* >(this));
+ throw io::IOException( u"document is read only"_ustr, static_cast< ::cppu::OWeakObject* >(this));
aGuard.clear();
@@ -265,7 +249,7 @@ void SAL_CALL ChartModel::storeAsURL(
return; //behave passive if already disposed or closed or throw exception @todo?
apphelper::MediaDescriptorHelper aMediaDescriptorHelper(rMediaDescriptor);
- uno::Sequence< beans::PropertyValue > aReducedMediaDescriptor(
+ const uno::Sequence< beans::PropertyValue >& aReducedMediaDescriptor(
aMediaDescriptorHelper.getReducedForModel() );
m_bReadOnly = false;
@@ -293,7 +277,7 @@ void SAL_CALL ChartModel::storeToURL(
aGuard.clear();
apphelper::MediaDescriptorHelper aMediaDescriptorHelper(rMediaDescriptor);
- uno::Sequence< beans::PropertyValue > aReducedMediaDescriptor(
+ const uno::Sequence< beans::PropertyValue >& aReducedMediaDescriptor(
aMediaDescriptorHelper.getReducedForModel() );
if ( rURL == "private:stream" )
@@ -302,8 +286,7 @@ void SAL_CALL ChartModel::storeToURL(
{
if( m_xContext.is() && aMediaDescriptorHelper.ISSET_OutputStream )
{
- Reference< io::XStream > xStream(
- io::TempFile::create(m_xContext), uno::UNO_QUERY_THROW );
+ rtl::Reference< utl::TempFileFastService > xStream = new utl::TempFileFastService;
Reference< io::XInputStream > xInputStream( xStream->getInputStream());
Reference< embed::XStorage > xStorage(
@@ -312,8 +295,7 @@ void SAL_CALL ChartModel::storeToURL(
{
impl_store( aReducedMediaDescriptor, xStorage );
- Reference< io::XSeekable > xSeekable( xStream, uno::UNO_QUERY_THROW );
- xSeekable->seek( 0 );
+ xStream->seek( 0 );
::comphelper::OStorageHelper::CopyInputToOutput( xInputStream, aMediaDescriptorHelper.OutputStream );
}
}
@@ -372,7 +354,7 @@ void ChartModel::impl_store(
try
{
xPropSet->setPropertyValue(
- "SavedObject",
+ u"SavedObject"_ustr,
uno::Any( aMDHelper.HierarchicalDocumentName ) );
}
catch ( const uno::Exception& )
@@ -387,7 +369,7 @@ void ChartModel::insertDefaultChart()
try
{
// create default chart
- Reference< chart2::XChartTypeTemplate > xTemplate( impl_createDefaultChartTypeTemplate() );
+ rtl::Reference< ::chart::ChartTypeTemplate > xTemplate( impl_createDefaultChartTypeTemplate() );
if( xTemplate.is())
{
try
@@ -398,11 +380,11 @@ void ChartModel::insertDefaultChart()
bool bSupportsCategories = xTemplate->supportsCategories();
if( bSupportsCategories )
{
- aParam = { beans::PropertyValue( "HasCategories", -1, uno::Any( true ),
+ aParam = { beans::PropertyValue( u"HasCategories"_ustr, -1, uno::Any( true ),
beans::PropertyState_DIRECT_VALUE ) };
}
- Reference< chart2::XDiagram > xDiagram( xTemplate->createDiagramByDataSource( xDataSource, aParam ) );
+ rtl::Reference< Diagram > xDiagram( xTemplate->createDiagramByDataSource2( xDataSource, aParam ) );
setFirstDiagram( xDiagram );
@@ -412,50 +394,39 @@ void ChartModel::insertDefaultChart()
AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) );
// create and attach legend
- Reference< chart2::XLegend > xLegend(
- m_xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.Legend", m_xContext ), uno::UNO_QUERY_THROW );
- Reference< beans::XPropertySet > xLegendProperties( xLegend, uno::UNO_QUERY );
- if( xLegendProperties.is() )
- {
- xLegendProperties->setPropertyValue( "FillStyle", uno::Any( drawing::FillStyle_NONE ));
- xLegendProperties->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_NONE ));
- xLegendProperties->setPropertyValue( "LineColor", uno::Any( static_cast< sal_Int32 >( 0xb3b3b3 ) )); // gray30
- xLegendProperties->setPropertyValue( "FillColor", uno::Any( static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
+ rtl::Reference< Legend > xLegend = new Legend();
+ xLegend->setPropertyValue( u"FillStyle"_ustr, uno::Any( drawing::FillStyle_NONE ));
+ xLegend->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_NONE ));
+ xLegend->setPropertyValue( u"LineColor"_ustr, uno::Any( static_cast< sal_Int32 >( 0xb3b3b3 ) )); // gray30
+ xLegend->setPropertyValue( u"FillColor"_ustr, uno::Any( static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
- if( bIsRTL )
- xLegendProperties->setPropertyValue( "AnchorPosition", uno::Any( chart2::LegendPosition_LINE_START ));
- }
+ if( bIsRTL )
+ xLegend->setPropertyValue( u"AnchorPosition"_ustr, uno::Any( chart2::LegendPosition_LINE_START ));
if(xDiagram.is())
+ {
xDiagram->setLegend( xLegend );
- // set simple 3D look
- Reference< beans::XPropertySet > xDiagramProperties( xDiagram, uno::UNO_QUERY );
- if( xDiagramProperties.is() )
- {
- xDiagramProperties->setPropertyValue( "RightAngledAxes", uno::Any( true ));
- xDiagramProperties->setPropertyValue( "D3DScenePerspective", uno::Any( drawing::ProjectionMode_PARALLEL ));
- ThreeDHelper::setScheme( xDiagram, ThreeDLookScheme::ThreeDLookScheme_Realistic );
- }
+ // set simple 3D look
+ xDiagram->setPropertyValue( u"RightAngledAxes"_ustr, uno::Any( true ));
+ xDiagram->setPropertyValue( u"D3DScenePerspective"_ustr, uno::Any( drawing::ProjectionMode_PARALLEL ));
+ xDiagram->setScheme( ThreeDLookScheme::ThreeDLookScheme_Realistic );
- //set some new 'defaults' for wall and floor
- if( xDiagram.is() )
- {
+ //set some new 'defaults' for wall and floor
Reference< beans::XPropertySet > xWall( xDiagram->getWall() );
if( xWall.is() )
{
- xWall->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_SOLID ) );
- xWall->setPropertyValue( "FillStyle", uno::Any( drawing::FillStyle_NONE ) );
- xWall->setPropertyValue( "LineColor", uno::Any( static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
- xWall->setPropertyValue( "FillColor", uno::Any( static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
+ xWall->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_SOLID ) );
+ xWall->setPropertyValue( u"FillStyle"_ustr, uno::Any( drawing::FillStyle_NONE ) );
+ xWall->setPropertyValue( u"LineColor"_ustr, uno::Any( static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
+ xWall->setPropertyValue( u"FillColor"_ustr, uno::Any( static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
}
Reference< beans::XPropertySet > xFloor( xDiagram->getFloor() );
if( xFloor.is() )
{
- xFloor->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_NONE ) );
- xFloor->setPropertyValue( "FillStyle", uno::Any( drawing::FillStyle_SOLID ) );
- xFloor->setPropertyValue( "LineColor", uno::Any( static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
- xFloor->setPropertyValue( "FillColor", uno::Any( static_cast< sal_Int32 >( 0xcccccc ) ) ); // gray20
+ xFloor->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
+ xFloor->setPropertyValue( u"FillStyle"_ustr, uno::Any( drawing::FillStyle_SOLID ) );
+ xFloor->setPropertyValue( u"LineColor"_ustr, uno::Any( static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
+ xFloor->setPropertyValue( u"FillColor"_ustr, uno::Any( static_cast< sal_Int32 >( 0xcccccc ) ) ); // gray20
}
}
@@ -465,7 +436,7 @@ void ChartModel::insertDefaultChart()
DBG_UNHANDLED_EXCEPTION("chart2");
}
}
- ChartModelHelper::setIncludeHiddenCells( false, *this );
+ setIncludeHiddenCells( false );
}
catch( const uno::Exception & )
{
@@ -591,8 +562,8 @@ void ChartModel::impl_loadGraphics(
{
try
{
- const Reference< embed::XStorage >& xGraphicsStorage(
- xStorage->openStorageElement( "Pictures",
+ const Reference< embed::XStorage > xGraphicsStorage(
+ xStorage->openStorageElement( u"Pictures"_ustr,
embed::ElementModes::READ ) );
if( xGraphicsStorage.is() )
@@ -645,16 +616,11 @@ void ChartModel::impl_notifyModifiedListeners()
//always notify the view first!
ChartViewHelper::setViewToDirtyState( this );
- ::comphelper::OInterfaceContainerHelper2* pIC = m_aLifeTimeManager.m_aListenerContainer
- .getContainer( cppu::UnoType<util::XModifyListener>::get());
- if( pIC )
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ if( m_aLifeTimeManager.m_aModifyListeners.getLength(aGuard) )
{
lang::EventObject aEvent( static_cast< lang::XComponent*>(this) );
- ::comphelper::OInterfaceIteratorHelper2 aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- static_cast< util::XModifyListener* >( aIt.next() )->modified( aEvent );
- }
+ m_aLifeTimeManager.m_aModifyListeners.notifyEach(aGuard, &util::XModifyListener::modified, aEvent);
}
}
@@ -683,7 +649,8 @@ void SAL_CALL ChartModel::setModified( sal_Bool bModified )
if( m_nControllerLockCount > 0 )
{
- m_bUpdateNotificationsPending = true;
+ if (bModified)
+ m_bUpdateNotificationsPending = true; // Maybe !bModified should reset it?
return;//don't call listeners if controllers are locked
}
aGuard.clear();
@@ -699,8 +666,8 @@ void SAL_CALL ChartModel::addModifyListener(
if( m_aLifeTimeManager.impl_isDisposedOrClosed() )
return; //behave passive if already disposed or closed
- m_aLifeTimeManager.m_aListenerContainer.addInterface(
- cppu::UnoType<util::XModifyListener>::get(), xListener );
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aModifyListeners.addInterface( aGuard, xListener );
}
void SAL_CALL ChartModel::removeModifyListener(
@@ -709,8 +676,8 @@ void SAL_CALL ChartModel::removeModifyListener(
if( m_aLifeTimeManager.impl_isDisposedOrClosed(false) )
return; //behave passive if already disposed or closed
- m_aLifeTimeManager.m_aListenerContainer.removeInterface(
- cppu::UnoType<util::XModifyListener>::get(), xListener );
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aModifyListeners.removeInterface( aGuard, xListener );
}
// util::XModifyListener
@@ -724,13 +691,13 @@ void SAL_CALL ChartModel::modified( const lang::EventObject& rEvenObject)
try
{
uno::Sequence<beans::PropertyValue> aArguments =
- DataSourceHelper::createArguments("PivotChart", uno::Sequence<sal_Int32>(), true, true, true);
+ DataSourceHelper::createArguments(u"PivotChart"_ustr, uno::Sequence<sal_Int32>(), true, true, true);
Reference<chart2::data::XDataSource> xDataSource(xDataProvider->createDataSource(aArguments));
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = getTypeManager();
- Reference<chart2::XDiagram> xDiagram(getFirstDiagram());
+ rtl::Reference<Diagram> xDiagram(getFirstChartDiagram());
- DiagramHelper::tTemplateWithServiceName aTemplateAndService = DiagramHelper::getTemplateForDiagram(xDiagram, xChartTypeManager);
+ Diagram::tTemplateWithServiceName aTemplateAndService = xDiagram->getTemplate(xChartTypeManager);
aTemplateAndService.xChartTypeTemplate->changeDiagramData(xDiagram, xDataSource, aArguments);
}
catch (const uno::Exception &)
@@ -779,16 +746,14 @@ Reference< embed::XStorage > SAL_CALL ChartModel::getDocumentStorage()
void ChartModel::impl_notifyStorageChangeListeners()
{
- ::comphelper::OInterfaceContainerHelper2* pIC = m_aLifeTimeManager.m_aListenerContainer
- .getContainer( cppu::UnoType<document::XStorageChangeListener>::get());
- if( pIC )
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ if( m_aLifeTimeManager.m_aStorageChangeListeners.getLength(aGuard) )
{
- ::comphelper::OInterfaceIteratorHelper2 aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- static_cast< document::XStorageChangeListener* >( aIt.next() )
- ->notifyStorageChange( static_cast< ::cppu::OWeakObject* >( this ), m_xStorage );
- }
+ m_aLifeTimeManager.m_aStorageChangeListeners.forEach(aGuard,
+ [this](const uno::Reference<document::XStorageChangeListener>& l)
+ {
+ l->notifyStorageChange( static_cast< ::cppu::OWeakObject* >( this ), m_xStorage );
+ });
}
}
@@ -797,8 +762,8 @@ void SAL_CALL ChartModel::addStorageChangeListener( const Reference< document::X
if( m_aLifeTimeManager.impl_isDisposedOrClosed() )
return; //behave passive if already disposed or closed
- m_aLifeTimeManager.m_aListenerContainer.addInterface(
- cppu::UnoType<document::XStorageChangeListener>::get(), xListener );
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aStorageChangeListeners.addInterface( aGuard, xListener );
}
void SAL_CALL ChartModel::removeStorageChangeListener( const Reference< document::XStorageChangeListener >& xListener )
@@ -806,8 +771,8 @@ void SAL_CALL ChartModel::removeStorageChangeListener( const Reference< document
if( m_aLifeTimeManager.impl_isDisposedOrClosed(false) )
return; //behave passive if already disposed or closed
- m_aLifeTimeManager.m_aListenerContainer.removeInterface(
- cppu::UnoType<document::XStorageChangeListener>::get(), xListener );
+ std::unique_lock aGuard(m_aLifeTimeManager.m_aAccessMutex);
+ m_aLifeTimeManager.m_aStorageChangeListeners.removeInterface(aGuard, xListener );
}
} // namespace chart
diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx
index a5838c91f5d5..3e224d6523de 100644
--- a/chart2/source/model/main/DataPoint.cxx
+++ b/chart2/source/model/main/DataPoint.cxx
@@ -26,7 +26,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
@@ -39,45 +39,21 @@ using ::com::sun::star::beans::Property;
namespace
{
-struct StaticDataPointInfoHelper_Initializer
+::cppu::OPropertyArrayHelper& StaticDataPointInfoHelper()
{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::DataPointProperties::AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticDataPointInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDataPointInfoHelper_Initializer >
-{
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::DataPointProperties::AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-struct StaticDataPointInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDataPointInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticDataPointInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticDataPointInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -86,7 +62,6 @@ namespace chart
{
DataPoint::DataPoint( const uno::Reference< beans::XPropertySet > & rParentProperties ) :
- ::property::OPropertySet( m_aMutex ),
m_xParentProperties( rParentProperties ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_bNoParentPropAllowed( false )
@@ -96,7 +71,7 @@ DataPoint::DataPoint( const uno::Reference< beans::XPropertySet > & rParentPrope
DataPoint::DataPoint( const DataPoint & rOther ) :
impl::DataPoint_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_bNoParentPropAllowed( true )
{
@@ -195,7 +170,7 @@ void SAL_CALL DataPoint::setFastPropertyValue_NoBroadcast(
ModifyListenerHelper::removeListener( xBroadcaster, m_xModifyEventForwarder );
}
- OSL_ASSERT( rValue.getValueType().getTypeClass() == uno::TypeClass_INTERFACE );
+ OSL_ASSERT( rValue.getValueTypeClass() == uno::TypeClass_INTERFACE );
if( rValue.hasValue() &&
(rValue >>= xBroadcaster) &&
xBroadcaster.is())
@@ -209,13 +184,15 @@ void SAL_CALL DataPoint::setFastPropertyValue_NoBroadcast(
::cppu::IPropertyArrayHelper & SAL_CALL DataPoint::getInfoHelper()
{
- return *StaticDataPointInfoHelper::get();
+ return StaticDataPointInfoHelper();
}
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL DataPoint::getPropertySetInfo()
{
- return *StaticDataPointInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticDataPointInfoHelper() ) );
+ return xPropertySetInfo;
}
// ____ XModifyBroadcaster ____
@@ -255,7 +232,7 @@ IMPLEMENT_FORWARD_XINTERFACE2( DataPoint, DataPoint_Base, ::property::OPropertyS
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
OUString SAL_CALL DataPoint::getImplementationName()
{
- return "com.sun.star.comp.chart.DataPoint" ;
+ return u"com.sun.star.comp.chart.DataPoint"_ustr ;
}
sal_Bool SAL_CALL DataPoint::supportsService( const OUString& rServiceName )
@@ -266,10 +243,10 @@ sal_Bool SAL_CALL DataPoint::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL DataPoint::getSupportedServiceNames()
{
return {
- "com.sun.star.drawing.FillProperties",
- "com.sun.star.chart2.DataPoint",
- "com.sun.star.chart2.DataPointProperties",
- "com.sun.star.beans.PropertySet"
+ u"com.sun.star.drawing.FillProperties"_ustr,
+ u"com.sun.star.chart2.DataPoint"_ustr,
+ u"com.sun.star.chart2.DataPointProperties"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr
};
}
diff --git a/chart2/source/model/main/DataPoint.hxx b/chart2/source/model/main/DataPoint.hxx
index 52feb197d354..ba94449fff94 100644
--- a/chart2/source/model/main/DataPoint.hxx
+++ b/chart2/source/model/main/DataPoint.hxx
@@ -18,7 +18,6 @@
*/
#pragma once
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/weakref.hxx>
#include <comphelper/uno3.hxx>
@@ -44,7 +43,6 @@ typedef ::cppu::WeakImplHelper<
}
class DataPoint final :
- public cppu::BaseMutex,
public impl::DataPoint_Base,
public ::property::OPropertySet
{
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 267bf9014dca..53f88600214f 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -30,11 +30,14 @@
#include <com/sun/star/drawing/BitmapMode.hpp>
#include <com/sun/star/drawing/RectanglePoint.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/chart2/XDataPointCustomLabelField.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
+#include <tools/color.hxx>
+
using namespace ::com::sun::star;
using ::com::sun::star::beans::Property;
@@ -337,6 +340,12 @@ void DataPointProperties::AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( "InvertNegative",
+ PROP_DATAPOINT_INVERT_NEGATIVE,
+ cppu::UnoType<bool>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
+
// statistics
rOutProperties.emplace_back( CHART_UNONAME_ERRORBAR_X,
PROP_DATAPOINT_ERROR_BAR_X,
@@ -445,13 +454,18 @@ void DataPointProperties::AddPropertiesToVector(
cppu::UnoType<chart2::RelativePosition>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID );
+
+ rOutProperties.emplace_back("CustomLabelSize", PROP_DATAPOINT_LABEL_CUSTOM_SIZE,
+ cppu::UnoType<chart2::RelativeSize>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID);
}
void DataPointProperties::AddDefaultsToMap(
::chart::tPropertyValueMap & rOutMap )
{
- PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATAPOINT_COLOR, 0x0099ccff ); // blue 8
- PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_TRANSPARENCY, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_COLOR, Color(0x99, 0xcc, 0xff) ); // blue 8
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_TRANSPARENCY, sal_Int16(0) );
//fill
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_FILL_STYLE, drawing::FillStyle_SOLID );
@@ -462,29 +476,29 @@ void DataPointProperties::AddDefaultsToMap(
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_FILL_BACKGROUND, false );
//border
- PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATAPOINT_BORDER_COLOR, 0x000000 ); // black
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_BORDER_COLOR, COL_BLACK );
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_BORDER_STYLE, drawing::LineStyle_SOLID ); // drawing::LineStyle_NONE
- PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATAPOINT_BORDER_WIDTH, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_BORDER_WIDTH, sal_Int32(0) );
PropertyHelper::setEmptyPropertyValueDefault( rOutMap, PROP_DATAPOINT_BORDER_DASH_NAME );
- PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_BORDER_TRANSPARENCY, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_BORDER_TRANSPARENCY, sal_Int16(0) );
//line
PropertyHelper::setPropertyValueDefault( rOutMap, LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_SOLID );
- PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, LinePropertiesHelper::PROP_LINE_WIDTH, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, LinePropertiesHelper::PROP_LINE_WIDTH, sal_Int32(0) );
PropertyHelper::setPropertyValueDefault( rOutMap, LinePropertiesHelper::PROP_LINE_DASH, drawing::LineDash());
PropertyHelper::setEmptyPropertyValueDefault( rOutMap, LinePropertiesHelper::PROP_LINE_DASH_NAME );
PropertyHelper::setPropertyValueDefault( rOutMap, LinePropertiesHelper::PROP_LINE_CAP, drawing::LineCap_BUTT);
//fill bitmap
- PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETX, 0 );
- PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETY, 0 );
- PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETX, 0 );
- PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETY, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETX, sal_Int16(0) );
+ PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETY, sal_Int16(0) );
+ PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETX, sal_Int16(0) );
+ PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETY, sal_Int16(0) );
PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_RECTANGLEPOINT, drawing::RectanglePoint_MIDDLE_MIDDLE );
PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_LOGICALSIZE, true );
- PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEX, 0 );
- PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEY, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEX, sal_Int32(0) );
+ PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEY, sal_Int32(0) );
PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_MODE, drawing::BitmapMode_REPEAT );
//others
@@ -492,19 +506,20 @@ void DataPointProperties::AddDefaultsToMap(
aSymbProp.Style = chart2::SymbolStyle_NONE;
aSymbProp.StandardSymbol = 0;
aSymbProp.Size = awt::Size( 250, 250 ); // ca. 7pt x 7pt (7pt=246.94)
- aSymbProp.BorderColor = 0x000000; // Black
+ aSymbProp.BorderColor = sal_Int32(COL_BLACK);
aSymbProp.FillColor = 0xee4000; // OrangeRed2
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_SYMBOL_PROP, aSymbProp );
- PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_DATAPOINT_OFFSET, 0.0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_OFFSET, 0.0 );
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_GEOMETRY3D, chart2::DataPointGeometry3D::CUBOID );
//@todo maybe choose a different one here -> should be dynamically that of the attached axis
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_ERROR_BAR_X, uno::Reference< beans::XPropertySet >());
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_ERROR_BAR_Y, uno::Reference< beans::XPropertySet >());
- PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_PERCENT_DIAGONAL, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_PERCENT_DIAGONAL, sal_Int16(0) );
- PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_DATAPOINT_TEXT_ROTATION, 0.0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_TEXT_ROTATION, 0.0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_INVERT_NEGATIVE, false );
PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE, true);
@@ -521,17 +536,17 @@ void DataPointProperties::AddDefaultsToMap(
));
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_TEXT_WORD_WRAP, false );
- PropertyHelper::setPropertyValueDefault< OUString >( rOutMap, PROP_DATAPOINT_LABEL_SEPARATOR, " " );
- PropertyHelper::setPropertyValueDefault<sal_Int32>(rOutMap, PROP_DATAPOINT_LABEL_BORDER_STYLE, sal_Int32(drawing::LineStyle_NONE));
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_LABEL_SEPARATOR, u" "_ustr );
+ PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_STYLE, drawing::LineStyle_NONE);
PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_COLOR);
PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_FILL_STYLE);
PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_FILL_COLOR);
PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_FILL_BACKGROUND);
PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_FILL_HATCH_NAME);
- PropertyHelper::setPropertyValueDefault<sal_Int32>(rOutMap, PROP_DATAPOINT_LABEL_BORDER_WIDTH, 0);
+ PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_WIDTH, sal_Int32(0));
PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_DASH, drawing::LineDash());
PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_DASH_NAME);
- PropertyHelper::setPropertyValueDefault<sal_Int16>(rOutMap, PROP_DATAPOINT_LABEL_BORDER_TRANS, 0);
+ PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_TRANS, sal_Int16(0));
uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aFields(0);
PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_CUSTOM_LABEL_FIELDS, aFields);
diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx
index ada7907b888f..fe1969bc5f15 100644
--- a/chart2/source/model/main/DataPointProperties.hxx
+++ b/chart2/source/model/main/DataPointProperties.hxx
@@ -69,6 +69,7 @@ namespace DataPointProperties
PROP_DATAPOINT_LABEL_PLACEMENT,
PROP_DATAPOINT_REFERENCE_DIAGRAM_SIZE,
PROP_DATAPOINT_TEXT_ROTATION,
+ PROP_DATAPOINT_INVERT_NEGATIVE,
// statistics
PROP_DATAPOINT_ERROR_BAR_X,
@@ -87,7 +88,8 @@ namespace DataPointProperties
PROP_DATAPOINT_LABEL_BORDER_DASH_NAME,
PROP_DATAPOINT_LABEL_BORDER_TRANS,
PROP_DATAPOINT_CUSTOM_LABEL_FIELDS,
- PROP_DATAPOINT_LABEL_CUSTOM_POS
+ PROP_DATAPOINT_LABEL_CUSTOM_POS,
+ PROP_DATAPOINT_LABEL_CUSTOM_SIZE
// additionally some properties from ::chart::LineProperties
};
diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx
index d6aa5eebe3e9..a9843f1d423d 100644
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -18,20 +18,26 @@
*/
#include <DataSeries.hxx>
-#include "DataSeriesProperties.hxx"
+#include <DataSeriesProperties.hxx>
#include "DataPointProperties.hxx"
#include <CharacterProperties.hxx>
#include <UserDefinedProperties.hxx>
#include "DataPoint.hxx"
#include <DataSeriesHelper.hxx>
#include <CloneHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include <ModifyListenerHelper.hxx>
-#include <EventListenerHelper.hxx>
+#include <unonames.hxx>
+#include <com/sun/star/chart2/DataPointLabel.hpp>
+#include <com/sun/star/chart2/Symbol.hpp>
+#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <com/sun/star/container/NoSuchElementException.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <rtl/ref.hxx>
+#include <rtl/ustrbuf.hxx>
#include <algorithm>
@@ -44,46 +50,43 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::osl::MutexGuard;
-namespace
+namespace chart
{
-
-struct StaticDataSeriesDefaults : public rtl::StaticWithInit< ::chart::tPropertyValueMap, StaticDataSeriesDefaults >
+const ::chart::tPropertyValueMap & StaticDataSeriesDefaults()
{
- ::chart::tPropertyValueMap operator()()
- {
- ::chart::tPropertyValueMap aStaticDefaults;
- ::chart::DataSeriesProperties::AddDefaultsToMap( aStaticDefaults );
- ::chart::CharacterProperties::AddDefaultsToMap( aStaticDefaults );
- float fDefaultCharHeight = 10.0;
- ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
- ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight );
- ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight );
- return aStaticDefaults;
- }
+ static const ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aMap;
+ ::chart::DataSeriesProperties::AddDefaultsToMap( aMap );
+ ::chart::CharacterProperties::AddDefaultsToMap( aMap );
+ float fDefaultCharHeight = 10.0;
+ ::chart::PropertyHelper::setPropertyValue( aMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( aMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( aMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight );
+ return aMap;
+ }();
+ return aStaticDefaults;
};
+} // namespace chart
-struct StaticDataSeriesInfoHelper : public rtl::StaticWithInit< ::cppu::OPropertyArrayHelper, StaticDataSeriesInfoHelper, StaticDataSeriesInfoHelper, uno::Sequence< Property > >
+namespace
{
- uno::Sequence< Property > operator()()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::DataSeriesProperties::AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
+::cppu::OPropertyArrayHelper& StaticDataSeriesInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper oHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::DataSeriesProperties::AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- return comphelper::containerToSequence( aProperties );
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticDataSeriesInfo : public rtl::StaticWithInit< uno::Reference< beans::XPropertySetInfo >, StaticDataSeriesInfo >
-{
- uno::Reference< beans::XPropertySetInfo > operator()()
- {
- return ::cppu::OPropertySetHelper::createPropertySetInfo(StaticDataSeriesInfoHelper::get() );
- }
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return oHelper;
};
void lcl_SetParent(
@@ -127,24 +130,22 @@ namespace chart
{
DataSeries::DataSeries() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
}
DataSeries::DataSeries( const DataSeries & rOther ) :
impl::DataSeries_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
if( ! rOther.m_aDataSequences.empty())
{
- CloneHelper::CloneRefVector<css::chart2::data::XLabeledDataSequence>(
- rOther.m_aDataSequences, m_aDataSequences );
+ CloneHelper::CloneRefVector(rOther.m_aDataSequences, m_aDataSequences );
ModifyListenerHelper::addListenerToAllElements( m_aDataSequences, m_xModifyEventForwarder );
}
- CloneHelper::CloneRefVector< chart2::XRegressionCurve >( rOther.m_aRegressionCurves, m_aRegressionCurves );
+ CloneHelper::CloneRefVector( rOther.m_aRegressionCurves, m_aRegressionCurves );
ModifyListenerHelper::addListenerToAllElements( m_aRegressionCurves, m_xModifyEventForwarder );
// add as listener to XPropertySet properties
@@ -165,9 +166,6 @@ DataSeries::DataSeries( const DataSeries & rOther ) :
// late initialization to call after copy-constructing
void DataSeries::Init( const DataSeries & rOther )
{
- if( ! rOther.m_aDataSequences.empty())
- EventListenerHelper::addListenerToAllElements( m_aDataSequences, this );
-
Reference< uno::XInterface > xThisInterface( static_cast< ::cppu::OWeakObject * >( this ));
if( ! rOther.m_aAttributedDataPoints.empty())
{
@@ -232,7 +230,7 @@ uno::Reference< util::XCloneable > SAL_CALL DataSeries::createClone()
// ____ OPropertySet ____
void DataSeries::GetDefaultValue( sal_Int32 nHandle, uno::Any& rDest ) const
{
- const tPropertyValueMap& rStaticDefaults = StaticDataSeriesDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticDataSeriesDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rDest.clear();
@@ -243,13 +241,15 @@ void DataSeries::GetDefaultValue( sal_Int32 nHandle, uno::Any& rDest ) const
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL DataSeries::getInfoHelper()
{
- return StaticDataSeriesInfoHelper::get();
+ return StaticDataSeriesInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL DataSeries::getPropertySetInfo()
{
- return StaticDataSeriesInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropSetInfo =
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticDataSeriesInfoHelper() );
+ return xPropSetInfo;
}
void SAL_CALL DataSeries::getFastPropertyValue
@@ -283,7 +283,7 @@ void SAL_CALL DataSeries::setFastPropertyValue_NoBroadcast(
ModifyListenerHelper::removeListener( xBroadcaster, m_xModifyEventForwarder );
}
- OSL_ASSERT( rValue.getValueType().getTypeClass() == uno::TypeClass_INTERFACE );
+ OSL_ASSERT( rValue.getValueTypeClass() == uno::TypeClass_INTERFACE );
if( rValue.hasValue() &&
(rValue >>= xBroadcaster) &&
xBroadcaster.is())
@@ -300,14 +300,14 @@ Reference< beans::XPropertySet >
{
Reference< beans::XPropertySet > xResult;
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences;
{
MutexGuard aGuard( m_aMutex );
- aSequences = comphelper::containerToSequence( m_aDataSequences );
+ aSequences = m_aDataSequences;
}
- std::vector< Reference< chart2::data::XLabeledDataSequence > > aValuesSeries(
- DataSeriesHelper::getAllDataSequencesByRole( aSequences , "values" ) );
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aValuesSeries(
+ DataSeriesHelper::getAllDataSequencesByRole( aSequences , u"values"_ustr ) );
if (aValuesSeries.empty())
throw lang::IndexOutOfBoundsException();
@@ -324,7 +324,7 @@ Reference< beans::XPropertySet >
if( !xResult.is() )
{
Reference< beans::XPropertySet > xParentProperties;
- Reference< util::XModifyListener > xModifyEventForwarder;
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
{
MutexGuard aGuard( m_aMutex );
xParentProperties = this;
@@ -347,7 +347,7 @@ Reference< beans::XPropertySet >
void SAL_CALL DataSeries::resetDataPoint( sal_Int32 nIndex )
{
Reference< beans::XPropertySet > xDataPointProp;
- Reference< util::XModifyListener > xModifyEventForwarder;
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
{
MutexGuard aGuard( m_aMutex );
xModifyEventForwarder = m_xModifyEventForwarder;
@@ -371,7 +371,7 @@ void SAL_CALL DataSeries::resetDataPoint( sal_Int32 nIndex )
void SAL_CALL DataSeries::resetAllDataPoints()
{
tDataPointAttributeContainer aOldAttributedDataPoints;
- Reference< util::XModifyListener > xModifyEventForwarder;
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
{
MutexGuard aGuard( m_aMutex );
xModifyEventForwarder = m_xModifyEventForwarder;
@@ -387,44 +387,67 @@ void SAL_CALL DataSeries::setData( const uno::Sequence< Reference< chart2::data:
{
tDataSequenceContainer aOldDataSequences;
tDataSequenceContainer aNewDataSequences;
- Reference< util::XModifyListener > xModifyEventForwarder;
- Reference< lang::XEventListener > xListener;
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
{
MutexGuard aGuard( m_aMutex );
xModifyEventForwarder = m_xModifyEventForwarder;
- xListener = this;
std::swap( aOldDataSequences, m_aDataSequences );
- aNewDataSequences = comphelper::sequenceToContainer<tDataSequenceContainer>( aData );
+ for (const auto & i : aData)
+ {
+ aNewDataSequences.push_back(i);
+ }
m_aDataSequences = aNewDataSequences;
}
ModifyListenerHelper::removeListenerFromAllElements( aOldDataSequences, xModifyEventForwarder );
- EventListenerHelper::removeListenerFromAllElements( aOldDataSequences, xListener );
- EventListenerHelper::addListenerToAllElements( aNewDataSequences, xListener );
ModifyListenerHelper::addListenerToAllElements( aNewDataSequences, xModifyEventForwarder );
fireModifyEvent();
}
+void DataSeries::setData( const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > >& aData )
+{
+ tDataSequenceContainer aOldDataSequences;
+ tDataSequenceContainer aNewDataSequences;
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
+ {
+ MutexGuard aGuard( m_aMutex );
+ xModifyEventForwarder = m_xModifyEventForwarder;
+ std::swap( aOldDataSequences, m_aDataSequences );
+ aNewDataSequences = aData;
+ m_aDataSequences = aNewDataSequences;
+ }
+ ModifyListenerHelper::removeListenerFromAllElements( aOldDataSequences, xModifyEventForwarder );
+ ModifyListenerHelper::addListenerToAllElements( aNewDataSequences, xModifyEventForwarder );
+ fireModifyEvent();
+}
+
+void DataSeries::addDataSequence(css::uno::Reference<css::chart2::data::XLabeledDataSequence> const& rSequence)
+{
+ m_aDataSequences.push_back(rSequence);
+}
+
// ____ XDataSource ____
Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL DataSeries::getDataSequences()
{
MutexGuard aGuard( m_aMutex );
- return comphelper::containerToSequence( m_aDataSequences );
+ return comphelper::containerToSequence<Reference< chart2::data::XLabeledDataSequence >>( m_aDataSequences );
}
// ____ XRegressionCurveContainer ____
void SAL_CALL DataSeries::addRegressionCurve(
const uno::Reference< chart2::XRegressionCurve >& xRegressionCurve )
{
- Reference< util::XModifyListener > xModifyEventForwarder;
+ auto pRegressionCurve = dynamic_cast<RegressionCurveModel*>(xRegressionCurve.get());
+ assert(pRegressionCurve);
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
{
MutexGuard aGuard( m_aMutex );
xModifyEventForwarder = m_xModifyEventForwarder;
- if( std::find( m_aRegressionCurves.begin(), m_aRegressionCurves.end(), xRegressionCurve )
+ if( std::find( m_aRegressionCurves.begin(), m_aRegressionCurves.end(), pRegressionCurve )
!= m_aRegressionCurves.end())
- throw lang::IllegalArgumentException("curve not found", static_cast<cppu::OWeakObject*>(this), 1);
- m_aRegressionCurves.push_back( xRegressionCurve );
+ throw lang::IllegalArgumentException(u"curve not found"_ustr, static_cast<cppu::OWeakObject*>(this), 1);
+ m_aRegressionCurves.push_back( pRegressionCurve );
}
- ModifyListenerHelper::addListener( xRegressionCurve, xModifyEventForwarder );
+ ModifyListenerHelper::addListener( rtl::Reference<RegressionCurveModel>(pRegressionCurve), xModifyEventForwarder );
fireModifyEvent();
}
@@ -433,36 +456,44 @@ void SAL_CALL DataSeries::removeRegressionCurve(
{
if( !xRegressionCurve.is() )
throw container::NoSuchElementException();
+ auto pRegressionCurve = dynamic_cast<RegressionCurveModel*>(xRegressionCurve.get());
+ assert(pRegressionCurve);
- Reference< util::XModifyListener > xModifyEventForwarder;
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
{
MutexGuard aGuard( m_aMutex );
xModifyEventForwarder = m_xModifyEventForwarder;
tRegressionCurveContainerType::iterator aIt(
- std::find( m_aRegressionCurves.begin(), m_aRegressionCurves.end(), xRegressionCurve ) );
+ std::find( m_aRegressionCurves.begin(), m_aRegressionCurves.end(), pRegressionCurve ) );
if( aIt == m_aRegressionCurves.end())
throw container::NoSuchElementException(
- "The given regression curve is no element of this series",
+ u"The given regression curve is no element of this series"_ustr,
static_cast< uno::XWeak * >( this ));
m_aRegressionCurves.erase( aIt );
}
- ModifyListenerHelper::removeListener( xRegressionCurve, xModifyEventForwarder );
+ ModifyListenerHelper::removeListener( rtl::Reference<RegressionCurveModel>(pRegressionCurve), xModifyEventForwarder );
fireModifyEvent();
}
uno::Sequence< uno::Reference< chart2::XRegressionCurve > > SAL_CALL DataSeries::getRegressionCurves()
{
MutexGuard aGuard( m_aMutex );
- return comphelper::containerToSequence( m_aRegressionCurves );
+ return comphelper::containerToSequence<uno::Reference< chart2::XRegressionCurve >>( m_aRegressionCurves );
}
void SAL_CALL DataSeries::setRegressionCurves(
const Sequence< Reference< chart2::XRegressionCurve > >& aRegressionCurves )
{
tRegressionCurveContainerType aOldCurves;
- auto aNewCurves( comphelper::sequenceToContainer<tRegressionCurveContainerType>( aRegressionCurves ) );
- Reference< util::XModifyListener > xModifyEventForwarder;
+ tRegressionCurveContainerType aNewCurves;
+ for (const auto & i : aRegressionCurves)
+ {
+ auto pRegressionCurve = dynamic_cast<RegressionCurveModel*>(i.get());
+ assert(pRegressionCurve);
+ aNewCurves.push_back(pRegressionCurve);
+ }
+ rtl::Reference< ModifyEventForwarder > xModifyEventForwarder;
{
MutexGuard aGuard( m_aMutex );
xModifyEventForwarder = m_xModifyEventForwarder;
@@ -492,13 +523,8 @@ void SAL_CALL DataSeries::modified( const lang::EventObject& aEvent )
}
// ____ XEventListener (base of XModifyListener) ____
-void SAL_CALL DataSeries::disposing( const lang::EventObject& rEventObject )
+void SAL_CALL DataSeries::disposing( const lang::EventObject& )
{
- // forget disposed data sequences
- tDataSequenceContainer::iterator aIt(
- std::find( m_aDataSequences.begin(), m_aDataSequences.end(), rEventObject.Source ));
- if( aIt != m_aDataSequences.end())
- m_aDataSequences.erase( aIt );
}
// ____ OPropertySet ____
@@ -521,7 +547,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( DataSeries, DataSeries_Base, OPropertySet )
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
OUString SAL_CALL DataSeries::getImplementationName()
{
- return "com.sun.star.comp.chart.DataSeries";
+ return u"com.sun.star.comp.chart.DataSeries"_ustr;
}
sal_Bool SAL_CALL DataSeries::supportsService( const OUString& rServiceName )
@@ -532,9 +558,486 @@ sal_Bool SAL_CALL DataSeries::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL DataSeries::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.DataSeries",
- "com.sun.star.chart2.DataPointProperties",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.DataSeries"_ustr,
+ u"com.sun.star.chart2.DataPointProperties"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
+}
+
+static Reference< chart2::data::XLabeledDataSequence > lcl_findLSequenceWithOnlyLabel(
+ const Sequence< Reference< chart2::data::XLabeledDataSequence > > & rDataSequences )
+{
+ Reference< chart2::data::XLabeledDataSequence > xResult;
+
+ for( auto const & labeledData : rDataSequences )
+ {
+ OSL_ENSURE( labeledData.is(), "empty LabeledDataSequence" );
+ // no values are set but a label exists
+ if( labeledData.is() &&
+ ( ! labeledData->getValues().is() &&
+ labeledData->getLabel().is()))
+ {
+ xResult.set( labeledData );
+ break;
+ }
+ }
+
+ return xResult;
+}
+
+static OUString lcl_getDataSequenceLabel( const Reference< chart2::data::XDataSequence > & xSequence )
+{
+ OUString aResult;
+
+ Reference< chart2::data::XTextualDataSequence > xTextSeq( xSequence, uno::UNO_QUERY );
+ if( xTextSeq.is())
+ {
+ Sequence< OUString > aSeq( xTextSeq->getTextualData());
+
+ const sal_Int32 nMax = aSeq.getLength() - 1;
+ OUStringBuffer aBuf;
+
+ for( sal_Int32 i = 0; i <= nMax; ++i )
+ {
+ aBuf.append( aSeq[i] );
+ if( i < nMax )
+ aBuf.append( ' ');
+ }
+ aResult = aBuf.makeStringAndClear();
+ }
+ else if( xSequence.is())
+ {
+ Sequence< uno::Any > aSeq( xSequence->getData());
+
+ const sal_Int32 nMax = aSeq.getLength() - 1;
+ OUString aVal;
+ OUStringBuffer aBuf;
+ double fNum = 0;
+
+ for( sal_Int32 i = 0; i <= nMax; ++i )
+ {
+ if( aSeq[i] >>= aVal )
+ {
+ aBuf.append( aVal );
+ if( i < nMax )
+ aBuf.append( ' ');
+ }
+ else if( aSeq[ i ] >>= fNum )
+ {
+ aBuf.append( fNum );
+ if( i < nMax )
+ aBuf.append( ' ');
+ }
+ }
+ aResult = aBuf.makeStringAndClear();
+ }
+
+ return aResult;
+}
+
+static OUString getLabelForLabeledDataSequence(
+ const Reference< chart2::data::XLabeledDataSequence > & xLabeledSeq )
+{
+ OUString aResult;
+ if( xLabeledSeq.is())
+ {
+ Reference< chart2::data::XDataSequence > xSeq( xLabeledSeq->getLabel());
+ if( xSeq.is() )
+ aResult = lcl_getDataSequenceLabel( xSeq );
+ if( !xSeq.is() || aResult.isEmpty() )
+ {
+ // no label set or label content is empty -> use auto-generated one
+ Reference< chart2::data::XDataSequence > xValueSeq( xLabeledSeq->getValues() );
+ if( xValueSeq.is() )
+ {
+ Sequence< OUString > aLabels( xValueSeq->generateLabel(
+ chart2::data::LabelOrigin_SHORT_SIDE ) );
+ // no labels returned is interpreted as: auto-generation not
+ // supported by sequence
+ if( aLabels.hasElements() )
+ aResult=aLabels[0];
+ else
+ {
+ //todo?: maybe use the index of the series as name
+ //but as the index may change it would be better to have such a name persistent
+ //what is not possible at the moment
+ //--> maybe use the identifier as part of the name ...
+ aResult = lcl_getDataSequenceLabel( xValueSeq );
+ }
+ }
+ }
+ }
+ return aResult;
+}
+
+OUString DataSeries::getLabelForRole( const OUString & rLabelSequenceRole )
+{
+ OUString aResult;
+
+ Reference< chart2::data::XLabeledDataSequence > xLabeledSeq(
+ ::chart::DataSeriesHelper::getDataSequenceByRole( this, rLabelSequenceRole ));
+ if( xLabeledSeq.is())
+ aResult = getLabelForLabeledDataSequence( xLabeledSeq );
+ else
+ {
+ // special case: labeled data series with only a label and no values may
+ // serve as label
+ xLabeledSeq.set( lcl_findLSequenceWithOnlyLabel( getDataSequences() ));
+ if( xLabeledSeq.is())
+ {
+ Reference< chart2::data::XDataSequence > xSeq( xLabeledSeq->getLabel());
+ if( xSeq.is())
+ aResult = lcl_getDataSequenceLabel( xSeq );
+ }
+ }
+
+ return aResult;
+}
+
+static bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
+{
+ if (!xDataSequence.is())
+ return false;
+ uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ uno::Sequence< sal_Int32 > aHiddenValues;
+ try
+ {
+ xProp->getPropertyValue( u"HiddenValues"_ustr ) >>= aHiddenValues;
+ if( !aHiddenValues.hasElements() )
+ return true;
+ }
+ catch( const uno::Exception& )
+ {
+ return true;
+ }
+ }
+ return xDataSequence->getData().hasElements();
+}
+
+bool DataSeries::hasUnhiddenData()
+{
+ MutexGuard aGuard( m_aMutex );
+
+ for(uno::Reference< chart2::data::XLabeledDataSequence > const & rDataSequence : m_aDataSequences)
+ {
+ if( !rDataSequence.is() )
+ continue;
+ if( lcl_SequenceHasUnhiddenData( rDataSequence->getValues() ) )
+ return true;
+ }
+ return false;
+}
+
+bool DataSeries::hasPointOwnColor(
+ sal_Int32 nPointIndex
+ , const css::uno::Reference< css::beans::XPropertySet >& xDataPointProperties //may be NULL this is just for performance
+ )
+{
+ if( hasPointOwnProperties( nPointIndex ))
+ {
+ uno::Reference< beans::XPropertyState > xPointState( xDataPointProperties, uno::UNO_QUERY );
+ if( !xPointState.is() )
+ {
+ xPointState.set( getDataPointByIndex( nPointIndex ), uno::UNO_QUERY );
+ }
+ if( !xPointState.is() )
+ return false;
+
+ return (xPointState->getPropertyState( u"Color"_ustr) != beans::PropertyState_DEFAULT_VALUE );
+ }
+
+ return false;
+}
+
+bool DataSeries::hasPointOwnProperties( sal_Int32 nPointIndex )
+{
+ MutexGuard aGuard( m_aMutex );
+ return m_aAttributedDataPoints.find(nPointIndex) != m_aAttributedDataPoints.end();
+}
+
+sal_Int32 DataSeries::getAttachedAxisIndex()
+{
+ sal_Int32 nRet = 0;
+ try
+ {
+ getFastPropertyValue( ::chart::DataSeriesProperties::PROP_DATASERIES_ATTACHED_AXIS_INDEX ) >>= nRet;
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ return nRet;
+}
+
+void DataSeries::switchSymbolsOnOrOff( bool bSymbolsOn, sal_Int32 nSeriesIndex )
+{
+ css::chart2::Symbol aSymbProp;
+ if( getPropertyValue( u"Symbol"_ustr) >>= aSymbProp )
+ {
+ if( !bSymbolsOn )
+ aSymbProp.Style = chart2::SymbolStyle_NONE;
+ else if( aSymbProp.Style == chart2::SymbolStyle_NONE )
+ {
+ aSymbProp.Style = chart2::SymbolStyle_STANDARD;
+ aSymbProp.StandardSymbol = nSeriesIndex;
+ }
+ setPropertyValue( u"Symbol"_ustr, uno::Any( aSymbProp ));
+ }
+ //todo: check attributed data points
+}
+
+void DataSeries::switchLinesOnOrOff( bool bLinesOn )
+{
+ if( bLinesOn )
+ {
+ // keep line-styles that are not NONE
+ css::drawing::LineStyle eLineStyle;
+ if( (getPropertyValue( u"LineStyle"_ustr) >>= eLineStyle ) &&
+ eLineStyle == drawing::LineStyle_NONE )
+ {
+ setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_SOLID ) );
+ }
+ }
+ else
+ setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
+}
+
+void DataSeries::makeLinesThickOrThin( bool bThick )
+{
+ sal_Int32 nNewValue = bThick ? 80 : 0;
+ sal_Int32 nOldValue = 0;
+ if( (getPropertyValue( u"LineWidth"_ustr) >>= nOldValue ) &&
+ nOldValue != nNewValue )
+ {
+ if( !(bThick && nOldValue>0))
+ setPropertyValue( u"LineWidth"_ustr, uno::Any( nNewValue ) );
+ }
+}
+
+void DataSeries::setPropertyAlsoToAllAttributedDataPoints( const OUString& rPropertyName, const uno::Any& rPropertyValue )
+{
+ setPropertyValue( rPropertyName, rPropertyValue );
+
+ std::vector<sal_Int32> aAttributedDataPointIndexList;
+ {
+ MutexGuard aGuard( m_aMutex );
+ aAttributedDataPointIndexList.reserve(m_aAttributedDataPoints.size());
+ for (const auto & rPair : m_aAttributedDataPoints)
+ aAttributedDataPointIndexList.push_back(rPair.first);
+ }
+
+ for(sal_Int32 nIdx : aAttributedDataPointIndexList)
+ {
+ Reference< beans::XPropertySet > xPointProp( getDataPointByIndex(nIdx) );
+ if(!xPointProp.is())
+ continue;
+ xPointProp->setPropertyValue( rPropertyName, rPropertyValue );
+ if( rPropertyName == "LabelPlacement" )
+ {
+ xPointProp->setPropertyValue(u"CustomLabelPosition"_ustr, uno::Any());
+ xPointProp->setPropertyValue(u"CustomLabelSize"_ustr, uno::Any());
+ }
+ }
+}
+
+bool DataSeries::hasAttributedDataPointDifferentValue(
+ const OUString& rPropertyName, const uno::Any& rPropertyValue )
+{
+ std::vector<sal_Int32> aAttributedDataPointIndexList;
+ {
+ MutexGuard aGuard( m_aMutex );
+ aAttributedDataPointIndexList.reserve(m_aAttributedDataPoints.size());
+ for (const auto & rPair : m_aAttributedDataPoints)
+ aAttributedDataPointIndexList.push_back(rPair.first);
+ }
+
+ for(sal_Int32 nIdx : aAttributedDataPointIndexList)
+ {
+ Reference< beans::XPropertySet > xPointProp( getDataPointByIndex(nIdx) );
+ if(!xPointProp.is())
+ continue;
+ uno::Any aPointValue( xPointProp->getPropertyValue( rPropertyName ) );
+ if( rPropertyValue != aPointValue )
+ return true;
+ }
+
+ return false;
+}
+
+bool DataSeries::hasDataLabelsAtSeries()
+{
+ bool bRet = false;
+ try
+ {
+ chart2::DataPointLabel aLabel;
+ if( getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel )
+ bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent || aLabel.ShowCategoryName
+ || aLabel.ShowSeriesName;
+ }
+ catch(const uno::Exception &)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
+ return bRet;
+}
+
+bool DataSeries::hasDataLabelsAtPoints()
+{
+ bool bRet = false;
+ try
+ {
+ std::vector<sal_Int32> aAttributedDataPointIndexList;
+ {
+ MutexGuard aGuard( m_aMutex );
+ aAttributedDataPointIndexList.reserve(m_aAttributedDataPoints.size());
+ for (const auto & rPair : m_aAttributedDataPoints)
+ aAttributedDataPointIndexList.push_back(rPair.first);
+ }
+ for(sal_Int32 nIdx : aAttributedDataPointIndexList)
+ {
+ Reference< beans::XPropertySet > xPointProp( getDataPointByIndex(nIdx) );
+ if( xPointProp.is() )
+ {
+ chart2::DataPointLabel aLabel;
+ if( xPointProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel )
+ bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent
+ || aLabel.ShowCategoryName || aLabel.ShowCustomLabel
+ || aLabel.ShowSeriesName;
+ if( bRet )
+ break;
+ }
+ }
+ }
+ catch(const uno::Exception &)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
+ return bRet;
+}
+
+bool DataSeries::hasDataLabelAtPoint( sal_Int32 nPointIndex )
+{
+ bool bRet = false;
+ try
+ {
+ Reference< beans::XPropertySet > xProp;
+ bool bFound = false;
+ {
+ MutexGuard aGuard( m_aMutex );
+ bFound = m_aAttributedDataPoints.find(nPointIndex) != m_aAttributedDataPoints.end();
+ }
+ if (bFound)
+ xProp = getDataPointByIndex(nPointIndex);
+ else
+ xProp = this;
+ if( xProp.is() )
+ {
+ chart2::DataPointLabel aLabel;
+ if( xProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel )
+ bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent
+ || aLabel.ShowCategoryName || aLabel.ShowCustomLabel
+ || aLabel.ShowSeriesName;
+ }
+ }
+ catch(const uno::Exception &)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
+ return bRet;
+}
+
+void DataSeries::insertDataLabelsToSeriesAndAllPoints()
+{
+ impl_insertOrDeleteDataLabelsToSeriesAndAllPoints( true /*bInsert*/ );
+}
+
+void DataSeries::deleteDataLabelsFromSeriesAndAllPoints()
+{
+ impl_insertOrDeleteDataLabelsToSeriesAndAllPoints( false /*bInsert*/ );
+}
+
+void DataSeries::impl_insertOrDeleteDataLabelsToSeriesAndAllPoints( bool bInsert )
+{
+ try
+ {
+ chart2::DataPointLabel aLabelAtSeries;
+ getPropertyValue(CHART_UNONAME_LABEL) >>= aLabelAtSeries;
+ aLabelAtSeries.ShowNumber = bInsert;
+ if( !bInsert )
+ {
+ aLabelAtSeries.ShowNumberInPercent = false;
+ aLabelAtSeries.ShowCategoryName = false;
+ }
+ setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabelAtSeries));
+ std::vector<sal_Int32> aAttributedDataPointIndexList;
+ {
+ MutexGuard aGuard( m_aMutex );
+ aAttributedDataPointIndexList.reserve(m_aAttributedDataPoints.size());
+ for (const auto & rPair : m_aAttributedDataPoints)
+ aAttributedDataPointIndexList.push_back(rPair.first);
+ }
+ for(sal_Int32 nIdx : aAttributedDataPointIndexList)
+ {
+ Reference< beans::XPropertySet > xPointProp( getDataPointByIndex(nIdx) );
+ if( xPointProp.is() )
+ {
+ chart2::DataPointLabel aLabel;
+ xPointProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel;
+ aLabel.ShowNumber = bInsert;
+ if( !bInsert )
+ {
+ aLabel.ShowNumberInPercent = false;
+ aLabel.ShowCategoryName = false;
+ aLabel.ShowCustomLabel = false;
+ aLabel.ShowSeriesName = false;
+ }
+ xPointProp->setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabel));
+ xPointProp->setPropertyValue(CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
+ }
+ }
+ }
+ catch(const uno::Exception &)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
+}
+
+sal_Int32 DataSeries::getExplicitNumberFormatKeyForDataLabel()
+{
+ sal_Int32 nFormat = 0;
+ try
+ {
+ bool bLinkToSource = true;
+ getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
+ getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat;
+
+ if (bLinkToSource)
+ {
+ MutexGuard aGuard( m_aMutex );
+
+ if (!m_aDataSequences.empty())
+ {
+ Reference<chart2::data::XLabeledDataSequence> xLabeledSeq(m_aDataSequences[0]);
+ if( xLabeledSeq.is() )
+ {
+ Reference< chart2::data::XDataSequence > xSeq( xLabeledSeq->getValues());
+ if( xSeq.is() )
+ {
+ nFormat = xSeq->getNumberFormatKeyByIndex( -1 );
+ }
+ }
+ }
+ }
+ }
+ catch (const beans::UnknownPropertyException&)
+ {
+ }
+
+ if (nFormat < 0)
+ nFormat = 0;
+ return nFormat;
+
}
} // namespace chart
diff --git a/chart2/source/model/main/DataSeriesProperties.cxx b/chart2/source/model/main/DataSeriesProperties.cxx
index d85d264753c1..c558b3820cab 100644
--- a/chart2/source/model/main/DataSeriesProperties.cxx
+++ b/chart2/source/model/main/DataSeriesProperties.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "DataSeriesProperties.hxx"
+#include <DataSeriesProperties.hxx>
#include "DataPointProperties.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
@@ -75,6 +75,12 @@ void DataSeriesProperties::AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( "InvertNegative",
+ PROP_DATASERIES_INVERT_NEGATIVE,
+ cppu::UnoType<sal_Bool>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
+
// add properties of service DataPointProperties
DataPointProperties::AddPropertiesToVector( rOutProperties );
}
@@ -84,9 +90,10 @@ void DataSeriesProperties::AddDefaultsToMap(
{
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING );
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false );
- PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, sal_Int32(0) );
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_SHOW_LEGEND_ENTRY, true );
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES, true );
+ PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_INVERT_NEGATIVE, false );
// PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
diff --git a/chart2/source/model/main/DataTable.cxx b/chart2/source/model/main/DataTable.cxx
new file mode 100644
index 000000000000..01aa023ed977
--- /dev/null
+++ b/chart2/source/model/main/DataTable.cxx
@@ -0,0 +1,210 @@
+/* -*- 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 <DataTable.hxx>
+
+#include <LinePropertiesHelper.hxx>
+#include <FillProperties.hxx>
+#include <CharacterProperties.hxx>
+#include <ModifyListenerHelper.hxx>
+#include <PropertyHelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
+
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+#include <algorithm>
+
+using namespace css;
+
+namespace
+{
+/** DataTable Properties */
+enum
+{
+ DataTableProperty_HorizontalBorder,
+ DataTableProperty_VerticalBorder,
+ DataTableProperty_Outilne,
+ DataTableProperty_Keys,
+};
+
+void lcl_AddPropertiesToVector(std::vector<beans::Property>& rProps)
+{
+ auto const nBound = beans::PropertyAttribute::BOUND;
+ auto const nMaybeDefault = beans::PropertyAttribute::MAYBEDEFAULT;
+
+ rProps.emplace_back("HBorder", DataTableProperty_HorizontalBorder, cppu::UnoType<bool>::get(),
+ nBound | nMaybeDefault);
+ rProps.emplace_back("VBorder", DataTableProperty_VerticalBorder, cppu::UnoType<bool>::get(),
+ nBound | nMaybeDefault);
+ rProps.emplace_back("Outline", DataTableProperty_Outilne, cppu::UnoType<bool>::get(),
+ nBound | nMaybeDefault);
+ rProps.emplace_back("Keys", DataTableProperty_Keys, cppu::UnoType<bool>::get(),
+ nBound | nMaybeDefault);
+}
+
+const ::chart::tPropertyValueMap& StaticDataTableDefaults()
+{
+ static ::chart::tPropertyValueMap aStaticDefaults = []() {
+ ::chart::tPropertyValueMap aMap;
+ ::chart::LinePropertiesHelper::AddDefaultsToMap(aMap);
+ ::chart::FillProperties::AddDefaultsToMap(aMap);
+ ::chart::CharacterProperties::AddDefaultsToMap(aMap);
+
+ ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_HorizontalBorder,
+ false);
+ ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_VerticalBorder,
+ false);
+ ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Outilne, false);
+ ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Keys, false);
+
+ ::chart::PropertyHelper::setPropertyValue(
+ aMap, ::chart::LinePropertiesHelper::PROP_LINE_WIDTH, uno::Any(sal_Int32(1)));
+
+ ::chart::PropertyHelper::setPropertyValueDefault(
+ aMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE);
+
+ float fDefaultCharHeight = 10.0;
+ ::chart::PropertyHelper::setPropertyValue(
+ aMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight);
+ ::chart::PropertyHelper::setPropertyValue(
+ aMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight);
+ ::chart::PropertyHelper::setPropertyValue(
+ aMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight);
+ return aMap;
+ }();
+ return aStaticDefaults;
+};
+
+cppu::OPropertyArrayHelper& StaticDataTableInfoHelper()
+{
+ static cppu::OPropertyArrayHelper aPropHelper = []() {
+ std::vector<beans::Property> aProperties;
+ lcl_AddPropertiesToVector(aProperties);
+ ::chart::LinePropertiesHelper::AddPropertiesToVector(aProperties);
+ ::chart::FillProperties::AddPropertiesToVector(aProperties);
+ ::chart::CharacterProperties::AddPropertiesToVector(aProperties);
+ std::sort(aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess());
+
+ return comphelper::containerToSequence(aProperties);
+ }();
+ return aPropHelper;
+};
+
+} // anonymous namespace
+
+namespace chart
+{
+DataTable::DataTable()
+ : m_xModifyEventForwarder(new ModifyEventForwarder())
+{
+}
+
+DataTable::DataTable(const DataTable& rOther)
+ : DataTable_Base(rOther)
+ , ::property::OPropertySet(rOther)
+ , m_xModifyEventForwarder(new ModifyEventForwarder())
+{
+}
+
+DataTable::~DataTable() = default;
+
+// ____ XCloneable ____
+uno::Reference<util::XCloneable> SAL_CALL DataTable::createClone()
+{
+ return uno::Reference<util::XCloneable>(new DataTable(*this));
+}
+
+// ____ XModifyBroadcaster ____
+void SAL_CALL DataTable::addModifyListener(const uno::Reference<util::XModifyListener>& aListener)
+{
+ m_xModifyEventForwarder->addModifyListener(aListener);
+}
+
+void SAL_CALL
+DataTable::removeModifyListener(const uno::Reference<util::XModifyListener>& aListener)
+{
+ m_xModifyEventForwarder->removeModifyListener(aListener);
+}
+
+// ____ XModifyListener ____
+void SAL_CALL DataTable::modified(const lang::EventObject& aEvent)
+{
+ m_xModifyEventForwarder->modified(aEvent);
+}
+
+// ____ XEventListener (base of XModifyListener) ____
+void SAL_CALL DataTable::disposing(const lang::EventObject& /* Source */)
+{
+ // nothing
+}
+
+// ____ OPropertySet ____
+void DataTable::firePropertyChangeEvent()
+{
+ m_xModifyEventForwarder->modified(lang::EventObject(static_cast<uno::XWeak*>(this)));
+}
+
+// ____ OPropertySet ____
+void DataTable::GetDefaultValue(sal_Int32 nHandle, uno::Any& rAny) const
+{
+ const tPropertyValueMap& rStaticDefaults = StaticDataTableDefaults();
+ auto aFound = rStaticDefaults.find(nHandle);
+ if (aFound == rStaticDefaults.end())
+ rAny.clear();
+ else
+ rAny = (*aFound).second;
+}
+
+::cppu::IPropertyArrayHelper& SAL_CALL DataTable::getInfoHelper()
+{
+ return StaticDataTableInfoHelper();
+}
+
+// ____ XPropertySet ____
+uno::Reference<beans::XPropertySetInfo> SAL_CALL DataTable::getPropertySetInfo()
+{
+ static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticDataTableInfoHelper()));
+ return xPropertySetInfo;
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+OUString SAL_CALL DataTable::getImplementationName()
+{
+ return u"com.sun.star.comp.chart2.DataTable"_ustr;
+}
+
+sal_Bool SAL_CALL DataTable::supportsService(const OUString& rServiceName)
+{
+ return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence<OUString> SAL_CALL DataTable::getSupportedServiceNames()
+{
+ return { u"com.sun.star.chart2.DataTable"_ustr, u"com.sun.star.beans.PropertySet"_ustr,
+ u"com.sun.star.drawing.FillProperties"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr,
+ u"com.sun.star.style.CharacterProperties"_ustr };
+}
+
+IMPLEMENT_FORWARD_XINTERFACE2(DataTable, DataTable_Base, ::property::OPropertySet)
+IMPLEMENT_FORWARD_XTYPEPROVIDER2(DataTable, DataTable_Base, ::property::OPropertySet)
+
+} // namespace chart
+
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_chart2_DataTable_get_implementation(
+ css::uno::XComponentContext* /*pComponentContext*/, uno::Sequence<uno::Any> const& /*rAny*/)
+{
+ return cppu::acquire(new ::chart::DataTable);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index 91b4a6b31c7b..d478eec74ba7 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -18,9 +18,16 @@
*/
#include <Diagram.hxx>
+#include <AxisHelper.hxx>
+#include <BaseGFXHelper.hxx>
+#include <ChartTypeHelper.hxx>
#include <ChartTypeManager.hxx>
#include <ChartTypeTemplate.hxx>
+#include <ChartType.hxx>
+#include <DataSeriesHelper.hxx>
#include <PropertyHelper.hxx>
+#include <RegressionCurveHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include "Wall.hxx"
#include <ModifyListenerHelper.hxx>
#include <UserDefinedProperties.hxx>
@@ -31,22 +38,38 @@
#include <SceneProperties.hxx>
#include <unonames.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <Legend.hxx>
+#include <Axis.hxx>
+#include <DataTable.hxx>
+#include <servicenames_charttypes.hxx>
+#include <defines.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
+#include <com/sun/star/chart2/StackingDirection.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
+#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/container/NoSuchElementException.hpp>
+#include <com/sun/star/drawing/ShadeMode.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/CloseVetoException.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <o3tl/safeint.hxx>
+#include <rtl/math.hxx>
+#include <tools/helpers.hxx>
#include <algorithm>
+#include <utility>
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans::PropertyAttribute;
+using namespace ::chart::SceneProperties;
using ::com::sun::star::beans::Property;
using ::com::sun::star::uno::Sequence;
@@ -74,6 +97,8 @@ enum
PROP_DIAGRAM_MISSING_VALUE_TREATMENT,
PROP_DIAGRAM_3DRELATIVEHEIGHT,
PROP_DIAGRAM_DATATABLEHBORDER,
+ PROP_DIAGRAM_OF_PIE_TYPE,
+ PROP_DIAGRAM_SPLIT_POS,
PROP_DIAGRAM_DATATABLEVBORDER,
PROP_DIAGRAM_DATATABLEOUTLINE,
PROP_DIAGRAM_EXTERNALDATA
@@ -160,21 +185,14 @@ void lcl_AddPropertiesToVector(
PROP_DIAGRAM_3DRELATIVEHEIGHT,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::MAYBEVOID );
- rOutProperties.emplace_back( "DataTableHBorder",
- PROP_DIAGRAM_DATATABLEHBORDER,
- cppu::UnoType<bool>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "DataTableVBorder",
- PROP_DIAGRAM_DATATABLEVBORDER,
- cppu::UnoType<bool>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "DataTableOutline",
- PROP_DIAGRAM_DATATABLEOUTLINE,
- cppu::UnoType<bool>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( "SubPieType",
+ PROP_DIAGRAM_OF_PIE_TYPE,
+ cppu::UnoType<chart2::PieChartSubType>::get(),
+ beans::PropertyAttribute::MAYBEVOID );
+ rOutProperties.emplace_back( "SplitPos",
+ PROP_DIAGRAM_SPLIT_POS,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::MAYBEVOID );
rOutProperties.emplace_back( "ExternalData",
PROP_DIAGRAM_EXTERNALDATA,
cppu::UnoType<OUString>::get(),
@@ -192,11 +210,11 @@ const ::chart::tPropertyValueMap& StaticDiagramDefaults()
::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true );
::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true );
::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
- ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_DIAGRAM_DATATABLEHBORDER, false );
- ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_DIAGRAM_DATATABLEVBORDER, false );
- ::chart::PropertyHelper::setPropertyValueDefault( aMap, PROP_DIAGRAM_DATATABLEOUTLINE, false );
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_DIAGRAM_3DRELATIVEHEIGHT, 100 );
+ ::chart::PropertyHelper::setPropertyValueDefault< chart2::PieChartSubType >( aMap, PROP_DIAGRAM_OF_PIE_TYPE,
+ chart2::PieChartSubType_NONE);
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_DIAGRAM_SPLIT_POS, 2 );
::chart::SceneProperties::AddDefaultsToMap( aMap );
return aMap;
}();
@@ -245,9 +263,8 @@ void lcl_CloneCoordinateSystems(
namespace chart
{
-Diagram::Diagram( uno::Reference< uno::XComponentContext > const & xContext ) :
- ::property::OPropertySet( m_aMutex ),
- m_xContext( xContext ),
+Diagram::Diagram( uno::Reference< uno::XComponentContext > xContext ) :
+ m_xContext(std::move( xContext )),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
// Set camera position to a default position (that should be set hard, so
@@ -255,13 +272,13 @@ Diagram::Diagram( uno::Reference< uno::XComponentContext > const & xContext ) :
// straight ono the scene). These defaults have been acquired from the old
// chart implementation.
setFastPropertyValue_NoBroadcast(
- SceneProperties::PROP_SCENE_CAMERA_GEOMETRY, uno::Any(
+ PROP_SCENE_CAMERA_GEOMETRY, uno::Any(
ThreeDHelper::getDefaultCameraGeometry()));
}
Diagram::Diagram( const Diagram & rOther ) :
impl::Diagram_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xContext( rOther.m_xContext ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
@@ -274,7 +291,10 @@ Diagram::Diagram( const Diagram & rOther ) :
if ( rOther.m_xFloor )
m_xFloor = new Wall( *rOther.m_xFloor );
m_xTitle.set( CloneHelper::CreateRefClone< chart2::XTitle >()( rOther.m_xTitle ));
- m_xLegend.set( CloneHelper::CreateRefClone< chart2::XLegend >()( rOther.m_xLegend ));
+ if (rOther.m_xLegend)
+ m_xLegend = new Legend(*rOther.m_xLegend);
+ if (rOther.m_xDataTable)
+ m_xDataTable = new DataTable(*rOther.m_xDataTable);
if ( m_xWall )
m_xWall->addModifyListener( m_xModifyEventForwarder );
@@ -347,9 +367,22 @@ uno::Reference< chart2::XLegend > SAL_CALL Diagram::getLegend()
return m_xLegend;
}
+rtl::Reference< ::chart::Legend > Diagram::getLegend2() const
+{
+ MutexGuard aGuard( m_aMutex );
+ return m_xLegend;
+}
+
void SAL_CALL Diagram::setLegend( const uno::Reference< chart2::XLegend >& xNewLegend )
{
- Reference< chart2::XLegend > xOldLegend;
+ auto pLegend = dynamic_cast<Legend*>(xNewLegend.get());
+ assert(!xNewLegend || pLegend);
+ setLegend(rtl::Reference< Legend >(pLegend));
+}
+
+void Diagram::setLegend( const rtl::Reference< Legend >& xNewLegend )
+{
+ rtl::Reference< Legend > xOldLegend;
{
MutexGuard aGuard( m_aMutex );
if( m_xLegend == xNewLegend )
@@ -395,13 +428,13 @@ void SAL_CALL Diagram::setDiagramData(
const Sequence< beans::PropertyValue >& aArguments )
{
rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = new ::chart::ChartTypeManager( m_xContext );
- DiagramHelper::tTemplateWithServiceName aTemplateAndService = DiagramHelper::getTemplateForDiagram( this, xChartTypeManager );
+ Diagram::tTemplateWithServiceName aTemplateAndService = getTemplate( xChartTypeManager );
rtl::Reference< ::chart::ChartTypeTemplate > xTemplate( aTemplateAndService.xChartTypeTemplate );
if( !xTemplate.is() )
- xTemplate = xChartTypeManager->createTemplate( "com.sun.star.chart2.template.Column" );
+ xTemplate = xChartTypeManager->createTemplate( u"com.sun.star.chart2.template.Column"_ustr );
if(!xTemplate.is())
return;
- xTemplate->changeDiagramData( this, xDataSource, aArguments );
+ xTemplate->changeDiagramData( rtl::Reference< ::chart::Diagram >(this), xDataSource, aArguments );
}
// ____ XTitled ____
@@ -431,17 +464,118 @@ void SAL_CALL Diagram::setTitleObject( const uno::Reference< chart2::XTitle >& x
// ____ X3DDefaultSetter ____
void SAL_CALL Diagram::set3DSettingsToDefault()
{
- ThreeDHelper::set3DSettingsToDefault( this );
+ setPropertyToDefault( u"D3DSceneDistance"_ustr);
+ setPropertyToDefault( u"D3DSceneFocalLength"_ustr);
+ setDefaultRotation();
+ setDefaultIllumination();
}
void SAL_CALL Diagram::setDefaultRotation()
{
- ThreeDHelper::setDefaultRotation( this );
+ bool bPieOrDonut( isPieOrDonutChart() );
+ setDefaultRotation( bPieOrDonut );
+}
+
+static ::basegfx::B3DHomMatrix lcl_getCompleteRotationMatrix( Diagram& rDiagram )
+{
+ ::basegfx::B3DHomMatrix aCompleteRotation;
+ double fXAngleRad=0.0;
+ double fYAngleRad=0.0;
+ double fZAngleRad=0.0;
+ rDiagram.getRotationAngle( fXAngleRad, fYAngleRad, fZAngleRad );
+ aCompleteRotation.rotate( fXAngleRad, fYAngleRad, fZAngleRad );
+ return aCompleteRotation;
+}
+static void lcl_RotateLightSource( Diagram& rDiagram
+ , int nLightSourceDirectionProp
+ , int nLightSourceOnProp
+ , const ::basegfx::B3DHomMatrix& rRotationMatrix )
+{
+ bool bLightOn = false;
+ if( !(rDiagram.getFastPropertyValue( nLightSourceOnProp ) >>= bLightOn) )
+ return;
+
+ if( bLightOn )
+ {
+ drawing::Direction3D aLight;
+ if( rDiagram.getFastPropertyValue( nLightSourceDirectionProp ) >>= aLight )
+ {
+ ::basegfx::B3DVector aLightVector( BaseGFXHelper::Direction3DToB3DVector( aLight ) );
+ aLightVector = rRotationMatrix*aLightVector;
+
+ rDiagram.setFastPropertyValue( nLightSourceDirectionProp
+ , uno::Any( BaseGFXHelper::B3DVectorToDirection3D( aLightVector ) ) );
+ }
+ }
+}
+
+static void lcl_setLightsForScheme( Diagram& rDiagram, const ThreeDLookScheme& rScheme )
+{
+ if( rScheme == ThreeDLookScheme::ThreeDLookScheme_Unknown)
+ return;
+
+ // "D3DSceneLightOn2" / UNO_NAME_3D_SCENE_LIGHTON_2
+ rDiagram.setFastPropertyValue( PROP_SCENE_LIGHT_ON_2, uno::Any( true ) );
+
+ rtl::Reference< ChartType > xChartType( rDiagram.getChartTypeByIndex( 0 ) );
+ uno::Any aADirection( rScheme == ThreeDLookScheme::ThreeDLookScheme_Simple
+ ? ChartTypeHelper::getDefaultSimpleLightDirection(xChartType)
+ : ChartTypeHelper::getDefaultRealisticLightDirection(xChartType) );
+
+ // "D3DSceneLightDirection2" / UNO_NAME_3D_SCENE_LIGHTDIRECTION_2
+ rDiagram.setFastPropertyValue( PROP_SCENE_LIGHT_DIRECTION_2, aADirection );
+ //rotate light direction when right angled axes are off but supported
+ {
+ bool bRightAngledAxes = false;
+ rDiagram.getFastPropertyValue( PROP_DIAGRAM_RIGHT_ANGLED_AXES ) >>= bRightAngledAxes; // "RightAngledAxes"
+ if(!bRightAngledAxes)
+ {
+ if (xChartType.is() ? xChartType->isSupportingRightAngledAxes() : true)
+ {
+ ::basegfx::B3DHomMatrix aRotation( lcl_getCompleteRotationMatrix( rDiagram ) );
+ BaseGFXHelper::ReduceToRotationMatrix( aRotation );
+ // "D3DSceneLightDirection2", "D3DSceneLightOn2"
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_2, PROP_SCENE_LIGHT_ON_2, aRotation );
+ }
+ }
+ }
+
+ sal_Int32 nColor = ::chart::ChartTypeHelper::getDefaultDirectLightColor(
+ rScheme == ThreeDLookScheme::ThreeDLookScheme_Simple, xChartType);
+ // "D3DSceneLightColor2" / UNO_NAME_3D_SCENE_LIGHTCOLOR_2
+ rDiagram.setFastPropertyValue( PROP_SCENE_LIGHT_COLOR_2, uno::Any( nColor ) );
+
+ sal_Int32 nAmbientColor = ::chart::ChartTypeHelper::getDefaultAmbientLightColor(
+ rScheme == ThreeDLookScheme::ThreeDLookScheme_Simple, xChartType);
+ // "D3DSceneAmbientColor" / UNO_NAME_3D_SCENE_AMBIENTCOLOR
+ rDiagram.setFastPropertyValue( PROP_SCENE_AMBIENT_COLOR, uno::Any( nAmbientColor ) );
}
void SAL_CALL Diagram::setDefaultIllumination()
{
- ThreeDHelper::setDefaultIllumination( this );
+ drawing::ShadeMode aShadeMode( drawing::ShadeMode_SMOOTH );
+ try
+ {
+ // "D3DSceneShadeMode"
+ getFastPropertyValue( PROP_SCENE_SHADE_MODE )>>= aShadeMode;
+ // "D3DSceneLightOn1" / UNO_NAME_3D_SCENE_LIGHTON_1
+ setFastPropertyValue( PROP_SCENE_LIGHT_ON_1, uno::Any( false ) );
+ setFastPropertyValue( PROP_SCENE_LIGHT_ON_3, uno::Any( false ) );
+ setFastPropertyValue( PROP_SCENE_LIGHT_ON_4, uno::Any( false ) );
+ setFastPropertyValue( PROP_SCENE_LIGHT_ON_5, uno::Any( false ) );
+ setFastPropertyValue( PROP_SCENE_LIGHT_ON_6, uno::Any( false ) );
+ setFastPropertyValue( PROP_SCENE_LIGHT_ON_7, uno::Any( false ) );
+ setFastPropertyValue( PROP_SCENE_LIGHT_ON_8, uno::Any( false ) );
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ ThreeDLookScheme aScheme = (aShadeMode == drawing::ShadeMode_FLAT)
+ ? ThreeDLookScheme::ThreeDLookScheme_Simple
+ : ThreeDLookScheme::ThreeDLookScheme_Realistic;
+ lcl_setLightsForScheme( *this, aScheme );
}
// ____ XCoordinateSystemContainer ____
@@ -454,7 +588,7 @@ void SAL_CALL Diagram::addCoordinateSystem(
MutexGuard aGuard( m_aMutex );
if( std::find( m_aCoordSystems.begin(), m_aCoordSystems.end(), pCoordSys )
!= m_aCoordSystems.end())
- throw lang::IllegalArgumentException("coordsys not found", static_cast<cppu::OWeakObject*>(this), 1);
+ throw lang::IllegalArgumentException(u"coordsys not found"_ustr, static_cast<cppu::OWeakObject*>(this), 1);
if( !m_aCoordSystems.empty() )
{
@@ -477,7 +611,7 @@ void SAL_CALL Diagram::removeCoordinateSystem(
auto aIt = std::find( m_aCoordSystems.begin(), m_aCoordSystems.end(), pCoordSys );
if( aIt == m_aCoordSystems.end())
throw container::NoSuchElementException(
- "The given coordinate-system is no element of the container",
+ u"The given coordinate-system is no element of the container"_ustr,
static_cast< uno::XWeak * >( this ));
m_aCoordSystems.erase( aIt );
}
@@ -491,6 +625,12 @@ uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > SAL_CALL Diagram::g
return comphelper::containerToSequence<uno::Reference< chart2::XCoordinateSystem >>( m_aCoordSystems );
}
+Diagram::tCoordinateSystemContainerType Diagram::getBaseCoordinateSystems() const
+{
+ MutexGuard aGuard( m_aMutex );
+ return m_aCoordSystems;
+}
+
void SAL_CALL Diagram::setCoordinateSystems(
const Sequence< Reference< chart2::XCoordinateSystem > >& aCoordinateSystems )
{
@@ -515,6 +655,28 @@ void SAL_CALL Diagram::setCoordinateSystems(
fireModifyEvent();
}
+void Diagram::setCoordinateSystems(
+ const std::vector< rtl::Reference< BaseCoordinateSystem > >& aCoordinateSystems )
+{
+ tCoordinateSystemContainerType aNew;
+ tCoordinateSystemContainerType aOld;
+ if( !aCoordinateSystems.empty() )
+ {
+ OSL_ENSURE( aCoordinateSystems.size()<=1, "more than one coordinatesystem is not supported yet by the fileformat" );
+ aNew.push_back( aCoordinateSystems[0] );
+ }
+ {
+ MutexGuard aGuard( m_aMutex );
+ std::swap( aOld, m_aCoordSystems );
+ m_aCoordSystems = aNew;
+ }
+ for (auto & xSystem : aOld)
+ xSystem->removeModifyListener(m_xModifyEventForwarder);
+ for (auto & xSystem : aNew)
+ xSystem->addModifyListener(m_xModifyEventForwarder);
+ fireModifyEvent();
+}
+
// ____ XCloneable ____
Reference< util::XCloneable > SAL_CALL Diagram::createClone()
{
@@ -580,14 +742,14 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL Diagram::getPropertySetInfo()
}
// ____ XFastPropertySet ____
-void SAL_CALL Diagram::setFastPropertyValue( sal_Int32 nHandle, const Any& rValue )
+void SAL_CALL Diagram::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue )
{
//special treatment for some 3D properties
if( nHandle == PROP_DIAGRAM_PERSPECTIVE )
{
sal_Int32 fPerspective = 20;
if( rValue >>=fPerspective )
- ThreeDHelper::setCameraDistance( this, ThreeDHelper::PerspectiveToCameraDistance( fPerspective ) );
+ setCameraDistance( ThreeDHelper::PerspectiveToCameraDistance( fPerspective ) );
}
else if( nHandle == PROP_DIAGRAM_ROTATION_HORIZONTAL
|| nHandle == PROP_DIAGRAM_ROTATION_VERTICAL )
@@ -596,16 +758,16 @@ void SAL_CALL Diagram::setFastPropertyValue( sal_Int32 nHandle, const Any& rValu
if( rValue >>=nNewAngleDegree )
{
sal_Int32 nHorizontal, nVertical;
- ThreeDHelper::getRotationFromDiagram( this, nHorizontal, nVertical );
+ getRotation( nHorizontal, nVertical );
if( nHandle == PROP_DIAGRAM_ROTATION_HORIZONTAL )
nHorizontal = nNewAngleDegree;
else
nVertical = nNewAngleDegree;
- ThreeDHelper::setRotationToDiagram( this, nHorizontal, nVertical );
+ setRotation( nHorizontal, nVertical );
}
}
else
- ::property::OPropertySet::setFastPropertyValue( nHandle, rValue );
+ ::property::OPropertySet::setFastPropertyValue_NoBroadcast( nHandle, rValue );
}
void SAL_CALL Diagram::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const
@@ -614,14 +776,14 @@ void SAL_CALL Diagram::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) co
if( nHandle == PROP_DIAGRAM_PERSPECTIVE )
{
sal_Int32 nPerspective = ::basegfx::fround( ThreeDHelper::CameraDistanceToPerspective(
- ThreeDHelper::getCameraDistance( const_cast< Diagram* >( this ) ) ) );
+ const_cast< Diagram* >( this )->getCameraDistance() ) );
rValue <<= nPerspective;
}
else if( nHandle == PROP_DIAGRAM_ROTATION_HORIZONTAL
|| nHandle == PROP_DIAGRAM_ROTATION_VERTICAL )
{
sal_Int32 nHorizontal, nVertical;
- ThreeDHelper::getRotationFromDiagram( const_cast< Diagram* >( this ), nHorizontal, nVertical );
+ const_cast< Diagram* >( this )->getRotation( nHorizontal, nVertical );
sal_Int32 nAngleDegree = 0;
if( nHandle == PROP_DIAGRAM_ROTATION_HORIZONTAL )
nAngleDegree = nHorizontal;
@@ -633,6 +795,42 @@ void SAL_CALL Diagram::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) co
::property::OPropertySet::getFastPropertyValue( rValue,nHandle );
}
+uno::Reference<chart2::XDataTable> SAL_CALL Diagram::getDataTable()
+{
+ MutexGuard aGuard( m_aMutex );
+ return m_xDataTable;
+}
+
+rtl::Reference<::chart::DataTable> Diagram::getDataTableRef() const
+{
+ MutexGuard aGuard( m_aMutex );
+ return m_xDataTable;
+}
+
+void SAL_CALL Diagram::setDataTable(const uno::Reference<chart2::XDataTable>& xDataTable)
+{
+ auto* pDataTable = dynamic_cast<DataTable*>(xDataTable.get());
+ assert(!xDataTable || pDataTable);
+ setDataTable(rtl::Reference<DataTable>(pDataTable));
+}
+
+void Diagram::setDataTable(const rtl::Reference<DataTable>& xNewDataTable)
+{
+ rtl::Reference<DataTable> xOldDataTable;
+ {
+ MutexGuard aGuard(m_aMutex);
+ if (m_xDataTable == xNewDataTable)
+ return;
+ xOldDataTable = m_xDataTable;
+ m_xDataTable = xNewDataTable;
+ }
+ if (xOldDataTable.is())
+ ModifyListenerHelper::removeListener(xOldDataTable, m_xModifyEventForwarder);
+ if (xNewDataTable.is())
+ ModifyListenerHelper::addListener(xNewDataTable, m_xModifyEventForwarder);
+ fireModifyEvent();
+}
+
using impl::Diagram_Base;
IMPLEMENT_FORWARD_XINTERFACE2( Diagram, Diagram_Base, ::property::OPropertySet )
@@ -641,7 +839,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( Diagram, Diagram_Base, ::property::OPropertySe
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
OUString SAL_CALL Diagram::getImplementationName()
{
- return "com.sun.star.comp.chart2.Diagram";
+ return u"com.sun.star.comp.chart2.Diagram"_ustr;
}
sal_Bool SAL_CALL Diagram::supportsService( const OUString& rServiceName )
@@ -652,9 +850,1441 @@ sal_Bool SAL_CALL Diagram::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL Diagram::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.Diagram",
- "com.sun.star.layout.LayoutElement",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.Diagram"_ustr,
+ u"com.sun.star.layout.LayoutElement"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
+}
+
+DiagramPositioningMode Diagram::getDiagramPositioningMode()
+{
+ DiagramPositioningMode eMode = DiagramPositioningMode::Auto;
+ chart2::RelativePosition aRelPos;
+ chart2::RelativeSize aRelSize;
+ if( (getFastPropertyValue(PROP_DIAGRAM_REL_POS) >>= aRelPos ) &&
+ (getFastPropertyValue(PROP_DIAGRAM_REL_SIZE) >>= aRelSize ) )
+ {
+ bool bPosSizeExcludeAxes=false;
+ getFastPropertyValue(PROP_DIAGRAM_POSSIZE_EXCLUDE_LABELS) >>= bPosSizeExcludeAxes;
+ if( bPosSizeExcludeAxes )
+ eMode = DiagramPositioningMode::Excluding;
+ else
+ eMode = DiagramPositioningMode::Including;
+ }
+ return eMode;
+}
+
+
+sal_Int32 Diagram::getCorrectedMissingValueTreatment(
+ const rtl::Reference< ChartType >& xChartType )
+{
+ sal_Int32 nResult = css::chart::MissingValueTreatment::LEAVE_GAP;
+ const uno::Sequence < sal_Int32 > aAvailableMissingValueTreatments(
+ ChartTypeHelper::getSupportedMissingValueTreatments( xChartType ) );
+
+ if( getFastPropertyValue( PROP_DIAGRAM_MISSING_VALUE_TREATMENT ) >>= nResult )
+ {
+ //ensure that the set value is supported by this charttype
+ for( sal_Int32 n : aAvailableMissingValueTreatments )
+ if( n == nResult )
+ return nResult; //ok
+ }
+
+ //otherwise use the first supported one
+ if( aAvailableMissingValueTreatments.hasElements() )
+ {
+ nResult = aAvailableMissingValueTreatments[0];
+ return nResult;
+ }
+
+ return nResult;
+}
+
+void Diagram::setGeometry3D( sal_Int32 nNewGeometry )
+{
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec =
+ getDataSeries();
+
+ for (auto const& series : aSeriesVec)
+ {
+ series->setPropertyAlsoToAllAttributedDataPoints(
+ u"Geometry3D"_ustr, uno::Any( nNewGeometry ));
+ }
+}
+
+sal_Int32 Diagram::getGeometry3D( bool& rbFound, bool& rbAmbiguous )
+{
+ sal_Int32 nCommonGeom( css::chart2::DataPointGeometry3D::CUBOID );
+ rbFound = false;
+ rbAmbiguous = false;
+
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec = getDataSeries();
+
+ if( aSeriesVec.empty())
+ rbAmbiguous = true;
+
+ for (auto const& series : aSeriesVec)
+ {
+ try
+ {
+ sal_Int32 nGeom = 0;
+ if( series->getPropertyValue( u"Geometry3D"_ustr) >>= nGeom )
+ {
+ if( ! rbFound )
+ {
+ // first series
+ nCommonGeom = nGeom;
+ rbFound = true;
+ }
+ // further series: compare for uniqueness
+ else if( nCommonGeom != nGeom )
+ {
+ rbAmbiguous = true;
+ break;
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ }
+
+ return nCommonGeom;
+}
+
+bool Diagram::isPieOrDonutChart()
+{
+ rtl::Reference< ChartType > xChartType = getChartTypeByIndex( 0 );
+
+ if( xChartType .is() )
+ {
+ OUString aChartType = xChartType->getChartType();
+ if( aChartType == CHART2_SERVICE_NAME_CHARTTYPE_PIE )
+ return true;
+ }
+ return false;
+}
+
+bool Diagram::isSupportingFloorAndWall()
+{
+ //pies and donuts currently do not support this because of wrong files from older versions
+ //todo: allow this in future again, if fileversion is available for OLE objects (metastream)
+ //thus the wrong bottom can be removed on import
+
+ const std::vector< rtl::Reference< ChartType > > aTypes = getChartTypes();
+ for( rtl::Reference< ChartType > const & xType : aTypes )
+ {
+ OUString sChartType = xType->getChartType();
+ if( sChartType.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
+ return false;
+ if( sChartType.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
+ return false;
+ if( sChartType.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
+ return false;
+ }
+ return true;
+}
+
+ /**
+ * This method implements the logic of checking if a series can be moved
+ * forward/backward. Depending on the "bDoMove" parameter the series will
+ * be moved (bDoMove = true) or the function just will test if the
+ * series can be moved without doing the move (bDoMove = false).
+ *
+ * @param xDiagram
+ * Reference to the diagram that contains the series.
+ *
+ * @param xGivenDataSeries
+ * Reference to the series that should moved or tested for moving.
+ *
+ * @param bForward
+ * Direction in which the series should be moved or tested for moving.
+ *
+ * @param bDoMove
+ * Should this function really move the series (true) or just test if it is
+ * possible (false).
+ *
+ *
+ * @returns
+ * in case of bDoMove == true
+ * - True : if the move was done
+ * - False : the move failed
+ * in case of bDoMove == false
+ * - True : the series can be moved
+ * - False : the series can not be moved
+ *
+ */
+static bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
+ const Diagram& rDiagram,
+ const rtl::Reference< DataSeries >& xGivenDataSeries,
+ bool bForward,
+ bool bDoMove )
+{
+ bool bMovedOrMoveAllowed = false;
+
+ try
+ {
+ if( !xGivenDataSeries.is() )
+ return false;
+
+ //find position of series.
+ bool bFound = false;
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysList( rDiagram.getBaseCoordinateSystems() );
+
+ for( std::size_t nCS = 0; !bFound && nCS < aCooSysList.size(); ++nCS )
+ {
+ const rtl::Reference< BaseCoordinateSystem > & xCooSys( aCooSysList[nCS] );
+
+ //iterate through all chart types in the current coordinate system
+ std::vector< rtl::Reference< ChartType > > aChartTypeList( xCooSys->getChartTypes2() );
+ rtl::Reference< ChartType > xFormerChartType;
+
+ for( std::size_t nT = 0; !bFound && nT < aChartTypeList.size(); ++nT )
+ {
+ rtl::Reference< ChartType > xCurrentChartType( aChartTypeList[nT] );
+
+ //iterate through all series in this chart type
+
+ std::vector< rtl::Reference< DataSeries > > aSeriesList = xCurrentChartType->getDataSeries2();
+
+ for( std::size_t nS = 0; !bFound && nS < aSeriesList.size(); ++nS )
+ {
+
+ // We found the series we are interested in!
+ if( xGivenDataSeries==aSeriesList[nS] )
+ {
+ std::size_t nOldSeriesIndex = nS;
+ bFound = true;
+
+ try
+ {
+ sal_Int32 nNewSeriesIndex = nS;
+
+ // tdf#34517 Bringing forward means increasing, backwards means decreasing series position
+ if( !bForward )
+ nNewSeriesIndex--;
+ else
+ nNewSeriesIndex++;
+
+ if( nNewSeriesIndex >= 0 && o3tl::make_unsigned(nNewSeriesIndex) < aSeriesList.size() )
+ {
+ //move series in the same charttype
+ bMovedOrMoveAllowed = true;
+ if( bDoMove )
+ {
+ aSeriesList[ nOldSeriesIndex ] = aSeriesList[ nNewSeriesIndex ];
+ aSeriesList[ nNewSeriesIndex ] = xGivenDataSeries;
+ xCurrentChartType->setDataSeries( aSeriesList );
+ }
+ }
+ else if( nNewSeriesIndex<0 )
+ {
+ //exchange series with former charttype
+ if( xFormerChartType.is() && DiagramHelper::areChartTypesCompatible( xFormerChartType, xCurrentChartType ) )
+ {
+ bMovedOrMoveAllowed = true;
+ if( bDoMove )
+ {
+ std::vector< rtl::Reference< DataSeries > > aOtherSeriesList = xFormerChartType->getDataSeries2();
+ sal_Int32 nOtherSeriesIndex = aOtherSeriesList.size()-1;
+ if( nOtherSeriesIndex >= 0 && o3tl::make_unsigned(nOtherSeriesIndex) < aOtherSeriesList.size() )
+ {
+ rtl::Reference< DataSeries > xExchangeSeries( aOtherSeriesList[nOtherSeriesIndex] );
+ aOtherSeriesList[nOtherSeriesIndex] = xGivenDataSeries;
+ xFormerChartType->setDataSeries(aOtherSeriesList);
+
+ aSeriesList[nOldSeriesIndex] = std::move(xExchangeSeries);
+ xCurrentChartType->setDataSeries(aSeriesList);
+ }
+ }
+ }
+ }
+ else if( nT+1 < aChartTypeList.size() )
+ {
+ //exchange series with next charttype
+ const rtl::Reference< ChartType >& xOtherChartType( aChartTypeList[nT+1] );
+ if( xOtherChartType.is() && DiagramHelper::areChartTypesCompatible( xOtherChartType, xCurrentChartType ) )
+ {
+ bMovedOrMoveAllowed = true;
+ if( bDoMove )
+ {
+ std::vector< rtl::Reference< DataSeries > > aOtherSeriesList = xOtherChartType->getDataSeries2();
+ if( !aOtherSeriesList.empty() )
+ {
+ rtl::Reference<DataSeries> xExchangeSeries(aOtherSeriesList[0]);
+ aOtherSeriesList[0] = xGivenDataSeries;
+ xOtherChartType->setDataSeries(aOtherSeriesList);
+
+ aSeriesList[nOldSeriesIndex] = std::move(xExchangeSeries);
+ xCurrentChartType->setDataSeries(aSeriesList);
+ }
+ }
+ }
+ }
+ }
+ catch( const util::CloseVetoException& )
+ {
+ }
+ catch( const uno::RuntimeException& )
+ {
+ }
+ }
+ }
+ xFormerChartType = std::move(xCurrentChartType);
+ }
+ }
+ }
+ catch( const util::CloseVetoException& )
+ {
+ }
+ catch( const uno::RuntimeException& )
+ {
+ }
+ return bMovedOrMoveAllowed;
+}
+
+bool Diagram::isSeriesMoveable(
+ const rtl::Reference< DataSeries >& xGivenDataSeries,
+ bool bForward )
+{
+ const bool bDoMove = false;
+
+ bool bIsMoveable = lcl_moveSeriesOrCheckIfMoveIsAllowed(
+ *this, xGivenDataSeries, bForward, bDoMove );
+
+ return bIsMoveable;
+}
+
+bool Diagram::moveSeries( const rtl::Reference< DataSeries >& xGivenDataSeries, bool bForward )
+{
+ const bool bDoMove = true;
+
+ bool bMoved = lcl_moveSeriesOrCheckIfMoveIsAllowed(
+ *this, xGivenDataSeries, bForward, bDoMove );
+
+ return bMoved;
+}
+
+std::vector< rtl::Reference< ChartType > > Diagram::getChartTypes()
+{
+ std::vector< rtl::Reference< ChartType > > aResult;
+ try
+ {
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : getBaseCoordinateSystems() )
+ {
+ const std::vector< rtl::Reference< ChartType > > & aChartTypeSeq( coords->getChartTypes2());
+ aResult.insert( aResult.end(), aChartTypeSeq.begin(), aChartTypeSeq.end() );
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ return aResult;
+}
+
+rtl::Reference< ChartType > Diagram::getChartTypeByIndex( sal_Int32 nIndex )
+{
+ rtl::Reference< ChartType > xChartType;
+
+ //iterate through all coordinate systems
+ sal_Int32 nTypesSoFar = 0;
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : getBaseCoordinateSystems() )
+ {
+ const std::vector< rtl::Reference< ChartType > > & aChartTypeList( coords->getChartTypes2() );
+ if( nIndex >= 0 && o3tl::make_unsigned(nIndex) < nTypesSoFar + aChartTypeList.size() )
+ {
+ xChartType = aChartTypeList[nIndex - nTypesSoFar];
+ break;
+ }
+ nTypesSoFar += aChartTypeList.size();
+ }
+
+ return xChartType;
+}
+
+bool Diagram::isSupportingDateAxis()
+{
+ auto xChartType = getChartTypeByIndex(0);
+ return xChartType.is() ? xChartType->isSupportingDateAxis(0) : true;
+}
+
+static std::vector< rtl::Reference< Axis > > lcl_getAxisHoldingCategoriesFromDiagram(
+ const Diagram& rDiagram )
+{
+ std::vector< rtl::Reference< Axis > > aRet;
+
+ // return first x-axis as fall-back
+ rtl::Reference< Axis > xFallBack;
+ try
+ {
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : rDiagram.getBaseCoordinateSystems() )
+ {
+ OSL_ASSERT( xCooSys.is());
+ for( sal_Int32 nN = xCooSys->getDimension(); nN--; )
+ {
+ const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nN);
+ for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI)
+ {
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( nN,nI );
+ OSL_ASSERT( xAxis.is());
+ if( xAxis.is())
+ {
+ chart2::ScaleData aScaleData = xAxis->getScaleData();
+ if( aScaleData.Categories.is() || (aScaleData.AxisType == chart2::AxisType::CATEGORY) )
+ {
+ aRet.push_back(xAxis);
+ }
+ if( (nN == 0) && !xFallBack.is())
+ xFallBack = std::move(xAxis);
+ }
+ }
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2" );
+ }
+
+ if( aRet.empty() )
+ aRet.push_back(xFallBack);
+
+ return aRet;
+}
+
+uno::Reference< chart2::data::XLabeledDataSequence > Diagram::getCategories()
+{
+ uno::Reference< chart2::data::XLabeledDataSequence > xResult;
+
+ try
+ {
+ std::vector< rtl::Reference< Axis > > aCatAxes(
+ lcl_getAxisHoldingCategoriesFromDiagram( *this ));
+ //search for first categories
+ if (aCatAxes.empty())
+ return xResult;
+
+ const rtl::Reference< Axis >& xCatAxis(aCatAxes[0]);
+ if( !xCatAxis.is())
+ return xResult;
+
+ chart2::ScaleData aScaleData( xCatAxis->getScaleData());
+ if( !aScaleData.Categories.is() )
+ return xResult;
+
+ xResult = aScaleData.Categories;
+ uno::Reference<beans::XPropertySet> xProp(xResult->getValues(), uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ try
+ {
+ xProp->setPropertyValue( u"Role"_ustr, uno::Any( u"categories"_ustr ) );
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ return xResult;
+}
+
+void Diagram::setCategories(
+ const uno::Reference< chart2::data::XLabeledDataSequence >& xCategories,
+ bool bSetAxisType /* = false */,
+ bool bCategoryAxis /* = true */ )
+{
+ std::vector< rtl::Reference< Axis > > aCatAxes(
+ lcl_getAxisHoldingCategoriesFromDiagram( *this ));
+
+ for (const rtl::Reference< Axis >& xCatAxis : aCatAxes)
+ {
+ if( xCatAxis.is())
+ {
+ chart2::ScaleData aScaleData( xCatAxis->getScaleData());
+ aScaleData.Categories = xCategories;
+ if( bSetAxisType )
+ {
+ if( bCategoryAxis )
+ aScaleData.AxisType = chart2::AxisType::CATEGORY;
+ else if( aScaleData.AxisType == chart2::AxisType::CATEGORY || aScaleData.AxisType == chart2::AxisType::DATE )
+ aScaleData.AxisType = chart2::AxisType::REALNUMBER;
+ }
+ xCatAxis->setScaleData( aScaleData );
+ }
+ }
+}
+
+bool Diagram::isCategory()
+{
+ try
+ {
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : getBaseCoordinateSystems() )
+ {
+ for( sal_Int32 nN = xCooSys->getDimension(); nN--; )
+ {
+ const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nN);
+ for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI)
+ {
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( nN,nI );
+ OSL_ASSERT( xAxis.is());
+ if( xAxis.is())
+ {
+ chart2::ScaleData aScaleData = xAxis->getScaleData();
+ if( aScaleData.AxisType == chart2::AxisType::CATEGORY || aScaleData.AxisType == chart2::AxisType::DATE )
+ return true;
+ }
+ }
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ return false;
+}
+
+std::vector< std::vector< rtl::Reference< DataSeries > > >
+Diagram::getDataSeriesGroups()
+{
+ std::vector< std::vector< rtl::Reference< DataSeries > > > aResult;
+
+ //iterate through all coordinate systems
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : getBaseCoordinateSystems() )
+ {
+ //iterate through all chart types in the current coordinate system
+ for( rtl::Reference< ChartType > const & chartType : coords->getChartTypes2() )
+ {
+ aResult.push_back( chartType->getDataSeries2() );
+ }
+ }
+ return aResult;
+}
+
+std::vector< rtl::Reference< ::chart::DataSeries > >
+ Diagram::getDataSeries()
+{
+ std::vector< rtl::Reference< DataSeries > > aResult;
+ try
+ {
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : getBaseCoordinateSystems() )
+ {
+ for( rtl::Reference< ChartType> const & chartType : coords->getChartTypes2() )
+ {
+ const std::vector< rtl::Reference< DataSeries > > aSeriesSeq( chartType->getDataSeries2() );
+ aResult.insert( aResult.end(), aSeriesSeq.begin(), aSeriesSeq.end() );
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ return aResult;
+}
+
+rtl::Reference< ChartType > Diagram::getChartTypeOfSeries(
+ const rtl::Reference< DataSeries >& xGivenDataSeries )
+{
+ if( !xGivenDataSeries.is() )
+ return nullptr;
+
+ //iterate through the model to find the given xSeries
+ //the found parent indicates the charttype
+
+ //iterate through all coordinate systems
+
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : getBaseCoordinateSystems() )
+ {
+ //iterate through all chart types in the current coordinate system
+ const std::vector< rtl::Reference< ChartType > > & aChartTypeList( xCooSys->getChartTypes2() );
+ for( rtl::Reference< ChartType > const & xChartType : aChartTypeList )
+ {
+ //iterate through all series in this chart type
+ for( rtl::Reference< DataSeries > const & dataSeries : xChartType->getDataSeries2() )
+ {
+ if( xGivenDataSeries==dataSeries )
+ return xChartType;
+ }
+ }
+ }
+ return nullptr;
+}
+
+rtl::Reference< Axis > Diagram::getAttachedAxis(
+ const rtl::Reference< DataSeries >& xSeries )
+{
+ return AxisHelper::getAxis( 1, !xSeries || xSeries->isAttachedToMainAxis(), this );
+}
+
+bool Diagram::attachSeriesToAxis( bool bAttachToMainAxis
+ , const rtl::Reference< DataSeries >& xDataSeries
+ , const uno::Reference< uno::XComponentContext > & xContext
+ , bool bAdaptAxes )
+{
+ bool bChanged = false;
+
+ //set property at axis
+
+ sal_Int32 nNewAxisIndex = bAttachToMainAxis ? 0 : 1;
+ sal_Int32 nOldAxisIndex = xDataSeries->getAttachedAxisIndex();
+ rtl::Reference< Axis > xOldAxis = getAttachedAxis( xDataSeries );
+
+ if( nOldAxisIndex != nNewAxisIndex )
+ {
+ try
+ {
+ xDataSeries->setPropertyValue( u"AttachedAxisIndex"_ustr, uno::Any( nNewAxisIndex ) );
+ bChanged = true;
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ }
+
+ if( bChanged )
+ {
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 1, bAttachToMainAxis, this );
+ if(!xAxis.is()) //create an axis if necessary
+ xAxis = AxisHelper::createAxis( 1, bAttachToMainAxis, this, xContext );
+ if( bAdaptAxes )
+ {
+ AxisHelper::makeAxisVisible( xAxis );
+ AxisHelper::hideAxisIfNoDataIsAttached( xOldAxis, this );
+ }
+ }
+
+ return bChanged;
+}
+
+void Diagram::replaceCoordinateSystem(
+ const rtl::Reference< BaseCoordinateSystem > & xCooSysToReplace,
+ const rtl::Reference< BaseCoordinateSystem > & xReplacement )
+{
+ // update the coordinate-system container
+ try
+ {
+ uno::Reference< chart2::data::XLabeledDataSequence > xCategories = getCategories();
+
+ // move chart types of xCooSysToReplace to xReplacement
+ xReplacement->setChartTypes( xCooSysToReplace->getChartTypes());
+
+ removeCoordinateSystem( xCooSysToReplace );
+ addCoordinateSystem( xReplacement );
+
+ if( xCategories.is() )
+ setCategories( xCategories );
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+sal_Int32 Diagram::getDimension()
+{
+ // -1: not yet set
+ sal_Int32 nResult = -1;
+
+ try
+ {
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : getBaseCoordinateSystems() )
+ {
+ if(xCooSys.is())
+ {
+ nResult = xCooSys->getDimension();
+ break;
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ return nResult;
+}
+
+void Diagram::setDimension( sal_Int32 nNewDimensionCount )
+{
+ if( getDimension() == nNewDimensionCount )
+ return;
+
+ try
+ {
+ bool rbFound = false;
+ bool rbAmbiguous = true;
+ StackMode eStackMode = getStackMode( rbFound, rbAmbiguous );
+ bool bIsSupportingOnlyDeepStackingFor3D=false;
+
+ //change all coordinate systems:
+ auto aCoordSystems = getBaseCoordinateSystems();
+ for( rtl::Reference<BaseCoordinateSystem> const & xOldCooSys : aCoordSystems )
+ {
+ rtl::Reference< BaseCoordinateSystem > xNewCooSys;
+
+ const std::vector< rtl::Reference< ChartType > > aChartTypeList( xOldCooSys->getChartTypes2() );
+ for( rtl::Reference< ChartType > const & xChartType : aChartTypeList )
+ {
+ bIsSupportingOnlyDeepStackingFor3D = xChartType.is() ? xChartType->isSupportingOnlyDeepStackingFor3D() : false;
+ if(!xNewCooSys.is())
+ {
+ xNewCooSys = dynamic_cast<BaseCoordinateSystem*>(xChartType->createCoordinateSystem( nNewDimensionCount ).get());
+ assert(xNewCooSys);
+ break;
+ }
+ //@todo make sure that all following charttypes are also capable of the new dimension
+ //otherwise separate them in a different group
+ //BM: might be done in replaceCoordinateSystem()
+ }
+
+ // replace the old coordinate system at all places where it was used
+ replaceCoordinateSystem( xOldCooSys, xNewCooSys );
+ }
+
+ //correct stack mode if necessary
+ if( nNewDimensionCount==3 && eStackMode != StackMode::ZStacked && bIsSupportingOnlyDeepStackingFor3D )
+ setStackMode( StackMode::ZStacked );
+ else if( nNewDimensionCount==2 && eStackMode == StackMode::ZStacked )
+ setStackMode( StackMode::NONE );
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+void Diagram::setStackMode( StackMode eStackMode )
+{
+ try
+ {
+ bool bValueFound = false;
+ bool bIsAmbiguous = false;
+ StackMode eOldStackMode = getStackMode( bValueFound, bIsAmbiguous );
+
+ if( eStackMode == eOldStackMode && !bIsAmbiguous )
+ return;
+
+ chart2::StackingDirection eNewDirection = chart2::StackingDirection_NO_STACKING;
+ if( eStackMode == StackMode::YStacked || eStackMode == StackMode::YStackedPercent )
+ eNewDirection = chart2::StackingDirection_Y_STACKING;
+ else if( eStackMode == StackMode::ZStacked )
+ eNewDirection = chart2::StackingDirection_Z_STACKING;
+
+ uno::Any aNewDirection( eNewDirection );
+
+ bool bPercent = false;
+ if( eStackMode == StackMode::YStackedPercent )
+ bPercent = true;
+
+ //iterate through all coordinate systems
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : getBaseCoordinateSystems() )
+ {
+ //set correct percent stacking
+ const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(1);
+ for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI)
+ {
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( 1,nI );
+ if( xAxis.is())
+ {
+ chart2::ScaleData aScaleData = xAxis->getScaleData();
+ if( (aScaleData.AxisType==chart2::AxisType::PERCENT) != bPercent )
+ {
+ if( bPercent )
+ aScaleData.AxisType = chart2::AxisType::PERCENT;
+ else
+ aScaleData.AxisType = chart2::AxisType::REALNUMBER;
+ xAxis->setScaleData( aScaleData );
+ }
+ }
+ }
+ //iterate through all chart types in the current coordinate system
+ const std::vector< rtl::Reference< ChartType > > & aChartTypeList( xCooSys->getChartTypes2() );
+ if (aChartTypeList.empty())
+ continue;
+
+ rtl::Reference< ChartType > xChartType( aChartTypeList[0] );
+
+ //iterate through all series in this chart type
+ for( rtl::Reference< DataSeries > const & dataSeries : xChartType->getDataSeries2() )
+ {
+ dataSeries->setPropertyValue( u"StackingDirection"_ustr, aNewDirection );
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+StackMode Diagram::getStackMode( bool& rbFound, bool& rbAmbiguous )
+{
+ rbFound=false;
+ rbAmbiguous=false;
+
+ StackMode eGlobalStackMode = StackMode::NONE;
+
+ //iterate through all coordinate systems
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : getBaseCoordinateSystems() )
+ {
+ //iterate through all chart types in the current coordinate system
+ std::vector< rtl::Reference< ChartType > > aChartTypeList( xCooSys->getChartTypes2() );
+ for( std::size_t nT = 0; nT < aChartTypeList.size(); ++nT )
+ {
+ const rtl::Reference< ChartType >& xChartType( aChartTypeList[nT] );
+
+ StackMode eLocalStackMode = DiagramHelper::getStackModeFromChartType(
+ xChartType, rbFound, rbAmbiguous, xCooSys );
+
+ if( rbFound && eLocalStackMode != eGlobalStackMode && nT>0 )
+ {
+ rbAmbiguous = true;
+ return eGlobalStackMode;
+ }
+
+ eGlobalStackMode = eLocalStackMode;
+ }
+ }
+
+ return eGlobalStackMode;
+}
+
+void Diagram::setVertical( bool bVertical /* = true */ )
+{
+ try
+ {
+ uno::Any aValue;
+ aValue <<= bVertical;
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : getBaseCoordinateSystems() )
+ {
+ bool bChanged = false;
+ bool bOldSwap = false;
+ if( !(xCooSys->getPropertyValue(u"SwapXAndYAxis"_ustr) >>= bOldSwap)
+ || bVertical != bOldSwap )
+ bChanged = true;
+
+ if( bChanged )
+ xCooSys->setPropertyValue(u"SwapXAndYAxis"_ustr, aValue);
+
+ const sal_Int32 nDimensionCount = xCooSys->getDimension();
+ sal_Int32 nDimIndex = 0;
+ for (nDimIndex=0; nDimIndex < nDimensionCount; ++nDimIndex)
+ {
+ const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nDimIndex);
+ for (sal_Int32 nI = 0; nI <= nMaximumScaleIndex; ++nI)
+ {
+ rtl::Reference<Axis> xAxis = xCooSys->getAxisByDimension2(nDimIndex,nI);
+ if (!xAxis.is())
+ continue;
+
+ //adapt title rotation only when axis swapping has changed
+ if (!bChanged)
+ continue;
+
+ Reference< beans::XPropertySet > xTitleProps( xAxis->getTitleObject(), uno::UNO_QUERY );
+ if (!xTitleProps.is())
+ continue;
+
+ double fAngleDegree = 0.0;
+ xTitleProps->getPropertyValue(u"TextRotation"_ustr) >>= fAngleDegree;
+ if (fAngleDegree != 0.0 &&
+ !rtl::math::approxEqual(fAngleDegree, 90.0))
+ continue;
+
+ double fNewAngleDegree = 0.0;
+ if( !bVertical && nDimIndex == 1 )
+ fNewAngleDegree = 90.0;
+ else if( bVertical && nDimIndex == 0 )
+ fNewAngleDegree = 90.0;
+
+ xTitleProps->setPropertyValue(u"TextRotation"_ustr, uno::Any(fNewAngleDegree));
+ }
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+bool Diagram::getVertical( bool& rbFound, bool& rbAmbiguous )
+{
+ bool bValue = false;
+ rbFound = false;
+ rbAmbiguous = false;
+
+ for (rtl::Reference<BaseCoordinateSystem> const & coords : getBaseCoordinateSystems())
+ {
+ bool bCurrent = false;
+ if (coords->getPropertyValue(u"SwapXAndYAxis"_ustr) >>= bCurrent)
+ {
+ if (!rbFound)
+ {
+ bValue = bCurrent;
+ rbFound = true;
+ }
+ else if (bCurrent != bValue)
+ {
+ // ambiguous -> choose always first found
+ rbAmbiguous = true;
+ }
+ }
+ }
+ return bValue;
+}
+
+Diagram::tTemplateWithServiceName
+ Diagram::getTemplate(
+ const rtl::Reference< ::chart::ChartTypeManager > & xChartTypeManager )
+{
+ tTemplateWithServiceName aResult;
+
+ if( !xChartTypeManager )
+ return aResult;
+
+ Sequence< OUString > aServiceNames( xChartTypeManager->getAvailableServiceNames());
+ const sal_Int32 nLength = aServiceNames.getLength();
+
+ bool bTemplateFound = false;
+
+ for( sal_Int32 i = 0; ! bTemplateFound && i < nLength; ++i )
+ {
+ try
+ {
+ rtl::Reference< ::chart::ChartTypeTemplate > xTempl =
+ xChartTypeManager->createTemplate( aServiceNames[ i ] );
+
+ if (xTempl.is() && xTempl->matchesTemplate2(this, true))
+ {
+ aResult.xChartTypeTemplate = std::move(xTempl);
+ aResult.sServiceName = aServiceNames[ i ];
+ bTemplateFound = true;
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ }
+
+ return aResult;
+}
+
+std::vector< rtl::Reference< RegressionCurveModel > >
+ Diagram::getAllRegressionCurvesNotMeanValueLine()
+{
+ std::vector< rtl::Reference< RegressionCurveModel > > aResult;
+ std::vector< rtl::Reference< DataSeries > > aSeries( getDataSeries());
+ for (auto const& elem : aSeries)
+ {
+ for( rtl::Reference< RegressionCurveModel > const & curve : elem->getRegressionCurves2() )
+ {
+ if( ! RegressionCurveHelper::isMeanValueLine( curve ))
+ aResult.push_back( curve );
+ }
+ }
+
+ return aResult;
+}
+
+double Diagram::getCameraDistance()
+{
+ double fCameraDistance = FIXED_SIZE_FOR_3D_CHART_VOLUME;
+
+ try
+ {
+ drawing::CameraGeometry aCG( ThreeDHelper::getDefaultCameraGeometry() );
+ getFastPropertyValue( PROP_SCENE_CAMERA_GEOMETRY ) >>= aCG;
+ ::basegfx::B3DVector aVRP( BaseGFXHelper::Position3DToB3DVector( aCG.vrp ) );
+ fCameraDistance = aVRP.getLength();
+
+ ThreeDHelper::ensureCameraDistanceRange( fCameraDistance );
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ return fCameraDistance;
+}
+
+void Diagram::setCameraDistance(double fCameraDistance )
+{
+ try
+ {
+ if( fCameraDistance <= 0 )
+ fCameraDistance = FIXED_SIZE_FOR_3D_CHART_VOLUME;
+
+ drawing::CameraGeometry aCG( ThreeDHelper::getDefaultCameraGeometry() );
+ getFastPropertyValue( PROP_SCENE_CAMERA_GEOMETRY ) >>= aCG;
+ ::basegfx::B3DVector aVRP( BaseGFXHelper::Position3DToB3DVector( aCG.vrp ) );
+ if( ::basegfx::fTools::equalZero( aVRP.getLength() ) )
+ aVRP = ::basegfx::B3DVector(0,0,1);
+ aVRP.setLength(fCameraDistance);
+ aCG.vrp = BaseGFXHelper::B3DVectorToPosition3D( aVRP );
+
+ setFastPropertyValue( PROP_SCENE_CAMERA_GEOMETRY, uno::Any( aCG ));
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+static bool lcl_isRightAngledAxesSetAndSupported( Diagram& rDiagram )
+{
+ bool bRightAngledAxes = false;
+ rDiagram.getFastPropertyValue( PROP_DIAGRAM_RIGHT_ANGLED_AXES ) >>= bRightAngledAxes; // "RightAngledAxes"
+ if(bRightAngledAxes)
+ {
+ auto xChartType = rDiagram.getChartTypeByIndex(0);
+ if (xChartType.is() ? xChartType->isSupportingRightAngledAxes() : true)
+ return true;
+ }
+ return false;
+}
+
+void Diagram::getRotation( sal_Int32& rnHorizontalAngleDegree, sal_Int32& rnVerticalAngleDegree )
+{
+ double fXAngle, fYAngle, fZAngle;
+ getRotationAngle( fXAngle, fYAngle, fZAngle );
+
+ if( !lcl_isRightAngledAxesSetAndSupported( *this ) )
+ {
+ ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
+ rnHorizontalAngleDegree, rnVerticalAngleDegree, fXAngle, fYAngle, fZAngle);
+ rnVerticalAngleDegree*=-1;
+ }
+ else
+ {
+ rnHorizontalAngleDegree = basegfx::fround(basegfx::rad2deg(fXAngle));
+ rnVerticalAngleDegree = basegfx::fround(-1.0 * basegfx::rad2deg(fYAngle));
+ // nZRotation = basegfx::fround(-1.0 * basegfx::rad2deg(fZAngle));
+ }
+
+ rnHorizontalAngleDegree = NormAngle180(rnHorizontalAngleDegree);
+ rnVerticalAngleDegree = NormAngle180(rnVerticalAngleDegree);
+}
+
+void Diagram::setRotation( sal_Int32 nHorizontalAngleDegree, sal_Int32 nVerticalYAngleDegree )
+{
+ //todo: x and y is not equal to horz and vert in case of RightAngledAxes==false
+ double fXAngle = basegfx::deg2rad(nHorizontalAngleDegree);
+ double fYAngle = basegfx::deg2rad(-1 * nVerticalYAngleDegree);
+ double fZAngle = 0.0;
+
+ if( !lcl_isRightAngledAxesSetAndSupported( *this ) )
+ ThreeDHelper::convertElevationRotationDegToXYZAngleRad(
+ nHorizontalAngleDegree, -1*nVerticalYAngleDegree, fXAngle, fYAngle, fZAngle );
+
+ setRotationAngle( fXAngle, fYAngle, fZAngle );
+}
+
+static ::basegfx::B3DHomMatrix lcl_getCameraMatrix( Diagram& rDiagram )
+{
+ drawing::HomogenMatrix aCameraMatrix;
+
+ drawing::CameraGeometry aCG( ThreeDHelper::getDefaultCameraGeometry() );
+ rDiagram.getFastPropertyValue( PROP_SCENE_CAMERA_GEOMETRY ) >>= aCG; // "D3DCameraGeometry"
+
+ ::basegfx::B3DVector aVPN( BaseGFXHelper::Direction3DToB3DVector( aCG.vpn ) );
+ ::basegfx::B3DVector aVUP( BaseGFXHelper::Direction3DToB3DVector( aCG.vup ) );
+
+ //normalize vectors:
+ aVPN.normalize();
+ aVUP.normalize();
+
+ ::basegfx::B3DVector aCross = ::basegfx::cross( aVUP, aVPN );
+
+ //first line is VUP x VPN
+ aCameraMatrix.Line1.Column1 = aCross[0];
+ aCameraMatrix.Line1.Column2 = aCross[1];
+ aCameraMatrix.Line1.Column3 = aCross[2];
+ aCameraMatrix.Line1.Column4 = 0.0;
+
+ //second line is VUP
+ aCameraMatrix.Line2.Column1 = aVUP[0];
+ aCameraMatrix.Line2.Column2 = aVUP[1];
+ aCameraMatrix.Line2.Column3 = aVUP[2];
+ aCameraMatrix.Line2.Column4 = 0.0;
+
+ //third line is VPN
+ aCameraMatrix.Line3.Column1 = aVPN[0];
+ aCameraMatrix.Line3.Column2 = aVPN[1];
+ aCameraMatrix.Line3.Column3 = aVPN[2];
+ aCameraMatrix.Line3.Column4 = 0.0;
+
+ //fourth line is 0 0 0 1
+ aCameraMatrix.Line4.Column1 = 0.0;
+ aCameraMatrix.Line4.Column2 = 0.0;
+ aCameraMatrix.Line4.Column3 = 0.0;
+ aCameraMatrix.Line4.Column4 = 1.0;
+
+ return BaseGFXHelper::HomogenMatrixToB3DHomMatrix( aCameraMatrix );
+}
+
+static double lcl_shiftAngleToIntervalMinusPiToPi( double fAngleRad )
+{
+ //valid range: ]-Pi,Pi]
+ while( fAngleRad<=-M_PI )
+ fAngleRad+=(2*M_PI);
+ while( fAngleRad>M_PI )
+ fAngleRad-=(2*M_PI);
+ return fAngleRad;
+}
+
+void Diagram::getRotationAngle( double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad )
+{
+ //takes the camera and the transformation matrix into account
+
+ rfXAngleRad = rfYAngleRad = rfZAngleRad = 0.0;
+
+ //get camera rotation
+ ::basegfx::B3DHomMatrix aFixCameraRotationMatrix( lcl_getCameraMatrix( *this ) );
+ BaseGFXHelper::ReduceToRotationMatrix( aFixCameraRotationMatrix );
+
+ //get scene rotation
+ ::basegfx::B3DHomMatrix aSceneRotation;
+ {
+ drawing::HomogenMatrix aHomMatrix;
+ // "D3DTransformMatrix"
+ if( getFastPropertyValue( PROP_SCENE_TRANSF_MATRIX ) >>= aHomMatrix )
+ {
+ aSceneRotation = BaseGFXHelper::HomogenMatrixToB3DHomMatrix( aHomMatrix );
+ BaseGFXHelper::ReduceToRotationMatrix( aSceneRotation );
+ }
+ }
+
+ ::basegfx::B3DHomMatrix aResultRotation = aFixCameraRotationMatrix * aSceneRotation;
+ ::basegfx::B3DTuple aRotation( BaseGFXHelper::GetRotationFromMatrix( aResultRotation ) );
+
+ rfXAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getX());
+ rfYAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getY());
+ rfZAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getZ());
+
+ if(rfZAngleRad<-M_PI_2 || rfZAngleRad>M_PI_2)
+ {
+ rfZAngleRad-=M_PI;
+ rfXAngleRad-=M_PI;
+ rfYAngleRad=(M_PI-rfYAngleRad);
+
+ rfXAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfXAngleRad);
+ rfYAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfYAngleRad);
+ rfZAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfZAngleRad);
+ }
+}
+
+static ::basegfx::B3DHomMatrix lcl_getInverseRotationMatrix( Diagram& rDiagram )
+{
+ ::basegfx::B3DHomMatrix aInverseRotation;
+ double fXAngleRad=0.0;
+ double fYAngleRad=0.0;
+ double fZAngleRad=0.0;
+ rDiagram.getRotationAngle( fXAngleRad, fYAngleRad, fZAngleRad );
+ aInverseRotation.rotate( 0.0, 0.0, -fZAngleRad );
+ aInverseRotation.rotate( 0.0, -fYAngleRad, 0.0 );
+ aInverseRotation.rotate( -fXAngleRad, 0.0, 0.0 );
+ return aInverseRotation;
+}
+
+static void lcl_rotateLights( const ::basegfx::B3DHomMatrix& rLightRotation, Diagram& rDiagram )
+{
+ ::basegfx::B3DHomMatrix aLightRotation( rLightRotation );
+ BaseGFXHelper::ReduceToRotationMatrix( aLightRotation );
+
+ // "D3DSceneLightDirection1","D3DSceneLightOn1",
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_1, PROP_SCENE_LIGHT_ON_1, aLightRotation );
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_2, PROP_SCENE_LIGHT_ON_2, aLightRotation );
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_3, PROP_SCENE_LIGHT_ON_3, aLightRotation );
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_4, PROP_SCENE_LIGHT_ON_4, aLightRotation );
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_5, PROP_SCENE_LIGHT_ON_5, aLightRotation );
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_6, PROP_SCENE_LIGHT_ON_6, aLightRotation );
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_7, PROP_SCENE_LIGHT_ON_7, aLightRotation );
+ lcl_RotateLightSource( rDiagram, PROP_SCENE_LIGHT_DIRECTION_8, PROP_SCENE_LIGHT_ON_8, aLightRotation );
+}
+
+void Diagram::setRotationAngle(
+ double fXAngleRad, double fYAngleRad, double fZAngleRad )
+{
+ //the rotation of the camera is not touched but taken into account
+ //the rotation difference is applied to the transformation matrix
+
+ //the light sources will be adapted also
+
+ try
+ {
+ //remind old rotation for adaptation of light directions
+ ::basegfx::B3DHomMatrix aInverseOldRotation( lcl_getInverseRotationMatrix( *this ) );
+
+ ::basegfx::B3DHomMatrix aInverseCameraRotation;
+ {
+ ::basegfx::B3DTuple aR( BaseGFXHelper::GetRotationFromMatrix(
+ lcl_getCameraMatrix( *this ) ) );
+ aInverseCameraRotation.rotate( 0.0, 0.0, -aR.getZ() );
+ aInverseCameraRotation.rotate( 0.0, -aR.getY(), 0.0 );
+ aInverseCameraRotation.rotate( -aR.getX(), 0.0, 0.0 );
+ }
+
+ ::basegfx::B3DHomMatrix aCumulatedRotation;
+ aCumulatedRotation.rotate( fXAngleRad, fYAngleRad, fZAngleRad );
+
+ //calculate new scene matrix
+ ::basegfx::B3DHomMatrix aSceneRotation = aInverseCameraRotation*aCumulatedRotation;
+ BaseGFXHelper::ReduceToRotationMatrix( aSceneRotation );
+
+ //set new rotation to transformation matrix ("D3DTransformMatrix")
+ setFastPropertyValue(
+ PROP_SCENE_TRANSF_MATRIX, uno::Any( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aSceneRotation )));
+
+ //rotate lights if RightAngledAxes are not set or not supported
+ bool bRightAngledAxes = false;
+ getFastPropertyValue( PROP_DIAGRAM_RIGHT_ANGLED_AXES ) >>= bRightAngledAxes;
+ auto xChartType = getChartTypeByIndex(0);
+ if (!bRightAngledAxes || !(xChartType.is() ? xChartType->isSupportingRightAngledAxes() : true))
+ {
+ ::basegfx::B3DHomMatrix aNewRotation;
+ aNewRotation.rotate( fXAngleRad, fYAngleRad, fZAngleRad );
+ lcl_rotateLights( aNewRotation*aInverseOldRotation, *this );
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+static bool lcl_isEqual( const drawing::Direction3D& rA, const drawing::Direction3D& rB )
+{
+ return ::rtl::math::approxEqual(rA.DirectionX, rB.DirectionX)
+ && ::rtl::math::approxEqual(rA.DirectionY, rB.DirectionY)
+ && ::rtl::math::approxEqual(rA.DirectionZ, rB.DirectionZ);
+}
+static bool lcl_isSimpleScheme( drawing::ShadeMode aShadeMode
+ , sal_Int32 nRoundedEdges
+ , sal_Int32 nObjectLines
+ , const rtl::Reference< Diagram >& xDiagram )
+{
+ if(aShadeMode!=drawing::ShadeMode_FLAT)
+ return false;
+ if(nRoundedEdges!=0)
+ return false;
+ if(nObjectLines==0)
+ {
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeByIndex( 0 ) );
+ return ChartTypeHelper::noBordersForSimpleScheme( xChartType );
+ }
+ if(nObjectLines!=1)
+ return false;
+ return true;
+}
+static bool lcl_isRealisticScheme( drawing::ShadeMode aShadeMode
+ , sal_Int32 nRoundedEdges
+ , sal_Int32 nObjectLines )
+{
+ if(aShadeMode!=drawing::ShadeMode_SMOOTH)
+ return false;
+ if(nRoundedEdges!=5)
+ return false;
+ if(nObjectLines!=0)
+ return false;
+ return true;
+}
+static bool lcl_isLightScheme( Diagram& rDiagram, bool bRealistic )
+{
+ bool bIsOn = false;
+ // "D3DSceneLightOn2" / UNO_NAME_3D_SCENE_LIGHTON_2
+ rDiagram.getFastPropertyValue( PROP_SCENE_LIGHT_ON_2 ) >>= bIsOn;
+ if(!bIsOn)
+ return false;
+
+ rtl::Reference< ChartType > xChartType( rDiagram.getChartTypeByIndex( 0 ) );
+
+ sal_Int32 nColor = 0;
+ // "D3DSceneLightColor2" / UNO_NAME_3D_SCENE_LIGHTCOLOR_2
+ rDiagram.getFastPropertyValue( PROP_SCENE_LIGHT_COLOR_2 ) >>= nColor;
+ if( nColor != ::chart::ChartTypeHelper::getDefaultDirectLightColor( !bRealistic, xChartType ) )
+ return false;
+
+ sal_Int32 nAmbientColor = 0;
+ // "D3DSceneAmbientColor" / UNO_NAME_3D_SCENE_AMBIENTCOLOR
+ rDiagram.getFastPropertyValue( PROP_SCENE_AMBIENT_COLOR ) >>= nAmbientColor;
+ if( nAmbientColor != ::chart::ChartTypeHelper::getDefaultAmbientLightColor( !bRealistic, xChartType ) )
+ return false;
+
+ drawing::Direction3D aDirection(0,0,0);
+ // "D3DSceneLightDirection2" / UNO_NAME_3D_SCENE_LIGHTDIRECTION_2
+ rDiagram.getFastPropertyValue( PROP_SCENE_LIGHT_DIRECTION_2 ) >>= aDirection;
+
+ drawing::Direction3D aDefaultDirection( bRealistic
+ ? ChartTypeHelper::getDefaultRealisticLightDirection(xChartType)
+ : ChartTypeHelper::getDefaultSimpleLightDirection(xChartType) );
+
+ //rotate default light direction when right angled axes are off but supported
+ {
+ bool bRightAngledAxes = false;
+ rDiagram.getFastPropertyValue( PROP_DIAGRAM_RIGHT_ANGLED_AXES ) >>= bRightAngledAxes; // "RightAngledAxes"
+ if(!bRightAngledAxes)
+ {
+ if (xChartType.is() ? xChartType->isSupportingRightAngledAxes() : true)
+ {
+ ::basegfx::B3DHomMatrix aRotation( lcl_getCompleteRotationMatrix( rDiagram ) );
+ BaseGFXHelper::ReduceToRotationMatrix( aRotation );
+ ::basegfx::B3DVector aLightVector( BaseGFXHelper::Direction3DToB3DVector( aDefaultDirection ) );
+ aLightVector = aRotation*aLightVector;
+ aDefaultDirection = BaseGFXHelper::B3DVectorToDirection3D( aLightVector );
+ }
+ }
+ }
+
+ return lcl_isEqual( aDirection, aDefaultDirection );
+}
+static bool lcl_isRealisticLightScheme( Diagram& rDiagram )
+{
+ return lcl_isLightScheme( rDiagram, true /*bRealistic*/ );
+}
+static bool lcl_isSimpleLightScheme( Diagram& rDiagram )
+{
+ return lcl_isLightScheme( rDiagram, false /*bRealistic*/ );
+}
+
+ThreeDLookScheme Diagram::detectScheme()
+{
+ ThreeDLookScheme aScheme = ThreeDLookScheme::ThreeDLookScheme_Unknown;
+
+ sal_Int32 nRoundedEdges;
+ sal_Int32 nObjectLines;
+ ThreeDHelper::getRoundedEdgesAndObjectLines( this, nRoundedEdges, nObjectLines );
+
+ //get shade mode and light settings:
+ drawing::ShadeMode aShadeMode( drawing::ShadeMode_SMOOTH );
+ try
+ {
+ getFastPropertyValue( PROP_SCENE_SHADE_MODE )>>= aShadeMode; // "D3DSceneShadeMode"
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ if( lcl_isSimpleScheme( aShadeMode, nRoundedEdges, nObjectLines, this ) )
+ {
+ if( lcl_isSimpleLightScheme(*this) )
+ aScheme = ThreeDLookScheme::ThreeDLookScheme_Simple;
+ }
+ else if( lcl_isRealisticScheme( aShadeMode, nRoundedEdges, nObjectLines ) )
+ {
+ if( lcl_isRealisticLightScheme(*this) )
+ aScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic;
+ }
+
+ return aScheme;
+}
+
+static void lcl_setRealisticScheme( drawing::ShadeMode& rShadeMode
+ , sal_Int32& rnRoundedEdges
+ , sal_Int32& rnObjectLines )
+{
+ rShadeMode = drawing::ShadeMode_SMOOTH;
+ rnRoundedEdges = 5;
+ rnObjectLines = 0;
+}
+
+static void lcl_setSimpleScheme( drawing::ShadeMode& rShadeMode
+ , sal_Int32& rnRoundedEdges
+ , sal_Int32& rnObjectLines
+ , const rtl::Reference< Diagram >& xDiagram )
+{
+ rShadeMode = drawing::ShadeMode_FLAT;
+ rnRoundedEdges = 0;
+
+ rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeByIndex( 0 ) );
+ rnObjectLines = ChartTypeHelper::noBordersForSimpleScheme( xChartType ) ? 0 : 1;
+}
+void Diagram::setScheme( ThreeDLookScheme aScheme )
+{
+ if( aScheme == ThreeDLookScheme::ThreeDLookScheme_Unknown )
+ return;
+
+ drawing::ShadeMode aShadeMode;
+ sal_Int32 nRoundedEdges;
+ sal_Int32 nObjectLines;
+
+ if( aScheme == ThreeDLookScheme::ThreeDLookScheme_Simple )
+ lcl_setSimpleScheme(aShadeMode,nRoundedEdges,nObjectLines,this);
+ else
+ lcl_setRealisticScheme(aShadeMode,nRoundedEdges,nObjectLines);
+
+ try
+ {
+ ThreeDHelper::setRoundedEdgesAndObjectLines( this, nRoundedEdges, nObjectLines );
+
+ drawing::ShadeMode aOldShadeMode;
+ if( ! (getFastPropertyValue( PROP_SCENE_SHADE_MODE)>>=aOldShadeMode) ||
+ aOldShadeMode != aShadeMode )
+ {
+ setFastPropertyValue( PROP_SCENE_SHADE_MODE, uno::Any( aShadeMode )); // "D3DSceneShadeMode"
+ }
+
+ lcl_setLightsForScheme( *this, aScheme );
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+}
+
+void Diagram::setDefaultRotation( bool bPieOrDonut )
+{
+ drawing::CameraGeometry aCameraGeo( ThreeDHelper::getDefaultCameraGeometry( bPieOrDonut ) );
+ // "D3DCameraGeometry"
+ setFastPropertyValue( PROP_SCENE_CAMERA_GEOMETRY, uno::Any( aCameraGeo ));
+
+ ::basegfx::B3DHomMatrix aSceneRotation;
+ if( bPieOrDonut )
+ aSceneRotation.rotate( -M_PI/3.0, 0, 0 );
+ // "D3DTransformMatrix"
+ setFastPropertyValue( PROP_SCENE_TRANSF_MATRIX,
+ uno::Any( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aSceneRotation )));
+}
+
+void Diagram::switchRightAngledAxes( bool bRightAngledAxes )
+{
+ try
+ {
+ bool bOldRightAngledAxes = false;
+ getFastPropertyValue( PROP_DIAGRAM_RIGHT_ANGLED_AXES ) >>= bOldRightAngledAxes; // "RightAngledAxes"
+ if( bOldRightAngledAxes!=bRightAngledAxes)
+ {
+ setFastPropertyValue( PROP_DIAGRAM_RIGHT_ANGLED_AXES, uno::Any( bRightAngledAxes ));
+ if(bRightAngledAxes)
+ {
+ ::basegfx::B3DHomMatrix aInverseRotation( lcl_getInverseRotationMatrix( *this ) );
+ lcl_rotateLights( aInverseRotation, *this );
+ }
+ else
+ {
+ ::basegfx::B3DHomMatrix aCompleteRotation( lcl_getCompleteRotationMatrix( *this ) );
+ lcl_rotateLights( aCompleteRotation, *this );
+ }
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
}
} // namespace chart
diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx
index a08375fc5cf4..8e1842559c7b 100644
--- a/chart2/source/model/main/FormattedString.cxx
+++ b/chart2/source/model/main/FormattedString.cxx
@@ -17,13 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "FormattedString.hxx"
+#include <FormattedString.hxx>
#include <CharacterProperties.hxx>
#include <PropertyHelper.hxx>
#include <ModifyListenerHelper.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
namespace com::sun::star::uno { class XComponentContext; }
@@ -33,61 +32,36 @@ using ::com::sun::star::beans::Property;
using ::com::sun::star::uno::Sequence;
using ::osl::MutexGuard;
-namespace
-{
-
-struct StaticFormattedStringDefaults_Initializer
+namespace chart
{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- ::chart::CharacterProperties::AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-};
-
-struct StaticFormattedStringDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticFormattedStringDefaults_Initializer >
+const ::chart::tPropertyValueMap & StaticFormattedStringDefaults()
{
+ static ::chart::tPropertyValueMap aStaticDefaults = []
+ {
+ ::chart::tPropertyValueMap aMap;
+ ::chart::CharacterProperties::AddDefaultsToMap( aMap );
+ return aMap;
+ }();
+ return aStaticDefaults;
};
+} // namespace chart
-struct StaticFormattedStringInfoHelper_Initializer
+namespace
{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-struct StaticFormattedStringInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticFormattedStringInfoHelper_Initializer >
+::cppu::OPropertyArrayHelper& StaticFormattedStringInfoHelper()
{
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
-struct StaticFormattedStringInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticFormattedStringInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticFormattedStringInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticFormattedStringInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -96,7 +70,6 @@ namespace chart
{
FormattedString::FormattedString() :
- ::property::OPropertySet( m_aMutex ),
m_aType(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT),
m_bDataLabelsRange(false),
m_xModifyEventForwarder( new ModifyEventForwarder() )
@@ -104,7 +77,7 @@ FormattedString::FormattedString() :
FormattedString::FormattedString( const FormattedString & rOther ) :
impl::FormattedString_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_aString( rOther.m_aString ),
m_aType(rOther.m_aType),
m_aGuid(rOther.m_aGuid),
@@ -243,7 +216,7 @@ void FormattedString::fireModifyEvent()
// ____ OPropertySet ____
void FormattedString::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticFormattedStringDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticFormattedStringDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -254,13 +227,15 @@ void FormattedString::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL FormattedString::getInfoHelper()
{
- return *StaticFormattedStringInfoHelper::get();
+ return StaticFormattedStringInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL FormattedString::getPropertySetInfo()
{
- return *StaticFormattedStringInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticFormattedStringInfoHelper() ) );
+ return xPropertySetInfo;
}
using impl::FormattedString_Base;
@@ -273,7 +248,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( FormattedString, FormattedString_Base, ::prope
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
OUString SAL_CALL FormattedString::getImplementationName()
{
- return "com.sun.star.comp.chart.FormattedString";
+ return u"com.sun.star.comp.chart.FormattedString"_ustr;
}
sal_Bool SAL_CALL FormattedString::supportsService( const OUString& rServiceName )
@@ -284,9 +259,9 @@ sal_Bool SAL_CALL FormattedString::supportsService( const OUString& rServiceName
css::uno::Sequence< OUString > SAL_CALL FormattedString::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.DataPointCustomLabelField",
- "com.sun.star.chart2.FormattedString",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.DataPointCustomLabelField"_ustr,
+ u"com.sun.star.chart2.FormattedString"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/main/GridProperties.cxx b/chart2/source/model/main/GridProperties.cxx
index 0cfeaaafe1e3..2c1cacf86cf3 100644
--- a/chart2/source/model/main/GridProperties.cxx
+++ b/chart2/source/model/main/GridProperties.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "GridProperties.hxx"
+#include <GridProperties.hxx>
#include <LinePropertiesHelper.hxx>
#include <UserDefinedProperties.hxx>
#include <PropertyHelper.hxx>
@@ -25,9 +25,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
-namespace com::sun::star::beans { class XPropertySetInfo; }
namespace com::sun::star::uno { class XComponentContext; }
using namespace ::com::sun::star;
@@ -54,71 +52,38 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT );
}
-struct StaticGridDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
-
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_GRID_SHOW, false );
-
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >(
- rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_COLOR, 0xb3b3b3 ); // gray30
- }
-};
-
-struct StaticGridDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticGridDefaults_Initializer >
-{
-};
-
-struct StaticGridInfoHelper_Initializer
+const ::chart::tPropertyValueMap & StaticGridDefaults()
{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aTmp );
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_GRID_SHOW, false );
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue< sal_Int32 >(
+ aTmp, ::chart::LinePropertiesHelper::PROP_LINE_COLOR, 0xb3b3b3 ); // gray30
+ return aTmp;
+ }();
+ return aStaticDefaults;
};
-struct StaticGridInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticGridInfoHelper_Initializer >
+::cppu::OPropertyArrayHelper& StaticGridInfoHelper()
{
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-struct StaticGridInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticGridInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticGridInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticGridInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -127,13 +92,12 @@ namespace chart
{
GridProperties::GridProperties() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{}
GridProperties::GridProperties( const GridProperties & rOther ) :
impl::GridProperties_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
}
@@ -144,7 +108,7 @@ GridProperties::~GridProperties()
// ____ OPropertySet ____
void GridProperties::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticGridDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticGridDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -154,13 +118,15 @@ void GridProperties::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL GridProperties::getInfoHelper()
{
- return *StaticGridInfoHelper::get();
+ return StaticGridInfoHelper();
}
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL GridProperties::getPropertySetInfo()
{
- return *StaticGridInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticGridInfoHelper() ) );
+ return xPropertySetInfo;
}
// ____ XCloneable ____
@@ -201,7 +167,7 @@ void GridProperties::firePropertyChangeEvent()
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
OUString SAL_CALL GridProperties::getImplementationName()
{
- return "com.sun.star.comp.chart2.GridProperties";
+ return u"com.sun.star.comp.chart2.GridProperties"_ustr;
}
sal_Bool SAL_CALL GridProperties::supportsService( const OUString& rServiceName )
@@ -212,8 +178,8 @@ sal_Bool SAL_CALL GridProperties::supportsService( const OUString& rServiceName
css::uno::Sequence< OUString > SAL_CALL GridProperties::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.GridProperties",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.GridProperties"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
// needed by MSC compiler
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index 27eae67764ed..5f6ee67ccaa0 100644
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Legend.hxx"
+#include <Legend.hxx>
#include <LinePropertiesHelper.hxx>
#include <FillProperties.hxx>
#include <CharacterProperties.hxx>
@@ -31,7 +31,6 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
#include <algorithm>
@@ -106,78 +105,53 @@ void lcl_AddPropertiesToVector(
}
-struct StaticLegendDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
- ::chart::FillProperties::AddDefaultsToMap( rOutMap );
- ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
-
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_EXPANSION, css::chart::ChartLegendExpansion_HIGH );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_OVERLAY, false );
-
- float fDefaultCharHeight = 10.0;
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight );
- }
-};
+} // namespace
-struct StaticLegendDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticLegendDefaults_Initializer >
+namespace chart
{
-};
-
-struct StaticLegendInfoHelper_Initializer
+const ::chart::tPropertyValueMap& StaticLegendDefaults()
{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aTmp );
+ ::chart::FillProperties::AddDefaultsToMap( aTmp );
+ ::chart::CharacterProperties::AddDefaultsToMap( aTmp );
+
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_LEGEND_EXPANSION, css::chart::ChartLegendExpansion_HIGH );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_LEGEND_SHOW, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_LEGEND_OVERLAY, false );
+
+ float fDefaultCharHeight = 10.0;
+ ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight );
+ ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight );
+ return aTmp;
+ }();
+ return aStaticDefaults;
};
+} // namespace chart
-struct StaticLegendInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticLegendInfoHelper_Initializer >
-{
-};
-
-struct StaticLegendInfo_Initializer
+namespace
{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticLegendInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticLegendInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLegendInfo_Initializer >
+::cppu::OPropertyArrayHelper& StaticLegendInfoHelper()
{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -186,14 +160,13 @@ namespace chart
{
Legend::Legend() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
}
Legend::Legend( const Legend & rOther ) :
impl::Legend_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
}
@@ -240,7 +213,7 @@ void Legend::firePropertyChangeEvent()
// ____ OPropertySet ____
void Legend::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticLegendDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticLegendDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -250,19 +223,21 @@ void Legend::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL Legend::getInfoHelper()
{
- return *StaticLegendInfoHelper::get();
+ return StaticLegendInfoHelper();
}
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL Legend::getPropertySetInfo()
{
- return *StaticLegendInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticLegendInfoHelper() ) );
+ return xPropertySetInfo;
}
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
OUString SAL_CALL Legend::getImplementationName()
{
- return "com.sun.star.comp.chart2.Legend";
+ return u"com.sun.star.comp.chart2.Legend"_ustr;
}
sal_Bool SAL_CALL Legend::supportsService( const OUString& rServiceName )
@@ -273,12 +248,12 @@ sal_Bool SAL_CALL Legend::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL Legend::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.Legend",
- "com.sun.star.beans.PropertySet",
- "com.sun.star.drawing.FillProperties",
- "com.sun.star.drawing.LineProperties",
- "com.sun.star.style.CharacterProperties",
- "com.sun.star.layout.LayoutElement"
+ u"com.sun.star.chart2.Legend"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr,
+ u"com.sun.star.drawing.FillProperties"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr,
+ u"com.sun.star.style.CharacterProperties"_ustr,
+ u"com.sun.star.layout.LayoutElement"_ustr
};
}
diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx
index 9f51469ca9cb..2bddc6214ca1 100644
--- a/chart2/source/model/main/PageBackground.cxx
+++ b/chart2/source/model/main/PageBackground.cxx
@@ -18,15 +18,17 @@
*/
#include "PageBackground.hxx"
+#include <comphelper/lok.hxx>
#include <LinePropertiesHelper.hxx>
#include <FillProperties.hxx>
#include <UserDefinedProperties.hxx>
#include <PropertyHelper.hxx>
#include <ModifyListenerHelper.hxx>
+#include <svtools/colorcfg.hxx>
+#include <sfx2/viewsh.hxx>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
#include <vector>
#include <algorithm>
@@ -40,70 +42,47 @@ using ::com::sun::star::beans::Property;
namespace
{
-struct StaticPageBackgroundDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
- ::chart::FillProperties::AddDefaultsToMap( rOutMap );
-
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
- }
+const ::chart::tPropertyValueMap& StaticPageBackgroundDefaults()
+{
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aTmp );
+ ::chart::FillProperties::AddDefaultsToMap( aTmp );
+
+ // override other defaults
+ Color aDocColor = COL_WHITE;
+ if (comphelper::LibreOfficeKit::isActive()) {
+ aDocColor = COL_AUTO;
+ } else {
+ if (SfxViewShell* pCurrentSh = SfxViewShell::Current()) {
+ aDocColor = pCurrentSh->GetColorConfigColor(svtools::DOCCOLOR);
+ } else {
+ aDocColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+ }
+ }
+ ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::FillProperties::PROP_FILL_COLOR, aDocColor );
+ ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ return aTmp;
+ }();
+ return aStaticDefaults;
};
-struct StaticPageBackgroundDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticPageBackgroundDefaults_Initializer >
+::cppu::OPropertyArrayHelper& StaticPageBackgroundInfoHelper()
{
-};
-
-struct StaticPageBackgroundInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- return comphelper::containerToSequence( aProperties );
- }
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-};
-
-struct StaticPageBackgroundInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPageBackgroundInfoHelper_Initializer >
-{
-};
-
-struct StaticPageBackgroundInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticPageBackgroundInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticPageBackgroundInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticPageBackgroundInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -112,19 +91,26 @@ namespace chart
{
PageBackground::PageBackground() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{}
PageBackground::PageBackground( const PageBackground & rOther ) :
impl::PageBackground_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{}
PageBackground::~PageBackground()
{}
+// ____ XTypeProvider ____
+uno::Sequence< css::uno::Type > SAL_CALL PageBackground::getTypes()
+{
+ return ::comphelper::concatSequences(
+ impl::PageBackground_Base::getTypes(),
+ ::property::OPropertySet::getTypes());
+}
+
// ____ XCloneable ____
uno::Reference< util::XCloneable > SAL_CALL PageBackground::createClone()
{
@@ -134,7 +120,7 @@ uno::Reference< util::XCloneable > SAL_CALL PageBackground::createClone()
// ____ OPropertySet ____
void PageBackground::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticPageBackgroundDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticPageBackgroundDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -144,13 +130,15 @@ void PageBackground::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL PageBackground::getInfoHelper()
{
- return *StaticPageBackgroundInfoHelper::get();
+ return StaticPageBackgroundInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL PageBackground::getPropertySetInfo()
{
- return *StaticPageBackgroundInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticPageBackgroundInfoHelper() ) );
+ return xPropertySetInfo;
}
// ____ XModifyBroadcaster ____
@@ -184,7 +172,7 @@ void PageBackground::firePropertyChangeEvent()
OUString SAL_CALL PageBackground::getImplementationName()
{
- return "com.sun.star.comp.chart2.PageBackground";
+ return u"com.sun.star.comp.chart2.PageBackground"_ustr;
}
sal_Bool SAL_CALL PageBackground::supportsService( const OUString& rServiceName )
@@ -195,8 +183,8 @@ sal_Bool SAL_CALL PageBackground::supportsService( const OUString& rServiceName
css::uno::Sequence< OUString > SAL_CALL PageBackground::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.PageBackground",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.PageBackground"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
using impl::PageBackground_Base;
diff --git a/chart2/source/model/main/PageBackground.hxx b/chart2/source/model/main/PageBackground.hxx
index 3bc2dcfd0224..2aef8bd45ebe 100644
--- a/chart2/source/model/main/PageBackground.hxx
+++ b/chart2/source/model/main/PageBackground.hxx
@@ -21,7 +21,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <ModifyListenerHelper.hxx>
@@ -40,7 +39,6 @@ typedef ::cppu::WeakImplHelper<
}
class PageBackground final :
- public cppu::BaseMutex,
public impl::PageBackground_Base,
public ::property::OPropertySet
{
@@ -58,6 +56,9 @@ public:
explicit PageBackground( const PageBackground & rOther );
+ // ____ XTypeProvider ____
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
+
// ____ OPropertySet ____
virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
diff --git a/chart2/source/model/main/PolarCoordinateSystem.cxx b/chart2/source/model/main/PolarCoordinateSystem.cxx
index 5c891989e37f..e2581c0a55f2 100644
--- a/chart2/source/model/main/PolarCoordinateSystem.cxx
+++ b/chart2/source/model/main/PolarCoordinateSystem.cxx
@@ -31,8 +31,8 @@ using ::com::sun::star::uno::Sequence;
namespace
{
-constexpr OUStringLiteral CHART2_COOSYSTEM_POLAR_SERVICE_NAME
- = u"com.sun.star.chart2.CoordinateSystems.Polar";
+constexpr OUString CHART2_COOSYSTEM_POLAR_SERVICE_NAME
+ = u"com.sun.star.chart2.CoordinateSystems.Polar"_ustr;
}
@@ -72,7 +72,7 @@ uno::Reference< util::XCloneable > SAL_CALL PolarCoordinateSystem::createClone()
// ____ XServiceInfo ____
OUString SAL_CALL PolarCoordinateSystem::getImplementationName()
{
- return "com.sun.star.comp.chart.PolarCoordinateSystem";
+ return u"com.sun.star.comp.chart.PolarCoordinateSystem"_ustr;
}
sal_Bool SAL_CALL PolarCoordinateSystem::supportsService( const OUString& rServiceName )
@@ -97,7 +97,7 @@ PolarCoordinateSystem2d::~PolarCoordinateSystem2d()
// ____ XServiceInfo ____
OUString SAL_CALL PolarCoordinateSystem2d::getImplementationName()
{
- return "com.sun.star.comp.chart2.PolarCoordinateSystem2d" ;
+ return u"com.sun.star.comp.chart2.PolarCoordinateSystem2d"_ustr ;
}
sal_Bool SAL_CALL PolarCoordinateSystem2d::supportsService( const OUString& rServiceName )
@@ -109,7 +109,7 @@ css::uno::Sequence< OUString > SAL_CALL PolarCoordinateSystem2d::getSupportedSer
{
return {
CHART2_COOSYSTEM_POLAR_SERVICE_NAME,
- "com.sun.star.chart2.PolarCoordinateSystem2d" };
+ u"com.sun.star.chart2.PolarCoordinateSystem2d"_ustr };
}
// ==== PolarCoordinateSystem3d ====
@@ -124,7 +124,7 @@ PolarCoordinateSystem3d::~PolarCoordinateSystem3d()
// ____ XServiceInfo ____
OUString SAL_CALL PolarCoordinateSystem3d::getImplementationName()
{
- return "com.sun.star.comp.chart2.PolarCoordinateSystem3d";
+ return u"com.sun.star.comp.chart2.PolarCoordinateSystem3d"_ustr;
}
sal_Bool SAL_CALL PolarCoordinateSystem3d::supportsService( const OUString& rServiceName )
@@ -136,7 +136,7 @@ css::uno::Sequence< OUString > SAL_CALL PolarCoordinateSystem3d::getSupportedSer
{
return {
CHART2_COOSYSTEM_POLAR_SERVICE_NAME,
- "com.sun.star.chart2.PolarCoordinateSystem3d" };
+ u"com.sun.star.chart2.PolarCoordinateSystem3d"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx
index c93a9500e2d6..0be153bb8059 100644
--- a/chart2/source/model/main/StockBar.cxx
+++ b/chart2/source/model/main/StockBar.cxx
@@ -23,13 +23,9 @@
#include <UserDefinedProperties.hxx>
#include <PropertyHelper.hxx>
#include <ModifyListenerHelper.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <tools/diagnose_ex.h>
#include <algorithm>
-namespace com::sun::star::beans { class XPropertySetInfo; }
-
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -38,69 +34,36 @@ using ::com::sun::star::beans::Property;
namespace
{
-struct StaticStockBarInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticStockBarInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticStockBarInfoHelper_Initializer >
+::cppu::OPropertyArrayHelper& StaticStockBarInfoHelper()
{
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-struct StaticStockBarInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticStockBarInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticStockBarInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticStockBarInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
-struct StaticStockBarDefaults_Initializer
+const ::chart::tPropertyValueMap & StaticStockBarDefaults()
{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
- ::chart::FillProperties::AddDefaultsToMap( rOutMap );
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aTmp );
+ ::chart::FillProperties::AddDefaultsToMap( aTmp );
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff ); // white
- }
-};
-
-struct StaticStockBarDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticStockBarDefaults_Initializer >
-{
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( aTmp, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff ); // white
+ return aTmp;
+ }();
+ return aStaticDefaults;
};
} // anonymous namespace
@@ -109,7 +72,6 @@ namespace chart
{
StockBar::StockBar( bool bRisingCourse ) :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
if( ! bRisingCourse )
@@ -125,13 +87,21 @@ StockBar::StockBar( bool bRisingCourse ) :
StockBar::StockBar( const StockBar & rOther ) :
impl::StockBar_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{}
StockBar::~StockBar()
{}
+// ____ XTypeProvider ____
+uno::Sequence< css::uno::Type > SAL_CALL StockBar::getTypes()
+{
+ return ::comphelper::concatSequences(
+ impl::StockBar_Base::getTypes(),
+ ::property::OPropertySet::getTypes());
+}
+
// ____ XCloneable ____
uno::Reference< util::XCloneable > SAL_CALL StockBar::createClone()
{
@@ -141,7 +111,7 @@ uno::Reference< util::XCloneable > SAL_CALL StockBar::createClone()
// ____ OPropertySet ____
void StockBar::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticStockBarDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticStockBarDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -151,13 +121,15 @@ void StockBar::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL StockBar::getInfoHelper()
{
- return *StaticStockBarInfoHelper::get();
+ return StaticStockBarInfoHelper();
}
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL StockBar::getPropertySetInfo()
{
- return *StaticStockBarInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticStockBarInfoHelper() ) );
+ return xPropertySetInfo;
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx
index 35e3631077b1..d882304d43d3 100644
--- a/chart2/source/model/main/Title.cxx
+++ b/chart2/source/model/main/Title.cxx
@@ -17,7 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Title.hxx"
+#include <Title.hxx>
+#include <CharacterProperties.hxx>
#include <LinePropertiesHelper.hxx>
#include <FillProperties.hxx>
#include <CloneHelper.hxx>
@@ -30,7 +31,6 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
#include <vector>
#include <algorithm>
@@ -140,86 +140,56 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID );
}
-struct StaticTitleDefaults_Initializer
+const ::chart::tPropertyValueMap& StaticTitleDefaults()
{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
- ::chart::FillProperties::AddDefaultsToMap( rOutMap );
-
- // ParagraphProperties
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_PARA_ADJUST,
- css::style::ParagraphAdjust_CENTER );
- // PROP_TITLE_PARA_LAST_LINE_ADJUST
-
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_LEFT_MARGIN, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_RIGHT_MARGIN, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_TOP_MARGIN, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_BOTTOM_MARGIN, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_PARA_IS_HYPHENATION, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_VISIBLE, true );
-
- // own properties
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_TITLE_TEXT_ROTATION, 0.0 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_TEXT_STACKED, false );
-
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
- }
-};
-
-struct StaticTitleDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticTitleDefaults_Initializer >
-{
-};
-
-struct StaticTitleInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticTitleInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticTitleInfoHelper_Initializer >
-{
-};
-
-struct StaticTitleInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticTitleInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+
+ ::chart::CharacterProperties::AddDefaultsToMap( aTmp );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aTmp );
+ ::chart::FillProperties::AddDefaultsToMap( aTmp );
+
+ // ParagraphProperties
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_TITLE_PARA_ADJUST,
+ css::style::ParagraphAdjust_CENTER );
+ // PROP_TITLE_PARA_LAST_LINE_ADJUST
+
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_TITLE_PARA_LEFT_MARGIN, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_TITLE_PARA_RIGHT_MARGIN, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_TITLE_PARA_TOP_MARGIN, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_TITLE_PARA_BOTTOM_MARGIN, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_TITLE_PARA_IS_HYPHENATION, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_TITLE_VISIBLE, true );
+
+ // own properties
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( aTmp, PROP_TITLE_TEXT_ROTATION, 0.0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_TITLE_TEXT_STACKED, false );
+
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE );
+ ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ return aTmp;
+ }();
+ return aStaticDefaults;
};
-struct StaticTitleInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticTitleInfo_Initializer >
+::cppu::OPropertyArrayHelper& StaticTitleInfoHelper()
{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -228,13 +198,12 @@ namespace chart
{
Title::Title() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{}
Title::Title( const Title & rOther ) :
impl::Title_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
CloneHelper::CloneRefSequence<chart2::XFormattedString>(
@@ -285,7 +254,7 @@ void SAL_CALL Title::setText( const uno::Sequence< uno::Reference< chart2::XForm
// ____ OPropertySet ____
void Title::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticTitleDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticTitleDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -295,13 +264,15 @@ void Title::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL Title::getInfoHelper()
{
- return *StaticTitleInfoHelper::get();
+ return StaticTitleInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL Title::getPropertySetInfo()
{
- return *StaticTitleInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticTitleInfoHelper() ) );
+ return xPropertySetInfo;
}
// ____ XModifyBroadcaster ____
@@ -340,7 +311,7 @@ void Title::fireModifyEvent()
OUString SAL_CALL Title::getImplementationName()
{
- return "com.sun.star.comp.chart2.Title";
+ return u"com.sun.star.comp.chart2.Title"_ustr;
}
sal_Bool SAL_CALL Title::supportsService( const OUString& rServiceName )
@@ -351,10 +322,10 @@ sal_Bool SAL_CALL Title::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL Title::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.Title",
- "com.sun.star.style.ParagraphProperties",
- "com.sun.star.beans.PropertySet",
- "com.sun.star.layout.LayoutElement" };
+ u"com.sun.star.chart2.Title"_ustr,
+ u"com.sun.star.style.ParagraphProperties"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr,
+ u"com.sun.star.layout.LayoutElement"_ustr };
}
// needed by MSC compiler
diff --git a/chart2/source/model/main/UndoManager.cxx b/chart2/source/model/main/UndoManager.cxx
index 63dacf48444c..45f2b29ffffc 100644
--- a/chart2/source/model/main/UndoManager.cxx
+++ b/chart2/source/model/main/UndoManager.cxx
@@ -18,9 +18,9 @@
*/
#include "UndoManager.hxx"
+#include <ChartModel.hxx>
#include <ChartViewHelper.hxx>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/NoSupportException.hpp>
@@ -34,7 +34,6 @@ namespace chart
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::XInterface;
- using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::lang::DisposedException;
using ::com::sun::star::document::XUndoManager;
@@ -42,14 +41,13 @@ namespace chart
using ::com::sun::star::document::XUndoManagerListener;
using ::com::sun::star::lang::NoSupportException;
using ::com::sun::star::util::XModifyListener;
- using ::com::sun::star::frame::XModel;
namespace impl
{
class UndoManager_Impl : public ::framework::IUndoManagerImplementation
{
public:
- UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ UndoManager_Impl( UndoManager& i_antiImpl, ::chart::ChartModel& i_parent, ::osl::Mutex& i_mutex )
:m_rAntiImpl( i_antiImpl )
,m_rParent( i_parent )
,m_rMutex( i_mutex )
@@ -70,7 +68,7 @@ namespace chart
virtual Reference< XUndoManager > getThis() override;
// attribute access
- ::cppu::OWeakObject& getParent() { return m_rParent; }
+ ::chart::ChartModel& getParent() { return m_rParent; }
::framework::UndoManagerHelper& getUndoHelper() { return m_aUndoHelper; }
// public interface
@@ -83,7 +81,7 @@ namespace chart
private:
UndoManager& m_rAntiImpl;
- ::cppu::OWeakObject& m_rParent;
+ ::chart::ChartModel& m_rParent;
::osl::Mutex& m_rMutex;
bool m_bDisposed;
@@ -172,7 +170,7 @@ namespace chart
using impl::UndoManagerMethodGuard;
- UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ UndoManager::UndoManager( ::chart::ChartModel& i_parent, ::osl::Mutex& i_mutex )
:m_pImpl( new impl::UndoManager_Impl( *this, i_parent, i_mutex ) )
{
}
@@ -225,7 +223,7 @@ namespace chart
UndoManagerMethodGuard aGuard( *m_pImpl );
m_pImpl->getUndoHelper().undo( aGuard );
- ChartViewHelper::setViewToDirtyState( Reference< XModel >( getParent(), UNO_QUERY ) );
+ ChartViewHelper::setViewToDirtyState( &m_pImpl->getParent() );
}
void SAL_CALL UndoManager::redo( )
@@ -233,7 +231,7 @@ namespace chart
UndoManagerMethodGuard aGuard( *m_pImpl );
m_pImpl->getUndoHelper().redo( aGuard );
- ChartViewHelper::setViewToDirtyState( Reference< XModel >( getParent(), UNO_QUERY ) );
+ ChartViewHelper::setViewToDirtyState( &m_pImpl->getParent() );
}
sal_Bool SAL_CALL UndoManager::isUndoPossible( )
diff --git a/chart2/source/model/main/UndoManager.hxx b/chart2/source/model/main/UndoManager.hxx
index 4d0a214e5a70..c20dcef6643d 100644
--- a/chart2/source/model/main/UndoManager.hxx
+++ b/chart2/source/model/main/UndoManager.hxx
@@ -28,6 +28,7 @@
namespace chart
{
+class ChartModel;
namespace impl
{
@@ -40,7 +41,7 @@ namespace chart
class UndoManager : public impl::UndoManager_Base
{
public:
- UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex );
+ UndoManager( ::chart::ChartModel& i_parent, ::osl::Mutex& i_mutex );
virtual ~UndoManager();
// XInterface
diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx
index 5588ed81e0a3..1bbe133de905 100644
--- a/chart2/source/model/main/Wall.cxx
+++ b/chart2/source/model/main/Wall.cxx
@@ -24,7 +24,6 @@
#include <PropertyHelper.hxx>
#include <ModifyListenerHelper.hxx>
#include <com/sun/star/drawing/LineStyle.hpp>
-#include <tools/diagnose_ex.h>
#include <vector>
#include <algorithm>
@@ -36,69 +35,21 @@ using ::com::sun::star::beans::Property;
namespace
{
-struct StaticWallDefaults_Initializer
+::cppu::OPropertyArrayHelper& StaticWallInfoHelper()
{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
- ::chart::FillProperties::AddDefaultsToMap( rOutMap );
-
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
- }
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-struct StaticWallDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticWallDefaults_Initializer >
-{
-};
-
-struct StaticWallInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-};
-
-struct StaticWallInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticWallInfoHelper_Initializer >
-{
-};
-
-struct StaticWallInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticWallInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticWallInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticWallInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -107,19 +58,26 @@ namespace chart
{
Wall::Wall() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{}
Wall::Wall( const Wall & rOther ) :
impl::Wall_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{}
Wall::~Wall()
{}
+// ____ XTypeProvider ____
+uno::Sequence< css::uno::Type > SAL_CALL Wall::getTypes()
+{
+ return ::comphelper::concatSequences(
+ impl::Wall_Base::getTypes(),
+ ::property::OPropertySet::getTypes());
+}
+
// ____ XCloneable ____
uno::Reference< util::XCloneable > SAL_CALL Wall::createClone()
{
@@ -129,9 +87,18 @@ uno::Reference< util::XCloneable > SAL_CALL Wall::createClone()
// ____ OPropertySet ____
void Wall::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticWallDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
- if( aFound == rStaticDefaults.end() )
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( aTmp );
+ ::chart::FillProperties::AddDefaultsToMap( aTmp );
+
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
+ if( aFound == aStaticDefaults.end() )
rAny.clear();
else
rAny = (*aFound).second;
@@ -139,13 +106,15 @@ void Wall::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL Wall::getInfoHelper()
{
- return *StaticWallInfoHelper::get();
+ return StaticWallInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL Wall::getPropertySetInfo()
{
- return *StaticWallInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticWallInfoHelper() ) );
+ return xPropertySetInfo;
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/main/Wall.hxx b/chart2/source/model/main/Wall.hxx
index ddec92b6c876..6cae798959c1 100644
--- a/chart2/source/model/main/Wall.hxx
+++ b/chart2/source/model/main/Wall.hxx
@@ -21,7 +21,6 @@
#include <com/sun/star/util/XCloneable.hpp>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <ModifyListenerHelper.hxx>
@@ -39,7 +38,6 @@ typedef ::cppu::WeakImplHelper<
}
class Wall final :
- public cppu::BaseMutex,
public impl::Wall_Base,
public ::property::OPropertySet
{
@@ -52,6 +50,9 @@ public:
explicit Wall( const Wall & rOther );
+ // ____ XTypeProvider ____
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
+
// ____ OPropertySet ____
virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
diff --git a/chart2/source/model/template/AreaChartType.cxx b/chart2/source/model/template/AreaChartType.cxx
index 840bdba036d7..6d1dd578b0fe 100644
--- a/chart2/source/model/template/AreaChartType.cxx
+++ b/chart2/source/model/template/AreaChartType.cxx
@@ -44,6 +44,11 @@ uno::Reference< util::XCloneable > SAL_CALL AreaChartType::createClone()
return uno::Reference< util::XCloneable >( new AreaChartType( *this ));
}
+rtl::Reference< ChartType > AreaChartType::cloneChartType() const
+{
+ return new AreaChartType( *this );
+}
+
// ____ XChartType ____
OUString SAL_CALL AreaChartType::getChartType()
{
@@ -52,7 +57,7 @@ OUString SAL_CALL AreaChartType::getChartType()
OUString SAL_CALL AreaChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.AreaChartType";
+ return u"com.sun.star.comp.chart.AreaChartType"_ustr;
}
sal_Bool SAL_CALL AreaChartType::supportsService( const OUString& rServiceName )
@@ -64,7 +69,7 @@ css::uno::Sequence< OUString > SAL_CALL AreaChartType::getSupportedServiceNames(
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_AREA,
- "com.sun.star.chart2.ChartType" };
+ u"com.sun.star.chart2.ChartType"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/AreaChartType.hxx b/chart2/source/model/template/AreaChartType.hxx
index fdd2df3a234b..8ca01e1f3afd 100644
--- a/chart2/source/model/template/AreaChartType.hxx
+++ b/chart2/source/model/template/AreaChartType.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
namespace chart
{
@@ -36,6 +36,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit AreaChartType( const AreaChartType & rOther );
diff --git a/chart2/source/model/template/AreaChartTypeTemplate.cxx b/chart2/source/model/template/AreaChartTypeTemplate.cxx
index 6087c21251fb..c71fb5fb126f 100644
--- a/chart2/source/model/template/AreaChartTypeTemplate.cxx
+++ b/chart2/source/model/template/AreaChartTypeTemplate.cxx
@@ -18,15 +18,15 @@
*/
#include "AreaChartTypeTemplate.hxx"
-#include <servicenames_charttypes.hxx>
-#include <DiagramHelper.hxx>
+#include "AreaChartType.hxx"
+#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <PropertyHelper.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
@@ -54,58 +54,19 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT );
}
-struct StaticAreaChartTypeTemplateDefaults_Initializer
+::cppu::OPropertyArrayHelper& StaticAreaChartTypeTemplateInfoHelper()
{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aStaticDefaults, PROP_AREA_TEMPLATE_DIMENSION, 2 );
- return &aStaticDefaults;
- }
-};
-
-struct StaticAreaChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticAreaChartTypeTemplateDefaults_Initializer >
-{
-};
-
-struct StaticAreaChartTypeTemplateInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticAreaChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticAreaChartTypeTemplateInfoHelper_Initializer >
-{
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
-struct StaticAreaChartTypeTemplateInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAreaChartTypeTemplateInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticAreaChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticAreaChartTypeTemplateInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -120,7 +81,6 @@ AreaChartTypeTemplate::AreaChartTypeTemplate(
StackMode eStackMode,
sal_Int32 nDim /* = 2 */ ) :
ChartTypeTemplate( xContext, rServiceName ),
- ::property::OPropertySet( m_aMutex ),
m_eStackMode( eStackMode )
{
setFastPropertyValue_NoBroadcast( PROP_AREA_TEMPLATE_DIMENSION, uno::Any( nDim ));
@@ -132,9 +92,14 @@ AreaChartTypeTemplate::~AreaChartTypeTemplate()
// ____ OPropertySet ____
void AreaChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticAreaChartTypeTemplateDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
- if( aFound == rStaticDefaults.end() )
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_AREA_TEMPLATE_DIMENSION, 2 );
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
+ if( aFound == aStaticDefaults.end() )
rAny.clear();
else
rAny = (*aFound).second;
@@ -142,13 +107,15 @@ void AreaChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
::cppu::IPropertyArrayHelper & SAL_CALL AreaChartTypeTemplate::getInfoHelper()
{
- return *StaticAreaChartTypeTemplateInfoHelper::get();
+ return StaticAreaChartTypeTemplateInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL AreaChartTypeTemplate::getPropertySetInfo()
{
- return *StaticAreaChartTypeTemplateInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticAreaChartTypeTemplateInfoHelper() ) );
+ return xPropertySetInfo;
}
sal_Int32 AreaChartTypeTemplate::getDimension() const
@@ -173,59 +140,41 @@ StackMode AreaChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ )
return m_eStackMode;
}
-// ____ XChartTypeTemplate ____
-void SAL_CALL AreaChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+// ____ ChartTypeTemplate ____
+void AreaChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", uno::Any( drawing::LineStyle_NONE ) );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"BorderStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
}
-void SAL_CALL AreaChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram >& xDiagram )
+void AreaChartTypeTemplate::resetStyles2( const rtl::Reference< ::chart::Diagram >& xDiagram )
{
- ChartTypeTemplate::resetStyles( xDiagram );
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ ChartTypeTemplate::resetStyles2( xDiagram );
+ std::vector< rtl::Reference< ::chart::DataSeries > > aSeriesVec(
+ xDiagram->getDataSeries());
uno::Any aLineStyleAny( drawing::LineStyle_NONE );
for (auto const& series : aSeriesVec)
{
- Reference< beans::XPropertyState > xState(series, uno::UNO_QUERY);
- Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY);
- if( xState.is() &&
- xProp.is() &&
- xProp->getPropertyValue( "BorderStyle") == aLineStyleAny )
+ if( series->getPropertyValue( u"BorderStyle"_ustr) == aLineStyleAny )
{
- xState->setPropertyToDefault( "BorderStyle");
+ series->setPropertyToDefault( u"BorderStyle"_ustr);
}
}
}
-Reference< chart2::XChartType > AreaChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+rtl::Reference< ChartType > AreaChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
{
- Reference< chart2::XChartType > xResult;
-
- try
- {
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_AREA ), uno::UNO_QUERY_THROW );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- return xResult;
+ return new AreaChartType();
}
-Reference< chart2::XChartType > SAL_CALL AreaChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > AreaChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
+ rtl::Reference< ChartType > xResult( getChartTypeForIndex( 0 ) );
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
return xResult;
}
diff --git a/chart2/source/model/template/AreaChartTypeTemplate.hxx b/chart2/source/model/template/AreaChartTypeTemplate.hxx
index 6954513481e4..76a5bfd4c890 100644
--- a/chart2/source/model/template/AreaChartTypeTemplate.hxx
+++ b/chart2/source/model/template/AreaChartTypeTemplate.hxx
@@ -22,14 +22,12 @@
#include <StackMode.hxx>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <comphelper/uno3.hxx>
namespace chart
{
class AreaChartTypeTemplate :
- public cppu::BaseMutex,
public ChartTypeTemplate,
public ::property::OPropertySet
{
@@ -55,20 +53,20 @@ protected:
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
- // ____ XChartTypeTemplate ____
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence<
- css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ // ____ ChartTypeTemplate ____
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeGroupIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
- virtual void SAL_CALL resetStyles(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override;
+ virtual void resetStyles2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram ) override;
// ____ ChartTypeTemplate ____
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
virtual sal_Int32 getDimension() const override;
virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const override;
diff --git a/chart2/source/model/template/BarChartType.cxx b/chart2/source/model/template/BarChartType.cxx
index d32aa6efeca3..7bd27a943238 100644
--- a/chart2/source/model/template/BarChartType.cxx
+++ b/chart2/source/model/template/BarChartType.cxx
@@ -45,6 +45,11 @@ uno::Reference< util::XCloneable > SAL_CALL BarChartType::createClone()
return uno::Reference< util::XCloneable >( new BarChartType( *this ));
}
+rtl::Reference< ChartType > BarChartType::cloneChartType() const
+{
+ return new BarChartType( *this );
+}
+
// ____ XChartType ____
OUString SAL_CALL BarChartType::getChartType()
{
@@ -53,12 +58,12 @@ OUString SAL_CALL BarChartType::getChartType()
uno::Sequence< OUString > BarChartType::getSupportedPropertyRoles()
{
- return { "FillColor", "BorderColor" };
+ return { u"FillColor"_ustr, u"BorderColor"_ustr };
}
OUString SAL_CALL BarChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.BarChartType";
+ return u"com.sun.star.comp.chart.BarChartType"_ustr;
}
sal_Bool SAL_CALL BarChartType::supportsService( const OUString& rServiceName )
@@ -70,7 +75,7 @@ css::uno::Sequence< OUString > SAL_CALL BarChartType::getSupportedServiceNames()
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_BAR,
- "com.sun.star.chart2.ChartType" };
+ u"com.sun.star.chart2.ChartType"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/BarChartType.hxx b/chart2/source/model/template/BarChartType.hxx
index 62ed9aa0c2a2..cceaf05777f0 100644
--- a/chart2/source/model/template/BarChartType.hxx
+++ b/chart2/source/model/template/BarChartType.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
namespace chart
{
@@ -36,6 +36,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit BarChartType( const BarChartType & rOther );
diff --git a/chart2/source/model/template/BarChartTypeTemplate.cxx b/chart2/source/model/template/BarChartTypeTemplate.cxx
index f4534a27071a..e1d380fc8f85 100644
--- a/chart2/source/model/template/BarChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BarChartTypeTemplate.cxx
@@ -18,17 +18,16 @@
*/
#include "BarChartTypeTemplate.hxx"
-#include <DiagramHelper.hxx>
-#include <servicenames_charttypes.hxx>
+#include "ColumnChartType.hxx"
+#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <PropertyHelper.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
@@ -62,64 +61,19 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT );
}
-struct StaticBarChartTypeTemplateDefaults_Initializer
+::cppu::OPropertyArrayHelper& StaticBarChartTypeTemplateInfoHelper()
{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_BAR_TEMPLATE_DIMENSION, 2 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BAR_TEMPLATE_GEOMETRY3D, ::chart2::DataPointGeometry3D::CUBOID );
- }
-};
-
-struct StaticBarChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBarChartTypeTemplateDefaults_Initializer >
-{
-};
-
-struct StaticBarChartTypeTemplateInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticBarChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBarChartTypeTemplateInfoHelper_Initializer >
-{
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
-struct StaticBarChartTypeTemplateInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBarChartTypeTemplateInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticBarChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBarChartTypeTemplateInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -135,7 +89,6 @@ BarChartTypeTemplate::BarChartTypeTemplate(
BarDirection eDirection,
sal_Int32 nDim /* = 2 */ ) :
ChartTypeTemplate( xContext, rServiceName ),
- ::property::OPropertySet( m_aMutex ),
m_eStackMode( eStackMode ),
m_eBarDirection( eDirection ),
m_nDim( nDim )
@@ -159,19 +112,19 @@ bool BarChartTypeTemplate::isSwapXAndY() const
return (m_eBarDirection == HORIZONTAL);
}
-// ____ XChartTypeTemplate ____
-sal_Bool SAL_CALL BarChartTypeTemplate::matchesTemplate(
- const Reference< chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties )
+// ____ ChartTypeTemplate ____
+bool BarChartTypeTemplate::matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties )
{
- bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties );
+ bool bResult = ChartTypeTemplate::matchesTemplate2( xDiagram, bAdaptProperties );
//check BarDirection
if( bResult )
{
bool bFound = false;
bool bAmbiguous = false;
- bool bVertical = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
+ bool bVertical = xDiagram->getVertical( bFound, bAmbiguous );
if( m_eBarDirection == HORIZONTAL )
bResult = bVertical;
else if( m_eBarDirection == VERTICAL )
@@ -185,7 +138,7 @@ sal_Bool SAL_CALL BarChartTypeTemplate::matchesTemplate(
{
bool bGeomFound = false, bGeomAmbiguous = false;
- sal_Int32 aCommonGeom = DiagramHelper::getGeometry3D( xDiagram, bGeomFound, bGeomAmbiguous );
+ sal_Int32 aCommonGeom = xDiagram->getGeometry3D( bGeomFound, bGeomAmbiguous );
if( !bGeomAmbiguous )
{
@@ -196,29 +149,16 @@ sal_Bool SAL_CALL BarChartTypeTemplate::matchesTemplate(
return bResult;
}
-Reference< chart2::XChartType > BarChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
-{
- Reference< chart2::XChartType > xResult;
-
- try
- {
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_COLUMN ), uno::UNO_QUERY_THROW );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- return xResult;
+rtl::Reference< ChartType > BarChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+{
+ return new ColumnChartType();
}
-Reference< chart2::XChartType > SAL_CALL BarChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > BarChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
+ rtl::Reference< ChartType > xResult( getChartTypeForIndex( 0 ) );
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
return xResult;
}
@@ -226,9 +166,15 @@ Reference< chart2::XChartType > SAL_CALL BarChartTypeTemplate::getChartTypeForNe
// ____ OPropertySet ____
void BarChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticBarChartTypeTemplateDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
- if( aFound == rStaticDefaults.end() )
+ static ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aTmp, PROP_BAR_TEMPLATE_DIMENSION, 2 );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_BAR_TEMPLATE_GEOMETRY3D, ::chart2::DataPointGeometry3D::CUBOID );
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
+ if( aFound == aStaticDefaults.end() )
rAny.clear();
else
rAny = (*aFound).second;
@@ -236,23 +182,25 @@ void BarChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
::cppu::IPropertyArrayHelper & SAL_CALL BarChartTypeTemplate::getInfoHelper()
{
- return *StaticBarChartTypeTemplateInfoHelper::get();
+ return StaticBarChartTypeTemplateInfoHelper();
}
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL BarChartTypeTemplate::getPropertySetInfo()
{
- return *StaticBarChartTypeTemplateInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticBarChartTypeTemplateInfoHelper() ) );
+ return xPropertySetInfo;
}
-void SAL_CALL BarChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void BarChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", uno::Any( drawing::LineStyle_NONE ) );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"BorderStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
if( getDimension() != 3 )
return;
@@ -261,7 +209,7 @@ void SAL_CALL BarChartTypeTemplate::applyStyle(
//apply Geometry3D
uno::Any aAGeometry3D;
getFastPropertyValue( aAGeometry3D, PROP_BAR_TEMPLATE_GEOMETRY3D );
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "Geometry3D", aAGeometry3D );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"Geometry3D"_ustr, aAGeometry3D );
}
catch( const uno::Exception & )
{
@@ -269,39 +217,32 @@ void SAL_CALL BarChartTypeTemplate::applyStyle(
}
}
-void SAL_CALL BarChartTypeTemplate::resetStyles(
- const Reference< chart2::XDiagram >& xDiagram )
+void BarChartTypeTemplate::resetStyles2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram )
{
- ChartTypeTemplate::resetStyles( xDiagram );
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ ChartTypeTemplate::resetStyles2( xDiagram );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec(
+ xDiagram->getDataSeries());
uno::Any aLineStyleAny( drawing::LineStyle_NONE );
for (auto const& series : aSeriesVec)
{
- Reference< beans::XPropertyState > xState(series, uno::UNO_QUERY);
- if( xState.is())
+ if( getDimension() == 3 )
+ series->setPropertyToDefault( u"Geometry3D"_ustr);
+ if( series->getPropertyValue( u"BorderStyle"_ustr) == aLineStyleAny )
{
- if( getDimension() == 3 )
- xState->setPropertyToDefault( "Geometry3D");
- Reference< beans::XPropertySet > xProp( xState, uno::UNO_QUERY );
- if( xProp.is() &&
- xProp->getPropertyValue( "BorderStyle") == aLineStyleAny )
- {
- xState->setPropertyToDefault( "BorderStyle");
- }
+ series->setPropertyToDefault( u"BorderStyle"_ustr);
}
}
- DiagramHelper::setVertical( xDiagram, false );
+ xDiagram->setVertical( false );
}
void BarChartTypeTemplate::createCoordinateSystems(
- const Reference< chart2::XCoordinateSystemContainer > & xCooSysCnt )
+ const rtl::Reference< ::chart::Diagram > & xDiagram )
{
- ChartTypeTemplate::createCoordinateSystems( xCooSysCnt );
+ ChartTypeTemplate::createCoordinateSystems( xDiagram );
- Reference< chart2::XDiagram > xDiagram( xCooSysCnt, uno::UNO_QUERY );
- DiagramHelper::setVertical( xDiagram, m_eBarDirection == HORIZONTAL );
+ xDiagram->setVertical( m_eBarDirection == HORIZONTAL );
}
IMPLEMENT_FORWARD_XINTERFACE2( BarChartTypeTemplate, ChartTypeTemplate, OPropertySet )
diff --git a/chart2/source/model/template/BarChartTypeTemplate.hxx b/chart2/source/model/template/BarChartTypeTemplate.hxx
index 4146e2611c55..ab56869e71cd 100644
--- a/chart2/source/model/template/BarChartTypeTemplate.hxx
+++ b/chart2/source/model/template/BarChartTypeTemplate.hxx
@@ -19,7 +19,6 @@
#pragma once
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <comphelper/uno3.hxx>
#include <ChartTypeTemplate.hxx>
@@ -29,7 +28,6 @@ namespace chart
{
class BarChartTypeTemplate :
- public cppu::BaseMutex,
public ChartTypeTemplate,
public ::property::OPropertySet
{
@@ -62,30 +60,28 @@ protected:
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
- // ____ XChartTypeTemplate ____
- virtual sal_Bool SAL_CALL matchesTemplate(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties ) override;
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence<
- css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ // ____ ChartTypeTemplate ____
+ virtual bool matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties ) override;
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeGroupIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
- virtual void SAL_CALL resetStyles(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override;
-
- // ____ ChartTypeTemplate ____
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual void resetStyles2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram ) override;
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
virtual sal_Int32 getDimension() const override;
virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const override;
virtual bool isSwapXAndY() const override;
virtual void createCoordinateSystems(
- const css::uno::Reference< css::chart2::XCoordinateSystemContainer > & xCooSysCnt ) override;
+ const rtl::Reference< ::chart::Diagram > & xDiagram ) override;
private:
StackMode m_eStackMode;
diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx
index d0fc66213a97..76abecfe27ef 100644
--- a/chart2/source/model/template/BubbleChartType.cxx
+++ b/chart2/source/model/template/BubbleChartType.cxx
@@ -21,6 +21,7 @@
#include <PropertyHelper.hxx>
#include <servicenames_charttypes.hxx>
#include <CartesianCoordinateSystem.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <AxisIndexDefines.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
@@ -35,55 +36,16 @@ using ::com::sun::star::uno::Reference;
namespace
{
-struct StaticBubbleChartTypeDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- return &aStaticDefaults;
- }
-};
-
-struct StaticBubbleChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBubbleChartTypeDefaults_Initializer >
-{
-};
-
-struct StaticBubbleChartTypeInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-};
-
-struct StaticBubbleChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBubbleChartTypeInfoHelper_Initializer >
-{
-};
-
-struct StaticBubbleChartTypeInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBubbleChartTypeInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticBubbleChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBubbleChartTypeInfo_Initializer >
+::cppu::OPropertyArrayHelper& StaticBubbleChartTypeInfoHelper()
{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -109,16 +71,21 @@ uno::Reference< util::XCloneable > SAL_CALL BubbleChartType::createClone()
return uno::Reference< util::XCloneable >( new BubbleChartType( *this ));
}
+rtl::Reference< ChartType > BubbleChartType::cloneChartType() const
+{
+ return new BubbleChartType( *this );
+}
+
// ____ XChartType ____
-Reference< chart2::XCoordinateSystem > SAL_CALL
- BubbleChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+rtl::Reference< ::chart::BaseCoordinateSystem >
+ BubbleChartType::createCoordinateSystem2( sal_Int32 DimensionCount )
{
rtl::Reference< CartesianCoordinateSystem > xResult =
new CartesianCoordinateSystem( DimensionCount );
for( sal_Int32 i=0; i<DimensionCount; ++i )
{
- Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) );
+ rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( i, MAIN_AXIS_INDEX );
if( !xAxis.is() )
{
OSL_FAIL("a created coordinate system should have an axis for each dimension");
@@ -147,25 +114,25 @@ OUString SAL_CALL BubbleChartType::getChartType()
uno::Sequence< OUString > SAL_CALL BubbleChartType::getSupportedMandatoryRoles()
{
- return { "label", "values-x", "values-y", "values-size" };
+ return { u"label"_ustr, u"values-x"_ustr, u"values-y"_ustr, u"values-size"_ustr };
}
uno::Sequence< OUString > SAL_CALL BubbleChartType::getSupportedPropertyRoles()
{
- return { "FillColor", "BorderColor" };
+ return { u"FillColor"_ustr, u"BorderColor"_ustr };
}
OUString SAL_CALL BubbleChartType::getRoleOfSequenceForSeriesLabel()
{
- return "values-size";
+ return u"values-size"_ustr;
}
// ____ OPropertySet ____
void BubbleChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticBubbleChartTypeDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
- if( aFound == rStaticDefaults.end() )
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
+ if( aFound == aStaticDefaults.end() )
rAny.clear();
else
rAny = (*aFound).second;
@@ -174,18 +141,20 @@ void BubbleChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartType::getInfoHelper()
{
- return *StaticBubbleChartTypeInfoHelper::get();
+ return StaticBubbleChartTypeInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL BubbleChartType::getPropertySetInfo()
{
- return *StaticBubbleChartTypeInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticBubbleChartTypeInfoHelper() ) );
+ return xPropertySetInfo;
}
OUString SAL_CALL BubbleChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.BubbleChartType";
+ return u"com.sun.star.comp.chart.BubbleChartType"_ustr;
}
sal_Bool SAL_CALL BubbleChartType::supportsService( const OUString& rServiceName )
@@ -197,8 +166,8 @@ css::uno::Sequence< OUString > SAL_CALL BubbleChartType::getSupportedServiceName
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE,
- "com.sun.star.chart2.ChartType",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.ChartType"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/BubbleChartType.hxx b/chart2/source/model/template/BubbleChartType.hxx
index 4be938b66a88..a2afa7e6941d 100644
--- a/chart2/source/model/template/BubbleChartType.hxx
+++ b/chart2/source/model/template/BubbleChartType.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
namespace chart
{
@@ -36,6 +36,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit BubbleChartType( const BubbleChartType & rOther );
@@ -45,8 +47,6 @@ private:
getSupportedMandatoryRoles() override;
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedPropertyRoles() override;
- virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
- createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
virtual OUString SAL_CALL getRoleOfSequenceForSeriesLabel() override;
// ____ OPropertySet ____
@@ -61,6 +61,9 @@ private:
// ____ XCloneable ____
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
+
+ virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+ createCoordinateSystem2( sal_Int32 DimensionCount ) override;
};
} // namespace chart
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
index 3d7416b288cd..f72515eefd87 100644
--- a/chart2/source/model/template/BubbleChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
@@ -18,14 +18,14 @@
*/
#include "BubbleChartTypeTemplate.hxx"
+#include "BubbleChartType.hxx"
#include "BubbleDataInterpreter.hxx"
-#include <servicenames_charttypes.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <PropertyHelper.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
@@ -38,56 +38,16 @@ using ::com::sun::star::beans::Property;
namespace
{
-struct StaticBubbleChartTypeTemplateDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- return &aStaticDefaults;
- }
-};
-
-struct StaticBubbleChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBubbleChartTypeTemplateDefaults_Initializer >
-{
-};
-
-struct StaticBubbleChartTypeTemplateInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticBubbleChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBubbleChartTypeTemplateInfoHelper_Initializer >
-{
-};
-
-struct StaticBubbleChartTypeTemplateInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBubbleChartTypeTemplateInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticBubbleChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBubbleChartTypeTemplateInfo_Initializer >
+::cppu::OPropertyArrayHelper & StaticBubbleChartTypeTemplateInfoHelper()
{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -99,8 +59,7 @@ BubbleChartTypeTemplate::BubbleChartTypeTemplate(
Reference<
uno::XComponentContext > const & xContext,
const OUString & rServiceName ) :
- ChartTypeTemplate( xContext, rServiceName ),
- ::property::OPropertySet( m_aMutex )
+ ChartTypeTemplate( xContext, rServiceName )
{
}
@@ -110,9 +69,9 @@ BubbleChartTypeTemplate::~BubbleChartTypeTemplate()
// ____ OPropertySet ____
void BubbleChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticBubbleChartTypeTemplateDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
- if( aFound == rStaticDefaults.end() )
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
+ if( aFound == aStaticDefaults.end() )
rAny.clear();
else
rAny = (*aFound).second;
@@ -120,13 +79,15 @@ void BubbleChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny
::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartTypeTemplate::getInfoHelper()
{
- return *StaticBubbleChartTypeTemplateInfoHelper::get();
+ return StaticBubbleChartTypeTemplateInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL BubbleChartTypeTemplate::getPropertySetInfo()
{
- return *StaticBubbleChartTypeTemplateInfo::get();
+ static const uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticBubbleChartTypeTemplateInfoHelper() ) );
+ return xPropertySetInfo;
}
sal_Int32 BubbleChartTypeTemplate::getDimension() const
@@ -139,14 +100,14 @@ StackMode BubbleChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */
return StackMode::NONE;
}
-void SAL_CALL BubbleChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void BubbleChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", uno::Any( drawing::LineStyle_NONE ) );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"BorderStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
}
// ____ XChartTypeTemplate ____
@@ -155,36 +116,19 @@ sal_Bool SAL_CALL BubbleChartTypeTemplate::supportsCategories()
return false;
}
-Reference< chart2::XChartType > BubbleChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+rtl::Reference< ChartType > BubbleChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
{
- Reference< chart2::XChartType > xResult;
-
- try
- {
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ), uno::UNO_QUERY_THROW );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- return xResult;
+ return new BubbleChartType();
}
-Reference< chart2::XChartType > SAL_CALL BubbleChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > BubbleChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ), uno::UNO_QUERY_THROW );
+ xResult = new BubbleChartType();
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
}
@@ -196,7 +140,7 @@ Reference< chart2::XChartType > SAL_CALL BubbleChartTypeTemplate::getChartTypeFo
return xResult;
}
-Reference< chart2::XDataInterpreter > SAL_CALL BubbleChartTypeTemplate::getDataInterpreter()
+rtl::Reference< DataInterpreter > BubbleChartTypeTemplate::getDataInterpreter2()
{
if( ! m_xDataInterpreter.is())
m_xDataInterpreter.set( new BubbleDataInterpreter );
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.hxx b/chart2/source/model/template/BubbleChartTypeTemplate.hxx
index d04e09e38481..8a59e5e72817 100644
--- a/chart2/source/model/template/BubbleChartTypeTemplate.hxx
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.hxx
@@ -20,14 +20,12 @@
#include <ChartTypeTemplate.hxx>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <comphelper/uno3.hxx>
namespace chart
{
class BubbleChartTypeTemplate :
- public cppu::BaseMutex,
public ChartTypeTemplate,
public ::property::OPropertySet
{
@@ -51,19 +49,20 @@ protected:
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
- // ____ XChartTypeTemplate ____
+ // ____ ChartTypeTemplate ____
virtual sal_Bool SAL_CALL supportsCategories() override;
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual css::uno::Reference< css::chart2::XDataInterpreter > SAL_CALL getDataInterpreter() override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual rtl::Reference< ::chart::DataInterpreter > getDataInterpreter2() override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeGroupIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
// ____ ChartTypeTemplate ____
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
virtual sal_Int32 getDimension() const override;
virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const override;
diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx
index 09fd1c25d7da..8157fdcfb0fe 100644
--- a/chart2/source/model/template/BubbleDataInterpreter.cxx
+++ b/chart2/source/model/template/BubbleDataInterpreter.cxx
@@ -17,17 +17,19 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "BubbleDataInterpreter.hxx"
#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <CommonConverters.hxx>
-#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -44,25 +46,25 @@ BubbleDataInterpreter::~BubbleDataInterpreter()
}
// ____ XDataInterpreter ____
-chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
+InterpretedData BubbleDataInterpreter::interpretDataSource(
const Reference< chart2::data::XDataSource >& xSource,
const Sequence< beans::PropertyValue >& aArguments,
- const Sequence< Reference< XDataSeries > >& aSeriesToReUse )
+ const std::vector< rtl::Reference< DataSeries > >& aSeriesToReUse )
{
if( ! xSource.is())
return InterpretedData();
- Sequence< Reference< data::XLabeledDataSequence > > aData( xSource->getDataSequences() );
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aData = DataInterpreter::getDataSequences(xSource);
- Reference< data::XLabeledDataSequence > xValuesX;
- vector< Reference< data::XLabeledDataSequence > > aYValuesVector;
- vector< Reference< data::XLabeledDataSequence > > aSizeValuesVector;
+ uno::Reference< chart2::data::XLabeledDataSequence > xValuesX;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aYValuesVector;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aSizeValuesVector;
- Reference< data::XLabeledDataSequence > xCategories;
+ uno::Reference< chart2::data::XLabeledDataSequence > xCategories;
bool bHasCategories = HasCategories( aArguments, aData );
bool bUseCategoriesAsX = UseCategoriesAsX( aArguments );
- sal_Int32 nDataSeqCount = aData.getLength();
+ sal_Int32 nDataSeqCount = aData.size();
bool bSetXValues = bHasCategories ? ( (nDataSeqCount-1) > 2 && (nDataSeqCount-1) % 2 != 0 )
:( nDataSeqCount > 2 && nDataSeqCount % 2 != 0 );
@@ -75,10 +77,10 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
{
if( bHasCategories && !bCategoriesUsed )
{
- xCategories.set( aData[nDataIdx] );
+ xCategories = aData[nDataIdx];
if( xCategories.is())
{
- SetRole( xCategories->getValues(), "categories");
+ SetRole( xCategories->getValues(), u"categories"_ustr);
if( bUseCategoriesAsX )
{
bSetXValues = false;
@@ -89,22 +91,22 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
}
else if( !xValuesX.is() && bSetXValues )
{
- xValuesX.set( aData[nDataIdx] );
+ xValuesX = aData[nDataIdx];
if( xValuesX.is())
- SetRole( xValuesX->getValues(), "values-x");
+ SetRole( xValuesX->getValues(), u"values-x"_ustr);
}
else if( bNextIsYValues )
{
aYValuesVector.push_back( aData[nDataIdx] );
if( aData[nDataIdx].is())
- SetRole( aData[nDataIdx]->getValues(), "values-y");
+ SetRole( aData[nDataIdx]->getValues(), u"values-y"_ustr);
bNextIsYValues = false;
}
else if( !bNextIsYValues )
{
aSizeValuesVector.push_back( aData[nDataIdx] );
if( aData[nDataIdx].is())
- SetRole( aData[nDataIdx]->getValues(), "values-size");
+ SetRole( aData[nDataIdx]->getValues(), u"values-size"_ustr);
bNextIsYValues = (nDataSeqCount-(nDataIdx+1)) >= 2;//two or more left
}
}
@@ -115,8 +117,8 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
}
// create DataSeries
- sal_Int32 nSeriesIndex = 0;
- vector< Reference< XDataSeries > > aSeriesVec;
+ std::size_t nSeriesIndex = 0;
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec;
aSeriesVec.reserve( aSizeValuesVector.size());
Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX;
@@ -124,7 +126,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
for( size_t nN = 0; nN < aSizeValuesVector.size(); ++nN, ++nSeriesIndex )
{
- vector< Reference< data::XLabeledDataSequence > > aNewData;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewData;
if( xValuesX.is() )
{
if( nN > 0 && xCloneableX.is() )
@@ -135,51 +137,48 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
aNewData.push_back( aYValuesVector[nN] );
aNewData.push_back(aSizeValuesVector[nN]);
- Reference< XDataSeries > xSeries;
- if( nSeriesIndex < aSeriesToReUse.getLength())
- xSeries.set( aSeriesToReUse[nSeriesIndex] );
+ rtl::Reference< DataSeries > xSeries;
+ if( nSeriesIndex < aSeriesToReUse.size())
+ xSeries = aSeriesToReUse[nSeriesIndex];
else
- xSeries.set( new DataSeries );
- OSL_ASSERT( xSeries.is() );
- Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
- OSL_ASSERT( xSink.is() );
- xSink->setData( comphelper::containerToSequence( aNewData ) );
+ xSeries = new DataSeries;
+ assert( xSeries.is() );
+ xSeries->setData( aNewData );
aSeriesVec.push_back( xSeries );
}
- return InterpretedData( { comphelper::containerToSequence(aSeriesVec) }, xCategories );
+ return { { std::move(aSeriesVec) }, xCategories };
}
-chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
- const chart2::InterpretedData& aInterpretedData )
+InterpretedData BubbleDataInterpreter::reinterpretDataSeries(
+ const InterpretedData& aInterpretedData )
{
InterpretedData aResult( aInterpretedData );
sal_Int32 i=0;
- Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
- const sal_Int32 nCount = aSeries.getLength();
+ std::vector< rtl::Reference< DataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
+ const sal_Int32 nCount = aSeries.size();
for( ; i<nCount; ++i )
{
try
{
- Reference< data::XDataSource > xSeriesSource( aSeries[i], uno::UNO_QUERY_THROW );
- Sequence< Reference< data::XLabeledDataSequence > > aNewSequences;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewSequences;
- Reference< data::XLabeledDataSequence > xValuesSize(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, "values-size" ));
- Reference< data::XLabeledDataSequence > xValuesY(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, "values-y" ));
- Reference< data::XLabeledDataSequence > xValuesX(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, "values-x" ));
+ uno::Reference< chart2::data::XLabeledDataSequence > xValuesSize(
+ DataSeriesHelper::getDataSequenceByRole( aSeries[i], u"values-size"_ustr ));
+ uno::Reference< chart2::data::XLabeledDataSequence > xValuesY(
+ DataSeriesHelper::getDataSequenceByRole( aSeries[i], u"values-y"_ustr ));
+ uno::Reference< chart2::data::XLabeledDataSequence > xValuesX(
+ DataSeriesHelper::getDataSequenceByRole( aSeries[i], u"values-x"_ustr ));
if( ! xValuesX.is() ||
! xValuesY.is() ||
! xValuesSize.is() )
{
- vector< Reference< data::XLabeledDataSequence > > aValueSeqVec(
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aValueSeqVec(
DataSeriesHelper::getAllDataSequencesByRole(
- xSeriesSource->getDataSequences(), "values" ));
+ aSeries[i]->getDataSequences2(), u"values"_ustr ));
if( xValuesX.is())
aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX ));
if( xValuesY.is())
@@ -192,25 +191,25 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
if( ! xValuesSize.is() &&
aValueSeqVec.size() > nIndex )
{
- xValuesSize.set( aValueSeqVec[nIndex++] );
+ xValuesSize = aValueSeqVec[nIndex++];
if( xValuesSize.is())
- SetRole( xValuesSize->getValues(), "values-size");
+ SetRole( xValuesSize->getValues(), u"values-size"_ustr);
}
if( ! xValuesY.is() &&
aValueSeqVec.size() > nIndex )
{
- xValuesY.set( aValueSeqVec[nIndex++] );
+ xValuesY = aValueSeqVec[nIndex++];
if( xValuesY.is())
- SetRole( xValuesY->getValues(), "values-y");
+ SetRole( xValuesY->getValues(), u"values-y"_ustr);
}
if( ! xValuesX.is() &&
aValueSeqVec.size() > nIndex )
{
- xValuesX.set( aValueSeqVec[nIndex++] );
+ xValuesX = aValueSeqVec[nIndex++];
if( xValuesX.is())
- SetRole( xValuesY->getValues(), "values-x");
+ SetRole( xValuesX->getValues(), u"values-x"_ustr);
}
}
if( xValuesSize.is())
@@ -232,8 +231,8 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
}
}
- const Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences());
- if( aSeqs.getLength() != aNewSequences.getLength() )
+ const std::vector< uno::Reference< data::XLabeledDataSequence > > & aSeqs = aSeries[i]->getDataSequences2();
+ if( aSeqs.size() != aNewSequences.size() )
{
#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
for( auto const & j : aSeqs )
@@ -241,8 +240,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
assert( (j == xValuesY || j == xValuesX || j == xValuesSize) && "All sequences should be used" );
}
#endif
- Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW );
- xSink->setData( aNewSequences );
+ aSeries[i]->setData( aNewSequences );
}
}
catch( const uno::Exception & )
@@ -254,17 +252,15 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
return aResult;
}
-sal_Bool SAL_CALL BubbleDataInterpreter::isDataCompatible(
- const chart2::InterpretedData& aInterpretedData )
+bool BubbleDataInterpreter::isDataCompatible(
+ const InterpretedData& aInterpretedData )
{
- const Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
- for( Reference< XDataSeries > const & dataSeries : aSeries )
+ const std::vector< rtl::Reference< DataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
+ for( rtl::Reference< DataSeries > const & dataSeries : aSeries )
{
try
{
- Reference< data::XDataSource > xSrc( dataSeries, uno::UNO_QUERY_THROW );
- Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSrc->getDataSequences());
- if( aSeq.getLength() != 3 )
+ if( dataSeries->getDataSequences2().size() != 3 )
return false;
}
catch( const uno::Exception & )
diff --git a/chart2/source/model/template/BubbleDataInterpreter.hxx b/chart2/source/model/template/BubbleDataInterpreter.hxx
index e5a9041a75e3..ff4b56de615a 100644
--- a/chart2/source/model/template/BubbleDataInterpreter.hxx
+++ b/chart2/source/model/template/BubbleDataInterpreter.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "DataInterpreter.hxx"
+#include <DataInterpreter.hxx>
namespace chart
{
@@ -30,15 +30,15 @@ public:
virtual ~BubbleDataInterpreter() override;
protected:
- // ____ XDataInterpreter ____
- virtual css::chart2::InterpretedData SAL_CALL interpretDataSource(
+ // ____ DataInterpreter ____
+ virtual InterpretedData interpretDataSource(
const css::uno::Reference< css::chart2::data::XDataSource >& xSource,
const css::uno::Sequence< css::beans::PropertyValue >& aArguments,
- const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > >& aSeriesToReUse ) override;
- virtual css::chart2::InterpretedData SAL_CALL reinterpretDataSeries(
- const css::chart2::InterpretedData& aInterpretedData ) override;
- virtual sal_Bool SAL_CALL isDataCompatible(
- const css::chart2::InterpretedData& aInterpretedData ) override;
+ const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse ) override;
+ virtual InterpretedData reinterpretDataSeries(
+ const InterpretedData& aInterpretedData ) override;
+ virtual bool isDataCompatible(
+ const InterpretedData& aInterpretedData ) override;
};
} // namespace chart
diff --git a/chart2/source/model/template/CandleStickChartType.cxx b/chart2/source/model/template/CandleStickChartType.cxx
index 065b8d8ca736..4e1f08f05679 100644
--- a/chart2/source/model/template/CandleStickChartType.cxx
+++ b/chart2/source/model/template/CandleStickChartType.cxx
@@ -24,7 +24,7 @@
#include <servicenames_charttypes.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace com::sun::star::uno { class XComponentContext; }
@@ -79,66 +79,17 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT );
}
-struct StaticCandleStickChartTypeDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- // must match default in CTOR!
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_JAPANESE, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_SHOW_FIRST, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_SHOW_HIGH_LOW, true );
- }
-};
-
-struct StaticCandleStickChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticCandleStickChartTypeDefaults_Initializer >
-{
-};
-
-struct StaticCandleStickChartTypeInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticCandleStickChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticCandleStickChartTypeInfoHelper_Initializer >
-{
-};
-
-struct StaticCandleStickChartTypeInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticCandleStickChartTypeInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticCandleStickChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticCandleStickChartTypeInfo_Initializer >
+::cppu::OPropertyArrayHelper& StaticCandleStickChartTypeInfoHelper()
{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -206,6 +157,11 @@ uno::Reference< util::XCloneable > SAL_CALL CandleStickChartType::createClone()
return uno::Reference< util::XCloneable >( new CandleStickChartType( *this ));
}
+rtl::Reference< ChartType > CandleStickChartType::cloneChartType() const
+{
+ return new CandleStickChartType( *this );
+}
+
// ____ XChartType ____
OUString SAL_CALL CandleStickChartType::getChartType()
{
@@ -259,15 +215,23 @@ Sequence< OUString > SAL_CALL CandleStickChartType::getSupportedOptionalRoles()
OUString SAL_CALL CandleStickChartType::getRoleOfSequenceForSeriesLabel()
{
- return "values-last";
+ return u"values-last"_ustr;
}
// ____ OPropertySet ____
void CandleStickChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticCandleStickChartTypeDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
- if( aFound == rStaticDefaults.end() )
+ static const ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ // must match default in CTOR!
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_CANDLESTICKCHARTTYPE_JAPANESE, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_CANDLESTICKCHARTTYPE_SHOW_FIRST, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_CANDLESTICKCHARTTYPE_SHOW_HIGH_LOW, true );
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
+ if( aFound == aStaticDefaults.end() )
rAny.clear();
else
rAny = (*aFound).second;
@@ -276,13 +240,15 @@ void CandleStickChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL CandleStickChartType::getInfoHelper()
{
- return *StaticCandleStickChartTypeInfoHelper::get();
+ return StaticCandleStickChartTypeInfoHelper();
}
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL CandleStickChartType::getPropertySetInfo()
{
- return *StaticCandleStickChartTypeInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticCandleStickChartTypeInfoHelper() ) );
+ return xPropertySetInfo;
}
void SAL_CALL CandleStickChartType::setFastPropertyValue_NoBroadcast(
@@ -301,7 +267,7 @@ void SAL_CALL CandleStickChartType::setFastPropertyValue_NoBroadcast(
ModifyListenerHelper::removeListener( xBroadcaster, m_xModifyEventForwarder );
}
- OSL_ASSERT( rValue.getValueType().getTypeClass() == uno::TypeClass_INTERFACE );
+ OSL_ASSERT( rValue.getValueTypeClass() == uno::TypeClass_INTERFACE );
if( rValue.hasValue() &&
(rValue >>= xBroadcaster) &&
xBroadcaster.is())
@@ -315,7 +281,7 @@ void SAL_CALL CandleStickChartType::setFastPropertyValue_NoBroadcast(
OUString SAL_CALL CandleStickChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.CandleStickChartType" ;
+ return u"com.sun.star.comp.chart.CandleStickChartType"_ustr ;
}
sal_Bool SAL_CALL CandleStickChartType::supportsService( const OUString& rServiceName )
@@ -327,8 +293,8 @@ css::uno::Sequence< OUString > SAL_CALL CandleStickChartType::getSupportedServic
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK,
- "com.sun.star.chart2.ChartType",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.ChartType"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/CandleStickChartType.hxx b/chart2/source/model/template/CandleStickChartType.hxx
index eac57a5b6496..822422aac85f 100644
--- a/chart2/source/model/template/CandleStickChartType.hxx
+++ b/chart2/source/model/template/CandleStickChartType.hxx
@@ -18,14 +18,12 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
namespace chart
{
-// see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100797> "[10/11/12 Regression] using
-// declaration causing virtual call with wrongly adjusted this pointer" before restoring 'final'
-class CandleStickChartType /* final */ : public ChartType
+class CandleStickChartType final : public ChartType
{
public:
explicit CandleStickChartType();
@@ -38,6 +36,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit CandleStickChartType( const CandleStickChartType & rOther );
diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx
index b93c36806096..9e6f91f1def0 100644
--- a/chart2/source/model/template/ChartType.cxx
+++ b/chart2/source/model/template/ChartType.cxx
@@ -17,16 +17,21 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "ChartType.hxx"
+#include <ChartType.hxx>
#include <CartesianCoordinateSystem.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <CloneHelper.hxx>
#include <AxisIndexDefines.hxx>
#include <ModifyListenerHelper.hxx>
-#include <vcl/svapp.hxx>
+#include <DataSeries.hxx>
+#include <servicenames_charttypes.hxx>
+#include <StackMode.hxx>
+#include <DiagramHelper.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -38,20 +43,19 @@ namespace chart
{
ChartType::ChartType() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_bNotifyChanges( true )
{}
ChartType::ChartType( const ChartType & rOther ) :
impl::ChartType_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_bNotifyChanges( true )
{
{
SolarMutexGuard g; // access to rOther.m_aDataSeries
- CloneHelper::CloneRefVector<css::chart2::XDataSeries>(
+ CloneHelper::CloneRefVector(
rOther.m_aDataSeries, m_aDataSeries);
}
ModifyListenerHelper::addListenerToAllElements( m_aDataSeries, m_xModifyEventForwarder );
@@ -67,12 +71,18 @@ ChartType::~ChartType()
Reference< chart2::XCoordinateSystem > SAL_CALL
ChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
{
+ return createCoordinateSystem2(DimensionCount);
+}
+
+rtl::Reference< BaseCoordinateSystem >
+ ChartType::createCoordinateSystem2( ::sal_Int32 DimensionCount )
+{
rtl::Reference< CartesianCoordinateSystem > xResult =
new CartesianCoordinateSystem( DimensionCount );
for( sal_Int32 i=0; i<DimensionCount; ++i )
{
- Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) );
+ rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( i, MAIN_AXIS_INDEX );
if( !xAxis.is() )
{
OSL_FAIL("a created coordinate system should have an axis for each dimension");
@@ -98,7 +108,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL
Sequence< OUString > SAL_CALL ChartType::getSupportedMandatoryRoles()
{
- return { "label", "values-y" };
+ return { u"label"_ustr, u"values-y"_ustr };
}
Sequence< OUString > SAL_CALL ChartType::getSupportedOptionalRoles()
@@ -113,15 +123,15 @@ Sequence< OUString > SAL_CALL ChartType::getSupportedPropertyRoles()
OUString SAL_CALL ChartType::getRoleOfSequenceForSeriesLabel()
{
- return "values-y";
+ return u"values-y"_ustr;
}
void ChartType::impl_addDataSeriesWithoutNotification(
- const Reference< chart2::XDataSeries >& xDataSeries )
+ const rtl::Reference< DataSeries >& xDataSeries )
{
if( std::find( m_aDataSeries.begin(), m_aDataSeries.end(), xDataSeries )
!= m_aDataSeries.end())
- throw lang::IllegalArgumentException("dataseries not found", static_cast<cppu::OWeakObject*>(this), 1);
+ throw lang::IllegalArgumentException(u"dataseries not found"_ustr, static_cast<cppu::OWeakObject*>(this), 1);
m_aDataSeries.push_back( xDataSeries );
ModifyListenerHelper::addListener( xDataSeries, m_xModifyEventForwarder );
@@ -130,6 +140,13 @@ void ChartType::impl_addDataSeriesWithoutNotification(
// ____ XDataSeriesContainer ____
void SAL_CALL ChartType::addDataSeries( const Reference< chart2::XDataSeries >& xDataSeries )
{
+ rtl::Reference<DataSeries> xTmp = dynamic_cast<DataSeries*>(xDataSeries.get());
+ assert(xTmp);
+ addDataSeries(xTmp);
+}
+
+void ChartType::addDataSeries( const rtl::Reference< DataSeries >& xDataSeries )
+{
SolarMutexGuard g;
impl_addDataSeriesWithoutNotification( xDataSeries );
@@ -138,17 +155,23 @@ void SAL_CALL ChartType::addDataSeries( const Reference< chart2::XDataSeries >&
void SAL_CALL ChartType::removeDataSeries( const Reference< chart2::XDataSeries >& xDataSeries )
{
+ rtl::Reference<DataSeries> xTmp = dynamic_cast<DataSeries*>(xDataSeries.get());
+ assert(xTmp);
+ removeDataSeries(xTmp);
+}
+
+void ChartType::removeDataSeries( const rtl::Reference< DataSeries >& xDataSeries )
+{
if( !xDataSeries.is())
throw container::NoSuchElementException();
SolarMutexGuard g;
- tDataSeriesContainerType::iterator aIt(
- std::find( m_aDataSeries.begin(), m_aDataSeries.end(), xDataSeries ) );
+ auto aIt = std::find( m_aDataSeries.begin(), m_aDataSeries.end(), xDataSeries );
if( aIt == m_aDataSeries.end())
throw container::NoSuchElementException(
- "The given series is no element of this charttype",
+ u"The given series is no element of this charttype"_ustr,
static_cast< uno::XWeak * >( this ));
ModifyListenerHelper::removeListener( xDataSeries, m_xModifyEventForwarder );
@@ -160,18 +183,34 @@ Sequence< Reference< chart2::XDataSeries > > SAL_CALL ChartType::getDataSeries()
{
SolarMutexGuard g;
- return comphelper::containerToSequence( m_aDataSeries );
+ return comphelper::containerToSequence< Reference< chart2::XDataSeries > >( m_aDataSeries );
+}
+
+const std::vector<rtl::Reference<::chart::DataSeries>>& ChartType::getDataSeries2() const
+{
+ return m_aDataSeries;
}
void SAL_CALL ChartType::setDataSeries( const Sequence< Reference< chart2::XDataSeries > >& aDataSeries )
{
+ std::vector< rtl::Reference<DataSeries> > aTmp;
+ for (auto const & i : aDataSeries)
+ {
+ auto p = dynamic_cast<DataSeries*>(i.get());
+ assert(p);
+ aTmp.push_back(p);
+ }
+ setDataSeries(aTmp);
+}
+
+void ChartType::setDataSeries( const std::vector< rtl::Reference< DataSeries > >& aDataSeries )
+{
SolarMutexGuard g;
m_bNotifyChanges = false;
try
{
- const Sequence< Reference< chart2::XDataSeries > > aOldSeries( getDataSeries() );
- for( auto const & i : aOldSeries )
+ for( auto const & i : m_aDataSeries )
ModifyListenerHelper::removeListener( i, m_xModifyEventForwarder );
m_aDataSeries.clear();
@@ -185,6 +224,13 @@ void SAL_CALL ChartType::setDataSeries( const Sequence< Reference< chart2::XData
}
m_bNotifyChanges = true;
fireModifyEvent();
+
+ createCalculatedDataSeries();
+}
+
+void ChartType::createCalculatedDataSeries()
+{
+
}
// ____ OPropertySet ____
@@ -196,31 +242,10 @@ void ChartType::GetDefaultValue( sal_Int32 /* nHandle */, uno::Any& rAny ) const
namespace
{
-struct StaticChartTypeInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( Sequence< beans::Property >{} );
- return &aPropHelper;
- }
-};
-
-struct StaticChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticChartTypeInfoHelper_Initializer >
-{
-};
-
-struct StaticChartTypeInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticChartTypeInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticChartTypeInfo_Initializer >
+::cppu::OPropertyArrayHelper& StaticChartTypeInfoHelper()
{
+ static ::cppu::OPropertyArrayHelper aPropHelper( Sequence< beans::Property >{} );
+ return aPropHelper;
};
}
@@ -228,13 +253,15 @@ struct StaticChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans:
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL ChartType::getInfoHelper()
{
- return *StaticChartTypeInfoHelper::get();
+ return StaticChartTypeInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL ChartType::getPropertySetInfo()
{
- return *StaticChartTypeInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo( StaticChartTypeInfoHelper() ) );
+ return xPropertySetInfo;
}
// ____ XModifyBroadcaster ____
@@ -242,8 +269,7 @@ void SAL_CALL ChartType::addModifyListener( const uno::Reference< util::XModifyL
{
try
{
- uno::Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
- xBroadcaster->addModifyListener( aListener );
+ m_xModifyEventForwarder->addModifyListener( aListener );
}
catch( const uno::Exception & )
{
@@ -255,8 +281,7 @@ void SAL_CALL ChartType::removeModifyListener( const uno::Reference< util::XModi
{
try
{
- uno::Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
- xBroadcaster->removeModifyListener( aListener );
+ m_xModifyEventForwarder->removeModifyListener( aListener );
}
catch( const uno::Exception & )
{
@@ -295,11 +320,350 @@ void ChartType::fireModifyEvent()
m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this )));
}
+bool ChartType::isSupportingStatisticProperties(sal_Int32 nDimensionCount)
+{
+ //3D charts, pie, net and stock do not support statistic properties
+
+ if (nDimensionCount == 3)
+ return false;
+
+ OUString aChartTypeName = getChartType();
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE)) //todo: BubbleChart support error bars and trend lines
+ return false;
+
+ return true;
+}
+
+bool ChartType::isSupportingRegressionProperties(sal_Int32 nDimensionCount)
+{
+ // note: old chart: only scatter chart
+ return isSupportingStatisticProperties(nDimensionCount);
+}
+
+bool ChartType::isSupportingGeometryProperties(sal_Int32 nDimensionCount)
+{
+ //form tab only for 3D-bar and 3D-column charts.
+ if (nDimensionCount == 3)
+ {
+ OUString aChartTypeName = getChartType();
+
+ if (aChartTypeName == CHART2_SERVICE_NAME_CHARTTYPE_BAR)
+ return true;
+
+ if (aChartTypeName == CHART2_SERVICE_NAME_CHARTTYPE_COLUMN)
+ return true;
+ }
+ return false;
+}
+
+bool ChartType::isSupportingAreaProperties(sal_Int32 nDimensionCount)
+{
+ //2D line charts, net and stock do not support area properties
+ if (nDimensionCount == 2)
+ {
+ OUString aChartTypeName = getChartType();
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK))
+ return false;
+ }
+ return true;
+}
+
+bool ChartType::isSupportingSymbolProperties(sal_Int32 nDimensionCount)
+{
+ //2D line charts, 2D scatter charts and 2D net charts do support symbols
+ if (nDimensionCount == 3)
+ return false;
+
+ OUString aChartTypeName = getChartType();
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE))
+ return true;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER))
+ return true;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET))
+ return true;
+
+ return false;
+}
+
+bool ChartType::isSupportingSecondaryAxis(sal_Int32 nDimensionCount)
+{
+ //3D, pie and net charts do not support a secondary axis at all
+ if (nDimensionCount == 3)
+ return false;
+
+ OUString aChartTypeName = getChartType();
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET))
+ return false;
+
+ return true;
+}
+
+bool ChartType::isSupportingRightAngledAxes()
+{
+ OUString aChartTypeName = getChartType();
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE))
+ return false;
+ return true;
+}
+
+bool ChartType::isSupportingOverlapAndGapWidthProperties(sal_Int32 nDimensionCount)
+{
+ //2D bar charts do support a this special properties
+ if (nDimensionCount == 3)
+ return false;
+
+ OUString aChartTypeName = getChartType();
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN))
+ return true;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR))
+ return true;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM))
+ return true;
+ return false;
+}
+
+bool ChartType::isSupportingBarConnectors(sal_Int32 nDimensionCount)
+{
+ //2D bar charts with stacked series support this
+
+ if (nDimensionCount == 3)
+ return false;
+
+ bool bFound = false;
+ bool bAmbiguous = false;
+ StackMode eStackMode = DiagramHelper::getStackModeFromChartType(this, bFound, bAmbiguous, nullptr);
+ if (eStackMode != StackMode::YStacked || bAmbiguous)
+ return false;
+
+ OUString aChartTypeName = getChartType();
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN))
+ return true;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR))
+ return true; // note: old chart was false here
+
+ return false;
+}
+
+bool ChartType::isSupportingAxisSideBySide(sal_Int32 nDimensionCount)
+{
+ bool bResult = false;
+
+ if (nDimensionCount < 3)
+ {
+ bool bFound = false;
+ bool bAmbiguous = false;
+ StackMode eStackMode = DiagramHelper::getStackModeFromChartType(this, bFound, bAmbiguous, nullptr);
+ if (eStackMode == StackMode::NONE && !bAmbiguous)
+ {
+ OUString aChartTypeName = getChartType();
+
+ bResult = aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR);
+ }
+ }
+
+ return bResult;
+}
+
+bool ChartType::isSupportingBaseValue()
+{
+ OUString aChartTypeName = getChartType();
+
+ return aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA);
+}
+
+bool ChartType::isSupportingAxisPositioning(sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex )
+{
+ OUString aChartTypeName = getChartType();
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET))
+ return false;
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET))
+ return false;
+
+ if (nDimensionCount == 3)
+ return nDimensionIndex < 2;
+
+ return true;
+}
+
+bool ChartType::isSupportingMainAxis(sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex)
+{
+ // pie charts do not support axis at all
+ // no 3rd axis for 2D charts
+
+ OUString aChartTypeName = getChartType();
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE))
+ return false;
+
+ if (nDimensionIndex == 2)
+ return nDimensionCount == 3;
+
+ return true;
+}
+
+bool ChartType::isSupportingStartingAngle()
+{
+ OUString aChartTypeName = getChartType();
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE))
+ return true;
+ return false;
+}
+
+bool ChartType::isSupportingDateAxis(sal_Int32 nDimensionIndex)
+{
+ if (nDimensionIndex != 0)
+ return false;
+
+ sal_Int32 nType = getAxisType(nDimensionIndex);
+
+ if (nType != chart2::AxisType::CATEGORY)
+ return false;
+
+ OUString aChartTypeName = getChartType();
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET))
+ {
+ return false;
+ }
+ return true;
+}
+
+bool ChartType::isSupportingComplexCategory()
+{
+ OUString aChartTypeName = getChartType();
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE))
+ return false;
+ return true;
+}
+
+bool ChartType::isSupportingCategoryPositioning(sal_Int32 nDimensionCount)
+{
+ OUString aChartTypeName = getChartType();
+
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK))
+ {
+ return true;
+ }
+ else if (nDimensionCount == 2 &&
+ (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM)))
+ {
+ return true;
+ }
+ return false;
+}
+
+bool ChartType::isSupportingOnlyDeepStackingFor3D()
+{
+ OUString aChartTypeName = getChartType();
+ return
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA);
+}
+
+bool ChartType::isSeriesInFrontOfAxisLine()
+{
+ OUString aChartTypeName = getChartType();
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET))
+ return false;
+ return true;
+}
+
+sal_Int32 ChartType::getAxisType(sal_Int32 nDimensionIndex)
+{
+ //returned is a constant from constant group css::chart2::AxisType
+
+ OUString aChartTypeName = getChartType();
+ if (nDimensionIndex == 2) //z-axis
+ return chart2::AxisType::SERIES;
+
+ if (nDimensionIndex == 1) //y-axis
+ return chart2::AxisType::REALNUMBER;
+
+ if (nDimensionIndex == 0) //x-axis
+ {
+ if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE))
+ return chart2::AxisType::REALNUMBER;
+ return chart2::AxisType::CATEGORY;
+ }
+ return chart2::AxisType::CATEGORY;
+}
+
using impl::ChartType_Base;
IMPLEMENT_FORWARD_XINTERFACE2( ChartType, ChartType_Base, ::property::OPropertySet )
IMPLEMENT_FORWARD_XTYPEPROVIDER2( ChartType, ChartType_Base, ::property::OPropertySet )
+void ChartType::deleteSeries( const rtl::Reference< ::chart::DataSeries > & xSeries )
+{
+ try
+ {
+ SolarMutexGuard g;
+
+ auto it = std::find( m_aDataSeries.begin(), m_aDataSeries.end(), xSeries );
+ if( it == m_aDataSeries.end())
+ return;
+
+ ModifyListenerHelper::removeListener( *it, m_xModifyEventForwarder );
+ m_aDataSeries.erase(it);
+ fireModifyEvent();
+
+ createCalculatedDataSeries();
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx
index 5b639dbf31ab..8baf3682ecac 100644
--- a/chart2/source/model/template/ChartTypeManager.cxx
+++ b/chart2/source/model/template/ChartTypeManager.cxx
@@ -23,23 +23,25 @@
#include "LineChartTypeTemplate.hxx"
#include "BarChartTypeTemplate.hxx"
#include "ColumnLineChartTypeTemplate.hxx"
+#include "HistogramChartTypeTemplate.hxx"
#include "AreaChartTypeTemplate.hxx"
#include "PieChartTypeTemplate.hxx"
#include "ScatterChartTypeTemplate.hxx"
#include "StockChartTypeTemplate.hxx"
#include "NetChartTypeTemplate.hxx"
#include "BubbleChartTypeTemplate.hxx"
+#include "FunnelChartTypeTemplate.hxx"
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
#include <algorithm>
#include <iterator>
#include <o3tl/functional.hxx>
#include <map>
+#include <utility>
using namespace ::com::sun::star;
@@ -79,6 +81,7 @@ enum TemplateId
TEMPLATE_PERCENTSTACKEDTHREEDBARFLAT,
TEMPLATE_COLUMNWITHLINE,
TEMPLATE_STACKEDCOLUMNWITHLINE,
+ TEMPLATE_HISTOGRAM,
TEMPLATE_AREA,
TEMPLATE_STACKEDAREA,
TEMPLATE_PERCENTSTACKEDAREA,
@@ -89,6 +92,8 @@ enum TemplateId
TEMPLATE_PIEALLEXPLODED,
TEMPLATE_DONUT,
TEMPLATE_DONUTALLEXPLODED,
+ TEMPLATE_BAROFPIE,
+ TEMPLATE_PIEOFPIE,
TEMPLATE_THREEDPIE,
TEMPLATE_THREEDPIEALLEXPLODED,
TEMPLATE_THREEDDONUT,
@@ -114,6 +119,7 @@ enum TemplateId
TEMPLATE_STOCKVOLUMELOWHIGHCLOSE,
TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE,
TEMPLATE_BUBBLE,
+ TEMPLATE_FUNNEL,
// TEMPLATE_SURFACE,
// TEMPLATE_ADDIN,
TEMPLATE_NOT_FOUND = 0xffff
@@ -153,6 +159,7 @@ const tTemplateMapType & lcl_DefaultChartTypeMap()
{"com.sun.star.chart2.template.PercentStackedThreeDBarFlat", TEMPLATE_PERCENTSTACKEDTHREEDBARFLAT},
{"com.sun.star.chart2.template.ColumnWithLine", TEMPLATE_COLUMNWITHLINE},
{"com.sun.star.chart2.template.StackedColumnWithLine", TEMPLATE_STACKEDCOLUMNWITHLINE},
+ {"com.sun.star.chart2.template.Histogram", TEMPLATE_HISTOGRAM},
{"com.sun.star.chart2.template.Area", TEMPLATE_AREA},
{"com.sun.star.chart2.template.StackedArea", TEMPLATE_STACKEDAREA},
{"com.sun.star.chart2.template.PercentStackedArea", TEMPLATE_PERCENTSTACKEDAREA},
@@ -163,6 +170,9 @@ const tTemplateMapType & lcl_DefaultChartTypeMap()
{"com.sun.star.chart2.template.PieAllExploded", TEMPLATE_PIEALLEXPLODED},
{"com.sun.star.chart2.template.Donut", TEMPLATE_DONUT},
{"com.sun.star.chart2.template.DonutAllExploded", TEMPLATE_DONUTALLEXPLODED},
+ {"com.sun.star.chart2.template.BarOfPie", TEMPLATE_BAROFPIE},
+ {"com.sun.star.chart2.template.PieOfPie", TEMPLATE_PIEOFPIE},
+ {"com.sun.star.chart2.template.DonutAllExploded", TEMPLATE_DONUTALLEXPLODED},
{"com.sun.star.chart2.template.ThreeDPie", TEMPLATE_THREEDPIE},
{"com.sun.star.chart2.template.ThreeDPieAllExploded", TEMPLATE_THREEDPIEALLEXPLODED},
{"com.sun.star.chart2.template.ThreeDDonut", TEMPLATE_THREEDDONUT},
@@ -188,6 +198,7 @@ const tTemplateMapType & lcl_DefaultChartTypeMap()
{"com.sun.star.chart2.template.StockVolumeLowHighClose", TEMPLATE_STOCKVOLUMELOWHIGHCLOSE},
{"com.sun.star.chart2.template.StockVolumeOpenLowHighClose", TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE},
{"com.sun.star.chart2.template.Bubble", TEMPLATE_BUBBLE},
+ {"com.sun.star.chart2.template.Funnel", TEMPLATE_FUNNEL},
// {"com.sun.star.chart2.template.Surface", TEMPLATE_SURFACE},
// {"com.sun.star.chart2.template.Addin", TEMPLATE_ADDIN},
};
@@ -213,8 +224,8 @@ namespace chart
ChartTypeManager::ChartTypeManager(
uno::Reference<
- uno::XComponentContext > const & xContext ) :
- m_xContext( xContext )
+ uno::XComponentContext > xContext ) :
+ m_xContext(std::move( xContext ))
{}
ChartTypeManager::~ChartTypeManager()
@@ -360,6 +371,11 @@ rtl::Reference< ::chart::ChartTypeTemplate > ChartTypeManager::createTemplate(
}
break;
+ // Histogram
+ case TEMPLATE_HISTOGRAM:
+ xTemplate.set( new HistogramChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode::NONE ));
+ break;
+
// Area
case TEMPLATE_AREA:
xTemplate.set( new AreaChartTypeTemplate( m_xContext, aServiceSpecifier, StackMode::NONE ));
@@ -382,35 +398,53 @@ rtl::Reference< ::chart::ChartTypeTemplate > ChartTypeManager::createTemplate(
case TEMPLATE_PIE:
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
- chart2::PieChartOffsetMode_NONE, false ));
+ chart2::PieChartOffsetMode_NONE, false,
+ chart2::PieChartSubType_NONE, 3, 2));
break;
case TEMPLATE_PIEALLEXPLODED:
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
- chart2::PieChartOffsetMode_ALL_EXPLODED, false ));
+ chart2::PieChartOffsetMode_ALL_EXPLODED, false,
+ chart2::PieChartSubType_NONE, 3, 2 ));
break;
case TEMPLATE_DONUT:
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
- chart2::PieChartOffsetMode_NONE, true ));
+ chart2::PieChartOffsetMode_NONE, true,
+ chart2::PieChartSubType_NONE, 3, 2 ));
break;
case TEMPLATE_DONUTALLEXPLODED:
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
- chart2::PieChartOffsetMode_ALL_EXPLODED, true ));
+ chart2::PieChartOffsetMode_ALL_EXPLODED, true,
+ chart2::PieChartSubType_NONE, 3, 2 ));
+ break;
+ case TEMPLATE_BAROFPIE:
+ xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
+ chart2::PieChartOffsetMode_NONE, false,
+ chart2::PieChartSubType_BAR, 3, 2 ));
+ break;
+ case TEMPLATE_PIEOFPIE:
+ xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
+ chart2::PieChartOffsetMode_NONE, false,
+ chart2::PieChartSubType_PIE, 3, 2 ));
break;
case TEMPLATE_THREEDPIE:
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
- chart2::PieChartOffsetMode_NONE, false, 3 ));
+ chart2::PieChartOffsetMode_NONE, false,
+ chart2::PieChartSubType_NONE, 3, 3 ));
break;
case TEMPLATE_THREEDPIEALLEXPLODED:
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
- chart2::PieChartOffsetMode_ALL_EXPLODED, false, 3 ));
+ chart2::PieChartOffsetMode_ALL_EXPLODED, false,
+ chart2::PieChartSubType_NONE, 3, 3 ));
break;
case TEMPLATE_THREEDDONUT:
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
- chart2::PieChartOffsetMode_NONE, true, 3 ));
+ chart2::PieChartOffsetMode_NONE, true,
+ chart2::PieChartSubType_NONE, 3, 3 ));
break;
case TEMPLATE_THREEDDONUTALLEXPLODED:
xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier,
- chart2::PieChartOffsetMode_ALL_EXPLODED, true, 3 ));
+ chart2::PieChartOffsetMode_ALL_EXPLODED, true,
+ chart2::PieChartSubType_NONE, 3, 3 ));
break;
case TEMPLATE_SCATTERLINESYMBOL:
@@ -501,6 +535,11 @@ rtl::Reference< ::chart::ChartTypeTemplate > ChartTypeManager::createTemplate(
xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier ));
break;
+ // Funnel chart
+ case TEMPLATE_FUNNEL:
+ xTemplate.set( new FunnelChartTypeTemplate( m_xContext,
+ aServiceSpecifier));
+ break;
case TEMPLATE_NOT_FOUND:
SAL_WARN("chart2", "Couldn't instantiate service: "<< aServiceSpecifier );
assert(false);
@@ -539,7 +578,7 @@ uno::Sequence< OUString > SAL_CALL ChartTypeManager::getAvailableServiceNames()
if( xEnumAcc.is())
{
uno::Reference< container::XEnumeration > xEnum(
- xEnumAcc->createContentEnumeration( "com.sun.star.chart2.ChartTypeTemplate" ));
+ xEnumAcc->createContentEnumeration( u"com.sun.star.chart2.ChartTypeTemplate"_ustr ));
if( xEnum.is())
{
uno::Reference< uno::XInterface > xFactIntf;
@@ -562,7 +601,7 @@ uno::Sequence< OUString > SAL_CALL ChartTypeManager::getAvailableServiceNames()
// ____ XServiceInfo ____
OUString SAL_CALL ChartTypeManager::getImplementationName()
{
- return "com.sun.star.comp.chart.ChartTypeManager";
+ return u"com.sun.star.comp.chart.ChartTypeManager"_ustr;
}
sal_Bool SAL_CALL ChartTypeManager::supportsService( const OUString& rServiceName )
@@ -573,8 +612,8 @@ sal_Bool SAL_CALL ChartTypeManager::supportsService( const OUString& rServiceNam
css::uno::Sequence< OUString > SAL_CALL ChartTypeManager::getSupportedServiceNames()
{
return {
- "com.sun.star.chart2.ChartTypeManager",
- "com.sun.star.lang.MultiServiceFactory" };
+ u"com.sun.star.chart2.ChartTypeManager"_ustr,
+ u"com.sun.star.lang.MultiServiceFactory"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index e6eb5e27e069..5685f9e06c0c 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -18,29 +18,35 @@
*/
#include <ChartTypeTemplate.hxx>
-#include "DataInterpreter.hxx"
+#include <DataInterpreter.hxx>
#include <CommonConverters.hxx>
#include <ChartTypeHelper.hxx>
+#include <ChartType.hxx>
+#include <DataSeriesProperties.hxx>
+#include <DataSource.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
+#include <Diagram.hxx>
#include <DiagramHelper.hxx>
#include <AxisIndexDefines.hxx>
+#include <BaseCoordinateSystem.hxx>
#include <unonames.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <tools/diagnose_ex.h>
+#include <com/sun/star/chart2/XColorScheme.hpp>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/property.hxx>
-#include <comphelper/sequence.hxx>
#include <algorithm>
+#include <cstddef>
+#include <utility>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
@@ -49,19 +55,18 @@ namespace
{
void lcl_applyDefaultStyle(
- const Reference< XDataSeries > & xSeries,
+ const rtl::Reference< ::chart::DataSeries > & xSeries,
sal_Int32 nIndex,
- const Reference< XDiagram > & xDiagram )
+ const rtl::Reference< ::chart::Diagram > & xDiagram )
{
// @deprecated: correct default color should be found by view without
// setting color as hard attribute
if( xSeries.is() && xDiagram.is())
{
- Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
Reference< chart2::XColorScheme > xColorScheme( xDiagram->getDefaultColorScheme());
- if( xSeriesProp.is() && xColorScheme.is() )
- xSeriesProp->setPropertyValue(
- "Color",
+ if( xColorScheme.is() )
+ xSeries->setPropertyValue(
+ u"Color"_ustr,
uno::Any( xColorScheme->getColorByIndex( nIndex )));
}
}
@@ -69,7 +74,7 @@ void lcl_applyDefaultStyle(
void lcl_ensureCorrectLabelPlacement( const Reference< beans::XPropertySet >& xProp, const uno::Sequence < sal_Int32 >& rAvailablePlacements )
{
sal_Int32 nLabelPlacement=0;
- if( !(xProp.is() && (xProp->getPropertyValue( "LabelPlacement" ) >>= nLabelPlacement)) )
+ if( !(xProp.is() && (xProp->getPropertyValue( u"LabelPlacement"_ustr ) >>= nLabelPlacement)) )
return;
bool bValid = false;
@@ -87,7 +92,7 @@ void lcl_ensureCorrectLabelPlacement( const Reference< beans::XPropertySet >& xP
//otherwise use the first supported one
if( rAvailablePlacements.hasElements() )
aNewValue <<=rAvailablePlacements[0];
- xProp->setPropertyValue( "LabelPlacement", aNewValue );
+ xProp->setPropertyValue( u"LabelPlacement"_ustr, aNewValue );
}
}
@@ -95,25 +100,24 @@ void lcl_resetLabelPlacementIfDefault( const Reference< beans::XPropertySet >& x
{
sal_Int32 nLabelPlacement=0;
- if( xProp.is() && (xProp->getPropertyValue( "LabelPlacement" ) >>= nLabelPlacement) )
+ if( xProp.is() && (xProp->getPropertyValue( u"LabelPlacement"_ustr ) >>= nLabelPlacement) )
{
if( nDefaultPlacement == nLabelPlacement )
- xProp->setPropertyValue( "LabelPlacement", uno::Any() );
+ xProp->setPropertyValue( u"LabelPlacement"_ustr, uno::Any() );
}
}
-void lcl_ensureCorrectMissingValueTreatment( const Reference< chart2::XDiagram >& xDiagram, const Reference< XChartType >& xChartType )
+void lcl_ensureCorrectMissingValueTreatment( const rtl::Reference< ::chart::Diagram >& xDiagram, const rtl::Reference< ::chart::ChartType >& xChartType )
{
- Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
- if( xDiaProp.is() )
+ if( xDiagram.is() )
{
uno::Sequence < sal_Int32 > aAvailableMissingValueTreatment(
::chart::ChartTypeHelper::getSupportedMissingValueTreatments( xChartType ) );
if( aAvailableMissingValueTreatment.hasElements() )
- xDiaProp->setPropertyValue( "MissingValueTreatment", uno::Any( aAvailableMissingValueTreatment[0] ) );
+ xDiagram->setPropertyValue( u"MissingValueTreatment"_ustr, uno::Any( aAvailableMissingValueTreatment[0] ) );
else
- xDiaProp->setPropertyValue( "MissingValueTreatment", uno::Any() );
+ xDiagram->setPropertyValue( u"MissingValueTreatment"_ustr, uno::Any() );
}
}
@@ -124,44 +128,39 @@ namespace chart
ChartTypeTemplate::ChartTypeTemplate(
Reference< uno::XComponentContext > const & xContext,
- const OUString & rServiceName ) :
+ OUString aServiceName ) :
m_xContext( xContext ),
- m_aServiceName( rServiceName )
+ m_aServiceName(std::move( aServiceName ))
{
}
ChartTypeTemplate::~ChartTypeTemplate()
{}
-// ____ XChartTypeTemplate ____
-uno::Reference< XDiagram > SAL_CALL ChartTypeTemplate::createDiagramByDataSource(
+// ____ ChartTypeTemplate ____
+rtl::Reference< Diagram > ChartTypeTemplate::createDiagramByDataSource2(
const uno::Reference< data::XDataSource >& xDataSource,
const uno::Sequence< beans::PropertyValue >& aArguments )
{
- Reference< XDiagram > xDia;
+ rtl::Reference< Diagram > xDia;
try
{
// create diagram
- xDia.set(
- GetComponentContext()->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.Diagram",
- GetComponentContext() ),
- uno::UNO_QUERY_THROW );
+ xDia = new Diagram(GetComponentContext());
// modify diagram
- Reference< chart2::XDataInterpreter > xInterpreter( getDataInterpreter());
- chart2::InterpretedData aData(
+ rtl::Reference< DataInterpreter > xInterpreter( getDataInterpreter2());
+ InterpretedData aData(
xInterpreter->interpretDataSource(
- xDataSource, aArguments, Sequence< Reference< XDataSeries > >() ));
+ xDataSource, aArguments, {} ));
- const Sequence< Sequence< Reference< XDataSeries > > > aSeries( aData.Series );
sal_Int32 nCount = 0;
- for( auto const & i : aSeries )
+ for( auto const & i : aData.Series )
for( auto const & j : i )
lcl_applyDefaultStyle( j, nCount++, xDia );
- Sequence< Reference< XChartType > > aOldChartTypesSeq;
+ std::vector< rtl::Reference< ChartType > > aOldChartTypesSeq;
FillDiagram( xDia, aData.Series, aData.Categories, aOldChartTypesSeq );
}
catch( const uno::Exception & )
@@ -177,23 +176,23 @@ sal_Bool SAL_CALL ChartTypeTemplate::supportsCategories()
return true;
}
-void SAL_CALL ChartTypeTemplate::changeDiagram( const uno::Reference< XDiagram >& xDiagram )
+void ChartTypeTemplate::changeDiagram( const rtl::Reference< Diagram >& xDiagram )
{
if( ! xDiagram.is())
return;
try
{
- Sequence< Sequence< Reference< XDataSeries > > > aSeriesSeq(
- DiagramHelper::getDataSeriesGroups( xDiagram ));
- Sequence< Reference< XDataSeries > > aFlatSeriesSeq( FlattenSequence( aSeriesSeq ));
- const sal_Int32 nFormerSeriesCount = aFlatSeriesSeq.getLength();
+ std::vector< std::vector< rtl::Reference< DataSeries > > > aSeriesSeq =
+ xDiagram->getDataSeriesGroups();
+ std::vector< rtl::Reference< DataSeries > > aFlatSeriesSeq( FlattenSequence( aSeriesSeq ));
+ const sal_Int32 nFormerSeriesCount = aFlatSeriesSeq.size();
// chart-type specific interpretation of existing data series
- Reference< chart2::XDataInterpreter > xInterpreter( getDataInterpreter());
- chart2::InterpretedData aData;
+ rtl::Reference< DataInterpreter > xInterpreter( getDataInterpreter2());
+ InterpretedData aData;
aData.Series = aSeriesSeq;
- aData.Categories = DiagramHelper::getCategoriesFromDiagram( xDiagram );
+ aData.Categories = xDiagram->getCategories();
if( xInterpreter->isDataCompatible( aData ) )
{
@@ -201,7 +200,7 @@ void SAL_CALL ChartTypeTemplate::changeDiagram( const uno::Reference< XDiagram >
}
else
{
- Reference< data::XDataSource > xSource( xInterpreter->mergeInterpretedData( aData ));
+ rtl::Reference< DataSource > xSource = DataInterpreter::mergeInterpretedData( aData );
// todo: get a "range-union" from the data provider by calling
// OUString aRange = getRangeRepresentationByData( xSource );
// xSource.set( getDataByRangeRepresentation( aRange, aParam ));
@@ -209,7 +208,7 @@ void SAL_CALL ChartTypeTemplate::changeDiagram( const uno::Reference< XDiagram >
Sequence< beans::PropertyValue > aParam;
if( aData.Categories.is())
{
- aParam = { beans::PropertyValue( "HasCategories", -1, uno::Any( true ),
+ aParam = { beans::PropertyValue( u"HasCategories"_ustr, -1, uno::Any( true ),
beans::PropertyState_DIRECT_VALUE ) };
}
aData = xInterpreter->interpretDataSource( xSource, aParam, aFlatSeriesSeq );
@@ -217,29 +216,21 @@ void SAL_CALL ChartTypeTemplate::changeDiagram( const uno::Reference< XDiagram >
aSeriesSeq = aData.Series;
sal_Int32 nIndex = 0;
- for( auto const & i : std::as_const(aSeriesSeq) )
+ for (auto const& i : aSeriesSeq)
for( auto const & j : i )
{
if( nIndex >= nFormerSeriesCount )
- lcl_applyDefaultStyle( j, nIndex++, xDiagram );
+ lcl_applyDefaultStyle( j, nIndex, xDiagram );
+ nIndex++;
}
// remove charttype groups from all coordinate systems
- Sequence< Reference< XChartType > > aOldChartTypesSeq(
- DiagramHelper::getChartTypesFromDiagram(xDiagram) );
+ std::vector< rtl::Reference< ChartType > > aOldChartTypesSeq =
+ xDiagram->getChartTypes();
- Reference< XCoordinateSystemContainer > xCoordSysCnt( xDiagram, uno::UNO_QUERY );
- OSL_ASSERT( xCoordSysCnt.is());
- if( xCoordSysCnt.is())
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : xDiagram->getBaseCoordinateSystems() )
{
- const Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCoordSysCnt->getCoordinateSystems());
- for( Reference< XCoordinateSystem > const & coords : aCooSysSeq )
- {
- Reference< XChartTypeContainer > xContainer( coords, uno::UNO_QUERY );
- if( xContainer.is() )
- xContainer->setChartTypes( Sequence< Reference< XChartType > >() );
- }
+ coords->setChartTypes( Sequence< Reference< XChartType > >() );
}
FillDiagram( xDiagram, aSeriesSeq, aData.Categories, aOldChartTypesSeq );
@@ -250,8 +241,8 @@ void SAL_CALL ChartTypeTemplate::changeDiagram( const uno::Reference< XDiagram >
}
}
-void SAL_CALL ChartTypeTemplate::changeDiagramData(
- const Reference< chart2::XDiagram >& xDiagram,
+void ChartTypeTemplate::changeDiagramData(
+ const rtl::Reference< Diagram >& xDiagram,
const Reference< chart2::data::XDataSource >& xDataSource,
const Sequence< beans::PropertyValue >& aArguments )
{
@@ -262,37 +253,34 @@ void SAL_CALL ChartTypeTemplate::changeDiagramData(
try
{
// interpret new data and re-use existing series
- Sequence< Reference< XDataSeries > > aFlatSeriesSeq(
- comphelper::containerToSequence( DiagramHelper::getDataSeriesFromDiagram( xDiagram )));
- const sal_Int32 nFormerSeriesCount = aFlatSeriesSeq.getLength();
- Reference< chart2::XDataInterpreter > xInterpreter( getDataInterpreter());
- chart2::InterpretedData aData =
+ std::vector< rtl::Reference< DataSeries > > aFlatSeriesSeq =
+ xDiagram->getDataSeries();
+ const sal_Int32 nFormerSeriesCount = aFlatSeriesSeq.size();
+ rtl::Reference< DataInterpreter > xInterpreter( getDataInterpreter2());
+ InterpretedData aData =
xInterpreter->interpretDataSource( xDataSource, aArguments, aFlatSeriesSeq );
// data series
- Sequence< Sequence< Reference< XDataSeries > > > aSeriesSeq( aData.Series );
-
- sal_Int32 i, j, nIndex = 0;
- for( i=0; i<aSeriesSeq.getLength(); ++i )
- for( j=0; j<aSeriesSeq[i].getLength(); ++j, ++nIndex )
+ sal_Int32 nIndex = 0;
+ for( std::size_t i=0; i<aData.Series.size(); ++i )
+ for( std::size_t j=0; j<aData.Series[i].size(); ++j, ++nIndex )
{
if( nIndex >= nFormerSeriesCount )
{
- lcl_applyDefaultStyle( aSeriesSeq[i][j], nIndex, xDiagram );
- applyStyle( aSeriesSeq[i][j], i, j, aSeriesSeq[i].getLength() );
+ lcl_applyDefaultStyle( aData.Series[i][j], nIndex, xDiagram );
+ applyStyle2( aData.Series[i][j], i, j, aData.Series[i].size() );
}
}
// categories
- DiagramHelper::setCategoriesToDiagram( aData.Categories, xDiagram, true, supportsCategories() );
+ xDiagram->setCategories( aData.Categories, true, supportsCategories() );
- Sequence< Reference< XChartType > > aChartTypes(
- DiagramHelper::getChartTypesFromDiagram( xDiagram ));
- sal_Int32 nMax = std::min( aChartTypes.getLength(), aSeriesSeq.getLength());
- for( i=0; i<nMax; ++i )
+ std::vector< rtl::Reference< ChartType > > aChartTypes =
+ xDiagram->getChartTypes();
+ sal_Int32 nMax = std::min( aChartTypes.size(), aData.Series.size());
+ for( sal_Int32 i=0; i<nMax; ++i )
{
- Reference< XDataSeriesContainer > xDSCnt( aChartTypes[i], uno::UNO_QUERY_THROW );
- xDSCnt->setDataSeries( aSeriesSeq[i] );
+ aChartTypes[i]->setDataSeries( aData.Series[i] );
}
}
catch( const uno::Exception & )
@@ -301,9 +289,9 @@ void SAL_CALL ChartTypeTemplate::changeDiagramData(
}
}
-sal_Bool SAL_CALL ChartTypeTemplate::matchesTemplate(
- const Reference< chart2::XDiagram >& xDiagram,
- sal_Bool /* bAdaptProperties */ )
+bool ChartTypeTemplate::matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool /* bAdaptProperties */ )
{
bool bResult = false;
@@ -312,36 +300,30 @@ sal_Bool SAL_CALL ChartTypeTemplate::matchesTemplate(
try
{
- Reference< XCoordinateSystemContainer > xCooSysCnt(
- xDiagram, uno::UNO_QUERY_THROW );
- Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysSeq(
+ xDiagram->getBaseCoordinateSystems());
// need to have at least one coordinate system
- bResult = aCooSysSeq.hasElements();
+ bResult = !aCooSysSeq.empty();
if( bResult )
{
- Sequence< Reference< XChartType > > aFormerlyUsedChartTypes;
- Reference<XChartType> xOldCT = getChartTypeForNewSeries(aFormerlyUsedChartTypes);
+ std::vector< rtl::Reference< ChartType > > aFormerlyUsedChartTypes;
+ rtl::Reference<ChartType> xOldCT = getChartTypeForNewSeries2(aFormerlyUsedChartTypes);
if (!xOldCT.is())
return false;
const OUString aChartTypeToMatch = xOldCT->getChartType();
const sal_Int32 nDimensionToMatch = getDimension();
- for( sal_Int32 nCooSysIdx=0; bResult && (nCooSysIdx < aCooSysSeq.getLength()); ++nCooSysIdx )
+ for( std::size_t nCooSysIdx=0; bResult && (nCooSysIdx < aCooSysSeq.size()); ++nCooSysIdx )
{
// match dimension
- bResult = bResult && (aCooSysSeq[nCooSysIdx]->getDimension() == nDimensionToMatch);
+ bResult = aCooSysSeq[nCooSysIdx]->getDimension() == nDimensionToMatch;
- Reference< XChartTypeContainer > xCTCnt( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY_THROW );
- Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
- for( sal_Int32 nCTIdx=0; bResult && (nCTIdx < aChartTypeSeq.getLength()); ++nCTIdx )
+ const std::vector< rtl::Reference< ChartType > > & aChartTypeSeq( aCooSysSeq[nCooSysIdx]->getChartTypes2());
+ for( std::size_t nCTIdx=0; bResult && (nCTIdx < aChartTypeSeq.size()); ++nCTIdx )
{
- if (!aChartTypeSeq[nCTIdx].is())
- return false;
-
// match chart type
- bResult = bResult && aChartTypeSeq[nCTIdx]->getChartType() == aChartTypeToMatch;
+ bResult = aChartTypeSeq[nCTIdx]->getChartType() == aChartTypeToMatch;
bool bFound=false;
bool bAmbiguous=false;
// match stacking mode
@@ -362,7 +344,7 @@ sal_Bool SAL_CALL ChartTypeTemplate::matchesTemplate(
return bResult;
}
-Reference< chart2::XDataInterpreter > SAL_CALL ChartTypeTemplate::getDataInterpreter()
+rtl::Reference< DataInterpreter > ChartTypeTemplate::getDataInterpreter2()
{
if( ! m_xDataInterpreter.is())
m_xDataInterpreter.set( new DataInterpreter );
@@ -370,15 +352,14 @@ Reference< chart2::XDataInterpreter > SAL_CALL ChartTypeTemplate::getDataInterpr
return m_xDataInterpreter;
}
-void SAL_CALL ChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void ChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 /* nSeriesIndex */,
::sal_Int32 /* nSeriesCount */ )
{
// sset stacking mode
- Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
- if( !xSeriesProp.is())
+ if( !xSeries.is())
return;
try
@@ -391,16 +372,17 @@ void SAL_CALL ChartTypeTemplate::applyStyle(
: (eStackMode == StackMode::ZStacked )
? chart2::StackingDirection_Z_STACKING
: chart2::StackingDirection_NO_STACKING );
- xSeriesProp->setPropertyValue( "StackingDirection", aPropValue );
+ xSeries->setPropertyValue( u"StackingDirection"_ustr, aPropValue );
//ensure valid label placement
{
uno::Sequence < sal_Int32 > aAvailablePlacements( ChartTypeHelper::getSupportedLabelPlacements(
getChartTypeForIndex( nChartTypeIndex ), isSwapXAndY(), xSeries ) );
- lcl_ensureCorrectLabelPlacement( xSeriesProp, aAvailablePlacements );
+ lcl_ensureCorrectLabelPlacement( xSeries, aAvailablePlacements );
uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProp->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
+ // "AttributedDataPoints"
+ if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList )
for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
lcl_ensureCorrectLabelPlacement( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]), aAvailablePlacements );
}
@@ -411,88 +393,63 @@ void SAL_CALL ChartTypeTemplate::applyStyle(
}
}
-void ChartTypeTemplate::applyStyles( const Reference< chart2::XDiagram >& xDiagram )
+void ChartTypeTemplate::applyStyles( const rtl::Reference< ::chart::Diagram >& xDiagram )
{
// apply chart-type specific styles, like "symbols on" for example
- Sequence< Sequence< Reference< XDataSeries > > > aNewSeriesSeq(
- DiagramHelper::getDataSeriesGroups( xDiagram ));
- for( sal_Int32 i=0; i<aNewSeriesSeq.getLength(); ++i )
+ std::vector< std::vector< rtl::Reference< DataSeries > > > aNewSeriesSeq(
+ xDiagram->getDataSeriesGroups());
+ for( std::size_t i=0; i<aNewSeriesSeq.size(); ++i )
{
- const sal_Int32 nNumSeries = aNewSeriesSeq[i].getLength();
+ const sal_Int32 nNumSeries = aNewSeriesSeq[i].size();
for( sal_Int32 j=0; j<nNumSeries; ++j )
- applyStyle( aNewSeriesSeq[i][j], i, j, nNumSeries );
+ applyStyle2( aNewSeriesSeq[i][j], i, j, nNumSeries );
}
//ensure valid empty cell handling (for first chart type...)
lcl_ensureCorrectMissingValueTreatment( xDiagram, getChartTypeForIndex( 0 ) );
}
-void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram >& xDiagram )
+void ChartTypeTemplate::resetStyles2( const rtl::Reference< ::chart::Diagram >& xDiagram )
{
// reset number format if we had percent stacking on
bool bPercent = (getStackMode(0) == StackMode::YStackedPercent);
if( bPercent )
{
- const Sequence< Reference< chart2::XAxis > > aAxisSeq( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( Reference< chart2::XAxis > const & axis : aAxisSeq )
+ const std::vector< rtl::Reference< Axis > > aAxisSeq( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
+ for( rtl::Reference< Axis > const & axis : aAxisSeq )
{
if( AxisHelper::getDimensionIndexOfAxis( axis, xDiagram )== 1 )
{
- Reference< beans::XPropertySet > xAxisProp( axis, uno::UNO_QUERY );
- if( xAxisProp.is())
- {
- // set number format to source format
- xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::Any(true));
- xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
- }
+ // set number format to source format
+ axis->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::Any(true));
+ axis->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
}
}
}
//reset label placement if default
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : xDiagram->getBaseCoordinateSystems() )
{
- uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if( xCooSysContainer.is() )
+ //iterate through all chart types in the current coordinate system
+ for( rtl::Reference< ChartType > const & xChartType : xCooSys->getChartTypes2() )
{
- const uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
- for( uno::Reference< XCoordinateSystem > const & xCooSys : aCooSysList )
+ //iterate through all series in this chart type
+ for( rtl::Reference< DataSeries > const & xSeries : xChartType->getDataSeries2() )
{
- //iterate through all chart types in the current coordinate system
- uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
- OSL_ASSERT( xChartTypeContainer.is());
- if( !xChartTypeContainer.is() )
+ uno::Sequence < sal_Int32 > aAvailablePlacements( ChartTypeHelper::getSupportedLabelPlacements(
+ xChartType, isSwapXAndY(), xSeries ) );
+ if(!aAvailablePlacements.hasElements())
continue;
- const uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- for( uno::Reference< XChartType > const & xChartType : aChartTypeList )
- {
- //iterate through all series in this chart type
- uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
- OSL_ASSERT( xDataSeriesContainer.is());
- if( !xDataSeriesContainer.is() )
- continue;
-
- const uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
- for( Reference< XDataSeries > const & xSeries : aSeriesList )
- {
- Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
- if(!xSeries.is() || !xSeriesProp.is() )
- continue;
-
- uno::Sequence < sal_Int32 > aAvailablePlacements( ChartTypeHelper::getSupportedLabelPlacements(
- xChartType, isSwapXAndY(), xSeries ) );
- if(!aAvailablePlacements.hasElements())
- continue;
- sal_Int32 nDefaultPlacement = aAvailablePlacements[0];
+ sal_Int32 nDefaultPlacement = aAvailablePlacements[0];
- lcl_resetLabelPlacementIfDefault( xSeriesProp, nDefaultPlacement );
+ lcl_resetLabelPlacementIfDefault( xSeries, nDefaultPlacement );
- uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProp->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
- for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
- lcl_resetLabelPlacementIfDefault( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]), nDefaultPlacement );
- }
- }
+ uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
+ // "AttributedDataPoints"
+ if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList )
+ for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
+ lcl_resetLabelPlacementIfDefault( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]), nDefaultPlacement );
}
}
}
@@ -521,48 +478,45 @@ bool ChartTypeTemplate::isSwapXAndY() const
}
void ChartTypeTemplate::createCoordinateSystems(
- const Reference< chart2::XCoordinateSystemContainer > & xOutCooSysCnt )
+ const rtl::Reference< ::chart::Diagram > & xDiagram )
{
- if( ! xOutCooSysCnt.is())
+ if( ! xDiagram.is())
return;
- Sequence< Reference< XChartType > > aFormerlyUsedChartTypes;
- Reference< XChartType > xChartType( getChartTypeForNewSeries(aFormerlyUsedChartTypes));
+ std::vector< rtl::Reference< ChartType > > aFormerlyUsedChartTypes;
+ rtl::Reference< ChartType > xChartType( getChartTypeForNewSeries2(aFormerlyUsedChartTypes));
if( ! xChartType.is())
return;
- Reference< XCoordinateSystem > xCooSys( xChartType->createCoordinateSystem( getDimension()));
+ rtl::Reference< BaseCoordinateSystem > xCooSys = xChartType->createCoordinateSystem2( getDimension());
if( ! xCooSys.is())
{
// chart type wants no coordinate systems
- xOutCooSysCnt->setCoordinateSystems( Sequence< Reference< XCoordinateSystem > >());
+ xDiagram->setCoordinateSystems( Sequence< Reference< XCoordinateSystem > >());
return;
}
// #i69680# make grid of first y-axis visible (was in the CooSys CTOR before)
if( xCooSys->getDimension() >= 2 )
{
- Reference< chart2::XAxis > xAxis( xCooSys->getAxisByDimension( 1, 0 ));
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( 1, 0 );
if( xAxis.is())
- AxisHelper::makeGridVisible( xAxis->getGridProperties() );
+ AxisHelper::makeGridVisible( xAxis->getGridProperties2() );
}
- Sequence< Reference< XCoordinateSystem > > aCoordinateSystems(
- xOutCooSysCnt->getCoordinateSystems());
+ std::vector< rtl::Reference< BaseCoordinateSystem > > aCoordinateSystems(
+ xDiagram->getBaseCoordinateSystems());
- if( aCoordinateSystems.hasElements())
+ if( !aCoordinateSystems.empty() )
{
bool bOk = true;
- for( sal_Int32 i=0; bOk && i<aCoordinateSystems.getLength(); ++i )
- bOk = bOk && ( xCooSys->getCoordinateSystemType() == aCoordinateSystems[i]->getCoordinateSystemType() &&
+ for( std::size_t i=0; bOk && i<aCoordinateSystems.size(); ++i )
+ bOk = ( xCooSys->getCoordinateSystemType() == aCoordinateSystems[i]->getCoordinateSystemType() &&
(xCooSys->getDimension() == aCoordinateSystems[i]->getDimension()) );
// coordinate systems are ok
if( bOk )
return;
// there are coordinate systems but they do not fit. So overwrite them.
- }
- //copy as much info from former coordinate system as possible:
- if( aCoordinateSystems.hasElements() )
- {
- Reference< XCoordinateSystem > xOldCooSys( aCoordinateSystems[0] );
+ //copy as much info from former coordinate system as possible:
+ const rtl::Reference< BaseCoordinateSystem >& xOldCooSys( aCoordinateSystems[0] );
sal_Int32 nMaxDimensionCount = std::min( xCooSys->getDimension(), xOldCooSys->getDimension() );
for(sal_Int32 nDimensionIndex=0; nDimensionIndex<nMaxDimensionCount; nDimensionIndex++)
@@ -570,7 +524,7 @@ void ChartTypeTemplate::createCoordinateSystems(
const sal_Int32 nMaximumAxisIndex = xOldCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
for(sal_Int32 nAxisIndex=0; nAxisIndex<=nMaximumAxisIndex; ++nAxisIndex)
{
- uno::Reference< XAxis > xAxis( xOldCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) );
+ rtl::Reference< Axis > xAxis = xOldCooSys->getAxisByDimension2( nDimensionIndex, nAxisIndex );
if( xAxis.is())
{
xCooSys->setAxisByDimension( nDimensionIndex, xAxis, nAxisIndex );
@@ -582,22 +536,19 @@ void ChartTypeTemplate::createCoordinateSystems(
// set new coordinate systems
aCoordinateSystems = { xCooSys };
- xOutCooSysCnt->setCoordinateSystems( aCoordinateSystems );
+ xDiagram->setCoordinateSystems( aCoordinateSystems );
}
void ChartTypeTemplate::adaptScales(
- const Sequence< Reference< chart2::XCoordinateSystem > > & aCooSysSeq,
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysSeq,
const Reference< data::XLabeledDataSequence > & xCategories //@todo: in future there may be more than one sequence of categories (e.g. charttype with categories at x and y axis )
)
{
bool bSupportsCategories( supportsCategories() );
- for( Reference< XCoordinateSystem > const & xCooSys : aCooSysSeq )
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : aCooSysSeq )
{
try
{
- if( !xCooSys.is() )
- continue;
-
// attach categories to first axis
sal_Int32 nDim( xCooSys->getDimension());
if( nDim > 0 )
@@ -606,19 +557,26 @@ void ChartTypeTemplate::adaptScales(
const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionX);
for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI)
{
- Reference< XAxis > xAxis( xCooSys->getAxisByDimension(nDimensionX,nI) );
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2(nDimensionX,nI);
if( xAxis.is())
{
ScaleData aData( xAxis->getScaleData() );
aData.Categories = xCategories;
if(bSupportsCategories)
{
- Reference< XChartType > xChartType(getChartTypeForNewSeries(Sequence< Reference< XChartType > >()));
+ rtl::Reference< ChartType > xChartType = getChartTypeForNewSeries2({});
if( aData.AxisType == AxisType::CATEGORY )
{
- aData.ShiftedCategoryPosition = m_aServiceName.indexOf("Column") != -1 || m_aServiceName.indexOf("Bar") != -1 || m_aServiceName.endsWith("Close");
+ // Shift for Column, Hi-Lo-Close, and regular
+ // Bar types, but not BarOfPie
+ aData.ShiftedCategoryPosition =
+ m_aServiceName.indexOf("Column") != -1 ||
+ m_aServiceName.indexOf("Histogram") != -1 ||
+ (m_aServiceName.indexOf("Bar") != -1 &&
+ !m_aServiceName.indexOf("BarOfPie")) ||
+ m_aServiceName.endsWith("Close");
}
- bool bSupportsDates = ::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, nDimensionX );
+ bool bSupportsDates = xChartType.is() ? xChartType->isSupportingDateAxis(nDimensionX) : true;
if( aData.AxisType != AxisType::CATEGORY && ( aData.AxisType != AxisType::DATE || !bSupportsDates) )
{
aData.AxisType = AxisType::CATEGORY;
@@ -639,7 +597,7 @@ void ChartTypeTemplate::adaptScales(
const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(1);
for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI)
{
- Reference< chart2::XAxis > xAxis( xCooSys->getAxisByDimension( 1,nI ));
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( 1,nI );
if( xAxis.is())
{
bool bPercent = (getStackMode(0) == StackMode::YStackedPercent);
@@ -664,18 +622,18 @@ void ChartTypeTemplate::adaptScales(
}
}
-void ChartTypeTemplate::adaptDiagram( const Reference< XDiagram > & /* xDiagram */ )
+void ChartTypeTemplate::adaptDiagram( const rtl::Reference< ::chart::Diagram > & /* xDiagram */ )
{
- }
+}
void ChartTypeTemplate::createAxes(
- const Sequence< Reference< XCoordinateSystem > > & rCoordSys )
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & rCoordSys )
{
//create missing axes
- if( !rCoordSys.hasElements() )
+ if( rCoordSys.empty() )
return;
- Reference< XCoordinateSystem > xCooSys( rCoordSys[0] );
+ const rtl::Reference< BaseCoordinateSystem >& xCooSys( rCoordSys[0] );
if(!xCooSys.is())
return;
@@ -690,26 +648,26 @@ void ChartTypeTemplate::createAxes(
nAxisCount = 2;
for( sal_Int32 nAxisIndex = 0; nAxisIndex < nAxisCount; ++nAxisIndex )
{
- Reference< XAxis > xAxis = AxisHelper::getAxis( nDim, nAxisIndex, xCooSys );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDim, nAxisIndex, xCooSys );
if( !xAxis.is())
{
// create and add axis
- xAxis.set( AxisHelper::createAxis(
- nDim, nAxisIndex, xCooSys, GetComponentContext() ));
+ xAxis = AxisHelper::createAxis(
+ nDim, nAxisIndex, xCooSys, GetComponentContext() );
}
}
}
}
void ChartTypeTemplate::adaptAxes(
- const Sequence< Reference< XCoordinateSystem > > & rCoordSys )
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & rCoordSys )
{
//adapt properties of existing axes and remove superfluous axes
- if( !rCoordSys.hasElements() )
+ if( rCoordSys.empty() )
return;
- for( Reference< XCoordinateSystem > const & xCooSys : rCoordSys )
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : rCoordSys )
{
if( !xCooSys.is() )
continue;
@@ -719,7 +677,7 @@ void ChartTypeTemplate::adaptAxes(
sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension( nDim );
for( sal_Int32 nAxisIndex=0; nAxisIndex<=nMaxAxisIndex; nAxisIndex++ )
{
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDim, nAxisIndex, xCooSys ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDim, nAxisIndex, xCooSys );
if( !xAxis.is() )
continue;
@@ -729,13 +687,9 @@ void ChartTypeTemplate::adaptAxes(
bool bPercent = (getStackMode(0) == StackMode::YStackedPercent);
if( bPercent && nDim == 1 )
{
- Reference< beans::XPropertySet > xAxisProp( xAxis, uno::UNO_QUERY );
- if( xAxisProp.is())
- {
- // set number format to source format
- xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::Any(true));
- xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
- }
+ // set number format to source format
+ xAxis->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::Any(true));
+ xAxis->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
}
}
}
@@ -749,19 +703,18 @@ sal_Int32 ChartTypeTemplate::getAxisCountByDimension( sal_Int32 nDimension )
}
void ChartTypeTemplate::FillDiagram(
- const Reference< XDiagram >& xDiagram,
- const Sequence< Sequence< Reference< XDataSeries > > >& aSeriesSeq,
- const Reference< data::XLabeledDataSequence >& xCategories,
- const Sequence< Reference< XChartType > >& aOldChartTypesSeq )
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ const std::vector< std::vector< rtl::Reference< DataSeries > > >& aSeriesSeq,
+ const uno::Reference< chart2::data::XLabeledDataSequence >& xCategories,
+ const std::vector< rtl::Reference< ChartType > >& aOldChartTypesSeq )
{
adaptDiagram( xDiagram );
try
{
// create coordinate systems and scales
- Reference< XCoordinateSystemContainer > xCoordSysCnt( xDiagram, uno::UNO_QUERY_THROW );
- createCoordinateSystems( xCoordSysCnt );
- Sequence< Reference< XCoordinateSystem > > aCoordinateSystems( xCoordSysCnt->getCoordinateSystems());
+ createCoordinateSystems( xDiagram );
+ std::vector< rtl::Reference< BaseCoordinateSystem > > aCoordinateSystems( xDiagram->getBaseCoordinateSystems());
createAxes( aCoordinateSystems );
adaptAxes( aCoordinateSystems );
adaptScales( aCoordinateSystems, xCategories );
@@ -777,62 +730,57 @@ void ChartTypeTemplate::FillDiagram(
}
void ChartTypeTemplate::createChartTypes(
- const Sequence< Sequence< Reference< XDataSeries > > > & aSeriesSeq,
- const Sequence< Reference< XCoordinateSystem > > & rCoordSys,
- const Sequence< Reference< XChartType > >& aOldChartTypesSeq )
+ const std::vector< std::vector< rtl::Reference< DataSeries > > > & aSeriesSeq,
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & rCoordSys,
+ const std::vector< rtl::Reference< ChartType > >& aOldChartTypesSeq )
{
- if( ! rCoordSys.hasElements() ||
- ! rCoordSys[0].is() )
+ if( rCoordSys.empty() )
return;
try
{
- sal_Int32 nCooSysIdx=0;
- Reference< XChartType > xCT;
- if( !aSeriesSeq.hasElements() )
+ std::size_t nCooSysIdx=0;
+ rtl::Reference< ChartType > xCT;
+ if( aSeriesSeq.empty() )
{
// we need a new chart type
- xCT.set( getChartTypeForNewSeries( aOldChartTypesSeq ));
- Reference< XChartTypeContainer > xCTCnt( rCoordSys[nCooSysIdx], uno::UNO_QUERY_THROW );
- xCTCnt->setChartTypes({ xCT });
+ xCT = getChartTypeForNewSeries2( aOldChartTypesSeq );
+ rCoordSys[nCooSysIdx]->setChartTypes(std::vector{ xCT });
}
else
{
- for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aSeriesSeq.getLength(); ++nSeriesIdx )
+ for( std::size_t nSeriesIdx=0; nSeriesIdx<aSeriesSeq.size(); ++nSeriesIdx )
{
if( nSeriesIdx == nCooSysIdx )
{
// we need a new chart type
- xCT.set( getChartTypeForNewSeries( aOldChartTypesSeq ));
- Reference< XChartTypeContainer > xCTCnt( rCoordSys[nCooSysIdx], uno::UNO_QUERY_THROW );
- Sequence< Reference< XChartType > > aCTSeq( xCTCnt->getChartTypes());
- if( aCTSeq.hasElements())
+ xCT = getChartTypeForNewSeries2( aOldChartTypesSeq );
+ std::vector< rtl::Reference< ChartType > > aCTSeq( rCoordSys[nCooSysIdx]->getChartTypes2());
+ if( !aCTSeq.empty())
{
- aCTSeq.getArray()[0] = xCT;
- xCTCnt->setChartTypes( aCTSeq );
+ aCTSeq[0] = xCT;
+ rCoordSys[nCooSysIdx]->setChartTypes( aCTSeq );
}
else
- xCTCnt->addChartType( xCT );
+ rCoordSys[nCooSysIdx]->addChartType( xCT );
- Reference< chart2::XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
- xDSCnt->setDataSeries( aSeriesSeq[nSeriesIdx] );
+ xCT->setDataSeries( aSeriesSeq[nSeriesIdx] );
}
else
{
// reuse existing chart type
OSL_ASSERT( xCT.is());
- Reference< chart2::XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
- Sequence< Reference< XDataSeries > > aNewSeriesSeq( xDSCnt->getDataSeries());
- sal_Int32 nNewStartIndex = aNewSeriesSeq.getLength();
- aNewSeriesSeq.realloc( nNewStartIndex + aSeriesSeq[nSeriesIdx].getLength() );
+ std::vector< rtl::Reference< DataSeries > > aNewSeriesSeq = xCT->getDataSeries2();
+ sal_Int32 nNewStartIndex = aNewSeriesSeq.size();
+ aNewSeriesSeq.resize( nNewStartIndex + aSeriesSeq[nSeriesIdx].size() );
std::copy( aSeriesSeq[nSeriesIdx].begin(),
aSeriesSeq[nSeriesIdx].end(),
- aNewSeriesSeq.getArray() + nNewStartIndex );
- xDSCnt->setDataSeries( aNewSeriesSeq );
+ aNewSeriesSeq.begin() + nNewStartIndex );
+ xCT->setDataSeries( aNewSeriesSeq );
}
// spread the series over the available coordinate systems
- if( rCoordSys.getLength() > (nCooSysIdx + 1) )
+ if( rCoordSys.size() > (nCooSysIdx + 1) )
++nCooSysIdx;
}
}
@@ -844,27 +792,77 @@ void ChartTypeTemplate::createChartTypes(
}
void ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem(
- const Sequence< Reference< XChartType > > & rOldChartTypesSeq,
- const Reference< XChartType > & xNewChartType )
+ const std::vector< rtl::Reference< ChartType > > & rOldChartTypesSeq,
+ const rtl::Reference< ChartType > & xNewChartType )
{
- Reference< beans::XPropertySet > xDestination( xNewChartType, uno::UNO_QUERY );
- if( !xDestination.is() )
+ if( !xNewChartType.is() )
return;
OUString aNewChartType( xNewChartType->getChartType() );
- Reference< beans::XPropertySet > xSource;
- for( Reference< XChartType > const & xOldType : rOldChartTypesSeq )
+ rtl::Reference< ChartType > xSource;
+ for( rtl::Reference< ChartType > const & xOldType : rOldChartTypesSeq )
{
if( xOldType.is() && xOldType->getChartType() == aNewChartType )
{
- xSource.set( Reference< beans::XPropertySet >(xOldType, uno::UNO_QUERY ) );
+ xSource = xOldType;
if( xSource.is() )
break;
}
}
if( xSource.is() )
- comphelper::copyProperties( xSource, xDestination );
+ comphelper::copyProperties( xSource, xNewChartType );
+}
+
+css::uno::Reference< css::uno::XInterface > ChartTypeTemplate::getDataInterpreter()
+{
+ return static_cast<cppu::OWeakObject*>(getDataInterpreter2().get());
+}
+css::uno::Reference< css::chart2::XDiagram > ChartTypeTemplate::createDiagramByDataSource(
+ const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArguments )
+{
+ return createDiagramByDataSource2(xDataSource, aArguments);
+}
+void ChartTypeTemplate::changeDiagram(
+ const css::uno::Reference< css::chart2::XDiagram >& xDiagram )
+{
+ changeDiagram(rtl::Reference<Diagram>(dynamic_cast<Diagram*>(xDiagram.get())));
+}
+void ChartTypeTemplate::changeDiagramData(
+ const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
+ const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArguments )
+{
+ changeDiagramData(rtl::Reference<Diagram>(dynamic_cast<Diagram*>(xDiagram.get())), xDataSource, aArguments);
+}
+sal_Bool ChartTypeTemplate::matchesTemplate(
+ const css::uno::Reference<css::chart2::XDiagram >& xDiagram,
+ sal_Bool bAdaptProperties )
+{
+ return matchesTemplate2(dynamic_cast<Diagram*>(xDiagram.get()), static_cast<bool>(bAdaptProperties));
+}
+css::uno::Reference< ::css::chart2::XChartType > ChartTypeTemplate::getChartTypeForNewSeries(
+ const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes )
+{
+ std::vector< rtl::Reference< ::chart::ChartType > > aTmp;
+ aTmp.reserve(aFormerlyUsedChartTypes.getLength());
+ for (auto const & rxChartType : aFormerlyUsedChartTypes)
+ aTmp.push_back(dynamic_cast<ChartType*>(rxChartType.get()));
+ return getChartTypeForNewSeries2(aTmp);
+}
+void ChartTypeTemplate::applyStyle(
+ const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ ::sal_Int32 nChartTypeIndex,
+ ::sal_Int32 nSeriesIndex,
+ ::sal_Int32 nSeriesCount )
+{
+ applyStyle2(dynamic_cast<DataSeries*>(xSeries.get()), nChartTypeIndex, nSeriesIndex, nSeriesCount);
+}
+void ChartTypeTemplate::resetStyles(
+ const css::uno::Reference< css::chart2::XDiagram >& xDiagram )
+{
+ resetStyles2(dynamic_cast<Diagram*>(xDiagram.get()));
}
} // namespace chart
diff --git a/chart2/source/model/template/ColumnChartType.cxx b/chart2/source/model/template/ColumnChartType.cxx
index 3553e289985e..378ed35e59d7 100644
--- a/chart2/source/model/template/ColumnChartType.cxx
+++ b/chart2/source/model/template/ColumnChartType.cxx
@@ -54,67 +54,19 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT );
}
-struct StaticColumnChartTypeDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- Sequence< sal_Int32 > aSeq{ 0, 0 };
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, aSeq );
-
- aSeq = { 100, 100 };
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
- }
-};
-
-struct StaticColumnChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticColumnChartTypeDefaults_Initializer >
-{
-};
-
-struct StaticColumnChartTypeInfoHelper_Initializer
+::cppu::OPropertyArrayHelper & StaticColumnChartTypeInfoHelper()
{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
+ static ::cppu::OPropertyArrayHelper aPropHelper = []()
+ {
+ std::vector< css::beans::Property > aProperties;
+ lcl_AddPropertiesToVector( aProperties );
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticColumnChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticColumnChartTypeInfoHelper_Initializer >
-{
-};
-
-struct StaticColumnChartTypeInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticColumnChartTypeInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticColumnChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticColumnChartTypeInfo_Initializer >
-{
+ return comphelper::containerToSequence( aProperties );
+ }();
+ return aPropHelper;
};
} // anonymous namespace
@@ -139,6 +91,11 @@ uno::Reference< util::XCloneable > SAL_CALL ColumnChartType::createClone()
return uno::Reference< util::XCloneable >( new ColumnChartType( *this ));
}
+rtl::Reference< ChartType > ColumnChartType::cloneChartType() const
+{
+ return new ColumnChartType( *this );
+}
+
// ____ XChartType ____
OUString SAL_CALL ColumnChartType::getChartType()
{
@@ -147,15 +104,23 @@ OUString SAL_CALL ColumnChartType::getChartType()
uno::Sequence< OUString > ColumnChartType::getSupportedPropertyRoles()
{
- return { "FillColor", "BorderColor" };
+ return { u"FillColor"_ustr, u"BorderColor"_ustr };
}
// ____ OPropertySet ____
void ColumnChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticColumnChartTypeDefaults::get();
- tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
- if( aFound == rStaticDefaults.end() )
+ static const ::chart::tPropertyValueMap aStaticDefaults = []()
+ {
+ ::chart::tPropertyValueMap aTmp;
+ Sequence< sal_Int32 > aSeq{ 0, 0 };
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, aSeq );
+ aSeq = { 100, 100 };
+ ::chart::PropertyHelper::setPropertyValueDefault( aTmp, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound( aStaticDefaults.find( nHandle ) );
+ if( aFound == aStaticDefaults.end() )
rAny.clear();
else
rAny = (*aFound).second;
@@ -163,18 +128,20 @@ void ColumnChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL ColumnChartType::getInfoHelper()
{
- return *StaticColumnChartTypeInfoHelper::get();
+ return StaticColumnChartTypeInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL ColumnChartType::getPropertySetInfo()
{
- return *StaticColumnChartTypeInfo::get();
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticColumnChartTypeInfoHelper() ) );
+ return xPropertySetInfo;
}
OUString SAL_CALL ColumnChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.ColumnChartType";
+ return u"com.sun.star.comp.chart.ColumnChartType"_ustr;
}
sal_Bool SAL_CALL ColumnChartType::supportsService( const OUString& rServiceName )
@@ -186,7 +153,7 @@ css::uno::Sequence< OUString > SAL_CALL ColumnChartType::getSupportedServiceName
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_COLUMN,
- "com.sun.star.chart2.ChartType" };
+ u"com.sun.star.chart2.ChartType"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/ColumnChartType.hxx b/chart2/source/model/template/ColumnChartType.hxx
index d304092cbfc0..2c6b3d762321 100644
--- a/chart2/source/model/template/ColumnChartType.hxx
+++ b/chart2/source/model/template/ColumnChartType.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
namespace chart
{
@@ -36,6 +36,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit ColumnChartType( const ColumnChartType & rOther );
diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
index fad59386b2b3..d45ca516af2c 100644
--- a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
@@ -18,24 +18,24 @@
*/
#include "ColumnLineChartTypeTemplate.hxx"
+#include "ColumnChartType.hxx"
+#include "LineChartType.hxx"
#include <CommonConverters.hxx>
+#include <BaseCoordinateSystem.hxx>
+#include <Diagram.hxx>
#include <DiagramHelper.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <servicenames_charttypes.hxx>
#include "ColumnLineDataInterpreter.hxx"
#include <PropertyHelper.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
-using namespace ::com::sun::star::chart2;
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -50,69 +50,44 @@ enum
PROP_COL_LINE_NUMBER_OF_LINES
};
-void lcl_AddPropertiesToVector(
- std::vector< Property > & rOutProperties )
+::chart::tPropertyValueMap& StaticColumnLineChartTypeTemplateDefaults()
{
- rOutProperties.emplace_back( "NumberOfLines",
- PROP_COL_LINE_NUMBER_OF_LINES,
- cppu::UnoType<sal_Int32>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
+ static ::chart::tPropertyValueMap aStaticDefaults =
+ []()
+ {
+ ::chart::tPropertyValueMap aOutMap;
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_COL_LINE_NUMBER_OF_LINES, 1 );
+ return aOutMap;
+ }();
+ return aStaticDefaults;
}
-struct StaticColumnLineChartTypeTemplateDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aStaticDefaults, PROP_COL_LINE_NUMBER_OF_LINES, 1 );
- return &aStaticDefaults;
- }
-};
-
-struct StaticColumnLineChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticColumnLineChartTypeTemplateDefaults_Initializer >
-{
-};
-
-struct StaticColumnLineChartTypeTemplateInfoHelper_Initializer
+::cppu::OPropertyArrayHelper& StaticColumnLineChartTypeTemplateInfoHelper()
{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper(
+ []()
+ {
+ std::vector< css::beans::Property > aProperties {
+ { u"NumberOfLines"_ustr,
+ PROP_COL_LINE_NUMBER_OF_LINES,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT } };
-struct StaticColumnLineChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticColumnLineChartTypeTemplateInfoHelper_Initializer >
-{
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticColumnLineChartTypeTemplateInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticColumnLineChartTypeTemplateInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ return comphelper::containerToSequence( aProperties );
+ }());
+ return aPropHelper;
+}
-struct StaticColumnLineChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticColumnLineChartTypeTemplateInfo_Initializer >
+uno::Reference< beans::XPropertySetInfo >& StaticColumnLineChartTypeTemplateInfo()
{
-};
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticColumnLineChartTypeTemplateInfoHelper() ) );
+ return xPropertySetInfo;
+}
} // anonymous namespace
@@ -126,7 +101,6 @@ ColumnLineChartTypeTemplate::ColumnLineChartTypeTemplate(
StackMode eStackMode,
sal_Int32 nNumberOfLines ) :
ChartTypeTemplate( xContext, rServiceName ),
- ::property::OPropertySet( m_aMutex ),
m_eStackMode( eStackMode )
{
setFastPropertyValue_NoBroadcast( PROP_COL_LINE_NUMBER_OF_LINES, uno::Any( nNumberOfLines ));
@@ -138,7 +112,7 @@ ColumnLineChartTypeTemplate::~ColumnLineChartTypeTemplate()
// ____ OPropertySet ____
void ColumnLineChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticColumnLineChartTypeTemplateDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticColumnLineChartTypeTemplateDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -148,30 +122,27 @@ void ColumnLineChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any&
::cppu::IPropertyArrayHelper & SAL_CALL ColumnLineChartTypeTemplate::getInfoHelper()
{
- return *StaticColumnLineChartTypeTemplateInfoHelper::get();
+ return StaticColumnLineChartTypeTemplateInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL ColumnLineChartTypeTemplate::getPropertySetInfo()
{
- return *StaticColumnLineChartTypeTemplateInfo::get();
+ return StaticColumnLineChartTypeTemplateInfo();
}
void ColumnLineChartTypeTemplate::createChartTypes(
- const Sequence< Sequence< Reference< XDataSeries > > > & aSeriesSeq,
- const Sequence< Reference< XCoordinateSystem > > & rCoordSys,
- const Sequence< Reference< XChartType > >& aOldChartTypesSeq )
+ const std::vector< std::vector< rtl::Reference< DataSeries > > > & aSeriesSeq,
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & rCoordSys,
+ const std::vector< rtl::Reference< ChartType > >& aOldChartTypesSeq )
{
- if( ! rCoordSys.hasElements() ||
- ! rCoordSys[0].is() )
+ if( rCoordSys.empty() )
return;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- const Sequence< Reference< XDataSeries > > aFlatSeriesSeq( FlattenSequence( aSeriesSeq ));
- sal_Int32 nNumberOfSeries = aFlatSeriesSeq.getLength();
+ const std::vector< rtl::Reference< DataSeries > > aFlatSeriesSeq( FlattenSequence( aSeriesSeq ));
+ sal_Int32 nNumberOfSeries = aFlatSeriesSeq.size();
sal_Int32 nNumberOfLines = 0;
sal_Int32 nNumberOfColumns = 0;
@@ -195,38 +166,33 @@ void ColumnLineChartTypeTemplate::createChartTypes(
// Columns
- Reference< XChartType > xCT(
- xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_COLUMN ), uno::UNO_QUERY_THROW );
+ rtl::Reference< ChartType > xCT = new ColumnChartType();
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aOldChartTypesSeq, xCT );
- Reference< XChartTypeContainer > xCTCnt( rCoordSys[ 0 ], uno::UNO_QUERY_THROW );
- xCTCnt->setChartTypes( Sequence< Reference< chart2::XChartType > >( &xCT, 1 ));
+ rCoordSys[ 0 ]->setChartTypes( std::vector{xCT} );
if( nNumberOfColumns > 0 )
{
- Reference< XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
- Sequence< Reference< XDataSeries > > aColumnSeq( nNumberOfColumns );
+ std::vector< rtl::Reference< DataSeries > > aColumnSeq( nNumberOfColumns );
std::copy( aFlatSeriesSeq.begin(),
aFlatSeriesSeq.begin() + nNumberOfColumns,
- aColumnSeq.getArray());
- xDSCnt->setDataSeries( aColumnSeq );
+ aColumnSeq.begin());
+ xCT->setDataSeries( aColumnSeq );
}
// Lines
- xCT.set( xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY_THROW );
- xCTCnt.set( rCoordSys[ 0 ], uno::UNO_QUERY_THROW );
- xCTCnt->addChartType( xCT );
+ xCT = new LineChartType();
+ rCoordSys[ 0 ]->addChartType( xCT );
if( nNumberOfLines > 0 )
{
- Reference< XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
- Sequence< Reference< XDataSeries > > aLineSeq( nNumberOfLines );
+ std::vector< rtl::Reference< DataSeries > > aLineSeq( nNumberOfLines );
std::copy( aFlatSeriesSeq.begin() + nNumberOfColumns,
aFlatSeriesSeq.end(),
- aLineSeq.getArray());
- xDSCnt->setDataSeries( aLineSeq );
+ aLineSeq.begin());
+ xCT->setDataSeries( aLineSeq );
}
}
catch( const uno::Exception & )
@@ -235,27 +201,23 @@ void ColumnLineChartTypeTemplate::createChartTypes(
}
}
-void SAL_CALL ColumnLineChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void ColumnLineChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
if( nChartTypeIndex==0 ) // columns
{
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", uno::Any( drawing::LineStyle_NONE ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"BorderStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
}
else if( nChartTypeIndex==1 ) // lines
{
- Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY );
- if( xProp.is() )
- {
- DataSeriesHelper::switchLinesOnOrOff( xProp, true );
- DataSeriesHelper::switchSymbolsOnOrOff( xProp, false, nSeriesIndex );
- DataSeriesHelper::makeLinesThickOrThin( xProp, true );
- }
+ xSeries->switchLinesOnOrOff( true );
+ xSeries->switchSymbolsOnOrOff( false, nSeriesIndex );
+ xSeries->makeLinesThickOrThin( true );
}
}
@@ -267,9 +229,9 @@ StackMode ColumnLineChartTypeTemplate::getStackMode( sal_Int32 nChartTypeIndex )
}
// ____ XChartTypeTemplate ____
-sal_Bool SAL_CALL ColumnLineChartTypeTemplate::matchesTemplate(
- const uno::Reference< XDiagram >& xDiagram,
- sal_Bool bAdaptProperties )
+bool ColumnLineChartTypeTemplate::matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties )
{
bool bResult = false;
@@ -278,35 +240,27 @@ sal_Bool SAL_CALL ColumnLineChartTypeTemplate::matchesTemplate(
try
{
- Reference< chart2::XChartType > xColumnChartType;
- Reference< XCoordinateSystem > xColumnChartCooSys;
- Reference< chart2::XChartType > xLineChartType;
+ rtl::Reference< ChartType > xColumnChartType;
+ rtl::Reference< BaseCoordinateSystem > xColumnChartCooSys;
+ rtl::Reference< ChartType > xLineChartType;
sal_Int32 nNumberOfChartTypes = 0;
- Reference< XCoordinateSystemContainer > xCooSysCnt(
- xDiagram, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
- for( Reference< XCoordinateSystem > const & coords : aCooSysSeq )
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : xDiagram->getBaseCoordinateSystems() )
{
- Reference< XChartTypeContainer > xCTCnt( coords, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
- for( Reference< XChartType > const & chartType : aChartTypeSeq )
+ const std::vector< rtl::Reference< ChartType > > aChartTypeSeq( coords->getChartTypes2());
+ for( rtl::Reference< ChartType > const & chartType : aChartTypeSeq )
{
- if( chartType.is())
+ ++nNumberOfChartTypes;
+ if( nNumberOfChartTypes > 2 )
+ break;
+ OUString aCTService = chartType->getChartType();
+ if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_COLUMN )
{
- ++nNumberOfChartTypes;
- if( nNumberOfChartTypes > 2 )
- break;
- OUString aCTService = chartType->getChartType();
- if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_COLUMN )
- {
- xColumnChartType.set( chartType );
- xColumnChartCooSys.set( coords );
- }
- else if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_LINE )
- xLineChartType.set( chartType );
+ xColumnChartType = chartType;
+ xColumnChartCooSys = coords;
}
+ else if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_LINE )
+ xLineChartType = chartType;
}
if( nNumberOfChartTypes > 2 )
break;
@@ -331,10 +285,9 @@ sal_Bool SAL_CALL ColumnLineChartTypeTemplate::matchesTemplate(
if( bResult && bAdaptProperties )
{
- Reference< XDataSeriesContainer > xSeriesContainer( xLineChartType, uno::UNO_QUERY );
- if( xSeriesContainer.is() )
+ if( xLineChartType.is() )
{
- sal_Int32 nNumberOfLines = xSeriesContainer->getDataSeries().getLength();
+ sal_Int32 nNumberOfLines = xLineChartType->getDataSeries().getLength();
setFastPropertyValue_NoBroadcast( PROP_COL_LINE_NUMBER_OF_LINES, uno::Any( nNumberOfLines ));
}
}
@@ -349,32 +302,22 @@ sal_Bool SAL_CALL ColumnLineChartTypeTemplate::matchesTemplate(
return bResult;
}
-Reference< chart2::XChartType > ColumnLineChartTypeTemplate::getChartTypeForIndex( sal_Int32 nChartTypeIndex )
+rtl::Reference< ChartType > ColumnLineChartTypeTemplate::getChartTypeForIndex( sal_Int32 nChartTypeIndex )
{
- Reference< chart2::XChartType > xCT;
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY );
- if(xFact.is())
- {
- if( nChartTypeIndex == 0 )
- xCT.set( xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_COLUMN ), uno::UNO_QUERY );
- else
- xCT.set( xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY );
- }
- return xCT;
+ if( nChartTypeIndex == 0 )
+ return new ColumnChartType();
+ else
+ return new LineChartType();
}
-Reference< XChartType > SAL_CALL ColumnLineChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > ColumnLineChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY_THROW );
+ xResult = new LineChartType();
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
}
catch( const uno::Exception & )
@@ -385,13 +328,13 @@ Reference< XChartType > SAL_CALL ColumnLineChartTypeTemplate::getChartTypeForNew
return xResult;
}
-Reference< XDataInterpreter > SAL_CALL ColumnLineChartTypeTemplate::getDataInterpreter()
+rtl::Reference< DataInterpreter > ColumnLineChartTypeTemplate::getDataInterpreter2()
{
if( ! m_xDataInterpreter.is())
{
sal_Int32 nNumberOfLines = 1;
getFastPropertyValue( PROP_COL_LINE_NUMBER_OF_LINES ) >>= nNumberOfLines;
- m_xDataInterpreter.set( new ColumnLineDataInterpreter( nNumberOfLines ) );
+ m_xDataInterpreter = new ColumnLineDataInterpreter( nNumberOfLines );
}
else
{
diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.hxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.hxx
index d112b81f58ad..68f144d6fedb 100644
--- a/chart2/source/model/template/ColumnLineChartTypeTemplate.hxx
+++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.hxx
@@ -22,14 +22,12 @@
#include <StackMode.hxx>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <comphelper/uno3.hxx>
namespace chart
{
class ColumnLineChartTypeTemplate :
- public cppu::BaseMutex,
public ChartTypeTemplate,
public ::property::OPropertySet
{
@@ -55,35 +53,33 @@ protected:
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
- // ____ XChartTypeTemplate ____
- virtual sal_Bool SAL_CALL matchesTemplate(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties ) override;
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence<
- css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ // ____ ChartTypeTemplate ____
+ virtual bool matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties ) override;
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeGroupIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
- virtual css::uno::Reference< css::chart2::XDataInterpreter > SAL_CALL getDataInterpreter() override;
+ virtual rtl::Reference< ::chart::DataInterpreter > getDataInterpreter2() override;
// ____ ChartTypeTemplate ____
virtual void createChartTypes(
- const css::uno::Sequence<
- css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XDataSeries > > > & aSeriesSeq,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XCoordinateSystem > > & rCoordSys,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XChartType > > & aOldChartTypesSeq
+ const std::vector<
+ std::vector<
+ rtl::Reference<
+ ::chart::DataSeries > > > & aSeriesSeq,
+ const std::vector<
+ rtl::Reference<
+ ::chart::BaseCoordinateSystem > > & rCoordSys,
+ const std::vector< rtl::Reference< ChartType > > & aOldChartTypesSeq
) override;
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const override;
diff --git a/chart2/source/model/template/ColumnLineDataInterpreter.cxx b/chart2/source/model/template/ColumnLineDataInterpreter.cxx
index 658bf2fd62d9..5cce30cd97a0 100644
--- a/chart2/source/model/template/ColumnLineDataInterpreter.cxx
+++ b/chart2/source/model/template/ColumnLineDataInterpreter.cxx
@@ -18,13 +18,13 @@
*/
#include "ColumnLineDataInterpreter.hxx"
+#include <DataSeries.hxx>
#include <osl/diagnose.h>
#include <algorithm>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -41,34 +41,33 @@ ColumnLineDataInterpreter::ColumnLineDataInterpreter(
ColumnLineDataInterpreter::~ColumnLineDataInterpreter()
{}
-// ____ XDataInterpreter ____
-InterpretedData SAL_CALL ColumnLineDataInterpreter::interpretDataSource(
+// ____ DataInterpreter ____
+InterpretedData ColumnLineDataInterpreter::interpretDataSource(
const Reference< data::XDataSource >& xSource,
const Sequence< beans::PropertyValue >& aArguments,
- const Sequence< Reference< XDataSeries > >& aSeriesToReUse )
+ const std::vector< rtl::Reference< DataSeries > >& aSeriesToReUse )
{
InterpretedData aResult( DataInterpreter::interpretDataSource( xSource, aArguments, aSeriesToReUse ));
// the base class should return one group
- OSL_ASSERT( aResult.Series.getLength() == 1 );
- if( aResult.Series.getLength() == 1 )
+ OSL_ASSERT( aResult.Series.size() == 1 );
+ if( aResult.Series.size() == 1 )
{
- sal_Int32 nNumberOfSeries = aResult.Series[0].getLength();
+ sal_Int32 nNumberOfSeries = aResult.Series[0].size();
// if we have more than one series put the last nNumOfLines ones into a new group
if( nNumberOfSeries > 1 && m_nNumberOfLines > 0 )
{
sal_Int32 nNumOfLines = std::min( m_nNumberOfLines, nNumberOfSeries - 1 );
- aResult.Series.realloc(2);
- auto pSeries = aResult.Series.getArray();
+ aResult.Series.resize(2);
- Sequence< Reference< XDataSeries > > & rColumnDataSeries = pSeries[0];
- Sequence< Reference< XDataSeries > > & rLineDataSeries = pSeries[1];
- rLineDataSeries.realloc( nNumOfLines );
+ std::vector< rtl::Reference< DataSeries > > & rColumnDataSeries = aResult.Series[0];
+ std::vector< rtl::Reference< DataSeries > > & rLineDataSeries = aResult.Series[1];
+ rLineDataSeries.resize( nNumOfLines );
std::copy( std::cbegin(rColumnDataSeries) + nNumberOfSeries - nNumOfLines,
std::cbegin(rColumnDataSeries) + nNumberOfSeries,
- rLineDataSeries.getArray() );
- rColumnDataSeries.realloc( nNumberOfSeries - nNumOfLines );
+ rLineDataSeries.begin() );
+ rColumnDataSeries.resize( nNumberOfSeries - nNumOfLines );
}
}
diff --git a/chart2/source/model/template/ColumnLineDataInterpreter.hxx b/chart2/source/model/template/ColumnLineDataInterpreter.hxx
index 43801bc249d3..c2ec75826007 100644
--- a/chart2/source/model/template/ColumnLineDataInterpreter.hxx
+++ b/chart2/source/model/template/ColumnLineDataInterpreter.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "DataInterpreter.hxx"
+#include <DataInterpreter.hxx>
namespace chart
{
@@ -29,12 +29,11 @@ public:
virtual ~ColumnLineDataInterpreter() override;
protected:
- // ____ XDataInterpreter ____
- virtual css::chart2::InterpretedData SAL_CALL interpretDataSource(
+ // ____ DataInterpreter ____
+ virtual InterpretedData interpretDataSource(
const css::uno::Reference<css::chart2::data::XDataSource>& xSource,
const css::uno::Sequence<css::beans::PropertyValue>& aArguments,
- const css::uno::Sequence<css::uno::Reference<css::chart2::XDataSeries>>& aSeriesToReUse)
- override;
+ const std::vector<rtl::Reference<::chart::DataSeries>>& aSeriesToReUse) override;
private:
sal_Int32 m_nNumberOfLines;
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index 524ce73d0d2d..0b60c03c2a1f 100644
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -17,22 +17,20 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "DataInterpreter.hxx"
+#include <DataInterpreter.hxx>
#include <DataSeries.hxx>
-#include <DataSourceHelper.hxx>
+#include <DataSource.hxx>
#include <DataSeriesHelper.hxx>
#include <CommonConverters.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
-#include <vector>
#include <algorithm>
+#include <cstddef>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -54,10 +52,10 @@ DataInterpreter::~DataInterpreter()
{}
// ____ XDataInterpreter ____
-InterpretedData SAL_CALL DataInterpreter::interpretDataSource(
+InterpretedData DataInterpreter::interpretDataSource(
const Reference< data::XDataSource >& xSource,
const Sequence< beans::PropertyValue >& aArguments,
- const Sequence< Reference< XDataSeries > >& aSeriesToReUse )
+ const std::vector< rtl::Reference< DataSeries > >& aSeriesToReUse )
{
if( ! xSource.is())
return InterpretedData();
@@ -66,10 +64,10 @@ InterpretedData SAL_CALL DataInterpreter::interpretDataSource(
lcl_ShowDataSource( xSource );
#endif
- const Sequence< Reference< data::XLabeledDataSequence > > aData( xSource->getDataSequences() );
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aData = getDataSequences(xSource);
- Reference< data::XLabeledDataSequence > xCategories;
- vector< Reference< data::XLabeledDataSequence > > aSequencesVec;
+ uno::Reference< chart2::data::XLabeledDataSequence > xCategories;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aSequencesVec;
// check if we should use categories
@@ -77,22 +75,22 @@ InterpretedData SAL_CALL DataInterpreter::interpretDataSource(
// parse data
bool bCategoriesUsed = false;
- for( Reference< data::XLabeledDataSequence > const & labeledData : aData )
+ for( uno::Reference< chart2::data::XLabeledDataSequence > const & labeledData : aData )
{
try
{
if( bHasCategories && ! bCategoriesUsed )
{
- xCategories.set( labeledData );
+ xCategories = labeledData;
if( xCategories.is())
- SetRole( xCategories->getValues(), "categories");
+ SetRole( xCategories->getValues(), u"categories"_ustr);
bCategoriesUsed = true;
}
else
{
aSequencesVec.push_back( labeledData );
if( labeledData.is())
- SetRole( labeledData->getValues(), "values-y");
+ SetRole( labeledData->getValues(), u"values-y"_ustr);
}
}
catch( const uno::Exception & )
@@ -102,63 +100,60 @@ InterpretedData SAL_CALL DataInterpreter::interpretDataSource(
}
// create DataSeries
- sal_Int32 nSeriesIndex = 0;
- vector< Reference< XDataSeries > > aSeriesVec;
+ std::size_t nSeriesIndex = 0;
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec;
aSeriesVec.reserve( aSequencesVec.size());
for (auto const& elem : aSequencesVec)
{
- Sequence< Reference< data::XLabeledDataSequence > > aNewData( &elem, 1 );
- Reference< XDataSeries > xSeries;
- if( nSeriesIndex < aSeriesToReUse.getLength())
- xSeries.set( aSeriesToReUse[nSeriesIndex] );
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewData { elem };
+ rtl::Reference< DataSeries > xSeries;
+ if( nSeriesIndex < aSeriesToReUse.size())
+ xSeries = aSeriesToReUse[nSeriesIndex];
else
- xSeries.set( new DataSeries );
- OSL_ASSERT( xSeries.is() );
- Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
- OSL_ASSERT( xSink.is() );
- xSink->setData( aNewData );
+ xSeries = new DataSeries;
+ assert( xSeries.is() );
+ xSeries->setData( aNewData );
aSeriesVec.push_back( xSeries );
++nSeriesIndex;
}
- return InterpretedData( { comphelper::containerToSequence( aSeriesVec ) }, xCategories );
+ return { { std::move(aSeriesVec) }, xCategories };
}
-InterpretedData SAL_CALL DataInterpreter::reinterpretDataSeries(
+InterpretedData DataInterpreter::reinterpretDataSeries(
const InterpretedData& aInterpretedData )
{
InterpretedData aResult( aInterpretedData );
sal_Int32 i=0;
- Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
- const sal_Int32 nCount = aSeries.getLength();
+ std::vector< rtl::Reference< DataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
+ const sal_Int32 nCount = aSeries.size();
for( ; i<nCount; ++i )
{
try
{
- Reference< data::XDataSource > xSeriesSource( aSeries[i], uno::UNO_QUERY_THROW );
- Sequence< Reference< data::XLabeledDataSequence > > aNewSequences;
+ std::vector< uno::Reference< data::XLabeledDataSequence > > aNewSequences;
// values-y
- Reference< data::XLabeledDataSequence > xValuesY(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, "values-y" ));
+ uno::Reference< data::XLabeledDataSequence > xValuesY =
+ DataSeriesHelper::getDataSequenceByRole( aSeries[i], u"values-y"_ustr );
// re-use values-... as values-y
if( ! xValuesY.is())
{
- xValuesY.set(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, "values", true ));
+ xValuesY =
+ DataSeriesHelper::getDataSequenceByRole( aSeries[i], u"values"_ustr, true );
if( xValuesY.is())
- SetRole( xValuesY->getValues(), "values-y");
+ SetRole( xValuesY->getValues(), u"values-y"_ustr);
}
if( xValuesY.is())
{
aNewSequences = { xValuesY };
}
- Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences());
- if( aSeqs.getLength() != aNewSequences.getLength() )
+ const std::vector< uno::Reference< data::XLabeledDataSequence > > & aSeqs = aSeries[i]->getDataSequences2();
+ if( aSeqs.size() != aNewSequences.size() )
{
#ifdef DEBUG_CHART2_TEMPLATE
sal_Int32 j=0;
@@ -167,8 +162,7 @@ InterpretedData SAL_CALL DataInterpreter::reinterpretDataSeries(
assert( aSeqs[j] == xValuesY && "All sequences should be used" );
}
#endif
- Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW );
- xSink->setData( aNewSequences );
+ aSeries[i]->setData( aNewSequences );
}
}
catch( const uno::Exception & )
@@ -181,17 +175,15 @@ InterpretedData SAL_CALL DataInterpreter::reinterpretDataSeries(
}
// criterion: all series must have exactly one data::XLabeledDataSequence
-sal_Bool SAL_CALL DataInterpreter::isDataCompatible(
- const chart2::InterpretedData& aInterpretedData )
+bool DataInterpreter::isDataCompatible(
+ const InterpretedData& aInterpretedData )
{
- const Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
- for( Reference< XDataSeries > const & i : aSeries )
+ const std::vector< rtl::Reference< DataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
+ for( rtl::Reference< DataSeries > const & i : aSeries )
{
try
{
- Reference< data::XDataSource > xSrc( i, uno::UNO_QUERY_THROW );
- Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSrc->getDataSequences());
- if( aSeq.getLength() != 1 )
+ if( i->getDataSequences2().size() != 1 )
return false;
}
catch( const uno::Exception & )
@@ -256,27 +248,24 @@ private:
} // anonymous namespace
-Reference< data::XDataSource > SAL_CALL DataInterpreter::mergeInterpretedData(
+rtl::Reference< DataSource > DataInterpreter::mergeInterpretedData(
const InterpretedData& aInterpretedData )
{
- vector< Reference< data::XLabeledDataSequence > > aResultVec;
- aResultVec.reserve( aInterpretedData.Series.getLength() +
+ std::vector< Reference< data::XLabeledDataSequence > > aResultVec;
+ aResultVec.reserve( aInterpretedData.Series.size() +
1 // categories
);
if( aInterpretedData.Categories.is())
aResultVec.push_back( aInterpretedData.Categories );
- const Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
- for( Reference< XDataSeries > const & dataSeries : aSeries )
+ const std::vector< rtl::Reference< DataSeries > > aSeries = FlattenSequence( aInterpretedData.Series );
+ for( rtl::Reference< DataSeries > const & dataSeries : aSeries )
{
try
{
- Reference< data::XDataSource > xSrc( dataSeries, uno::UNO_QUERY_THROW );
- const Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSrc->getDataSequences());
-
// add all sequences of data series
- for( Reference< data::XLabeledDataSequence > const & xAdd : aSeq )
+ for( uno::Reference< data::XLabeledDataSequence > const & xAdd : dataSeries->getDataSequences2() )
{
// only add if sequence is not yet in the result
if( none_of( aResultVec.begin(), aResultVec.end(),
@@ -292,10 +281,10 @@ Reference< data::XDataSource > SAL_CALL DataInterpreter::mergeInterpretedData(
}
}
- return DataSourceHelper::createDataSource( comphelper::containerToSequence( aResultVec ) );
+ return new DataSource(aResultVec);
}
-uno::Any SAL_CALL DataInterpreter::getChartTypeSpecificData(
+uno::Any DataInterpreter::getChartTypeSpecificData(
const OUString & )
{
return uno::Any();
@@ -312,7 +301,7 @@ OUString DataInterpreter::GetRole( const Reference< data::XDataSequence > & xSeq
try
{
Reference< beans::XPropertySet > xProp( xSeq, uno::UNO_QUERY_THROW );
- xProp->getPropertyValue( "Role") >>= aResult;
+ xProp->getPropertyValue( u"Role"_ustr) >>= aResult;
}
catch( const uno::Exception & )
{
@@ -328,7 +317,7 @@ void DataInterpreter::SetRole( const Reference< data::XDataSequence > & xSeq, co
try
{
Reference< beans::XPropertySet > xProp( xSeq, uno::UNO_QUERY_THROW );
- xProp->setPropertyValue( "Role", uno::Any( rRole ));
+ xProp->setPropertyValue( u"Role"_ustr, uno::Any( rRole ));
}
catch( const uno::Exception & )
{
@@ -350,14 +339,14 @@ uno::Any DataInterpreter::GetProperty(
bool DataInterpreter::HasCategories(
const Sequence< beans::PropertyValue > & rArguments,
- const Sequence< Reference< data::XLabeledDataSequence > > & rData )
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & rData )
{
bool bHasCategories = false;
if( rArguments.hasElements() )
GetProperty( rArguments, u"HasCategories" ) >>= bHasCategories;
- for( sal_Int32 nLSeqIdx=0; ! bHasCategories && nLSeqIdx<rData.getLength(); ++nLSeqIdx )
+ for( std::size_t nLSeqIdx=0; ! bHasCategories && nLSeqIdx<rData.size(); ++nLSeqIdx )
bHasCategories = ( rData[nLSeqIdx].is() && GetRole( rData[nLSeqIdx]->getValues() ) == "categories");
return bHasCategories;
@@ -373,7 +362,7 @@ bool DataInterpreter::UseCategoriesAsX( const Sequence< beans::PropertyValue > &
OUString SAL_CALL DataInterpreter::getImplementationName()
{
- return "com.sun.star.comp.chart2.DataInterpreter";
+ return u"com.sun.star.comp.chart2.DataInterpreter"_ustr;
}
sal_Bool SAL_CALL DataInterpreter::supportsService( const OUString& rServiceName )
@@ -383,7 +372,18 @@ sal_Bool SAL_CALL DataInterpreter::supportsService( const OUString& rServiceName
css::uno::Sequence< OUString > SAL_CALL DataInterpreter::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.DataInterpreter" };
+ return { u"com.sun.star.chart2.DataInterpreter"_ustr };
+}
+
+std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > DataInterpreter::getDataSequences(
+ const css::uno::Reference< css::chart2::data::XDataSource >& xSource)
+{
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aData;
+ for (const Reference< data::XLabeledDataSequence > & rLDS : xSource->getDataSequences() )
+ {
+ aData.push_back(rLDS);
+ }
+ return aData;
}
} // namespace chart
@@ -406,7 +406,7 @@ void lcl_ShowDataSource( const Reference< data::XDataSource > & xSource )
{
if( aSequences[k].is())
{
- OUString aSourceRepr("<none>");
+ OUString aSourceRepr(u"<none>"_ustr);
if( aSequences[k]->getValues().is())
aSourceRepr = aSequences[k]->getValues()->getSourceRangeRepresentation();
xProp.set( aSequences[k]->getValues(), uno::UNO_QUERY );
@@ -420,7 +420,7 @@ void lcl_ShowDataSource( const Reference< data::XDataSource > & xSource )
SAL_INFO("chart2", " <data sequence " << k << "> unknown Role, Source: " << aSourceRepr );
}
- aSourceRepr = "<none>";
+ aSourceRepr = u"<none>"_ustr;
if( aSequences[k]->getLabel().is())
aSourceRepr = aSequences[k]->getLabel()->getSourceRangeRepresentation();
xProp.set( aSequences[k]->getLabel(), uno::UNO_QUERY );
diff --git a/chart2/source/model/template/DataInterpreter.hxx b/chart2/source/model/template/DataInterpreter.hxx
deleted file mode 100644
index 5f9a9239202f..000000000000
--- a/chart2/source/model/template/DataInterpreter.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- 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 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 .
- */
-#pragma once
-
-#include <cppuhelper/implbase.hxx>
-#include <com/sun/star/chart2/XDataInterpreter.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace chart
-{
-
-class DataInterpreter : public ::cppu::WeakImplHelper<
- css::chart2::XDataInterpreter,
- css::lang::XServiceInfo >
-{
-public:
- explicit DataInterpreter();
- virtual ~DataInterpreter() override;
-
- /// XServiceInfo declarations
- virtual OUString SAL_CALL getImplementationName() override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
-
- // convenience methods
- static OUString GetRole( const css::uno::Reference< css::chart2::data::XDataSequence > & xSeq );
-
- static void SetRole(
- const css::uno::Reference< css::chart2::data::XDataSequence > & xSeq,
- const OUString & rRole );
-
- static css::uno::Any GetProperty(
- const css::uno::Sequence<css::beans::PropertyValue > & aArguments,
- std::u16string_view rName );
-
- static bool HasCategories(
- const css::uno::Sequence< css::beans::PropertyValue > & rArguments,
- const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & rData );
-
- static bool UseCategoriesAsX(
- const css::uno::Sequence< css::beans::PropertyValue > & rArguments );
-
-protected:
- // ____ XDataInterpreter ____
- virtual css::chart2::InterpretedData SAL_CALL interpretDataSource(
- const css::uno::Reference< css::chart2::data::XDataSource >& xSource,
- const css::uno::Sequence< css::beans::PropertyValue >& aArguments,
- const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > >& aSeriesToReUse ) override;
- virtual css::chart2::InterpretedData SAL_CALL reinterpretDataSeries(
- const css::chart2::InterpretedData& aInterpretedData ) override;
- virtual sal_Bool SAL_CALL isDataCompatible(
- const css::chart2::InterpretedData& aInterpretedData ) override;
- virtual css::uno::Reference< css::chart2::data::XDataSource > SAL_CALL mergeInterpretedData(
- const css::chart2::InterpretedData& aInterpretedData ) override;
- virtual css::uno::Any SAL_CALL getChartTypeSpecificData(
- const OUString& sKey ) override;
-};
-
-} // namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/FilledNetChartType.cxx b/chart2/source/model/template/FilledNetChartType.cxx
index 3179317daee5..5d44dc95d46a 100644
--- a/chart2/source/model/template/FilledNetChartType.cxx
+++ b/chart2/source/model/template/FilledNetChartType.cxx
@@ -24,7 +24,6 @@
namespace com::sun::star::uno { class XComponentContext; }
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Sequence;
@@ -48,6 +47,11 @@ uno::Reference< util::XCloneable > SAL_CALL FilledNetChartType::createClone()
return uno::Reference< util::XCloneable >( new FilledNetChartType( *this ));
}
+rtl::Reference< ChartType > FilledNetChartType::cloneChartType() const
+{
+ return new FilledNetChartType( *this );
+}
+
// ____ XChartType ____
OUString SAL_CALL FilledNetChartType::getChartType()
{
@@ -56,7 +60,7 @@ OUString SAL_CALL FilledNetChartType::getChartType()
OUString SAL_CALL FilledNetChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.FilledNetChartType";
+ return u"com.sun.star.comp.chart.FilledNetChartType"_ustr;
}
sal_Bool SAL_CALL FilledNetChartType::supportsService( const OUString& rServiceName )
@@ -68,8 +72,8 @@ css::uno::Sequence< OUString > SAL_CALL FilledNetChartType::getSupportedServiceN
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET,
- "com.sun.star.chart2.ChartType",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.ChartType"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/FilledNetChartType.hxx b/chart2/source/model/template/FilledNetChartType.hxx
index 0ca41b60ba55..b2d239aeca36 100644
--- a/chart2/source/model/template/FilledNetChartType.hxx
+++ b/chart2/source/model/template/FilledNetChartType.hxx
@@ -32,6 +32,8 @@ public:
virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit FilledNetChartType(const FilledNetChartType& rOther);
diff --git a/chart2/source/model/template/FunnelChartType.cxx b/chart2/source/model/template/FunnelChartType.cxx
new file mode 100644
index 000000000000..d9ffe231063f
--- /dev/null
+++ b/chart2/source/model/template/FunnelChartType.cxx
@@ -0,0 +1,75 @@
+/* -*- 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 "FunnelChartType.hxx"
+#include <servicenames_charttypes.hxx>
+#include <cppuhelper/supportsservice.hxx>
+
+namespace com::sun::star::uno
+{
+class XComponentContext;
+}
+
+using namespace ::com::sun::star;
+
+namespace chart
+{
+FunnelChartType::FunnelChartType() {}
+
+FunnelChartType::FunnelChartType(const FunnelChartType& rOther)
+ : ChartType(rOther)
+{
+}
+
+FunnelChartType::~FunnelChartType() {}
+
+// ____ XCloneable ____
+uno::Reference<util::XCloneable> SAL_CALL FunnelChartType::createClone()
+{
+ return uno::Reference<util::XCloneable>(new FunnelChartType(*this));
+}
+
+rtl::Reference<ChartType> FunnelChartType::cloneChartType() const
+{
+ return new FunnelChartType(*this);
+}
+
+// ____ XChartType ____
+OUString SAL_CALL FunnelChartType::getChartType() { return CHART2_SERVICE_NAME_CHARTTYPE_FUNNEL; }
+
+uno::Sequence<OUString> FunnelChartType::getSupportedPropertyRoles()
+{
+ return { "FillColor", "BorderColor" };
+}
+
+OUString SAL_CALL FunnelChartType::getImplementationName()
+{
+ return "com.sun.star.comp.chart.FunnelChartType";
+}
+
+sal_Bool SAL_CALL FunnelChartType::supportsService(const OUString& rServiceName)
+{
+ return cppu::supportsService(this, rServiceName);
+}
+
+css::uno::Sequence<OUString> SAL_CALL FunnelChartType::getSupportedServiceNames()
+{
+ return { CHART2_SERVICE_NAME_CHARTTYPE_FUNNEL, "com.sun.star.chart2.ChartType" };
+}
+
+} // namespace chart
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_comp_chart_FunnelChartType_get_implementation(css::uno::XComponentContext* /*context*/,
+ css::uno::Sequence<css::uno::Any> const&)
+{
+ return cppu::acquire(new ::chart::FunnelChartType);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/FunnelChartType.hxx b/chart2/source/model/template/FunnelChartType.hxx
new file mode 100644
index 000000000000..fbaa3f46354d
--- /dev/null
+++ b/chart2/source/model/template/FunnelChartType.hxx
@@ -0,0 +1,40 @@
+/* -*- 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 <ChartType.hxx>
+
+namespace chart
+{
+class FunnelChartType final : public ChartType
+{
+public:
+ explicit FunnelChartType();
+ virtual ~FunnelChartType() override;
+
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
+private:
+ explicit FunnelChartType(const FunnelChartType& rOther);
+
+ // ____ XChartType ____
+ virtual OUString SAL_CALL getChartType() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedPropertyRoles() override;
+
+ // ____ XCloneable ____
+ virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() override;
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/FunnelChartTypeTemplate.cxx b/chart2/source/model/template/FunnelChartTypeTemplate.cxx
new file mode 100644
index 000000000000..40b3897f8ad1
--- /dev/null
+++ b/chart2/source/model/template/FunnelChartTypeTemplate.cxx
@@ -0,0 +1,192 @@
+/* -*- 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 "FunnelChartTypeTemplate.hxx"
+#include "ColumnChartType.hxx"
+#include <Diagram.hxx>
+#include <DiagramHelper.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesHelper.hxx>
+#include <PropertyHelper.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <comphelper/diagnose_ex.hxx>
+
+#include <algorithm>
+
+using namespace ::com::sun::star;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::beans::Property;
+
+namespace
+{
+enum
+{
+ PROP_FUNNEL_TEMPLATE_DIMENSION,
+ PROP_FUNNEL_TEMPLATE_GEOMETRY3D
+};
+
+void lcl_AddPropertiesToVector(std::vector<Property>& rOutProperties)
+{
+ rOutProperties.emplace_back(
+ "Dimension", PROP_FUNNEL_TEMPLATE_DIMENSION, cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
+ rOutProperties.emplace_back(
+ "Geometry3D", PROP_FUNNEL_TEMPLATE_GEOMETRY3D, cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
+}
+
+::cppu::OPropertyArrayHelper& StaticFunnelChartTypeTemplateInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []() {
+ std::vector<css::beans::Property> aProperties;
+ lcl_AddPropertiesToVector(aProperties);
+
+ std::sort(aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess());
+
+ return comphelper::containerToSequence(aProperties);
+ }();
+ return aPropHelper;
+};
+
+} // anonymous namespace
+
+namespace chart
+{
+FunnelChartTypeTemplate::FunnelChartTypeTemplate(Reference<uno::XComponentContext> const& xContext,
+ const OUString& rServiceName,
+ sal_Int32 nDim /* = 2 */)
+ : ChartTypeTemplate(xContext, rServiceName)
+ , m_nDim(nDim)
+{
+}
+
+FunnelChartTypeTemplate::~FunnelChartTypeTemplate() {}
+
+sal_Int32 FunnelChartTypeTemplate::getDimension() const { return m_nDim; }
+
+// ____ ChartTypeTemplate ____
+bool FunnelChartTypeTemplate::matchesTemplate2(const rtl::Reference<::chart::Diagram>& xDiagram,
+ bool bAdaptProperties)
+{
+ bool bResult = ChartTypeTemplate::matchesTemplate2(xDiagram, bAdaptProperties);
+
+ // adapt solid-type of template according to values in series
+ if (bAdaptProperties && bResult && getDimension() == 3)
+ {
+ bool bGeomFound = false, bGeomAmbiguous = false;
+ sal_Int32 aCommonGeom = xDiagram->getGeometry3D(bGeomFound, bGeomAmbiguous);
+
+ if (!bGeomAmbiguous)
+ {
+ setFastPropertyValue_NoBroadcast(PROP_FUNNEL_TEMPLATE_GEOMETRY3D,
+ uno::Any(aCommonGeom));
+ }
+ }
+
+ return bResult;
+}
+
+rtl::Reference<ChartType>
+ FunnelChartTypeTemplate::getChartTypeForIndex(sal_Int32 /*nChartTypeIndex*/)
+{
+ return new ColumnChartType();
+}
+
+rtl::Reference<ChartType> FunnelChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector<rtl::Reference<ChartType>>& aFormerlyUsedChartTypes)
+{
+ rtl::Reference<ChartType> xResult(getChartTypeForIndex(0));
+ ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem(aFormerlyUsedChartTypes, xResult);
+ return xResult;
+}
+
+// ____ OPropertySet ____
+void FunnelChartTypeTemplate::GetDefaultValue(sal_Int32 nHandle, uno::Any& rAny) const
+{
+ static ::chart::tPropertyValueMap aStaticDefaults = []() {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::PropertyHelper::setPropertyValueDefault<sal_Int32>(
+ aTmp, PROP_FUNNEL_TEMPLATE_DIMENSION, 2);
+ ::chart::PropertyHelper::setPropertyValueDefault(aTmp, PROP_FUNNEL_TEMPLATE_GEOMETRY3D,
+ ::chart2::DataPointGeometry3D::CUBOID);
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound(aStaticDefaults.find(nHandle));
+ if (aFound == aStaticDefaults.end())
+ rAny.clear();
+ else
+ rAny = (*aFound).second;
+}
+
+::cppu::IPropertyArrayHelper& SAL_CALL FunnelChartTypeTemplate::getInfoHelper()
+{
+ return StaticFunnelChartTypeTemplateInfoHelper();
+}
+
+// ____ XPropertySet ____
+Reference<beans::XPropertySetInfo> SAL_CALL FunnelChartTypeTemplate::getPropertySetInfo()
+{
+ static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(
+ StaticFunnelChartTypeTemplateInfoHelper()));
+ return xPropertySetInfo;
+}
+
+void FunnelChartTypeTemplate::applyStyle2(const rtl::Reference<DataSeries>& xSeries,
+ ::sal_Int32 nChartTypeIndex, ::sal_Int32 nSeriesIndex,
+ ::sal_Int32 nSeriesCount)
+{
+ ChartTypeTemplate::applyStyle2(xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount);
+ xSeries->setPropertyAlsoToAllAttributedDataPoints("BorderStyle",
+ uno::Any(drawing::LineStyle_NONE));
+ if (getDimension() != 3)
+ return;
+
+ try
+ {
+ //apply Geometry3D
+ uno::Any aAGeometry3D;
+ getFastPropertyValue(aAGeometry3D, PROP_FUNNEL_TEMPLATE_GEOMETRY3D);
+ xSeries->setPropertyAlsoToAllAttributedDataPoints("Geometry3D", aAGeometry3D);
+ }
+ catch (const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+void FunnelChartTypeTemplate::resetStyles2(const rtl::Reference<::chart::Diagram>& xDiagram)
+{
+ ChartTypeTemplate::resetStyles2(xDiagram);
+ std::vector<rtl::Reference<DataSeries>> aSeriesVec(xDiagram->getDataSeries());
+ uno::Any aLineStyleAny(drawing::LineStyle_NONE);
+ for (auto const& series : aSeriesVec)
+ {
+ if (getDimension() == 3)
+ series->setPropertyToDefault("Geometry3D");
+ if (series->getPropertyValue("BorderStyle") == aLineStyleAny)
+ {
+ series->setPropertyToDefault("BorderStyle");
+ }
+ }
+
+ xDiagram->setVertical(false);
+}
+
+IMPLEMENT_FORWARD_XINTERFACE2(FunnelChartTypeTemplate, ChartTypeTemplate, OPropertySet)
+IMPLEMENT_FORWARD_XTYPEPROVIDER2(FunnelChartTypeTemplate, ChartTypeTemplate, OPropertySet)
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/FunnelChartTypeTemplate.hxx b/chart2/source/model/template/FunnelChartTypeTemplate.hxx
new file mode 100644
index 000000000000..ffaefeace151
--- /dev/null
+++ b/chart2/source/model/template/FunnelChartTypeTemplate.hxx
@@ -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/.
+ */
+#pragma once
+
+#include <OPropertySet.hxx>
+#include <comphelper/uno3.hxx>
+
+#include <ChartTypeTemplate.hxx>
+
+namespace chart
+{
+class FunnelChartTypeTemplate : public ChartTypeTemplate, public ::property::OPropertySet
+{
+public:
+ FunnelChartTypeTemplate(css::uno::Reference<css::uno::XComponentContext> const& xContext,
+ const OUString& rServiceName, sal_Int32 nDim = 2);
+ virtual ~FunnelChartTypeTemplate() override;
+
+ /// merge XInterface implementations
+ DECLARE_XINTERFACE()
+ /// merge XTypeProvider implementations
+ DECLARE_XTYPEPROVIDER()
+
+protected:
+ // ____ OPropertySet ____
+ virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any& rAny) const override;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+
+ // ____ XPropertySet ____
+ virtual css::uno::Reference<css::beans::XPropertySetInfo>
+ SAL_CALL getPropertySetInfo() override;
+
+ // ____ ChartTypeTemplate ____
+ virtual bool matchesTemplate2(const rtl::Reference<::chart::Diagram>& xDiagram,
+ bool bAdaptProperties) override;
+ virtual rtl::Reference<::chart::ChartType> getChartTypeForNewSeries2(
+ const std::vector<rtl::Reference<::chart::ChartType>>& aFormerlyUsedChartTypes) override;
+ virtual void applyStyle2(const rtl::Reference<::chart::DataSeries>& xSeries,
+ ::sal_Int32 nChartTypeGroupIndex, ::sal_Int32 nSeriesIndex,
+ ::sal_Int32 nSeriesCount) override;
+ virtual void resetStyles2(const rtl::Reference<::chart::Diagram>& xDiagram) override;
+
+ // ____ ChartTypeTemplate ____
+ virtual sal_Int32 getDimension() const override;
+
+ virtual rtl::Reference<::chart::ChartType>
+ getChartTypeForIndex(sal_Int32 nChartTypeIndex) override;
+
+private:
+ sal_Int32 m_nDim;
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/HistogramCalculator.cxx b/chart2/source/model/template/HistogramCalculator.cxx
new file mode 100644
index 000000000000..ac0455196a53
--- /dev/null
+++ b/chart2/source/model/template/HistogramCalculator.cxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 "HistogramCalculator.hxx"
+
+#include <algorithm>
+#include <cmath>
+
+namespace chart
+{
+HistogramCalculator::HistogramCalculator() = default;
+
+void HistogramCalculator::computeBinFrequencyHistogram(const std::vector<double>& rDataPoints)
+{
+ if (rDataPoints.empty())
+ return;
+
+ mnBins = 1;
+ mfBinWidth = 1.0;
+ maBinRanges.clear();
+ maBinFrequencies.clear();
+
+ // Calculate statistics
+ double fSum = 0.0;
+ double fSquareSum = 0.0;
+ double fMinValue = rDataPoints[0];
+ double fMaxValue = rDataPoints[0];
+ sal_Int32 nValidCount = 0;
+
+ // Compute min and max values, ignoring non-finite values
+ for (const auto& rValue : rDataPoints)
+ {
+ if (std::isfinite(rValue))
+ {
+ fSum += rValue;
+ fSquareSum += rValue * rValue;
+ fMinValue = std::min(fMinValue, rValue);
+ fMaxValue = std::max(fMaxValue, rValue);
+ ++nValidCount;
+ }
+ }
+
+ if (nValidCount < 2 || fMinValue == fMaxValue) // Need at least two points for variance
+ {
+ mnBins = 1;
+ mfBinWidth = 1.0;
+ maBinRanges = { { std::floor(fMinValue), std::ceil(fMinValue + 1.0) } };
+ maBinFrequencies = { nValidCount };
+ return;
+ }
+
+ double fMean = fSum / nValidCount;
+ double fVariance = (fSquareSum - fSum * fMean) / (nValidCount - 1);
+ double fStdDev = std::sqrt(fVariance);
+
+ // Apply Scott's rule for bin width
+ mfBinWidth = (3.5 * fStdDev) / std::cbrt(nValidCount);
+
+ // Calculate number of bins
+ mnBins = static_cast<sal_Int32>(std::ceil((fMaxValue - fMinValue) / mfBinWidth));
+ mnBins = std::max<sal_Int32>(mnBins, 1); // Ensure at least one bin
+
+ // Set up bin ranges
+ maBinRanges.reserve(mnBins);
+ double fBinStart = fMinValue;
+
+ for (sal_Int32 i = 0; i < mnBins; ++i)
+ {
+ double fBinEnd = fBinStart + mfBinWidth;
+
+ // Correct rounding to avoid discrepancies
+ fBinStart = std::round(fBinStart * 100.0) / 100.0;
+ fBinEnd = std::round(fBinEnd * 100.0) / 100.0;
+
+ if (i == 0)
+ {
+ // First bin includes the minimum value, so use closed interval [fMinValue, fBinEnd]
+ maBinRanges.emplace_back(fMinValue, fBinEnd);
+ }
+ else
+ {
+ // Subsequent bins use half-open interval (fBinStart, fBinEnd]
+ maBinRanges.emplace_back(fBinStart, fBinEnd);
+ }
+ fBinStart = fBinEnd;
+ }
+
+ // Adjust the last bin end to be inclusive
+ maBinRanges.back().second = std::max(maBinRanges.back().second, fMaxValue);
+
+ // Calculate frequencies
+ maBinFrequencies.assign(mnBins, 0);
+ for (double fValue : rDataPoints)
+ {
+ if (std::isfinite(fValue))
+ {
+ for (size_t i = 0; i < maBinRanges.size(); ++i)
+ {
+ if (i == 0 && fValue >= maBinRanges[i].first && fValue <= maBinRanges[i].second)
+ {
+ maBinFrequencies[i]++;
+ break;
+ }
+ else if (i > 0 && fValue > maBinRanges[i].first && fValue <= maBinRanges[i].second)
+ {
+ maBinFrequencies[i]++;
+ break;
+ }
+ }
+ }
+ }
+}
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/model/template/HistogramCalculator.hxx b/chart2/source/model/template/HistogramCalculator.hxx
new file mode 100644
index 000000000000..d2c43453af1b
--- /dev/null
+++ b/chart2/source/model/template/HistogramCalculator.hxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 <sal/types.h>
+#include <vector>
+
+namespace chart
+{
+class HistogramCalculator
+{
+ sal_Int32 mnBins = 1;
+ double mfBinWidth = 1.0;
+
+ std::vector<std::pair<double, double>> maBinRanges;
+ std::vector<sal_Int32> maBinFrequencies;
+
+public:
+ HistogramCalculator();
+
+ void computeBinFrequencyHistogram(const std::vector<double>& dataPoints);
+
+ const std::vector<std::pair<double, double>>& getBinRanges() const { return maBinRanges; }
+ const std::vector<sal_Int32>& getBinFrequencies() const { return maBinFrequencies; }
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/model/template/HistogramChartType.cxx b/chart2/source/model/template/HistogramChartType.cxx
new file mode 100644
index 000000000000..2f202de39945
--- /dev/null
+++ b/chart2/source/model/template/HistogramChartType.cxx
@@ -0,0 +1,295 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 "HistogramChartType.hxx"
+#include <servicenames_charttypes.hxx>
+#include <CartesianCoordinateSystem.hxx>
+#include <PropertyHelper.hxx>
+#include <Axis.hxx>
+#include <AxisHelper.hxx>
+#include <AxisIndexDefines.hxx>
+#include <DataSeries.hxx>
+#include <LabeledDataSequence.hxx>
+#include <HistogramDataSequence.hxx>
+#include "HistogramCalculator.hxx"
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <cppuhelper/supportsservice.hxx>
+
+#include <algorithm>
+#include <cmath>
+#include <iostream>
+namespace com::sun::star::uno
+{
+class XComponentContext;
+}
+
+using namespace ::com::sun::star;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::beans::Property;
+
+namespace
+{
+enum
+{
+ PROP_HISTOGRAMCHARTTYPE_BINWIDTH,
+ PROP_HISTOGRAMCHARTTYPE_BINRANGE,
+ PROP_HISTOGRAMCHARTTYPE_FREQUENCYTYPE,
+ PROP_HISTOGRAMCHARTTYPE_OVERLAP_SEQUENCE,
+ PROP_HISTOGRAMCHARTTYPE_GAPWIDTH_SEQUENCE
+};
+
+void lcl_AddPropertiesToVector(std::vector<Property>& rOutProperties)
+{
+ rOutProperties.emplace_back(
+ "BinWidth", PROP_HISTOGRAMCHARTTYPE_BINWIDTH, cppu::UnoType<double>::get(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
+
+ rOutProperties.emplace_back(
+ "BinRange", PROP_HISTOGRAMCHARTTYPE_BINRANGE, cppu::UnoType<double>::get(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
+
+ rOutProperties.emplace_back(
+ "FrequencyType", PROP_HISTOGRAMCHARTTYPE_FREQUENCYTYPE, cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
+
+ rOutProperties.emplace_back("OverlapSequence", PROP_HISTOGRAMCHARTTYPE_OVERLAP_SEQUENCE,
+ cppu::UnoType<Sequence<sal_Int32>>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT);
+
+ rOutProperties.emplace_back("GapwidthSequence", PROP_HISTOGRAMCHARTTYPE_GAPWIDTH_SEQUENCE,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT);
+}
+
+::cppu::OPropertyArrayHelper& StaticHistogramChartTypeInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []() {
+ std::vector<css::beans::Property> aProperties;
+ lcl_AddPropertiesToVector(aProperties);
+
+ std::sort(aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess());
+
+ return comphelper::containerToSequence(aProperties);
+ }();
+ return aPropHelper;
+};
+
+} // anonymous namespace
+
+namespace chart
+{
+HistogramChartType::HistogramChartType() {}
+
+HistogramChartType::HistogramChartType(const HistogramChartType& rOther)
+ : ChartType(rOther)
+{
+}
+
+HistogramChartType::~HistogramChartType() {}
+
+// ____ XCloneable ____
+uno::Reference<util::XCloneable> SAL_CALL HistogramChartType::createClone()
+{
+ return uno::Reference<util::XCloneable>(new HistogramChartType(*this));
+}
+
+rtl::Reference<ChartType> HistogramChartType::cloneChartType() const
+{
+ return new HistogramChartType(*this);
+}
+
+// ____ XChartType ____
+rtl::Reference<::chart::BaseCoordinateSystem>
+HistogramChartType::createCoordinateSystem2(sal_Int32 DimensionCount)
+{
+ rtl::Reference<CartesianCoordinateSystem> xResult
+ = new CartesianCoordinateSystem(DimensionCount);
+
+ for (sal_Int32 i = 0; i < DimensionCount; i++)
+ {
+ rtl::Reference<Axis> xAxis = xResult->getAxisByDimension2(i, MAIN_AXIS_INDEX);
+ if (xAxis.is())
+ {
+ chart2::ScaleData aScaleData = xAxis->getScaleData();
+ aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
+ aScaleData.Scaling = AxisHelper::createLinearScaling();
+
+ if (i == 0) //X-axis
+ {
+ aScaleData.AxisType = chart2::AxisType::REALNUMBER;
+ aScaleData.AutoDateAxis = false;
+ }
+ else if (i == 1) //Y-axis
+ {
+ aScaleData.AxisType = chart2::AxisType::REALNUMBER;
+ }
+
+ xAxis->setScaleData(aScaleData);
+ }
+ }
+
+ return xResult;
+}
+
+OUString SAL_CALL HistogramChartType::getChartType()
+{
+ return CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM;
+}
+
+uno::Sequence<OUString> HistogramChartType::getSupportedPropertyRoles()
+{
+ return { u"FillColor"_ustr, u"BorderColor"_ustr };
+}
+
+::cppu::IPropertyArrayHelper& SAL_CALL HistogramChartType::getInfoHelper()
+{
+ return StaticHistogramChartTypeInfoHelper();
+}
+
+// ____ OPropertySet ____
+void HistogramChartType::GetDefaultValue(sal_Int32 nHandle, uno::Any& rAny) const
+{
+ static const ::chart::tPropertyValueMap aStaticDefaults = []() {
+ ::chart::tPropertyValueMap aTmp;
+ Sequence<sal_Int32> aSeq{ 0 }; // No gap for histogram
+ ::chart::PropertyHelper::setPropertyValueDefault(
+ aTmp, PROP_HISTOGRAMCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq);
+ ::chart::PropertyHelper::setPropertyValueDefault(
+ aTmp, PROP_HISTOGRAMCHARTTYPE_OVERLAP_SEQUENCE, aSeq);
+ ::chart::PropertyHelper::setPropertyValueDefault(aTmp, PROP_HISTOGRAMCHARTTYPE_BINWIDTH,
+ 2.0);
+ ::chart::PropertyHelper::setPropertyValueDefault(aTmp, PROP_HISTOGRAMCHARTTYPE_BINRANGE,
+ 1.0);
+ ::chart::PropertyHelper::setPropertyValueDefault(
+ aTmp, PROP_HISTOGRAMCHARTTYPE_FREQUENCYTYPE, sal_Int32(0));
+ return aTmp;
+ }();
+
+ tPropertyValueMap::const_iterator aFound(aStaticDefaults.find(nHandle));
+ if (aFound == aStaticDefaults.end())
+ rAny.clear();
+ else
+ rAny = (*aFound).second;
+}
+// ____ XPropertySet ____
+uno::Reference<beans::XPropertySetInfo> SAL_CALL HistogramChartType::getPropertySetInfo()
+{
+ static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticHistogramChartTypeInfoHelper()));
+ return xPropertySetInfo;
+}
+
+OUString SAL_CALL HistogramChartType::getImplementationName()
+{
+ return "com.sun.star.comp.chart.HistogramChartType";
+}
+
+sal_Bool SAL_CALL HistogramChartType::supportsService(const OUString& rServiceName)
+{
+ return cppu::supportsService(this, rServiceName);
+}
+
+css::uno::Sequence<OUString> SAL_CALL HistogramChartType::getSupportedServiceNames()
+{
+ return { CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM, "com.sun.star.chart2.ChartType" };
+}
+
+namespace
+{
+void setRoleToTheSequence(uno::Reference<chart2::data::XDataSequence> const& xSequence,
+ OUString const& rRole)
+{
+ if (!xSequence.is())
+ return;
+ try
+ {
+ uno::Reference<beans::XPropertySet> xProperty(xSequence, uno::UNO_QUERY_THROW);
+ xProperty->setPropertyValue(u"Role"_ustr, uno::Any(rRole));
+ }
+ catch (const uno::Exception&)
+ {
+ }
+}
+}
+
+void HistogramChartType::createCalculatedDataSeries()
+{
+ if (m_aDataSeries.empty())
+ return;
+
+ std::vector<uno::Reference<chart2::data::XLabeledDataSequence>> const& aDataSequences
+ = m_aDataSeries[0]->getDataSequences2();
+
+ if (aDataSequences.empty() || !aDataSequences[0].is())
+ return;
+
+ // Extract raw data from the spreadsheet
+ std::vector<double> rawData;
+ uno::Reference<chart2::data::XDataSequence> xValues = aDataSequences[0]->getValues();
+
+ uno::Sequence<uno::Any> aRawAnyValues = xValues->getData();
+ for (const auto& aAny : aRawAnyValues)
+ {
+ double fValue = 0.0;
+ if (aAny >>= fValue) // Extract double from Any
+ {
+ rawData.push_back(fValue);
+ }
+ }
+
+ // Perform histogram calculations
+ HistogramCalculator aHistogramCalculator;
+ aHistogramCalculator.computeBinFrequencyHistogram(rawData);
+
+ // Get bin ranges and frequencies
+ const auto& binRanges = aHistogramCalculator.getBinRanges();
+ const auto& binFrequencies = aHistogramCalculator.getBinFrequencies();
+
+ // Create labels and values for HistogramDataSequence
+ std::vector<OUString> aLabels;
+ std::vector<double> aValues;
+ for (size_t i = 0; i < binRanges.size(); ++i)
+ {
+ OUString aLabel;
+ if (i == 0)
+ {
+ aLabel = u"["_ustr + OUString::number(binRanges[i].first) + u"-"_ustr
+ + OUString::number(binRanges[i].second) + u"]"_ustr;
+ }
+ else
+ {
+ aLabel = u"("_ustr + OUString::number(binRanges[i].first) + u"-"_ustr
+ + OUString::number(binRanges[i].second) + u"]"_ustr;
+ }
+ aLabels.push_back(aLabel);
+ aValues.push_back(static_cast<double>(binFrequencies[i]));
+ }
+
+ rtl::Reference<HistogramDataSequence> aValuesDataSequence = new HistogramDataSequence();
+ aValuesDataSequence->setValues(comphelper::containerToSequence(aValues));
+ aValuesDataSequence->setLabels(comphelper::containerToSequence(aLabels));
+
+ setRoleToTheSequence(aValuesDataSequence, u"values-y"_ustr);
+
+ m_aDataSeries[0]->addDataSequence(new LabeledDataSequence(aValuesDataSequence));
+}
+
+} // namespace chart
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_comp_chart_HistogramChartType_get_implementation(
+ css::uno::XComponentContext* /*context*/, css::uno::Sequence<css::uno::Any> const&)
+{
+ return cppu::acquire(new ::chart::HistogramChartType());
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/model/template/HistogramChartType.hxx b/chart2/source/model/template/HistogramChartType.hxx
new file mode 100644
index 000000000000..621c153a2d61
--- /dev/null
+++ b/chart2/source/model/template/HistogramChartType.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 <ChartType.hxx>
+
+namespace chart
+{
+class HistogramChartType : public ChartType
+{
+public:
+ explicit HistogramChartType();
+ virtual ~HistogramChartType() override;
+
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
+ void createCalculatedDataSeries() override;
+
+protected:
+ explicit HistogramChartType(const HistogramChartType& rOther);
+
+ // ____ XChartType ____
+ rtl::Reference<::chart::BaseCoordinateSystem>
+ createCoordinateSystem2(sal_Int32 DimensionCount) override;
+ OUString SAL_CALL getChartType() override;
+ css::uno::Sequence<OUString> SAL_CALL getSupportedPropertyRoles() override;
+
+ // ____ OPropertySet ____
+ void GetDefaultValue(sal_Int32 nHandle, css::uno::Any& rAny) const override;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+
+ // ____ XPropertySet ____
+ css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
+
+ // ____ XCloneable ____
+ css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() override;
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/model/template/HistogramChartTypeTemplate.cxx b/chart2/source/model/template/HistogramChartTypeTemplate.cxx
new file mode 100644
index 000000000000..b30d1205c429
--- /dev/null
+++ b/chart2/source/model/template/HistogramChartTypeTemplate.cxx
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 "HistogramChartTypeTemplate.hxx"
+#include "HistogramChartType.hxx"
+#include "HistogramDataInterpreter.hxx"
+#include <Diagram.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesHelper.hxx>
+#include <PropertyHelper.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <comphelper/diagnose_ex.hxx>
+
+#include <algorithm>
+
+using namespace ::com::sun::star;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::beans::Property;
+
+namespace
+{
+enum
+{
+ PROP_HISTOGRAM_TEMPLATE_DIMENSION,
+};
+
+void lcl_AddPropertiesToVector(std::vector<Property>& rOutProperties)
+{
+ rOutProperties.emplace_back(
+ "Dimension", PROP_HISTOGRAM_TEMPLATE_DIMENSION, cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
+}
+
+::cppu::OPropertyArrayHelper& StaticHistogramChartTypeTemplateInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper aPropHelper = []() {
+ std::vector<css::beans::Property> aProperties;
+ lcl_AddPropertiesToVector(aProperties);
+
+ std::sort(aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess());
+
+ return comphelper::containerToSequence(aProperties);
+ }();
+ return aPropHelper;
+};
+
+} // anonymous namespace
+
+namespace chart
+{
+HistogramChartTypeTemplate::HistogramChartTypeTemplate(
+ Reference<uno::XComponentContext> const& xContext, const OUString& rServiceName,
+ StackMode eStackMode)
+ : ChartTypeTemplate(xContext, rServiceName)
+ , m_eStackMode(eStackMode)
+ , m_nDim(2)
+{
+}
+
+sal_Int32 HistogramChartTypeTemplate::getDimension() const { return m_nDim; }
+
+StackMode HistogramChartTypeTemplate::getStackMode(sal_Int32 /* nChartTypeIndex */) const
+{
+ return m_eStackMode;
+}
+
+rtl::Reference<ChartType>
+ HistogramChartTypeTemplate::getChartTypeForIndex(sal_Int32 /*nChartTypeIndex*/)
+{
+ return new HistogramChartType();
+}
+
+rtl::Reference<ChartType> HistogramChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector<rtl::Reference<ChartType>>& aFormerlyUsedChartTypes)
+{
+ rtl::Reference<ChartType> xResult(getChartTypeForIndex(0));
+ ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem(aFormerlyUsedChartTypes, xResult);
+ return xResult;
+}
+
+// ____ OPropertySet ____
+void HistogramChartTypeTemplate::GetDefaultValue(sal_Int32 nHandle, uno::Any& rAny) const
+{
+ static ::chart::tPropertyValueMap aStaticDefaults = []() {
+ ::chart::tPropertyValueMap aTmp;
+ ::chart::PropertyHelper::setPropertyValueDefault<sal_Int32>(
+ aTmp, PROP_HISTOGRAM_TEMPLATE_DIMENSION, 2);
+ return aTmp;
+ }();
+ tPropertyValueMap::const_iterator aFound(aStaticDefaults.find(nHandle));
+ if (aFound == aStaticDefaults.end())
+ rAny.clear();
+ else
+ rAny = (*aFound).second;
+}
+
+::cppu::IPropertyArrayHelper& SAL_CALL HistogramChartTypeTemplate::getInfoHelper()
+{
+ return StaticHistogramChartTypeTemplateInfoHelper();
+}
+
+// ____ XPropertySet ____
+Reference<beans::XPropertySetInfo> SAL_CALL HistogramChartTypeTemplate::getPropertySetInfo()
+{
+ static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(
+ StaticHistogramChartTypeTemplateInfoHelper()));
+ return xPropertySetInfo;
+}
+
+void HistogramChartTypeTemplate::applyStyle2(const rtl::Reference<DataSeries>& xSeries,
+ ::sal_Int32 nChartTypeIndex, ::sal_Int32 nSeriesIndex,
+ ::sal_Int32 nSeriesCount)
+{
+ ChartTypeTemplate::applyStyle2(xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount);
+ xSeries->setPropertyAlsoToAllAttributedDataPoints("BorderStyle",
+ uno::Any(drawing::LineStyle_NONE));
+}
+
+void HistogramChartTypeTemplate::resetStyles2(const rtl::Reference<::chart::Diagram>& xDiagram)
+{
+ ChartTypeTemplate::resetStyles2(xDiagram);
+ std::vector<rtl::Reference<DataSeries>> aSeriesVec(xDiagram->getDataSeries());
+ uno::Any aLineStyleAny(drawing::LineStyle_NONE);
+ for (auto const& series : aSeriesVec)
+ {
+ if (series->getPropertyValue("BorderStyle") == aLineStyleAny)
+ {
+ series->setPropertyToDefault("BorderStyle");
+ }
+ }
+
+ xDiagram->setVertical(false);
+}
+
+rtl::Reference<DataInterpreter> HistogramChartTypeTemplate::getDataInterpreter2()
+{
+ if (!m_xDataInterpreter.is())
+ m_xDataInterpreter.set(new HistogramDataInterpreter);
+
+ return m_xDataInterpreter;
+}
+
+IMPLEMENT_FORWARD_XINTERFACE2(HistogramChartTypeTemplate, ChartTypeTemplate, OPropertySet)
+IMPLEMENT_FORWARD_XTYPEPROVIDER2(HistogramChartTypeTemplate, ChartTypeTemplate, OPropertySet)
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/model/template/HistogramChartTypeTemplate.hxx b/chart2/source/model/template/HistogramChartTypeTemplate.hxx
new file mode 100644
index 000000000000..519292f6107f
--- /dev/null
+++ b/chart2/source/model/template/HistogramChartTypeTemplate.hxx
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 <OPropertySet.hxx>
+#include <comphelper/uno3.hxx>
+
+#include <ChartTypeTemplate.hxx>
+#include <StackMode.hxx>
+
+namespace chart
+{
+class HistogramChartTypeTemplate : public ChartTypeTemplate, public ::property::OPropertySet
+{
+public:
+ explicit HistogramChartTypeTemplate(
+ css::uno::Reference<css::uno::XComponentContext> const& xContext,
+ const OUString& rServiceName, StackMode eStackMode);
+
+ /// merge XInterface implementations
+ DECLARE_XINTERFACE()
+ /// merge XTypeProvider implementations
+ DECLARE_XTYPEPROVIDER()
+
+protected:
+ // ____ OPropertySet ____
+ virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any& rAny) const override;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+
+ // ____ XPropertySet ____
+ virtual css::uno::Reference<css::beans::XPropertySetInfo>
+ SAL_CALL getPropertySetInfo() override;
+
+ // ____ ChartTypeTemplate ____
+ virtual rtl::Reference<::chart::ChartType> getChartTypeForNewSeries2(
+ const std::vector<rtl::Reference<::chart::ChartType>>& aFormerlyUsedChartTypes) override;
+
+ virtual sal_Bool SAL_CALL supportsCategories() override { return true; }
+
+ virtual void applyStyle2(const rtl::Reference<::chart::DataSeries>& xSeries,
+ ::sal_Int32 nChartTypeGroupIndex, ::sal_Int32 nSeriesIndex,
+ ::sal_Int32 nSeriesCount) override;
+
+ virtual void resetStyles2(const rtl::Reference<::chart::Diagram>& xDiagram) override;
+
+ virtual rtl::Reference<::chart::ChartType>
+ getChartTypeForIndex(sal_Int32 nChartTypeIndex) override;
+
+ virtual sal_Int32 getDimension() const override;
+ virtual StackMode getStackMode(sal_Int32 nChartTypeIndex) const override;
+
+ rtl::Reference<chart::DataInterpreter> getDataInterpreter2() override;
+
+private:
+ StackMode m_eStackMode;
+ sal_Int32 m_nDim;
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/model/template/HistogramDataInterpreter.cxx b/chart2/source/model/template/HistogramDataInterpreter.cxx
new file mode 100644
index 000000000000..c78f3b298b33
--- /dev/null
+++ b/chart2/source/model/template/HistogramDataInterpreter.cxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 <sal/config.h>
+
+#include "HistogramDataInterpreter.hxx"
+#include <HistogramDataSequence.hxx>
+#include "HistogramCalculator.hxx"
+#include <LabeledDataSequence.hxx>
+
+#include <DataSeries.hxx>
+#include <DataSeriesHelper.hxx>
+#include <CommonConverters.hxx>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <comphelper/diagnose_ex.hxx>
+#include <sal/log.hxx>
+
+using namespace css;
+
+namespace chart
+{
+InterpretedData HistogramDataInterpreter::interpretDataSource(
+ const uno::Reference<chart2::data::XDataSource>& xSource,
+ const uno::Sequence<beans::PropertyValue>& aArguments,
+ const std::vector<rtl::Reference<DataSeries>>& aSeriesToReUse)
+{
+ if (!xSource.is())
+ return InterpretedData();
+
+ InterpretedData aInterpretedData(
+ DataInterpreter::interpretDataSource(xSource, aArguments, aSeriesToReUse));
+
+ std::vector<uno::Reference<chart2::data::XLabeledDataSequence>> aData
+ = DataInterpreter::getDataSequences(xSource);
+
+ if (aData.empty() || !aData[0].is())
+ return InterpretedData();
+
+ SetRole(aData[0]->getValues(), u"values-y-original"_ustr);
+
+ return aInterpretedData;
+}
+
+InterpretedData
+HistogramDataInterpreter::reinterpretDataSeries(const InterpretedData& rInterpretedData)
+{
+ return rInterpretedData;
+}
+
+bool HistogramDataInterpreter::isDataCompatible(const InterpretedData& /*aInterpretedData*/)
+{
+ return false;
+}
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/model/template/HistogramDataInterpreter.hxx b/chart2/source/model/template/HistogramDataInterpreter.hxx
new file mode 100644
index 000000000000..9d90e0f2512a
--- /dev/null
+++ b/chart2/source/model/template/HistogramDataInterpreter.hxx
@@ -0,0 +1,35 @@
+/* -*- 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 <DataInterpreter.hxx>
+
+namespace chart
+{
+class HistogramDataInterpreter : public DataInterpreter
+{
+public:
+ explicit HistogramDataInterpreter() = default;
+
+protected:
+ // ____ DataInterpreter ____
+ virtual InterpretedData interpretDataSource(
+ const css::uno::Reference<css::chart2::data::XDataSource>& xSource,
+ const css::uno::Sequence<css::beans::PropertyValue>& aArguments,
+ const std::vector<rtl::Reference<::chart::DataSeries>>& aSeriesToReUse) override;
+
+ virtual InterpretedData reinterpretDataSeries(const InterpretedData& aInterpretedData) override;
+
+ virtual bool isDataCompatible(const InterpretedData& aInterpretedData) override;
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/LineChartType.cxx b/chart2/source/model/template/LineChartType.cxx
index f0d595f27102..4d75a029b944 100644
--- a/chart2/source/model/template/LineChartType.cxx
+++ b/chart2/source/model/template/LineChartType.cxx
@@ -43,90 +43,59 @@ enum
PROP_LINECHARTTYPE_SPLINE_ORDER
};
-void lcl_AddPropertiesToVector(
- std::vector< Property > & rOutProperties )
+::chart::tPropertyValueMap& StaticLineChartTypeDefaults()
+{
+ static ::chart::tPropertyValueMap aStaticDefaults =
+ []()
+ {
+ ::chart::tPropertyValueMap aOutMap;
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_LINECHARTTYPE_CURVE_STYLE, ::chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_LINECHARTTYPE_CURVE_RESOLUTION, 20 );
+
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_LINECHARTTYPE_SPLINE_ORDER, 3 );
+ return aOutMap;
+ }();
+ return aStaticDefaults;
+}
+
+::cppu::OPropertyArrayHelper& StaticLineChartTypeInfoHelper()
{
- rOutProperties.emplace_back( CHART_UNONAME_CURVE_STYLE,
+ static ::cppu::OPropertyArrayHelper aPropHelper(
+ []()
+ {
+ std::vector< css::beans::Property > aProperties {
+ { CHART_UNONAME_CURVE_STYLE,
PROP_LINECHARTTYPE_CURVE_STYLE,
cppu::UnoType<chart2::CurveStyle>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
-
- rOutProperties.emplace_back( CHART_UNONAME_CURVE_RESOLUTION,
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { CHART_UNONAME_CURVE_RESOLUTION,
PROP_LINECHARTTYPE_CURVE_RESOLUTION,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( CHART_UNONAME_SPLINE_ORDER,
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { CHART_UNONAME_SPLINE_ORDER,
PROP_LINECHARTTYPE_SPLINE_ORDER,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
-}
-
-struct StaticLineChartTypeDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_CURVE_STYLE, ::chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_CURVE_RESOLUTION, 20 );
-
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_SPLINE_ORDER, 3 );
- }
-};
-
-struct StaticLineChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticLineChartTypeDefaults_Initializer >
-{
-};
-
-struct StaticLineChartTypeInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
+ | beans::PropertyAttribute::MAYBEDEFAULT } };
- return comphelper::containerToSequence( aProperties );
- }
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-};
-
-struct StaticLineChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticLineChartTypeInfoHelper_Initializer >
-{
-};
-
-struct StaticLineChartTypeInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticLineChartTypeInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ return comphelper::containerToSequence( aProperties );
+ }());
+ return aPropHelper;
+}
-struct StaticLineChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLineChartTypeInfo_Initializer >
+uno::Reference< beans::XPropertySetInfo >& StaticLineChartTypeInfo()
{
-};
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticLineChartTypeInfoHelper() ) );
+ return xPropertySetInfo;
+}
} // anonymous namespace
@@ -151,6 +120,11 @@ uno::Reference< util::XCloneable > SAL_CALL LineChartType::createClone()
return uno::Reference< util::XCloneable >( new LineChartType( *this ));
}
+rtl::Reference< ChartType > LineChartType::cloneChartType() const
+{
+ return new LineChartType( *this );
+}
+
// ____ XChartType ____
OUString SAL_CALL LineChartType::getChartType()
{
@@ -160,7 +134,7 @@ OUString SAL_CALL LineChartType::getChartType()
// ____ OPropertySet ____
void LineChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticLineChartTypeDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticLineChartTypeDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -170,18 +144,18 @@ void LineChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
::cppu::IPropertyArrayHelper & SAL_CALL LineChartType::getInfoHelper()
{
- return *StaticLineChartTypeInfoHelper::get();
+ return StaticLineChartTypeInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL LineChartType::getPropertySetInfo()
{
- return *StaticLineChartTypeInfo::get();
+ return StaticLineChartTypeInfo();
}
OUString SAL_CALL LineChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.LineChartType";
+ return u"com.sun.star.comp.chart.LineChartType"_ustr;
}
sal_Bool SAL_CALL LineChartType::supportsService( const OUString& rServiceName )
@@ -193,8 +167,8 @@ css::uno::Sequence< OUString > SAL_CALL LineChartType::getSupportedServiceNames(
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_LINE,
- "com.sun.star.chart2.ChartType",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.ChartType"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/LineChartType.hxx b/chart2/source/model/template/LineChartType.hxx
index a655670d852e..4c44cca9c349 100644
--- a/chart2/source/model/template/LineChartType.hxx
+++ b/chart2/source/model/template/LineChartType.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
namespace chart
{
@@ -36,6 +36,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit LineChartType( const LineChartType & rOther );
diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx
index bbde1bebc3f1..816ae23c4dc7 100644
--- a/chart2/source/model/template/LineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/LineChartTypeTemplate.cxx
@@ -18,10 +18,12 @@
*/
#include "LineChartTypeTemplate.hxx"
-#include <DiagramHelper.hxx>
-#include <servicenames_charttypes.hxx>
+#include "LineChartType.hxx"
+#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <PropertyHelper.hxx>
+#include <ChartType.hxx>
#include <unonames.hxx>
#include <com/sun/star/chart2/CurveStyle.hpp>
@@ -30,8 +32,7 @@
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
@@ -52,89 +53,58 @@ enum
};
-void lcl_AddPropertiesToVector(
- std::vector< Property > & rOutProperties )
+::chart::tPropertyValueMap& StaticLineChartTypeTemplateDefaults()
{
- rOutProperties.emplace_back( CHART_UNONAME_CURVE_STYLE,
+ static ::chart::tPropertyValueMap aStaticDefaults =
+ []()
+ {
+ ::chart::tPropertyValueMap aOutMap;
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
+
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
+ return aOutMap;
+ }();
+ return aStaticDefaults;
+}
+
+::cppu::OPropertyArrayHelper& StaticLineChartTypeTemplateInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper aPropHelper(
+ []()
+ {
+ std::vector< css::beans::Property > aProperties {
+ { CHART_UNONAME_CURVE_STYLE,
PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE,
cppu::UnoType<chart2::CurveStyle>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( CHART_UNONAME_CURVE_RESOLUTION,
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { CHART_UNONAME_CURVE_RESOLUTION,
PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( CHART_UNONAME_SPLINE_ORDER,
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { CHART_UNONAME_SPLINE_ORDER,
PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
-}
-
-struct StaticLineChartTypeTemplateDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
-
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
- }
-};
-
-struct StaticLineChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticLineChartTypeTemplateDefaults_Initializer >
-{
-};
-
-struct StaticLineChartTypeTemplateInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
+ | beans::PropertyAttribute::MAYBEDEFAULT } };
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticLineChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticLineChartTypeTemplateInfoHelper_Initializer >
-{
-};
-
-struct StaticLineChartTypeTemplateInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticLineChartTypeTemplateInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ return comphelper::containerToSequence( aProperties );
+ }());
+ return aPropHelper;
+}
-struct StaticLineChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLineChartTypeTemplateInfo_Initializer >
+uno::Reference< beans::XPropertySetInfo >& StaticLineChartTypeTemplateInfo()
{
-};
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticLineChartTypeTemplateInfoHelper() ) );
+ return xPropertySetInfo;
+}
} // anonymous namespace
@@ -150,7 +120,6 @@ LineChartTypeTemplate::LineChartTypeTemplate(
bool bHasLines /* = true */,
sal_Int32 nDim /* = 2 */ ) :
ChartTypeTemplate( xContext, rServiceName ),
- ::property::OPropertySet( m_aMutex ),
m_eStackMode( eStackMode ),
m_bHasSymbols( bSymbols ),
m_bHasLines( bHasLines ),
@@ -166,7 +135,7 @@ LineChartTypeTemplate::~LineChartTypeTemplate()
// ____ OPropertySet ____
void LineChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticLineChartTypeTemplateDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticLineChartTypeTemplateDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -176,13 +145,13 @@ void LineChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
::cppu::IPropertyArrayHelper & SAL_CALL LineChartTypeTemplate::getInfoHelper()
{
- return *StaticLineChartTypeTemplateInfoHelper::get();
+ return StaticLineChartTypeTemplateInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL LineChartTypeTemplate::getPropertySetInfo()
{
- return *StaticLineChartTypeTemplateInfo::get();
+ return StaticLineChartTypeTemplateInfo();
}
sal_Int32 LineChartTypeTemplate::getDimension() const
@@ -195,12 +164,12 @@ StackMode LineChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ )
return m_eStackMode;
}
-// ____ XChartTypeTemplate ____
-sal_Bool SAL_CALL LineChartTypeTemplate::matchesTemplate(
- const uno::Reference< chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties )
+// ____ ChartTypeTemplate ____
+bool LineChartTypeTemplate::matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties )
{
- bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties );
+ bool bResult = ChartTypeTemplate::matchesTemplate2( xDiagram, bAdaptProperties );
// check symbol-style and line-style
// for a template with symbols (or with lines) it is ok, if there is at least one series
@@ -210,8 +179,8 @@ sal_Bool SAL_CALL LineChartTypeTemplate::matchesTemplate(
bool bSymbolFound = false;
bool bLineFound = false;
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec =
+ xDiagram->getDataSeries();
for (auto const& series : aSeriesVec)
{
@@ -219,9 +188,8 @@ sal_Bool SAL_CALL LineChartTypeTemplate::matchesTemplate(
{
chart2::Symbol aSymbProp;
drawing::LineStyle eLineStyle;
- Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY_THROW);
- bool bCurrentHasSymbol = (xProp->getPropertyValue( "Symbol") >>= aSymbProp) &&
+ bool bCurrentHasSymbol = (series->getPropertyValue( u"Symbol"_ustr) >>= aSymbProp) &&
(aSymbProp.Style != chart2::SymbolStyle_NONE);
if( bCurrentHasSymbol )
@@ -233,7 +201,7 @@ sal_Bool SAL_CALL LineChartTypeTemplate::matchesTemplate(
break;
}
- bool bCurrentHasLine = (xProp->getPropertyValue( "LineStyle") >>= eLineStyle) &&
+ bool bCurrentHasLine = (series->getPropertyValue( u"LineStyle"_ustr) >>= eLineStyle) &&
( eLineStyle != drawing::LineStyle_NONE );
if( bCurrentHasLine )
@@ -267,12 +235,10 @@ sal_Bool SAL_CALL LineChartTypeTemplate::matchesTemplate(
{
try
{
- uno::Reference< beans::XPropertySet > xChartTypeProp(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ),
- uno::UNO_QUERY_THROW );
- setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, xChartTypeProp->getPropertyValue(CHART_UNONAME_CURVE_STYLE) );
- setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, xChartTypeProp->getPropertyValue(CHART_UNONAME_CURVE_RESOLUTION) );
- setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, xChartTypeProp->getPropertyValue(CHART_UNONAME_SPLINE_ORDER) );
+ rtl::Reference< ChartType > xChartType = xDiagram->getChartTypeByIndex( 0 );
+ setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, xChartType->getPropertyValue(CHART_UNONAME_CURVE_STYLE) );
+ setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, xChartType->getPropertyValue(CHART_UNONAME_CURVE_RESOLUTION) );
+ setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, xChartType->getPropertyValue(CHART_UNONAME_SPLINE_ORDER) );
}
catch( const uno::Exception & )
{
@@ -283,27 +249,20 @@ sal_Bool SAL_CALL LineChartTypeTemplate::matchesTemplate(
return bResult;
}
-Reference< chart2::XChartType > LineChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+rtl::Reference< ChartType > LineChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY_THROW );
-
- Reference< beans::XPropertySet > xCTProp( xResult, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- xCTProp->setPropertyValue(
- CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
- xCTProp->setPropertyValue(
- CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
- xCTProp->setPropertyValue(
- CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
- }
+ xResult = new LineChartType();
+
+ xResult->setPropertyValue(
+ CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
+ xResult->setPropertyValue(
+ CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
+ xResult->setPropertyValue(
+ CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
}
catch( const uno::Exception & )
{
@@ -313,30 +272,23 @@ Reference< chart2::XChartType > LineChartTypeTemplate::getChartTypeForIndex( sal
return xResult;
}
-Reference< chart2::XChartType > SAL_CALL LineChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > LineChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY_THROW );
+ xResult = new LineChartType();
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
- Reference< beans::XPropertySet > xCTProp( xResult, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- xCTProp->setPropertyValue(
- CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
- xCTProp->setPropertyValue(
- CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
- xCTProp->setPropertyValue(
- CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
- }
+ xResult->setPropertyValue(
+ CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
+ xResult->setPropertyValue(
+ CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
+ xResult->setPropertyValue(
+ CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
}
catch( const uno::Exception & )
{
@@ -346,21 +298,19 @@ Reference< chart2::XChartType > SAL_CALL LineChartTypeTemplate::getChartTypeForN
return xResult;
}
-void SAL_CALL LineChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void LineChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
try
{
- Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY_THROW );
-
- DataSeriesHelper::switchSymbolsOnOrOff( xProp, m_bHasSymbols, nSeriesIndex );
- DataSeriesHelper::switchLinesOnOrOff( xProp, m_bHasLines );
- DataSeriesHelper::makeLinesThickOrThin( xProp, m_nDim==2 );
+ xSeries->switchSymbolsOnOrOff( m_bHasSymbols, nSeriesIndex );
+ xSeries->switchLinesOnOrOff( m_bHasLines );
+ xSeries->makeLinesThickOrThin( m_nDim==2 );
}
catch( const uno::Exception & )
{
diff --git a/chart2/source/model/template/LineChartTypeTemplate.hxx b/chart2/source/model/template/LineChartTypeTemplate.hxx
index 84d87a32185c..a634fb390aae 100644
--- a/chart2/source/model/template/LineChartTypeTemplate.hxx
+++ b/chart2/source/model/template/LineChartTypeTemplate.hxx
@@ -20,7 +20,6 @@
#include <ChartTypeTemplate.hxx>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <StackMode.hxx>
#include <comphelper/uno3.hxx>
@@ -28,7 +27,6 @@ namespace chart
{
class LineChartTypeTemplate :
- public cppu::BaseMutex,
public ChartTypeTemplate,
public ::property::OPropertySet
{
@@ -56,20 +54,19 @@ protected:
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
- // ____ XChartTypeTemplate ____
- virtual sal_Bool SAL_CALL matchesTemplate(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties ) override;
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ // ____ ChartTypeTemplate ____
+ virtual bool matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties ) override;
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeGroupIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
-
- // ____ ChartTypeTemplate ____
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
virtual sal_Int32 getDimension() const override;
virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const override;
diff --git a/chart2/source/model/template/NetChartType.cxx b/chart2/source/model/template/NetChartType.cxx
index 8aecbec7b60c..b1bed1b605ca 100644
--- a/chart2/source/model/template/NetChartType.cxx
+++ b/chart2/source/model/template/NetChartType.cxx
@@ -22,6 +22,7 @@
#include <servicenames_charttypes.hxx>
#include <AxisIndexDefines.hxx>
#include <AxisHelper.hxx>
+#include <Axis.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
@@ -47,18 +48,18 @@ NetChartType_Base::NetChartType_Base( const NetChartType_Base & rOther ) :
NetChartType_Base::~NetChartType_Base()
{}
-Reference< XCoordinateSystem > SAL_CALL
- NetChartType_Base::createCoordinateSystem( ::sal_Int32 DimensionCount )
+rtl::Reference< ::chart::BaseCoordinateSystem >
+ NetChartType_Base::createCoordinateSystem2( sal_Int32 DimensionCount )
{
if( DimensionCount != 2 )
throw lang::IllegalArgumentException(
- "NetChart must be two-dimensional",
+ u"NetChart must be two-dimensional"_ustr,
static_cast< ::cppu::OWeakObject* >( this ), 0 );
rtl::Reference< PolarCoordinateSystem > xResult =
new PolarCoordinateSystem( DimensionCount );
- Reference< XAxis > xAxis( xResult->getAxisByDimension( 0, MAIN_AXIS_INDEX ) );
+ rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( 0, MAIN_AXIS_INDEX );
if( xAxis.is() )
{
ScaleData aScaleData = xAxis->getScaleData();
@@ -68,7 +69,7 @@ Reference< XCoordinateSystem > SAL_CALL
xAxis->setScaleData( aScaleData );
}
- xAxis = xResult->getAxisByDimension( 1, MAIN_AXIS_INDEX );
+ xAxis = xResult->getAxisByDimension2( 1, MAIN_AXIS_INDEX );
if( xAxis.is() )
{
ScaleData aScaleData = xAxis->getScaleData();
@@ -89,45 +90,31 @@ void NetChartType_Base::GetDefaultValue( sal_Int32 /*nHandle*/, uno::Any& rAny )
namespace
{
-struct StaticNetChartTypeInfoHelper_Initializer
+::cppu::OPropertyArrayHelper& StaticNetChartTypeInfoHelper()
{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper(Sequence< beans::Property >{});
- return &aPropHelper;
- }
-};
-
-struct StaticNetChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticNetChartTypeInfoHelper_Initializer >
-{
-};
-
-struct StaticNetChartTypeInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticNetChartTypeInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper(Sequence< beans::Property >{});
+ return aPropHelper;
+}
-struct StaticNetChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticNetChartTypeInfo_Initializer >
+uno::Reference< beans::XPropertySetInfo >& StaticNetChartTypeInfo()
{
-};
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticNetChartTypeInfoHelper() ) );
+ return xPropertySetInfo;
+}
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL NetChartType_Base::getInfoHelper()
{
- return *StaticNetChartTypeInfoHelper::get();
+ return StaticNetChartTypeInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL NetChartType_Base::getPropertySetInfo()
{
- return *StaticNetChartTypeInfo::get();
+ return StaticNetChartTypeInfo();
}
NetChartType::NetChartType()
@@ -147,6 +134,11 @@ uno::Reference< util::XCloneable > SAL_CALL NetChartType::createClone()
return uno::Reference< util::XCloneable >( new NetChartType( *this ));
}
+rtl::Reference< ChartType > NetChartType::cloneChartType() const
+{
+ return new NetChartType( *this );
+}
+
// ____ XChartType ____
OUString SAL_CALL NetChartType::getChartType()
{
@@ -155,7 +147,7 @@ OUString SAL_CALL NetChartType::getChartType()
OUString SAL_CALL NetChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.NetChartType";
+ return u"com.sun.star.comp.chart.NetChartType"_ustr;
}
sal_Bool SAL_CALL NetChartType::supportsService( const OUString& rServiceName )
@@ -167,8 +159,8 @@ css::uno::Sequence< OUString > SAL_CALL NetChartType::getSupportedServiceNames()
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_NET,
- "com.sun.star.chart2.ChartType",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.ChartType"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/NetChartType.hxx b/chart2/source/model/template/NetChartType.hxx
index 7f1c16d60dd8..ae414a27c4e1 100644
--- a/chart2/source/model/template/NetChartType.hxx
+++ b/chart2/source/model/template/NetChartType.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
namespace chart
{
@@ -32,10 +32,6 @@ public:
protected:
explicit NetChartType_Base( const NetChartType_Base & rOther );
- // ____ XChartType ____
- virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
- createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
-
// ____ OPropertySet ____
virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
@@ -44,6 +40,9 @@ protected:
// ____ XPropertySet ____
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
+
+ virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+ createCoordinateSystem2( sal_Int32 DimensionCount ) override;
};
class NetChartType final : public NetChartType_Base
@@ -59,6 +58,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit NetChartType( const NetChartType & rOther );
diff --git a/chart2/source/model/template/NetChartTypeTemplate.cxx b/chart2/source/model/template/NetChartTypeTemplate.cxx
index fed499cb3970..07537c66b1df 100644
--- a/chart2/source/model/template/NetChartTypeTemplate.cxx
+++ b/chart2/source/model/template/NetChartTypeTemplate.cxx
@@ -18,20 +18,21 @@
*/
#include "NetChartTypeTemplate.hxx"
-#include <DiagramHelper.hxx>
-#include <servicenames_charttypes.hxx>
+#include "FilledNetChartType.hxx"
+#include "NetChartType.hxx"
+#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <ChartType.hxx>
#include <com/sun/star/chart2/SymbolStyle.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
namespace chart
{
@@ -58,21 +59,19 @@ StackMode NetChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ )
return m_eStackMode;
}
-void SAL_CALL NetChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void NetChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
try
{
- Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY_THROW );
-
- DataSeriesHelper::switchSymbolsOnOrOff( xProp, m_bHasSymbols, nSeriesIndex );
- DataSeriesHelper::switchLinesOnOrOff( xProp, m_bHasLines );
- DataSeriesHelper::makeLinesThickOrThin( xProp, true );
+ xSeries->switchSymbolsOnOrOff( m_bHasSymbols, nSeriesIndex );
+ xSeries->switchLinesOnOrOff( m_bHasLines );
+ xSeries->makeLinesThickOrThin( true );
}
catch( const uno::Exception & )
{
@@ -80,15 +79,12 @@ void SAL_CALL NetChartTypeTemplate::applyStyle(
}
}
-// ____ XChartTypeTemplate ____
-sal_Bool SAL_CALL NetChartTypeTemplate::matchesTemplate(
- const Reference< chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties )
+// ____ ChartTypeTemplate ____
+bool NetChartTypeTemplate::matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties )
{
- bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties );
-
- uno::Reference< beans::XPropertySet > xChartTypeProp(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ), uno::UNO_QUERY_THROW );
+ bool bResult = ChartTypeTemplate::matchesTemplate2( xDiagram, bAdaptProperties );
if( bResult )
{
@@ -102,8 +98,8 @@ sal_Bool SAL_CALL NetChartTypeTemplate::matchesTemplate(
bool bSymbolFound = false;
bool bLineFound = false;
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec =
+ xDiagram->getDataSeries();
for (auto const& series : aSeriesVec)
{
@@ -111,9 +107,8 @@ sal_Bool SAL_CALL NetChartTypeTemplate::matchesTemplate(
{
chart2::Symbol aSymbProp;
drawing::LineStyle eLineStyle;
- Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY_THROW);
- bool bCurrentHasSymbol = (xProp->getPropertyValue( "Symbol") >>= aSymbProp) &&
+ bool bCurrentHasSymbol = (series->getPropertyValue( u"Symbol"_ustr) >>= aSymbProp) &&
(aSymbProp.Style != chart2::SymbolStyle_NONE);
if( bCurrentHasSymbol )
@@ -125,7 +120,7 @@ sal_Bool SAL_CALL NetChartTypeTemplate::matchesTemplate(
break;
}
- bool bCurrentHasLine = (xProp->getPropertyValue( "LineStyle") >>= eLineStyle) &&
+ bool bCurrentHasLine = (series->getPropertyValue( u"LineStyle"_ustr) >>= eLineStyle) &&
( eLineStyle != drawing::LineStyle_NONE );
if( bCurrentHasLine )
@@ -157,34 +152,18 @@ sal_Bool SAL_CALL NetChartTypeTemplate::matchesTemplate(
return bResult;
}
-Reference< chart2::XChartType > NetChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+rtl::Reference< ChartType > NetChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
{
- Reference< chart2::XChartType > xResult;
-
- try
- {
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
-
- if( m_bHasFilledArea )
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET ), uno::UNO_QUERY_THROW );
- else
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_NET ), uno::UNO_QUERY_THROW );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- return xResult;
+ if( m_bHasFilledArea )
+ return new FilledNetChartType();
+ else
+ return new NetChartType();
}
-Reference< chart2::XChartType > SAL_CALL NetChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > NetChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) );
+ rtl::Reference< ChartType > xResult( getChartTypeForIndex( 0 ) );
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
return xResult;
}
diff --git a/chart2/source/model/template/NetChartTypeTemplate.hxx b/chart2/source/model/template/NetChartTypeTemplate.hxx
index ac0ee3aebf0b..b1f5ac9dbd83 100644
--- a/chart2/source/model/template/NetChartTypeTemplate.hxx
+++ b/chart2/source/model/template/NetChartTypeTemplate.hxx
@@ -38,20 +38,21 @@ public:
virtual ~NetChartTypeTemplate() override;
protected:
- // ____ XChartTypeTemplate ____
- virtual sal_Bool SAL_CALL matchesTemplate(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties ) override;
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ // ____ ChartTypeTemplate ____
+ virtual bool matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties ) override;
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeGroupIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
// ____ ChartTypeTemplate ____
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const override;
diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx
index 777fb55c316d..36f9a59d0862 100644
--- a/chart2/source/model/template/PieChartType.cxx
+++ b/chart2/source/model/template/PieChartType.cxx
@@ -20,12 +20,14 @@
#include "PieChartType.hxx"
#include <PropertyHelper.hxx>
#include <PolarCoordinateSystem.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <servicenames_charttypes.hxx>
#include <AxisIndexDefines.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
using namespace ::com::sun::star;
@@ -36,85 +38,59 @@ using ::com::sun::star::uno::Reference;
namespace
{
-enum
+::chart::tPropertyValueMap& StaticPieChartTypeDefaults()
{
- PROP_PIECHARTTYPE_USE_RINGS,
- PROP_PIECHARTTYPE_3DRELATIVEHEIGHT
-};
+ static ::chart::tPropertyValueMap aStaticDefaults =
+ []()
+ {
+ ::chart::tPropertyValueMap aOutMap;
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, ::chart::PROP_PIECHARTTYPE_USE_RINGS, false );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, ::chart::PROP_PIECHARTTYPE_3DRELATIVEHEIGHT, 100 );
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, ::chart::PROP_PIECHARTTYPE_SUBTYPE, chart2::PieChartSubType_NONE );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, ::chart::PROP_PIECHARTTYPE_SPLIT_POS, 2 );
+ return aOutMap;
+ }();
+ return aStaticDefaults;
+}
-void lcl_AddPropertiesToVector(
- std::vector< Property > & rOutProperties )
+::cppu::OPropertyArrayHelper& StaticPieChartTypeInfoHelper()
{
- rOutProperties.emplace_back( "UseRings",
- PROP_PIECHARTTYPE_USE_RINGS,
+ static ::cppu::OPropertyArrayHelper aPropHelper(
+ []()
+ {
+ std::vector< css::beans::Property > aProperties {
+ { u"UseRings"_ustr,
+ ::chart::PROP_PIECHARTTYPE_USE_RINGS,
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "3DRelativeHeight",
- PROP_PIECHARTTYPE_3DRELATIVEHEIGHT,
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { u"3DRelativeHeight"_ustr,
+ ::chart::PROP_PIECHARTTYPE_3DRELATIVEHEIGHT,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::MAYBEVOID },
+ { u"SubPieType"_ustr,
+ ::chart::PROP_PIECHARTTYPE_SUBTYPE,
+ cppu::UnoType<chart2::PieChartSubType>::get(),
+ beans::PropertyAttribute::MAYBEDEFAULT },
+ { u"SplitPos"_ustr,
+ ::chart::PROP_PIECHARTTYPE_SPLIT_POS,
cppu::UnoType<sal_Int32>::get(),
- beans::PropertyAttribute::MAYBEVOID );
+ beans::PropertyAttribute::MAYBEVOID }
+ };
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+
+ return comphelper::containerToSequence( aProperties );
+ }());
+ return aPropHelper;
}
-struct StaticPieChartTypeDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIECHARTTYPE_USE_RINGS, false );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_PIECHARTTYPE_3DRELATIVEHEIGHT, 100 );
- }
-};
-
-struct StaticPieChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticPieChartTypeDefaults_Initializer >
-{
-};
-
-struct StaticPieChartTypeInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticPieChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPieChartTypeInfoHelper_Initializer >
-{
-};
-
-struct StaticPieChartTypeInfo_Initializer
+uno::Reference< beans::XPropertySetInfo >& StaticPieChartTypeInfo()
{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticPieChartTypeInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticPieChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticPieChartTypeInfo_Initializer >
-{
-};
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo( StaticPieChartTypeInfoHelper() ) );
+ return xPropertySetInfo;
+}
} // anonymous namespace
@@ -139,21 +115,26 @@ uno::Reference< util::XCloneable > SAL_CALL PieChartType::createClone()
return uno::Reference< util::XCloneable >( new PieChartType( *this ));
}
+rtl::Reference< ChartType > PieChartType::cloneChartType() const
+{
+ return new PieChartType( *this );
+}
+
// ____ XChartType ____
OUString SAL_CALL PieChartType::getChartType()
{
return CHART2_SERVICE_NAME_CHARTTYPE_PIE;
}
-Reference< chart2::XCoordinateSystem > SAL_CALL
- PieChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+rtl::Reference< ::chart::BaseCoordinateSystem >
+ PieChartType::createCoordinateSystem2( sal_Int32 DimensionCount )
{
rtl::Reference< PolarCoordinateSystem > xResult =
new PolarCoordinateSystem( DimensionCount );
for( sal_Int32 i=0; i<DimensionCount; ++i )
{
- Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) );
+ rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( i, MAIN_AXIS_INDEX );
if( !xAxis.is() )
{
OSL_FAIL("a created coordinate system should have an axis for each dimension");
@@ -182,13 +163,13 @@ Reference< chart2::XCoordinateSystem > SAL_CALL
uno::Sequence< OUString > PieChartType::getSupportedPropertyRoles()
{
- return { "FillColor", "BorderColor" };
+ return { u"FillColor"_ustr, u"BorderColor"_ustr };
}
// ____ OPropertySet ____
void PieChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticPieChartTypeDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticPieChartTypeDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -199,18 +180,18 @@ void PieChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL PieChartType::getInfoHelper()
{
- return *StaticPieChartTypeInfoHelper::get();
+ return StaticPieChartTypeInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL PieChartType::getPropertySetInfo()
{
- return *StaticPieChartTypeInfo::get();
+ return StaticPieChartTypeInfo();
}
OUString SAL_CALL PieChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.PieChartType";
+ return u"com.sun.star.comp.chart.PieChartType"_ustr;
}
sal_Bool SAL_CALL PieChartType::supportsService( const OUString& rServiceName )
@@ -222,8 +203,8 @@ css::uno::Sequence< OUString > SAL_CALL PieChartType::getSupportedServiceNames()
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_PIE,
- "com.sun.star.chart2.ChartType",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.ChartType"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/PieChartType.hxx b/chart2/source/model/template/PieChartType.hxx
index c3164d4308a6..083bd78facd3 100644
--- a/chart2/source/model/template/PieChartType.hxx
+++ b/chart2/source/model/template/PieChartType.hxx
@@ -18,7 +18,8 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
namespace chart
{
@@ -36,13 +37,13 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit PieChartType( const PieChartType & rOther );
// ____ XChartType ____
virtual OUString SAL_CALL getChartType() override;
- virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
- createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedPropertyRoles() override;
@@ -58,6 +59,9 @@ private:
// ____ XCloneable ____
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
+
+ virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+ createCoordinateSystem2( sal_Int32 DimensionCount ) override;
};
} // namespace chart
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index 218ee48ff520..25d6d9c6ffe6 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -18,28 +18,29 @@
*/
#include "PieChartTypeTemplate.hxx"
+#include "PieChartType.hxx"
+#include <BaseCoordinateSystem.hxx>
#include <CommonConverters.hxx>
-#include <DiagramHelper.hxx>
-#include <servicenames_charttypes.hxx>
+#include <ChartType.hxx>
+#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
+#include <DataSeriesProperties.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
-#include <ThreeDHelper.hxx>
#include <PropertyHelper.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <officecfg/Office/Compatibility.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <rtl/math.hxx>
#include <algorithm>
using namespace ::com::sun::star;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::beans::Property;
using ::com::sun::star::uno::Sequence;
@@ -53,95 +54,80 @@ enum
PROP_PIE_TEMPLATE_DEFAULT_OFFSET,
PROP_PIE_TEMPLATE_OFFSET_MODE,
PROP_PIE_TEMPLATE_DIMENSION,
- PROP_PIE_TEMPLATE_USE_RINGS
+ PROP_PIE_TEMPLATE_USE_RINGS,
+ PROP_PIE_TEMPLATE_SUB_PIE_TYPE,
+ PROP_PIE_TEMPLATE_SPLIT_POS
};
-void lcl_AddPropertiesToVector(
- std::vector< Property > & rOutProperties )
+::chart::tPropertyValueMap& StaticPieChartTypeTemplateDefaults()
{
- rOutProperties.emplace_back( "OffsetMode",
+ static ::chart::tPropertyValueMap aStaticDefaults =
+ []{
+ ::chart::tPropertyValueMap aOutMap;
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_PIE_TEMPLATE_OFFSET_MODE, chart2::PieChartOffsetMode_NONE );
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( aOutMap, PROP_PIE_TEMPLATE_DEFAULT_OFFSET, 0.5 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_PIE_TEMPLATE_DIMENSION, 2 );
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_PIE_TEMPLATE_USE_RINGS, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_PIE_TEMPLATE_SUB_PIE_TYPE, chart2::PieChartSubType_NONE );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >(
+ aOutMap, PROP_PIE_TEMPLATE_SPLIT_POS, 2 );
+ return aOutMap;
+ }();
+ return aStaticDefaults;
+}
+
+::cppu::OPropertyArrayHelper& StaticPieChartTypeTemplateInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper aPropHelper(
+ []()
+ {
+ std::vector< css::beans::Property > aProperties {
+ { u"OffsetMode"_ustr,
PROP_PIE_TEMPLATE_OFFSET_MODE,
cppu::UnoType<chart2::PieChartOffsetMode>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "DefaultOffset",
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { u"DefaultOffset"_ustr,
PROP_PIE_TEMPLATE_DEFAULT_OFFSET,
cppu::UnoType<double>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "Dimension",
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { u"Dimension"_ustr,
PROP_PIE_TEMPLATE_DIMENSION,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( "UseRings",
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { u"UseRings"_ustr,
PROP_PIE_TEMPLATE_USE_RINGS,
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
-}
-
-struct StaticPieChartTypeTemplateDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIE_TEMPLATE_OFFSET_MODE, chart2::PieChartOffsetMode_NONE );
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_PIE_TEMPLATE_DEFAULT_OFFSET, 0.5 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_PIE_TEMPLATE_DIMENSION, 2 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIE_TEMPLATE_USE_RINGS, false );
- }
-};
-
-struct StaticPieChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticPieChartTypeTemplateDefaults_Initializer >
-{
-};
-
-struct StaticPieChartTypeTemplateInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static uno::Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { u"SubPieType"_ustr,
+ PROP_PIE_TEMPLATE_SUB_PIE_TYPE,
+ cppu::UnoType<chart2::PieChartSubType>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { u"SplitPos"_ustr,
+ PROP_PIE_TEMPLATE_SPLIT_POS,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT }
+ };
-};
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
-struct StaticPieChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPieChartTypeTemplateInfoHelper_Initializer >
-{
-};
-
-struct StaticPieChartTypeTemplateInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticPieChartTypeTemplateInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ return comphelper::containerToSequence( aProperties );
+ }() );
+ return aPropHelper;
+}
-struct StaticPieChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticPieChartTypeTemplateInfo_Initializer >
+uno::Reference< beans::XPropertySetInfo >& StaticPieChartTypeTemplateInfo()
{
-};
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticPieChartTypeTemplateInfoHelper() ) );
+ return xPropertySetInfo;
+}
} // anonymous namespace
@@ -153,14 +139,17 @@ PieChartTypeTemplate::PieChartTypeTemplate(
uno::XComponentContext > const & xContext,
const OUString & rServiceName,
chart2::PieChartOffsetMode eMode,
- bool bRings /* = false */,
+ bool bRings,
+ chart2::PieChartSubType eSubType,
+ sal_Int32 nCompositeSize,
sal_Int32 nDim /* = 2 */ ) :
- ChartTypeTemplate( xContext, rServiceName ),
- ::property::OPropertySet( m_aMutex )
+ ChartTypeTemplate( xContext, rServiceName )
{
setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_OFFSET_MODE, uno::Any( eMode ));
setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_DIMENSION, uno::Any( nDim ));
setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_USE_RINGS, uno::Any( bRings ));
+ setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_SUB_PIE_TYPE, uno::Any( eSubType ));
+ setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_SPLIT_POS, uno::Any( nCompositeSize ));
}
PieChartTypeTemplate::~PieChartTypeTemplate()
@@ -169,7 +158,7 @@ PieChartTypeTemplate::~PieChartTypeTemplate()
// ____ OPropertySet ____
void PieChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticPieChartTypeTemplateDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticPieChartTypeTemplateDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -179,13 +168,13 @@ void PieChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny )
::cppu::IPropertyArrayHelper & SAL_CALL PieChartTypeTemplate::getInfoHelper()
{
- return *StaticPieChartTypeTemplateInfoHelper::get();
+ return StaticPieChartTypeTemplateInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL PieChartTypeTemplate::getPropertySetInfo()
{
- return *StaticPieChartTypeTemplateInfo::get();
+ return StaticPieChartTypeTemplateInfo();
}
// ____ ChartTypeTemplate ____
@@ -212,14 +201,14 @@ sal_Int32 PieChartTypeTemplate::getAxisCountByDimension( sal_Int32 /*nDimension*
}
void PieChartTypeTemplate::adaptAxes(
- const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > & /*rCoordSys*/ )
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & /*rCoordSys*/ )
{
// hide existing axes
//hhhh todo
}
void PieChartTypeTemplate::adaptScales(
- const Sequence< Reference< chart2::XCoordinateSystem > > & aCooSysSeq,
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysSeq,
const Reference< chart2::data::XLabeledDataSequence > & xCategories //@todo: in future there may be more than one sequence of categories (e.g. charttype with categories at x and y axis )
)
{
@@ -228,12 +217,12 @@ void PieChartTypeTemplate::adaptScales(
//remove explicit scalings from radius axis
//and ensure correct orientation of scales for donuts
- for( Reference< chart2::XCoordinateSystem > const & coords : aCooSysSeq )
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : aCooSysSeq )
{
try
{
- Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 1 /*nDimensionIndex*/,0 /*nAxisIndex*/
- , coords ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 1 /*nDimensionIndex*/,0 /*nAxisIndex*/
+ , coords );
if( xAxis.is() )
{
chart2::ScaleData aScaleData( xAxis->getScaleData() );
@@ -272,35 +261,29 @@ void PieChartTypeTemplate::adaptScales(
}
void PieChartTypeTemplate::createChartTypes(
- const Sequence< Sequence< Reference< chart2::XDataSeries > > > & aSeriesSeq,
- const Sequence< Reference< chart2::XCoordinateSystem > > & rCoordSys,
- const Sequence< Reference< chart2::XChartType > >& /* aOldChartTypesSeq */ )
+ const std::vector< std::vector< rtl::Reference< DataSeries > > > & aSeriesSeq,
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & rCoordSys,
+ const std::vector< rtl::Reference< ChartType > >& /* aOldChartTypesSeq */ )
{
- if( ! rCoordSys.hasElements() ||
- ! rCoordSys[0].is() )
+ if( rCoordSys.empty() )
return;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
-
- Reference< chart2::XChartType > xCT(
- xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_PIE ), uno::UNO_QUERY_THROW );
- Reference< beans::XPropertySet > xCTProp( xCT, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- xCTProp->setPropertyValue(
- "UseRings", getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS ));
- }
- Reference< chart2::XChartTypeContainer > xCTCnt( rCoordSys[0], uno::UNO_QUERY_THROW );
- xCTCnt->setChartTypes( Sequence< Reference< chart2::XChartType > >( &xCT, 1 ));
-
- if( aSeriesSeq.hasElements() )
+ rtl::Reference< ChartType > xCT = new PieChartType();
+ xCT->setFastPropertyValue(
+ PROP_PIECHARTTYPE_USE_RINGS, getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS )); // "UseRings"
+ xCT->setFastPropertyValue(
+ PROP_PIECHARTTYPE_SUBTYPE, getFastPropertyValue( PROP_PIE_TEMPLATE_SUB_PIE_TYPE )); // "SubType"
+ xCT->setFastPropertyValue(
+ PROP_PIECHARTTYPE_SPLIT_POS, getFastPropertyValue(
+ PROP_PIE_TEMPLATE_SPLIT_POS )); // "CompositeSize"
+ rCoordSys[0]->setChartTypes( std::vector{xCT} );
+
+ if( !aSeriesSeq.empty() )
{
- Reference< chart2::XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
- Sequence< Reference< chart2::XDataSeries > > aFlatSeriesSeq( FlattenSequence( aSeriesSeq ));
- xDSCnt->setDataSeries( aFlatSeriesSeq );
+ std::vector< rtl::Reference< DataSeries > > aFlatSeriesSeq = FlattenSequence( aSeriesSeq );
+ xCT->setDataSeries( aFlatSeriesSeq );
DataSeriesHelper::setStackModeAtSeries(
aFlatSeriesSeq, rCoordSys[0], getStackMode( 0 ));
@@ -313,16 +296,18 @@ void PieChartTypeTemplate::createChartTypes(
}
// ____ XChartTypeTemplate ____
-sal_Bool SAL_CALL PieChartTypeTemplate::matchesTemplate(
- const uno::Reference< chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties )
+bool PieChartTypeTemplate::matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties )
{
- bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties );
+ bool bResult = ChartTypeTemplate::matchesTemplate2( xDiagram, bAdaptProperties );
bool bTemplateUsesRings = false;
getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS ) >>= bTemplateUsesRings;
chart2::PieChartOffsetMode ePieOffsetMode;
getFastPropertyValue( PROP_PIE_TEMPLATE_OFFSET_MODE ) >>= ePieOffsetMode;
+ chart2::PieChartSubType eTemplateSubType;
+ getFastPropertyValue( PROP_PIE_TEMPLATE_SUB_PIE_TYPE ) >>= eTemplateSubType;
//check offset-mode
if( bResult )
@@ -333,8 +318,8 @@ sal_Bool SAL_CALL PieChartTypeTemplate::matchesTemplate(
bool bAllOffsetsEqual = true;
sal_Int32 nOuterSeriesIndex = 0;
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec =
+ xDiagram->getDataSeries();
//tdf#108067 The outer series is the last series in OOXML-heavy environments
if( !officecfg::Office::Compatibility::View::ReverseXAxisOrientationDoughnutChart::get() )
@@ -344,13 +329,12 @@ sal_Bool SAL_CALL PieChartTypeTemplate::matchesTemplate(
if( !aSeriesVec.empty() )
{
//@todo in future this will depend on Orientation of the radius axis scale
- Reference< chart2::XDataSeries > xSeries( aSeriesVec[nOuterSeriesIndex] );
- Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY_THROW );
- xProp->getPropertyValue( "Offset") >>= fOffset;
+ const rtl::Reference< DataSeries >& xSeries( aSeriesVec[nOuterSeriesIndex] );
+ xSeries->getPropertyValue( u"Offset"_ustr) >>= fOffset;
- //get AttributedDataPoints
+ // "AttributedDataPoints"
uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xProp->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
+ if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList )
{
for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
{
@@ -358,7 +342,7 @@ sal_Bool SAL_CALL PieChartTypeTemplate::matchesTemplate(
if(xPointProp.is())
{
double fPointOffset=0.0;
- if( xProp->getPropertyValue( "Offset") >>= fPointOffset )
+ if( xSeries->getPropertyValue( u"Offset"_ustr) >>= fPointOffset )
{
if( ! ::rtl::math::approxEqual( fPointOffset, fOffset ) )
{
@@ -391,35 +375,37 @@ sal_Bool SAL_CALL PieChartTypeTemplate::matchesTemplate(
//check UseRings
if( bResult )
{
- uno::Reference< beans::XPropertySet > xCTProp(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ), uno::UNO_QUERY_THROW );
+ rtl::Reference< ChartType > xCTProp = xDiagram->getChartTypeByIndex( 0 );
bool bUseRings = false;
- if( xCTProp->getPropertyValue( "UseRings") >>= bUseRings )
+ if( xCTProp->getFastPropertyValue( PROP_PIECHARTTYPE_USE_RINGS ) >>= bUseRings ) // "UseRings"
{
bResult = ( bTemplateUsesRings == bUseRings );
}
}
+ if( bResult )
+ {
+ rtl::Reference< ChartType > xCTProp = xDiagram->getChartTypeByIndex( 0 );
+ chart2::PieChartSubType eSubType = chart2::PieChartSubType_NONE;
+ if( xCTProp->getFastPropertyValue( PROP_PIECHARTTYPE_SUBTYPE ) >>= eSubType )
+ {
+ bResult = ( eTemplateSubType == eSubType );
+ }
+ }
return bResult;
}
-Reference< chart2::XChartType > PieChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+rtl::Reference< ChartType > PieChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_PIE ), uno::UNO_QUERY_THROW );
- Reference< beans::XPropertySet > xCTProp( xResult, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- xCTProp->setPropertyValue(
- "UseRings", getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS ));
- }
-
+ xResult = new PieChartType();
+ xResult->setFastPropertyValue(
+ PROP_PIECHARTTYPE_USE_RINGS, getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS )); // "UseRings"
+ xResult->setFastPropertyValue(
+ PROP_PIECHARTTYPE_SUBTYPE, getFastPropertyValue( PROP_PIE_TEMPLATE_SUB_PIE_TYPE ));
}
catch( const uno::Exception & )
{
@@ -429,25 +415,19 @@ Reference< chart2::XChartType > PieChartTypeTemplate::getChartTypeForIndex( sal_
return xResult;
}
-Reference< chart2::XChartType > SAL_CALL PieChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > PieChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_PIE ), uno::UNO_QUERY_THROW );
+ xResult = new PieChartType();
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
- Reference< beans::XPropertySet > xCTProp( xResult, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- xCTProp->setPropertyValue(
- "UseRings", getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS ));
- }
-
+ xResult->setFastPropertyValue(
+ PROP_PIECHARTTYPE_USE_RINGS, getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS )); // "UseRings"
+ xResult->setFastPropertyValue(
+ PROP_PIECHARTTYPE_SUBTYPE, getFastPropertyValue( PROP_PIE_TEMPLATE_SUB_PIE_TYPE ));
}
catch( const uno::Exception & )
{
@@ -457,18 +437,16 @@ Reference< chart2::XChartType > SAL_CALL PieChartTypeTemplate::getChartTypeForNe
return xResult;
}
-void SAL_CALL PieChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void PieChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
try
{
- uno::Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY_THROW );
-
bool bTemplateUsesRings = false;
sal_Int32 nOuterSeriesIndex = 0;
getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS ) >>= bTemplateUsesRings;
@@ -479,7 +457,7 @@ void SAL_CALL PieChartTypeTemplate::applyStyle(
if( nSeriesIndex == nOuterSeriesIndex ) //@todo in future this will depend on Orientation of the radius axis scale
{
- static const OUStringLiteral aOffsetPropName( u"Offset" );
+ static constexpr OUString aOffsetPropName( u"Offset"_ustr );
// get offset mode
chart2::PieChartOffsetMode ePieOffsetMode;
getFastPropertyValue( PROP_PIE_TEMPLATE_OFFSET_MODE ) >>= ePieOffsetMode;
@@ -490,7 +468,8 @@ void SAL_CALL PieChartTypeTemplate::applyStyle(
double fOffsetToSet = fDefaultOffset;
uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- xProp->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList;
+ // "AttributedDataPoints"
+ xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList;
// determine whether to set the new offset
bool bSetOffset = ( ePieOffsetMode == chart2::PieChartOffsetMode_ALL_EXPLODED );
@@ -500,12 +479,12 @@ void SAL_CALL PieChartTypeTemplate::applyStyle(
// set offset to 0 if the offset was exactly "all exploded"
// before (individual offsets are kept)
double fOffset = 0.0;
- if( (xProp->getPropertyValue( aOffsetPropName ) >>= fOffset) &&
+ if( (xSeries->getPropertyValue( aOffsetPropName ) >>= fOffset) &&
::rtl::math::approxEqual( fOffset, fDefaultOffset ))
{
fOffsetToSet = 0.0;
bSetOffset = true;
- for( auto const & pointIndex : std::as_const(aAttributedDataPointIndexList) )
+ for (auto const& pointIndex : aAttributedDataPointIndexList)
{
uno::Reference< beans::XPropertySet > xPointProp(
xSeries->getDataPointByIndex( pointIndex ));
@@ -527,10 +506,10 @@ void SAL_CALL PieChartTypeTemplate::applyStyle(
if( bSetOffset )
{
// set the offset to the series and to the attributed data points
- xProp->setPropertyValue( aOffsetPropName, uno::Any( fOffsetToSet ));
+ xSeries->setPropertyValue( aOffsetPropName, uno::Any( fOffsetToSet ));
// remove hard attributes from data points
- for( auto const & pointIndex : std::as_const(aAttributedDataPointIndexList) )
+ for (auto const& pointIndex : aAttributedDataPointIndexList)
{
uno::Reference< beans::XPropertyState > xPointState(
xSeries->getDataPointByIndex( pointIndex ), uno::UNO_QUERY );
@@ -541,10 +520,10 @@ void SAL_CALL PieChartTypeTemplate::applyStyle(
}
// line style
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", uno::Any( drawing::LineStyle_NONE ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"BorderStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
// vary colors by point
- xProp->setPropertyValue( "VaryColorsByPoint", uno::Any( true ));
+ xSeries->setFastPropertyValue( PROP_DATASERIES_VARY_COLORS_BY_POINT, uno::Any( true )); // "VaryColorsByPoint"
}
catch( const uno::Exception & )
{
@@ -552,22 +531,21 @@ void SAL_CALL PieChartTypeTemplate::applyStyle(
}
}
-void SAL_CALL PieChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram >& xDiagram )
+void PieChartTypeTemplate::resetStyles2( const rtl::Reference< ::chart::Diagram >& xDiagram )
{
// reset axes and grids
- Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY );
- if( xCooSysCnt.is())
+ if( xDiagram.is())
{
- const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysSeq( xDiagram->getBaseCoordinateSystems());
ChartTypeTemplate::createAxes( aCooSysSeq );
//reset scale orientation
- for( Reference< chart2::XCoordinateSystem > const & coords : aCooSysSeq )
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : aCooSysSeq )
{
try
{
- Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 0 /*nDimensionIndex*/,0 /*nAxisIndex*/
- , coords ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 0 /*nDimensionIndex*/,0 /*nAxisIndex*/
+ , coords );
if( xAxis.is() )
{
chart2::ScaleData aScaleData( xAxis->getScaleData() );
@@ -590,40 +568,34 @@ void SAL_CALL PieChartTypeTemplate::resetStyles( const Reference< chart2::XDiagr
}
}
- ChartTypeTemplate::resetStyles( xDiagram );
+ ChartTypeTemplate::resetStyles2( xDiagram );
// vary colors by point,
// line style
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec =
+ xDiagram->getDataSeries();
uno::Any aLineStyleAny( drawing::LineStyle_NONE );
for (auto const& series : aSeriesVec)
{
- Reference< beans::XPropertyState > xState(series, uno::UNO_QUERY);
- if( xState.is())
+ series->setPropertyToDefault( u"VaryColorsByPoint"_ustr);
+ if( series->getPropertyValue( u"BorderStyle"_ustr) == aLineStyleAny )
{
- xState->setPropertyToDefault( "VaryColorsByPoint");
- Reference< beans::XPropertySet > xProp( xState, uno::UNO_QUERY );
- if( xProp.is() &&
- xProp->getPropertyValue( "BorderStyle") == aLineStyleAny )
- {
- xState->setPropertyToDefault( "BorderStyle");
- }
+ series->setPropertyToDefault( u"BorderStyle"_ustr);
}
}
//reset scene properties
- ThreeDHelper::setDefaultRotation( uno::Reference< beans::XPropertySet >( xDiagram, uno::UNO_QUERY ), false );
+ xDiagram->setDefaultRotation( false );
}
// ____ XChartTypeTemplate ____
-void PieChartTypeTemplate::adaptDiagram( const uno::Reference< chart2::XDiagram >& xDiagram )
+void PieChartTypeTemplate::adaptDiagram( const rtl::Reference< ::chart::Diagram >& xDiagram )
{
if( !xDiagram.is() )
return;
//different default for scene geometry:
- ThreeDHelper::setDefaultRotation( uno::Reference< beans::XPropertySet >( xDiagram, uno::UNO_QUERY ), true );
+ xDiagram->setDefaultRotation( true );
}
IMPLEMENT_FORWARD_XINTERFACE2( PieChartTypeTemplate, ChartTypeTemplate, OPropertySet )
diff --git a/chart2/source/model/template/PieChartTypeTemplate.hxx b/chart2/source/model/template/PieChartTypeTemplate.hxx
index c749be57447a..d95b8c49d900 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.hxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.hxx
@@ -19,17 +19,16 @@
#pragma once
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <comphelper/uno3.hxx>
#include <ChartTypeTemplate.hxx>
#include <com/sun/star/chart2/PieChartOffsetMode.hpp>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
namespace chart
{
class PieChartTypeTemplate :
- public cppu::BaseMutex,
public ChartTypeTemplate,
public ::property::OPropertySet
{
@@ -39,7 +38,9 @@ public:
const OUString & rServiceName,
css::chart2::PieChartOffsetMode eMode,
bool bRings,
- sal_Int32 nDim = 2 );
+ css::chart2::PieChartSubType eSubType,
+ sal_Int32 nCompositeSize,
+ sal_Int32 nDim );
virtual ~PieChartTypeTemplate() override;
/// merge XInterface implementations
@@ -56,50 +57,48 @@ protected:
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
- // ____ XChartTypeTemplate ____
- virtual sal_Bool SAL_CALL matchesTemplate(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties ) override;
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence<
- css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ // ____ ChartTypeTemplate ____
+ virtual bool matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties ) override;
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeGroupIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
- virtual void SAL_CALL resetStyles(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override;
+ virtual void resetStyles2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram ) override;
// ____ ChartTypeTemplate ____
virtual sal_Int32 getDimension() const override;
virtual void adaptDiagram(
- const css::uno::Reference< css::chart2::XDiagram > & xDiagram ) override;
+ const rtl::Reference< ::chart::Diagram > & xDiagram ) override;
virtual sal_Int32 getAxisCountByDimension( sal_Int32 nDimension ) override;
virtual void adaptAxes(
- const css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > > & rCoordSys ) override;
+ const std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > > & rCoordSys ) override;
virtual void adaptScales(
- const css::uno::Sequence< css::uno::Reference< css::chart2::XCoordinateSystem > > & aCooSysSeq,
+ const std::vector< rtl::Reference< ::chart::BaseCoordinateSystem > > & aCooSysSeq,
const css::uno::Reference< css::chart2::data::XLabeledDataSequence > & xCategories ) override;
virtual void createChartTypes(
- const css::uno::Sequence<
- css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XDataSeries > > >& aSeriesSeq,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XCoordinateSystem > > & rCoordSys,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XChartType > > & aOldChartTypesSeq
+ const std::vector<
+ std::vector<
+ rtl::Reference<
+ ::chart::DataSeries > > >& aSeriesSeq,
+ const std::vector<
+ rtl::Reference<
+ ::chart::BaseCoordinateSystem > > & rCoordSys,
+ const std::vector< rtl::Reference< ChartType > > & aOldChartTypesSeq
) override;
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
};
diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx
index 4693df06d674..47698f448f24 100644
--- a/chart2/source/model/template/ScatterChartType.cxx
+++ b/chart2/source/model/template/ScatterChartType.cxx
@@ -21,6 +21,7 @@
#include <PropertyHelper.hxx>
#include <servicenames_charttypes.hxx>
#include <CartesianCoordinateSystem.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <AxisIndexDefines.hxx>
#include <unonames.hxx>
@@ -46,90 +47,57 @@ enum
PROP_SCATTERCHARTTYPE_SPLINE_ORDER
};
-void lcl_AddPropertiesToVector(
- std::vector< Property > & rOutProperties )
+::chart::tPropertyValueMap& StaticScatterChartTypeDefaults()
{
- rOutProperties.emplace_back( CHART_UNONAME_CURVE_STYLE,
+ static ::chart::tPropertyValueMap aStaticDefaults =
+ []()
+ {
+ ::chart::tPropertyValueMap aOutMap;
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_SCATTERCHARTTYPE_CURVE_STYLE, chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_SCATTERCHARTTYPE_CURVE_RESOLUTION, 20 );
+
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_SCATTERCHARTTYPE_SPLINE_ORDER, 3 );
+ return aOutMap;
+ }();
+ return aStaticDefaults;
+}
+
+::cppu::OPropertyArrayHelper& StaticScatterChartTypeInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper aPropHelper(
+ []()
+ {
+ std::vector< css::beans::Property > aProperties {
+ { CHART_UNONAME_CURVE_STYLE,
PROP_SCATTERCHARTTYPE_CURVE_STYLE,
cppu::UnoType<chart2::CurveStyle>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
-
- rOutProperties.emplace_back( CHART_UNONAME_CURVE_RESOLUTION,
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { CHART_UNONAME_CURVE_RESOLUTION,
PROP_SCATTERCHARTTYPE_CURVE_RESOLUTION,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( CHART_UNONAME_SPLINE_ORDER,
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { CHART_UNONAME_SPLINE_ORDER,
PROP_SCATTERCHARTTYPE_SPLINE_ORDER,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
+ | beans::PropertyAttribute::MAYBEDEFAULT } };
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+ return comphelper::containerToSequence( aProperties );
+ }() );
+ return aPropHelper;
}
-struct StaticScatterChartTypeDefaults_Initializer
+const uno::Reference< beans::XPropertySetInfo >& StaticScatterChartTypeInfo()
{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCATTERCHARTTYPE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_CURVE_RESOLUTION, 20 );
-
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_SPLINE_ORDER, 3 );
- }
-};
-
-struct StaticScatterChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticScatterChartTypeDefaults_Initializer >
-{
-};
-
-struct StaticScatterChartTypeInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticScatterChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticScatterChartTypeInfoHelper_Initializer >
-{
-};
-
-struct StaticScatterChartTypeInfo_Initializer
-{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticScatterChartTypeInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
-
-struct StaticScatterChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticScatterChartTypeInfo_Initializer >
-{
-};
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticScatterChartTypeInfoHelper() ) );
+ return xPropertySetInfo;
+}
} // anonymous namespace
@@ -154,16 +122,21 @@ uno::Reference< util::XCloneable > SAL_CALL ScatterChartType::createClone()
return uno::Reference< util::XCloneable >( new ScatterChartType( *this ));
}
+rtl::Reference< ChartType > ScatterChartType::cloneChartType() const
+{
+ return new ScatterChartType( *this );
+}
+
// ____ XChartType ____
-Reference< chart2::XCoordinateSystem > SAL_CALL
- ScatterChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+rtl::Reference< ::chart::BaseCoordinateSystem >
+ ScatterChartType::createCoordinateSystem2( sal_Int32 DimensionCount )
{
rtl::Reference< CartesianCoordinateSystem > xResult =
new CartesianCoordinateSystem( DimensionCount );
for( sal_Int32 i=0; i<DimensionCount; ++i )
{
- Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) );
+ rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( i, MAIN_AXIS_INDEX );
if( !xAxis.is() )
{
OSL_FAIL("a created coordinate system should have an axis for each dimension");
@@ -192,13 +165,13 @@ OUString SAL_CALL ScatterChartType::getChartType()
uno::Sequence< OUString > SAL_CALL ScatterChartType::getSupportedMandatoryRoles()
{
- return { "label", "values-x", "values-y" };
+ return { u"label"_ustr, u"values-x"_ustr, u"values-y"_ustr };
}
// ____ OPropertySet ____
void ScatterChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticScatterChartTypeDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticScatterChartTypeDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -209,18 +182,18 @@ void ScatterChartType::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) cons
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL ScatterChartType::getInfoHelper()
{
- return *StaticScatterChartTypeInfoHelper::get();
+ return StaticScatterChartTypeInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL ScatterChartType::getPropertySetInfo()
{
- return *StaticScatterChartTypeInfo::get();
+ return StaticScatterChartTypeInfo();
}
OUString SAL_CALL ScatterChartType::getImplementationName()
{
- return "com.sun.star.comp.chart.ScatterChartType";
+ return u"com.sun.star.comp.chart.ScatterChartType"_ustr;
}
sal_Bool SAL_CALL ScatterChartType::supportsService( const OUString& rServiceName )
@@ -232,8 +205,8 @@ css::uno::Sequence< OUString > SAL_CALL ScatterChartType::getSupportedServiceNam
{
return {
CHART2_SERVICE_NAME_CHARTTYPE_SCATTER,
- "com.sun.star.chart2.ChartType",
- "com.sun.star.beans.PropertySet" };
+ u"com.sun.star.chart2.ChartType"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr };
}
} // namespace chart
diff --git a/chart2/source/model/template/ScatterChartType.hxx b/chart2/source/model/template/ScatterChartType.hxx
index da14efb0df3f..f490c108ca56 100644
--- a/chart2/source/model/template/ScatterChartType.hxx
+++ b/chart2/source/model/template/ScatterChartType.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "ChartType.hxx"
+#include <ChartType.hxx>
namespace chart
{
@@ -36,6 +36,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override;
+ virtual rtl::Reference<ChartType> cloneChartType() const override;
+
private:
explicit ScatterChartType( const ScatterChartType & rOther );
@@ -43,8 +45,6 @@ private:
virtual OUString SAL_CALL getChartType() override;
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedMandatoryRoles() override;
- virtual css::uno::Reference< css::chart2::XCoordinateSystem > SAL_CALL
- createCoordinateSystem( ::sal_Int32 DimensionCount ) override;
// ____ OPropertySet ____
virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
@@ -58,6 +58,9 @@ private:
// ____ XCloneable ____
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
+
+ virtual rtl::Reference< ::chart::BaseCoordinateSystem >
+ createCoordinateSystem2( sal_Int32 DimensionCount ) override;
};
} // namespace chart
diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
index cf22e22c6d55..5ba115af253c 100644
--- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
@@ -18,9 +18,11 @@
*/
#include "ScatterChartTypeTemplate.hxx"
+#include "ScatterChartType.hxx"
#include "XYDataInterpreter.hxx"
-#include <DiagramHelper.hxx>
-#include <servicenames_charttypes.hxx>
+#include <ChartType.hxx>
+#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <PropertyHelper.hxx>
#include <unonames.hxx>
@@ -31,8 +33,7 @@
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
@@ -53,89 +54,58 @@ enum
};
-void lcl_AddPropertiesToVector(
- std::vector< Property > & rOutProperties )
+const ::chart::tPropertyValueMap& StaticScatterChartTypeTemplateDefaults()
{
- rOutProperties.emplace_back( CHART_UNONAME_CURVE_STYLE,
- PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE,
- cppu::UnoType<chart2::CurveStyle>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( CHART_UNONAME_CURVE_RESOLUTION,
- PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
- cppu::UnoType<sal_Int32>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
- rOutProperties.emplace_back( CHART_UNONAME_SPLINE_ORDER,
- PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER,
- cppu::UnoType<sal_Int32>::get(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT );
+ static const ::chart::tPropertyValueMap aStaticDefaults =
+ []()
+ {
+ ::chart::tPropertyValueMap aOutMap;
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
+
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
+ return aOutMap;
+ }();
+ return aStaticDefaults;
}
-struct StaticScatterChartTypeTemplateDefaults_Initializer
-{
- ::chart::tPropertyValueMap* operator()()
- {
- static ::chart::tPropertyValueMap aStaticDefaults;
- lcl_AddDefaultsToMap( aStaticDefaults );
- return &aStaticDefaults;
- }
-private:
- static void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
- {
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
-
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
- }
-};
-
-struct StaticScatterChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticScatterChartTypeTemplateDefaults_Initializer >
-{
-};
-
-struct StaticScatterChartTypeTemplateInfoHelper_Initializer
-{
- ::cppu::OPropertyArrayHelper* operator()()
- {
- static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
- return &aPropHelper;
- }
-
-private:
- static Sequence< Property > lcl_GetPropertySequence()
- {
- std::vector< css::beans::Property > aProperties;
- lcl_AddPropertiesToVector( aProperties );
-
- std::sort( aProperties.begin(), aProperties.end(),
- ::chart::PropertyNameLess() );
-
- return comphelper::containerToSequence( aProperties );
- }
-
-};
-
-struct StaticScatterChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticScatterChartTypeTemplateInfoHelper_Initializer >
-{
-};
-struct StaticScatterChartTypeTemplateInfo_Initializer
+::cppu::OPropertyArrayHelper& StaticScatterChartTypeTemplateInfoHelper()
{
- uno::Reference< beans::XPropertySetInfo >* operator()()
- {
- static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
- ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticScatterChartTypeTemplateInfoHelper::get() ) );
- return &xPropertySetInfo;
- }
-};
+ static ::cppu::OPropertyArrayHelper aPropHelper(
+ []()
+ {
+ std::vector< css::beans::Property > aProperties {
+ { CHART_UNONAME_CURVE_STYLE,
+ PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE,
+ cppu::UnoType<chart2::CurveStyle>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { CHART_UNONAME_CURVE_RESOLUTION,
+ PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT },
+ { CHART_UNONAME_SPLINE_ORDER,
+ PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT } };
+ std::sort( aProperties.begin(), aProperties.end(),
+ ::chart::PropertyNameLess() );
+ return comphelper::containerToSequence( aProperties );
+ }() );
+ return aPropHelper;
+}
-struct StaticScatterChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticScatterChartTypeTemplateInfo_Initializer >
+const uno::Reference< beans::XPropertySetInfo >& StaticScatterChartTypeTemplateInfo()
{
-};
+ static const uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(StaticScatterChartTypeTemplateInfoHelper() ) );
+ return xPropertySetInfo;
+}
} // anonymous namespace
@@ -150,7 +120,6 @@ ScatterChartTypeTemplate::ScatterChartTypeTemplate(
bool bHasLines /* = true */,
sal_Int32 nDim /* = 2 */ ) :
ChartTypeTemplate( xContext, rServiceName ),
- ::property::OPropertySet( m_aMutex ),
m_bHasSymbols( bSymbols ),
m_bHasLines( bHasLines ),
m_nDim( nDim )
@@ -165,7 +134,7 @@ ScatterChartTypeTemplate::~ScatterChartTypeTemplate()
// ____ OPropertySet ____
void ScatterChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAny ) const
{
- const tPropertyValueMap& rStaticDefaults = *StaticScatterChartTypeTemplateDefaults::get();
+ const tPropertyValueMap& rStaticDefaults = StaticScatterChartTypeTemplateDefaults();
tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
if( aFound == rStaticDefaults.end() )
rAny.clear();
@@ -175,13 +144,13 @@ void ScatterChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle, uno::Any& rAn
::cppu::IPropertyArrayHelper & SAL_CALL ScatterChartTypeTemplate::getInfoHelper()
{
- return *StaticScatterChartTypeTemplateInfoHelper::get();
+ return StaticScatterChartTypeTemplateInfoHelper();
}
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL ScatterChartTypeTemplate::getPropertySetInfo()
{
- return *StaticScatterChartTypeTemplateInfo::get();
+ return StaticScatterChartTypeTemplateInfo();
}
sal_Int32 ScatterChartTypeTemplate::getDimension() const
@@ -196,23 +165,21 @@ StackMode ScatterChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex *
return StackMode::NONE;
}
-void SAL_CALL ScatterChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void ScatterChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
try
{
- Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY_THROW );
-
- DataSeriesHelper::switchSymbolsOnOrOff( xProp, m_bHasSymbols, nSeriesIndex );
- DataSeriesHelper::switchLinesOnOrOff( xProp, m_bHasLines );
- DataSeriesHelper::makeLinesThickOrThin( xProp, m_nDim==2 );
+ xSeries->switchSymbolsOnOrOff( m_bHasSymbols, nSeriesIndex );
+ xSeries->switchLinesOnOrOff( m_bHasLines );
+ xSeries->makeLinesThickOrThin( m_nDim==2 );
if( m_nDim==3 )
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", uno::Any( drawing::LineStyle_NONE ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"BorderStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
}
catch( const uno::Exception & )
{
@@ -226,11 +193,11 @@ sal_Bool SAL_CALL ScatterChartTypeTemplate::supportsCategories()
return false;
}
-sal_Bool SAL_CALL ScatterChartTypeTemplate::matchesTemplate(
- const Reference< chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties )
+bool ScatterChartTypeTemplate::matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties )
{
- bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties );
+ bool bResult = ChartTypeTemplate::matchesTemplate2( xDiagram, bAdaptProperties );
// check symbol-style and line-style
// for a template with symbols (or with lines) it is ok, if there is at least one series
@@ -240,8 +207,8 @@ sal_Bool SAL_CALL ScatterChartTypeTemplate::matchesTemplate(
bool bSymbolFound = false;
bool bLineFound = false;
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec =
+ xDiagram->getDataSeries();
for (auto const& series : aSeriesVec)
{
@@ -249,9 +216,8 @@ sal_Bool SAL_CALL ScatterChartTypeTemplate::matchesTemplate(
{
chart2::Symbol aSymbProp;
drawing::LineStyle eLineStyle;
- Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY_THROW);
- bool bCurrentHasSymbol = (xProp->getPropertyValue( "Symbol") >>= aSymbProp) &&
+ bool bCurrentHasSymbol = (series->getPropertyValue( u"Symbol"_ustr) >>= aSymbProp) &&
(aSymbProp.Style != chart2::SymbolStyle_NONE);
if( bCurrentHasSymbol )
@@ -263,7 +229,7 @@ sal_Bool SAL_CALL ScatterChartTypeTemplate::matchesTemplate(
break;
}
- bool bCurrentHasLine = (xProp->getPropertyValue( "LineStyle") >>= eLineStyle) &&
+ bool bCurrentHasLine = (series->getPropertyValue( u"LineStyle"_ustr) >>= eLineStyle) &&
( eLineStyle != drawing::LineStyle_NONE );
if( bCurrentHasLine )
@@ -297,9 +263,8 @@ sal_Bool SAL_CALL ScatterChartTypeTemplate::matchesTemplate(
{
try
{
- uno::Reference< beans::XPropertySet > xChartTypeProp(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ),
- uno::UNO_QUERY_THROW );
+ rtl::Reference< ChartType > xChartTypeProp =
+ xDiagram->getChartTypeByIndex(0);
setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE, xChartTypeProp->getPropertyValue(CHART_UNONAME_CURVE_STYLE) );
setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, xChartTypeProp->getPropertyValue(CHART_UNONAME_CURVE_RESOLUTION) );
setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER, xChartTypeProp->getPropertyValue(CHART_UNONAME_SPLINE_ORDER) );
@@ -313,27 +278,20 @@ sal_Bool SAL_CALL ScatterChartTypeTemplate::matchesTemplate(
return bResult;
}
-Reference< chart2::XChartType > ScatterChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+rtl::Reference< ChartType > ScatterChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_SCATTER ), uno::UNO_QUERY_THROW );
-
- Reference< beans::XPropertySet > xCTProp( xResult, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- xCTProp->setPropertyValue(
- CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE ));
- xCTProp->setPropertyValue(
- CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
- xCTProp->setPropertyValue(
- CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER ));
- }
+ xResult = new ScatterChartType();
+
+ xResult->setPropertyValue(
+ CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE ));
+ xResult->setPropertyValue(
+ CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
+ xResult->setPropertyValue(
+ CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER ));
}
catch( const uno::Exception & )
{
@@ -343,30 +301,23 @@ Reference< chart2::XChartType > ScatterChartTypeTemplate::getChartTypeForIndex(
return xResult;
}
-Reference< chart2::XChartType > SAL_CALL ScatterChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > ScatterChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_SCATTER ), uno::UNO_QUERY_THROW );
+ xResult = new ScatterChartType();
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
- Reference< beans::XPropertySet > xCTProp( xResult, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- xCTProp->setPropertyValue(
- CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE ));
- xCTProp->setPropertyValue(
- CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
- xCTProp->setPropertyValue(
- CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER ));
- }
+ xResult->setPropertyValue(
+ CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE ));
+ xResult->setPropertyValue(
+ CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
+ xResult->setPropertyValue(
+ CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER ));
}
catch( const uno::Exception & )
{
@@ -376,7 +327,7 @@ Reference< chart2::XChartType > SAL_CALL ScatterChartTypeTemplate::getChartTypeF
return xResult;
}
-Reference< chart2::XDataInterpreter > SAL_CALL ScatterChartTypeTemplate::getDataInterpreter()
+rtl::Reference< DataInterpreter > ScatterChartTypeTemplate::getDataInterpreter2()
{
if( ! m_xDataInterpreter.is())
m_xDataInterpreter.set( new XYDataInterpreter );
diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.hxx b/chart2/source/model/template/ScatterChartTypeTemplate.hxx
index f25d6ebcbf49..0d7aec7ad188 100644
--- a/chart2/source/model/template/ScatterChartTypeTemplate.hxx
+++ b/chart2/source/model/template/ScatterChartTypeTemplate.hxx
@@ -20,14 +20,12 @@
#include <ChartTypeTemplate.hxx>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <comphelper/uno3.hxx>
namespace chart
{
class ScatterChartTypeTemplate :
- public cppu::BaseMutex,
public ChartTypeTemplate,
public ::property::OPropertySet
{
@@ -54,23 +52,23 @@ protected:
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override;
- // ____ XChartTypeTemplate ____
+ // ____ ChartTypeTemplate ____
virtual sal_Bool SAL_CALL supportsCategories() override;
- virtual sal_Bool SAL_CALL matchesTemplate(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties ) override;
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence<
- css::uno::Reference< css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual css::uno::Reference< css::chart2::XDataInterpreter > SAL_CALL getDataInterpreter() override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ virtual bool matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties ) override;
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual rtl::Reference< ::chart::DataInterpreter > getDataInterpreter2() override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeGroupIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
// ____ ChartTypeTemplate ____
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
virtual sal_Int32 getDimension() const override;
virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const override;
diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx
index 9f54c44cbca4..b9f141831d08 100644
--- a/chart2/source/model/template/StockChartTypeTemplate.cxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.cxx
@@ -18,25 +18,25 @@
*/
#include "StockChartTypeTemplate.hxx"
+#include "ColumnChartType.hxx"
+#include "CandleStickChartType.hxx"
+#include "LineChartType.hxx"
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include "StockDataInterpreter.hxx"
-#include <DiagramHelper.hxx>
+#include <Diagram.hxx>
+#include <BaseCoordinateSystem.hxx>
#include <servicenames_charttypes.hxx>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <PropertyHelper.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
-#include <vector>
#include <algorithm>
+#include <cstddef>
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -127,7 +127,6 @@ StockChartTypeTemplate::StockChartTypeTemplate(
StockVariant eVariant,
bool bJapaneseStyle ) :
ChartTypeTemplate( xContext, rServiceName ),
- ::property::OPropertySet( m_aMutex ),
m_eStockVariant( eVariant )
{
setFastPropertyValue_NoBroadcast(
@@ -184,13 +183,13 @@ sal_Int32 StockChartTypeTemplate::getAxisCountByDimension( sal_Int32 nDimension
return bHasVolume ? 2 : 1;
}
-void SAL_CALL StockChartTypeTemplate::applyStyle(
- const Reference< chart2::XDataSeries >& xSeries,
+void StockChartTypeTemplate::applyStyle2(
+ const rtl::Reference< DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount )
{
- ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+ ChartTypeTemplate::applyStyle2( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
try
{
sal_Int32 nNewAxisIndex = 0;
@@ -200,25 +199,20 @@ void SAL_CALL StockChartTypeTemplate::applyStyle(
if( bHasVolume && nChartTypeIndex != 0 )
nNewAxisIndex = 1;
- Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY );
- if( xProp.is() )
- xProp->setPropertyValue( "AttachedAxisIndex", uno::Any( nNewAxisIndex ) );
+ xSeries->setPropertyValue( u"AttachedAxisIndex"_ustr, uno::Any( nNewAxisIndex ) );
if( bHasVolume && nChartTypeIndex==0 )
{
//switch lines off for volume bars
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", uno::Any( drawing::LineStyle_NONE ) );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"BorderStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
}
else
{
//ensure that lines are on
- if( xProp.is() )
- {
- drawing::LineStyle eStyle = drawing::LineStyle_NONE;
- xProp->getPropertyValue( "LineStyle" ) >>= eStyle;
- if( eStyle == drawing::LineStyle_NONE )
- xProp->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_SOLID ));
- }
+ drawing::LineStyle eStyle = drawing::LineStyle_NONE;
+ xSeries->getPropertyValue( u"LineStyle"_ustr ) >>= eStyle;
+ if( eStyle == drawing::LineStyle_NONE )
+ xSeries->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_SOLID ));
}
}
@@ -228,66 +222,57 @@ void SAL_CALL StockChartTypeTemplate::applyStyle(
}
}
-void SAL_CALL StockChartTypeTemplate::resetStyles(
- const Reference< chart2::XDiagram >& xDiagram )
+void StockChartTypeTemplate::resetStyles2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram )
{
- ChartTypeTemplate::resetStyles( xDiagram );
+ ChartTypeTemplate::resetStyles2( xDiagram );
if( getDimension() == 3 )
{
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec =
+ xDiagram->getDataSeries();
for (auto const& series : aSeriesVec)
{
- Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY);
- if( xProp.is() )
- xProp->setPropertyValue( "AttachedAxisIndex", uno::Any( sal_Int32(0) ) );
+ series->setPropertyValue( u"AttachedAxisIndex"_ustr, uno::Any( sal_Int32(0) ) );
}
}
- DiagramHelper::setVertical( xDiagram, false );
+ xDiagram->setVertical( false );
}
-Reference< XChartType > StockChartTypeTemplate::getChartTypeForIndex( sal_Int32 nChartTypeIndex )
+rtl::Reference< ChartType > StockChartTypeTemplate::getChartTypeForIndex( sal_Int32 nChartTypeIndex )
{
- Reference< XChartType > xCT;
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY );
- if(xFact.is())
+ rtl::Reference< ChartType > xCT;
+ bool bHasVolume = false;
+ getFastPropertyValue( PROP_STOCKCHARTTYPE_TEMPLATE_VOLUME ) >>= bHasVolume;
+ if( bHasVolume )
{
- bool bHasVolume = false;
- getFastPropertyValue( PROP_STOCKCHARTTYPE_TEMPLATE_VOLUME ) >>= bHasVolume;
- if( bHasVolume )
- {
- if( nChartTypeIndex == 0 )
- xCT.set( xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_COLUMN ), uno::UNO_QUERY );
- else if( nChartTypeIndex == 1 )
- xCT.set( xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ), uno::UNO_QUERY );
- else
- xCT.set( xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY );
- }
+ if( nChartTypeIndex == 0 )
+ xCT = new ColumnChartType();
+ else if( nChartTypeIndex == 1 )
+ xCT = new CandleStickChartType();
else
- {
- if( nChartTypeIndex == 0 )
- xCT.set( xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ), uno::UNO_QUERY );
- else
- xCT.set( xFact->createInstance( CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY );
- }
+ xCT = new LineChartType();
+ }
+ else
+ {
+ if( nChartTypeIndex == 0 )
+ xCT = new CandleStickChartType();
+ else
+ xCT = new LineChartType();
}
return xCT;
}
void StockChartTypeTemplate::createChartTypes(
- const Sequence< Sequence< Reference< XDataSeries > > > & aSeriesSeq,
- const Sequence< Reference< XCoordinateSystem > > & rCoordSys,
- const Sequence< Reference< XChartType > >& /* aOldChartTypesSeq */ )
+ const std::vector< std::vector< rtl::Reference< DataSeries > > > & aSeriesSeq,
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > & rCoordSys,
+ const std::vector< rtl::Reference< ChartType > >& /* aOldChartTypesSeq */ )
{
- if( !rCoordSys.hasElements() )
+ if( rCoordSys.empty() )
return;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
bool bHasVolume = false;
bool bShowFirst = false;
bool bJapaneseStyle = false;
@@ -298,63 +283,49 @@ void StockChartTypeTemplate::createChartTypes(
getFastPropertyValue( PROP_STOCKCHARTTYPE_TEMPLATE_JAPANESE ) >>= bJapaneseStyle;
getFastPropertyValue( PROP_STOCKCHARTTYPE_TEMPLATE_LOW_HIGH ) >>= bShowHighLow;
- sal_Int32 nSeriesIndex = 0;
+ std::size_t nSeriesIndex = 0;
- std::vector< Reference< chart2::XChartType > > aChartTypeVec;
+ std::vector< rtl::Reference< ChartType > > aChartTypeVec;
// Bars (Volume)
if( bHasVolume )
{
// chart type
- Reference< XChartType > xCT(
- xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_COLUMN ), uno::UNO_QUERY_THROW );
+ rtl::Reference< ChartType > xCT = new ColumnChartType();
aChartTypeVec.push_back( xCT );
- if( aSeriesSeq.getLength() > nSeriesIndex &&
- aSeriesSeq[nSeriesIndex].hasElements() )
+ if( aSeriesSeq.size() > nSeriesIndex &&
+ !aSeriesSeq[nSeriesIndex].empty() )
{
- Reference< XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
- xDSCnt->setDataSeries( aSeriesSeq[ nSeriesIndex ] );
+ xCT->setDataSeries( aSeriesSeq[ nSeriesIndex ] );
}
++nSeriesIndex;
}
- Reference< XChartType > xCT(
- xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ), uno::UNO_QUERY_THROW );
+ rtl::Reference< ChartType > xCT = new CandleStickChartType();
aChartTypeVec.push_back( xCT );
- Reference< beans::XPropertySet > xCTProp( xCT, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- xCTProp->setPropertyValue( "Japanese", uno::Any( bJapaneseStyle ));
- xCTProp->setPropertyValue( "ShowFirst", uno::Any( bShowFirst ));
- xCTProp->setPropertyValue( "ShowHighLow", uno::Any( bShowHighLow ));
- }
+ xCT->setPropertyValue( u"Japanese"_ustr, uno::Any( bJapaneseStyle ));
+ xCT->setPropertyValue( u"ShowFirst"_ustr, uno::Any( bShowFirst ));
+ xCT->setPropertyValue( u"ShowHighLow"_ustr, uno::Any( bShowHighLow ));
- if( aSeriesSeq.getLength() > nSeriesIndex &&
- aSeriesSeq[ nSeriesIndex ].hasElements() )
+ if( aSeriesSeq.size() > nSeriesIndex &&
+ !aSeriesSeq[ nSeriesIndex ].empty() )
{
- Reference< XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
- xDSCnt->setDataSeries( aSeriesSeq[ nSeriesIndex ] );
+ xCT->setDataSeries( aSeriesSeq[ nSeriesIndex ] );
}
++nSeriesIndex;
// Lines (remaining series)
- if( aSeriesSeq.getLength() > nSeriesIndex &&
- aSeriesSeq[ nSeriesIndex ].hasElements() )
+ if( aSeriesSeq.size() > nSeriesIndex &&
+ !aSeriesSeq[ nSeriesIndex ].empty() )
{
- xCT.set(
- xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY_THROW );
+ xCT = new LineChartType();
aChartTypeVec.push_back( xCT );
- Reference< XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
- xDSCnt->setDataSeries( aSeriesSeq[ nSeriesIndex ] );
+ xCT->setDataSeries( aSeriesSeq[ nSeriesIndex ] );
}
- Reference< XChartTypeContainer > xCTCnt( rCoordSys[ 0 ], uno::UNO_QUERY_THROW );
- xCTCnt->setChartTypes( comphelper::containerToSequence(aChartTypeVec) );
+ rCoordSys[ 0 ]->setChartTypes( aChartTypeVec );
}
catch( const uno::Exception & )
{
@@ -362,10 +333,10 @@ void StockChartTypeTemplate::createChartTypes(
}
}
-// ____ XChartTypeTemplate ____
-sal_Bool SAL_CALL StockChartTypeTemplate::matchesTemplate(
- const uno::Reference< XDiagram >& xDiagram,
- sal_Bool /* bAdaptProperties */ )
+// ____ ChartTypeTemplate ____
+bool StockChartTypeTemplate::matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool /* bAdaptProperties */ )
{
bool bResult = false;
@@ -380,34 +351,25 @@ sal_Bool SAL_CALL StockChartTypeTemplate::matchesTemplate(
getFastPropertyValue( PROP_STOCKCHARTTYPE_TEMPLATE_OPEN ) >>= bHasOpenValue;
getFastPropertyValue( PROP_STOCKCHARTTYPE_TEMPLATE_JAPANESE ) >>= bHasJapaneseStyle;
- Reference< chart2::XChartType > xVolumeChartType;
- Reference< chart2::XChartType > xCandleStickChartType;
- Reference< chart2::XChartType > xLineChartType;
+ rtl::Reference< ChartType > xVolumeChartType;
+ rtl::Reference< ChartType > xCandleStickChartType;
+ rtl::Reference< ChartType > xLineChartType;
sal_Int32 nNumberOfChartTypes = 0;
- Reference< XCoordinateSystemContainer > xCooSysCnt(
- xDiagram, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
- for( Reference< XCoordinateSystem > const & coords : aCooSysSeq )
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : xDiagram->getBaseCoordinateSystems() )
{
- Reference< XChartTypeContainer > xCTCnt( coords, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
- for( Reference< XChartType > const & chartType : aChartTypeSeq )
+ for( rtl::Reference< ChartType > const & chartType : coords->getChartTypes2() )
{
- if( chartType.is())
- {
- ++nNumberOfChartTypes;
- if( nNumberOfChartTypes > 3 )
- break;
- OUString aCTService = chartType->getChartType();
- if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_COLUMN )
- xVolumeChartType.set( chartType );
- else if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK )
- xCandleStickChartType.set( chartType );
- else if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_LINE )
- xLineChartType.set( chartType );
- }
+ ++nNumberOfChartTypes;
+ if( nNumberOfChartTypes > 3 )
+ break;
+ OUString aCTService = chartType->getChartType();
+ if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_COLUMN )
+ xVolumeChartType = chartType;
+ else if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK )
+ xCandleStickChartType = chartType;
+ else if( aCTService == CHART2_SERVICE_NAME_CHARTTYPE_LINE )
+ xLineChartType = chartType;
}
if( nNumberOfChartTypes > 3 )
break;
@@ -418,18 +380,14 @@ sal_Bool SAL_CALL StockChartTypeTemplate::matchesTemplate(
bResult = true;
// check for japanese style
- Reference< beans::XPropertySet > xCTProp( xCandleStickChartType, uno::UNO_QUERY );
- if( xCTProp.is())
- {
- bool bJapaneseProp = false;
- xCTProp->getPropertyValue( "Japanese") >>= bJapaneseProp;
- bResult = bResult && ( bHasJapaneseStyle == bJapaneseProp );
-
- // in old chart japanese == showFirst
- bool bShowFirstProp = false;
- xCTProp->getPropertyValue( "ShowFirst") >>= bShowFirstProp;
- bResult = bResult && ( bHasOpenValue == bShowFirstProp );
- }
+ bool bJapaneseProp = false;
+ xCandleStickChartType->getPropertyValue( u"Japanese"_ustr) >>= bJapaneseProp;
+ bResult = bResult && ( bHasJapaneseStyle == bJapaneseProp );
+
+ // in old chart japanese == showFirst
+ bool bShowFirstProp = false;
+ xCandleStickChartType->getPropertyValue( u"ShowFirst"_ustr) >>= bShowFirstProp;
+ bResult = bResult && ( bHasOpenValue == bShowFirstProp );
}
}
catch( const uno::Exception & )
@@ -440,17 +398,14 @@ sal_Bool SAL_CALL StockChartTypeTemplate::matchesTemplate(
return bResult;
}
-Reference< XChartType > SAL_CALL StockChartTypeTemplate::getChartTypeForNewSeries(
- const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+rtl::Reference< ChartType > StockChartTypeTemplate::getChartTypeForNewSeries2(
+ const std::vector< rtl::Reference< ChartType > >& aFormerlyUsedChartTypes )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ChartType > xResult;
try
{
- Reference< lang::XMultiServiceFactory > xFact(
- GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_LINE ), uno::UNO_QUERY_THROW );
+ xResult = new LineChartType();
ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem( aFormerlyUsedChartTypes, xResult );
}
catch( const uno::Exception & )
@@ -461,7 +416,7 @@ Reference< XChartType > SAL_CALL StockChartTypeTemplate::getChartTypeForNewSerie
return xResult;
}
-Reference< XDataInterpreter > SAL_CALL StockChartTypeTemplate::getDataInterpreter()
+rtl::Reference< DataInterpreter > StockChartTypeTemplate::getDataInterpreter2()
{
if( ! m_xDataInterpreter.is())
m_xDataInterpreter.set( new StockDataInterpreter( m_eStockVariant ) );
diff --git a/chart2/source/model/template/StockChartTypeTemplate.hxx b/chart2/source/model/template/StockChartTypeTemplate.hxx
index 99eb7da8c8cf..aed35a000919 100644
--- a/chart2/source/model/template/StockChartTypeTemplate.hxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.hxx
@@ -20,14 +20,12 @@
#include <ChartTypeTemplate.hxx>
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <comphelper/uno3.hxx>
namespace chart
{
class StockChartTypeTemplate :
- public cppu::BaseMutex,
public ChartTypeTemplate,
public ::property::OPropertySet
{
@@ -70,40 +68,37 @@ protected:
getPropertySetInfo() override;
// ____ XChartTypeTemplate ____
- virtual sal_Bool SAL_CALL matchesTemplate(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram,
- sal_Bool bAdaptProperties ) override;
- virtual css::uno::Reference< css::chart2::XChartType > SAL_CALL
- getChartTypeForNewSeries( const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XChartType > >& aFormerlyUsedChartTypes ) override;
- virtual css::uno::Reference< css::chart2::XDataInterpreter > SAL_CALL getDataInterpreter() override;
- virtual void SAL_CALL applyStyle(
- const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
+ virtual bool matchesTemplate2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram,
+ bool bAdaptProperties ) override;
+ virtual rtl::Reference< ::chart::ChartType >
+ getChartTypeForNewSeries2( const std::vector<
+ rtl::Reference< ::chart::ChartType > >& aFormerlyUsedChartTypes ) override;
+ virtual rtl::Reference< ::chart::DataInterpreter > getDataInterpreter2() override;
+ virtual void applyStyle2(
+ const rtl::Reference< ::chart::DataSeries >& xSeries,
::sal_Int32 nChartTypeIndex,
::sal_Int32 nSeriesIndex,
::sal_Int32 nSeriesCount ) override;
- virtual void SAL_CALL resetStyles(
- const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override;
+ virtual void resetStyles2(
+ const rtl::Reference< ::chart::Diagram >& xDiagram ) override;
// ChartTypeTemplate
virtual sal_Int32 getAxisCountByDimension( sal_Int32 nDimension ) override;
// ____ ChartTypeTemplate ____
virtual void createChartTypes(
- const css::uno::Sequence<
- css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XDataSeries > > >& aSeriesSeq,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XCoordinateSystem > > & rCoordSys,
- const css::uno::Sequence<
- css::uno::Reference<
- css::chart2::XChartType > > & aOldChartTypesSeq
+ const std::vector<
+ std::vector<
+ rtl::Reference<
+ ::chart::DataSeries > > >& aSeriesSeq,
+ const std::vector<
+ rtl::Reference<
+ ::chart::BaseCoordinateSystem > > & rCoordSys,
+ const std::vector< rtl::Reference< ChartType > > & aOldChartTypesSeq
) override;
- virtual css::uno::Reference< css::chart2::XChartType >
+ virtual rtl::Reference< ::chart::ChartType >
getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
private:
diff --git a/chart2/source/model/template/StockDataInterpreter.cxx b/chart2/source/model/template/StockDataInterpreter.cxx
index 7647f475f1f8..75e0bb439c72 100644
--- a/chart2/source/model/template/StockDataInterpreter.cxx
+++ b/chart2/source/model/template/StockDataInterpreter.cxx
@@ -17,15 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "StockDataInterpreter.hxx"
#include "StockChartTypeTemplate.hxx"
#include <DataSeries.hxx>
-#include <com/sun/star/chart2/data/XDataSink.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -43,17 +45,17 @@ StockDataInterpreter::~StockDataInterpreter()
{}
// ____ XDataInterpreter ____
-InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
+InterpretedData StockDataInterpreter::interpretDataSource(
const Reference< data::XDataSource >& xSource,
const Sequence< beans::PropertyValue >& rArguments,
- const Sequence< Reference< XDataSeries > >& rSeriesToReUse )
+ const std::vector< rtl::Reference< ::chart::DataSeries > >& rSeriesToReUse )
{
if( ! xSource.is())
return InterpretedData();
- Reference< data::XLabeledDataSequence > xCategories;
- Sequence< Reference< data::XLabeledDataSequence > > aData( xSource->getDataSequences() );
- const sal_Int32 nDataCount( aData.getLength());
+ uno::Reference< chart2::data::XLabeledDataSequence > xCategories;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aData = DataInterpreter::getDataSequences(xSource);
+ const sal_Int32 nDataCount( aData.size());
// sub-type properties
const StockChartTypeTemplate::StockVariant eVar( GetStockVariant());
@@ -87,16 +89,15 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
sal_Int32 nNumberOfGroups( bHasVolume ? 2 : 1 );
// sequences of data::XLabeledDataSequence per series per group
- Sequence< Sequence< Sequence< Reference< data::XLabeledDataSequence > > > > aSequences( nNumberOfGroups );
- auto pSequences = aSequences.getArray();
+ std::vector< std::vector< std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > > > aSequences( nNumberOfGroups );
const sal_Int32 nBarGroupIndex( 0 );
const sal_Int32 nCandleStickGroupIndex( nNumberOfGroups - 1 );
// allocate space for labeled sequences
if( nRemaining > 0 )
++nCandleStickSeries;
- pSequences[nCandleStickGroupIndex].realloc( nCandleStickSeries );
- auto pCandleStickGroup = pSequences[nCandleStickGroupIndex].getArray();
+ aSequences[nCandleStickGroupIndex].resize( nCandleStickSeries );
+ auto & pCandleStickGroup = aSequences[nCandleStickGroupIndex];
if( bHasVolume )
{
// if there are remaining sequences, the first one is taken for
@@ -104,9 +105,9 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
// is used
if( nRemaining > 1 )
++nVolumeSeries;
- pSequences[nBarGroupIndex].realloc( nVolumeSeries );
+ aSequences[nBarGroupIndex].resize( nVolumeSeries );
}
- auto pBarGroup = pSequences[nBarGroupIndex].getArray();
+ auto & pBarGroup = aSequences[nBarGroupIndex];
// create data
sal_Int32 nSourceIndex = 0; // index into aData sequence
@@ -114,7 +115,7 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
// 1. categories
if( bHasCategories )
{
- xCategories.set( aData[nSourceIndex] );
+ xCategories = aData[nSourceIndex];
++nSourceIndex;
}
@@ -124,42 +125,42 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
// bar
if( bHasVolume )
{
- pBarGroup[nLabeledSeqIdx].realloc( 1 );
- pBarGroup[nLabeledSeqIdx].getArray()[0].set( aData[nSourceIndex] );
+ pBarGroup[nLabeledSeqIdx].resize( 1 );
+ pBarGroup[nLabeledSeqIdx][0] = aData[nSourceIndex];
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-y");
+ SetRole( aData[nSourceIndex]->getValues(), u"values-y"_ustr);
++nSourceIndex;
}
sal_Int32 nSeqIdx = 0;
if( bHasOpenValues )
{
- pCandleStickGroup[nLabeledSeqIdx].realloc( 4 );
- pCandleStickGroup[nLabeledSeqIdx].getArray()[nSeqIdx].set( aData[nSourceIndex] );
+ pCandleStickGroup[nLabeledSeqIdx].resize( 4 );
+ pCandleStickGroup[nLabeledSeqIdx][nSeqIdx] = aData[nSourceIndex];
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-first");
+ SetRole( aData[nSourceIndex]->getValues(), u"values-first"_ustr);
++nSourceIndex;
++nSeqIdx;
}
else
- pCandleStickGroup[nLabeledSeqIdx].realloc( 3 );
- auto pLabeledSeq = pCandleStickGroup[nLabeledSeqIdx].getArray();
+ pCandleStickGroup[nLabeledSeqIdx].resize( 3 );
+ auto & pLabeledSeq = pCandleStickGroup[nLabeledSeqIdx];
- pLabeledSeq[nSeqIdx].set( aData[nSourceIndex] );
+ pLabeledSeq[nSeqIdx] = aData[nSourceIndex];
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-min");
+ SetRole( aData[nSourceIndex]->getValues(), u"values-min"_ustr);
++nSourceIndex;
++nSeqIdx;
- pLabeledSeq[nSeqIdx].set( aData[nSourceIndex] );
+ pLabeledSeq[nSeqIdx] = aData[nSourceIndex];
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-max");
+ SetRole( aData[nSourceIndex]->getValues(), u"values-max"_ustr);
++nSourceIndex;
++nSeqIdx;
- pLabeledSeq[nSeqIdx].set( aData[nSourceIndex] );
+ pLabeledSeq[nSeqIdx] = aData[nSourceIndex];
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-last");
+ SetRole( aData[nSourceIndex]->getValues(), u"values-last"_ustr);
++nSourceIndex;
++nSeqIdx;
}
@@ -168,11 +169,11 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
if( bHasVolume && nRemaining > 1 )
{
OSL_ASSERT( nVolumeSeries > nNumOfFullSeries );
- pBarGroup[nVolumeSeries - 1].realloc( 1 );
+ pBarGroup[nVolumeSeries - 1].resize( 1 );
OSL_ASSERT( nDataCount > nSourceIndex );
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-y");
- pBarGroup[nVolumeSeries - 1].getArray()[0].set( aData[nSourceIndex] );
+ SetRole( aData[nSourceIndex]->getValues(), u"values-y"_ustr);
+ pBarGroup[nVolumeSeries - 1][0] = aData[nSourceIndex];
++nSourceIndex;
--nRemaining;
OSL_ENSURE( nRemaining, "additional bar should only be used if there is at least one more sequence for a candle stick" );
@@ -183,24 +184,24 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
{
OSL_ASSERT( nCandleStickSeries > nNumOfFullSeries );
const sal_Int32 nSeriesIndex = nCandleStickSeries - 1;
- pCandleStickGroup[nSeriesIndex].realloc( nRemaining );
- auto pLabeledSeq = pCandleStickGroup[nSeriesIndex].getArray();
+ pCandleStickGroup[nSeriesIndex].resize( nRemaining );
+ auto & pLabeledSeq = pCandleStickGroup[nSeriesIndex];
OSL_ASSERT( nDataCount > nSourceIndex );
// 1. low
sal_Int32 nSeqIdx( 0 );
- pLabeledSeq[nSeqIdx].set( aData[nSourceIndex] );
+ pLabeledSeq[nSeqIdx] = aData[nSourceIndex];
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-min");
+ SetRole( aData[nSourceIndex]->getValues(), u"values-min"_ustr);
++nSourceIndex;
++nSeqIdx;
// 2. high
if( nSeqIdx < nRemaining )
{
- pLabeledSeq[nSeqIdx].set( aData[nSourceIndex] );
+ pLabeledSeq[nSeqIdx] = aData[nSourceIndex];
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-max");
+ SetRole( aData[nSourceIndex]->getValues(), u"values-max"_ustr);
++nSourceIndex;
++nSeqIdx;
}
@@ -209,9 +210,9 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
OSL_ENSURE( bHasOpenValues || nSeqIdx >= nRemaining, "could have created full series" );
if( nSeqIdx < nRemaining )
{
- pLabeledSeq[nSeqIdx].set( aData[nSourceIndex] );
+ pLabeledSeq[nSeqIdx] = aData[nSourceIndex];
if( aData[nSourceIndex].is())
- SetRole( aData[nSourceIndex]->getValues(), "values-last");
+ SetRole( aData[nSourceIndex]->getValues(), u"values-last"_ustr);
++nSourceIndex;
++nSeqIdx;
}
@@ -221,27 +222,26 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
}
// create DataSeries
- Sequence< Sequence< Reference< XDataSeries > > > aResultSeries( nNumberOfGroups );
- auto pResultSeries = aResultSeries.getArray();
- sal_Int32 nGroupIndex, nReUsedSeriesIdx = 0;
+ std::vector< std::vector< rtl::Reference< DataSeries > > > aResultSeries( nNumberOfGroups );
+ sal_Int32 nGroupIndex;
+ std::size_t nReUsedSeriesIdx = 0;
for( nGroupIndex=0; nGroupIndex<nNumberOfGroups; ++nGroupIndex )
{
- const sal_Int32 nNumSeriesData = aSequences[nGroupIndex].getLength();
- pResultSeries[nGroupIndex].realloc( nNumSeriesData );
- auto pResultSerie = pResultSeries[nGroupIndex].getArray();
+ const sal_Int32 nNumSeriesData = aSequences[nGroupIndex].size();
+ aResultSeries[nGroupIndex].resize( nNumSeriesData );
+ auto & pResultSerie = aResultSeries[nGroupIndex];
for( sal_Int32 nSeriesIdx = 0; nSeriesIdx < nNumSeriesData; ++nSeriesIdx, ++nReUsedSeriesIdx )
{
try
{
- Reference< XDataSeries > xSeries;
- if( nReUsedSeriesIdx < rSeriesToReUse.getLength())
- xSeries.set( rSeriesToReUse[nReUsedSeriesIdx] );
+ rtl::Reference< DataSeries > xSeries;
+ if( nReUsedSeriesIdx < rSeriesToReUse.size())
+ xSeries = rSeriesToReUse[nReUsedSeriesIdx];
else
- xSeries.set( new DataSeries );
- OSL_ASSERT( xSeries.is() );
- Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY_THROW );
- xSink->setData( aSequences[nGroupIndex][nSeriesIdx] );
- pResultSerie[nSeriesIdx].set( xSeries );
+ xSeries = new DataSeries;
+ assert( xSeries.is() );
+ xSeries->setData( aSequences[nGroupIndex][nSeriesIdx] );
+ pResultSerie[nSeriesIdx] = std::move(xSeries);
}
catch( const uno::Exception & )
{
@@ -250,7 +250,7 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
}
}
- return InterpretedData( aResultSeries, xCategories );
+ return { std::move(aResultSeries), xCategories };
}
// criterion: there must be two groups for stock-charts with volume and all
@@ -258,11 +258,11 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource(
// todo: skip first criterion? (to allow easy switch from stock-chart without
// volume to one with volume)
-sal_Bool SAL_CALL StockDataInterpreter::isDataCompatible(
+bool StockDataInterpreter::isDataCompatible(
const InterpretedData& aInterpretedData )
{
// high/low/close
- sal_Int32 nNumberOfNecessarySequences = 3;
+ std::size_t nNumberOfNecessarySequences = 3;
// open
StockChartTypeTemplate::StockVariant eVar( GetStockVariant());
if( ( eVar == StockChartTypeTemplate::StockVariant::Open ) ||
@@ -273,32 +273,30 @@ sal_Bool SAL_CALL StockDataInterpreter::isDataCompatible(
( eVar == StockChartTypeTemplate::StockVariant::VolumeOpen ));
// 1. correct number of sub-types
- if( aInterpretedData.Series.getLength() < (bHasVolume ? 2 : 1 ))
+ if( aInterpretedData.Series.size() < (bHasVolume ? 2U : 1U ))
return false;
// 2. a. volume -- use default check
if( bHasVolume )
{
if( ! DataInterpreter::isDataCompatible(
- InterpretedData( Sequence< Sequence< Reference< XDataSeries > > >(
- aInterpretedData.Series.getConstArray(), 1 ),
- aInterpretedData.Categories )))
+ { std::vector< std::vector< rtl::Reference< DataSeries > > >{
+ aInterpretedData.Series[0] },
+ aInterpretedData.Categories }))
return false;
}
// 2. b. candlestick
{
- OSL_ASSERT( aInterpretedData.Series.getLength() > (bHasVolume ? 1 : 0));
- const Sequence< Reference< XDataSeries > > aSeries( aInterpretedData.Series[(bHasVolume ? 1 : 0)] );
- if(!aSeries.hasElements())
+ OSL_ASSERT( aInterpretedData.Series.size() > (bHasVolume ? 1U : 0U));
+ const std::vector< rtl::Reference< DataSeries > > & aSeries = aInterpretedData.Series[(bHasVolume ? 1 : 0)];
+ if(aSeries.empty())
return false;
- for( Reference< XDataSeries > const & dataSeries : aSeries )
+ for( rtl::Reference< DataSeries > const & dataSeries : aSeries )
{
try
{
- Reference< data::XDataSource > xSrc( dataSeries, uno::UNO_QUERY_THROW );
- Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSrc->getDataSequences());
- if( aSeq.getLength() != nNumberOfNecessarySequences )
+ if( dataSeries->getDataSequences2().size() != nNumberOfNecessarySequences )
return false;
}
catch( const uno::Exception & )
@@ -314,14 +312,14 @@ sal_Bool SAL_CALL StockDataInterpreter::isDataCompatible(
return true;
}
-InterpretedData SAL_CALL StockDataInterpreter::reinterpretDataSeries(
+InterpretedData StockDataInterpreter::reinterpretDataSeries(
const InterpretedData& aInterpretedData )
{
// prerequisite: StockDataInterpreter::isDataCompatible() returned true
return aInterpretedData;
}
-uno::Any SAL_CALL StockDataInterpreter::getChartTypeSpecificData(
+uno::Any StockDataInterpreter::getChartTypeSpecificData(
const OUString& sKey )
{
if( sKey == "stock variant" )
diff --git a/chart2/source/model/template/StockDataInterpreter.hxx b/chart2/source/model/template/StockDataInterpreter.hxx
index ba2d5ee79111..4617da5974a9 100644
--- a/chart2/source/model/template/StockDataInterpreter.hxx
+++ b/chart2/source/model/template/StockDataInterpreter.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "DataInterpreter.hxx"
+#include <DataInterpreter.hxx>
#include "StockChartTypeTemplate.hxx"
@@ -34,15 +34,15 @@ public:
protected:
// ____ XDataInterpreter ____
- virtual css::chart2::InterpretedData SAL_CALL interpretDataSource(
+ virtual InterpretedData interpretDataSource(
const css::uno::Reference< css::chart2::data::XDataSource >& xSource,
const css::uno::Sequence< css::beans::PropertyValue >& aArguments,
- const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > >& aSeriesToReUse ) override;
- virtual sal_Bool SAL_CALL isDataCompatible(
- const css::chart2::InterpretedData& aInterpretedData ) override;
- virtual css::chart2::InterpretedData SAL_CALL reinterpretDataSeries(
- const css::chart2::InterpretedData& aInterpretedData ) override;
- virtual css::uno::Any SAL_CALL getChartTypeSpecificData(
+ const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse ) override;
+ virtual bool isDataCompatible(
+ const InterpretedData& aInterpretedData ) override;
+ virtual InterpretedData reinterpretDataSeries(
+ const InterpretedData& aInterpretedData ) override;
+ virtual css::uno::Any getChartTypeSpecificData(
const OUString& sKey ) override;
private:
diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx
index 1f0480a28c39..d6daa2a5b1d9 100644
--- a/chart2/source/model/template/XYDataInterpreter.cxx
+++ b/chart2/source/model/template/XYDataInterpreter.cxx
@@ -17,18 +17,20 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include "XYDataInterpreter.hxx"
#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <CommonConverters.hxx>
-#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -45,36 +47,36 @@ XYDataInterpreter::~XYDataInterpreter()
}
// ____ XDataInterpreter ____
-chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
+InterpretedData XYDataInterpreter::interpretDataSource(
const Reference< chart2::data::XDataSource >& xSource,
const Sequence< beans::PropertyValue >& aArguments,
- const Sequence< Reference< XDataSeries > >& aSeriesToReUse )
+ const std::vector< rtl::Reference< DataSeries > >& aSeriesToReUse )
{
if( ! xSource.is())
return InterpretedData();
- const Sequence< Reference< data::XLabeledDataSequence > > aData( xSource->getDataSequences() );
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aData = DataInterpreter::getDataSequences(xSource);
- Reference< data::XLabeledDataSequence > xValuesX;
- vector< Reference< data::XLabeledDataSequence > > aSequencesVec;
+ uno::Reference< chart2::data::XLabeledDataSequence > xValuesX;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aSequencesVec;
- Reference< data::XLabeledDataSequence > xCategories;
+ uno::Reference< chart2::data::XLabeledDataSequence > xCategories;
bool bHasCategories = HasCategories( aArguments, aData );
bool bUseCategoriesAsX = UseCategoriesAsX( aArguments );
// parse data
bool bCategoriesUsed = false;
- bool bSetXValues = aData.getLength()>1;
- for( Reference< data::XLabeledDataSequence > const & labelData : aData )
+ bool bSetXValues = aData.size()>1;
+ for( uno::Reference< chart2::data::XLabeledDataSequence > const & labelData : aData )
{
try
{
if( bHasCategories && ! bCategoriesUsed )
{
- xCategories.set( labelData );
+ xCategories = labelData;
if( xCategories.is())
{
- SetRole( xCategories->getValues(), "categories");
+ SetRole( xCategories->getValues(), u"categories"_ustr);
if( bUseCategoriesAsX )
bSetXValues = false;
}
@@ -82,15 +84,15 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
}
else if( !xValuesX.is() && bSetXValues )
{
- xValuesX.set( labelData );
+ xValuesX = labelData;
if( xValuesX.is())
- SetRole( xValuesX->getValues(), "values-x");
+ SetRole( xValuesX->getValues(), u"values-x"_ustr);
}
else
{
aSequencesVec.push_back( labelData );
if( labelData.is())
- SetRole( labelData->getValues(), "values-y");
+ SetRole( labelData->getValues(), u"values-y"_ustr);
}
}
catch( const uno::Exception & )
@@ -100,16 +102,16 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
}
// create DataSeries
- vector< Reference< XDataSeries > > aSeriesVec;
+ std::vector< rtl::Reference< DataSeries > > aSeriesVec;
aSeriesVec.reserve( aSequencesVec.size());
Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX;
Reference< util::XCloneable > xCloneable( xValuesX, uno::UNO_QUERY );
- sal_Int32 nSeriesIndex = 0;
+ std::size_t nSeriesIndex = 0;
for (auto const& elem : aSequencesVec)
{
- vector< Reference< data::XLabeledDataSequence > > aNewData;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewData;
if( nSeriesIndex && xCloneable.is() )
xClonedXValues.set( xCloneable->createClone(), uno::UNO_QUERY );
@@ -118,50 +120,47 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
aNewData.push_back(elem);
- Reference< XDataSeries > xSeries;
- if( nSeriesIndex < aSeriesToReUse.getLength())
- xSeries.set( aSeriesToReUse[nSeriesIndex] );
+ rtl::Reference< DataSeries > xSeries;
+ if( nSeriesIndex < aSeriesToReUse.size())
+ xSeries = aSeriesToReUse[nSeriesIndex];
else
- xSeries.set( new DataSeries );
- OSL_ASSERT( xSeries.is() );
- Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
- OSL_ASSERT( xSink.is() );
- xSink->setData( comphelper::containerToSequence( aNewData ) );
+ xSeries = new DataSeries;
+ assert( xSeries.is() );
+ xSeries->setData( aNewData );
aSeriesVec.push_back( xSeries );
++nSeriesIndex;
}
- return InterpretedData( { comphelper::containerToSequence( aSeriesVec ) }, xCategories );
+ return { { std::move(aSeriesVec) }, xCategories };
}
-chart2::InterpretedData SAL_CALL XYDataInterpreter::reinterpretDataSeries(
- const chart2::InterpretedData& aInterpretedData )
+InterpretedData XYDataInterpreter::reinterpretDataSeries(
+ const InterpretedData& aInterpretedData )
{
InterpretedData aResult( aInterpretedData );
sal_Int32 i=0;
- Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
- const sal_Int32 nCount = aSeries.getLength();
+ std::vector< rtl::Reference< DataSeries > > aSeries = FlattenSequence( aInterpretedData.Series );
+ const sal_Int32 nCount = aSeries.size();
for( ; i<nCount; ++i )
{
try
{
- Reference< data::XDataSource > xSeriesSource( aSeries[i], uno::UNO_QUERY_THROW );
- Sequence< Reference< data::XLabeledDataSequence > > aNewSequences;
+ std::vector< uno::Reference< data::XLabeledDataSequence > > aNewSequences;
// values-y
- Reference< data::XLabeledDataSequence > xValuesY(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, "values-y" ));
- Reference< data::XLabeledDataSequence > xValuesX(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, "values-x" ));
+ uno::Reference< chart2::data::XLabeledDataSequence > xValuesY(
+ DataSeriesHelper::getDataSequenceByRole( aSeries[i], u"values-y"_ustr ));
+ uno::Reference< chart2::data::XLabeledDataSequence > xValuesX(
+ DataSeriesHelper::getDataSequenceByRole( aSeries[i], u"values-x"_ustr ));
// re-use values-... as values-x/values-y
if( ! xValuesX.is() ||
! xValuesY.is())
{
- vector< Reference< data::XLabeledDataSequence > > aValueSeqVec(
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aValueSeqVec(
DataSeriesHelper::getAllDataSequencesByRole(
- xSeriesSource->getDataSequences(), "values" ));
+ aSeries[i]->getDataSequences2(), u"values"_ustr ));
if( xValuesX.is())
aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX ));
if( xValuesY.is())
@@ -171,17 +170,17 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::reinterpretDataSeries(
if( ! xValuesY.is() &&
aValueSeqVec.size() > nIndex )
{
- xValuesY.set( aValueSeqVec[nIndex++] );
+ xValuesY = aValueSeqVec[nIndex++];
if( xValuesY.is())
- SetRole( xValuesY->getValues(), "values-y");
+ SetRole( xValuesY->getValues(), u"values-y"_ustr);
}
if( ! xValuesX.is() &&
aValueSeqVec.size() > nIndex )
{
- xValuesX.set( aValueSeqVec[nIndex++] );
+ xValuesX = aValueSeqVec[nIndex++];
if( xValuesX.is())
- SetRole( xValuesY->getValues(), "values-x");
+ SetRole( xValuesX->getValues(), u"values-x"_ustr);
}
}
if( xValuesY.is())
@@ -196,8 +195,8 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::reinterpretDataSeries(
}
}
- const Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences());
- if( aSeqs.getLength() != aNewSequences.getLength() )
+ const std::vector< uno::Reference< data::XLabeledDataSequence > > & aSeqs = aSeries[i]->getDataSequences2();
+ if( aSeqs.size() != aNewSequences.size() )
{
#ifdef DBG_UTIL
for( auto const & j : aSeqs )
@@ -205,8 +204,7 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::reinterpretDataSeries(
SAL_WARN_IF((j == xValuesY || j == xValuesX), "chart2.template", "All sequences should be used" );
}
#endif
- Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW );
- xSink->setData( aNewSequences );
+ aSeries[i]->setData( aNewSequences );
}
}
catch( const uno::Exception & )
@@ -219,17 +217,15 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::reinterpretDataSeries(
}
// criterion: all series must have exactly two data::XLabeledDataSequences
-sal_Bool SAL_CALL XYDataInterpreter::isDataCompatible(
- const chart2::InterpretedData& aInterpretedData )
+bool XYDataInterpreter::isDataCompatible(
+ const InterpretedData& aInterpretedData )
{
- const Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
- for( Reference< XDataSeries > const & dataSeries : aSeries )
+ const std::vector< rtl::Reference< DataSeries > > aSeries = FlattenSequence( aInterpretedData.Series );
+ for( rtl::Reference< DataSeries > const & dataSeries : aSeries )
{
try
{
- Reference< data::XDataSource > xSrc( dataSeries, uno::UNO_QUERY_THROW );
- Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSrc->getDataSequences());
- if( aSeq.getLength() != 2 )
+ if( dataSeries->getDataSequences2().size() != 2 )
return false;
}
catch( const uno::Exception & )
diff --git a/chart2/source/model/template/XYDataInterpreter.hxx b/chart2/source/model/template/XYDataInterpreter.hxx
index 24f640c143f6..56343013da08 100644
--- a/chart2/source/model/template/XYDataInterpreter.hxx
+++ b/chart2/source/model/template/XYDataInterpreter.hxx
@@ -18,7 +18,7 @@
*/
#pragma once
-#include "DataInterpreter.hxx"
+#include <DataInterpreter.hxx>
namespace chart
{
@@ -30,15 +30,15 @@ public:
virtual ~XYDataInterpreter() override;
protected:
- // ____ XDataInterpreter ____
- virtual css::chart2::InterpretedData SAL_CALL interpretDataSource(
+ // ____ DataInterpreter ____
+ virtual InterpretedData interpretDataSource(
const css::uno::Reference< css::chart2::data::XDataSource >& xSource,
const css::uno::Sequence< css::beans::PropertyValue >& aArguments,
- const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > >& aSeriesToReUse ) override;
- virtual css::chart2::InterpretedData SAL_CALL reinterpretDataSeries(
- const css::chart2::InterpretedData& aInterpretedData ) override;
- virtual sal_Bool SAL_CALL isDataCompatible(
- const css::chart2::InterpretedData& aInterpretedData ) override;
+ const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse ) override;
+ virtual InterpretedData reinterpretDataSeries(
+ const InterpretedData& aInterpretedData ) override;
+ virtual bool isDataCompatible(
+ const InterpretedData& aInterpretedData ) override;
};
} // namespace chart
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index d936cf59c92b..51336ebc5a49 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -21,35 +21,36 @@
#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <ChartTypeHelper.hxx>
+#include <ChartType.hxx>
+#include <Axis.hxx>
#include <AxisIndexDefines.hxx>
+#include <DataSource.hxx>
#include <LinePropertiesHelper.hxx>
#include <servicenames_coosystems.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <Scaling.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
#include <DataSourceHelper.hxx>
#include <ReferenceSizeProvider.hxx>
#include <ExplicitCategoriesProvider.hxx>
#include <unonames.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <GridProperties.hxx>
+#include <o3tl/safeint.hxx>
#include <unotools/saveopt.hxx>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <sal/log.hxx>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <comphelper/sequence.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <cstddef>
#include <map>
namespace chart
@@ -75,15 +76,13 @@ ScaleData AxisHelper::createDefaultScale()
aScaleData.AxisType = chart2::AxisType::REALNUMBER;
aScaleData.AutoDateAxis = true;
aScaleData.ShiftedCategoryPosition = false;
- Sequence< SubIncrement > aSubIncrements{ SubIncrement() };
- aScaleData.IncrementData.SubIncrements = aSubIncrements;
+ aScaleData.IncrementData.SubIncrements = { SubIncrement() };
return aScaleData;
}
void AxisHelper::removeExplicitScaling( ScaleData& rScaleData )
{
- uno::Any aEmpty;
- rScaleData.Minimum = rScaleData.Maximum = rScaleData.Origin = aEmpty;
+ rScaleData.Minimum = rScaleData.Maximum = rScaleData.Origin = uno::Any();
rScaleData.Scaling = nullptr;
ScaleData aDefaultScale( createDefaultScale() );
rScaleData.IncrementData = aDefaultScale.IncrementData;
@@ -97,22 +96,22 @@ bool AxisHelper::isLogarithmic( const Reference< XScaling >& xScaling )
&& xServiceName->getServiceName() == "com.sun.star.chart2.LogarithmicScaling";
}
-chart2::ScaleData AxisHelper::getDateCheckedScale( const Reference< chart2::XAxis >& xAxis, ChartModel& rModel )
+chart2::ScaleData AxisHelper::getDateCheckedScale( const rtl::Reference< Axis >& xAxis, ChartModel& rModel )
{
ScaleData aScale = xAxis->getScaleData();
- Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( rModel ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys( rModel.getFirstCoordinateSystem() );
if( aScale.AutoDateAxis && aScale.AxisType == AxisType::CATEGORY )
{
sal_Int32 nDimensionIndex=0; sal_Int32 nAxisIndex=0;
AxisHelper::getIndicesForAxis(xAxis, xCooSys, nDimensionIndex, nAxisIndex );
- bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), nDimensionIndex );
+ auto xChartType = AxisHelper::getChartTypeByIndex(xCooSys, 0);
+ bool bChartTypeAllowsDateAxis = xChartType.is() ? xChartType->isSupportingDateAxis(nDimensionIndex) : true;
if( bChartTypeAllowsDateAxis )
aScale.AxisType = AxisType::DATE;
}
if( aScale.AxisType == AxisType::DATE )
{
- ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, rModel );
- if( !aExplicitCategoriesProvider.isDateAxis() )
+ if( !xCooSys || !xCooSys->getExplicitCategoriesProvider(rModel).isDateAxis() )
aScale.AxisType = AxisType::CATEGORY;
}
return aScale;
@@ -133,41 +132,33 @@ void AxisHelper::checkDateAxis( chart2::ScaleData& rScale, ExplicitCategoriesPro
}
sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
- const Reference< chart2::XAxis >& xAxis
- , const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
- , const Reference<chart2::XChartDocument>& xChartDoc
+ const rtl::Reference< Axis >& xAxis
+ , const rtl::Reference< BaseCoordinateSystem > & xCorrespondingCoordinateSystem
+ , const rtl::Reference<ChartModel>& xChartDoc
, bool bSearchForParallelAxisIfNothingIsFound )
{
sal_Int32 nNumberFormatKey(0);
sal_Int32 nAxisIndex = 0;
sal_Int32 nDimensionIndex = 1;
AxisHelper::getIndicesForAxis( xAxis, xCorrespondingCoordinateSystem, nDimensionIndex, nAxisIndex );
- Reference<util::XNumberFormatsSupplier> const xNumberFormatsSupplier(xChartDoc, uno::UNO_QUERY);
- Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
- if (!xProp.is())
+ if (!xAxis.is())
return 0;
bool bLinkToSource = true;
- xProp->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
- xProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey;
+ xAxis->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
+ xAxis->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey;
if (bLinkToSource)
{
bool bFormatSet = false;
//check whether we have a percent scale -> use percent format
- ChartModel* pModel = nullptr;
- if( xNumberFormatsSupplier.is() )
+ if (xChartDoc)
{
- pModel = dynamic_cast<ChartModel*>( xChartDoc.get() );
- assert(pModel);
- }
- if (pModel)
- {
- ScaleData aData = AxisHelper::getDateCheckedScale( xAxis, *pModel );
+ ScaleData aData = AxisHelper::getDateCheckedScale( xAxis, *xChartDoc );
if( aData.AxisType==AxisType::PERCENT )
{
- sal_Int32 nPercentFormat = DiagramHelper::getPercentNumberFormat( xNumberFormatsSupplier );
+ sal_Int32 nPercentFormat = DiagramHelper::getPercentNumberFormat( xChartDoc );
if( nPercentFormat != -1 )
{
nNumberFormatKey = nPercentFormat;
@@ -182,27 +173,27 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
if( xSeq.is() && !( xChartDoc.is() && xChartDoc->hasInternalDataProvider()) )
nNumberFormatKey = xSeq->getNumberFormatKeyByIndex( -1 );
else
- nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xChartDoc );
bFormatSet = true;
}
}
else if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() && nDimensionIndex == 0 ) //maybe date axis
{
- Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram() );
- if( DiagramHelper::isSupportingDateAxis( xDiagram ) )
+ rtl::Reference< Diagram > xDiagram( xChartDoc->getFirstChartDiagram() );
+ if( xDiagram->isSupportingDateAxis() )
{
- nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xChartDoc );
}
else
{
- Reference< data::XDataSource > xSource( DataSourceHelper::getUsedData( xChartDoc ) );
+ rtl::Reference< DataSource > xSource = DataSourceHelper::getUsedData( *xChartDoc );
if( xSource.is() )
{
- std::vector< Reference< chart2::data::XLabeledDataSequence > > aXValues(
- DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), "values-x" ) );
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aXValues(
+ DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), u"values-x"_ustr ) );
if( aXValues.empty() )
{
- Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
+ uno::Reference< chart2::data::XLabeledDataSequence > xCategories( xDiagram->getCategories() );
if( xCategories.is() )
{
Reference< data::XDataSequence > xSeq( xCategories->getValues());
@@ -221,7 +212,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
}
}
if( bHasValidDoubles )
- nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xChartDoc );
}
}
}
@@ -238,31 +229,26 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
try
{
- Reference< XChartTypeContainer > xCTCnt( xCorrespondingCoordinateSystem, uno::UNO_QUERY_THROW );
OUString aRoleToMatch;
if( nDimensionIndex == 0 )
aRoleToMatch = "values-x";
- const Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
- for( Reference< XChartType > const & chartType : aChartTypes )
+ const std::vector< rtl::Reference< ChartType > > & aChartTypes( xCorrespondingCoordinateSystem->getChartTypes2());
+ for( rtl::Reference< ChartType > const & chartType : aChartTypes )
{
if( nDimensionIndex != 0 )
aRoleToMatch = ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( chartType );
- Reference< XDataSeriesContainer > xDSCnt( chartType, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries());
- for( Reference< chart2::XDataSeries > const & xDataSeries : aDataSeriesSeq )
+ for( rtl::Reference< DataSeries > const & xDataSeries : chartType->getDataSeries2() )
{
- Reference< data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY_THROW );
-
if( nDimensionIndex == 1 )
{
//only take those series into account that are attached to this axis
- sal_Int32 nAttachedAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
+ sal_Int32 nAttachedAxisIndex = xDataSeries->getAttachedAxisIndex();
if( nAttachedAxisIndex != nAxisIndex )
continue;
}
Reference< data::XLabeledDataSequence > xLabeledSeq(
- DataSeriesHelper::getDataSequenceByRole( xSource, aRoleToMatch ) );
+ DataSeriesHelper::getDataSequenceByRole( xDataSeries, aRoleToMatch ) );
if( !xLabeledSeq.is() && nDimensionIndex==0 )
{
@@ -315,7 +301,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
if( !bNumberFormatKeyFoundViaAttachedData && nDimensionIndex == 1 )
{
sal_Int32 nParallelAxisIndex = (nAxisIndex==1) ?0 :1;
- Reference< XAxis > xParallelAxis( AxisHelper::getAxis( 1, nParallelAxisIndex, xCorrespondingCoordinateSystem ) );
+ rtl::Reference< Axis > xParallelAxis = AxisHelper::getAxis( 1, nParallelAxisIndex, xCorrespondingCoordinateSystem );
nNumberFormatKey = AxisHelper::getExplicitNumberFormatKeyForAxis(xParallelAxis, xCorrespondingCoordinateSystem, xChartDoc, false);
}
}
@@ -325,10 +311,10 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
return nNumberFormatKey;
}
-Reference< XAxis > AxisHelper::createAxis(
+rtl::Reference< Axis > AxisHelper::createAxis(
sal_Int32 nDimensionIndex
, sal_Int32 nAxisIndex // 0==main or 1==secondary axis
- , const Reference< XCoordinateSystem >& xCooSys
+ , const rtl::Reference< BaseCoordinateSystem >& xCooSys
, const Reference< uno::XComponentContext > & xContext
, ReferenceSizeProvider * pRefSizeProvider )
{
@@ -337,65 +323,53 @@ Reference< XAxis > AxisHelper::createAxis(
if( nDimensionIndex >= xCooSys->getDimension() )
return nullptr;
- Reference< XAxis > xAxis( xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.Axis", xContext ), uno::UNO_QUERY );
+ rtl::Reference< Axis > xAxis = new Axis();
- OSL_ASSERT( xAxis.is());
- if( xAxis.is())
+ xCooSys->setAxisByDimension( nDimensionIndex, xAxis, nAxisIndex );
+
+ if( nAxisIndex>0 )//when inserting secondary axes copy some things from the main axis
{
- xCooSys->setAxisByDimension( nDimensionIndex, xAxis, nAxisIndex );
+ css::chart::ChartAxisPosition eNewAxisPos( css::chart::ChartAxisPosition_END );
- if( nAxisIndex>0 )//when inserting secondary axes copy some things from the main axis
+ rtl::Reference< Axis > xMainAxis = xCooSys->getAxisByDimension2( nDimensionIndex, 0 );
+ if( xMainAxis.is() )
{
- css::chart::ChartAxisPosition eNewAxisPos( css::chart::ChartAxisPosition_END );
-
- Reference< XAxis > xMainAxis( xCooSys->getAxisByDimension( nDimensionIndex, 0 ) );
- if( xMainAxis.is() )
- {
- ScaleData aScale = xAxis->getScaleData();
- ScaleData aMainScale = xMainAxis->getScaleData();
-
- aScale.AxisType = aMainScale.AxisType;
- aScale.AutoDateAxis = aMainScale.AutoDateAxis;
- aScale.Categories = aMainScale.Categories;
- aScale.Orientation = aMainScale.Orientation;
- aScale.ShiftedCategoryPosition = aMainScale.ShiftedCategoryPosition;
-
- xAxis->setScaleData( aScale );
-
- //ensure that the second axis is not placed on the main axis
- Reference< beans::XPropertySet > xMainProp( xMainAxis, uno::UNO_QUERY );
- if( xMainProp.is() )
- {
- css::chart::ChartAxisPosition eMainAxisPos( css::chart::ChartAxisPosition_ZERO );
- xMainProp->getPropertyValue("CrossoverPosition") >>= eMainAxisPos;
- if( eMainAxisPos == css::chart::ChartAxisPosition_END )
- eNewAxisPos = css::chart::ChartAxisPosition_START;
- }
- }
-
- Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
- if( xProp.is() )
- xProp->setPropertyValue("CrossoverPosition", uno::Any(eNewAxisPos) );
+ ScaleData aScale = xAxis->getScaleData();
+ ScaleData aMainScale = xMainAxis->getScaleData();
+
+ aScale.AxisType = aMainScale.AxisType;
+ aScale.AutoDateAxis = aMainScale.AutoDateAxis;
+ aScale.Categories = aMainScale.Categories;
+ aScale.Orientation = aMainScale.Orientation;
+ aScale.ShiftedCategoryPosition = aMainScale.ShiftedCategoryPosition;
+
+ xAxis->setScaleData( aScale );
+
+ //ensure that the second axis is not placed on the main axis
+ css::chart::ChartAxisPosition eMainAxisPos( css::chart::ChartAxisPosition_ZERO );
+ xMainAxis->getPropertyValue(u"CrossoverPosition"_ustr) >>= eMainAxisPos;
+ if( eMainAxisPos == css::chart::ChartAxisPosition_END )
+ eNewAxisPos = css::chart::ChartAxisPosition_START;
}
- Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
- if( xProp.is() ) try
- {
- // set correct initial AutoScale
- if( pRefSizeProvider )
- pRefSizeProvider->setValuesAtPropertySet( xProp );
- }
- catch( const uno::Exception& )
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
+ xAxis->setPropertyValue(u"CrossoverPosition"_ustr, uno::Any(eNewAxisPos) );
+ }
+
+ try
+ {
+ // set correct initial AutoScale
+ if( pRefSizeProvider )
+ pRefSizeProvider->setValuesAtPropertySet( xAxis );
+ }
+ catch( const uno::Exception& )
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
}
return xAxis;
}
-Reference< XAxis > AxisHelper::createAxis( sal_Int32 nDimensionIndex, bool bMainAxis
- , const Reference< chart2::XDiagram >& xDiagram
+rtl::Reference< Axis > AxisHelper::createAxis( sal_Int32 nDimensionIndex, bool bMainAxis
+ , const rtl::Reference< Diagram >& xDiagram
, const Reference< uno::XComponentContext >& xContext
, ReferenceSizeProvider * pRefSizeProvider )
{
@@ -404,7 +378,7 @@ Reference< XAxis > AxisHelper::createAxis( sal_Int32 nDimensionIndex, bool bMain
return nullptr;
sal_Int32 nAxisIndex = bMainAxis ? MAIN_AXIS_INDEX : SECONDARY_AXIS_INDEX;
- Reference< XCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 );
+ rtl::Reference< BaseCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 );
// create axis
return AxisHelper::createAxis(
@@ -412,7 +386,7 @@ Reference< XAxis > AxisHelper::createAxis( sal_Int32 nDimensionIndex, bool bMain
}
void AxisHelper::showAxis( sal_Int32 nDimensionIndex, bool bMainAxis
- , const Reference< chart2::XDiagram >& xDiagram
+ , const rtl::Reference< Diagram >& xDiagram
, const Reference< uno::XComponentContext >& xContext
, ReferenceSizeProvider * pRefSizeProvider )
{
@@ -420,12 +394,12 @@ void AxisHelper::showAxis( sal_Int32 nDimensionIndex, bool bMainAxis
return;
bool bNewAxisCreated = false;
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram );
if( !xAxis.is() && xContext.is() )
{
// create axis
bNewAxisCreated = true;
- xAxis.set( AxisHelper::createAxis( nDimensionIndex, bMainAxis, xDiagram, xContext, pRefSizeProvider ) );
+ xAxis = AxisHelper::createAxis( nDimensionIndex, bMainAxis, xDiagram, xContext, pRefSizeProvider );
}
OSL_ASSERT( xAxis.is());
@@ -434,76 +408,73 @@ void AxisHelper::showAxis( sal_Int32 nDimensionIndex, bool bMainAxis
}
void AxisHelper::showGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
- , const Reference< XDiagram >& xDiagram )
+ , const rtl::Reference< Diagram >& xDiagram )
{
if( !xDiagram.is() )
return;
- Reference< XCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, nCooSysIndex );
+ rtl::Reference< BaseCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, nCooSysIndex );
if(!xCooSys.is())
return;
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, MAIN_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDimensionIndex, MAIN_AXIS_INDEX, xCooSys );
if(!xAxis.is())
{
//hhhh todo create axis without axis visibility
- }
- if(!xAxis.is())
return;
+ }
if( bMainGrid )
- AxisHelper::makeGridVisible( xAxis->getGridProperties() );
+ AxisHelper::makeGridVisible( xAxis->getGridProperties2() );
else
{
- const Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
+ std::vector< rtl::Reference< GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
for( auto const & i : aSubGrids )
AxisHelper::makeGridVisible( i );
}
}
-void AxisHelper::makeAxisVisible( const Reference< XAxis >& xAxis )
+void AxisHelper::makeAxisVisible( const rtl::Reference< Axis >& xAxis )
{
- Reference< beans::XPropertySet > xProps( xAxis, uno::UNO_QUERY );
- if( xProps.is() )
+ if( xAxis.is() )
{
- xProps->setPropertyValue( "Show", uno::Any( true ) );
- LinePropertiesHelper::SetLineVisible( xProps );
- xProps->setPropertyValue( "DisplayLabels", uno::Any( true ) );
+ xAxis->setPropertyValue( u"Show"_ustr, uno::Any( true ) );
+ LinePropertiesHelper::SetLineVisible( xAxis );
+ xAxis->setPropertyValue( u"DisplayLabels"_ustr, uno::Any( true ) );
}
}
-void AxisHelper::makeGridVisible( const Reference< beans::XPropertySet >& xGridProperties )
+void AxisHelper::makeGridVisible( const rtl::Reference< GridProperties >& xGridProperties )
{
if( xGridProperties.is() )
{
- xGridProperties->setPropertyValue( "Show", uno::Any( true ) );
+ xGridProperties->setPropertyValue( u"Show"_ustr, uno::Any( true ) );
LinePropertiesHelper::SetLineVisible( xGridProperties );
}
}
void AxisHelper::hideAxis( sal_Int32 nDimensionIndex, bool bMainAxis
- , const Reference< XDiagram >& xDiagram )
+ , const rtl::Reference< Diagram >& xDiagram )
{
AxisHelper::makeAxisInvisible( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) );
}
-void AxisHelper::makeAxisInvisible( const Reference< XAxis >& xAxis )
+void AxisHelper::makeAxisInvisible( const rtl::Reference< Axis >& xAxis )
{
- Reference< beans::XPropertySet > xProps( xAxis, uno::UNO_QUERY );
- if( xProps.is() )
+ if( xAxis.is() )
{
- xProps->setPropertyValue( "Show", uno::Any( false ) );
+ xAxis->setPropertyValue( u"Show"_ustr, uno::Any( false ) );
}
}
-void AxisHelper::hideAxisIfNoDataIsAttached( const Reference< XAxis >& xAxis, const Reference< XDiagram >& xDiagram )
+void AxisHelper::hideAxisIfNoDataIsAttached( const rtl::Reference< Axis >& xAxis, const rtl::Reference< Diagram >& xDiagram )
{
//axis is hidden if no data is attached anymore but data is available
bool bOtherSeriesAttachedToThisAxis = false;
- std::vector< Reference< chart2::XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector = xDiagram->getDataSeries();
for (auto const& series : aSeriesVector)
{
- uno::Reference< chart2::XAxis > xCurrentAxis = DiagramHelper::getAttachedAxis(series, xDiagram );
+ rtl::Reference< Axis > xCurrentAxis = xDiagram->getAttachedAxis(series);
if( xCurrentAxis==xAxis )
{
bOtherSeriesAttachedToThisAxis = true;
@@ -515,56 +486,56 @@ void AxisHelper::hideAxisIfNoDataIsAttached( const Reference< XAxis >& xAxis, co
}
void AxisHelper::hideGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
- , const Reference< XDiagram >& xDiagram )
+ , const rtl::Reference< Diagram >& xDiagram )
{
if( !xDiagram.is() )
return;
- Reference< XCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, nCooSysIndex );
+ rtl::Reference< BaseCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, nCooSysIndex );
if(!xCooSys.is())
return;
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, MAIN_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDimensionIndex, MAIN_AXIS_INDEX, xCooSys );
if(!xAxis.is())
return;
if( bMainGrid )
- AxisHelper::makeGridInvisible( xAxis->getGridProperties() );
+ AxisHelper::makeGridInvisible( xAxis->getGridProperties2() );
else
{
- const Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
+ std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
for( auto const & i : aSubGrids)
AxisHelper::makeGridInvisible( i );
}
}
-void AxisHelper::makeGridInvisible( const Reference< beans::XPropertySet >& xGridProperties )
+void AxisHelper::makeGridInvisible( const rtl::Reference< ::chart::GridProperties >& xGridProperties )
{
if( xGridProperties.is() )
{
- xGridProperties->setPropertyValue( "Show", uno::Any( false ) );
+ xGridProperties->setPropertyValue( u"Show"_ustr, uno::Any( false ) );
}
}
bool AxisHelper::isGridShown( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid
- , const Reference< css::chart2::XDiagram >& xDiagram )
+ , const rtl::Reference< Diagram >& xDiagram )
{
bool bRet = false;
- Reference< XCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, nCooSysIndex );
+ rtl::Reference< BaseCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, nCooSysIndex );
if(!xCooSys.is())
return bRet;
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, MAIN_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDimensionIndex, MAIN_AXIS_INDEX, xCooSys );
if(!xAxis.is())
return bRet;
if( bMainGrid )
- bRet = AxisHelper::isGridVisible( xAxis->getGridProperties() );
+ bRet = AxisHelper::isGridVisible( xAxis->getGridProperties2() );
else
{
- Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
- if( aSubGrids.hasElements() )
+ std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
+ if( !aSubGrids.empty() )
bRet = AxisHelper::isGridVisible( aSubGrids[0] );
}
@@ -572,26 +543,24 @@ bool AxisHelper::isGridShown( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex,
}
rtl::Reference< ::chart::BaseCoordinateSystem > AxisHelper::getCoordinateSystemByIndex(
- const Reference< XDiagram >& xDiagram, sal_Int32 nIndex )
+ const rtl::Reference< Diagram >& xDiagram, sal_Int32 nIndex )
{
if(!xDiagram.is())
return nullptr;
- ::chart::Diagram* pDiagram = dynamic_cast<::chart::Diagram*>(xDiagram.get());
- assert(pDiagram);
- auto & rCooSysList = pDiagram->getBaseCoordinateSystems();
- if(0<=nIndex && nIndex < static_cast<sal_Int32>(rCooSysList.size()))
- return rCooSysList[nIndex];
+ auto aCooSysList = xDiagram->getBaseCoordinateSystems();
+ if(0<=nIndex && o3tl::make_unsigned(nIndex) < aCooSysList.size())
+ return aCooSysList[nIndex];
return nullptr;
}
-Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, bool bMainAxis
- , const Reference< XDiagram >& xDiagram )
+rtl::Reference< Axis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, bool bMainAxis
+ , const rtl::Reference< Diagram >& xDiagram )
{
- Reference< XAxis > xRet;
+ rtl::Reference< Axis > xRet;
try
{
- Reference< XCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 );
- xRet.set( AxisHelper::getAxis( nDimensionIndex, bMainAxis ? 0 : 1, xCooSys ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 );
+ xRet = AxisHelper::getAxis( nDimensionIndex, bMainAxis ? 0 : 1, xCooSys );
}
catch( const uno::Exception & )
{
@@ -599,10 +568,10 @@ Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, bool bMainAxi
return xRet;
}
-Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex
- , const Reference< XCoordinateSystem >& xCooSys )
+rtl::Reference< Axis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex
+ , const rtl::Reference< BaseCoordinateSystem >& xCooSys )
{
- Reference< XAxis > xRet;
+ rtl::Reference< Axis > xRet;
if(!xCooSys.is())
return xRet;
@@ -614,12 +583,12 @@ Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAx
assert(nAxisIndex >= 0);
assert(nDimensionIndex >= 0);
- xRet.set( xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) );
+ xRet = xCooSys->getAxisByDimension2( nDimensionIndex, nAxisIndex );
return xRet;
}
-Reference< XAxis > AxisHelper::getCrossingMainAxis( const Reference< XAxis >& xAxis
- , const Reference< XCoordinateSystem >& xCooSys )
+rtl::Reference< Axis > AxisHelper::getCrossingMainAxis( const rtl::Reference< Axis >& xAxis
+ , const rtl::Reference< BaseCoordinateSystem >& xCooSys )
{
sal_Int32 nDimensionIndex = 0;
sal_Int32 nAxisIndex = 0;
@@ -628,8 +597,7 @@ Reference< XAxis > AxisHelper::getCrossingMainAxis( const Reference< XAxis >& xA
{
nDimensionIndex=1;
bool bSwapXY = false;
- Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY );
- if( xCooSysProp.is() && (xCooSysProp->getPropertyValue( "SwapXAndYAxis" ) >>= bSwapXY) && bSwapXY )
+ if( (xCooSys->getPropertyValue( u"SwapXAndYAxis"_ustr ) >>= bSwapXY) && bSwapXY )
nDimensionIndex=0;
}
else if( nDimensionIndex==1 )
@@ -639,8 +607,8 @@ Reference< XAxis > AxisHelper::getCrossingMainAxis( const Reference< XAxis >& xA
return AxisHelper::getAxis( nDimensionIndex, 0, xCooSys );
}
-Reference< XAxis > AxisHelper::getParallelAxis( const Reference< XAxis >& xAxis
- , const Reference< XDiagram >& xDiagram )
+rtl::Reference< Axis > AxisHelper::getParallelAxis( const rtl::Reference< Axis >& xAxis
+ , const rtl::Reference< Diagram >& xDiagram )
{
try
{
@@ -660,65 +628,64 @@ Reference< XAxis > AxisHelper::getParallelAxis( const Reference< XAxis >& xAxis
}
bool AxisHelper::isAxisShown( sal_Int32 nDimensionIndex, bool bMainAxis
- , const Reference< XDiagram >& xDiagram )
+ , const rtl::Reference< Diagram >& xDiagram )
{
return AxisHelper::isAxisVisible( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) );
}
-bool AxisHelper::isAxisVisible( const Reference< XAxis >& xAxis )
+bool AxisHelper::isAxisVisible( const rtl::Reference< Axis >& xAxis )
{
bool bRet = false;
- Reference< beans::XPropertySet > xProps( xAxis, uno::UNO_QUERY );
- if( xProps.is() )
+ if( xAxis.is() )
{
- xProps->getPropertyValue( "Show" ) >>= bRet;
- bRet = bRet && ( LinePropertiesHelper::IsLineVisible( xProps )
- || areAxisLabelsVisible( xProps ) );
+ xAxis->getPropertyValue( u"Show"_ustr ) >>= bRet;
+ bRet = bRet && ( LinePropertiesHelper::IsLineVisible( xAxis )
+ || areAxisLabelsVisible( xAxis ) );
}
return bRet;
}
-bool AxisHelper::areAxisLabelsVisible( const Reference< beans::XPropertySet >& xAxisProperties )
+bool AxisHelper::areAxisLabelsVisible( const rtl::Reference< Axis >& xAxis )
{
bool bRet = false;
- if( xAxisProperties.is() )
+ if( xAxis.is() )
{
- xAxisProperties->getPropertyValue( "DisplayLabels" ) >>= bRet;
+ xAxis->getPropertyValue( u"DisplayLabels"_ustr ) >>= bRet;
}
return bRet;
}
-bool AxisHelper::isGridVisible( const Reference< beans::XPropertySet >& xGridproperties )
+bool AxisHelper::isGridVisible( const rtl::Reference< ::chart::GridProperties >& xGridproperties )
{
bool bRet = false;
if( xGridproperties.is() )
{
- xGridproperties->getPropertyValue( "Show" ) >>= bRet;
+ xGridproperties->getPropertyValue( u"Show"_ustr ) >>= bRet;
bRet = bRet && LinePropertiesHelper::IsLineVisible( xGridproperties );
}
return bRet;
}
-Reference< beans::XPropertySet > AxisHelper::getGridProperties(
- const Reference< XCoordinateSystem >& xCooSys
+rtl::Reference< GridProperties > AxisHelper::getGridProperties(
+ const rtl::Reference< BaseCoordinateSystem >& xCooSys
, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex, sal_Int32 nSubGridIndex )
{
- Reference< beans::XPropertySet > xRet;
+ rtl::Reference< GridProperties > xRet;
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, nAxisIndex, xCooSys ) );
+ rtl::Reference< Axis > xAxis( AxisHelper::getAxis( nDimensionIndex, nAxisIndex, xCooSys ) );
if( xAxis.is() )
{
if( nSubGridIndex<0 )
- xRet.set( xAxis->getGridProperties() );
+ xRet = xAxis->getGridProperties2();
else
{
- Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
- if (nSubGridIndex < aSubGrids.getLength())
- xRet.set( aSubGrids[nSubGridIndex] );
+ std::vector< rtl::Reference< GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
+ if (nSubGridIndex < static_cast<sal_Int32>(aSubGrids.size()))
+ xRet = aSubGrids[nSubGridIndex];
}
}
@@ -726,8 +693,8 @@ Reference< beans::XPropertySet > AxisHelper::getGridProperties(
}
sal_Int32 AxisHelper::getDimensionIndexOfAxis(
- const Reference< XAxis >& xAxis
- , const Reference< XDiagram >& xDiagram )
+ const rtl::Reference< Axis >& xAxis
+ , const rtl::Reference< Diagram >& xDiagram )
{
sal_Int32 nDimensionIndex = -1;
sal_Int32 nCooSysIndex = -1;
@@ -737,8 +704,8 @@ sal_Int32 AxisHelper::getDimensionIndexOfAxis(
}
bool AxisHelper::getIndicesForAxis(
- const Reference< XAxis >& xAxis
- , const Reference< XCoordinateSystem >& xCooSys
+ const rtl::Reference< Axis >& xAxis
+ , const rtl::Reference< BaseCoordinateSystem >& xCooSys
, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex )
{
//returns true if indices are found
@@ -749,14 +716,14 @@ bool AxisHelper::getIndicesForAxis(
if( !xCooSys || !xAxis )
return false;
- Reference< XAxis > xCurrentAxis;
+ rtl::Reference< Axis > xCurrentAxis;
sal_Int32 nDimensionCount( xCooSys->getDimension() );
for( sal_Int32 nDimensionIndex = 0; nDimensionIndex < nDimensionCount; nDimensionIndex++ )
{
sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
for( sal_Int32 nAxisIndex = 0; nAxisIndex <= nMaxAxisIndex; nAxisIndex++ )
{
- xCurrentAxis = xCooSys->getAxisByDimension(nDimensionIndex,nAxisIndex);
+ xCurrentAxis = xCooSys->getAxisByDimension2(nDimensionIndex,nAxisIndex);
if( xCurrentAxis == xAxis )
{
rOutDimensionIndex = nDimensionIndex;
@@ -768,7 +735,7 @@ bool AxisHelper::getIndicesForAxis(
return false;
}
-bool AxisHelper::getIndicesForAxis( const Reference< XAxis >& xAxis, const Reference< XDiagram >& xDiagram
+bool AxisHelper::getIndicesForAxis( const rtl::Reference< Axis >& xAxis, const rtl::Reference< Diagram >& xDiagram
, sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex )
{
//returns true if indices are found
@@ -777,28 +744,24 @@ bool AxisHelper::getIndicesForAxis( const Reference< XAxis >& xAxis, const Refer
rOutDimensionIndex = -1;
rOutAxisIndex = -1;
- Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if(xCooSysContainer.is())
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysList = xDiagram->getBaseCoordinateSystems();
+ for( std::size_t nC=0; nC < aCooSysList.size(); ++nC )
{
- Sequence< Reference< XCoordinateSystem > > aCooSysList = xCooSysContainer->getCoordinateSystems();
- for( sal_Int32 nC=0; nC<aCooSysList.getLength(); ++nC )
+ if( AxisHelper::getIndicesForAxis( xAxis, aCooSysList[nC], rOutDimensionIndex, rOutAxisIndex ) )
{
- if( AxisHelper::getIndicesForAxis( xAxis, aCooSysList[nC], rOutDimensionIndex, rOutAxisIndex ) )
- {
- rOutCooSysIndex = nC;
- return true;
- }
+ rOutCooSysIndex = nC;
+ return true;
}
}
return false;
}
-std::vector< Reference< XAxis > > AxisHelper::getAllAxesOfCoordinateSystem(
- const Reference< XCoordinateSystem >& xCooSys
+std::vector< rtl::Reference< Axis > > AxisHelper::getAllAxesOfCoordinateSystem(
+ const rtl::Reference< BaseCoordinateSystem >& xCooSys
, bool bOnlyVisible /* = false */ )
{
- std::vector< Reference< XAxis > > aAxisVector;
+ std::vector< rtl::Reference< Axis > > aAxisVector;
if(xCooSys.is())
{
@@ -813,15 +776,13 @@ std::vector< Reference< XAxis > > AxisHelper::getAllAxesOfCoordinateSystem(
{
try
{
- Reference< XAxis > xAxis( xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) );
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( nDimensionIndex, nAxisIndex );
if( xAxis.is() )
{
bool bAddAxis = true;
if( bOnlyVisible )
{
- Reference< beans::XPropertySet > xAxisProp( xAxis, uno::UNO_QUERY );
- if( !xAxisProp.is() ||
- !(xAxisProp->getPropertyValue( "Show") >>= bAddAxis) )
+ if( !(xAxis->getPropertyValue( u"Show"_ustr) >>= bAddAxis) )
bAddAxis = false;
}
if( bAddAxis )
@@ -840,100 +801,89 @@ std::vector< Reference< XAxis > > AxisHelper::getAllAxesOfCoordinateSystem(
return aAxisVector;
}
-Sequence< Reference< XAxis > > AxisHelper::getAllAxesOfDiagram(
- const Reference< XDiagram >& xDiagram
+std::vector< rtl::Reference< Axis > > AxisHelper::getAllAxesOfDiagram(
+ const rtl::Reference< Diagram >& xDiagram
, bool bOnlyVisible )
{
- std::vector< Reference< XAxis > > aAxisVector;
+ std::vector< rtl::Reference< Axis > > aAxisVector;
- Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if(xCooSysContainer.is())
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : xDiagram->getBaseCoordinateSystems() )
{
- const Sequence< Reference< XCoordinateSystem > > aCooSysList = xCooSysContainer->getCoordinateSystems();
- for( Reference< XCoordinateSystem > const & coords : aCooSysList )
- {
- std::vector< Reference< XAxis > > aAxesPerCooSys( AxisHelper::getAllAxesOfCoordinateSystem( coords, bOnlyVisible ) );
- aAxisVector.insert( aAxisVector.end(), aAxesPerCooSys.begin(), aAxesPerCooSys.end() );
- }
+ std::vector< rtl::Reference< Axis > > aAxesPerCooSys = AxisHelper::getAllAxesOfCoordinateSystem( coords, bOnlyVisible );
+ aAxisVector.insert( aAxisVector.end(), aAxesPerCooSys.begin(), aAxesPerCooSys.end() );
}
- return comphelper::containerToSequence( aAxisVector );
+ return aAxisVector;
}
-Sequence< Reference< beans::XPropertySet > > AxisHelper::getAllGrids( const Reference< XDiagram >& xDiagram )
+std::vector< rtl::Reference< GridProperties > > AxisHelper::getAllGrids( const rtl::Reference< Diagram >& xDiagram )
{
- const Sequence< Reference< XAxis > > aAllAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- std::vector< Reference< beans::XPropertySet > > aGridVector;
+ const std::vector< rtl::Reference< Axis > > aAllAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
+ std::vector< rtl::Reference< GridProperties > > aGridVector;
- for( Reference< XAxis > const & xAxis : aAllAxes )
+ for( rtl::Reference< Axis > const & xAxis : aAllAxes )
{
- if(!xAxis.is())
- continue;
- Reference< beans::XPropertySet > xGridProperties( xAxis->getGridProperties() );
+ rtl::Reference< GridProperties > xGridProperties( xAxis->getGridProperties2() );
if( xGridProperties.is() )
aGridVector.push_back( xGridProperties );
- const Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
- for( Reference< beans::XPropertySet > const & xSubGrid : aSubGrids )
+ std::vector< rtl::Reference< GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
+ for( rtl::Reference< GridProperties > const & xSubGrid : aSubGrids )
{
if( xSubGrid.is() )
aGridVector.push_back( xSubGrid );
}
}
- return comphelper::containerToSequence( aGridVector );
+ return aGridVector;
}
void AxisHelper::getAxisOrGridPossibilities( Sequence< sal_Bool >& rPossibilityList
- , const Reference< XDiagram>& xDiagram, bool bAxis )
+ , const rtl::Reference< Diagram>& xDiagram, bool bAxis )
{
rPossibilityList.realloc(6);
sal_Bool* pPossibilityList = rPossibilityList.getArray();
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
+ sal_Int32 nDimensionCount = -1;
+ if (xDiagram)
+ nDimensionCount = xDiagram->getDimension();
//set possibilities:
sal_Int32 nIndex=0;
- Reference< XChartType > xChartType = DiagramHelper::getChartTypeByIndex( xDiagram, 0 );
+ rtl::Reference< ChartType > xChartType;
+ if (xDiagram)
+ xChartType = xDiagram->getChartTypeByIndex( 0 );
for(nIndex=0;nIndex<3;nIndex++)
- pPossibilityList[nIndex]=ChartTypeHelper::isSupportingMainAxis(xChartType,nDimensionCount,nIndex);
+ pPossibilityList[nIndex] = xChartType.is() ? xChartType->isSupportingMainAxis(nDimensionCount, nIndex) : true;
for(nIndex=3;nIndex<6;nIndex++)
if( bAxis )
- pPossibilityList[nIndex]=ChartTypeHelper::isSupportingSecondaryAxis(xChartType,nDimensionCount);
+ pPossibilityList[nIndex] = xChartType.is() ? xChartType->isSupportingSecondaryAxis(nDimensionCount) : true;
else
pPossibilityList[nIndex] = rPossibilityList[nIndex-3];
}
-bool AxisHelper::isSecondaryYAxisNeeded( const Reference< XCoordinateSystem >& xCooSys )
+bool AxisHelper::isSecondaryYAxisNeeded( const rtl::Reference< BaseCoordinateSystem >& xCooSys )
{
- Reference< chart2::XChartTypeContainer > xCTCnt( xCooSys, uno::UNO_QUERY );
- if( !xCTCnt.is() )
+ if( !xCooSys.is() )
return false;
- const Sequence< Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes() );
- for( Reference< chart2::XChartType > const & chartType : aChartTypes )
+ const std::vector< rtl::Reference< ChartType > > & aChartTypes( xCooSys->getChartTypes2() );
+ for( rtl::Reference< ChartType > const & chartType : aChartTypes )
{
- Reference< XDataSeriesContainer > xSeriesContainer( chartType, uno::UNO_QUERY );
- if( !xSeriesContainer.is() )
- continue;
-
- Sequence< Reference< XDataSeries > > aSeriesList( xSeriesContainer->getDataSeries() );
- for( sal_Int32 nS = aSeriesList.getLength(); nS-- ; )
+ const std::vector< rtl::Reference< DataSeries > > & aSeriesList = chartType->getDataSeries2();
+ for( sal_Int32 nS = aSeriesList.size(); nS-- ; )
{
- Reference< beans::XPropertySet > xProp( aSeriesList[nS], uno::UNO_QUERY );
- if(xProp.is())
- {
- sal_Int32 nAttachedAxisIndex = 0;
- if( ( xProp->getPropertyValue( "AttachedAxisIndex" ) >>= nAttachedAxisIndex ) && nAttachedAxisIndex>0 )
- return true;
- }
+ sal_Int32 nAttachedAxisIndex = 0;
+ if( ( aSeriesList[nS]->getPropertyValue( u"AttachedAxisIndex"_ustr ) >>= nAttachedAxisIndex ) &&
+ nAttachedAxisIndex>0 )
+ return true;
}
}
return false;
}
-bool AxisHelper::shouldAxisBeDisplayed( const Reference< XAxis >& xAxis
- , const Reference< XCoordinateSystem >& xCooSys )
+bool AxisHelper::shouldAxisBeDisplayed( const rtl::Reference< Axis >& xAxis
+ , const rtl::Reference< BaseCoordinateSystem >& xCooSys )
{
bool bRet = false;
@@ -944,13 +894,13 @@ bool AxisHelper::shouldAxisBeDisplayed( const Reference< XAxis >& xAxis
if( AxisHelper::getIndicesForAxis( xAxis, xCooSys, nDimensionIndex, nAxisIndex ) )
{
sal_Int32 nDimensionCount = xCooSys->getDimension();
- Reference< XChartType > xChartType( AxisHelper::getChartTypeByIndex( xCooSys, 0 ) );
+ rtl::Reference< ChartType > xChartType( AxisHelper::getChartTypeByIndex( xCooSys, 0 ) );
bool bMainAxis = (nAxisIndex==MAIN_AXIS_INDEX);
if( bMainAxis )
- bRet = ChartTypeHelper::isSupportingMainAxis(xChartType,nDimensionCount,nDimensionIndex);
+ bRet = xChartType.is() ? xChartType->isSupportingMainAxis(nDimensionCount, nDimensionIndex) : true;
else
- bRet = ChartTypeHelper::isSupportingSecondaryAxis(xChartType,nDimensionCount);
+ bRet = xChartType.is() ? xChartType->isSupportingSecondaryAxis(nDimensionCount) : true;
}
}
@@ -958,7 +908,7 @@ bool AxisHelper::shouldAxisBeDisplayed( const Reference< XAxis >& xAxis
}
void AxisHelper::getAxisOrGridExistence( Sequence< sal_Bool >& rExistenceList
- , const Reference< XDiagram>& xDiagram, bool bAxis )
+ , const rtl::Reference< Diagram>& xDiagram, bool bAxis )
{
rExistenceList.realloc(6);
sal_Bool* pExistenceList = rExistenceList.getArray();
@@ -982,7 +932,7 @@ void AxisHelper::getAxisOrGridExistence( Sequence< sal_Bool >& rExistenceList
}
}
-bool AxisHelper::changeVisibilityOfAxes( const Reference< XDiagram >& xDiagram
+bool AxisHelper::changeVisibilityOfAxes( const rtl::Reference< Diagram >& xDiagram
, const Sequence< sal_Bool >& rOldExistenceList
, const Sequence< sal_Bool >& rNewExistenceList
, const Reference< uno::XComponentContext >& xContext
@@ -1005,7 +955,7 @@ bool AxisHelper::changeVisibilityOfAxes( const Reference< XDiagram >& xDiagram
return bChanged;
}
-bool AxisHelper::changeVisibilityOfGrids( const Reference< XDiagram >& xDiagram
+bool AxisHelper::changeVisibilityOfGrids( const rtl::Reference< Diagram >& xDiagram
, const Sequence< sal_Bool >& rOldExistenceList
, const Sequence< sal_Bool >& rNewExistenceList )
{
@@ -1025,21 +975,18 @@ bool AxisHelper::changeVisibilityOfGrids( const Reference< XDiagram >& xDiagram
}
rtl::Reference< BaseCoordinateSystem > AxisHelper::getCoordinateSystemOfAxis(
- const Reference< XAxis >& xAxis
- , const Reference< XDiagram >& xDiagram )
+ const rtl::Reference< Axis >& xAxis
+ , const rtl::Reference< Diagram >& xDiagram )
{
if (!xDiagram)
return nullptr;
- ::chart::Diagram* pDiagram = dynamic_cast<::chart::Diagram*>(xDiagram.get());
- assert(pDiagram);
rtl::Reference< BaseCoordinateSystem > xRet;
- for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : pDiagram->getBaseCoordinateSystems() )
+ for( rtl::Reference< BaseCoordinateSystem > const & xCooSys : xDiagram->getBaseCoordinateSystems() )
{
- std::vector< Reference< XAxis > > aAllAxis( AxisHelper::getAllAxesOfCoordinateSystem( xCooSys ) );
+ std::vector< rtl::Reference< Axis > > aAllAxis = AxisHelper::getAllAxesOfCoordinateSystem( xCooSys );
- std::vector< Reference< XAxis > >::iterator aFound =
- std::find( aAllAxis.begin(), aAllAxis.end(), xAxis );
+ auto aFound = std::find( aAllAxis.begin(), aAllAxis.end(), xAxis );
if( aFound != aAllAxis.end())
{
xRet = xCooSys;
@@ -1049,22 +996,21 @@ rtl::Reference< BaseCoordinateSystem > AxisHelper::getCoordinateSystemOfAxis(
return xRet;
}
-Reference< XChartType > AxisHelper::getChartTypeByIndex( const Reference< XCoordinateSystem >& xCooSys, sal_Int32 nIndex )
+rtl::Reference< ChartType > AxisHelper::getChartTypeByIndex( const rtl::Reference< BaseCoordinateSystem >& xCooSys, sal_Int32 nIndex )
{
- Reference< XChartType > xChartType;
+ rtl::Reference< ChartType > xChartType;
- Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
- if( xChartTypeContainer.is() )
+ if( xCooSys.is() )
{
- Sequence< Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- if( nIndex >= 0 && nIndex < aChartTypeList.getLength() )
- xChartType.set( aChartTypeList[nIndex] );
+ const std::vector< rtl::Reference< ChartType > > aChartTypeList( xCooSys->getChartTypes2() );
+ if( nIndex >= 0 && o3tl::make_unsigned(nIndex) < aChartTypeList.size() )
+ xChartType = aChartTypeList[nIndex];
}
return xChartType;
}
-void AxisHelper::setRTLAxisLayout( const Reference< XCoordinateSystem >& xCooSys )
+void AxisHelper::setRTLAxisLayout( const rtl::Reference< BaseCoordinateSystem >& xCooSys )
{
if( !xCooSys.is() )
return;
@@ -1074,9 +1020,7 @@ void AxisHelper::setRTLAxisLayout( const Reference< XCoordinateSystem >& xCooSys
return;
bool bVertical = false;
- Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY );
- if( xCooSysProp.is() )
- xCooSysProp->getPropertyValue( "SwapXAndYAxis" ) >>= bVertical;
+ xCooSys->getPropertyValue( u"SwapXAndYAxis"_ustr ) >>= bVertical;
sal_Int32 nHorizontalAxisDimension = bVertical ? 1 : 0;
sal_Int32 nVerticalAxisDimension = bVertical ? 0 : 1;
@@ -1084,7 +1028,7 @@ void AxisHelper::setRTLAxisLayout( const Reference< XCoordinateSystem >& xCooSys
try
{
//reverse direction for horizontal main axis
- Reference< chart2::XAxis > xHorizontalMainAxis( AxisHelper::getAxis( nHorizontalAxisDimension, MAIN_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xHorizontalMainAxis = AxisHelper::getAxis( nHorizontalAxisDimension, MAIN_AXIS_INDEX, xCooSys );
if( xHorizontalMainAxis.is() )
{
chart2::ScaleData aScale = xHorizontalMainAxis->getScaleData();
@@ -1093,7 +1037,7 @@ void AxisHelper::setRTLAxisLayout( const Reference< XCoordinateSystem >& xCooSys
}
//mathematical direction for vertical main axis
- Reference< chart2::XAxis > xVerticalMainAxis( AxisHelper::getAxis( nVerticalAxisDimension, MAIN_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xVerticalMainAxis = AxisHelper::getAxis( nVerticalAxisDimension, MAIN_AXIS_INDEX, xCooSys );
if( xVerticalMainAxis.is() )
{
chart2::ScaleData aScale = xVerticalMainAxis->getScaleData();
@@ -1109,7 +1053,7 @@ void AxisHelper::setRTLAxisLayout( const Reference< XCoordinateSystem >& xCooSys
try
{
//reverse direction for horizontal secondary axis
- Reference< chart2::XAxis > xHorizontalSecondaryAxis( AxisHelper::getAxis( nHorizontalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xHorizontalSecondaryAxis = AxisHelper::getAxis( nHorizontalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys );
if( xHorizontalSecondaryAxis.is() )
{
chart2::ScaleData aScale = xHorizontalSecondaryAxis->getScaleData();
@@ -1118,7 +1062,7 @@ void AxisHelper::setRTLAxisLayout( const Reference< XCoordinateSystem >& xCooSys
}
//mathematical direction for vertical secondary axis
- Reference< chart2::XAxis > xVerticalSecondaryAxis( AxisHelper::getAxis( nVerticalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xVerticalSecondaryAxis = AxisHelper::getAxis( nVerticalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys );
if( xVerticalSecondaryAxis.is() )
{
chart2::ScaleData aScale = xVerticalSecondaryAxis->getScaleData();
@@ -1132,16 +1076,16 @@ void AxisHelper::setRTLAxisLayout( const Reference< XCoordinateSystem >& xCooSys
}
}
-Reference< XChartType > AxisHelper::getFirstChartTypeWithSeriesAttachedToAxisIndex( const Reference< chart2::XDiagram >& xDiagram, const sal_Int32 nAttachedAxisIndex )
+rtl::Reference< ChartType > AxisHelper::getFirstChartTypeWithSeriesAttachedToAxisIndex( const rtl::Reference< Diagram >& xDiagram, const sal_Int32 nAttachedAxisIndex )
{
- Reference< XChartType > xChartType;
- std::vector< Reference< XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ rtl::Reference< ChartType > xChartType;
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector = xDiagram->getDataSeries();
for (auto const& series : aSeriesVector)
{
- sal_Int32 nCurrentIndex = DataSeriesHelper::getAttachedAxisIndex(series);
+ sal_Int32 nCurrentIndex = series->getAttachedAxisIndex();
if( nAttachedAxisIndex == nCurrentIndex )
{
- xChartType = DiagramHelper::getChartTypeOfSeries(xDiagram, series);
+ xChartType = xDiagram->getChartTypeOfSeries(series);
if(xChartType.is())
break;
}
diff --git a/chart2/source/tools/TrueGuard.cxx b/chart2/source/tools/BaseColorScheme.cxx
index 3fca959e78c2..14e2e813cf55 100644
--- a/chart2/source/tools/TrueGuard.cxx
+++ b/chart2/source/tools/BaseColorScheme.cxx
@@ -17,18 +17,27 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <TrueGuard.hxx>
+#include <BaseColorScheme.hxx>
+
+#include <cppuhelper/supportsservice.hxx>
namespace chart
{
-TrueGuard::TrueGuard(bool& rbTrueDuringGuardedTime)
- : m_rbTrueDuringGuardedTime(rbTrueDuringGuardedTime)
+// explicit
+BaseColorScheme::BaseColorScheme()
+ : m_nNumberOfColors(0)
{
- m_rbTrueDuringGuardedTime = true;
}
-TrueGuard::~TrueGuard() { m_rbTrueDuringGuardedTime = false; }
+sal_Bool SAL_CALL BaseColorScheme::supportsService(const OUString& rServiceName)
+{
+ return cppu::supportsService(this, rServiceName);
+}
+css::uno::Sequence<OUString> SAL_CALL BaseColorScheme::getSupportedServiceNames()
+{
+ return { u"com.sun.star.chart2.ColorScheme"_ustr };
+}
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/BaseGFXHelper.cxx b/chart2/source/tools/BaseGFXHelper.cxx
index b518e7dd8b8c..765521d6959c 100644
--- a/chart2/source/tools/BaseGFXHelper.cxx
+++ b/chart2/source/tools/BaseGFXHelper.cxx
@@ -113,6 +113,12 @@ awt::Size B2IRectangleToAWTSize( const ::basegfx::B2IRectangle& rB2IRectangle )
static_cast< sal_Int32 >( rB2IRectangle.getHeight()));
}
+awt::Rectangle toAwtRectangle(const basegfx::B2IRectangle& rRectangle)
+{
+ return awt::Rectangle(rRectangle.getMinX(), rRectangle.getMinY(),
+ rRectangle.getWidth(), rRectangle.getHeight());
+}
+
B3DVector Direction3DToB3DVector( const Direction3D& rDirection )
{
return B3DVector(
@@ -222,7 +228,7 @@ void ReduceToRotationMatrix( ::basegfx::B3DHomMatrix & rB3DMatrix )
B3DTuple aR( GetRotationFromMatrix( rB3DMatrix ) );
::basegfx::B3DHomMatrix aRotationMatrix;
aRotationMatrix.rotate(aR.getX(),aR.getY(),aR.getZ());
- rB3DMatrix = aRotationMatrix;
+ rB3DMatrix = std::move(aRotationMatrix);
}
} // namespace chart::BaseGFXHelper
diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx
index 0ca95f9ebdf2..13755af2c7b3 100644
--- a/chart2/source/tools/CachedDataSequence.cxx
+++ b/chart2/source/tools/CachedDataSequence.cxx
@@ -23,7 +23,6 @@
#include <comphelper/sequenceashashmap.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
#include <algorithm>
@@ -32,17 +31,13 @@ using namespace ::com::sun::star;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
-using ::osl::MutexGuard;
// necessary for MS compiler
-using ::comphelper::OPropertyContainer;
-using ::comphelper::OMutexAndBroadcastHelper;
-using ::comphelper::OPropertyArrayUsageHelper;
using ::chart::impl::CachedDataSequence_Base;
namespace
{
-constexpr OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.CachedDataSequence";
+constexpr OUString lcl_aServiceName = u"com.sun.star.comp.chart.CachedDataSequence"_ustr;
enum
{
@@ -56,26 +51,20 @@ namespace chart
{
CachedDataSequence::CachedDataSequence()
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_eCurrentDataType( NUMERICAL ),
+ : m_eCurrentDataType( NUMERICAL ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
registerProperties();
}
CachedDataSequence::CachedDataSequence( const Reference< uno::XComponentContext > & /*xContext*/ )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_eCurrentDataType( MIXED ),
+ : m_eCurrentDataType( MIXED ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
registerProperties();
}
CachedDataSequence::CachedDataSequence( const OUString & rSingleText )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_eCurrentDataType( TEXTUAL ),
+ : m_eCurrentDataType( TEXTUAL ),
m_aTextualSequence({rSingleText}),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
@@ -83,9 +72,7 @@ CachedDataSequence::CachedDataSequence( const OUString & rSingleText )
}
CachedDataSequence::CachedDataSequence( const CachedDataSequence & rSource )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
+ : m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
m_sRole( rSource.m_sRole ),
m_eCurrentDataType( rSource.m_eCurrentDataType ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
@@ -111,13 +98,13 @@ CachedDataSequence::~CachedDataSequence()
void CachedDataSequence::registerProperties()
{
- registerProperty( "NumberFormatKey",
+ registerProperty( u"NumberFormatKey"_ustr,
PROP_NUMBERFORMAT_KEY,
0, // PropertyAttributes
& m_nNumberFormatKey,
cppu::UnoType<decltype(m_nNumberFormatKey)>::get() );
- registerProperty( "Role",
+ registerProperty( u"Role"_ustr,
PROP_PROPOSED_ROLE,
0, // PropertyAttributes
& m_sRole,
@@ -129,29 +116,11 @@ Sequence< double > CachedDataSequence::Impl_getNumericalData() const
if( m_eCurrentDataType == NUMERICAL )
return m_aNumericalSequence;
- sal_Int32 nSize = ( m_eCurrentDataType == TEXTUAL )
- ? m_aTextualSequence.getLength()
- : m_aMixedSequence.getLength();
-
- Sequence< double > aResult( nSize );
- double * pResultArray = aResult.getArray();
-
if( m_eCurrentDataType == TEXTUAL )
- {
- const OUString * pTextArray = m_aTextualSequence.getConstArray();
- std::transform( pTextArray, pTextArray + nSize,
- pResultArray,
- CommonFunctors::OUStringToDouble() );
- }
- else
- {
- OSL_ASSERT( m_eCurrentDataType == MIXED );
- const Any * pMixedArray = m_aMixedSequence.getConstArray();
- std::transform( pMixedArray, pMixedArray + nSize,
- pResultArray,
- CommonFunctors::AnyToDouble() );
- }
- return aResult;
+ return CommonFunctors::convertToSequence(m_aTextualSequence, CommonFunctors::ToDouble());
+
+ OSL_ASSERT(m_eCurrentDataType == MIXED);
+ return CommonFunctors::convertToSequence(m_aMixedSequence, CommonFunctors::ToDouble());
}
Sequence< OUString > CachedDataSequence::Impl_getTextualData() const
@@ -159,30 +128,11 @@ Sequence< OUString > CachedDataSequence::Impl_getTextualData() const
if( m_eCurrentDataType == TEXTUAL )
return m_aTextualSequence;
- sal_Int32 nSize = ( m_eCurrentDataType == NUMERICAL )
- ? m_aNumericalSequence.getLength()
- : m_aMixedSequence.getLength();
-
- Sequence< OUString > aResult( nSize );
- OUString * pResultArray = aResult.getArray();
-
if( m_eCurrentDataType == NUMERICAL )
- {
- const double * pTextArray = m_aNumericalSequence.getConstArray();
- std::transform( pTextArray, pTextArray + nSize,
- pResultArray,
- CommonFunctors::DoubleToOUString() );
- }
- else
- {
- OSL_ASSERT( m_eCurrentDataType == MIXED );
- const Any * pMixedArray = m_aMixedSequence.getConstArray();
- std::transform( pMixedArray, pMixedArray + nSize,
- pResultArray,
- CommonFunctors::AnyToString() );
- }
+ return CommonFunctors::convertToSequence(m_aNumericalSequence, CommonFunctors::ToString());
- return aResult;
+ OSL_ASSERT(m_eCurrentDataType == MIXED);
+ return CommonFunctors::convertToSequence(m_aMixedSequence, CommonFunctors::ToString());
}
Sequence< Any > CachedDataSequence::Impl_getMixedData() const
@@ -190,34 +140,15 @@ Sequence< Any > CachedDataSequence::Impl_getMixedData() const
if( m_eCurrentDataType == MIXED )
return m_aMixedSequence;
- sal_Int32 nSize = ( m_eCurrentDataType == NUMERICAL )
- ? m_aNumericalSequence.getLength()
- : m_aTextualSequence.getLength();
-
- Sequence< Any > aResult( nSize );
- Any * pResultArray = aResult.getArray();
-
if( m_eCurrentDataType == NUMERICAL )
- {
- const double * pTextArray = m_aNumericalSequence.getConstArray();
- std::transform( pTextArray, pTextArray + nSize,
- pResultArray,
- CommonFunctors::makeAny< double >() );
- }
- else
- {
- OSL_ASSERT( m_eCurrentDataType == TEXTUAL );
- const OUString * pMixedArray = m_aTextualSequence.getConstArray();
- std::transform( pMixedArray, pMixedArray + nSize,
- pResultArray,
- CommonFunctors::makeAny< OUString >() );
- }
+ return CommonFunctors::convertToSequence(m_aNumericalSequence, CommonFunctors::makeAny());
- return aResult;
+ OSL_ASSERT(m_eCurrentDataType == TEXTUAL);
+ return CommonFunctors::convertToSequence(m_aTextualSequence, CommonFunctors::makeAny());
}
-IMPLEMENT_FORWARD_XINTERFACE2( CachedDataSequence, CachedDataSequence_Base, OPropertyContainer )
-IMPLEMENT_FORWARD_XTYPEPROVIDER2( CachedDataSequence, CachedDataSequence_Base, OPropertyContainer )
+IMPLEMENT_FORWARD_XINTERFACE2( CachedDataSequence, CachedDataSequence_Base, comphelper::OPropertyContainer2 )
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( CachedDataSequence, CachedDataSequence_Base, comphelper::OPropertyContainer2 )
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL CachedDataSequence::getPropertySetInfo()
@@ -255,16 +186,16 @@ css::uno::Sequence< OUString > SAL_CALL CachedDataSequence::getSupportedServiceN
{
return {
lcl_aServiceName,
- "com.sun.star.chart2.data.DataSequence",
- "com.sun.star.chart2.data.NumericalDataSequence",
- "com.sun.star.chart2.data.TextualDataSequence"
+ u"com.sun.star.chart2.data.DataSequence"_ustr,
+ u"com.sun.star.chart2.data.NumericalDataSequence"_ustr,
+ u"com.sun.star.chart2.data.TextualDataSequence"_ustr
};
}
// ________ XNumericalDataSequence ________
Sequence< double > SAL_CALL CachedDataSequence::getNumericalData()
{
- MutexGuard aGuard( GetMutex() );
+ std::unique_lock aGuard( m_aMutex );
if( m_eCurrentDataType == NUMERICAL )
return m_aNumericalSequence;
@@ -275,7 +206,7 @@ Sequence< double > SAL_CALL CachedDataSequence::getNumericalData()
// ________ XTextualDataSequence ________
Sequence< OUString > SAL_CALL CachedDataSequence::getTextualData()
{
- MutexGuard aGuard( GetMutex() );
+ std::unique_lock aGuard( m_aMutex );
if( m_eCurrentDataType == TEXTUAL )
return m_aTextualSequence;
@@ -286,7 +217,7 @@ Sequence< OUString > SAL_CALL CachedDataSequence::getTextualData()
// ________ XDataSequence ________
Sequence< Any > SAL_CALL CachedDataSequence::getData()
{
- MutexGuard aGuard( GetMutex() );
+ std::unique_lock aGuard( m_aMutex );
return Impl_getMixedData();
}
@@ -325,17 +256,17 @@ void SAL_CALL CachedDataSequence::removeModifyListener( const Reference< util::X
void SAL_CALL CachedDataSequence::initialize(const uno::Sequence< uno::Any > & _aArguments)
{
::comphelper::SequenceAsHashMap aMap(_aArguments);
- m_aNumericalSequence = aMap.getUnpackedValueOrDefault( "DataSequence" ,m_aNumericalSequence);
+ m_aNumericalSequence = aMap.getUnpackedValueOrDefault( u"DataSequence"_ustr ,m_aNumericalSequence);
if ( m_aNumericalSequence.hasElements() )
m_eCurrentDataType = NUMERICAL;
else
{
- m_aTextualSequence = aMap.getUnpackedValueOrDefault( "DataSequence" ,m_aTextualSequence);
+ m_aTextualSequence = aMap.getUnpackedValueOrDefault( u"DataSequence"_ustr ,m_aTextualSequence);
if ( m_aTextualSequence.hasElements() )
m_eCurrentDataType = TEXTUAL;
else
{
- m_aMixedSequence = aMap.getUnpackedValueOrDefault( "DataSequence" ,m_aMixedSequence);
+ m_aMixedSequence = aMap.getUnpackedValueOrDefault( u"DataSequence"_ustr ,m_aMixedSequence);
if ( m_aMixedSequence.hasElements() )
m_eCurrentDataType = MIXED;
}
diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx
index 659ef6d955f3..4bb0cbda2591 100644
--- a/chart2/source/tools/CharacterProperties.cxx
+++ b/chart2/source/tools/CharacterProperties.cxx
@@ -35,7 +35,9 @@
#include <unotools/lingucfg.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/languagetag.hxx>
+#include <tools/color.hxx>
#include <vcl/outdev.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -339,15 +341,16 @@ void CharacterProperties::AddPropertiesToVector(
void CharacterProperties::AddDefaultsToMap(
::chart::tPropertyValueMap & rOutMap )
{
+ SolarMutexGuard aGuard;
const float fDefaultFontHeight = 13.0;
SvtLinguConfig aLinguConfig;
lang::Locale aDefaultLocale;
- aLinguConfig.GetProperty("DefaultLocale") >>= aDefaultLocale;
+ aLinguConfig.GetProperty(u"DefaultLocale") >>= aDefaultLocale;
lang::Locale aDefaultLocale_CJK;
- aLinguConfig.GetProperty("DefaultLocale_CJK") >>= aDefaultLocale_CJK;
+ aLinguConfig.GetProperty(u"DefaultLocale_CJK") >>= aDefaultLocale_CJK;
lang::Locale aDefaultLocale_CTL;
- aLinguConfig.GetProperty("DefaultLocale_CTL") >>= aDefaultLocale_CTL;
+ aLinguConfig.GetProperty(u"DefaultLocale_CTL") >>= aDefaultLocale_CTL;
using namespace ::com::sun::star::i18n::ScriptType;
LanguageType nLang;
@@ -360,22 +363,22 @@ void CharacterProperties::AddDefaultsToMap(
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, aFont.GetFamilyName() );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_STYLE_NAME, aFont.GetStyleName() );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_FAMILY, sal_Int16(aFont.GetFamilyType()) );//awt::FontFamily::SWISS
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_FAMILY, sal_Int16(aFont.GetFamilyTypeMaybeAskConfig()) );//awt::FontFamily::SWISS
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_CHAR_SET, sal_Int16(aFont.GetCharSet()) );//use awt::CharSet::DONTKNOW instead of SYSTEM to avoid assertion issue 50249
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_PITCH, sal_Int16(aFont.GetPitch()) );//awt::FontPitch::VARIABLE
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_COLOR, -1 ); //automatic color (COL_AUTO)
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_PITCH, sal_Int16(aFont.GetPitchMaybeAskConfig()) );//awt::FontPitch::VARIABLE
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COLOR, COL_AUTO ); //automatic color
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_CHAR_HEIGHT, fDefaultFontHeight );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE, awt::FontUnderline::NONE );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_UNDERLINE_COLOR, -1 ); //automatic color (COL_AUTO)
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE_COLOR, COL_AUTO ); //automatic color
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE_HAS_COLOR, false );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE, awt::FontUnderline::NONE );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_OVERLINE_COLOR, -1 ); //automatic color (COL_AUTO)
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE_COLOR, COL_AUTO ); //automatic color
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE_HAS_COLOR, false );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WEIGHT, awt::FontWeight::NORMAL );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_POSTURE, awt::FontSlant_NONE );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_AUTO_KERNING, true );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_CHAR_KERNING, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_CHAR_STRIKE_OUT, awt::FontStrikeout::NONE );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_KERNING, sal_Int16(0) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_STRIKE_OUT, awt::FontStrikeout::NONE );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WORD_MODE, false );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_LOCALE, aDefaultLocale );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_SHADOWED, false );
@@ -390,9 +393,9 @@ void CharacterProperties::AddDefaultsToMap(
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_LOCALE, aDefaultLocale_CJK );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_NAME, aFontCJK.GetFamilyName() );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_STYLE_NAME, aFontCJK.GetStyleName() );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_FAMILY, sal_Int16(aFontCJK.GetFamilyType()) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_FAMILY, sal_Int16(aFontCJK.GetFamilyTypeMaybeAskConfig()) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_CHAR_SET, sal_Int16(aFontCJK.GetCharSet()) );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_PITCH, sal_Int16(aFontCJK.GetPitch()) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_PITCH, sal_Int16(aFontCJK.GetPitchMaybeAskConfig()) );
// Complex Text Layout (com.sun.star.style.CharacterPropertiesComplex)
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultFontHeight );
@@ -401,9 +404,9 @@ void CharacterProperties::AddDefaultsToMap(
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_LOCALE, aDefaultLocale_CTL );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_NAME, aFontCTL.GetFamilyName() );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_STYLE_NAME, aFontCTL.GetStyleName() );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_FAMILY, sal_Int16(aFontCTL.GetFamilyType()) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_FAMILY, sal_Int16(aFontCTL.GetFamilyTypeMaybeAskConfig()) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_CHAR_SET, sal_Int16(aFontCTL.GetCharSet()) );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_PITCH, sal_Int16(aFontCTL.GetPitch()) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_PITCH, sal_Int16(aFontCTL.GetPitchMaybeAskConfig()) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_WRITING_MODE, sal_Int16( css::text::WritingMode2::PAGE ) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PARA_IS_CHARACTER_DISTANCE, true );
@@ -421,17 +424,17 @@ awt::FontDescriptor CharacterProperties::createFontDescriptorFromPropertySet(
awt::FontDescriptor aResult;
// Note: keep this sorted!
uno::Sequence< OUString > aPropNameSeq{
- "CharFontCharSet", // CharSet
- "CharFontFamily", // Family
- "CharFontName", // Name
- "CharFontPitch", // Pitch
- "CharFontStyleName", // StyleName
- "CharHeight", // Height
- "CharPosture", // Slant
- "CharStrikeout", // Strikeout
- "CharUnderline", // Underline
- "CharWeight", // Weight
- "CharWordMode"}; // WordLineMode
+ u"CharFontCharSet"_ustr, // CharSet
+ u"CharFontFamily"_ustr, // Family
+ u"CharFontName"_ustr, // Name
+ u"CharFontPitch"_ustr, // Pitch
+ u"CharFontStyleName"_ustr, // StyleName
+ u"CharHeight"_ustr, // Height
+ u"CharPosture"_ustr, // Slant
+ u"CharStrikeout"_ustr, // Strikeout
+ u"CharUnderline"_ustr, // Underline
+ u"CharWeight"_ustr, // Weight
+ u"CharWordMode"_ustr}; // WordLineMode
uno::Sequence< uno::Any > aValues( xMultiPropSet->getPropertyValues( aPropNameSeq ));
sal_Int32 i=0;
diff --git a/chart2/source/tools/ChartColorPaletteHelper.cxx b/chart2/source/tools/ChartColorPaletteHelper.cxx
new file mode 100644
index 000000000000..9373bf242b70
--- /dev/null
+++ b/chart2/source/tools/ChartColorPaletteHelper.cxx
@@ -0,0 +1,199 @@
+/* -*- 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 <ChartColorPaletteHelper.hxx>
+#include <ChartModel.hxx>
+#include <sal/log.hxx>
+#include <docmodel/uno/UnoTheme.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/virdev.hxx>
+
+namespace chart
+{
+constexpr tools::Long BORDER = ChartColorPaletteLayout::ItemBorder;
+constexpr tools::Long SIZE = ChartColorPaletteLayout::ItemSize;
+
+namespace
+{
+void decreaseLuminance(Color& color)
+{
+ const sal_uInt8 nLumDiff = std::floor(color.GetLuminance() * 0.40);
+ color.DecreaseLuminance(nLumDiff);
+}
+} // end of unnamed namespace
+
+ChartColorPaletteHelper::ChartColorPaletteHelper(const std::shared_ptr<model::Theme>& pTheme)
+{
+ createBasePaletteFromTheme(pTheme);
+}
+
+void ChartColorPaletteHelper::createBasePaletteFromTheme(
+ const std::shared_ptr<model::Theme>& pTheme)
+{
+ if (pTheme)
+ {
+ mBasePalette[0] = pTheme->GetColor(model::ThemeColorType::Accent1);
+ mBasePalette[1] = pTheme->GetColor(model::ThemeColorType::Accent2);
+ mBasePalette[2] = pTheme->GetColor(model::ThemeColorType::Accent3);
+ mBasePalette[3] = pTheme->GetColor(model::ThemeColorType::Accent4);
+ mBasePalette[4] = pTheme->GetColor(model::ThemeColorType::Accent5);
+ mBasePalette[5] = pTheme->GetColor(model::ThemeColorType::Accent6);
+ }
+ else // default palette
+ {
+ SAL_WARN("chart2",
+ "ChartColorPaletteHelper::createBasePaletteFromTheme: no valid theme provided");
+ mBasePalette[0] = Color::STRtoRGB(u"18A303");
+ mBasePalette[1] = Color::STRtoRGB(u"0369A3");
+ mBasePalette[2] = Color::STRtoRGB(u"A33E03");
+ mBasePalette[3] = Color::STRtoRGB(u"8E03A3");
+ mBasePalette[4] = Color::STRtoRGB(u"C99C00");
+ mBasePalette[5] = Color::STRtoRGB(u"C9211E");
+ }
+}
+
+ChartColorPalette ChartColorPaletteHelper::getColorPalette(const ChartColorPaletteType eType,
+ const sal_uInt32 nIndex) const
+{
+ switch (eType)
+ {
+ case ChartColorPaletteType::Colorful:
+ return createColorfulPalette(nIndex);
+ case ChartColorPaletteType::Monochromatic:
+ return createMonotonicPalette(nIndex);
+ default:
+ SAL_WARN("chart2",
+ "ChartColorPaletteHelper::getColorPalette: unknown palette type requested");
+ return mBasePalette;
+ }
+}
+
+ChartColorPalette ChartColorPaletteHelper::createColorfulPalette(const sal_uInt32 nIndex) const
+{
+ if (nIndex >= ColorfulPaletteSize)
+ {
+ SAL_WARN("chart2",
+ "ChartColorPaletteHelper::createColorfulPalette: wrong index: " << nIndex);
+ return mBasePalette;
+ }
+
+ switch (nIndex)
+ {
+ default:
+ case 0:
+ return mBasePalette;
+ case 1:
+ return createColorfulPaletteImpl(0, 2, 4);
+ case 2:
+ return createColorfulPaletteImpl(1, 3, 5);
+ case 3:
+ return createColorfulPaletteImpl(5, 4, 3);
+ }
+}
+
+ChartColorPalette ChartColorPaletteHelper::createColorfulPaletteImpl(const size_t nIdx1,
+ const size_t nIdx2,
+ const size_t nIdx3) const
+{
+ ChartColorPalette colorPalette = {
+ mBasePalette[nIdx1], mBasePalette[nIdx2], mBasePalette[nIdx3],
+ mBasePalette[nIdx1], mBasePalette[nIdx2], mBasePalette[nIdx3],
+ };
+ decreaseLuminance(colorPalette[3]);
+ decreaseLuminance(colorPalette[4]);
+ decreaseLuminance(colorPalette[5]);
+ return colorPalette;
+}
+
+ChartColorPalette ChartColorPaletteHelper::createMonotonicPalette(sal_uInt32 nIndex) const
+{
+ if (nIndex >= mBasePalette.size())
+ {
+ SAL_WARN("chart2",
+ "ChartColorPaletteHelper::createMonotonicPalette: wrong index: " << nIndex);
+ nIndex = 0;
+ }
+
+ ChartColorPalette colorPalette = {
+ mBasePalette[nIndex], mBasePalette[nIndex], mBasePalette[nIndex],
+ mBasePalette[nIndex], mBasePalette[nIndex], mBasePalette[nIndex],
+ };
+
+ for (size_t i = 0; i < colorPalette.size(); ++i)
+ {
+ Color& color = colorPalette[i];
+ sal_uInt16 nH, nS, nB;
+ color.RGBtoHSB(nH, nS, nB);
+ SAL_INFO("chart2", "createMonotonicPalette: i: " << i << ": before: nH: " << nH
+ << ", nS: " << nS << ", nB: " << nB);
+ nB += (static_cast<int>(i) - 2) * std::round(nB * 0.13);
+ nB = std::clamp(nB, sal_uInt16{ 0 }, sal_uInt16{ 100 });
+
+ if (i < 2)
+ nS += (2 - i) * std::round(nS * 0.013);
+ else if (i > 2)
+ nS = nS / (2 * (i - 2));
+ nS = std::clamp(nS, sal_uInt16{ 0 }, sal_uInt16{ 100 });
+
+ SAL_INFO("chart2", "createMonotonicPalette: i: " << i << ": after: nH: " << nH
+ << ", nS: " << nS << ", nB: " << nB);
+ color = Color::HSBtoRGB(nH, nS, nB);
+ }
+
+ return colorPalette;
+}
+
+void ChartColorPaletteHelper::renderColorPalette(OutputDevice* pDev,
+ const tools::Rectangle& rDrawArea,
+ const ChartColorPalette& rColorSet,
+ const bool bDrawItemBorder)
+{
+ const Point aPosition = rDrawArea.GetPos();
+ const Size aSize = rDrawArea.GetSize();
+
+ static constexpr Size aMin(BORDER * 6 + SIZE * ChartColorPaletteSize / 2,
+ BORDER * 5 + SIZE * 2);
+
+ const tools::Long startX = (aSize.Width() / 2.0) - (aMin.Width() / 2.0) + BORDER;
+ const tools::Long startY = (aSize.Height() / 2.0) - (aMin.Height() / 2.0) + BORDER;
+ tools::Long x = BORDER;
+ static constexpr tools::Long y1 = BORDER;
+ static constexpr tools::Long y2 = y1 + SIZE + BORDER;
+
+ pDev->SetFillColor();
+
+ if (bDrawItemBorder)
+ {
+ pDev->SetLineColor(COL_BLACK);
+ pDev->DrawRect(tools::Rectangle(aPosition, aSize));
+ }
+
+ for (sal_uInt32 i = 0; i < ChartColorPaletteSize / 2; i += 1)
+ {
+ pDev->SetFillColor(rColorSet[i]);
+ pDev->DrawRect(tools::Rectangle(
+ Point(aPosition.X() + x + startX, aPosition.Y() + startY + y1), Size(SIZE, SIZE)));
+
+ pDev->SetFillColor(rColorSet[i + ChartColorPaletteSize / 2]);
+ pDev->DrawRect(tools::Rectangle(
+ Point(aPosition.X() + x + startX, aPosition.Y() + startY + y2), Size(SIZE, SIZE)));
+
+ x += SIZE + BORDER;
+ }
+}
+
+void ChartColorPaletteHelper::renderNoPalette(OutputDevice* pDev, const tools::Rectangle& rDrawArea)
+{
+ pDev->SetLineColor(COL_BLACK);
+ pDev->SetFillColor(Application::GetSettings().GetStyleSettings().GetFaceColor());
+ pDev->DrawRect(rDrawArea);
+}
+} // end of namespace ::chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/ChartColorPalettes.cxx b/chart2/source/tools/ChartColorPalettes.cxx
new file mode 100644
index 000000000000..dbe7697c7210
--- /dev/null
+++ b/chart2/source/tools/ChartColorPalettes.cxx
@@ -0,0 +1,59 @@
+/* -*- 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 <ChartColorPalettes.hxx>
+#include <ChartColorPaletteHelper.hxx>
+#include <vcl/event.hxx>
+
+namespace chart
+{
+constexpr tools::Long BORDER = ChartColorPaletteLayout::ItemBorder;
+constexpr tools::Long SIZE = ChartColorPaletteLayout::ItemSize;
+
+void ChartColorPalettes::insert(ChartColorPalette const& rColorSet)
+{
+ maColorSets.push_back(rColorSet);
+ InsertItem(maColorSets.size());
+}
+
+const ChartColorPalette* ChartColorPalettes::getPalette(const sal_uInt32 nItem) const
+{
+ if (maColorSets.size() > nItem)
+ {
+ return &maColorSets[nItem];
+ }
+ return nullptr;
+}
+
+void ChartColorPalettes::SetDrawingArea(weld::DrawingArea* pDrawingArea)
+{
+ ValueSet::SetDrawingArea(pDrawingArea);
+ SetStyle(WB_TABSTOP | WB_DOUBLEBORDER);
+ SetItemWidth(BORDER * 6 + SIZE * ChartColorPaletteSize / 2);
+ SetItemHeight(BORDER * 5 + SIZE * 2);
+}
+
+void ChartColorPalettes::UserDraw(const UserDrawEvent& rUserDrawEvent)
+{
+ vcl::RenderContext* pDev = rUserDrawEvent.GetRenderContext();
+ const tools::Rectangle aDrawArea = rUserDrawEvent.GetRect();
+ const sal_uInt16 nItemId = rUserDrawEvent.GetItemId();
+ ChartColorPalette const& rColorSet = maColorSets[nItemId - 1];
+ ChartColorPaletteHelper::renderColorPalette(pDev, aDrawArea, rColorSet, false);
+}
+
+void ChartColorPalettes::StyleUpdated()
+{
+ SetFormat();
+ Invalidate();
+ ValueSet::StyleUpdated();
+}
+} // end namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/ConfigAccess.hxx b/chart2/source/tools/ChartColorScheme.cxx
index df59b16a3f75..816ecb422423 100644
--- a/chart2/source/view/inc/ConfigAccess.hxx
+++ b/chart2/source/tools/ChartColorScheme.cxx
@@ -17,19 +17,35 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#pragma once
+#include <ChartColorScheme.hxx>
-namespace chart::ConfigAccess
-{
-/** @descr Retrieve the setting for showing errors in charts from the registry
- settings of the Calc application.
+#include <cppuhelper/supportsservice.hxx>
- If this setting is not found, it is set to false (the default setting).
+namespace chart
+{
+// explicit
+ChartColorScheme::ChartColorScheme(const ChartColorPalette& rPalette)
+ : BaseColorScheme()
+{
+ m_nNumberOfColors = rPalette.size();
+ m_aColorSequence.realloc(m_nNumberOfColors);
+ sal_Int64* pColors = m_aColorSequence.getArray();
+ for (size_t i = 0; i < rPalette.size(); ++i)
+ {
+ pColors[i] = static_cast<sal_Int32>(rPalette[i]);
+ }
+}
- @return boolean UseErrorRectangle.
- */
-bool getUseErrorRectangle();
+::sal_Int32 SAL_CALL ChartColorScheme::getColorByIndex(::sal_Int32 nIndex)
+{
+ assert(m_nNumberOfColors > 0);
+ return static_cast<sal_Int32>(m_aColorSequence[nIndex % m_nNumberOfColors]);
+}
-} //namespace chart::ConfigAccess
+OUString SAL_CALL ChartColorScheme::getImplementationName()
+{
+ return "com.sun.star.comp.chart2.ChartColorScheme";
+}
+} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx
deleted file mode 100644
index b81d047cc39d..000000000000
--- a/chart2/source/tools/ChartModelHelper.cxx
+++ /dev/null
@@ -1,306 +0,0 @@
-/* -*- 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 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 .
- */
-
-#include <ChartModelHelper.hxx>
-#include <DiagramHelper.hxx>
-#include <Diagram.hxx>
-#include <DataSourceHelper.hxx>
-#include <ControllerLockGuard.hxx>
-#include <RangeHighlighter.hxx>
-#include <InternalDataProvider.hxx>
-#include <ChartModel.hxx>
-#include <BaseCoordinateSystem.hxx>
-
-#include <com/sun/star/chart/ChartDataRowSource.hpp>
-#include <com/sun/star/chart/XChartDocument.hpp>
-#include <com/sun/star/chart2/data/XDataReceiver.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/embed/Aspects.hpp>
-#include <com/sun/star/embed/XVisualObject.hpp>
-#include <com/sun/star/view/XSelectionChangeListener.hpp>
-#include <tools/diagnose_ex.h>
-
-namespace chart
-{
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
-
-uno::Reference< chart2::data::XRangeHighlighter > ChartModelHelper::createRangeHighlighter(
- const uno::Reference< view::XSelectionSupplier > & xSelectionSupplier )
-{
- return new RangeHighlighter( xSelectionSupplier );
-}
-
-rtl::Reference< InternalDataProvider > ChartModelHelper::createInternalDataProvider(
- const uno::Reference< css::chart2::XChartDocument >& xChartDoc, bool bConnectToModel )
-{
- bool bDefaultDataInColumns(true);
-
- // #i120559# Try to access the current state of "DataRowSource" for the
- // chart data and use it as default for creating a new InternalDataProvider
- if(xChartDoc.is())
- {
- css::uno::Reference< css::chart::XChartDocument > xDoc(xChartDoc, uno::UNO_QUERY);
-
- if(xDoc.is())
- {
- css::uno::Reference< css::chart::XDiagram > aDiagram = xDoc->getDiagram();
-
- if(aDiagram.is())
- {
- css::uno::Reference< css::beans::XPropertySet > xProp(aDiagram, uno::UNO_QUERY);
-
- if(xProp.is())
- {
- css::chart::ChartDataRowSource aDataRowSource(css::chart::ChartDataRowSource_COLUMNS);
-
- xProp->getPropertyValue( "DataRowSource" ) >>= aDataRowSource;
-
- bDefaultDataInColumns = (aDataRowSource == css::chart::ChartDataRowSource_COLUMNS);
- }
- }
- }
- }
-
- return new InternalDataProvider( xChartDoc, bConnectToModel, bDefaultDataInColumns );
-}
-
-rtl::Reference< Diagram > ChartModelHelper::findDiagram( const uno::Reference< frame::XModel >& xModel )
-{
- uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY );
- if( xChartDoc.is())
- return ChartModelHelper::findDiagram( xChartDoc );
- return nullptr;
-}
-
-rtl::Reference< Diagram > ChartModelHelper::findDiagram( const uno::Reference< chart2::XChartDocument >& xChartDoc )
-{
- try
- {
- if( !xChartDoc )
- return nullptr;
- uno::Reference<chart2::XDiagram> xDiagram = xChartDoc->getFirstDiagram();
- ::chart::Diagram* pDiagram = dynamic_cast<::chart::Diagram*>(xDiagram.get());
- assert(!xDiagram || pDiagram);
- return pDiagram;
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- return nullptr;
-}
-
-rtl::Reference< Diagram > ChartModelHelper::findDiagram( const rtl::Reference< ::chart::ChartModel >& xChartDoc )
-{
- if( !xChartDoc )
- return nullptr;
- rtl::Reference<::chart::Diagram> xDiagram = xChartDoc->getFirstChartDiagram();
- return xDiagram;
-}
-
-rtl::Reference< BaseCoordinateSystem > ChartModelHelper::getFirstCoordinateSystem( ChartModel& rModel )
-{
- rtl::Reference< Diagram > xDiagram = rModel.getFirstChartDiagram();
- if( xDiagram.is() )
- {
- auto& rCooSysSeq( xDiagram->getBaseCoordinateSystems() );
- if( !rCooSysSeq.empty() )
- return rCooSysSeq[0];
- }
- return nullptr;
-}
-
-rtl::Reference< BaseCoordinateSystem > ChartModelHelper::getFirstCoordinateSystem( const uno::Reference< frame::XModel >& xModel )
-{
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xModel );
- if( xDiagram.is() )
- {
- auto& rCooSysSeq( xDiagram->getBaseCoordinateSystems() );
- if( !rCooSysSeq.empty() )
- return rCooSysSeq[0];
- }
- return nullptr;
-}
-
-std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries(
- ChartModel& rModel )
-{
- std::vector< uno::Reference< XDataSeries > > aResult;
-
- uno::Reference< XDiagram > xDiagram = rModel.getFirstDiagram();
- if( xDiagram.is())
- aResult = DiagramHelper::getDataSeriesFromDiagram( xDiagram );
-
- return aResult;
-}
-
-std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries(
- const uno::Reference< XChartDocument > & xChartDoc )
-{
- std::vector< uno::Reference< XDataSeries > > aResult;
-
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartDoc );
- if( xDiagram.is())
- aResult = DiagramHelper::getDataSeriesFromDiagram( xDiagram );
-
- return aResult;
-}
-
-std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries(
- const rtl::Reference< ::chart::ChartModel > & xChartDoc )
-{
- std::vector< uno::Reference< XDataSeries > > aResult;
-
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartDoc );
- if( xDiagram.is())
- aResult = DiagramHelper::getDataSeriesFromDiagram( xDiagram );
-
- return aResult;
-}
-
-std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries(
- const uno::Reference< frame::XModel > & xModel )
-{
- return getDataSeries( uno::Reference< chart2::XChartDocument >( xModel, uno::UNO_QUERY ));
-}
-
-uno::Reference< XChartType > ChartModelHelper::getChartTypeOfSeries(
- const uno::Reference< frame::XModel >& xModel
- , const uno::Reference< XDataSeries >& xGivenDataSeries )
-{
- return DiagramHelper::getChartTypeOfSeries( ChartModelHelper::findDiagram( xModel ), xGivenDataSeries );
-}
-
-awt::Size ChartModelHelper::getDefaultPageSize()
-{
- return awt::Size( 16000, 9000 );
-}
-
-awt::Size ChartModelHelper::getPageSize( const uno::Reference< frame::XModel >& xModel )
-{
- awt::Size aPageSize( ChartModelHelper::getDefaultPageSize() );
- uno::Reference< embed::XVisualObject > xVisualObject(xModel,uno::UNO_QUERY);
- OSL_ENSURE(xVisualObject.is(),"need xVisualObject for page size");
- if( xVisualObject.is() )
- aPageSize = xVisualObject->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
- return aPageSize;
-}
-
-void ChartModelHelper::triggerRangeHighlighting( const uno::Reference< frame::XModel >& xModel )
-{
- uno::Reference< chart2::data::XDataReceiver > xDataReceiver( xModel, uno::UNO_QUERY );
- if( xDataReceiver.is() )
- {
- uno::Reference< view::XSelectionChangeListener > xSelectionChangeListener( xDataReceiver->getRangeHighlighter(), uno::UNO_QUERY );
- //trigger selection of cell range
- if( xSelectionChangeListener.is() )
- {
- lang::EventObject aEvent( xSelectionChangeListener );
- xSelectionChangeListener->selectionChanged( aEvent );
- }
- }
-}
-
-bool ChartModelHelper::isIncludeHiddenCells( const uno::Reference< frame::XModel >& xChartModel )
-{
- bool bIncluded = true; // hidden cells are included by default.
-
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
- if (!xDiagram.is())
- return bIncluded;
-
- try
- {
- xDiagram->getPropertyValue("IncludeHiddenCells") >>= bIncluded;
- }
- catch( const beans::UnknownPropertyException& )
- {
- }
-
- return bIncluded;
-}
-
-bool ChartModelHelper::setIncludeHiddenCells( bool bIncludeHiddenCells, ChartModel& rModel )
-{
- bool bChanged = false;
- try
- {
- ControllerLockGuard aLockedControllers( rModel );
-
- uno::Reference< beans::XPropertySet > xDiagramProperties( rModel.getFirstDiagram(), uno::UNO_QUERY );
- if (xDiagramProperties.is())
- {
- bool bOldValue = bIncludeHiddenCells;
- xDiagramProperties->getPropertyValue( "IncludeHiddenCells" ) >>= bOldValue;
- if( bOldValue == bIncludeHiddenCells )
- bChanged = true;
-
- //set the property on all instances in all cases to get the different objects in sync!
-
- uno::Any aNewValue(bIncludeHiddenCells);
-
- try
- {
- uno::Reference< beans::XPropertySet > xDataProviderProperties( rModel.getDataProvider(), uno::UNO_QUERY );
- if( xDataProviderProperties.is() )
- xDataProviderProperties->setPropertyValue("IncludeHiddenCells", aNewValue );
- }
- catch( const beans::UnknownPropertyException& )
- {
- //the property is optional!
- }
-
- try
- {
- uno::Reference< chart2::data::XDataSource > xUsedData( DataSourceHelper::getUsedData( rModel ) );
- if( xUsedData.is() )
- {
- uno::Reference< beans::XPropertySet > xProp;
- const uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
- for( uno::Reference< chart2::data::XLabeledDataSequence > const & labeledData : aData )
- {
- xProp.set( uno::Reference< beans::XPropertySet >( labeledData->getValues(), uno::UNO_QUERY ) );
- if(xProp.is())
- xProp->setPropertyValue("IncludeHiddenCells", aNewValue );
- xProp.set( uno::Reference< beans::XPropertySet >( labeledData->getLabel(), uno::UNO_QUERY ) );
- if(xProp.is())
- xProp->setPropertyValue("IncludeHiddenCells", aNewValue );
- }
- }
- }
- catch( const beans::UnknownPropertyException& )
- {
- //the property is optional!
- }
-
- xDiagramProperties->setPropertyValue( "IncludeHiddenCells", aNewValue);
- }
- }
- catch (const uno::Exception&)
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- return bChanged;
-}
-
-} //namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx
index 323e68197969..8582611360f9 100644
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -18,226 +18,28 @@
*/
#include <ChartTypeHelper.hxx>
+#include <ChartType.hxx>
+#include <BaseCoordinateSystem.hxx>
+#include <DataSeriesProperties.hxx>
#include <DiagramHelper.hxx>
#include <servicenames_charttypes.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
+#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
-#include <com/sun/star/chart/MissingValueTreatment.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
namespace chart
{
-bool ChartTypeHelper::isSupportingAxisSideBySide(
- const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- bool bResult = false;
-
- if( xChartType.is() &&
- nDimensionCount < 3 )
- {
- bool bFound=false;
- bool bAmbiguous=false;
- StackMode eStackMode = DiagramHelper::getStackModeFromChartType( xChartType, bFound, bAmbiguous, nullptr );
- if( eStackMode == StackMode::NONE && !bAmbiguous )
- {
- OUString aChartTypeName = xChartType->getChartType();
- bResult = ( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) ||
- aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) );
- }
- }
-
- return bResult;
-}
-
-bool ChartTypeHelper::isSupportingGeometryProperties( const uno::Reference< XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- //form tab only for 3D-bar and 3D-column charts.
-
- //@todo ask charttype itself --> need model change first
- if(xChartType.is())
- {
- if(nDimensionCount==3)
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName == CHART2_SERVICE_NAME_CHARTTYPE_BAR )
- return true;
- if( aChartTypeName == CHART2_SERVICE_NAME_CHARTTYPE_COLUMN )
- return true;
- }
- }
- return false;
-}
-
-bool ChartTypeHelper::isSupportingStatisticProperties( const uno::Reference< XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- //3D charts, pie, net and stock do not support statistic properties
-
- //@todo ask charttype itself (and series? --> stock chart?) --> need model change first
- if(xChartType.is())
- {
- if(nDimensionCount==3)
- return false;
-
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) ) //todo: BubbleChart support error bars and trend lines
- return false;
- }
- return true;
-}
-
-bool ChartTypeHelper::isSupportingRegressionProperties( const uno::Reference< XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- // note: old chart: only scatter chart
- return isSupportingStatisticProperties( xChartType, nDimensionCount );
-}
-
-bool ChartTypeHelper::isSupportingAreaProperties( const uno::Reference< XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- //2D line charts, net and stock do not support area properties
-
- //@todo ask charttype itself --> need model change first
- if(xChartType.is())
- {
- if(nDimensionCount==2)
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
- return false;
- }
- }
- return true;
-}
-
-bool ChartTypeHelper::isSupportingSymbolProperties( const uno::Reference< XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- //2D line charts, 2D scatter charts and 2D net charts do support symbols
-
- //@todo ask charttype itself --> need model change first
- if(xChartType.is())
- {
- if(nDimensionCount==3)
- return false;
-
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE) )
- return true;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) )
- return true;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
- return true;
- }
- return false;
-}
-
-bool ChartTypeHelper::isSupportingMainAxis( const uno::Reference< XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex )
-{
- //pie charts do not support axis at all
- //no 3rd axis for 2D charts
-
- //@todo ask charttype itself --> need model change first
- if(xChartType.is())
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
- return false;
-
- if( nDimensionIndex == 2 )
- return nDimensionCount == 3;
- }
- return true;
-}
-
-bool ChartTypeHelper::isSupportingSecondaryAxis( const uno::Reference< XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- //3D, pie and net charts do not support a secondary axis at all
-
- //@todo ask charttype itself --> need model change first
- if(xChartType.is())
- {
- if(nDimensionCount==3)
- return false;
-
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
- return false;
- }
- return true;
-}
-
-bool ChartTypeHelper::isSupportingOverlapAndGapWidthProperties(
- const uno::Reference< XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- //2D bar charts do support a this special properties
-
- //@todo ask charttype itself --> need model change first
- if(xChartType.is())
- {
- if(nDimensionCount==3)
- return false;
-
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) )
- return true;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) )
- return true;
- }
- return false;
-}
-
-bool ChartTypeHelper::isSupportingBarConnectors(
- const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- //2D bar charts with stacked series support this
-
- //@todo ask charttype itself --> need model change first
- if(xChartType.is())
- {
- if(nDimensionCount==3)
- return false;
-
- bool bFound=false;
- bool bAmbiguous=false;
- StackMode eStackMode = DiagramHelper::getStackModeFromChartType( xChartType, bFound, bAmbiguous, nullptr );
- if( eStackMode != StackMode::YStacked || bAmbiguous )
- return false;
-
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) )
- return true;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) )
- return true; // note: old chart was false here
- }
- return false;
-}
-
-uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const uno::Reference< chart2::XChartType >& xChartType
+uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const rtl::Reference< ChartType >& xChartType
, bool bSwapXAndY
- , const uno::Reference< chart2::XDataSeries >& xSeries )
+ , const rtl::Reference< DataSeries >& xSeries )
{
uno::Sequence < sal_Int32 > aRet;
if( !xChartType.is() )
@@ -247,8 +49,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const
if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
{
bool bDonut = false;
- uno::Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY_THROW );
- xChartTypeProp->getPropertyValue( "UseRings") >>= bDonut;
+ xChartType->getFastPropertyValue( PROP_PIECHARTTYPE_USE_RINGS ) >>= bDonut; // "UseRings"
if(!bDonut)
{
@@ -270,6 +71,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const
else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER)
|| aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE)
|| aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FUNNEL) // TODO: check this
)
{
aRet.realloc(5);
@@ -286,9 +88,8 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const
bool bStacked = false;
{
- uno::Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
chart2::StackingDirection eStacking = chart2::StackingDirection_NO_STACKING;
- xSeriesProp->getPropertyValue( "StackingDirection" ) >>= eStacking;
+ xSeries->getFastPropertyValue( PROP_DATASERIES_STACKING_DIRECTION ) >>= eStacking; // "StackingDirection"
bStacked = (eStacking == chart2::StackingDirection_Y_STACKING);
}
@@ -313,13 +114,24 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const
*pSeq++ = css::chart::DataLabelPlacement::INSIDE;
*pSeq++ = css::chart::DataLabelPlacement::NEAR_ORIGIN;
}
+ else if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM))
+ {
+ aRet.realloc(6);
+ sal_Int32* pSeq = aRet.getArray();
+
+ *pSeq++ = css::chart::DataLabelPlacement::TOP;
+ *pSeq++ = css::chart::DataLabelPlacement::BOTTOM;
+ *pSeq++ = css::chart::DataLabelPlacement::CENTER;
+ *pSeq++ = css::chart::DataLabelPlacement::OUTSIDE;
+ *pSeq++ = css::chart::DataLabelPlacement::INSIDE;
+ *pSeq++ = css::chart::DataLabelPlacement::NEAR_ORIGIN;
+ }
else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA) )
{
bool bStacked = false;
{
- uno::Reference<beans::XPropertySet> xSeriesProp(xSeries, uno::UNO_QUERY);
chart2::StackingDirection eStacking = chart2::StackingDirection_NO_STACKING;
- xSeriesProp->getPropertyValue("StackingDirection") >>= eStacking;
+ xSeries->getFastPropertyValue(PROP_DATASERIES_STACKING_DIRECTION) >>= eStacking; // "StackingDirection"
bStacked = (eStacking == chart2::StackingDirection_Y_STACKING);
}
@@ -367,104 +179,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const
return aRet;
}
-bool ChartTypeHelper::isSupportingRightAngledAxes( const uno::Reference< chart2::XChartType >& xChartType )
-{
- if(xChartType.is())
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
- return false;
- }
- return true;
-}
-
-bool ChartTypeHelper::isSupportingStartingAngle( const uno::Reference< chart2::XChartType >& xChartType )
-{
- if(xChartType.is())
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
- return true;
- }
- return false;
-}
-bool ChartTypeHelper::isSupportingBaseValue( const uno::Reference< chart2::XChartType >& xChartType )
-{
- if(xChartType.is())
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN)
- || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR)
- || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA)
- )
- return true;
- }
- return false;
-}
-
-bool ChartTypeHelper::isSupportingAxisPositioning( const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex )
-{
- if(xChartType.is())
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
- return false;
- }
- if( nDimensionCount==3 )
- return nDimensionIndex<2;
- return true;
-}
-
-bool ChartTypeHelper::isSupportingDateAxis( const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 nDimensionIndex )
-{
- if( nDimensionIndex!=0 )
- return false;
- if( xChartType.is() )
- {
- sal_Int32 nType = ChartTypeHelper::getAxisType( xChartType, nDimensionIndex );
- if( nType != AxisType::CATEGORY )
- return false;
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
- return false;
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
- return false;
- }
- return true;
-}
-
-bool ChartTypeHelper::isSupportingComplexCategory( const uno::Reference< chart2::XChartType >& xChartType )
-{
- if( xChartType.is() )
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
- return false;
- }
- return true;
-}
-
-bool ChartTypeHelper::isSupportingCategoryPositioning( const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 nDimensionCount )
-{
- if( xChartType.is() )
- {
- OUString aChartTypeName = xChartType->getChartType();
- if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA) ||
- aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE) ||
- aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK))
- return true;
- else if (nDimensionCount == 2 &&
- (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR)))
- return true;
- }
- return false;
-}
-
-bool ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( const uno::Reference< chart2::XChartType >& xChartType )
+bool ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( const rtl::Reference< ChartType >& xChartType )
{
if(xChartType.is())
{
@@ -477,7 +192,7 @@ bool ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( const uno::Reference< c
return false;
}
-bool ChartTypeHelper::noBordersForSimpleScheme( const uno::Reference< chart2::XChartType >& xChartType )
+bool ChartTypeHelper::noBordersForSimpleScheme( const rtl::Reference< ChartType >& xChartType )
{
if(xChartType.is())
{
@@ -488,7 +203,7 @@ bool ChartTypeHelper::noBordersForSimpleScheme( const uno::Reference< chart2::XC
return false;
}
-sal_Int32 ChartTypeHelper::getDefaultDirectLightColor( bool bSimple, const uno::Reference< chart2::XChartType >& xChartType )
+sal_Int32 ChartTypeHelper::getDefaultDirectLightColor( bool bSimple, const rtl::Reference< ChartType >& xChartType )
{
sal_Int32 nRet = static_cast< sal_Int32 >( 0x808080 ); // grey
if( xChartType .is() )
@@ -508,7 +223,7 @@ sal_Int32 ChartTypeHelper::getDefaultDirectLightColor( bool bSimple, const uno::
return nRet;
}
-sal_Int32 ChartTypeHelper::getDefaultAmbientLightColor( bool bSimple, const uno::Reference< chart2::XChartType >& xChartType )
+sal_Int32 ChartTypeHelper::getDefaultAmbientLightColor( bool bSimple, const rtl::Reference< ChartType >& xChartType )
{
sal_Int32 nRet = static_cast< sal_Int32 >( 0x999999 ); // grey40
if( xChartType .is() )
@@ -525,7 +240,7 @@ sal_Int32 ChartTypeHelper::getDefaultAmbientLightColor( bool bSimple, const uno:
return nRet;
}
-drawing::Direction3D ChartTypeHelper::getDefaultSimpleLightDirection( const uno::Reference< chart2::XChartType >& xChartType )
+drawing::Direction3D ChartTypeHelper::getDefaultSimpleLightDirection( const rtl::Reference< ChartType >& xChartType )
{
drawing::Direction3D aRet(0.0, 0.0, 1.0);
if( xChartType .is() )
@@ -540,7 +255,7 @@ drawing::Direction3D ChartTypeHelper::getDefaultSimpleLightDirection( const uno:
return aRet;
}
-drawing::Direction3D ChartTypeHelper::getDefaultRealisticLightDirection( const uno::Reference< chart2::XChartType >& xChartType )
+drawing::Direction3D ChartTypeHelper::getDefaultRealisticLightDirection( const rtl::Reference< ChartType >& xChartType )
{
drawing::Direction3D aRet(0.0, 0.0, 1.0);
if( xChartType .is() )
@@ -555,32 +270,8 @@ drawing::Direction3D ChartTypeHelper::getDefaultRealisticLightDirection( const u
return aRet;
}
-sal_Int32 ChartTypeHelper::getAxisType( const uno::Reference<
- XChartType >& xChartType, sal_Int32 nDimensionIndex )
-{
- //returned is a constant from constant group css::chart2::AxisType
-
- //@todo ask charttype itself --> need model change first
- if(!xChartType.is())
- return AxisType::CATEGORY;
-
- OUString aChartTypeName = xChartType->getChartType();
- if(nDimensionIndex==2)//z-axis
- return AxisType::SERIES;
- if(nDimensionIndex==1)//y-axis
- return AxisType::REALNUMBER;
- if(nDimensionIndex==0)//x-axis
- {
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER)
- || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
- return AxisType::REALNUMBER;
- return AxisType::CATEGORY;
- }
- return AxisType::CATEGORY;
-}
-
sal_Int32 ChartTypeHelper::getNumberOfDisplayedSeries(
- const uno::Reference< XChartType >& xChartType,
+ const rtl::Reference< ChartType >& xChartType,
sal_Int32 nNumberOfSeries )
{
if( xChartType.is() )
@@ -590,9 +281,8 @@ sal_Int32 ChartTypeHelper::getNumberOfDisplayedSeries(
OUString aChartTypeName = xChartType->getChartType();
if( aChartTypeName == CHART2_SERVICE_NAME_CHARTTYPE_PIE )
{
- uno::Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY_THROW );
bool bDonut = false;
- if( (xChartTypeProp->getPropertyValue( "UseRings") >>= bDonut)
+ if( (xChartType->getFastPropertyValue( PROP_PIECHARTTYPE_USE_RINGS ) >>= bDonut) // "UseRings"
&& !bDonut )
{
return nNumberOfSeries>0 ? 1 : 0;
@@ -607,7 +297,7 @@ sal_Int32 ChartTypeHelper::getNumberOfDisplayedSeries(
return nNumberOfSeries;
}
-uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments( const uno::Reference< XChartType >& xChartType )
+uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments( const rtl::Reference< ChartType >& xChartType )
{
uno::Sequence < sal_Int32 > aRet;
if( !xChartType.is() )
@@ -621,6 +311,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
OUString aChartTypeName = xChartType->getChartType();
if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) ||
aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FUNNEL) ||
aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
{
aRet.realloc( 2 );
@@ -628,6 +319,13 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
*pSeq++ = css::chart::MissingValueTreatment::LEAVE_GAP;
*pSeq++ = css::chart::MissingValueTreatment::USE_ZERO;
}
+ else if (aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM))
+ {
+ // Assuming histograms typically use zero for missing values
+ aRet.realloc(1);
+ sal_Int32* pSeq = aRet.getArray();
+ *pSeq++ = css::chart::MissingValueTreatment::USE_ZERO;
+ }
else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA) )
{
aRet.realloc( bStacked ? 1 : 2 );
@@ -668,20 +366,9 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
return aRet;
}
-bool ChartTypeHelper::isSeriesInFrontOfAxisLine( const uno::Reference< XChartType >& xChartType )
+OUString ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( const rtl::Reference< ChartType >& xChartType )
{
- if( xChartType.is() )
- {
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match( CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET ) )
- return false;
- }
- return true;
-}
-
-OUString ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( const uno::Reference< XChartType >& xChartType )
-{
- OUString aRet( "values-y" );
+ OUString aRet( u"values-y"_ustr );
if( !xChartType.is() )
return aRet;
OUString aChartTypeName = xChartType->getChartType();
@@ -690,9 +377,9 @@ OUString ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( const
return aRet;
}
-OUString ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( const uno::Reference< XChartType >& xChartType )
+OUString ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::Reference< ChartType >& xChartType )
{
- OUString aRet( "values-y" );
+ OUString aRet( u"values-y"_ustr );
if( !xChartType.is() )
return aRet;
OUString aChartTypeName = xChartType->getChartType();
@@ -702,22 +389,6 @@ OUString ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( co
return aRet;
}
-bool ChartTypeHelper::isSupportingOnlyDeepStackingFor3D( const uno::Reference< XChartType >& xChartType )
-{
- bool bRet = false;
- if( !xChartType.is() )
- return bRet;
-
- OUString aChartTypeName = xChartType->getChartType();
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE) ||
- aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) ||
- aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA) )
- {
- bRet = true;
- }
- return bRet;
-}
-
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/ChartViewHelper.cxx b/chart2/source/tools/ChartViewHelper.cxx
index 8caaeddb1e94..dc91c4361493 100644
--- a/chart2/source/tools/ChartViewHelper.cxx
+++ b/chart2/source/tools/ChartViewHelper.cxx
@@ -18,30 +18,29 @@
*/
#include <ChartViewHelper.hxx>
+#include <ChartModel.hxx>
+#include <ChartView.hxx>
#include <servicenames.hxx>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
-void ChartViewHelper::setViewToDirtyState(const uno::Reference<frame::XModel>& xChartModel)
+void ChartViewHelper::setViewToDirtyState(const rtl::Reference<::chart::ChartModel>& xChartModel)
{
try
{
- uno::Reference<lang::XMultiServiceFactory> xFact(xChartModel, uno::UNO_QUERY);
- if (xFact.is())
+ if (xChartModel.is())
{
- Reference<util::XModifyListener> xModifyListener(
- xFact->createInstance(CHART_VIEW_SERVICE_NAME), uno::UNO_QUERY);
+ Reference<util::XModifyListener> xModifyListener(xChartModel->createChartView());
if (xModifyListener.is())
{
- lang::EventObject aEvent(xChartModel);
+ lang::EventObject aEvent(static_cast<cppu::OWeakObject*>(xChartModel.get()));
xModifyListener->modified(aEvent);
}
}
@@ -51,6 +50,13 @@ void ChartViewHelper::setViewToDirtyState(const uno::Reference<frame::XModel>& x
DBG_UNHANDLED_EXCEPTION("chart2");
}
}
+
+void ChartViewHelper::setViewToDirtyState_UNO(
+ const css::uno::Reference<css::chart2::XChartDocument>& xChartModel)
+{
+ if (auto pChartModel = dynamic_cast<ChartModel*>(xChartModel.get()))
+ setViewToDirtyState(rtl::Reference(pChartModel));
+}
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/ColorPerPointHelper.cxx b/chart2/source/tools/ColorPerPointHelper.cxx
deleted file mode 100644
index 34aeb7866021..000000000000
--- a/chart2/source/tools/ColorPerPointHelper.cxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- 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 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 .
- */
-
-#include <ColorPerPointHelper.hxx>
-#include <com/sun/star/chart2/XDataSeries.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-#include <algorithm>
-
-namespace chart
-{
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
-
-bool ColorPerPointHelper::hasPointOwnColor(
- const css::uno::Reference< css::beans::XPropertySet >& xDataSeriesProperties
- , sal_Int32 nPointIndex
- , const css::uno::Reference< css::beans::XPropertySet >& xDataPointProperties //may be NULL this is just for performance
- )
-{
- if( !xDataSeriesProperties.is() )
- return false;
-
- if( hasPointOwnProperties( xDataSeriesProperties, nPointIndex ))
- {
- uno::Reference< beans::XPropertyState > xPointState( xDataPointProperties, uno::UNO_QUERY );
- if( !xPointState.is() )
- {
- uno::Reference< XDataSeries > xSeries( xDataSeriesProperties, uno::UNO_QUERY );
- if(xSeries.is())
- xPointState.set( xSeries->getDataPointByIndex( nPointIndex ), uno::UNO_QUERY );
- }
- if( !xPointState.is() )
- return false;
-
- return (xPointState->getPropertyState( "Color") != beans::PropertyState_DEFAULT_VALUE );
- }
-
- return false;
-}
-
-bool ColorPerPointHelper::hasPointOwnProperties(
- const css::uno::Reference< css::beans::XPropertySet >& xSeriesProperties
- , sal_Int32 nPointIndex )
-{
- if( xSeriesProperties.is() )
- {
- uno::Sequence< sal_Int32 > aIndexList;
- if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= aIndexList )
- {
- const sal_Int32 * pBegIt = aIndexList.getConstArray();
- const sal_Int32 * pEndIt = pBegIt + aIndexList.getLength();
- return ( std::find( pBegIt, pEndIt, nPointIndex ) != pEndIt );
- }
- }
-
- return false;
-}
-
-} //namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx
index 20a3346f69b0..293fa7b11ddf 100644
--- a/chart2/source/tools/CommonConverters.cxx
+++ b/chart2/source/tools/CommonConverters.cxx
@@ -24,10 +24,12 @@
#include <com/sun/star/chart2/data/XDataSequence.hpp>
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <cstddef>
#include <limits>
namespace chart
@@ -90,9 +92,10 @@ drawing::HomogenMatrix B3DHomMatrixToHomogenMatrix( const ::basegfx::B3DHomMatri
aM.set(1, 0, rM.get(1, 0));
aM.set(1, 1, rM.get(1, 1));
aM.set(1, 2, rM.get(1, 3));
- aM.set(2, 0, rM.get(3, 0));
- aM.set(2, 1, rM.get(3, 1));
- aM.set(2, 2, rM.get(3, 3));
+ // For this to be a valid 2D transform matrix, the last row must be [0,0,1]
+ assert( rM.get(3, 0) == 0 );
+ assert( rM.get(3, 1) == 0 );
+ assert( rM.get(3, 3) == 1 );
return aM;
}
@@ -105,9 +108,9 @@ drawing::HomogenMatrix3 B2DHomMatrixToHomogenMatrix3( const ::basegfx::B2DHomMat
aHM.Line2.Column1 = rM.get(1, 0);
aHM.Line2.Column2 = rM.get(1, 1);
aHM.Line2.Column3 = rM.get(1, 2);
- aHM.Line3.Column1 = rM.get(2, 0);
- aHM.Line3.Column2 = rM.get(2, 1);
- aHM.Line3.Column3 = rM.get(2, 2);
+ aHM.Line3.Column1 = 0;
+ aHM.Line3.Column2 = 0;
+ aHM.Line3.Column3 = 1;
return aHM;
}
@@ -190,7 +193,7 @@ void AddPointToPoly( std::vector<std::vector<css::drawing::Position3D>>& rPoly,
}
//make sure that we have enough polygons
- if(nPolygonIndex >= static_cast<sal_Int32>(rPoly.size()) )
+ if(o3tl::make_unsigned(nPolygonIndex) >= rPoly.size() )
{
rPoly.resize(nPolygonIndex+1);
}
@@ -227,7 +230,7 @@ drawing::Position3D getPointFromPoly( const std::vector<std::vector<css::drawing
{
drawing::Position3D aRet(0.0,0.0,0.0);
- if( nPolyIndex>=0 && nPolyIndex<static_cast<sal_Int32>(rPolygon.size()))
+ if( nPolyIndex>=0 && o3tl::make_unsigned(nPolyIndex)<rPolygon.size())
{
if(nPointIndex<static_cast<sal_Int32>(rPolygon[nPolyIndex].size()))
{
@@ -267,15 +270,15 @@ void addPolygon( std::vector<std::vector<css::drawing::Position3D>>& rRet, const
void appendPoly( std::vector<std::vector<css::drawing::Position3D>>& rRet, const std::vector<std::vector<css::drawing::Position3D>>& rAdd )
{
- sal_Int32 nOuterCount = std::max( rRet.size(), rAdd.size() );
+ std::size_t nOuterCount = std::max( rRet.size(), rAdd.size() );
rRet.resize(nOuterCount);
auto pSequence = rRet.data();
- for( sal_Int32 nOuter=0;nOuter<nOuterCount;nOuter++ )
+ for( std::size_t nOuter=0;nOuter<nOuterCount;nOuter++ )
{
sal_Int32 nOldPointCount = rRet[nOuter].size();
sal_Int32 nAddPointCount = 0;
- if(nOuter<static_cast<sal_Int32>(rAdd.size()))
+ if(nOuter<rAdd.size())
nAddPointCount = rAdd[nOuter].size();
if(!nAddPointCount)
continue;
@@ -377,7 +380,7 @@ drawing::PointSequenceSequence PolyToPointSequence(
aRet.realloc( rPolyPolygon.size() );
auto pRet = aRet.getArray();
- for(sal_Int32 nN = 0; nN < static_cast<sal_Int32>(rPolyPolygon.size()); nN++)
+ for(std::size_t nN = 0; nN < rPolyPolygon.size(); nN++)
{
sal_Int32 nInnerLength = rPolyPolygon[nN].size();
pRet[nN].realloc( nInnerLength );
@@ -396,17 +399,17 @@ basegfx::B2DPolyPolygon PolyToB2DPolyPolygon(
{
basegfx::B2DPolyPolygon aRetval;
- for(sal_Int32 nN = 0; nN < static_cast<sal_Int32>(rPolyPolygon.size()); nN++)
+ for(auto const & nN: rPolyPolygon)
{
basegfx::B2DPolygon aNewPolygon;
- sal_Int32 nInnerLength = rPolyPolygon[nN].size();
+ sal_Int32 nInnerLength = nN.size();
if(nInnerLength)
{
aNewPolygon.reserve(nInnerLength);
for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
{
- auto X = static_cast<sal_Int32>(rPolyPolygon[nN][nM].PositionX);
- auto Y = static_cast<sal_Int32>(rPolyPolygon[nN][nM].PositionY);
+ auto X = static_cast<sal_Int32>(nN[nM].PositionX);
+ auto Y = static_cast<sal_Int32>(nN[nM].PositionY);
aNewPolygon.append(basegfx::B2DPoint(X, Y));
}
// check for closed state flag
@@ -419,7 +422,7 @@ basegfx::B2DPolyPolygon PolyToB2DPolyPolygon(
}
void appendPointSequence( drawing::PointSequenceSequence& rTarget
- , drawing::PointSequenceSequence& rAdd )
+ , const drawing::PointSequenceSequence& rAdd )
{
sal_Int32 nAddCount = rAdd.getLength();
if(!nAddCount)
@@ -581,7 +584,7 @@ sal_Int16 getShortForLongAlso( const uno::Any& rAny )
}
bool replaceParamterInString( OUString & rInOutResourceString,
- const OUString & rParamToReplace,
+ std::u16string_view rParamToReplace,
std::u16string_view rReplaceWith )
{
sal_Int32 nPos = rInOutResourceString.indexOf( rParamToReplace );
@@ -589,7 +592,7 @@ bool replaceParamterInString( OUString & rInOutResourceString,
return false;
rInOutResourceString = rInOutResourceString.replaceAt( nPos
- , rParamToReplace.getLength(), rReplaceWith );
+ , rParamToReplace.size(), rReplaceWith );
return true;
}
diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx
index 50d72a88207e..b4bbd8dfa369 100644
--- a/chart2/source/tools/ConfigColorScheme.cxx
+++ b/chart2/source/tools/ConfigColorScheme.cxx
@@ -20,11 +20,7 @@
#include <ConfigColorScheme.hxx>
#include <unotools/configitem.hxx>
-#include <sal/macros.h>
#include <cppuhelper/supportsservice.hxx>
-#include <comphelper/sequence.hxx>
-
-#include <set>
using namespace ::com::sun::star;
@@ -34,7 +30,7 @@ using ::com::sun::star::uno::Sequence;
namespace
{
-constexpr OUStringLiteral aSeriesPropName = u"Series";
+constexpr OUString aSeriesPropName = u"Series"_ustr;
} // anonymous namespace
@@ -53,7 +49,6 @@ class ChartConfigItem : public ::utl::ConfigItem
public:
explicit ChartConfigItem( ConfigColorScheme & rListener );
- void addPropertyNotification( const OUString & rPropertyName );
uno::Any getProperty( const OUString & aPropertyName );
protected:
@@ -63,32 +58,27 @@ protected:
private:
ConfigColorScheme & m_rListener;
- std::set< OUString > m_aPropertiesToNotify;
};
ChartConfigItem::ChartConfigItem( ConfigColorScheme & rListener ) :
- ::utl::ConfigItem( "Office.Chart/DefaultColor" ),
+ ::utl::ConfigItem( u"Office.Chart/DefaultColor"_ustr ),
m_rListener( rListener )
-{}
+{
+ EnableNotification( { aSeriesPropName } );
+}
void ChartConfigItem::Notify( const Sequence< OUString > & aPropertyNames )
{
for( OUString const & s : aPropertyNames )
{
- if( m_aPropertiesToNotify.find( s ) != m_aPropertiesToNotify.end())
- m_rListener.notify( s );
+ if( s == aSeriesPropName )
+ m_rListener.notify();
}
}
void ChartConfigItem::ImplCommit()
{}
-void ChartConfigItem::addPropertyNotification( const OUString & rPropertyName )
-{
- m_aPropertiesToNotify.insert( rPropertyName );
- EnableNotification( comphelper::containerToSequence( m_aPropertiesToNotify ));
-}
-
uno::Any ChartConfigItem::getProperty( const OUString & aPropertyName )
{
Sequence< uno::Any > aValues(
@@ -103,8 +93,8 @@ uno::Any ChartConfigItem::getProperty( const OUString & aPropertyName )
// explicit
ConfigColorScheme::ConfigColorScheme(
const Reference< uno::XComponentContext > & xContext ) :
+ BaseColorScheme(),
m_xContext( xContext ),
- m_nNumberOfColors( 0 ),
m_bNeedsUpdate( true )
{
}
@@ -122,11 +112,8 @@ void ConfigColorScheme::retrieveConfigColors()
{
m_apChartConfigItem.reset(
new impl::ChartConfigItem( *this ));
- m_apChartConfigItem->addPropertyNotification( aSeriesPropName );
}
- OSL_ASSERT(m_apChartConfigItem);
- if (!m_apChartConfigItem)
- return;
+ assert(m_apChartConfigItem && "this can only be set at this point");
// retrieve colors
uno::Any aValue(
@@ -153,29 +140,18 @@ void ConfigColorScheme::retrieveConfigColors()
0xff00ff, 0x00ffff, 0xffff00
};
- static const sal_Int32 nMaxDefaultColors = SAL_N_ELEMENTS( nDefaultColors );
+ static const sal_Int32 nMaxDefaultColors = std::size( nDefaultColors );
return nDefaultColors[ nIndex % nMaxDefaultColors ];
}
-void ConfigColorScheme::notify( std::u16string_view rPropertyName )
+void ConfigColorScheme::notify()
{
- if( rPropertyName == aSeriesPropName )
- m_bNeedsUpdate = true;
+ m_bNeedsUpdate = true;
}
OUString SAL_CALL ConfigColorScheme::getImplementationName()
{
- return "com.sun.star.comp.chart2.ConfigDefaultColorScheme" ;
-}
-
-sal_Bool SAL_CALL ConfigColorScheme::supportsService( const OUString& rServiceName )
-{
- return cppu::supportsService(this, rServiceName);
-}
-
-css::uno::Sequence< OUString > SAL_CALL ConfigColorScheme::getSupportedServiceNames()
-{
- return { "com.sun.star.chart2.ColorScheme" };
+ return u"com.sun.star.comp.chart2.ConfigDefaultColorScheme"_ustr ;
}
} // namespace chart
diff --git a/chart2/source/tools/ControllerLockGuard.cxx b/chart2/source/tools/ControllerLockGuard.cxx
index 7719755e9aff..6bfe8e4a95d2 100644
--- a/chart2/source/tools/ControllerLockGuard.cxx
+++ b/chart2/source/tools/ControllerLockGuard.cxx
@@ -19,16 +19,15 @@
#include <ControllerLockGuard.hxx>
#include <ChartModel.hxx>
+#include <utility>
using namespace ::com::sun::star;
-using ::com::sun::star::uno::Reference;
-
namespace chart
{
-ControllerLockGuardUNO::ControllerLockGuardUNO( const uno::Reference< frame::XModel >& xModel ) :
- mxModel( xModel )
+ControllerLockGuardUNO::ControllerLockGuardUNO( rtl::Reference<::chart::ChartModel> xModel ) :
+ mxModel(std::move( xModel ))
{
mxModel->lockControllers();
}
@@ -49,8 +48,8 @@ ControllerLockGuard::~ControllerLockGuard()
mrModel.unlockControllers();
}
-ControllerLockHelper::ControllerLockHelper( const Reference< frame::XModel > & xModel ) :
- m_xModel( xModel )
+ControllerLockHelper::ControllerLockHelper( rtl::Reference<::chart::ChartModel> xModel ) :
+ m_xModel(std::move( xModel ))
{}
ControllerLockHelper::~ControllerLockHelper()
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index ed90d3a8c207..d3343d8dbcf3 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -18,36 +18,36 @@
*/
#include <DataSeriesHelper.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
#include <DataSource.hxx>
+#include <ChartType.hxx>
#include <unonames.hxx>
#include <Diagram.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <Axis.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
-#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
-#include <com/sun/star/chart2/data/LabelOrigin.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/SymbolStyle.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <comphelper/sequence.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
#include <iterator>
+#include <utility>
#include <vector>
#include <set>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -58,8 +58,8 @@ namespace
class lcl_MatchesRole
{
public:
- explicit lcl_MatchesRole( const OUString & aRole, bool bMatchPrefix ) :
- m_aRole( aRole ),
+ explicit lcl_MatchesRole( OUString aRole, bool bMatchPrefix ) :
+ m_aRole(std::move( aRole )),
m_bMatchPrefix( bMatchPrefix )
{}
@@ -72,11 +72,11 @@ public:
if( m_bMatchPrefix )
return ( xProp.is() &&
- (xProp->getPropertyValue( "Role" ) >>= aRole ) &&
+ (xProp->getPropertyValue( u"Role"_ustr ) >>= aRole ) &&
aRole.match( m_aRole ));
return ( xProp.is() &&
- (xProp->getPropertyValue( "Role" ) >>= aRole ) &&
+ (xProp->getPropertyValue( u"Role"_ustr ) >>= aRole ) &&
m_aRole == aRole );
}
@@ -85,106 +85,31 @@ private:
bool m_bMatchPrefix;
};
-Reference< chart2::data::XLabeledDataSequence > lcl_findLSequenceWithOnlyLabel(
- const Reference< chart2::data::XDataSource > & xDataSource )
-{
- Reference< chart2::data::XLabeledDataSequence > xResult;
- const Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences( xDataSource->getDataSequences());
-
- for( auto const & labeledData : aSequences )
- {
- OSL_ENSURE( labeledData.is(), "empty LabeledDataSequence" );
- // no values are set but a label exists
- if( labeledData.is() &&
- ( ! labeledData->getValues().is() &&
- labeledData->getLabel().is()))
- {
- xResult.set( labeledData );
- break;
- }
- }
-
- return xResult;
-}
-
void lcl_getCooSysAndChartTypeOfSeries(
- const Reference< chart2::XDataSeries > & xSeries,
- const Reference< chart2::XDiagram > & xDiagram,
+ const rtl::Reference< ::chart::DataSeries > & xSeries,
+ const rtl::Reference< ::chart::Diagram > & xDiagram,
rtl::Reference< ::chart::BaseCoordinateSystem > & xOutCooSys,
- Reference< chart2::XChartType > & xOutChartType )
+ rtl::Reference< ::chart::ChartType > & xOutChartType )
{
if( !xDiagram.is())
return;
- ::chart::Diagram* pDiagram = dynamic_cast<::chart::Diagram*>(xDiagram.get());
- for( rtl::Reference< ::chart::BaseCoordinateSystem > const & coords : pDiagram->getBaseCoordinateSystems() )
+ for( rtl::Reference< ::chart::BaseCoordinateSystem > const & coords : xDiagram->getBaseCoordinateSystems() )
{
- const Sequence< Reference< chart2::XChartType > > aChartTypes( coords->getChartTypes());
- for( Reference< chart2::XChartType > const & chartType : aChartTypes )
+ for( rtl::Reference< ::chart::ChartType > const & chartType : coords->getChartTypes2() )
{
- Reference< chart2::XDataSeriesContainer > xSeriesCnt( chartType, uno::UNO_QUERY );
- if( xSeriesCnt.is())
+ for( rtl::Reference< ::chart::DataSeries > const & dataSeries : chartType->getDataSeries2() )
{
- const Sequence< Reference< chart2::XDataSeries > > aSeries( xSeriesCnt->getDataSeries());
- for( Reference< chart2::XDataSeries > const & dataSeries : aSeries )
+ if( dataSeries == xSeries )
{
- if( dataSeries == xSeries )
- {
- xOutCooSys = coords;
- xOutChartType.set( chartType );
- }
+ xOutCooSys = coords;
+ xOutChartType = chartType;
}
}
}
}
}
-void lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( const Reference< chart2::XDataSeries >& xSeries, bool bInsert )
-{
- try
- {
- Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
- if( xSeriesProperties.is() )
- {
- DataPointLabel aLabelAtSeries;
- xSeriesProperties->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabelAtSeries;
- aLabelAtSeries.ShowNumber = bInsert;
- if( !bInsert )
- {
- aLabelAtSeries.ShowNumberInPercent = false;
- aLabelAtSeries.ShowCategoryName = false;
- }
- xSeriesProperties->setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabelAtSeries));
- uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
- {
- for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
- {
- Reference< beans::XPropertySet > xPointProp( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]) );
- if( xPointProp.is() )
- {
- DataPointLabel aLabel;
- xPointProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel;
- aLabel.ShowNumber = bInsert;
- if( !bInsert )
- {
- aLabel.ShowNumberInPercent = false;
- aLabel.ShowCategoryName = false;
- aLabel.ShowCustomLabel = false;
- aLabel.ShowSeriesName = false;
- }
- xPointProp->setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabel));
- xPointProp->setPropertyValue(CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
- }
- }
- }
- }
- }
- catch(const uno::Exception &)
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
-}
} // anonymous namespace
@@ -198,191 +123,84 @@ OUString getRole( const uno::Reference< chart2::data::XLabeledDataSequence >& xL
{
Reference< beans::XPropertySet > xProp( xLabeledDataSequence->getValues(), uno::UNO_QUERY );
if( xProp.is() )
- xProp->getPropertyValue( "Role" ) >>= aRet;
+ xProp->getPropertyValue( u"Role"_ustr ) >>= aRet;
}
return aRet;
}
-Reference< chart2::data::XLabeledDataSequence >
+uno::Reference< chart2::data::XLabeledDataSequence >
getDataSequenceByRole(
const Reference< chart2::data::XDataSource > & xSource,
const OUString& aRole,
bool bMatchPrefix /* = false */ )
{
- Reference< chart2::data::XLabeledDataSequence > aNoResult;
+ uno::Reference< chart2::data::XLabeledDataSequence > aNoResult;
if( ! xSource.is())
return aNoResult;
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aLabeledSeq( xSource->getDataSequences());
-
- const Reference< chart2::data::XLabeledDataSequence > * pBegin = aLabeledSeq.getConstArray();
- const Reference< chart2::data::XLabeledDataSequence > * pEnd = pBegin + aLabeledSeq.getLength();
- const Reference< chart2::data::XLabeledDataSequence > * pMatch =
- std::find_if( pBegin, pEnd, lcl_MatchesRole( aRole, bMatchPrefix ));
-
- if( pMatch != pEnd )
- return *pMatch;
+ const Sequence< Reference< chart2::data::XLabeledDataSequence > > aLabeledSeq( xSource->getDataSequences());
+ try
+ {
+ for (auto const & i : aLabeledSeq)
+ {
+ if (lcl_MatchesRole(aRole, bMatchPrefix)(i))
+ return i;
+ }
+ }
+ catch (const lang::DisposedException&)
+ {
+ TOOLS_WARN_EXCEPTION( "chart2", "unexpected exception caught" );
+ }
return aNoResult;
}
-std::vector< Reference< chart2::data::XLabeledDataSequence > >
+std::vector< uno::Reference< chart2::data::XLabeledDataSequence > >
getAllDataSequencesByRole( const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aDataSequences,
const OUString& aRole )
{
- std::vector< Reference< chart2::data::XLabeledDataSequence > > aResultVec;
- std::copy_if( aDataSequences.begin(), aDataSequences.end(),
- std::back_inserter( aResultVec ),
- lcl_MatchesRole(aRole, /*bMatchPrefix*/true) );
- return aResultVec;
-}
-
-std::vector<Reference<css::chart2::data::XLabeledDataSequence> >
-getAllDataSequences( const uno::Sequence<uno::Reference<chart2::XDataSeries> >& aSeries )
-{
- std::vector< Reference< chart2::data::XLabeledDataSequence > > aSeqVec;
-
- for( uno::Reference<chart2::XDataSeries> const & dataSeries : aSeries )
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aResultVec;
+ for (const auto & i : aDataSequences)
{
- Reference< chart2::data::XDataSource > xSource( dataSeries, uno::UNO_QUERY );
- if( xSource.is())
- {
- const Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( xSource->getDataSequences());
- aSeqVec.insert( aSeqVec.end(), aSeq.begin(), aSeq.end() );
- }
+ if (lcl_MatchesRole(aRole, /*bMatchPrefix*/true)(i))
+ aResultVec.push_back(i);
}
-
- return aSeqVec;
+ return aResultVec;
}
-Reference< chart2::data::XDataSource >
- getDataSource( const Sequence< Reference< chart2::XDataSeries > > & aSeries )
+std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > >
+ getAllDataSequencesByRole( const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aDataSequences,
+ const OUString& aRole )
{
- return Reference< chart2::data::XDataSource >(
- new DataSource(comphelper::containerToSequence(getAllDataSequences(aSeries))));
+ std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > aResultVec;
+ std::copy_if( aDataSequences.begin(), aDataSequences.end(),
+ std::back_inserter( aResultVec ),
+ lcl_MatchesRole(aRole, /*bMatchPrefix*/true) );
+ return aResultVec;
}
-namespace
-{
-OUString lcl_getDataSequenceLabel( const Reference< chart2::data::XDataSequence > & xSequence )
+std::vector<uno::Reference<chart2::data::XLabeledDataSequence> >
+getAllDataSequences( const std::vector<rtl::Reference<DataSeries> >& aSeries )
{
- OUString aResult;
-
- Reference< chart2::data::XTextualDataSequence > xTextSeq( xSequence, uno::UNO_QUERY );
- if( xTextSeq.is())
- {
- Sequence< OUString > aSeq( xTextSeq->getTextualData());
-
- const sal_Int32 nMax = aSeq.getLength() - 1;
- OUStringBuffer aBuf;
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aSeqVec;
- for( sal_Int32 i = 0; i <= nMax; ++i )
- {
- aBuf.append( aSeq[i] );
- if( i < nMax )
- aBuf.append( ' ');
- }
- aResult = aBuf.makeStringAndClear();
- }
- else if( xSequence.is())
+ for( rtl::Reference<DataSeries> const & dataSeries : aSeries )
{
- Sequence< uno::Any > aSeq( xSequence->getData());
-
- const sal_Int32 nMax = aSeq.getLength() - 1;
- OUString aVal;
- OUStringBuffer aBuf;
- double fNum = 0;
-
- for( sal_Int32 i = 0; i <= nMax; ++i )
- {
- if( aSeq[i] >>= aVal )
- {
- aBuf.append( aVal );
- if( i < nMax )
- aBuf.append( ' ');
- }
- else if( aSeq[ i ] >>= fNum )
- {
- aBuf.append( fNum );
- if( i < nMax )
- aBuf.append( ' ');
- }
- }
- aResult = aBuf.makeStringAndClear();
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aSeq( dataSeries->getDataSequences2());
+ aSeqVec.insert( aSeqVec.end(), aSeq.begin(), aSeq.end() );
}
- return aResult;
-}
+ return aSeqVec;
}
-OUString getLabelForLabeledDataSequence(
- const Reference< chart2::data::XLabeledDataSequence > & xLabeledSeq )
+rtl::Reference< DataSource >
+ getDataSource( const std::vector< rtl::Reference< DataSeries > > & aSeries )
{
- OUString aResult;
- if( xLabeledSeq.is())
- {
- Reference< chart2::data::XDataSequence > xSeq( xLabeledSeq->getLabel());
- if( xSeq.is() )
- aResult = lcl_getDataSequenceLabel( xSeq );
- if( !xSeq.is() || aResult.isEmpty() )
- {
- // no label set or label content is empty -> use auto-generated one
- Reference< chart2::data::XDataSequence > xValueSeq( xLabeledSeq->getValues() );
- if( xValueSeq.is() )
- {
- Sequence< OUString > aLabels( xValueSeq->generateLabel(
- chart2::data::LabelOrigin_SHORT_SIDE ) );
- // no labels returned is interpreted as: auto-generation not
- // supported by sequence
- if( aLabels.hasElements() )
- aResult=aLabels[0];
- else
- {
- //todo?: maybe use the index of the series as name
- //but as the index may change it would be better to have such a name persistent
- //what is not possible at the moment
- //--> maybe use the identifier as part of the name ...
- aResult = lcl_getDataSequenceLabel( xValueSeq );
- }
- }
- }
- }
- return aResult;
-}
-
-OUString getDataSeriesLabel(
- const Reference< chart2::XDataSeries > & xSeries,
- const OUString & rLabelSequenceRole )
-{
- OUString aResult;
-
- Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
- if( xSource.is())
- {
- Reference< chart2::data::XLabeledDataSequence > xLabeledSeq(
- ::chart::DataSeriesHelper::getDataSequenceByRole( xSource, rLabelSequenceRole ));
- if( xLabeledSeq.is())
- aResult = getLabelForLabeledDataSequence( xLabeledSeq );
- else
- {
- // special case: labeled data series with only a label and no values may
- // serve as label
- xLabeledSeq.set( lcl_findLSequenceWithOnlyLabel( xSource ));
- if( xLabeledSeq.is())
- {
- Reference< chart2::data::XDataSequence > xSeq( xLabeledSeq->getLabel());
- if( xSeq.is())
- aResult = lcl_getDataSequenceLabel( xSeq );
- }
- }
-
- }
-
- return aResult;
+ return new DataSource(getAllDataSequences(aSeries));
}
void setStackModeAtSeries(
- const Sequence< Reference< chart2::XDataSeries > > & aSeries,
- const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
+ const std::vector< rtl::Reference< DataSeries > > & aSeries,
+ const rtl::Reference< BaseCoordinateSystem > & xCorrespondingCoordinateSystem,
StackMode eStackMode )
{
const uno::Any aPropValue(
@@ -394,17 +212,16 @@ void setStackModeAtSeries(
: chart2::StackingDirection_NO_STACKING );
std::set< sal_Int32 > aAxisIndexSet;
- for( Reference< chart2::XDataSeries > const & dataSeries : aSeries )
+ for( rtl::Reference< DataSeries > const & dataSeries : aSeries )
{
try
{
- Reference< beans::XPropertySet > xProp( dataSeries, uno::UNO_QUERY );
- if( xProp.is() )
+ if( dataSeries.is() )
{
- xProp->setPropertyValue( "StackingDirection", aPropValue );
+ dataSeries->setPropertyValue( u"StackingDirection"_ustr, aPropValue );
- sal_Int32 nAxisIndex;
- xProp->getPropertyValue( "AttachedAxisIndex" ) >>= nAxisIndex;
+ sal_Int32 nAxisIndex = 0;
+ dataSeries->getPropertyValue( u"AttachedAxisIndex"_ustr ) >>= nAxisIndex;
aAxisIndexSet.insert(nAxisIndex);
}
}
@@ -425,8 +242,8 @@ void setStackModeAtSeries(
for (auto const& axisIndex : aAxisIndexSet)
{
- Reference< chart2::XAxis > xAxis(
- xCorrespondingCoordinateSystem->getAxisByDimension(1, axisIndex));
+ rtl::Reference< Axis > xAxis =
+ xCorrespondingCoordinateSystem->getAxisByDimension2(1, axisIndex);
if( xAxis.is())
{
bool bPercent = (eStackMode == StackMode::YStackedPercent);
@@ -444,37 +261,19 @@ void setStackModeAtSeries(
}
}
-sal_Int32 getAttachedAxisIndex( const Reference< chart2::XDataSeries > & xSeries )
-{
- sal_Int32 nRet = 0;
- try
- {
- Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY );
- if( xProp.is() )
- {
- xProp->getPropertyValue( "AttachedAxisIndex" ) >>= nRet;
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- return nRet;
-}
-
sal_Int32 getNumberFormatKeyFromAxis(
- const Reference< chart2::XDataSeries > & xSeries,
- const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
+ const rtl::Reference< DataSeries > & xSeries,
+ const rtl::Reference< BaseCoordinateSystem > & xCorrespondingCoordinateSystem,
sal_Int32 nDimensionIndex,
sal_Int32 nAxisIndex /* = -1 */ )
{
sal_Int32 nResult = 0;
if( nAxisIndex == -1 )
- nAxisIndex = getAttachedAxisIndex( xSeries );
+ nAxisIndex = xSeries->getAttachedAxisIndex();
try
{
- Reference< beans::XPropertySet > xAxisProp(
- xCorrespondingCoordinateSystem->getAxisByDimension( nDimensionIndex, nAxisIndex ), uno::UNO_QUERY );
+ rtl::Reference< Axis > xAxisProp =
+ xCorrespondingCoordinateSystem->getAxisByDimension2( nDimensionIndex, nAxisIndex );
if( xAxisProp.is())
xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nResult;
}
@@ -487,196 +286,27 @@ sal_Int32 getNumberFormatKeyFromAxis(
}
rtl::Reference< ::chart::BaseCoordinateSystem > getCoordinateSystemOfSeries(
- const Reference< chart2::XDataSeries > & xSeries,
- const Reference< chart2::XDiagram > & xDiagram )
+ const rtl::Reference< DataSeries > & xSeries,
+ const rtl::Reference< Diagram > & xDiagram )
{
rtl::Reference< ::chart::BaseCoordinateSystem > xResult;
- Reference< chart2::XChartType > xDummy;
+ rtl::Reference< ::chart::ChartType > xDummy;
lcl_getCooSysAndChartTypeOfSeries( xSeries, xDiagram, xResult, xDummy );
return xResult;
}
-Reference< chart2::XChartType > getChartTypeOfSeries(
- const Reference< chart2::XDataSeries > & xSeries,
- const Reference< chart2::XDiagram > & xDiagram )
+rtl::Reference< ::chart::ChartType > getChartTypeOfSeries(
+ const rtl::Reference< DataSeries > & xSeries,
+ const rtl::Reference< Diagram > & xDiagram )
{
- Reference< chart2::XChartType > xResult;
+ rtl::Reference< ::chart::ChartType > xResult;
rtl::Reference< ::chart::BaseCoordinateSystem > xDummy;
lcl_getCooSysAndChartTypeOfSeries( xSeries, xDiagram, xDummy, xResult );
return xResult;
}
-void deleteSeries(
- const Reference< chart2::XDataSeries > & xSeries,
- const Reference< chart2::XChartType > & xChartType )
-{
- try
- {
- Reference< chart2::XDataSeriesContainer > xSeriesCnt( xChartType, uno::UNO_QUERY_THROW );
- auto aSeries(
- comphelper::sequenceToContainer<std::vector< Reference< chart2::XDataSeries > > >( xSeriesCnt->getDataSeries()));
- std::vector< Reference< chart2::XDataSeries > >::iterator aIt =
- std::find( aSeries.begin(), aSeries.end(), xSeries );
- if( aIt != aSeries.end())
- {
- aSeries.erase( aIt );
- xSeriesCnt->setDataSeries( comphelper::containerToSequence( aSeries ));
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-}
-
-void switchSymbolsOnOrOff( const Reference< beans::XPropertySet > & xSeriesProperties,
- bool bSymbolsOn, sal_Int32 nSeriesIndex )
-{
- if( !xSeriesProperties.is() )
- return;
-
- chart2::Symbol aSymbProp;
- if( xSeriesProperties->getPropertyValue( "Symbol") >>= aSymbProp )
- {
- if( !bSymbolsOn )
- aSymbProp.Style = chart2::SymbolStyle_NONE;
- else if( aSymbProp.Style == chart2::SymbolStyle_NONE )
- {
- aSymbProp.Style = chart2::SymbolStyle_STANDARD;
- aSymbProp.StandardSymbol = nSeriesIndex;
- }
- xSeriesProperties->setPropertyValue( "Symbol", uno::Any( aSymbProp ));
- }
- //todo: check attributed data points
-}
-
-void switchLinesOnOrOff( const Reference< beans::XPropertySet > & xSeriesProperties, bool bLinesOn )
-{
- if( !xSeriesProperties.is() )
- return;
-
- if( bLinesOn )
- {
- // keep line-styles that are not NONE
- drawing::LineStyle eLineStyle;
- if( (xSeriesProperties->getPropertyValue( "LineStyle") >>= eLineStyle ) &&
- eLineStyle == drawing::LineStyle_NONE )
- {
- xSeriesProperties->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_SOLID ) );
- }
- }
- else
- xSeriesProperties->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_NONE ) );
-}
-
-void makeLinesThickOrThin( const Reference< beans::XPropertySet > & xSeriesProperties, bool bThick )
-{
- if( !xSeriesProperties.is() )
- return;
-
- sal_Int32 nNewValue = bThick ? 80 : 0;
- sal_Int32 nOldValue = 0;
- if( (xSeriesProperties->getPropertyValue( "LineWidth") >>= nOldValue ) &&
- nOldValue != nNewValue )
- {
- if( !(bThick && nOldValue>0))
- xSeriesProperties->setPropertyValue( "LineWidth", uno::Any( nNewValue ) );
- }
-}
-
-void setPropertyAlsoToAllAttributedDataPoints( const Reference< chart2::XDataSeries >& xSeries,
- const OUString& rPropertyName, const uno::Any& rPropertyValue )
-{
- Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
- if( !xSeriesProperties.is() )
- return;
-
- xSeriesProperties->setPropertyValue( rPropertyName, rPropertyValue );
- uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
- {
- for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
- {
- Reference< beans::XPropertySet > xPointProp( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]) );
- if(!xPointProp.is())
- continue;
- xPointProp->setPropertyValue( rPropertyName, rPropertyValue );
- if( rPropertyName == "LabelPlacement" )
- xPointProp->setPropertyValue("CustomLabelPosition", uno::Any());
- }
- }
-}
-
-bool hasAttributedDataPointDifferentValue( const Reference< chart2::XDataSeries >& xSeries,
- const OUString& rPropertyName, const uno::Any& rPropertyValue )
-{
- Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
- if( !xSeriesProperties.is() )
- return false;
-
- uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
- {
- for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
- {
- Reference< beans::XPropertySet > xPointProp( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]) );
- if(!xPointProp.is())
- continue;
- uno::Any aPointValue( xPointProp->getPropertyValue( rPropertyName ) );
- if( rPropertyValue != aPointValue )
- return true;
- }
- }
- return false;
-}
-
-namespace
-{
-
-bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
-{
- if( !xDataSequence.is() )
- return false;
- uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
- if( xProp.is() )
- {
- uno::Sequence< sal_Int32 > aHiddenValues;
- try
- {
- xProp->getPropertyValue( "HiddenValues" ) >>= aHiddenValues;
- if( !aHiddenValues.hasElements() )
- return true;
- }
- catch( const uno::Exception& )
- {
- return true;
- }
- }
- return xDataSequence->getData().hasElements();
-}
-
-}
-
-bool hasUnhiddenData( const uno::Reference< chart2::XDataSeries >& xSeries )
-{
- uno::Reference< chart2::data::XDataSource > xDataSource( xSeries, uno::UNO_QUERY );
-
- uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aDataSequences = xDataSource->getDataSequences();
-
- for(sal_Int32 nN = aDataSequences.getLength();nN--;)
- {
- if( !aDataSequences[nN].is() )
- continue;
- if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getValues() ) )
- return true;
- if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getLabel() ) )
- return true;
- }
- return false;
-}
-
sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nIndex, const Reference< chart2::data::XDataSequence >& xDataSequence, bool bTranslate )
{
if( !bTranslate )
@@ -688,7 +318,7 @@ sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nIndex, const Refere
if( xProp.is())
{
Sequence<sal_Int32> aHiddenIndicesSeq;
- xProp->getPropertyValue( "HiddenValues" ) >>= aHiddenIndicesSeq;
+ xProp->getPropertyValue( u"HiddenValues"_ustr ) >>= aHiddenIndicesSeq;
if( aHiddenIndicesSeq.hasElements() )
{
auto aHiddenIndices( comphelper::sequenceToContainer<std::vector< sal_Int32 >>( aHiddenIndicesSeq ) );
@@ -711,108 +341,6 @@ sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nIndex, const Refere
return nIndex;
}
-bool hasDataLabelsAtSeries( const Reference< chart2::XDataSeries >& xSeries )
-{
- bool bRet = false;
- try
- {
- Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY );
- if( xProp.is() )
- {
- DataPointLabel aLabel;
- if( xProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel )
- bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent || aLabel.ShowCategoryName
- || aLabel.ShowSeriesName;
- }
- }
- catch(const uno::Exception &)
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- return bRet;
-}
-
-bool hasDataLabelsAtPoints( const Reference< chart2::XDataSeries >& xSeries )
-{
- bool bRet = false;
- try
- {
- Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
- if( xSeriesProperties.is() )
- {
- uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
- {
- for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
- {
- Reference< beans::XPropertySet > xPointProp( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]) );
- if( xPointProp.is() )
- {
- DataPointLabel aLabel;
- if( xPointProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel )
- bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent
- || aLabel.ShowCategoryName || aLabel.ShowCustomLabel
- || aLabel.ShowSeriesName;
- if( bRet )
- break;
- }
- }
- }
- }
- }
- catch(const uno::Exception &)
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- return bRet;
-}
-
-bool hasDataLabelAtPoint( const Reference< chart2::XDataSeries >& xSeries, sal_Int32 nPointIndex )
-{
- bool bRet = false;
- try
- {
- Reference< beans::XPropertySet > xProp;
- Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
- if( xSeriesProperties.is() )
- {
- uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
- {
- auto aIndices( comphelper::sequenceToContainer<std::vector< sal_Int32 >>( aAttributedDataPointIndexList ) );
- std::vector< sal_Int32 >::iterator aIt = std::find( aIndices.begin(), aIndices.end(), nPointIndex );
- if( aIt != aIndices.end())
- xProp = xSeries->getDataPointByIndex(nPointIndex);
- else
- xProp = xSeriesProperties;
- }
- if( xProp.is() )
- {
- DataPointLabel aLabel;
- if( xProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel )
- bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent
- || aLabel.ShowCategoryName || aLabel.ShowCustomLabel
- || aLabel.ShowSeriesName;
- }
- }
- }
- catch(const uno::Exception &)
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- return bRet;
-}
-
-void insertDataLabelsToSeriesAndAllPoints( const Reference< chart2::XDataSeries >& xSeries )
-{
- lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( xSeries, true /*bInsert*/ );
-}
-
-void deleteDataLabelsFromSeriesAndAllPoints( const Reference< chart2::XDataSeries >& xSeries )
-{
- lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( xSeries, false /*bInsert*/ );
-}
-
void insertDataLabelToPoint( const Reference< beans::XPropertySet >& xPointProp )
{
try
diff --git a/chart2/source/tools/DataSource.cxx b/chart2/source/tools/DataSource.cxx
index bdcac98ef1e6..8bf1cd2bc792 100644
--- a/chart2/source/tools/DataSource.cxx
+++ b/chart2/source/tools/DataSource.cxx
@@ -19,6 +19,7 @@
#include <DataSource.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/sequence.hxx>
namespace com::sun::star::uno { class XComponentContext; }
@@ -39,6 +40,12 @@ DataSource::DataSource(
m_aDataSeq( rSequences )
{}
+DataSource::DataSource(
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & rSequences )
+{
+ m_aDataSeq = comphelper::containerToSequence< Reference< chart2::data::XLabeledDataSequence > >(rSequences);
+}
+
DataSource::~DataSource()
{}
@@ -56,7 +63,7 @@ void SAL_CALL DataSource::setData( const Sequence< Reference< chart2::data::XLab
OUString SAL_CALL DataSource::getImplementationName()
{
- return "com.sun.star.comp.chart.DataSource";
+ return u"com.sun.star.comp.chart.DataSource"_ustr;
}
sal_Bool SAL_CALL DataSource::supportsService( const OUString& rServiceName )
@@ -66,7 +73,7 @@ sal_Bool SAL_CALL DataSource::supportsService( const OUString& rServiceName )
css::uno::Sequence< OUString > SAL_CALL DataSource::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.data.DataSource" };
+ return { u"com.sun.star.chart2.data.DataSource"_ustr };
}
} // namespace chart
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 1881df79097e..c0bd10b65543 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -19,9 +19,9 @@
#include <DataSourceHelper.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <ChartTypeManager.hxx>
#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <DataSource.hxx>
#include <ControllerLockGuard.hxx>
@@ -29,13 +29,12 @@
#include <LabeledDataSequence.hxx>
#include <unonames.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -73,20 +72,19 @@ void lcl_addDataSourceRanges(
void lcl_addErrorBarRanges(
std::vector< OUString > & rOutResult,
- const uno::Reference< XDataSeries > & xDataSeries )
+ const rtl::Reference< DataSeries > & xDataSeries )
{
- uno::Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY );
- if( !xSeriesProp.is())
+ if( !xDataSeries.is())
return;
try
{
uno::Reference< beans::XPropertySet > xErrorBarProp;
- if( ( xSeriesProp->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp ) &&
+ if( ( xDataSeries->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp ) &&
xErrorBarProp.is())
{
sal_Int32 eStyle = css::chart::ErrorBarStyle::NONE;
- if( ( xErrorBarProp->getPropertyValue( "ErrorBarStyle") >>= eStyle ) &&
+ if( ( xErrorBarProp->getPropertyValue( u"ErrorBarStyle"_ustr) >>= eStyle ) &&
eStyle == css::chart::ErrorBarStyle::FROM_DATA )
{
uno::Reference< data::XDataSource > xErrorBarDataSource( xErrorBarProp, uno::UNO_QUERY );
@@ -95,10 +93,10 @@ void lcl_addErrorBarRanges(
}
}
- if( ( xSeriesProp->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp ) && xErrorBarProp.is())
+ if( ( xDataSeries->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp ) && xErrorBarProp.is())
{
sal_Int32 eStyle = css::chart::ErrorBarStyle::NONE;
- if( ( xErrorBarProp->getPropertyValue("ErrorBarStyle") >>= eStyle ) &&
+ if( ( xErrorBarProp->getPropertyValue(u"ErrorBarStyle"_ustr) >>= eStyle ) &&
eStyle == css::chart::ErrorBarStyle::FROM_DATA )
{
uno::Reference< data::XDataSource > xErrorBarDataSource( xErrorBarProp, uno::UNO_QUERY );
@@ -115,12 +113,6 @@ void lcl_addErrorBarRanges(
} // anonymous namespace
-Reference< chart2::data::XDataSource > DataSourceHelper::createDataSource(
- const Sequence< Reference< chart2::data::XLabeledDataSequence > >& rSequences )
-{
- return new DataSource(rSequences);
-}
-
Reference< chart2::data::XDataSequence > DataSourceHelper::createCachedDataSequence()
{
return new ::chart::CachedDataSequence();
@@ -131,20 +123,20 @@ Reference< chart2::data::XDataSequence > DataSourceHelper::createCachedDataSeque
return new ::chart::CachedDataSequence( rSingleText );
}
-Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
+rtl::Reference< LabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
const Reference< chart2::data::XDataSequence >& xValues ,
const Reference< chart2::data::XDataSequence >& xLabels )
{
return new ::chart::LabeledDataSequence( xValues, xLabels );
}
-Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
+rtl::Reference< LabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
const Reference< chart2::data::XDataSequence >& xValues )
{
return new ::chart::LabeledDataSequence( xValues );
}
-Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence()
+rtl::Reference< LabeledDataSequence > DataSourceHelper::createLabeledDataSequence()
{
return new ::chart::LabeledDataSequence;
}
@@ -158,9 +150,9 @@ uno::Sequence< beans::PropertyValue > DataSourceHelper::createArguments(
return
{
- { "DataRowSource", -1, uno::Any( eRowSource), beans::PropertyState_DIRECT_VALUE },
- { "FirstCellAsLabel", -1, uno::Any( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE },
- { "HasCategories", -1, uno::Any( bHasCategories ), beans::PropertyState_DIRECT_VALUE }
+ { u"DataRowSource"_ustr, -1, uno::Any( eRowSource), beans::PropertyState_DIRECT_VALUE },
+ { u"FirstCellAsLabel"_ustr, -1, uno::Any( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE },
+ { u"HasCategories"_ustr, -1, uno::Any( bHasCategories ), beans::PropertyState_DIRECT_VALUE }
};
}
@@ -172,14 +164,14 @@ uno::Sequence< beans::PropertyValue > DataSourceHelper::createArguments(
uno::Sequence< beans::PropertyValue > aArguments( createArguments( bUseColumns, bFirstCellAsLabel, bHasCategories ));
aArguments.realloc( aArguments.getLength() + 1 );
aArguments.getArray()[aArguments.getLength() - 1] =
- beans::PropertyValue( "CellRangeRepresentation"
+ beans::PropertyValue( u"CellRangeRepresentation"_ustr
, -1, uno::Any( rRangeRepresentation )
, beans::PropertyState_DIRECT_VALUE );
if( rSequenceMapping.hasElements() )
{
aArguments.realloc( aArguments.getLength() + 1 );
aArguments.getArray()[aArguments.getLength() - 1] =
- beans::PropertyValue( "SequenceMapping"
+ beans::PropertyValue( u"SequenceMapping"_ustr
, -1, uno::Any( rSequenceMapping )
, beans::PropertyState_DIRECT_VALUE );
}
@@ -217,26 +209,30 @@ void DataSourceHelper::readArguments( const uno::Sequence< beans::PropertyValue
}
}
-uno::Reference< chart2::data::XDataSource > DataSourceHelper::pressUsedDataIntoRectangularFormat(
- const uno::Reference< chart2::XChartDocument >& xChartDoc )
+rtl::Reference< DataSource > DataSourceHelper::pressUsedDataIntoRectangularFormat(
+ const rtl::Reference< ChartModel >& xChartDoc )
{
std::vector< Reference< chart2::data::XLabeledDataSequence > > aResultVector;
//categories are always the first sequence
- Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram());
+ rtl::Reference< Diagram > xDiagram( xChartDoc->getFirstChartDiagram());
- Reference< chart2::data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
+ Reference< chart2::data::XLabeledDataSequence > xCategories;
+ if (xDiagram)
+ xCategories = xDiagram->getCategories();
if( xCategories.is() )
aResultVector.push_back( xCategories );
- std::vector< Reference< chart2::XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
- uno::Reference< chart2::data::XDataSource > xSeriesSource(
- DataSeriesHelper::getDataSource( comphelper::containerToSequence(aSeriesVector) ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector;
+ if (xDiagram)
+ aSeriesVector = xDiagram->getDataSeries();
+ rtl::Reference< ::chart::DataSource > xSeriesSource =
+ DataSeriesHelper::getDataSource( aSeriesVector );
const Sequence< Reference< chart2::data::XLabeledDataSequence > > aDataSequences( xSeriesSource->getDataSequences() );
//the first x-values is always the next sequence //todo ... other x-values get lost for old format
Reference< chart2::data::XLabeledDataSequence > xXValues(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, "values-x" ) );
+ DataSeriesHelper::getDataSequenceByRole( xSeriesSource, u"values-x"_ustr ) );
if( xXValues.is() )
aResultVector.push_back( xXValues );
@@ -248,95 +244,59 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::pressUsedDataIntoR
aResultVector.push_back( labeledData );
}
- return new DataSource( comphelper::containerToSequence(aResultVector) );
+ return new DataSource( aResultVector );
}
-uno::Sequence< OUString > DataSourceHelper::getUsedDataRanges(
- const uno::Reference< chart2::XDiagram > & xDiagram )
+std::vector< OUString > DataSourceHelper::getUsedDataRanges(
+ const rtl::Reference< Diagram > & xDiagram )
{
std::vector< OUString > aResult;
if( xDiagram.is())
{
- uno::Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
+ uno::Reference< data::XLabeledDataSequence > xCategories( xDiagram->getCategories() );
if( xCategories.is() )
lcl_addRanges( aResult, xCategories );
- std::vector< uno::Reference< XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector( xDiagram->getDataSeries() );
for (auto const& series : aSeriesVector)
{
- uno::Reference< data::XDataSource > xDataSource(series, uno::UNO_QUERY);
- lcl_addDataSourceRanges( aResult, xDataSource );
+ lcl_addDataSourceRanges( aResult, series );
lcl_addErrorBarRanges( aResult, series );
}
}
- return comphelper::containerToSequence( aResult );
+ return aResult;
}
-uno::Sequence< OUString > DataSourceHelper::getUsedDataRanges( const uno::Reference< frame::XModel > & xChartModel )
+std::vector< OUString > DataSourceHelper::getUsedDataRanges( const rtl::Reference<::chart::ChartModel> & xChartModel )
{
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
return getUsedDataRanges( xDiagram );
}
-uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
- const uno::Reference< chart2::XChartDocument >& xChartDoc )
-{
- return pressUsedDataIntoRectangularFormat( xChartDoc );
-}
-
-uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
- const uno::Reference< frame::XModel >& xChartModel )
-{
- std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aResult;
-
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
- uno::Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
- if( xCategories.is() )
- aResult.push_back( xCategories );
-
- std::vector< uno::Reference< XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( xChartModel ) );
- for (auto const& series : aSeriesVector)
- {
- uno::Reference< data::XDataSource > xDataSource(series, uno::UNO_QUERY);
- if( !xDataSource.is() )
- continue;
- const uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
- aResult.insert( aResult.end(), aDataSequences.begin(), aDataSequences.end() );
- }
-
- return uno::Reference< chart2::data::XDataSource >(
- new DataSource( comphelper::containerToSequence( aResult )));
-}
-
-uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
+rtl::Reference< DataSource > DataSourceHelper::getUsedData(
ChartModel& rModel )
{
std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aResult;
- uno::Reference< XDiagram > xDiagram( rModel.getFirstDiagram() );
- uno::Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
+ rtl::Reference< Diagram > xDiagram = rModel.getFirstChartDiagram();
+ uno::Reference< chart2::data::XLabeledDataSequence > xCategories( xDiagram->getCategories() );
if( xCategories.is() )
aResult.push_back( xCategories );
- std::vector< uno::Reference< XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( rModel ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector = rModel.getDataSeries();
for (auto const& series : aSeriesVector)
{
- uno::Reference< data::XDataSource > xDataSource(series, uno::UNO_QUERY);
- if( !xDataSource.is() )
- continue;
- const uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aDataSequences( series->getDataSequences2() );
aResult.insert( aResult.end(), aDataSequences.begin(), aDataSequences.end() );
}
- return uno::Reference< chart2::data::XDataSource >(
- new DataSource( comphelper::containerToSequence( aResult )));
+ return new DataSource( aResult );
}
bool DataSourceHelper::detectRangeSegmentation(
- const uno::Reference<
- frame::XModel >& xChartModel
+ const rtl::Reference<::chart::ChartModel>& xChartModel
, OUString& rOutRangeString
, css::uno::Sequence< sal_Int32 >& rSequenceMapping
, bool& rOutUseColumns
@@ -345,22 +305,23 @@ bool DataSourceHelper::detectRangeSegmentation(
{
bool bSomethingDetected = false;
- uno::Reference< XChartDocument > xChartDocument( xChartModel, uno::UNO_QUERY );
- if( !xChartDocument.is() )
+ if( !xChartModel.is() )
return bSomethingDetected;
- uno::Reference< data::XDataProvider > xDataProvider( xChartDocument->getDataProvider() );
+ uno::Reference< data::XDataProvider > xDataProvider( xChartModel->getDataProvider() );
if( !xDataProvider.is() )
return bSomethingDetected;
try
{
DataSourceHelper::readArguments(
- xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartDocument ) ),
+ xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartModel ) ),
rOutRangeString, rSequenceMapping, rOutUseColumns, rOutFirstCellAsLabel, rOutHasCategories );
bSomethingDetected = !rOutRangeString.isEmpty();
- uno::Reference< chart2::data::XLabeledDataSequence > xCategories(
- DiagramHelper::getCategoriesFromDiagram( xChartDocument->getFirstDiagram() ));
+ rtl::Reference<Diagram> xDiagram = xChartModel->getFirstChartDiagram();
+ uno::Reference< chart2::data::XLabeledDataSequence > xCategories;
+ if (xDiagram)
+ xCategories = xDiagram->getCategories();
rOutHasCategories = xCategories.is();
}
catch( uno::Exception & )
@@ -371,7 +332,7 @@ bool DataSourceHelper::detectRangeSegmentation(
}
bool DataSourceHelper::allArgumentsForRectRangeDetected(
- const uno::Reference< chart2::XChartDocument >& xChartDocument )
+ const rtl::Reference<::chart::ChartModel>& xChartDocument )
{
bool bHasDataRowSource = false;
bool bHasFirstCellAsLabel = false;
@@ -415,30 +376,24 @@ bool DataSourceHelper::allArgumentsForRectRangeDetected(
}
void DataSourceHelper::setRangeSegmentation(
- const uno::Reference< frame::XModel >& xChartModel
+ const rtl::Reference<::chart::ChartModel>& xChartModel
, const css::uno::Sequence< sal_Int32 >& rSequenceMapping
, bool bUseColumns , bool bFirstCellAsLabel, bool bUseCategories )
{
- uno::Reference< XChartDocument > xChartDocument( xChartModel, uno::UNO_QUERY );
- if( !xChartDocument.is() )
- return;
- uno::Reference< data::XDataProvider > xDataProvider( xChartDocument->getDataProvider() );
+ uno::Reference< data::XDataProvider > xDataProvider( xChartModel->getDataProvider() );
if( !xDataProvider.is() )
return;
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
if( !xDiagram.is() )
return;
- uno::Reference< chart2::XChartTypeManager > xChartTypeManager( xChartDocument->getChartTypeManager() );
+ rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager = xChartModel->getTypeManager();
if( !xChartTypeManager.is() )
return;
- uno::Reference< lang::XMultiServiceFactory > xTemplateFactory( xChartTypeManager, uno::UNO_QUERY );
- if( !xTemplateFactory.is() )
- return;
OUString aRangeString;
bool bDummy;
uno::Sequence< sal_Int32 > aDummy;
- readArguments( xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartDocument )),
+ readArguments( xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartModel )),
aRangeString, aDummy, bDummy, bDummy, bDummy );
uno::Sequence< beans::PropertyValue > aArguments(
@@ -453,10 +408,10 @@ void DataSourceHelper::setRangeSegmentation(
xDiagram->setDiagramData( xDataSource, aArguments );
}
-Sequence< OUString > DataSourceHelper::getRangesFromLabeledDataSequence(
+std::vector< OUString > DataSourceHelper::getRangesFromLabeledDataSequence(
const Reference< data::XLabeledDataSequence > & xLSeq )
{
- Sequence< OUString > aResult;
+ std::vector< OUString > aResult;
if( xLSeq.is())
{
Reference< data::XDataSequence > xLabel( xLSeq->getLabel());
@@ -495,7 +450,7 @@ OUString DataSourceHelper::getRangeFromValues(
return aResult;
}
-Sequence< OUString > DataSourceHelper::getRangesFromDataSource( const Reference< data::XDataSource > & xSource )
+std::vector< OUString > DataSourceHelper::getRangesFromDataSource( const Reference< data::XDataSource > & xSource )
{
std::vector< OUString > aResult;
if( xSource.is())
@@ -512,7 +467,7 @@ Sequence< OUString > DataSourceHelper::getRangesFromDataSource( const Reference<
aResult.push_back( xValues->getSourceRangeRepresentation());
}
}
- return comphelper::containerToSequence( aResult );
+ return aResult;
}
} //namespace chart
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 1aa9ad5cc381..c6b8984a49a5 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -19,54 +19,42 @@
#include <DiagramHelper.hxx>
#include <Diagram.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
-#include <ChartTypeHelper.hxx>
-#include <ChartTypeManager.hxx>
-#include <ChartTypeTemplate.hxx>
+#include <ChartType.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
#include <ExplicitCategoriesProvider.hxx>
-#include <servicenames_charttypes.hxx>
#include <RelativePositionHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <NumberFormatterWrapper.hxx>
#include <unonames.hxx>
#include <BaseCoordinateSystem.hxx>
-#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
-#include <com/sun/star/chart2/XTitled.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
-#include <com/sun/star/util/CloseVetoException.hpp>
#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <unotools/saveopt.hxx>
-#include <rtl/math.hxx>
#include <svl/numformat.hxx>
#include <svl/zforlist.hxx>
+#include <svl/zformat.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <comphelper/sequence.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
#include <limits>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -76,283 +64,10 @@ using ::com::sun::star::chart2::XAnyDescriptionAccess;
namespace chart
{
-DiagramHelper::tTemplateWithServiceName
- DiagramHelper::getTemplateForDiagram(
- const Reference< XDiagram > & xDiagram,
- const rtl::Reference< ::chart::ChartTypeManager > & xChartTypeManager )
-{
- DiagramHelper::tTemplateWithServiceName aResult;
-
- if( ! (xChartTypeManager.is() && xDiagram.is()))
- return aResult;
-
- Sequence< OUString > aServiceNames( xChartTypeManager->getAvailableServiceNames());
- const sal_Int32 nLength = aServiceNames.getLength();
-
- bool bTemplateFound = false;
-
- for( sal_Int32 i = 0; ! bTemplateFound && i < nLength; ++i )
- {
- try
- {
- rtl::Reference< ::chart::ChartTypeTemplate > xTempl =
- xChartTypeManager->createTemplate( aServiceNames[ i ] );
-
- if (xTempl.is() && xTempl->matchesTemplate(xDiagram, true))
- {
- aResult.xChartTypeTemplate = xTempl;
- aResult.sServiceName = aServiceNames[ i ];
- bTemplateFound = true;
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- }
-
- return aResult;
-}
-
-void DiagramHelper::setVertical(
- const Reference< XDiagram > & xDiagram,
- bool bVertical /* = true */ )
-{
- try
- {
- Reference< XCoordinateSystemContainer > xCnt( xDiagram, uno::UNO_QUERY );
- if (!xCnt.is())
- return;
-
- const Sequence< Reference<XCoordinateSystem> > aCooSys = xCnt->getCoordinateSystems();
- uno::Any aValue;
- aValue <<= bVertical;
- for( uno::Reference< XCoordinateSystem > const & xCooSys : aCooSys )
- {
- Reference< beans::XPropertySet > xProp( xCooSys, uno::UNO_QUERY );
- bool bChanged = false;
- if (xProp.is())
- {
- bool bOldSwap = false;
- if( !(xProp->getPropertyValue("SwapXAndYAxis") >>= bOldSwap)
- || bVertical != bOldSwap )
- bChanged = true;
-
- if( bChanged )
- xProp->setPropertyValue("SwapXAndYAxis", aValue);
- }
-
- if (!xCooSys.is())
- continue;
-
- const sal_Int32 nDimensionCount = xCooSys->getDimension();
- sal_Int32 nDimIndex = 0;
- for (nDimIndex=0; nDimIndex < nDimensionCount; ++nDimIndex)
- {
- const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nDimIndex);
- for (sal_Int32 nI = 0; nI <= nMaximumScaleIndex; ++nI)
- {
- Reference<chart2::XAxis> xAxis = xCooSys->getAxisByDimension(nDimIndex,nI);
- if (!xAxis.is())
- continue;
-
- //adapt title rotation only when axis swapping has changed
- if (!bChanged)
- continue;
-
- Reference< XTitled > xTitled( xAxis, uno::UNO_QUERY );
- if (!xTitled.is())
- continue;
-
- Reference< beans::XPropertySet > xTitleProps( xTitled->getTitleObject(), uno::UNO_QUERY );
- if (!xTitleProps.is())
- continue;
-
- double fAngleDegree = 0.0;
- xTitleProps->getPropertyValue("TextRotation") >>= fAngleDegree;
- if (fAngleDegree != 0.0 &&
- !rtl::math::approxEqual(fAngleDegree, 90.0))
- continue;
-
- double fNewAngleDegree = 0.0;
- if( !bVertical && nDimIndex == 1 )
- fNewAngleDegree = 90.0;
- else if( bVertical && nDimIndex == 0 )
- fNewAngleDegree = 90.0;
-
- xTitleProps->setPropertyValue("TextRotation", uno::Any(fNewAngleDegree));
- }
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-}
-
-bool DiagramHelper::getVertical( const uno::Reference< chart2::XDiagram > & xDiagram,
- bool& rbFound, bool& rbAmbiguous )
-{
- bool bValue = false;
- rbFound = false;
- rbAmbiguous = false;
-
- Reference< XCoordinateSystemContainer > xCnt( xDiagram, uno::UNO_QUERY );
- if (!xCnt.is())
- return false;
-
- const Sequence< Reference<XCoordinateSystem> > aCooSys = xCnt->getCoordinateSystems();
-
- for (Reference<XCoordinateSystem> const & coords : aCooSys)
- {
- Reference<beans::XPropertySet> xProp(coords, uno::UNO_QUERY);
- if (!xProp.is())
- continue;
-
- bool bCurrent = false;
- if (xProp->getPropertyValue("SwapXAndYAxis") >>= bCurrent)
- {
- if (!rbFound)
- {
- bValue = bCurrent;
- rbFound = true;
- }
- else if (bCurrent != bValue)
- {
- // ambiguous -> choose always first found
- rbAmbiguous = true;
- }
- }
- }
- return bValue;
-}
-
-void DiagramHelper::setStackMode(
- const Reference< XDiagram > & xDiagram,
- StackMode eStackMode
-)
-{
- try
- {
- bool bValueFound = false;
- bool bIsAmbiguous = false;
- StackMode eOldStackMode = DiagramHelper::getStackMode( xDiagram, bValueFound, bIsAmbiguous );
-
- if( eStackMode == eOldStackMode && !bIsAmbiguous )
- return;
-
- StackingDirection eNewDirection = StackingDirection_NO_STACKING;
- if( eStackMode == StackMode::YStacked || eStackMode == StackMode::YStackedPercent )
- eNewDirection = StackingDirection_Y_STACKING;
- else if( eStackMode == StackMode::ZStacked )
- eNewDirection = StackingDirection_Z_STACKING;
-
- uno::Any aNewDirection( eNewDirection );
-
- bool bPercent = false;
- if( eStackMode == StackMode::YStackedPercent )
- bPercent = true;
-
- //iterate through all coordinate systems
- uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if( !xCooSysContainer.is() )
- return;
- const uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
- for( uno::Reference< XCoordinateSystem > const & xCooSys : aCooSysList )
- {
- //set correct percent stacking
- const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(1);
- for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI)
- {
- Reference< chart2::XAxis > xAxis( xCooSys->getAxisByDimension( 1,nI ));
- if( xAxis.is())
- {
- chart2::ScaleData aScaleData = xAxis->getScaleData();
- if( (aScaleData.AxisType==AxisType::PERCENT) != bPercent )
- {
- if( bPercent )
- aScaleData.AxisType = AxisType::PERCENT;
- else
- aScaleData.AxisType = AxisType::REALNUMBER;
- xAxis->setScaleData( aScaleData );
- }
- }
- }
- //iterate through all chart types in the current coordinate system
- uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
- if( !xChartTypeContainer.is() )
- continue;
- uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- if (!aChartTypeList.hasElements())
- continue;
-
- uno::Reference< XChartType > xChartType( aChartTypeList[0] );
-
- //iterate through all series in this chart type
- uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
- OSL_ASSERT( xDataSeriesContainer.is());
- if( !xDataSeriesContainer.is() )
- continue;
-
- const uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
- for( uno::Reference< XDataSeries > const & dataSeries : aSeriesList )
- {
- Reference< beans::XPropertySet > xProp( dataSeries, uno::UNO_QUERY );
- if(xProp.is())
- xProp->setPropertyValue( "StackingDirection", aNewDirection );
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-}
-
-StackMode DiagramHelper::getStackMode( const Reference< XDiagram > & xDiagram, bool& rbFound, bool& rbAmbiguous )
-{
- rbFound=false;
- rbAmbiguous=false;
-
- StackMode eGlobalStackMode = StackMode::NONE;
-
- //iterate through all coordinate systems
- uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if( !xCooSysContainer.is() )
- return eGlobalStackMode;
- const uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
- for( uno::Reference< XCoordinateSystem > const & xCooSys : aCooSysList )
- {
- //iterate through all chart types in the current coordinate system
- uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
- if( !xChartTypeContainer.is() )
- continue;
- uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- for( sal_Int32 nT = 0; nT < aChartTypeList.getLength(); ++nT )
- {
- uno::Reference< XChartType > xChartType( aChartTypeList[nT] );
-
- StackMode eLocalStackMode = DiagramHelper::getStackModeFromChartType(
- xChartType, rbFound, rbAmbiguous, xCooSys );
-
- if( rbFound && eLocalStackMode != eGlobalStackMode && nT>0 )
- {
- rbAmbiguous = true;
- return eGlobalStackMode;
- }
-
- eGlobalStackMode = eLocalStackMode;
- }
- }
-
- return eGlobalStackMode;
-}
-
StackMode DiagramHelper::getStackModeFromChartType(
- const Reference< XChartType > & xChartType,
+ const rtl::Reference< ChartType > & xChartType,
bool& rbFound, bool& rbAmbiguous,
- const Reference< XCoordinateSystem > & xCorrespondingCoordinateSystem )
+ const rtl::Reference< BaseCoordinateSystem > & xCorrespondingCoordinateSystem )
{
StackMode eStackMode = StackMode::NONE;
rbFound = false;
@@ -360,23 +75,21 @@ StackMode DiagramHelper::getStackModeFromChartType(
try
{
- Reference< XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY_THROW );
- Sequence< Reference< chart2::XDataSeries > > aSeries( xDSCnt->getDataSeries());
+ const std::vector< rtl::Reference< DataSeries > > & aSeries = xChartType->getDataSeries2();
chart2::StackingDirection eCommonDirection = chart2::StackingDirection_NO_STACKING;
bool bDirectionInitialized = false;
// first series is irrelevant for stacking, start with second, unless
// there is only one series
- const sal_Int32 nSeriesCount = aSeries.getLength();
+ const sal_Int32 nSeriesCount = aSeries.size();
sal_Int32 i = (nSeriesCount == 1) ? 0: 1;
for( ; i<nSeriesCount; ++i )
{
rbFound = true;
- Reference< beans::XPropertySet > xProp( aSeries[i], uno::UNO_QUERY_THROW );
chart2::StackingDirection eCurrentDirection = eCommonDirection;
// property is not MAYBEVOID
- bool bSuccess = ( xProp->getPropertyValue( "StackingDirection" ) >>= eCurrentDirection );
+ bool bSuccess = ( aSeries[i]->getPropertyValue( u"StackingDirection"_ustr ) >>= eCurrentDirection );
OSL_ASSERT( bSuccess );
if( ! bDirectionInitialized )
{
@@ -408,10 +121,10 @@ StackMode DiagramHelper::getStackModeFromChartType(
{
sal_Int32 nAxisIndex = 0;
if( nSeriesCount )
- nAxisIndex = DataSeriesHelper::getAttachedAxisIndex(aSeries[0]);
+ nAxisIndex = aSeries[0]->getAttachedAxisIndex();
- Reference< chart2::XAxis > xAxis(
- xCorrespondingCoordinateSystem->getAxisByDimension( 1,nAxisIndex ));
+ rtl::Reference< Axis > xAxis =
+ xCorrespondingCoordinateSystem->getAxisByDimension2( 1,nAxisIndex );
if( xAxis.is())
{
chart2::ScaleData aScaleData = xAxis->getScaleData();
@@ -431,502 +144,19 @@ StackMode DiagramHelper::getStackModeFromChartType(
return eStackMode;
}
-sal_Int32 DiagramHelper::getDimension( const Reference< XDiagram > & xDiagram )
-{
- // -1: not yet set
- sal_Int32 nResult = -1;
-
- try
- {
- Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY );
- if( xCooSysCnt.is() )
- {
- const Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
-
- for( Reference< XCoordinateSystem > const & xCooSys : aCooSysSeq )
- {
- if(xCooSys.is())
- {
- nResult = xCooSys->getDimension();
- break;
- }
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- return nResult;
-}
-
-void DiagramHelper::setDimension(
- const Reference< XDiagram > & xDiagram,
- sal_Int32 nNewDimensionCount )
-{
- if( ! xDiagram.is())
- return;
-
- if( DiagramHelper::getDimension( xDiagram ) == nNewDimensionCount )
- return;
-
- try
- {
- bool rbFound = false;
- bool rbAmbiguous = true;
- StackMode eStackMode = DiagramHelper::getStackMode( xDiagram, rbFound, rbAmbiguous );
- bool bIsSupportingOnlyDeepStackingFor3D=false;
-
- //change all coordinate systems:
- Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
- for( Reference<XCoordinateSystem> const & xOldCooSys : aCooSysList )
- {
- Reference< XCoordinateSystem > xNewCooSys;
-
- Reference< XChartTypeContainer > xChartTypeContainer( xOldCooSys, uno::UNO_QUERY );
- if( !xChartTypeContainer.is() )
- continue;
-
- const Sequence< Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- for( Reference< XChartType > const & xChartType : aChartTypeList )
- {
- bIsSupportingOnlyDeepStackingFor3D = ChartTypeHelper::isSupportingOnlyDeepStackingFor3D( xChartType );
- if(!xNewCooSys.is())
- {
- xNewCooSys = xChartType->createCoordinateSystem( nNewDimensionCount );
- break;
- }
- //@todo make sure that all following charttypes are also capable of the new dimension
- //otherwise separate them in a different group
- //BM: might be done in replaceCoordinateSystem()
- }
-
- // replace the old coordinate system at all places where it was used
- DiagramHelper::replaceCoordinateSystem( xDiagram, xOldCooSys, xNewCooSys );
- }
-
- //correct stack mode if necessary
- if( nNewDimensionCount==3 && eStackMode != StackMode::ZStacked && bIsSupportingOnlyDeepStackingFor3D )
- DiagramHelper::setStackMode( xDiagram, StackMode::ZStacked );
- else if( nNewDimensionCount==2 && eStackMode == StackMode::ZStacked )
- DiagramHelper::setStackMode( xDiagram, StackMode::NONE );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-}
-
-void DiagramHelper::replaceCoordinateSystem(
- const Reference< XDiagram > & xDiagram,
- const Reference< XCoordinateSystem > & xCooSysToReplace,
- const Reference< XCoordinateSystem > & xReplacement )
-{
- OSL_ASSERT( xDiagram.is());
- if( ! xDiagram.is())
- return;
-
- // update the coordinate-system container
- Reference< XCoordinateSystemContainer > xCont( xDiagram, uno::UNO_QUERY );
- if( !xCont.is())
- return;
-
- try
- {
- Reference< chart2::data::XLabeledDataSequence > xCategories = DiagramHelper::getCategoriesFromDiagram( xDiagram );
-
- // move chart types of xCooSysToReplace to xReplacement
- Reference< XChartTypeContainer > xCTCntCooSys( xCooSysToReplace, uno::UNO_QUERY_THROW );
- Reference< XChartTypeContainer > xCTCntReplacement( xReplacement, uno::UNO_QUERY_THROW );
- xCTCntReplacement->setChartTypes( xCTCntCooSys->getChartTypes());
-
- xCont->removeCoordinateSystem( xCooSysToReplace );
- xCont->addCoordinateSystem( xReplacement );
-
- if( xCategories.is() )
- DiagramHelper::setCategoriesToDiagram( xCategories, xDiagram );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-}
-
-bool DiagramHelper::isSeriesAttachedToMainAxis(
- const uno::Reference< chart2::XDataSeries >& xDataSeries )
-{
- sal_Int32 nAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
- return (nAxisIndex==0);
-}
-
-bool DiagramHelper::attachSeriesToAxis( bool bAttachToMainAxis
- , const uno::Reference< chart2::XDataSeries >& xDataSeries
- , const uno::Reference< chart2::XDiagram >& xDiagram
- , const uno::Reference< uno::XComponentContext > & xContext
- , bool bAdaptAxes )
-{
- bool bChanged = false;
-
- //set property at axis
- Reference< beans::XPropertySet > xProp( xDataSeries, uno::UNO_QUERY_THROW );
-
- sal_Int32 nNewAxisIndex = bAttachToMainAxis ? 0 : 1;
- sal_Int32 nOldAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
- uno::Reference< chart2::XAxis > xOldAxis( DiagramHelper::getAttachedAxis( xDataSeries, xDiagram ) );
-
- if( nOldAxisIndex != nNewAxisIndex )
- {
- try
- {
- xProp->setPropertyValue( "AttachedAxisIndex", uno::Any( nNewAxisIndex ) );
- bChanged = true;
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- }
-
- if( bChanged && xDiagram.is() )
- {
- uno::Reference< XAxis > xAxis( AxisHelper::getAxis( 1, bAttachToMainAxis, xDiagram ) );
- if(!xAxis.is()) //create an axis if necessary
- xAxis = AxisHelper::createAxis( 1, bAttachToMainAxis, xDiagram, xContext );
- if( bAdaptAxes )
- {
- AxisHelper::makeAxisVisible( xAxis );
- AxisHelper::hideAxisIfNoDataIsAttached( xOldAxis, xDiagram );
- }
- }
-
- return bChanged;
-}
-
-uno::Reference< XAxis > DiagramHelper::getAttachedAxis(
- const uno::Reference< XDataSeries >& xSeries,
- const uno::Reference< XDiagram >& xDiagram )
-{
- return AxisHelper::getAxis( 1, DiagramHelper::isSeriesAttachedToMainAxis( xSeries ), xDiagram );
-}
-
-uno::Reference< XChartType > DiagramHelper::getChartTypeOfSeries(
- const uno::Reference< chart2::XDiagram >& xDiagram
- , const uno::Reference< XDataSeries >& xGivenDataSeries )
-{
- if( !xGivenDataSeries.is() )
- return nullptr;
- if(!xDiagram.is())
- return nullptr;
-
- //iterate through the model to find the given xSeries
- //the found parent indicates the charttype
-
- //iterate through all coordinate systems
- uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if( !xCooSysContainer.is())
- return nullptr;
-
- const uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
- for( uno::Reference< XCoordinateSystem > const & xCooSys : aCooSysList )
- {
- //iterate through all chart types in the current coordinate system
- uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
- OSL_ASSERT( xChartTypeContainer.is());
- if( !xChartTypeContainer.is() )
- continue;
- const uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- for( uno::Reference< XChartType > const & xChartType : aChartTypeList )
- {
- //iterate through all series in this chart type
- uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
- OSL_ASSERT( xDataSeriesContainer.is());
- if( !xDataSeriesContainer.is() )
- continue;
-
- const uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
- for( uno::Reference< XDataSeries > const & dataSeries : aSeriesList )
- {
- if( xGivenDataSeries==dataSeries )
- return xChartType;
- }
- }
- }
- return nullptr;
-}
-
-std::vector< Reference< XDataSeries > >
- DiagramHelper::getDataSeriesFromDiagram(
- const Reference< XDiagram > & xDiagram )
-{
- std::vector< Reference< XDataSeries > > aResult;
-
- try
- {
- Reference< XCoordinateSystemContainer > xCooSysCnt(
- xDiagram, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
- for( Reference< XCoordinateSystem > const & coords : aCooSysSeq )
- {
- Reference< XChartTypeContainer > xCTCnt( coords, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
- for( Reference< XChartType> const & chartType : aChartTypeSeq )
- {
- Reference< XDataSeriesContainer > xDSCnt( chartType, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() );
- aResult.insert( aResult.end(), aSeriesSeq.begin(), aSeriesSeq.end() );
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- return aResult;
-}
-
-Sequence< Sequence< Reference< XDataSeries > > >
- DiagramHelper::getDataSeriesGroups( const Reference< XDiagram > & xDiagram )
-{
- vector< Sequence< Reference< XDataSeries > > > aResult;
-
- //iterate through all coordinate systems
- Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if( xCooSysContainer.is() )
- {
- const Sequence< Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
- for( Reference< XCoordinateSystem > const & coords : aCooSysList )
- {
- //iterate through all chart types in the current coordinate system
- Reference< XChartTypeContainer > xChartTypeContainer( coords, uno::UNO_QUERY );
- if( !xChartTypeContainer.is() )
- continue;
- const Sequence< Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- for( Reference< XChartType > const & chartType : aChartTypeList )
- {
- Reference< XDataSeriesContainer > xDataSeriesContainer( chartType, uno::UNO_QUERY );
- if( !xDataSeriesContainer.is() )
- continue;
- aResult.push_back( xDataSeriesContainer->getDataSeries() );
- }
- }
- }
- return comphelper::containerToSequence( aResult );
-}
-
-Reference< XChartType >
- DiagramHelper::getChartTypeByIndex( const Reference< XDiagram >& xDiagram, sal_Int32 nIndex )
-{
- Reference< XChartType > xChartType;
-
- //iterate through all coordinate systems
- Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if( ! xCooSysContainer.is())
- return xChartType;
-
- const Sequence< Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
- sal_Int32 nTypesSoFar = 0;
- for( Reference< XCoordinateSystem > const & coords : aCooSysList )
- {
- Reference< XChartTypeContainer > xChartTypeContainer( coords, uno::UNO_QUERY );
- if( !xChartTypeContainer.is() )
- continue;
- Sequence< Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- if( nIndex >= 0 && nIndex < (nTypesSoFar + aChartTypeList.getLength()) )
- {
- xChartType.set( aChartTypeList[nIndex - nTypesSoFar] );
- break;
- }
- nTypesSoFar += aChartTypeList.getLength();
- }
-
- return xChartType;
-}
-
-namespace
-{
-
-std::vector< Reference< XAxis > > lcl_getAxisHoldingCategoriesFromDiagram(
- const Reference< XDiagram > & xDiagram )
-{
- std::vector< Reference< XAxis > > aRet;
-
- // return first x-axis as fall-back
- Reference< XAxis > xFallBack;
- try
- {
- Reference< XCoordinateSystemContainer > xCooSysCnt(
- xDiagram, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
- for( Reference< XCoordinateSystem > const & xCooSys : aCooSysSeq )
- {
- OSL_ASSERT( xCooSys.is());
- for( sal_Int32 nN = xCooSys->getDimension(); nN--; )
- {
- const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nN);
- for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI)
- {
- Reference< XAxis > xAxis = xCooSys->getAxisByDimension( nN,nI );
- OSL_ASSERT( xAxis.is());
- if( xAxis.is())
- {
- ScaleData aScaleData = xAxis->getScaleData();
- if( aScaleData.Categories.is() || (aScaleData.AxisType == AxisType::CATEGORY) )
- {
- aRet.push_back(xAxis);
- }
- if( (nN == 0) && !xFallBack.is())
- xFallBack.set( xAxis );
- }
- }
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2" );
- }
-
- if( aRet.empty() )
- aRet.push_back(xFallBack);
-
- return aRet;
-}
-
-} // anonymous namespace
-
-bool DiagramHelper::isCategoryDiagram(
- const Reference< XDiagram >& xDiagram )
-{
- try
- {
- Reference< XCoordinateSystemContainer > xCooSysCnt(
- xDiagram, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
- for( Reference< XCoordinateSystem > const & xCooSys : aCooSysSeq )
- {
- OSL_ASSERT( xCooSys.is());
- for( sal_Int32 nN = xCooSys->getDimension(); nN--; )
- {
- const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nN);
- for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI)
- {
- Reference< XAxis > xAxis = xCooSys->getAxisByDimension( nN,nI );
- OSL_ASSERT( xAxis.is());
- if( xAxis.is())
- {
- ScaleData aScaleData = xAxis->getScaleData();
- if( aScaleData.AxisType == AxisType::CATEGORY || aScaleData.AxisType == AxisType::DATE )
- return true;
- }
- }
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- return false;
-}
-
-void DiagramHelper::setCategoriesToDiagram(
- const Reference< chart2::data::XLabeledDataSequence >& xCategories,
- const Reference< XDiagram >& xDiagram,
- bool bSetAxisType /* = false */,
- bool bCategoryAxis /* = true */ )
-{
- std::vector< Reference< chart2::XAxis > > aCatAxes(
- lcl_getAxisHoldingCategoriesFromDiagram( xDiagram ));
-
- for (const Reference< chart2::XAxis >& xCatAxis : aCatAxes)
- {
- if( xCatAxis.is())
- {
- ScaleData aScaleData( xCatAxis->getScaleData());
- aScaleData.Categories = xCategories;
- if( bSetAxisType )
- {
- if( bCategoryAxis )
- aScaleData.AxisType = AxisType::CATEGORY;
- else if( aScaleData.AxisType == AxisType::CATEGORY || aScaleData.AxisType == AxisType::DATE )
- aScaleData.AxisType = AxisType::REALNUMBER;
- }
- xCatAxis->setScaleData( aScaleData );
- }
- }
-}
-
-Reference< data::XLabeledDataSequence >
- DiagramHelper::getCategoriesFromDiagram(
- const Reference< XDiagram > & xDiagram )
-{
- Reference< data::XLabeledDataSequence > xResult;
-
- try
- {
- std::vector< Reference< chart2::XAxis > > aCatAxes(
- lcl_getAxisHoldingCategoriesFromDiagram( xDiagram ));
- //search for first categories
- if (!aCatAxes.empty())
- {
- Reference< chart2::XAxis > xCatAxis(aCatAxes[0]);
- if( xCatAxis.is())
- {
- ScaleData aScaleData( xCatAxis->getScaleData());
- if( aScaleData.Categories.is() )
- {
- xResult.set( aScaleData.Categories );
- uno::Reference<beans::XPropertySet> xProp(aScaleData.Categories->getValues(), uno::UNO_QUERY );
- if( xProp.is() )
- {
- try
- {
- xProp->setPropertyValue( "Role", uno::Any( OUString("categories") ) );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- }
- }
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- return xResult;
-}
-
static void lcl_generateAutomaticCategoriesFromChartType(
Sequence< OUString >& rRet,
- const Reference< XChartType >& xChartType )
+ const rtl::Reference< ChartType >& xChartType )
{
if(!xChartType.is())
return;
OUString aMainSeq( xChartType->getRoleOfSequenceForSeriesLabel() );
- Reference< XDataSeriesContainer > xSeriesCnt( xChartType, uno::UNO_QUERY );
- if( !xSeriesCnt.is() )
- return;
- const Sequence< Reference< XDataSeries > > aSeriesSeq( xSeriesCnt->getDataSeries() );
- for( Reference< XDataSeries > const & dataSeries : aSeriesSeq )
+ const std::vector< rtl::Reference< DataSeries > > & aSeriesSeq = xChartType->getDataSeries2();
+ for( rtl::Reference< DataSeries > const & dataSeries : aSeriesSeq )
{
- Reference< data::XDataSource > xDataSource( dataSeries, uno::UNO_QUERY );
- if( !xDataSource.is() )
- continue;
- Reference< chart2::data::XLabeledDataSequence > xLabeledSeq(
- ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aMainSeq ));
+ uno::Reference< data::XLabeledDataSequence > xLabeledSeq =
+ ::chart::DataSeriesHelper::getDataSequenceByRole( dataSeries, aMainSeq );
if( !xLabeledSeq.is() )
continue;
Reference< chart2::data::XDataSequence > xValueSeq( xLabeledSeq->getValues() );
@@ -938,15 +168,14 @@ static void lcl_generateAutomaticCategoriesFromChartType(
}
}
-Sequence< OUString > DiagramHelper::generateAutomaticCategoriesFromCooSys( const Reference< XCoordinateSystem > & xCooSys )
+Sequence< OUString > DiagramHelper::generateAutomaticCategoriesFromCooSys( const rtl::Reference< BaseCoordinateSystem > & xCooSys )
{
Sequence< OUString > aRet;
- Reference< XChartTypeContainer > xTypeCntr( xCooSys, uno::UNO_QUERY );
- if( xTypeCntr.is() )
+ if( xCooSys.is() )
{
- const Sequence< Reference< XChartType > > aChartTypes( xTypeCntr->getChartTypes() );
- for( Reference< XChartType > const & chartType : aChartTypes )
+ const std::vector< rtl::Reference< ChartType > > & aChartTypes( xCooSys->getChartTypes2() );
+ for( rtl::Reference< ChartType > const & chartType : aChartTypes )
{
lcl_generateAutomaticCategoriesFromChartType( aRet, chartType );
if( aRet.hasElements() )
@@ -959,14 +188,14 @@ Sequence< OUString > DiagramHelper::generateAutomaticCategoriesFromCooSys( const
Sequence< OUString > DiagramHelper::getExplicitSimpleCategories(
ChartModel& rModel )
{
- rtl::Reference< BaseCoordinateSystem > xCooSys = ChartModelHelper::getFirstCoordinateSystem( rModel );
+ rtl::Reference< BaseCoordinateSystem > xCooSys( rModel.getFirstCoordinateSystem() );
ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, rModel );
return aExplicitCategoriesProvider.getSimpleCategories();
}
namespace
{
-void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, const Reference< XAxis >& xAxis )
+void lcl_switchToDateCategories( const rtl::Reference< ChartModel >& xChartDoc, const Reference< XAxis >& xAxis )
{
if( !xAxis.is() )
return;
@@ -1002,13 +231,12 @@ void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, c
}
//check the numberformat at the axis
Reference< beans::XPropertySet > xAxisProps( xAxis, uno::UNO_QUERY );
- Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartDoc, uno::UNO_QUERY );
- if( xAxisProps.is() && xNumberFormatsSupplier.is() )
+ if( xAxisProps.is() )
{
sal_Int32 nNumberFormat = -1;
xAxisProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat;
- Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
+ Reference< util::XNumberFormats > xNumberFormats( xChartDoc->getNumberFormats() );
if( xNumberFormats.is() )
{
Reference< beans::XPropertySet > xKeyProps;
@@ -1022,7 +250,7 @@ void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, c
}
sal_Int32 nType = util::NumberFormat::UNDEFINED;
if( xKeyProps.is() )
- xKeyProps->getPropertyValue( "Type" ) >>= nType;
+ xKeyProps->getPropertyValue( u"Type"_ustr ) >>= nType;
if( !( nType & util::NumberFormat::DATE ) )
{
//set a date format to the axis
@@ -1042,7 +270,7 @@ void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, c
xAxis->setScaleData( aScale );
}
-void lcl_switchToTextCategories( const Reference< XChartDocument >& xChartDoc, const Reference< XAxis >& xAxis )
+void lcl_switchToTextCategories( const rtl::Reference< ChartModel >& xChartDoc, const Reference< XAxis >& xAxis )
{
if( !xAxis.is() )
return;
@@ -1059,43 +287,37 @@ void lcl_switchToTextCategories( const Reference< XChartDocument >& xChartDoc, c
}
-void DiagramHelper::switchToDateCategories( const Reference< XChartDocument >& xChartDoc )
+void DiagramHelper::switchToDateCategories( const rtl::Reference<::chart::ChartModel>& xChartDoc )
{
if(xChartDoc.is())
{
ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
- Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartDoc ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys = xChartDoc->getFirstCoordinateSystem();
if( xCooSys.is() )
{
- Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,0) );
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2(0,0);
lcl_switchToDateCategories( xChartDoc, xAxis );
}
}
}
-void DiagramHelper::switchToTextCategories( const Reference< XChartDocument >& xChartDoc )
+void DiagramHelper::switchToTextCategories( const rtl::Reference<::chart::ChartModel>& xChartDoc )
{
if(xChartDoc.is())
{
ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
- Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartDoc ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSys = xChartDoc->getFirstCoordinateSystem();
if( xCooSys.is() )
{
- Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,0) );
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2(0,0);
lcl_switchToTextCategories( xChartDoc, xAxis );
}
}
}
-bool DiagramHelper::isSupportingDateAxis( const Reference< chart2::XDiagram >& xDiagram )
-{
- return ::chart::ChartTypeHelper::isSupportingDateAxis(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ), 0 );
-}
-
-bool DiagramHelper::isDateNumberFormat( sal_Int32 nNumberFormat, const Reference< util::XNumberFormats >& xNumberFormats )
+bool DiagramHelper::isDateNumberFormat( sal_Int32 nNumberFormat, const css::uno::Reference< css::util::XNumberFormats >& xNumberFormats )
{
bool bIsDate = false;
if( !xNumberFormats.is() )
@@ -1105,7 +327,7 @@ bool DiagramHelper::isDateNumberFormat( sal_Int32 nNumberFormat, const Reference
if( xKeyProps.is() )
{
sal_Int32 nType = util::NumberFormat::UNDEFINED;
- xKeyProps->getPropertyValue( "Type" ) >>= nType;
+ xKeyProps->getPropertyValue( u"Type"_ustr ) >>= nType;
bIsDate = nType & util::NumberFormat::DATE;
}
return bIsDate;
@@ -1154,7 +376,7 @@ sal_Int32 DiagramHelper::getDateTimeInputNumberFormat( const Reference< util::XN
// Obtain best matching date, time or datetime format.
nRet = pNumFormatter->GuessDateTimeFormat( nType, fNumber, LANGUAGE_SYSTEM);
// Obtain the corresponding edit format.
- nRet = pNumFormatter->GetEditFormat( fNumber, nRet, nType, LANGUAGE_SYSTEM, nullptr);
+ nRet = pNumFormatter->GetEditFormat( fNumber, nRet, nType, nullptr);
}
return nRet;
}
@@ -1189,38 +411,8 @@ sal_Int32 DiagramHelper::getPercentNumberFormat( const Reference< util::XNumberF
return nRet;
}
-Sequence< Reference< XChartType > >
- DiagramHelper::getChartTypesFromDiagram(
- const Reference< XDiagram > & xDiagram )
-{
- std::vector< Reference< XChartType > > aResult;
-
- if(xDiagram.is())
- {
- try
- {
- Reference< XCoordinateSystemContainer > xCooSysCnt(
- xDiagram, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
- xCooSysCnt->getCoordinateSystems());
- for( Reference< XCoordinateSystem > const & coords : aCooSysSeq )
- {
- Reference< XChartTypeContainer > xCTCnt( coords, uno::UNO_QUERY_THROW );
- const Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
- aResult.insert( aResult.end(), aChartTypeSeq.begin(), aChartTypeSeq.end() );
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- }
-
- return comphelper::containerToSequence( aResult );
-}
-
-bool DiagramHelper::areChartTypesCompatible( const Reference< ::chart2::XChartType >& xFirstType,
- const Reference< ::chart2::XChartType >& xSecondType )
+bool DiagramHelper::areChartTypesCompatible( const rtl::Reference< ChartType >& xFirstType,
+ const rtl::Reference< ChartType >& xSecondType )
{
if( !xFirstType.is() || !xSecondType.is() )
return false;
@@ -1232,354 +424,6 @@ bool DiagramHelper::areChartTypesCompatible( const Reference< ::chart2::XChartTy
return ( aFirstRoles == aSecondRoles );
}
-namespace
-{
- /**
- * This method implements the logic of checking if a series can be moved
- * forward/backward. Depending on the "bDoMove" parameter the series will
- * be moved (bDoMove = true) or the function just will test if the
- * series can be moved without doing the move (bDoMove = false).
- *
- * @param xDiagram
- * Reference to the diagram that contains the series.
- *
- * @param xGivenDataSeries
- * Reference to the series that should moved or tested for moving.
- *
- * @param bForward
- * Direction in which the series should be moved or tested for moving.
- *
- * @param bDoMove
- * Should this function really move the series (true) or just test if it is
- * possible (false).
- *
- *
- * @returns
- * in case of bDoMove == true
- * - True : if the move was done
- * - False : the move failed
- * in case of bDoMove == false
- * - True : the series can be moved
- * - False : the series can not be moved
- *
- */
-
-bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
- const Reference< XDiagram >& xDiagram,
- const Reference< XDataSeries >& xGivenDataSeries,
- bool bForward,
- bool bDoMove )
-{
- bool bMovedOrMoveAllowed = false;
-
- try
- {
- uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
-
- if( xGivenDataSeries.is() && xCooSysContainer.is() )
- {
- //find position of series.
- bool bFound = false;
- uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
-
- for( sal_Int32 nCS = 0; !bFound && nCS < aCooSysList.getLength(); ++nCS )
- {
- uno::Reference< XCoordinateSystem > xCooSys( aCooSysList[nCS] );
-
- //iterate through all chart types in the current coordinate system
- uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
- OSL_ASSERT( xChartTypeContainer.is());
- if( !xChartTypeContainer.is() )
- continue;
- uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- uno::Reference< XChartType > xFormerChartType;
-
- for( sal_Int32 nT = 0; !bFound && nT < aChartTypeList.getLength(); ++nT )
- {
- uno::Reference< XChartType > xCurrentChartType( aChartTypeList[nT] );
-
- //iterate through all series in this chart type
- uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xCurrentChartType, uno::UNO_QUERY );
- OSL_ASSERT( xDataSeriesContainer.is());
- if( !xDataSeriesContainer.is() )
- continue;
-
- uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
- auto aSeriesListRange = asNonConstRange(aSeriesList);
-
- for( sal_Int32 nS = 0; !bFound && nS < aSeriesList.getLength(); ++nS )
- {
-
- // We found the series we are interested in!
- if( xGivenDataSeries==aSeriesList[nS] )
- {
- sal_Int32 nOldSeriesIndex = nS;
- bFound = true;
-
- try
- {
- sal_Int32 nNewSeriesIndex = nS;
-
- // tdf#34517 Bringing forward means increasing, backwards means decreasing series position
- if( !bForward )
- nNewSeriesIndex--;
- else
- nNewSeriesIndex++;
-
- if( nNewSeriesIndex >= 0 && nNewSeriesIndex < aSeriesList.getLength() )
- {
- //move series in the same charttype
- bMovedOrMoveAllowed = true;
- if( bDoMove )
- {
- aSeriesListRange[ nOldSeriesIndex ] = aSeriesList[ nNewSeriesIndex ];
- aSeriesListRange[ nNewSeriesIndex ] = xGivenDataSeries;
- xDataSeriesContainer->setDataSeries( aSeriesList );
- }
- }
- else if( nNewSeriesIndex<0 )
- {
- //exchange series with former charttype
- if( xFormerChartType.is() && DiagramHelper::areChartTypesCompatible( xFormerChartType, xCurrentChartType ) )
- {
- bMovedOrMoveAllowed = true;
- if( bDoMove )
- {
- uno::Reference< XDataSeriesContainer > xOtherDataSeriesContainer( xFormerChartType, uno::UNO_QUERY );
- if( xOtherDataSeriesContainer.is() )
- {
- uno::Sequence< uno::Reference< XDataSeries > > aOtherSeriesList( xOtherDataSeriesContainer->getDataSeries() );
- sal_Int32 nOtherSeriesIndex = aOtherSeriesList.getLength()-1;
- if( nOtherSeriesIndex >= 0 && nOtherSeriesIndex < aOtherSeriesList.getLength() )
- {
- uno::Reference< XDataSeries > xExchangeSeries( aOtherSeriesList[nOtherSeriesIndex] );
- aOtherSeriesList.getArray()[nOtherSeriesIndex] = xGivenDataSeries;
- xOtherDataSeriesContainer->setDataSeries(aOtherSeriesList);
-
- aSeriesListRange[nOldSeriesIndex]=xExchangeSeries;
- xDataSeriesContainer->setDataSeries(aSeriesList);
- }
- }
- }
- }
- }
- else if( nT+1 < aChartTypeList.getLength() )
- {
- //exchange series with next charttype
- uno::Reference< XChartType > xOtherChartType( aChartTypeList[nT+1] );
- if( xOtherChartType.is() && DiagramHelper::areChartTypesCompatible( xOtherChartType, xCurrentChartType ) )
- {
- bMovedOrMoveAllowed = true;
- if( bDoMove )
- {
- uno::Reference< XDataSeriesContainer > xOtherDataSeriesContainer( xOtherChartType, uno::UNO_QUERY );
- if( xOtherDataSeriesContainer.is() )
- {
- uno::Sequence< uno::Reference< XDataSeries > > aOtherSeriesList( xOtherDataSeriesContainer->getDataSeries() );
- if( aOtherSeriesList.hasElements() )
- {
- uno::Reference< XDataSeries > xExchangeSeries( aOtherSeriesList[0] );
- aOtherSeriesList.getArray()[0] = xGivenDataSeries;
- xOtherDataSeriesContainer->setDataSeries(aOtherSeriesList);
-
- aSeriesListRange[nOldSeriesIndex]=xExchangeSeries;
- xDataSeriesContainer->setDataSeries(aSeriesList);
- }
- }
- }
- }
- }
- }
- catch( const util::CloseVetoException& )
- {
- }
- catch( const uno::RuntimeException& )
- {
- }
- }
- }
- xFormerChartType = xCurrentChartType;
- }
- }
- }
- }
- catch( const util::CloseVetoException& )
- {
- }
- catch( const uno::RuntimeException& )
- {
- }
- return bMovedOrMoveAllowed;
-}
-} // anonymous namespace
-
-bool DiagramHelper::isSeriesMoveable(
- const Reference< XDiagram >& xDiagram,
- const Reference< XDataSeries >& xGivenDataSeries,
- bool bForward )
-{
- const bool bDoMove = false;
-
- bool bIsMoveable = lcl_moveSeriesOrCheckIfMoveIsAllowed(
- xDiagram, xGivenDataSeries, bForward, bDoMove );
-
- return bIsMoveable;
-}
-
-bool DiagramHelper::moveSeries( const Reference< XDiagram >& xDiagram, const Reference< XDataSeries >& xGivenDataSeries, bool bForward )
-{
- const bool bDoMove = true;
-
- bool bMoved = lcl_moveSeriesOrCheckIfMoveIsAllowed(
- xDiagram, xGivenDataSeries, bForward, bDoMove );
-
- return bMoved;
-}
-
-bool DiagramHelper::isSupportingFloorAndWall( const Reference<
- chart2::XDiagram >& xDiagram )
-{
- //pies and donuts currently do not support this because of wrong files from older versions
- //todo: allow this in future again, if fileversion is available for OLE objects (metastream)
- //thus the wrong bottom can be removed on import
-
- const Sequence< Reference< chart2::XChartType > > aTypes(
- ::chart::DiagramHelper::getChartTypesFromDiagram( xDiagram ) );
- for( Reference< chart2::XChartType > const & xType : aTypes )
- {
- if( xType.is() && xType->getChartType().match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
- return false;
- if( xType.is() && xType->getChartType().match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
- return false;
- if( xType.is() && xType->getChartType().match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
- return false;
- }
- return true;
-}
-
-bool DiagramHelper::isPieOrDonutChart( const css::uno::Reference< css::chart2::XDiagram >& xDiagram )
-{
- uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex(
- xDiagram, 0 ) );
-
- if( xChartType .is() )
- {
- OUString aChartType = xChartType->getChartType();
- if( aChartType == CHART2_SERVICE_NAME_CHARTTYPE_PIE )
- return true;
- }
- return false;
-}
-
-sal_Int32 DiagramHelper::getGeometry3D(
- const uno::Reference< chart2::XDiagram > & xDiagram,
- bool& rbFound, bool& rbAmbiguous )
-{
- sal_Int32 nCommonGeom( DataPointGeometry3D::CUBOID );
- rbFound = false;
- rbAmbiguous = false;
-
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
-
- if( aSeriesVec.empty())
- rbAmbiguous = true;
-
- for (auto const& series : aSeriesVec)
- {
- try
- {
- sal_Int32 nGeom = 0;
- Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY_THROW);
- if( xProp->getPropertyValue( "Geometry3D") >>= nGeom )
- {
- if( ! rbFound )
- {
- // first series
- nCommonGeom = nGeom;
- rbFound = true;
- }
- // further series: compare for uniqueness
- else if( nCommonGeom != nGeom )
- {
- rbAmbiguous = true;
- break;
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- }
-
- return nCommonGeom;
-}
-
-void DiagramHelper::setGeometry3D(
- const Reference< chart2::XDiagram > & xDiagram,
- sal_Int32 nNewGeometry )
-{
- std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
-
- for (auto const& series : aSeriesVec)
- {
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(
- series, "Geometry3D", uno::Any( nNewGeometry ));
- }
-}
-
-sal_Int32 DiagramHelper::getCorrectedMissingValueTreatment(
- const Reference< chart2::XDiagram > & xDiagram,
- const Reference< chart2::XChartType >& xChartType )
-{
- sal_Int32 nResult = css::chart::MissingValueTreatment::LEAVE_GAP;
- const uno::Sequence < sal_Int32 > aAvailableMissingValueTreatments(
- ChartTypeHelper::getSupportedMissingValueTreatments( xChartType ) );
-
- uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
- if( xDiaProp.is() && (xDiaProp->getPropertyValue( "MissingValueTreatment" ) >>= nResult) )
- {
- //ensure that the set value is supported by this charttype
- for( sal_Int32 n : aAvailableMissingValueTreatments )
- if( n == nResult )
- return nResult; //ok
- }
-
- //otherwise use the first supported one
- if( aAvailableMissingValueTreatments.hasElements() )
- {
- nResult = aAvailableMissingValueTreatments[0];
- return nResult;
- }
-
- return nResult;
-}
-
-DiagramPositioningMode DiagramHelper::getDiagramPositioningMode( const uno::Reference<
- chart2::XDiagram > & xDiagram )
-{
- DiagramPositioningMode eMode = DiagramPositioningMode_AUTO;
- uno::Reference< beans::XPropertySet > xDiaProps( xDiagram, uno::UNO_QUERY );
- if( xDiaProps.is() )
- {
- RelativePosition aRelPos;
- RelativeSize aRelSize;
- if( (xDiaProps->getPropertyValue("RelativePosition") >>= aRelPos ) &&
- (xDiaProps->getPropertyValue("RelativeSize") >>= aRelSize ) )
- {
- bool bPosSizeExcludeAxes=false;
- xDiaProps->getPropertyValue("PosSizeExcludeAxes") >>= bPosSizeExcludeAxes;
- if( bPosSizeExcludeAxes )
- eMode = DiagramPositioningMode_EXCLUDING;
- else
- eMode = DiagramPositioningMode_INCLUDING;
- }
- }
- return eMode;
-}
-
static void lcl_ensureRange0to1( double& rValue )
{
if(rValue<0.0)
@@ -1588,21 +432,21 @@ static void lcl_ensureRange0to1( double& rValue )
rValue=1.0;
}
-bool DiagramHelper::setDiagramPositioning( const uno::Reference< frame::XModel >& xChartModel,
+bool DiagramHelper::setDiagramPositioning( const rtl::Reference<::chart::ChartModel>& xChartModel,
const awt::Rectangle& rPosRect /*100th mm*/ )
{
ControllerLockGuardUNO aCtrlLockGuard( xChartModel );
bool bChanged = false;
- awt::Size aPageSize( ChartModelHelper::getPageSize(xChartModel) );
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
+ awt::Size aPageSize( xChartModel->getPageSize() );
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
if( !xDiagram.is() )
return bChanged;
RelativePosition aOldPos;
RelativeSize aOldSize;
- xDiagram->getPropertyValue("RelativePosition" ) >>= aOldPos;
- xDiagram->getPropertyValue("RelativeSize" ) >>= aOldSize;
+ xDiagram->getPropertyValue(u"RelativePosition"_ustr ) >>= aOldPos;
+ xDiagram->getPropertyValue(u"RelativeSize"_ustr ) >>= aOldSize;
RelativePosition aNewPos;
aNewPos.Anchor = drawing::Alignment_TOP_LEFT;
@@ -1622,8 +466,8 @@ bool DiagramHelper::setDiagramPositioning( const uno::Reference< frame::XModel >
if( (aNewPos.Secondary + aNewSize.Secondary) > 1.0 )
aNewPos.Secondary = 1.0 - aNewSize.Secondary;
- xDiagram->setPropertyValue( "RelativePosition", uno::Any(aNewPos) );
- xDiagram->setPropertyValue( "RelativeSize", uno::Any(aNewSize) );
+ xDiagram->setPropertyValue( u"RelativePosition"_ustr, uno::Any(aNewPos) );
+ xDiagram->setPropertyValue( u"RelativeSize"_ustr, uno::Any(aNewSize) );
bChanged = (aOldPos.Anchor!=aNewPos.Anchor) ||
(aOldPos.Primary!=aNewPos.Primary) ||
@@ -1633,20 +477,20 @@ bool DiagramHelper::setDiagramPositioning( const uno::Reference< frame::XModel >
return bChanged;
}
-awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const uno::Reference< frame::XModel >& xChartModel )
+awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const rtl::Reference<::chart::ChartModel>& xChartModel )
{
awt::Rectangle aRet(-1,-1,-1,-1);
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel );
+ rtl::Reference< Diagram > xDiagram = xChartModel->getFirstChartDiagram();
if( !xDiagram.is() )
return aRet;
- awt::Size aPageSize( ChartModelHelper::getPageSize(xChartModel) );
+ awt::Size aPageSize( xChartModel->getPageSize() );
RelativePosition aRelPos;
RelativeSize aRelSize;
- xDiagram->getPropertyValue("RelativePosition" ) >>= aRelPos;
- xDiagram->getPropertyValue("RelativeSize" ) >>= aRelSize;
+ xDiagram->getPropertyValue(u"RelativePosition"_ustr ) >>= aRelPos;
+ xDiagram->getPropertyValue(u"RelativeSize"_ustr ) >>= aRelSize;
awt::Size aAbsSize(
static_cast< sal_Int32 >( aRelSize.Primary * aPageSize.Width ),
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index f55b0637dc8a..03a35391c21e 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -33,7 +33,7 @@
#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
using namespace ::com::sun::star;
@@ -41,7 +41,7 @@ using namespace ::com::sun::star;
namespace
{
-constexpr OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart2.ErrorBar";
+constexpr OUString lcl_aServiceName = u"com.sun.star.comp.chart2.ErrorBar"_ustr;
bool lcl_isInternalData( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq )
{
@@ -53,22 +53,21 @@ const SfxItemPropertySet* GetErrorBarPropertySet()
{
static const SfxItemPropertyMapEntry aErrorBarPropertyMap_Impl[] =
{
- {u"ShowPositiveError",0,cppu::UnoType<bool>::get(), 0, 0},
- {u"ShowNegativeError",1,cppu::UnoType<bool>::get(), 0, 0},
- {u"PositiveError",2,cppu::UnoType<double>::get(),0,0},
- {u"NegativeError",3,cppu::UnoType<double>::get(), 0, 0},
- {u"PercentageError",4,cppu::UnoType<double>::get(), 0, 0},
- {u"ErrorBarStyle",5,cppu::UnoType<sal_Int32>::get(),0,0},
- {u"ErrorBarRangePositive",6,cppu::UnoType<OUString>::get(),0,0}, // read-only for export
- {u"ErrorBarRangeNegative",7,cppu::UnoType<OUString>::get(),0,0}, // read-only for export
- {u"Weight",8,cppu::UnoType<double>::get(),0,0},
- {u"LineStyle",9,cppu::UnoType<css::drawing::LineStyle>::get(),0,0},
- {u"LineDash",10,cppu::UnoType<drawing::LineDash>::get(),0,0},
- {u"LineWidth",11,cppu::UnoType<sal_Int32>::get(),0,0},
- {u"LineColor",12,cppu::UnoType<css::util::Color>::get(),0,0},
- {u"LineTransparence",13,cppu::UnoType<sal_Int16>::get(),0,0},
- {u"LineJoint",14,cppu::UnoType<css::drawing::LineJoint>::get(),0,0},
- { u"", 0, css::uno::Type(), 0, 0 }
+ {u"ShowPositiveError"_ustr,0,cppu::UnoType<bool>::get(), 0, 0},
+ {u"ShowNegativeError"_ustr,1,cppu::UnoType<bool>::get(), 0, 0},
+ {u"PositiveError"_ustr,2,cppu::UnoType<double>::get(),0,0},
+ {u"NegativeError"_ustr,3,cppu::UnoType<double>::get(), 0, 0},
+ {u"PercentageError"_ustr,4,cppu::UnoType<double>::get(), 0, 0},
+ {u"ErrorBarStyle"_ustr,5,cppu::UnoType<sal_Int32>::get(),0,0},
+ {u"ErrorBarRangePositive"_ustr,6,cppu::UnoType<OUString>::get(),0,0}, // read-only for export
+ {u"ErrorBarRangeNegative"_ustr,7,cppu::UnoType<OUString>::get(),0,0}, // read-only for export
+ {u"Weight"_ustr,8,cppu::UnoType<double>::get(),0,0},
+ {u"LineStyle"_ustr,9,cppu::UnoType<css::drawing::LineStyle>::get(),0,0},
+ {u"LineDash"_ustr,10,cppu::UnoType<drawing::LineDash>::get(),0,0},
+ {u"LineWidth"_ustr,11,cppu::UnoType<sal_Int32>::get(),0,0},
+ {u"LineColor"_ustr,12,cppu::UnoType<css::util::Color>::get(),0,0},
+ {u"LineTransparence"_ustr,13,cppu::UnoType<sal_Int16>::get(),0,0},
+ {u"LineJoint"_ustr,14,cppu::UnoType<css::drawing::LineJoint>::get(),0,0},
};
static SfxItemPropertySet aPropSet( aErrorBarPropertyMap_Impl );
return &aPropSet;
@@ -162,7 +161,7 @@ void ErrorBar::setPropertyValue( const OUString& rPropName, const uno::Any& rAny
else if(rPropName == "ShowNegativeError")
rAny >>= mbShowNegativeError;
else if(rPropName == "ErrorBarRangePositive" || rPropName == "ErrorBarRangeNegative")
- throw beans::UnknownPropertyException("read-only property", static_cast< uno::XWeak*>(this));
+ throw beans::UnknownPropertyException(u"read-only property"_ustr, static_cast< uno::XWeak*>(this));
else if(rPropName == "LineDashName")
rAny >>= maDashName;
else if(rPropName == "LineDash")
@@ -200,7 +199,7 @@ OUString getSourceRangeStrFromLabeledSequences( const uno::Sequence< uno::Refere
uno::Reference< chart2::data::XDataSequence > xSequence( labeledData->getValues());
uno::Reference< beans::XPropertySet > xSeqProp( xSequence, uno::UNO_QUERY_THROW );
OUString aRole;
- if( ( xSeqProp->getPropertyValue( "Role" ) >>= aRole ) &&
+ if( ( xSeqProp->getPropertyValue( u"Role"_ustr ) >>= aRole ) &&
aRole.match( "error-bars" ) && aRole.indexOf(aDirection) >= 0 )
{
return xSequence->getSourceRangeRepresentation();
@@ -451,7 +450,7 @@ css::uno::Sequence< OUString > SAL_CALL ErrorBar::getSupportedServiceNames()
{
return {
lcl_aServiceName,
- "com.sun.star.chart2.ErrorBar"
+ u"com.sun.star.chart2.ErrorBar"_ustr
};
}
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index 0f418198a08d..df431908f3f3 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -19,19 +19,24 @@
#include <ExplicitCategoriesProvider.hxx>
#include <DiagramHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <DataSourceHelper.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
#include <NumberFormatterWrapper.hxx>
#include <unonames.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <DataSeries.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart/ChartDataRowSource.hpp>
+#include <o3tl/compare.hxx>
#include <o3tl/safeint.hxx>
#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <svl/numuno.hxx>
#include <limits>
@@ -44,10 +49,10 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using std::vector;
-ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2::XCoordinateSystem >& xCooSysModel
+ExplicitCategoriesProvider::ExplicitCategoriesProvider( const rtl::Reference< BaseCoordinateSystem >& xCooSysModel
, ChartModel& rModel )
: m_bDirty(true)
- , m_xCooSysModel( xCooSysModel )
+ , m_xCooSysModel( xCooSysModel.get() )
, mrModel(rModel)
, m_bIsExplicitCategoriesInited(false)
, m_bIsDateAxis(false)
@@ -58,7 +63,7 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2:
if( xCooSysModel.is() )
{
// TODO: handle different category names on the primary and secondary category axis.
- uno::Reference< XAxis > xAxis( xCooSysModel->getAxisByDimension(0,0) );
+ rtl::Reference< Axis > xAxis = xCooSysModel->getAxisByDimension2(0,0);
if( xAxis.is() )
{
ScaleData aScale( xAxis->getScaleData() );
@@ -70,63 +75,78 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2:
if( m_xOriginalCategories.is() )
{
- uno::Reference< data::XDataProvider > xDataProvider( mrModel.getDataProvider() );
+ implInitSplit();
+ if( m_aSplitCategoriesList.empty() )
+ m_aSplitCategoriesList = { m_xOriginalCategories };
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
- OUString aCategoriesRange( DataSourceHelper::getRangeFromValues( m_xOriginalCategories ) );
- if( xDataProvider.is() && !aCategoriesRange.isEmpty() )
- {
- const bool bFirstCellAsLabel = false;
- const bool bHasCategories = false;
- const uno::Sequence< sal_Int32 > aSequenceMapping;
+void ExplicitCategoriesProvider::implInitSplit()
+{
+ uno::Reference< data::XDataProvider > xDataProvider( mrModel.getDataProvider() );
+ if( !xDataProvider.is() )
+ return;
- uno::Reference< data::XDataSource > xColumnCategoriesSource( xDataProvider->createDataSource(
- DataSourceHelper::createArguments( aCategoriesRange, aSequenceMapping, true /*bUseColumns*/
- , bFirstCellAsLabel, bHasCategories ) ) );
+ OUString aCategoriesRange( DataSourceHelper::getRangeFromValues( m_xOriginalCategories ) );
+ if( aCategoriesRange.isEmpty() )
+ return;
- uno::Reference< data::XDataSource > xRowCategoriesSource( xDataProvider->createDataSource(
- DataSourceHelper::createArguments( aCategoriesRange, aSequenceMapping, false /*bUseColumns*/
- , bFirstCellAsLabel, bHasCategories ) ) );
+ const bool bFirstCellAsLabel = false;
+ const bool bHasCategories = false;
+ const uno::Sequence< sal_Int32 > aSequenceMapping;
- if( xColumnCategoriesSource.is() && xRowCategoriesSource.is() )
- {
- Sequence< Reference< data::XLabeledDataSequence> > aColumns = xColumnCategoriesSource->getDataSequences();
- Sequence< Reference< data::XLabeledDataSequence> > aRows = xRowCategoriesSource->getDataSequences();
+ uno::Reference< data::XDataSource > xColumnCategoriesSource( xDataProvider->createDataSource(
+ DataSourceHelper::createArguments( aCategoriesRange, aSequenceMapping, true /*bUseColumns*/
+ , bFirstCellAsLabel, bHasCategories ) ) );
+ if( !xColumnCategoriesSource )
+ return;
- sal_Int32 nColumnCount = aColumns.getLength();
- sal_Int32 nRowCount = aRows.getLength();
- if( nColumnCount>1 && nRowCount>1 )
- {
- //we have complex categories
- //->split them in the direction of the first series
- //detect whether the first series is a row or a column
- bool bSeriesUsesColumns = true;
- std::vector< Reference< XDataSeries > > aSeries( ChartModelHelper::getDataSeries( mrModel ) );
- if( !aSeries.empty() )
- {
- uno::Reference< data::XDataSource > xSeriesSource( aSeries.front(), uno::UNO_QUERY );
- OUString aStringDummy;
- bool bDummy;
- uno::Sequence< sal_Int32 > aSeqDummy;
- DataSourceHelper::readArguments( xDataProvider->detectArguments( xSeriesSource),
- aStringDummy, aSeqDummy, bSeriesUsesColumns, bDummy, bDummy );
- }
- if( bSeriesUsesColumns )
- m_aSplitCategoriesList=aColumns;
- else
- m_aSplitCategoriesList=aRows;
- }
- }
- }
- if( !m_aSplitCategoriesList.hasElements() )
+ Sequence< Reference< data::XLabeledDataSequence> > aColumns = xColumnCategoriesSource->getDataSequences();
+ sal_Int32 nColumnCount = aColumns.getLength();
+ if( nColumnCount<=1 )
+ return;
+
+ uno::Reference< data::XDataSource > xRowCategoriesSource( xDataProvider->createDataSource(
+ DataSourceHelper::createArguments( aCategoriesRange, aSequenceMapping, false /*bUseColumns*/
+ , bFirstCellAsLabel, bHasCategories ) ) );
+ if( !xRowCategoriesSource )
+ return;
+
+ Sequence< Reference< data::XLabeledDataSequence> > aRows = xRowCategoriesSource->getDataSequences();
+ sal_Int32 nRowCount = aRows.getLength();
+ if( nRowCount<=1 )
+ return;
+
+ //we have complex categories
+ //->split them in the direction of the first series
+ //detect whether the first series is a row or a column
+ bool bSeriesUsesColumns = true;
+ std::vector< rtl::Reference< DataSeries > > aSeries = mrModel.getDataSeries();
+ if( !aSeries.empty() )
+ {
+ const rtl::Reference< DataSeries >& xSeriesSource = aSeries.front();
+ for(const auto& rArgument : xDataProvider->detectArguments( xSeriesSource))
+ {
+ if ( rArgument.Name == "DataRowSource" )
{
- m_aSplitCategoriesList = { m_xOriginalCategories };
+ css::chart::ChartDataRowSource eRowSource;
+ if( rArgument.Value >>= eRowSource )
+ {
+ bSeriesUsesColumns = (eRowSource == css::chart::ChartDataRowSource_COLUMNS);
+ break;
+ }
}
}
}
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
+ if( bSeriesUsesColumns )
+ m_aSplitCategoriesList = comphelper::sequenceToContainer<std::vector<Reference<data::XLabeledDataSequence>>>(aColumns);
+ else
+ m_aSplitCategoriesList = comphelper::sequenceToContainer<std::vector<Reference<data::XLabeledDataSequence>>>(aRows);
}
ExplicitCategoriesProvider::~ExplicitCategoriesProvider()
@@ -142,12 +162,12 @@ Reference< chart2::data::XDataSequence > ExplicitCategoriesProvider::getOriginal
bool ExplicitCategoriesProvider::hasComplexCategories() const
{
- return m_aSplitCategoriesList.getLength() > 1;
+ return m_aSplitCategoriesList.size() > 1;
}
sal_Int32 ExplicitCategoriesProvider::getCategoryLevelCount() const
{
- sal_Int32 nCount = m_aSplitCategoriesList.getLength();
+ sal_Int32 nCount = m_aSplitCategoriesList.size();
if(!nCount)
nCount = 1;
return nCount;
@@ -174,12 +194,12 @@ void ExplicitCategoriesProvider::convertCategoryAnysToText( uno::Sequence< OUStr
auto pOutTexts = rOutTexts.getArray();
sal_Int32 nAxisNumberFormat = 0;
- rtl::Reference< BaseCoordinateSystem > xCooSysModel( ChartModelHelper::getFirstCoordinateSystem( rModel ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSysModel( rModel.getFirstCoordinateSystem() );
if( xCooSysModel.is() )
{
- Reference< chart2::XAxis > xAxis( xCooSysModel->getAxisByDimension(0,0) );
+ rtl::Reference< Axis > xAxis = xCooSysModel->getAxisByDimension2(0,0);
nAxisNumberFormat = AxisHelper::getExplicitNumberFormatKeyForAxis(
- xAxis, xCooSysModel, uno::Reference<chart2::XChartDocument>(&rModel), false );
+ xAxis, xCooSysModel, &rModel, false );
}
Color nLabelColor;
@@ -190,7 +210,7 @@ void ExplicitCategoriesProvider::convertCategoryAnysToText( uno::Sequence< OUStr
for(sal_Int32 nN=0;nN<nCount;nN++)
{
OUString aText;
- uno::Any aAny = rInAnys[nN];
+ const uno::Any& aAny = rInAnys[nN];
if( aAny.hasValue() )
{
double fDouble = 0;
@@ -220,8 +240,7 @@ class SplitCategoriesProvider_ForLabeledDataSequences : public SplitCategoriesPr
public:
explicit SplitCategoriesProvider_ForLabeledDataSequences(
- const css::uno::Sequence<
- css::uno::Reference< css::chart2::data::XLabeledDataSequence> >& rSplitCategoriesList
+ const std::vector< Reference< data::XLabeledDataSequence> >& rSplitCategoriesList
, ChartModel& rModel )
: m_rSplitCategoriesList( rSplitCategoriesList )
, mrModel( rModel )
@@ -231,8 +250,7 @@ public:
virtual uno::Sequence< OUString > getStringsForLevel( sal_Int32 nIndex ) const override;
private:
- const css::uno::Sequence< css::uno::Reference<
- css::chart2::data::XLabeledDataSequence> >& m_rSplitCategoriesList;
+ const std::vector< Reference< data::XLabeledDataSequence> >& m_rSplitCategoriesList;
ChartModel& mrModel;
};
@@ -241,7 +259,7 @@ private:
sal_Int32 SplitCategoriesProvider_ForLabeledDataSequences::getLevelCount() const
{
- return m_rSplitCategoriesList.getLength();
+ return m_rSplitCategoriesList.size();
}
uno::Sequence< OUString > SplitCategoriesProvider_ForLabeledDataSequences::getStringsForLevel( sal_Int32 nLevel ) const
{
@@ -405,13 +423,13 @@ static bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >&
bool bOwnData = false;
bool bOwnDataAnddAxisHasAnyFormat = false;
bool bOwnDataAnddAxisHasDateFormat = false;
- Reference< XCoordinateSystem > xCooSysModel( ChartModelHelper::getFirstCoordinateSystem( rModel ) );
+ rtl::Reference< BaseCoordinateSystem > xCooSysModel( rModel.getFirstCoordinateSystem() );
if( xCooSysModel.is() )
{
if( rModel.hasInternalDataProvider() )
{
bOwnData = true;
- Reference< beans::XPropertySet > xAxisProps( xCooSysModel->getAxisByDimension(0,0), uno::UNO_QUERY );
+ rtl::Reference< Axis > xAxisProps = xCooSysModel->getAxisByDimension2(0,0);
sal_Int32 nAxisNumberFormat = 0;
if (xAxisProps.is() && (xAxisProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nAxisNumberFormat))
{
@@ -435,7 +453,7 @@ static bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >&
bIsDate = true;
bool bContainsEmptyString = false;
- uno::Any aAny = aValues[nN];
+ const uno::Any& aAny = aValues[nN];
if( aAny.hasValue() )
{
OUString aTest;
@@ -459,7 +477,9 @@ static bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >&
rDateCategories.push_back( std::numeric_limits<double>::quiet_NaN() );
}
}
- std::sort( rDateCategories.begin(), rDateCategories.end() );
+ std::sort(
+ rDateCategories.begin(), rDateCategories.end(),
+ [](auto x, auto y) { return o3tl::strong_order(x, y) < 0; } );
}
return bAnyDataFound && bOnlyDatesFound;
@@ -479,7 +499,8 @@ void ExplicitCategoriesProvider::init()
{
if(m_bIsDateAxis)
{
- if( ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( m_xCooSysModel, 0 ), 0 ) )
+ auto xChartType = AxisHelper::getChartTypeByIndex(m_xCooSysModel.get(), 0);
+ if (xChartType.is() ? xChartType->isSupportingDateAxis(0) : true)
m_bIsDateAxis = lcl_fillDateCategories( m_xOriginalCategories->getValues(), m_aDateCategories, m_bIsAutoDate, mrModel );
else
m_bIsDateAxis = false;
@@ -516,7 +537,7 @@ Sequence< OUString > const & ExplicitCategoriesProvider::getSimpleCategories()
}
}
if(!m_aExplicitCategories.hasElements())
- m_aExplicitCategories = DiagramHelper::generateAutomaticCategoriesFromCooSys( m_xCooSysModel );
+ m_aExplicitCategories = DiagramHelper::generateAutomaticCategoriesFromCooSys( m_xCooSysModel.get() );
m_bIsExplicitCategoriesInited = true;
}
return m_aExplicitCategories;
@@ -532,7 +553,7 @@ const std::vector<ComplexCategory>* ExplicitCategoriesProvider::getCategoriesByL
}
OUString ExplicitCategoriesProvider::getCategoryByIndex(
- const Reference< XCoordinateSystem >& xCooSysModel
+ const rtl::Reference< BaseCoordinateSystem >& xCooSysModel
, ChartModel& rModel
, sal_Int32 nIndex )
{
diff --git a/chart2/source/tools/FillProperties.cxx b/chart2/source/tools/FillProperties.cxx
index d0c888d748f2..ba3b63c83db1 100644
--- a/chart2/source/tools/FillProperties.cxx
+++ b/chart2/source/tools/FillProperties.cxx
@@ -23,6 +23,8 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/RectanglePoint.hpp>
+#include <tools/color.hxx>
+
using namespace ::com::sun::star;
using ::com::sun::star::beans::Property;
@@ -158,23 +160,23 @@ void lcl_AddDefaultsToMap_without_BitmapProperties(
::chart::tPropertyValueMap & rOutMap )
{
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_STYLE, drawing::FillStyle_SOLID );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, FillProperties::PROP_FILL_COLOR, 0xd9d9d9 ); // gray85
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_TRANSPARENCE, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_COLOR, Color(0xd9, 0xd9, 0xd9) ); // gray85
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_TRANSPARENCE, sal_Int16(0) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BACKGROUND, false );
}
void lcl_AddDefaultsToMap_only_BitmapProperties(
::chart::tPropertyValueMap & rOutMap )
{
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETX, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETY, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETX, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETY, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETX, sal_Int16(0) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETY, sal_Int16(0) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETX, sal_Int16(0) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETY, sal_Int16(0) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_RECTANGLEPOINT, drawing::RectanglePoint_MIDDLE_MIDDLE );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_LOGICALSIZE, true );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEX, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEY, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEX, sal_Int32(0) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEY, sal_Int32(0) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_MODE, drawing::BitmapMode_REPEAT );
}
diff --git a/chart2/source/tools/FormattedStringHelper.cxx b/chart2/source/tools/FormattedStringHelper.cxx
index 755dd532b042..6b881160670f 100644
--- a/chart2/source/tools/FormattedStringHelper.cxx
+++ b/chart2/source/tools/FormattedStringHelper.cxx
@@ -18,8 +18,8 @@
*/
#include <FormattedStringHelper.hxx>
-#include <com/sun/star/chart2/FormattedString.hpp>
-#include <tools/diagnose_ex.h>
+#include <FormattedString.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/property.hxx>
namespace chart
@@ -28,34 +28,29 @@ namespace chart
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-Sequence< Reference< chart2::XFormattedString2 > >
- FormattedStringHelper::createFormattedStringSequence(
- const Reference< uno::XComponentContext > & xContext
- , const OUString & rString
+rtl::Reference< ::chart::FormattedString >
+ FormattedStringHelper::createFormattedString(
+ const OUString & rString
, const Reference< beans::XPropertySet > & xTextProperties ) noexcept
{
- Reference< XFormattedString2 > xFormStr;
+ rtl::Reference< FormattedString > xFormStr;
try
{
- if( xContext.is() )
- {
- xFormStr = chart2::FormattedString::create(xContext);
+ xFormStr = new FormattedString();
- xFormStr->setString( rString );
+ xFormStr->setString( rString );
- // set character properties
- comphelper::copyProperties(
- xTextProperties, Reference< beans::XPropertySet >( xFormStr, uno::UNO_QUERY_THROW ) );
- }
+ // set character properties
+ comphelper::copyProperties(
+ xTextProperties, Reference< beans::XPropertySet >( static_cast<cppu::OWeakObject*>(xFormStr.get()), uno::UNO_QUERY_THROW ) );
}
catch( const uno::Exception & )
{
DBG_UNHANDLED_EXCEPTION("chart2");
}
- return Sequence< Reference< XFormattedString2 > >( & xFormStr, 1 );
+ return xFormStr;
}
} //namespace chart
diff --git a/chart2/source/tools/HistogramDataSequence.cxx b/chart2/source/tools/HistogramDataSequence.cxx
new file mode 100644
index 000000000000..c98a6c92fd33
--- /dev/null
+++ b/chart2/source/tools/HistogramDataSequence.cxx
@@ -0,0 +1,154 @@
+/* -*- 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 <HistogramDataSequence.hxx>
+
+#include <CommonFunctors.hxx>
+#include <ModifyListenerHelper.hxx>
+
+#include <comphelper/sequenceashashmap.hxx>
+#include <cppuhelper/supportsservice.hxx>
+
+#include <algorithm>
+#include <strings.hrc>
+#include <ResId.hxx>
+#include <utility>
+
+using namespace css;
+
+namespace
+{
+constexpr OUString lcl_aServiceName = u"com.sun.star.comp.chart.HistogramDataSequence"_ustr;
+
+enum
+{
+ PROP_PROPOSED_ROLE
+};
+
+} // anonymous namespace
+
+namespace chart
+{
+HistogramDataSequence::HistogramDataSequence()
+ : m_xModifyEventForwarder(new ModifyEventForwarder())
+{
+ registerProperty(u"Role"_ustr, PROP_PROPOSED_ROLE,
+ 0, // PropertyAttributes
+ &m_sRole, cppu::UnoType<decltype(m_sRole)>::get());
+}
+
+HistogramDataSequence::~HistogramDataSequence() {}
+
+IMPLEMENT_FORWARD_XINTERFACE2(HistogramDataSequence, HistogramDataSequence_Base,
+ comphelper::OPropertyContainer2)
+
+IMPLEMENT_FORWARD_XTYPEPROVIDER2(HistogramDataSequence, HistogramDataSequence_Base,
+ comphelper::OPropertyContainer2)
+
+// XPropertySet
+uno::Reference<beans::XPropertySetInfo> SAL_CALL HistogramDataSequence::getPropertySetInfo()
+{
+ return createPropertySetInfo(getInfoHelper());
+}
+
+// comphelper::OPropertySetHelper
+::cppu::IPropertyArrayHelper& HistogramDataSequence::getInfoHelper() { return *getArrayHelper(); }
+
+// comphelper::OPropertyArrayHelper
+::cppu::IPropertyArrayHelper* HistogramDataSequence::createArrayHelper() const
+{
+ uno::Sequence<beans::Property> aProperties;
+ // describes all properties which have been registered in the ctor
+ describeProperties(aProperties);
+
+ return new ::cppu::OPropertyArrayHelper(aProperties);
+}
+
+OUString SAL_CALL HistogramDataSequence::getImplementationName() { return lcl_aServiceName; }
+
+sal_Bool SAL_CALL HistogramDataSequence::supportsService(const OUString& rServiceName)
+{
+ return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence<OUString> SAL_CALL HistogramDataSequence::getSupportedServiceNames()
+{
+ return { lcl_aServiceName, u"com.sun.star.chart2.data.DataSequence"_ustr,
+ u"com.sun.star.chart2.data.NumericalDataSequence"_ustr,
+ u"com.sun.star.chart2.data.TextualDataSequence"_ustr };
+}
+
+// XNumericalDataSequence
+uno::Sequence<double> SAL_CALL HistogramDataSequence::getNumericalData()
+{
+ std::unique_lock<std::mutex> aGuard;
+
+ return mxValues;
+}
+
+// XTextualDataSequence
+uno::Sequence<OUString> SAL_CALL HistogramDataSequence::getTextualData()
+{
+ std::unique_lock<std::mutex> aGuard;
+ return {};
+}
+
+// XDataSequence
+uno::Sequence<uno::Any> SAL_CALL HistogramDataSequence::getData()
+{
+ std::unique_lock<std::mutex> aGuard;
+ uno::Sequence<uno::Any> aSequence(mxValues.size());
+ auto pSequence = aSequence.getArray();
+
+ size_t i = 0;
+ for (double nValue : mxValues)
+ {
+ pSequence[i] <<= nValue;
+ i++;
+ }
+ return aSequence;
+}
+
+OUString SAL_CALL HistogramDataSequence::getSourceRangeRepresentation() { return m_sRole; }
+
+uno::Sequence<OUString>
+ SAL_CALL HistogramDataSequence::generateLabel(css::chart2::data::LabelOrigin)
+{
+ return mxLabels;
+}
+
+sal_Int32 SAL_CALL HistogramDataSequence::getNumberFormatKeyByIndex(sal_Int32)
+{
+ return 0; // TODO - NumberFormat support
+}
+
+// XModifyBroadcaster
+void SAL_CALL
+HistogramDataSequence::addModifyListener(const uno::Reference<util::XModifyListener>& aListener)
+{
+ m_xModifyEventForwarder->addModifyListener(aListener);
+}
+
+void SAL_CALL
+HistogramDataSequence::removeModifyListener(const uno::Reference<util::XModifyListener>& aListener)
+{
+ m_xModifyEventForwarder->removeModifyListener(aListener);
+}
+
+// XCloneable
+
+uno::Reference<util::XCloneable> SAL_CALL HistogramDataSequence::createClone()
+{
+ rtl::Reference<HistogramDataSequence> pClone(new HistogramDataSequence());
+ return pClone;
+}
+
+} // namespace chart2
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index dd48289e831c..a0f5f087d09c 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -22,6 +22,7 @@
#include <strings.hrc>
#include <comphelper/sequence.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#ifdef DEBUG_CHART2_TOOLS
@@ -39,7 +40,6 @@
using ::com::sun::star::uno::Sequence;
using namespace ::com::sun::star;
-using namespace ::std;
namespace chart
{
@@ -48,14 +48,14 @@ namespace
{
struct lcl_NumberedStringGenerator
{
- lcl_NumberedStringGenerator( const OUString & rStub, const OUString & rWildcard ) :
+ lcl_NumberedStringGenerator( const OUString & rStub, std::u16string_view rWildcard ) :
m_aStub( rStub ),
m_nCounter( 0 ),
m_nStubStartIndex( rStub.indexOf( rWildcard )),
- m_nWildcardLength( rWildcard.getLength())
+ m_nWildcardLength( rWildcard.size())
{
}
- vector< uno::Any > operator()()
+ std::vector< uno::Any > operator()()
{
return { uno::Any(m_aStub.replaceAt( m_nStubStartIndex, m_nWildcardLength, OUString::number( ++m_nCounter ))) };
}
@@ -113,12 +113,12 @@ void InternalData::createDefaultData()
m_aRowLabels.clear();
m_aRowLabels.reserve( m_nRowCount );
generate_n( back_inserter( m_aRowLabels ), m_nRowCount,
- lcl_NumberedStringGenerator( aRowName, "%ROWNUMBER" ));
+ lcl_NumberedStringGenerator( aRowName, u"%ROWNUMBER" ));
m_aColumnLabels.clear();
m_aColumnLabels.reserve( m_nColumnCount );
generate_n( back_inserter( m_aColumnLabels ), m_nColumnCount,
- lcl_NumberedStringGenerator( aColName, "%COLUMNNUMBER" ));
+ lcl_NumberedStringGenerator( aColName, u"%COLUMNNUMBER" ));
}
void InternalData::setData( const Sequence< Sequence< double > >& rDataInRows )
@@ -174,35 +174,35 @@ Sequence< double > InternalData::getRowValues( sal_Int32 nRowIndex ) const
return Sequence< double >();
}
-void InternalData::setColumnValues( sal_Int32 nColumnIndex, const vector< double > & rNewData )
+void InternalData::setColumnValues( sal_Int32 nColumnIndex, const std::vector< double > & rNewData )
{
if( nColumnIndex < 0 )
return;
enlargeData( nColumnIndex + 1, rNewData.size() );
tDataType aSlice = m_aData[ std::slice( nColumnIndex, m_nRowCount, m_nColumnCount ) ];
- for( vector< double >::size_type i = 0; i < rNewData.size(); ++i )
+ for( std::vector< double >::size_type i = 0; i < rNewData.size(); ++i )
aSlice[i] = rNewData[i];
m_aData[ std::slice( nColumnIndex, m_nRowCount, m_nColumnCount ) ] = aSlice;
}
-void InternalData::setRowValues( sal_Int32 nRowIndex, const vector< double > & rNewData )
+void InternalData::setRowValues( sal_Int32 nRowIndex, const std::vector< double > & rNewData )
{
if( nRowIndex < 0 )
return;
enlargeData( rNewData.size(), nRowIndex+1 );
tDataType aSlice = m_aData[ std::slice( nRowIndex*m_nColumnCount, m_nColumnCount, 1 ) ];
- for( vector< double >::size_type i = 0; i < rNewData.size(); ++i )
+ for( std::vector< double >::size_type i = 0; i < rNewData.size(); ++i )
aSlice[i] = rNewData[i];
m_aData[ std::slice( nRowIndex*m_nColumnCount, m_nColumnCount, 1 ) ]= aSlice;
}
-void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, vector< uno::Any >&& rComplexLabel )
+void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, std::vector< uno::Any >&& rComplexLabel )
{
if( nColumnIndex < 0 )
return;
- if( nColumnIndex >= static_cast< sal_Int32 >( m_aColumnLabels.size() ) )
+ if( o3tl::make_unsigned(nColumnIndex) >= m_aColumnLabels.size() )
{
m_aColumnLabels.resize(nColumnIndex+1);
enlargeData( nColumnIndex+1, 0 );
@@ -212,19 +212,33 @@ void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, vector< uno::A
dump();
}
-void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, vector< uno::Any >&& rComplexLabel )
+void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, std::vector< uno::Any >&& rComplexLabel )
{
if( nRowIndex < 0 )
return;
- if( nRowIndex >= static_cast< sal_Int32 >( m_aRowLabels.size() ) )
+ if( o3tl::make_unsigned(nRowIndex) >= m_aRowLabels.size() )
{
m_aRowLabels.resize(nRowIndex+1);
enlargeData( 0, nRowIndex+1 );
}
- sal_Int32 nSize = static_cast<sal_Int32>( m_aRowLabels[nRowIndex].size() );
- if( nSize >= 1 && !rComplexLabel.empty() )
+ m_aRowLabels[nRowIndex] = std::move(rComplexLabel);
+
+ dump();
+}
+
+void InternalData::setComplexCategoryLabel(sal_Int32 nRowIndex, std::vector< uno::Any >&& rComplexLabel)
+{
+ if (nRowIndex < 0)
+ return;
+ if (o3tl::make_unsigned(nRowIndex) >= m_aRowLabels.size())
+ {
+ m_aRowLabels.resize(nRowIndex + 1);
+ enlargeData(0, nRowIndex + 1);
+ }
+ sal_Int32 nSize = static_cast<sal_Int32>(m_aRowLabels[nRowIndex].size());
+ if (nSize >= 1 && !rComplexLabel.empty())
{
- m_aRowLabels[nRowIndex].resize(nSize+1);
+ m_aRowLabels[nRowIndex].resize(nSize + 1);
m_aRowLabels[nRowIndex][nSize] = rComplexLabel[0];
}
else
@@ -233,19 +247,19 @@ void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, vector< uno::Any >&&
}
}
-vector< uno::Any > InternalData::getComplexColumnLabel( sal_Int32 nColumnIndex ) const
+std::vector< uno::Any > InternalData::getComplexColumnLabel( sal_Int32 nColumnIndex ) const
{
if( nColumnIndex < static_cast< sal_Int32 >( m_aColumnLabels.size() ) )
return m_aColumnLabels[nColumnIndex];
else
- return vector< uno::Any >();
+ return std::vector< uno::Any >();
}
-vector< uno::Any > InternalData::getComplexRowLabel( sal_Int32 nRowIndex ) const
+std::vector< uno::Any > InternalData::getComplexRowLabel( sal_Int32 nRowIndex ) const
{
if( nRowIndex < static_cast< sal_Int32 >( m_aRowLabels.size() ) )
return m_aRowLabels[nRowIndex];
else
- return vector< uno::Any >();
+ return std::vector< uno::Any >();
}
void InternalData::swapRowWithNext( sal_Int32 nRowIndex )
@@ -258,14 +272,10 @@ void InternalData::swapRowWithNext( sal_Int32 nRowIndex )
{
size_t nIndex1 = nColIdx + nRowIndex*m_nColumnCount;
size_t nIndex2 = nIndex1 + m_nColumnCount;
- double fTemp = m_aData[nIndex1];
- m_aData[nIndex1] = m_aData[nIndex2];
- m_aData[nIndex2] = fTemp;
+ std::swap(m_aData[nIndex1], m_aData[nIndex2]);
}
- vector< uno::Any > aTemp( m_aRowLabels[nRowIndex] );
- m_aRowLabels[nRowIndex] = m_aRowLabels[nRowIndex + 1];
- m_aRowLabels[nRowIndex + 1] = aTemp;
+ std::swap(m_aRowLabels[nRowIndex], m_aRowLabels[nRowIndex + 1]);
}
void InternalData::swapColumnWithNext( sal_Int32 nColumnIndex )
@@ -278,14 +288,10 @@ void InternalData::swapColumnWithNext( sal_Int32 nColumnIndex )
{
size_t nIndex1 = nColumnIndex + nRowIdx*m_nColumnCount;
size_t nIndex2 = nIndex1 + 1;
- double fTemp = m_aData[nIndex1];
- m_aData[nIndex1] = m_aData[nIndex2];
- m_aData[nIndex2] = fTemp;
+ std::swap(m_aData[nIndex1], m_aData[nIndex2]);
}
- vector< uno::Any > aTemp( m_aColumnLabels[nColumnIndex] );
- m_aColumnLabels[nColumnIndex] = m_aColumnLabels[nColumnIndex + 1];
- m_aColumnLabels[nColumnIndex + 1] = aTemp;
+ std::swap(m_aColumnLabels[nColumnIndex], m_aColumnLabels[nColumnIndex + 1]);
}
bool InternalData::enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount )
@@ -305,8 +311,7 @@ bool InternalData::enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount )
aNewData[ std::slice( nCol, m_nRowCount, nNewColumnCount ) ] ) =
m_aData[ std::slice( nCol, m_nRowCount, m_nColumnCount ) ];
- m_aData.resize( nNewSize );
- m_aData = aNewData;
+ m_aData = std::move(aNewData);
}
m_nColumnCount = nNewColumnCount;
m_nRowCount = nNewRowCount;
@@ -336,12 +341,11 @@ void InternalData::insertColumn( sal_Int32 nAfterIndex )
m_aData[ std::slice( nCol - 1, m_nRowCount, m_nColumnCount ) ] );
m_nColumnCount = nNewColumnCount;
- m_aData.resize( nNewSize );
- m_aData = aNewData;
+ m_aData = std::move(aNewData);
// labels
if( nAfterIndex < static_cast< sal_Int32 >( m_aColumnLabels.size()))
- m_aColumnLabels.insert( m_aColumnLabels.begin() + (nAfterIndex + 1), vector< uno::Any >(1) );
+ m_aColumnLabels.insert( m_aColumnLabels.begin() + (nAfterIndex + 1), std::vector< uno::Any >(1) );
dump();
}
@@ -394,12 +398,11 @@ void InternalData::insertRow( sal_Int32 nAfterIndex )
}
m_nRowCount = nNewRowCount;
- m_aData.resize( nNewSize );
- m_aData = aNewData;
+ m_aData = std::move(aNewData);
// labels
if( nAfterIndex < static_cast< sal_Int32 >( m_aRowLabels.size()))
- m_aRowLabels.insert( m_aRowLabels.begin() + nIndex, vector< uno::Any > (1));
+ m_aRowLabels.insert( m_aRowLabels.begin() + nIndex, std::vector< uno::Any > (1));
dump();
}
@@ -426,8 +429,7 @@ void InternalData::deleteColumn( sal_Int32 nAtIndex )
m_aData[ std::slice( nCol + 1, m_nRowCount, m_nColumnCount ) ] );
m_nColumnCount = nNewColumnCount;
- m_aData.resize( nNewSize );
- m_aData = aNewData;
+ m_aData = std::move(aNewData);
// labels
if( nAtIndex < static_cast< sal_Int32 >( m_aColumnLabels.size()))
@@ -462,8 +464,7 @@ void InternalData::deleteRow( sal_Int32 nAtIndex )
}
m_nRowCount = nNewRowCount;
- m_aData.resize( nNewSize );
- m_aData = aNewData;
+ m_aData = std::move(aNewData);
// labels
if( nAtIndex < static_cast< sal_Int32 >( m_aRowLabels.size()))
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index dd70b4617547..f432a430b275 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <cstddef>
#include <iterator>
#include <InternalDataProvider.hxx>
@@ -27,27 +28,25 @@
#include <UncachedDataSequence.hxx>
#include <DataSourceHelper.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <ExplicitCategoriesProvider.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <DataBrowserModel.hxx>
+#include <DataSeries.hxx>
#include <com/sun/star/chart2/data/XDataSequence.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/property.hxx>
-#include <tools/diagnose_ex.h>
+#include <o3tl/string_view.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <limits>
#include <vector>
#include <algorithm>
-namespace com::sun::star::chart2 { class XChartDocument; }
-
using namespace ::com::sun::star;
-using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -58,33 +57,21 @@ namespace chart
namespace
{
-constexpr OUStringLiteral lcl_aCategoriesRangeName = u"categories";
+constexpr OUString lcl_aCategoriesRangeName = u"categories"_ustr;
const char lcl_aCategoriesLevelRangeNamePrefix[] = "categoriesL "; //L <-> level
const char lcl_aCategoriesPointRangeNamePrefix[] = "categoriesP "; //P <-> point
-constexpr OUStringLiteral lcl_aCategoriesRoleName = u"categories";
+constexpr OUString lcl_aCategoriesRoleName = u"categories"_ustr;
const char lcl_aLabelRangePrefix[] = "label ";
-constexpr OUStringLiteral lcl_aCompleteRange = u"all";
+constexpr OUString lcl_aCompleteRange = u"all"_ustr;
typedef std::multimap< OUString, uno::WeakReference< chart2::data::XDataSequence > >
lcl_tSequenceMap;
-std::vector< OUString > lcl_AnyToStringSequence( const std::vector< uno::Any >& aAnySeq )
-{
- std::vector< OUString > aResult;
- aResult.resize( aAnySeq.size() );
- int i = 0;
- for (const uno::Any& aAny : aAnySeq)
- aResult[i++] = CommonFunctors::AnyToString()(aAny);
- return aResult;
-}
-
std::vector< uno::Any > lcl_StringToAnyVector( const css::uno::Sequence< OUString >& aStringSeq )
{
std::vector< uno::Any > aResult;
- aResult.resize( aStringSeq.getLength() );
- int i = 0;
- for (const OUString& aStr : aStringSeq)
- aResult[i++] = CommonFunctors::makeAny<OUString>()(aStr);
+ aResult.reserve(aStringSeq.getLength());
+ std::transform(aStringSeq.begin(), aStringSeq.end(), std::back_inserter(aResult), CommonFunctors::makeAny());
return aResult;
}
@@ -113,17 +100,11 @@ struct lcl_internalizeSeries
m_bConnectToModel( bConnectToModel ),
m_bDataInColumns( bDataInColumns )
{}
- void operator() ( const Reference< chart2::XDataSeries > & xSeries )
+ void operator() ( const rtl::Reference< DataSeries > & xSeries )
{
- Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
- Reference< chart2::data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
- if( !(xSource.is() && xSink.is()) )
- return;
-
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aOldSeriesData = xSource->getDataSequences();
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aNewSeriesData( aOldSeriesData.getLength() );
- auto aNewSeriesDataRange = asNonConstRange(aNewSeriesData);
- for( sal_Int32 i=0; i<aOldSeriesData.getLength(); ++i )
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aOldSeriesData = xSeries->getDataSequences2();
+ std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aNewSeriesData( aOldSeriesData.size() );
+ for( std::size_t i=0; i<aOldSeriesData.size(); ++i )
{
sal_Int32 nNewIndex( m_bDataInColumns ? m_rInternalData.appendColumn() : m_rInternalData.appendRow() );
OUString aIdentifier( OUString::number( nNewIndex ));
@@ -161,17 +142,17 @@ struct lcl_internalizeSeries
comphelper::copyProperties(
Reference< beans::XPropertySet >( xLabel, uno::UNO_QUERY ),
Reference< beans::XPropertySet >( xNewLabel, uno::UNO_QUERY ));
- aNewSeriesDataRange[i].set( new LabeledDataSequence( xNewValues, xNewLabel ) );
+ aNewSeriesData[i].set( new LabeledDataSequence( xNewValues, xNewLabel ) );
}
}
else
{
if( m_bConnectToModel )
- aNewSeriesDataRange[i].set( new LabeledDataSequence( xNewValues ) );
+ aNewSeriesData[i].set( new LabeledDataSequence( xNewValues ) );
}
}
if( m_bConnectToModel )
- xSink->setData( aNewSeriesData );
+ xSeries->setData( aNewSeriesData );
}
private:
@@ -188,7 +169,7 @@ public:
explicit lcl_copyFromLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- uno::Any operator() ( const vector< uno::Any >& rVector )
+ uno::Any operator() ( const std::vector< uno::Any >& rVector )
{
uno::Any aRet;
if( m_nLevel < static_cast< sal_Int32 >(rVector.size()) )
@@ -207,11 +188,11 @@ public:
explicit lcl_getStringFromLevelVector( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- OUString operator() ( const vector< uno::Any >& rVector )
+ OUString operator() ( const std::vector< uno::Any >& rVector )
{
OUString aString;
if( m_nLevel < static_cast< sal_Int32 >(rVector.size()) )
- aString = CommonFunctors::AnyToString()(rVector[m_nLevel]);
+ aString = CommonFunctors::ToString()(rVector[m_nLevel]);
return aString;
}
@@ -226,9 +207,9 @@ public:
explicit lcl_setAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- vector< uno::Any > operator() ( const vector< uno::Any >& rVector, const uno::Any& rNewValue )
+ std::vector< uno::Any > operator() ( const std::vector< uno::Any >& rVector, const uno::Any& rNewValue )
{
- vector< uno::Any > aRet( rVector );
+ std::vector< uno::Any > aRet( rVector );
if( m_nLevel >= static_cast< sal_Int32 >(aRet.size()) )
aRet.resize( m_nLevel+1 );
aRet[ m_nLevel ]=rNewValue;
@@ -246,9 +227,9 @@ public:
explicit lcl_setAnyAtLevelFromStringSequence( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- vector< uno::Any > operator() ( const vector< uno::Any >& rVector, const OUString& rNewValue )
+ std::vector< uno::Any > operator() ( const std::vector< uno::Any >& rVector, const OUString& rNewValue )
{
- vector< uno::Any > aRet( rVector );
+ std::vector< uno::Any > aRet( rVector );
if( m_nLevel >= static_cast< sal_Int32 >(aRet.size()) )
aRet.resize( m_nLevel+1 );
aRet[ m_nLevel ] <<= rNewValue;
@@ -266,7 +247,7 @@ public:
explicit lcl_insertAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- void operator() ( vector< uno::Any >& rVector )
+ void operator() ( std::vector< uno::Any >& rVector )
{
if( m_nLevel >= static_cast< sal_Int32 >(rVector.size()) )
{
@@ -289,7 +270,7 @@ public:
explicit lcl_removeAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- void operator() ( vector< uno::Any >& rVector )
+ void operator() ( std::vector< uno::Any >& rVector )
{
if( m_nLevel < static_cast<sal_Int32>(rVector.size()) )
{
@@ -308,18 +289,19 @@ InternalDataProvider::InternalDataProvider()
{}
InternalDataProvider::InternalDataProvider(
- const Reference< chart2::XChartDocument > & xChartDoc,
+ const rtl::Reference< ChartModel > & xModel,
bool bConnectToModel,
bool bDefaultDataInColumns)
: m_bDataInColumns( bDefaultDataInColumns )
{
+ if (!xModel.is())
+ return;
+ m_xChartModel = xModel.get();
try
{
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartDoc ) );
+ rtl::Reference< Diagram > xDiagram( xModel->getFirstChartDiagram() );
if( xDiagram.is())
{
- Reference< frame::XModel > xChartModel = xChartDoc;
-
//data in columns?
{
OUString aRangeString;
@@ -328,7 +310,7 @@ InternalDataProvider::InternalDataProvider(
uno::Sequence< sal_Int32 > aSequenceMapping;
const bool bSomethingDetected(
DataSourceHelper::detectRangeSegmentation(
- xChartModel, aRangeString, aSequenceMapping, m_bDataInColumns, bFirstCellAsLabel, bHasCategories ));
+ xModel, aRangeString, aSequenceMapping, m_bDataInColumns, bFirstCellAsLabel, bHasCategories ));
// #i120559# if no data was available, restore default
if(!bSomethingDetected && m_bDataInColumns != bDefaultDataInColumns)
@@ -339,16 +321,15 @@ InternalDataProvider::InternalDataProvider(
// categories
{
- vector< vector< uno::Any > > aNewCategories;//inner count is level
+ std::vector< std::vector< uno::Any > > aNewCategories;//inner count is level
{
- ChartModel& rModel = dynamic_cast<ChartModel&>(*xChartModel);
- ExplicitCategoriesProvider aExplicitCategoriesProvider(ChartModelHelper::getFirstCoordinateSystem(xChartModel), rModel);
+ ExplicitCategoriesProvider aExplicitCategoriesProvider(xModel->getFirstCoordinateSystem(), *xModel);
- const Sequence< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList( aExplicitCategoriesProvider.getSplitCategoriesList() );
- sal_Int32 nLevelCount = rSplitCategoriesList.getLength();
+ const std::vector< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList( aExplicitCategoriesProvider.getSplitCategoriesList() );
+ sal_Int32 nLevelCount = rSplitCategoriesList.size();
for( sal_Int32 nL = 0; nL<nLevelCount; nL++ )
{
- Reference< chart2::data::XLabeledDataSequence > xLDS( rSplitCategoriesList[nL] );
+ const Reference< chart2::data::XLabeledDataSequence >& xLDS( rSplitCategoriesList[nL] );
if( !xLDS.is() )
continue;
Sequence< uno::Any > aDataSeq;
@@ -361,7 +342,7 @@ InternalDataProvider::InternalDataProvider(
aNewCategories.resize( nLength );
else if( nLength < nCatLength )
aDataSeq.realloc( nCatLength );
- transform( aNewCategories.begin(), aNewCategories.end(), aDataSeq.getConstArray(),
+ transform( aNewCategories.begin(), aNewCategories.end(), aDataSeq.begin(),
aNewCategories.begin(), lcl_setAnyAtLevel(nL) );
}
if( !nLevelCount )
@@ -381,12 +362,14 @@ InternalDataProvider::InternalDataProvider(
else
m_aInternalData.setComplexColumnLabels( std::move(aNewCategories) );
if( bConnectToModel )
- DiagramHelper::setCategoriesToDiagram( new LabeledDataSequence(
- createDataSequenceByRangeRepresentation( lcl_aCategoriesRangeName )), xDiagram );
+ xDiagram->setCategories(
+ new LabeledDataSequence(
+ createDataSequenceByRangeRepresentation( lcl_aCategoriesRangeName ))
+ );
}
// data series
- std::vector< Reference< chart2::XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( xChartDoc ));
+ std::vector< rtl::Reference< DataSeries > > aSeriesVector( xModel->getDataSeries());
lcl_internalizeSeries ftor( m_aInternalData, *this, bConnectToModel, m_bDataInColumns );
for( const auto& rxScreen : aSeriesVector )
ftor( rxScreen );
@@ -409,6 +392,11 @@ InternalDataProvider::InternalDataProvider( const InternalDataProvider & rOther
InternalDataProvider::~InternalDataProvider()
{}
+void InternalDataProvider::setChartModel(ChartModel* pChartModel)
+{
+ m_xChartModel = pChartModel;
+}
+
void InternalDataProvider::addDataSequenceToMap(
const OUString & rRangeRepresentation,
const Reference< chart2::data::XDataSequence > & xSequence )
@@ -571,7 +559,8 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, st
}
if (rRole == u"values-y" || rRole == u"values-first" || rRole == u"values-last" ||
- rRole == u"values-min" || rRole == u"values-max" || rRole == u"values-size")
+ rRole == u"values-min" || rRole == u"values-max" || rRole == u"values-size" ||
+ rRole == u"error-bars-y-positive" || rRole == u"error-bars-y-negative")
{
// Column values. Append a new data column and populate it.
@@ -636,7 +625,7 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, st
}
std::vector<uno::Any> aLabels(1,
bStoreNumeric ? uno::Any(fValue) : uno::Any(aRawElems[i]));
- m_aInternalData.setComplexRowLabel(i, std::move(aLabels));
+ m_aInternalData.setComplexCategoryLabel(i, std::move(aLabels));
}
xSeq.set(new UncachedDataSequence(this, lcl_aCategoriesRangeName));
@@ -649,8 +638,12 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, st
sal_Int32 nColSize = m_aInternalData.getColumnCount();
if (!aRawElems.empty() && nColSize)
{
- std::vector<uno::Any> aLabels(1, uno::Any(aRawElems[0]));
- m_aInternalData.setComplexColumnLabel(nColSize-1, std::move(aLabels));
+ // Do not overwrite an existing label (attempted by series with no data values)
+ if (!m_aInternalData.getComplexColumnLabel(nColSize-1)[0].hasValue())
+ {
+ std::vector<uno::Any> aLabels(1, uno::Any(aRawElems[0]));
+ m_aInternalData.setComplexColumnLabel(nColSize-1, std::move(aLabels));
+ }
OUString aRangeRep = lcl_aLabelRangePrefix + OUString::number(nColSize-1);
xSeq.set(new UncachedDataSequence(this, aRangeRep));
@@ -680,7 +673,7 @@ sal_Bool SAL_CALL InternalDataProvider::createDataSourcePossible( const Sequence
namespace
{
-sal_Int32 lcl_getInnerLevelCount( const vector< vector< uno::Any > >& rLabels )
+sal_Int32 lcl_getInnerLevelCount( const std::vector< std::vector< uno::Any > >& rLabels )
{
sal_Int32 nCount = 1;//minimum is 1!
for (auto const& elemLabel : rLabels)
@@ -706,7 +699,7 @@ Reference< chart2::data::XDataSource > SAL_CALL InternalDataProvider::createData
{
//return split complex categories if we have any:
std::vector< Reference< chart2::data::XLabeledDataSequence > > aComplexCategories;
- vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ const std::vector< std::vector< uno::Any > > & aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
if( bUseColumns==m_bDataInColumns )
{
sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
@@ -785,19 +778,19 @@ Sequence< beans::PropertyValue > SAL_CALL InternalDataProvider::detectArguments(
{
Sequence< beans::PropertyValue > aArguments{
beans::PropertyValue(
- "CellRangeRepresentation", -1, uno::Any( OUString(lcl_aCompleteRange) ),
+ u"CellRangeRepresentation"_ustr, -1, uno::Any( lcl_aCompleteRange ),
beans::PropertyState_DIRECT_VALUE ),
beans::PropertyValue(
- "DataRowSource", -1, uno::Any(
+ u"DataRowSource"_ustr, -1, uno::Any(
m_bDataInColumns
? css::chart::ChartDataRowSource_COLUMNS
: css::chart::ChartDataRowSource_ROWS ),
beans::PropertyState_DIRECT_VALUE ),
// internal data always contains labels and categories
beans::PropertyValue(
- "FirstCellAsLabel", -1, uno::Any( true ), beans::PropertyState_DIRECT_VALUE ),
+ u"FirstCellAsLabel"_ustr, -1, uno::Any( true ), beans::PropertyState_DIRECT_VALUE ),
beans::PropertyValue(
- "HasCategories", -1, uno::Any( true ), beans::PropertyState_DIRECT_VALUE )
+ u"HasCategories"_ustr, -1, uno::Any( true ), beans::PropertyState_DIRECT_VALUE )
};
// #i85913# Sequence Mapping is not needed for internal data, as it is
// applied to the data when the data source is created.
@@ -823,7 +816,7 @@ Reference< chart2::data::XDataSequence > SAL_CALL InternalDataProvider::createDa
else if( aRangeRepresentation.match( lcl_aLabelRangePrefix ))
{
// label
- sal_Int32 nIndex = aRangeRepresentation.copy( strlen(lcl_aLabelRangePrefix)).toInt32();
+ sal_Int32 nIndex = o3tl::toInt32(aRangeRepresentation.subView( strlen(lcl_aLabelRangePrefix)));
return createDataSequenceAndAddToMap( lcl_aLabelRangePrefix + OUString::number( nIndex ));
}
else if ( aRangeRepresentation == "last" )
@@ -867,7 +860,7 @@ sal_Bool SAL_CALL InternalDataProvider::hasDataByRangeRepresentation( const OUSt
}
else if( aRange.match( lcl_aLabelRangePrefix ))
{
- sal_Int32 nIndex = aRange.copy( strlen(lcl_aLabelRangePrefix)).toInt32();
+ sal_Int32 nIndex = o3tl::toInt32(aRange.subView( strlen(lcl_aLabelRangePrefix)));
bResult = (nIndex < (m_bDataInColumns ? m_aInternalData.getColumnCount(): m_aInternalData.getRowCount()));
}
else
@@ -885,8 +878,8 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
if( aRange.match( lcl_aLabelRangePrefix ) )
{
- auto nIndex = aRange.copy( strlen(lcl_aLabelRangePrefix)).toUInt32();
- vector< uno::Any > aComplexLabel = m_bDataInColumns
+ auto nIndex = o3tl::toUInt32(aRange.subView( strlen(lcl_aLabelRangePrefix)));
+ std::vector< uno::Any > aComplexLabel = m_bDataInColumns
? m_aInternalData.getComplexColumnLabel( nIndex )
: m_aInternalData.getComplexRowLabel( nIndex );
if( !aComplexLabel.empty() )
@@ -894,8 +887,8 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
}
else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) )
{
- auto nPointIndex = aRange.copy( strlen(lcl_aCategoriesPointRangeNamePrefix) ).toUInt32();
- vector< uno::Any > aComplexCategory = m_bDataInColumns
+ auto nPointIndex = o3tl::toUInt32(aRange.subView( strlen(lcl_aCategoriesPointRangeNamePrefix) ));
+ std::vector< uno::Any > aComplexCategory = m_bDataInColumns
? m_aInternalData.getComplexRowLabel( nPointIndex )
: m_aInternalData.getComplexColumnLabel( nPointIndex );
if( !aComplexCategory.empty() )
@@ -903,18 +896,14 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
}
else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) )
{
- sal_Int32 nLevel = aRange.copy( strlen(lcl_aCategoriesLevelRangeNamePrefix) ).toInt32();
- vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ sal_Int32 nLevel = o3tl::toInt32(aRange.subView( strlen(lcl_aCategoriesLevelRangeNamePrefix) ));
+ const std::vector< std::vector< uno::Any > > & aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
if( nLevel < lcl_getInnerLevelCount( aCategories ) )
- {
- aResult.realloc( aCategories.size() );
- transform( aCategories.begin(), aCategories.end(),
- aResult.getArray(), lcl_copyFromLevel(nLevel) );
- }
+ aResult = CommonFunctors::convertToSequence(aCategories, lcl_copyFromLevel(nLevel));
}
else if( aRange == lcl_aCategoriesRangeName )
{
- vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ const std::vector< std::vector< uno::Any > > & aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
if( nLevelCount == 1 )
{
@@ -924,9 +913,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
{
// Maybe this 'else' part and the functions is not necessary anymore.
const Sequence< OUString > aLabels = m_bDataInColumns ? getRowDescriptions() : getColumnDescriptions();
- aResult.realloc( aLabels.getLength() );
- transform( aLabels.begin(), aLabels.end(),
- aResult.getArray(), CommonFunctors::makeAny< OUString >() );
+ aResult = CommonFunctors::convertToSequence(aLabels, CommonFunctors::makeAny());
}
}
else
@@ -938,11 +925,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
? m_aInternalData.getColumnValues(nIndex)
: m_aInternalData.getRowValues(nIndex);
if( aData.hasElements() )
- {
- aResult.realloc( aData.getLength());
- transform( aData.begin(), aData.end(),
- aResult.getArray(), CommonFunctors::makeAny< double >());
- }
+ aResult = CommonFunctors::convertToSequence(aData, CommonFunctors::makeAny());
}
}
@@ -952,10 +935,10 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
const OUString& aRange, const Sequence< uno::Any >& aNewData )
{
- auto aNewVector( comphelper::sequenceToContainer<vector< uno::Any >>(aNewData) );
+ auto aNewVector( comphelper::sequenceToContainer<std::vector< uno::Any >>(aNewData) );
if( aRange.match( lcl_aLabelRangePrefix ) )
{
- sal_uInt32 nIndex = aRange.copy( strlen(lcl_aLabelRangePrefix)).toInt32();
+ sal_uInt32 nIndex = o3tl::toInt32(aRange.subView( strlen(lcl_aLabelRangePrefix)));
if( m_bDataInColumns )
m_aInternalData.setComplexColumnLabel( nIndex, std::move(aNewVector) );
else
@@ -963,7 +946,7 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
}
else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) )
{
- sal_Int32 nPointIndex = aRange.copy( strlen(lcl_aCategoriesLevelRangeNamePrefix)).toInt32();
+ sal_Int32 nPointIndex = o3tl::toInt32(aRange.subView( strlen(lcl_aCategoriesLevelRangeNamePrefix)));
if( m_bDataInColumns )
m_aInternalData.setComplexRowLabel( nPointIndex, std::move(aNewVector) );
else
@@ -971,8 +954,8 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
}
else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) )
{
- sal_Int32 nLevel = aRange.copy( strlen(lcl_aCategoriesLevelRangeNamePrefix)).toInt32();
- vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
+ sal_Int32 nLevel = o3tl::toInt32(aRange.subView( strlen(lcl_aCategoriesLevelRangeNamePrefix)));
+ std::vector< std::vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
//ensure equal length
if( aNewVector.size() > aComplexCategories.size() )
@@ -990,7 +973,7 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
}
else if( aRange == lcl_aCategoriesRangeName )
{
- vector< vector< uno::Any > > aComplexCategories;
+ std::vector< std::vector< uno::Any > > aComplexCategories;
aComplexCategories.resize( aNewVector.size() );
transform( aComplexCategories.begin(), aComplexCategories.end(), aNewVector.begin(),
aComplexCategories.begin(), lcl_setAnyAtLevel(0) );
@@ -1004,9 +987,10 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
sal_Int32 nIndex = aRange.toInt32();
if( nIndex>=0 )
{
- vector< double > aNewDataVec;
+ std::vector< double > aNewDataVec;
+ aNewDataVec.reserve(aNewData.getLength());
transform( aNewData.begin(), aNewData.end(),
- back_inserter( aNewDataVec ), CommonFunctors::AnyToDouble());
+ back_inserter( aNewDataVec ), CommonFunctors::ToDouble());
if( m_bDataInColumns )
m_aInternalData.setColumnValues( nIndex, aNewDataVec );
else
@@ -1058,7 +1042,7 @@ void SAL_CALL InternalDataProvider::insertComplexCategoryLevel( sal_Int32 nLevel
OSL_ENSURE( nLevel> 0, "you can only insert category levels > 0" );//the first categories level cannot be deleted, check the calling code for error
if( nLevel>0 )
{
- vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
+ std::vector< std::vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_insertAnyAtLevel(nLevel) );
if( m_bDataInColumns )
m_aInternalData.setComplexRowLabels( std::move(aComplexCategories) );
@@ -1074,7 +1058,7 @@ void SAL_CALL InternalDataProvider::deleteComplexCategoryLevel( sal_Int32 nLevel
OSL_ENSURE( nLevel>0, "you can only delete category levels > 0" );//the first categories level cannot be deleted, check the calling code for error
if( nLevel>0 )
{
- vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
+ std::vector< std::vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_removeAnyAtLevel(nLevel) );
if( m_bDataInColumns )
m_aInternalData.setComplexRowLabels( std::move(aComplexCategories) );
@@ -1101,7 +1085,7 @@ void SAL_CALL InternalDataProvider::insertDataPointForAllSequences( ::sal_Int32
}
// notify change to all affected ranges
- tSequenceMap::const_iterator aBegin( m_aSequenceMap.lower_bound( "0"));
+ tSequenceMap::const_iterator aBegin( m_aSequenceMap.lower_bound( u"0"_ustr));
tSequenceMap::const_iterator aEnd( m_aSequenceMap.upper_bound( OUString::number( nMaxRep )));
std::for_each( aBegin, aEnd, lcl_setModified());
@@ -1124,7 +1108,7 @@ void SAL_CALL InternalDataProvider::deleteDataPointForAllSequences( ::sal_Int32
}
// notify change to all affected ranges
- tSequenceMap::const_iterator aBegin( m_aSequenceMap.lower_bound( "0"));
+ tSequenceMap::const_iterator aBegin( m_aSequenceMap.lower_bound( u"0"_ustr));
tSequenceMap::const_iterator aEnd( m_aSequenceMap.upper_bound( OUString::number( nMaxRep )));
std::for_each( aBegin, aEnd, lcl_setModified());
@@ -1143,7 +1127,7 @@ void SAL_CALL InternalDataProvider::swapDataPointWithNextOneForAllSequences( ::s
: m_aInternalData.getRowCount());
// notify change to all affected ranges
- tSequenceMap::const_iterator aBegin( m_aSequenceMap.lower_bound( "0"));
+ tSequenceMap::const_iterator aBegin( m_aSequenceMap.lower_bound( u"0"_ustr));
tSequenceMap::const_iterator aEnd( m_aSequenceMap.upper_bound( OUString::number( nMaxRep )));
std::for_each( aBegin, aEnd, lcl_setModified());
@@ -1157,6 +1141,13 @@ void SAL_CALL InternalDataProvider::registerDataSequenceForChanges( const Refere
addDataSequenceToMap( xSeq->getSourceRangeRepresentation(), xSeq );
}
+void SAL_CALL InternalDataProvider::insertDataSeries(::sal_Int32 nAfterIndex)
+{
+ // call the dialog insertion
+ DataBrowserModel aDBM(m_xChartModel);
+ aDBM.insertDataSeries(nAfterIndex);
+}
+
// ____ XRangeXMLConversion ____
OUString SAL_CALL InternalDataProvider::convertRangeToXML( const OUString& aRangeRepresentation )
{
@@ -1188,7 +1179,7 @@ OUString SAL_CALL InternalDataProvider::convertRangeToXML( const OUString& aRang
}
else if( aRangeRepresentation.match( lcl_aLabelRangePrefix ))
{
- sal_Int32 nIndex = aRangeRepresentation.copy( strlen(lcl_aLabelRangePrefix)).toInt32();
+ sal_Int32 nIndex = o3tl::toInt32(aRangeRepresentation.subView( strlen(lcl_aLabelRangePrefix)));
aRange.aUpperLeft.bIsEmpty = false;
aRange.aLowerRight.bIsEmpty = true;
if( m_bDataInColumns )
@@ -1240,10 +1231,10 @@ OUString SAL_CALL InternalDataProvider::convertRangeFromXML( const OUString& aXM
// <https://bugs.documentfoundation.org/show_bug.cgi?id=112783> "PIVOT CHARTS: Save produces
// invalid file because of invalid cell address":
if (aXMLRange == "PivotChart") {
- return "";
+ return u""_ustr;
}
- static const OUStringLiteral aPivotTableID(u"PT@");
+ static constexpr OUString aPivotTableID(u"PT@"_ustr);
if (aXMLRange.startsWith(aPivotTableID))
return aXMLRange.copy(aPivotTableID.getLength());
@@ -1289,54 +1280,35 @@ namespace
{
template< class Type >
-Sequence< Sequence< Type > > lcl_convertVectorVectorToSequenceSequence( const vector< vector< Type > >& rIn )
+Sequence< Sequence< Type > > lcl_convertVectorVectorToSequenceSequence( const std::vector< std::vector< Type > >& rIn )
{
- Sequence< Sequence< Type > > aRet;
- sal_Int32 nOuterCount = rIn.size();
- if( nOuterCount )
- {
- aRet.realloc(nOuterCount);
- auto pRet = aRet.getArray();
- for( sal_Int32 nN=0; nN<nOuterCount; nN++)
- pRet[nN]= comphelper::containerToSequence( rIn[nN] );
- }
- return aRet;
+ return CommonFunctors::convertToSequence(rIn, [](auto& v)
+ { return comphelper::containerToSequence(v); });
}
template< class Type >
-vector< vector< Type > > lcl_convertSequenceSequenceToVectorVector( const Sequence< Sequence< Type > >& rIn )
+std::vector< std::vector< Type > > lcl_convertSequenceSequenceToVectorVector( const Sequence< Sequence< Type > >& rIn )
{
- vector< vector< Type > > aRet;
- sal_Int32 nOuterCount = rIn.getLength();
- if( nOuterCount )
- {
- aRet.resize(nOuterCount);
- for( sal_Int32 nN=0; nN<nOuterCount; nN++)
- aRet[nN]= comphelper::sequenceToContainer<vector< Type >>( rIn[nN] );
- }
+ std::vector< std::vector< Type > > aRet;
+ aRet.reserve(rIn.getLength());
+ std::transform(rIn.begin(), rIn.end(), std::back_inserter(aRet),
+ [](auto& s) { return comphelper::sequenceToContainer<std::vector<Type>>(s); });
return aRet;
}
-std::vector< Sequence< OUString > > lcl_convertComplexAnyVectorToStringSequence( const vector< vector< uno::Any > >& rIn )
+Sequence< Sequence< OUString > > lcl_convertComplexAnyVectorToStringSequence( const std::vector< std::vector< uno::Any > >& rIn )
{
- std::vector< Sequence< OUString > > aRet;
- sal_Int32 nOuterCount = rIn.size();
- if( nOuterCount )
- {
- aRet.resize(nOuterCount);
- for( sal_Int32 nN=0; nN<nOuterCount; nN++)
- aRet[nN] = comphelper::containerToSequence(lcl_AnyToStringSequence( rIn[nN] ));
- }
- return aRet;
+ return CommonFunctors::convertToSequence(
+ rIn,
+ [](auto& v) { return CommonFunctors::convertToSequence(v, CommonFunctors::ToString()); });
}
-vector< vector< uno::Any > > lcl_convertComplexStringSequenceToAnyVector( const Sequence< Sequence< OUString > >& rIn )
+std::vector< std::vector< uno::Any > > lcl_convertComplexStringSequenceToAnyVector( const Sequence< Sequence< OUString > >& rIn )
{
- vector< vector< uno::Any > > aRet;
- sal_Int32 nOuterCount = rIn.getLength();
- aRet.reserve(nOuterCount);
- for (sal_Int32 nN = 0; nN < nOuterCount; nN++)
- aRet.push_back( lcl_StringToAnyVector( rIn[nN] ) );
+ std::vector< std::vector< uno::Any > > aRet;
+ aRet.reserve(rIn.getLength());
+ std::transform(rIn.begin(), rIn.end(), std::back_inserter(aRet),
+ [](auto& s) { return lcl_StringToAnyVector(s); });
return aRet;
}
@@ -1361,14 +1333,9 @@ sal_Int32 SplitCategoriesProvider_ForComplexDescriptions::getLevelCount() const
}
uno::Sequence< OUString > SplitCategoriesProvider_ForComplexDescriptions::getStringsForLevel( sal_Int32 nLevel ) const
{
- uno::Sequence< OUString > aResult;
if( nLevel < lcl_getInnerLevelCount( m_rComplexDescriptions ) )
- {
- aResult.realloc( m_rComplexDescriptions.size() );
- transform( m_rComplexDescriptions.begin(), m_rComplexDescriptions.end(),
- aResult.getArray(), lcl_getStringFromLevelVector(nLevel) );
- }
- return aResult;
+ return CommonFunctors::convertToSequence(m_rComplexDescriptions, lcl_getStringFromLevelVector(nLevel));
+ return {};
}
}//anonymous namespace
@@ -1376,7 +1343,7 @@ uno::Sequence< OUString > SplitCategoriesProvider_ForComplexDescriptions::getStr
// ____ XDateCategories ____
Sequence< double > SAL_CALL InternalDataProvider::getDateCategories()
{
- vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ const std::vector< std::vector< uno::Any > > & aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
sal_Int32 nCount = aCategories.size();
Sequence< double > aDoubles( nCount );
auto aDoublesRange = asNonConstRange(aDoubles);
@@ -1394,9 +1361,9 @@ Sequence< double > SAL_CALL InternalDataProvider::getDateCategories()
void SAL_CALL InternalDataProvider::setDateCategories( const Sequence< double >& rDates )
{
sal_Int32 nCount = rDates.getLength();
- vector< vector< uno::Any > > aNewCategories;
+ std::vector< std::vector< uno::Any > > aNewCategories;
aNewCategories.reserve(nCount);
- vector< uno::Any > aSingleLabel(1);
+ std::vector< uno::Any > aSingleLabel(1);
for(sal_Int32 nN=0; nN<nCount; ++nN )
{
@@ -1431,7 +1398,7 @@ void SAL_CALL InternalDataProvider::setAnyColumnDescriptions( const Sequence< Se
// ____ XComplexDescriptionAccess ____
Sequence< Sequence< OUString > > SAL_CALL InternalDataProvider::getComplexRowDescriptions()
{
- return comphelper::containerToSequence(lcl_convertComplexAnyVectorToStringSequence( m_aInternalData.getComplexRowLabels() ));
+ return lcl_convertComplexAnyVectorToStringSequence( m_aInternalData.getComplexRowLabels() );
}
void SAL_CALL InternalDataProvider::setComplexRowDescriptions( const Sequence< Sequence< OUString > >& aRowDescriptions )
{
@@ -1439,7 +1406,7 @@ void SAL_CALL InternalDataProvider::setComplexRowDescriptions( const Sequence< S
}
Sequence< Sequence< OUString > > SAL_CALL InternalDataProvider::getComplexColumnDescriptions()
{
- return comphelper::containerToSequence(lcl_convertComplexAnyVectorToStringSequence( m_aInternalData.getComplexColumnLabels() ));
+ return lcl_convertComplexAnyVectorToStringSequence( m_aInternalData.getComplexColumnLabels() );
}
void SAL_CALL InternalDataProvider::setComplexColumnDescriptions( const Sequence< Sequence< OUString > >& aColumnDescriptions )
{
@@ -1459,30 +1426,30 @@ void SAL_CALL InternalDataProvider::setData( const Sequence< Sequence< double >
void SAL_CALL InternalDataProvider::setRowDescriptions( const Sequence< OUString >& aRowDescriptions )
{
- vector< vector< uno::Any > > aComplexDescriptions( aRowDescriptions.getLength() );
- transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aRowDescriptions.getConstArray(),
+ std::vector< std::vector< uno::Any > > aComplexDescriptions( aRowDescriptions.getLength() );
+ transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aRowDescriptions.begin(),
aComplexDescriptions.begin(), lcl_setAnyAtLevelFromStringSequence(0) );
m_aInternalData.setComplexRowLabels( std::move(aComplexDescriptions) );
}
void SAL_CALL InternalDataProvider::setColumnDescriptions( const Sequence< OUString >& aColumnDescriptions )
{
- vector< vector< uno::Any > > aComplexDescriptions( aColumnDescriptions.getLength() );
- transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aColumnDescriptions.getConstArray(),
+ std::vector< std::vector< uno::Any > > aComplexDescriptions( aColumnDescriptions.getLength() );
+ transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aColumnDescriptions.begin(),
aComplexDescriptions.begin(), lcl_setAnyAtLevelFromStringSequence(0) );
m_aInternalData.setComplexColumnLabels( std::move(aComplexDescriptions) );
}
Sequence< OUString > SAL_CALL InternalDataProvider::getRowDescriptions()
{
- vector< vector< uno::Any > > aComplexLabels( m_aInternalData.getComplexRowLabels() );
+ const std::vector< std::vector< uno::Any > > & aComplexLabels( m_aInternalData.getComplexRowLabels() );
SplitCategoriesProvider_ForComplexDescriptions aProvider( aComplexLabels );
return ExplicitCategoriesProvider::getExplicitSimpleCategories( aProvider );
}
Sequence< OUString > SAL_CALL InternalDataProvider::getColumnDescriptions()
{
- vector< vector< uno::Any > > aComplexLabels( m_aInternalData.getComplexColumnLabels() );
+ const std::vector< std::vector< uno::Any > > & aComplexLabels( m_aInternalData.getComplexColumnLabels() );
SplitCategoriesProvider_ForComplexDescriptions aProvider( aComplexLabels );
return ExplicitCategoriesProvider::getExplicitSimpleCategories( aProvider );
}
@@ -1512,7 +1479,7 @@ sal_Bool SAL_CALL InternalDataProvider::isNotANumber( double nNumber )
void SAL_CALL InternalDataProvider::initialize(const uno::Sequence< uno::Any > & _aArguments)
{
comphelper::SequenceAsHashMap aArgs(_aArguments);
- if ( aArgs.getUnpackedValueOrDefault( "CreateDefaultData", false ) )
+ if ( aArgs.getUnpackedValueOrDefault( u"CreateDefaultData"_ustr, false ) )
m_aInternalData.createDefaultData();
}
@@ -1525,7 +1492,7 @@ Reference< util::XCloneable > SAL_CALL InternalDataProvider::createClone()
OUString SAL_CALL InternalDataProvider::getImplementationName()
{
// note: in xmloff this name is used to indicate usage of own data
- return "com.sun.star.comp.chart.InternalDataProvider";
+ return u"com.sun.star.comp.chart.InternalDataProvider"_ustr;
}
sal_Bool SAL_CALL InternalDataProvider::supportsService( const OUString& rServiceName )
@@ -1535,7 +1502,7 @@ sal_Bool SAL_CALL InternalDataProvider::supportsService( const OUString& rServic
css::uno::Sequence< OUString > SAL_CALL InternalDataProvider::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.data.DataProvider" };
+ return { u"com.sun.star.chart2.data.DataProvider"_ustr };
}
} // namespace chart
diff --git a/chart2/source/tools/LabeledDataSequence.cxx b/chart2/source/tools/LabeledDataSequence.cxx
index 93680f4bbace..181c639625ec 100644
--- a/chart2/source/tools/LabeledDataSequence.cxx
+++ b/chart2/source/tools/LabeledDataSequence.cxx
@@ -20,7 +20,7 @@
#include <LabeledDataSequence.hxx>
#include <ModifyListenerHelper.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
namespace com::sun::star::uno { class XComponentContext; }
@@ -37,24 +37,46 @@ LabeledDataSequence::LabeledDataSequence() :
{}
LabeledDataSequence::LabeledDataSequence(
- const uno::Reference< chart2::data::XDataSequence > & rValues ) :
- m_xData( rValues ),
+ uno::Reference< chart2::data::XDataSequence > xValues ) :
+ m_xData(std::move( xValues )),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder );
}
LabeledDataSequence::LabeledDataSequence(
- const uno::Reference< chart2::data::XDataSequence > & rValues,
- const uno::Reference< chart2::data::XDataSequence > & rLabel ) :
- m_xData( rValues ),
- m_xLabel( rLabel ),
+ uno::Reference< chart2::data::XDataSequence > xValues,
+ uno::Reference< chart2::data::XDataSequence > xLabel ) :
+ m_xData(std::move( xValues )),
+ m_xLabel(std::move( xLabel )),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder );
ModifyListenerHelper::addListener( m_xLabel, m_xModifyEventForwarder );
}
+LabeledDataSequence::LabeledDataSequence( const LabeledDataSequence& rSource ) :
+ impl::LabeledDataSequence_Base(),
+ m_xModifyEventForwarder( new ModifyEventForwarder() )
+{
+ uno::Reference< chart2::data::XDataSequence > xNewValues( rSource.m_xData );
+ uno::Reference< chart2::data::XDataSequence > xNewLabel( rSource.m_xLabel );
+
+ uno::Reference< util::XCloneable > xLabelCloneable( rSource.m_xLabel, uno::UNO_QUERY );
+ if( xLabelCloneable.is())
+ xNewLabel.set( xLabelCloneable->createClone(), uno::UNO_QUERY );
+
+ uno::Reference< util::XCloneable > xValuesCloneable( rSource.m_xData, uno::UNO_QUERY );
+ if( xValuesCloneable.is())
+ xNewValues.set( xValuesCloneable->createClone(), uno::UNO_QUERY );
+
+ m_xData = std::move(xNewValues);
+ m_xLabel = std::move(xNewLabel);
+
+ ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder );
+ ModifyListenerHelper::addListener( m_xLabel, m_xModifyEventForwarder );
+}
+
LabeledDataSequence::~LabeledDataSequence()
{
if( m_xModifyEventForwarder.is())
@@ -130,7 +152,7 @@ void SAL_CALL LabeledDataSequence::removeModifyListener( const Reference< util::
OUString SAL_CALL LabeledDataSequence::getImplementationName()
{
- return "com.sun.star.comp.chart2.LabeledDataSequence";
+ return u"com.sun.star.comp.chart2.LabeledDataSequence"_ustr;
}
sal_Bool SAL_CALL LabeledDataSequence::supportsService( const OUString& rServiceName )
@@ -140,7 +162,7 @@ sal_Bool SAL_CALL LabeledDataSequence::supportsService( const OUString& rService
css::uno::Sequence< OUString > SAL_CALL LabeledDataSequence::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.data.LabeledDataSequence" };
+ return { u"com.sun.star.chart2.data.LabeledDataSequence"_ustr };
}
} // namespace chart
diff --git a/chart2/source/tools/LegendHelper.cxx b/chart2/source/tools/LegendHelper.cxx
index 6fbd6bf63143..05609541d4ef 100644
--- a/chart2/source/tools/LegendHelper.cxx
+++ b/chart2/source/tools/LegendHelper.cxx
@@ -18,12 +18,14 @@
*/
#include <LegendHelper.hxx>
+#include <Legend.hxx>
#include <ChartModel.hxx>
+#include <Diagram.hxx>
#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -31,31 +33,30 @@ using ::com::sun::star::uno::Reference;
namespace chart
{
-Reference< chart2::XLegend > LegendHelper::showLegend( ChartModel& rModel
+rtl::Reference< Legend > LegendHelper::showLegend( ChartModel& rModel
, const uno::Reference< uno::XComponentContext >& xContext )
{
- uno::Reference< chart2::XLegend > xLegend = LegendHelper::getLegend( rModel, xContext, true );
- uno::Reference< beans::XPropertySet > xProp( xLegend, uno::UNO_QUERY );
- if( xProp.is())
+ rtl::Reference< Legend > xLegend = LegendHelper::getLegend( rModel, xContext, true );
+ if( xLegend.is())
{
- xProp->setPropertyValue( "Show", uno::Any(true) );
+ xLegend->setPropertyValue( u"Show"_ustr, uno::Any(true) );
chart2::RelativePosition aRelativePosition;
- if( !(xProp->getPropertyValue( "RelativePosition") >>= aRelativePosition) )
+ if( !(xLegend->getPropertyValue( u"RelativePosition"_ustr) >>= aRelativePosition) )
{
chart2::LegendPosition ePos = chart2::LegendPosition_LINE_END;
- if( !(xProp->getPropertyValue( "AnchorPosition") >>= ePos ) )
- xProp->setPropertyValue( "AnchorPosition", uno::Any( ePos ));
+ if( !(xLegend->getPropertyValue( u"AnchorPosition"_ustr) >>= ePos ) )
+ xLegend->setPropertyValue( u"AnchorPosition"_ustr, uno::Any( ePos ));
css::chart::ChartLegendExpansion eExpansion =
( ePos == chart2::LegendPosition_LINE_END ||
ePos == chart2::LegendPosition_LINE_START )
? css::chart::ChartLegendExpansion_HIGH
: css::chart::ChartLegendExpansion_WIDE;
- if( !(xProp->getPropertyValue( "Expansion") >>= eExpansion ) )
- xProp->setPropertyValue( "Expansion", uno::Any( eExpansion ));
+ if( !(xLegend->getPropertyValue( u"Expansion"_ustr) >>= eExpansion ) )
+ xLegend->setPropertyValue( u"Expansion"_ustr, uno::Any( eExpansion ));
- xProp->setPropertyValue( "RelativePosition", uno::Any());
+ xLegend->setPropertyValue( u"RelativePosition"_ustr, uno::Any());
}
}
@@ -64,31 +65,29 @@ Reference< chart2::XLegend > LegendHelper::showLegend( ChartModel& rModel
void LegendHelper::hideLegend( ChartModel& rModel )
{
- uno::Reference< chart2::XLegend > xLegend = LegendHelper::getLegend( rModel, nullptr );
- uno::Reference< beans::XPropertySet > xProp( xLegend, uno::UNO_QUERY );
- if( xProp.is())
+ rtl::Reference< Legend > xLegend = LegendHelper::getLegend( rModel, nullptr );
+ if( xLegend.is())
{
- xProp->setPropertyValue( "Show", uno::Any(false) );
+ xLegend->setPropertyValue( u"Show"_ustr, uno::Any(false) );
}
}
-uno::Reference< chart2::XLegend > LegendHelper::getLegend(
+rtl::Reference< Legend > LegendHelper::getLegend(
ChartModel& rModel
, const uno::Reference< uno::XComponentContext >& xContext
, bool bCreate )
{
- uno::Reference< chart2::XLegend > xResult;
+ rtl::Reference< Legend > xResult;
try
{
- uno::Reference< chart2::XDiagram > xDia( rModel.getFirstDiagram());
+ rtl::Reference< Diagram > xDia( rModel.getFirstChartDiagram());
if( xDia.is() )
{
- xResult.set( xDia->getLegend() );
+ xResult = xDia->getLegend2();
if( bCreate && !xResult.is() && xContext.is() )
{
- xResult.set( xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.Legend", xContext ), uno::UNO_QUERY );
+ xResult = new Legend();
xDia->setLegend( xResult );
}
}
@@ -105,14 +104,14 @@ uno::Reference< chart2::XLegend > LegendHelper::getLegend(
return xResult;
}
-bool LegendHelper::hasLegend( const uno::Reference< chart2::XDiagram > & xDiagram )
+bool LegendHelper::hasLegend( const rtl::Reference< Diagram > & xDiagram )
{
bool bReturn = false;
if( xDiagram.is())
{
uno::Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
if( xLegendProp.is())
- xLegendProp->getPropertyValue( "Show") >>= bReturn;
+ xLegendProp->getPropertyValue( u"Show"_ustr) >>= bReturn;
}
return bReturn;
diff --git a/chart2/source/tools/LifeTime.cxx b/chart2/source/tools/LifeTime.cxx
index 7a84f4f648c6..1264e908130a 100644
--- a/chart2/source/tools/LifeTime.cxx
+++ b/chart2/source/tools/LifeTime.cxx
@@ -20,11 +20,14 @@
#include <LifeTime.hxx>
#include <osl/diagnose.h>
+#include <com/sun/star/document/XStorageChangeListener.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/util/CloseVetoException.hpp>
#include <com/sun/star/util/XCloseListener.hpp>
#include <com/sun/star/util/XCloseable.hpp>
-#include <tools/diagnose_ex.h>
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/view/XSelectionChangeListener.hpp>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
using namespace ::com::sun::star;
@@ -33,8 +36,7 @@ namespace apphelper
{
LifeTimeManager::LifeTimeManager( lang::XComponent* pComponent )
- : m_aListenerContainer( m_aAccessMutex )
- , m_pComponent(pComponent)
+ : m_pComponent(pComponent)
{
m_bDisposed = false;
m_bInDispose = false;
@@ -85,7 +87,7 @@ void LifeTimeManager::impl_registerApiCall(bool bLongLastingCall)
m_aNoLongLastingCallCountCondition.reset();
}
-void LifeTimeManager::impl_unregisterApiCall(bool bLongLastingCall)
+void LifeTimeManager::impl_unregisterApiCall(std::unique_lock<std::mutex>& rGuard, bool bLongLastingCall)
{
//Mutex needs to be acquired exactly once
//mutex may be released inbetween in special case of impl_apiCallCountReachedNull()
@@ -101,7 +103,7 @@ void LifeTimeManager::impl_unregisterApiCall(bool bLongLastingCall)
if( m_nAccessCount== 0)
{
m_aNoAccessCountCondition.set();
- impl_apiCallCountReachedNull();
+ impl_apiCallCountReachedNull(rGuard);
}
}
@@ -110,7 +112,7 @@ bool LifeTimeManager::dispose()
{
//hold no mutex
{
- osl::MutexGuard aGuard( m_aAccessMutex );
+ std::unique_lock aGuard( m_aAccessMutex );
if( m_bDisposed || m_bInDispose )
{
@@ -122,23 +124,19 @@ bool LifeTimeManager::dispose()
//adding any listener is not allowed anymore
//new calls will not be accepted
//still running calls have the freedom to finish their work without crash
- }
- //no mutex is acquired
- //--do the disposing of listeners after calling this method
- {
uno::Reference< lang::XComponent > xComponent(m_pComponent);
if(xComponent.is())
{
// notify XCLoseListeners
lang::EventObject aEvent( xComponent );
- m_aListenerContainer.disposeAndClear( aEvent );
+ m_aCloseListeners.disposeAndClear( aGuard, aEvent );
+ m_aModifyListeners.disposeAndClear( aGuard, aEvent );
+ m_aStorageChangeListeners.disposeAndClear( aGuard, aEvent );
+ m_aEventListeners.disposeAndClear( aGuard, aEvent );
+ m_aSelectionChangeListeners.disposeAndClear( aGuard, aEvent );
}
- }
- //no mutex is acquired
- {
- osl::MutexGuard aGuard( m_aAccessMutex );
OSL_ENSURE( !m_bDisposed, "dispose was called already" );
m_bDisposed = true;
}
@@ -189,7 +187,7 @@ bool CloseableLifeTimeManager::g_close_startTryClose(bool bDeliverOwnership)
{
//no mutex is allowed to be acquired
{
- osl::MutexGuard aGuard( m_aAccessMutex );
+ std::unique_lock aGuard( m_aAccessMutex );
if( impl_isDisposedOrClosed(false) )
return false;
@@ -217,42 +215,40 @@ bool CloseableLifeTimeManager::g_close_startTryClose(bool bDeliverOwnership)
uno::Reference< util::XCloseable > xCloseable(m_pCloseable);
if(xCloseable.is())
{
+ std::unique_lock aGuard( m_aAccessMutex );
//--call queryClosing on all registered close listeners
- ::comphelper::OInterfaceContainerHelper2* pIC = m_aListenerContainer.getContainer(
- cppu::UnoType<util::XCloseListener>::get());
- if( pIC )
+ if( m_aCloseListeners.getLength(aGuard) )
{
lang::EventObject aEvent( xCloseable );
- ::comphelper::OInterfaceIteratorHelper2 aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- static_cast< util::XCloseListener* >( aIt.next() )
- ->queryClosing( aEvent, bDeliverOwnership );
- }
+ m_aCloseListeners.forEach(aGuard,
+ [&aEvent, bDeliverOwnership](const uno::Reference<util::XCloseListener>& l)
+ {
+ l->queryClosing(aEvent, bDeliverOwnership);
+ });
}
}
}
catch( const uno::Exception& )
{
//no mutex is acquired
- g_close_endTryClose(bDeliverOwnership);
+ g_close_endTryClose();
throw;
}
return true;
}
-void CloseableLifeTimeManager::g_close_endTryClose(bool bDeliverOwnership )
+void CloseableLifeTimeManager::g_close_endTryClose()
{
//this method is called, if the try to close was not successful
- osl::MutexGuard aGuard( m_aAccessMutex );
- impl_setOwnership( bDeliverOwnership, false );
+ std::unique_lock aGuard( m_aAccessMutex );
+ m_bOwnership = false;
m_bInTryClose = false;
m_aEndTryClosingCondition.set();
//Mutex needs to be acquired exactly once
//mutex may be released inbetween in special case of impl_apiCallCountReachedNull()
- impl_unregisterApiCall(false);
+ impl_unregisterApiCall(aGuard, false);
}
void CloseableLifeTimeManager::g_close_isNeedToCancelLongLastingCalls( bool bDeliverOwnership, util::CloseVetoException const & ex )
@@ -262,19 +258,18 @@ void CloseableLifeTimeManager::g_close_isNeedToCancelLongLastingCalls( bool bDel
//it returns true, if some longlasting calls are running, which might be cancelled
//it throws the given exception, if long calls are running but not cancelable
- osl::MutexGuard aGuard( m_aAccessMutex );
+ std::unique_lock aGuard( m_aAccessMutex );
//this count cannot grow after try of close has started, because we wait in all those methods for end of try closing
if( !m_nLongLastingCallCount )
return;
- impl_setOwnership( bDeliverOwnership, true );
-
+ m_bOwnership = bDeliverOwnership;
m_bInTryClose = false;
m_aEndTryClosingCondition.set();
//Mutex needs to be acquired exactly once
//mutex may be released inbetween in special case of impl_apiCallCountReachedNull()
- impl_unregisterApiCall(false);
+ impl_unregisterApiCall(aGuard, false);
throw ex;
}
@@ -282,31 +277,26 @@ void CloseableLifeTimeManager::g_close_isNeedToCancelLongLastingCalls( bool bDel
void CloseableLifeTimeManager::g_close_endTryClose_doClose()
{
//this method is called, if the try to close was successful
- osl::MutexGuard aGuard( m_aAccessMutex );
+ std::unique_lock aGuard( m_aAccessMutex );
m_bInTryClose = false;
m_aEndTryClosingCondition.set();
//Mutex needs to be acquired exactly once
//mutex may be released inbetween in special case of impl_apiCallCountReachedNull()
- impl_unregisterApiCall(false);
- impl_doClose();
-}
-
-void CloseableLifeTimeManager::impl_setOwnership( bool bDeliverOwnership, bool bMyVeto )
-{
- m_bOwnership = bDeliverOwnership && bMyVeto;
+ impl_unregisterApiCall(aGuard, false);
+ impl_doClose(aGuard);
}
-void CloseableLifeTimeManager::impl_apiCallCountReachedNull()
+void CloseableLifeTimeManager::impl_apiCallCountReachedNull(std::unique_lock<std::mutex>& rGuard)
{
//Mutex needs to be acquired exactly once
//mutex will be released inbetween in impl_doClose()
if( m_pCloseable && m_bOwnership )
- impl_doClose();
+ impl_doClose(rGuard);
}
-void CloseableLifeTimeManager::impl_doClose()
+void CloseableLifeTimeManager::impl_doClose(std::unique_lock<std::mutex>& rGuard)
{
//Mutex needs to be acquired exactly once before calling impl_doClose()
@@ -317,26 +307,17 @@ void CloseableLifeTimeManager::impl_doClose()
m_bClosed = true;
- NegativeGuard< osl::Mutex > aNegativeGuard( m_aAccessMutex );
- //mutex is not acquired, mutex will be reacquired at the end of this method automatically
-
uno::Reference< util::XCloseable > xCloseable;
+ xCloseable.set(m_pCloseable);
try
{
- xCloseable.set(m_pCloseable);
if(xCloseable.is())
{
//--call notifyClosing on all registered close listeners
- ::comphelper::OInterfaceContainerHelper2* pIC = m_aListenerContainer.getContainer(
- cppu::UnoType<util::XCloseListener>::get());
- if( pIC )
+ if( m_aCloseListeners.getLength(rGuard) )
{
lang::EventObject aEvent( xCloseable );
- ::comphelper::OInterfaceIteratorHelper2 aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- static_cast< util::XCloseListener* >( aIt.next() )->notifyClosing( aEvent );
- }
+ m_aCloseListeners.notifyEach(rGuard, &util::XCloseListener::notifyClosing, aEvent);
}
}
}
@@ -345,6 +326,7 @@ void CloseableLifeTimeManager::impl_doClose()
DBG_UNHANDLED_EXCEPTION("chart2");
}
+ rGuard.unlock();
if(xCloseable.is())
{
uno::Reference< lang::XComponent > xComponent( xCloseable, uno::UNO_QUERY );
@@ -354,18 +336,18 @@ void CloseableLifeTimeManager::impl_doClose()
xComponent->dispose();
}
}
- //mutex will be reacquired in destructor of aNegativeGuard
+ rGuard.lock();
}
void CloseableLifeTimeManager::g_addCloseListener( const uno::Reference< util::XCloseListener > & xListener )
{
- osl::MutexGuard aGuard( m_aAccessMutex );
+ std::unique_lock aGuard( m_aAccessMutex );
//Mutex needs to be acquired exactly once; will be released inbetween
if( !impl_canStartApiCall() )
return;
//mutex is acquired
- m_aListenerContainer.addInterface( cppu::UnoType<util::XCloseListener>::get(),xListener );
+ m_aCloseListeners.addInterface( aGuard, xListener );
m_bOwnership = false;
}
@@ -386,9 +368,9 @@ bool CloseableLifeTimeManager::impl_canStartApiCall()
//we need to wait for his end because the result of the preceding call
//is relevant for our behaviour here
- m_aAccessMutex.release();
+ m_aAccessMutex.unlock();
m_aEndTryClosingCondition.wait(); //@todo??? this may block??? try closing
- m_aAccessMutex.acquire();
+ m_aAccessMutex.lock();
if( m_bDisposed || m_bInDispose || m_bClosed )
return false; //return if closed already
}
@@ -421,12 +403,13 @@ LifeTimeGuard::~LifeTimeGuard()
try
{
//do acquire the mutex if it was cleared before
- osl::MutexGuard g(m_rManager.m_aAccessMutex);
+ if (!m_guard.owns_lock())
+ m_guard.lock();
if(m_bCallRegistered)
{
//Mutex needs to be acquired exactly once
//mutex may be released inbetween in special case of impl_apiCallCountReachedNull()
- m_rManager.impl_unregisterApiCall(m_bLongLastingCallRegistered);
+ m_rManager.impl_unregisterApiCall(m_guard, m_bLongLastingCallRegistered);
}
}
catch( uno::Exception& ex )
diff --git a/chart2/source/tools/LinePropertiesHelper.cxx b/chart2/source/tools/LinePropertiesHelper.cxx
index 7e6d28860903..8b9598c7461c 100644
--- a/chart2/source/tools/LinePropertiesHelper.cxx
+++ b/chart2/source/tools/LinePropertiesHelper.cxx
@@ -24,7 +24,8 @@
#include <com/sun/star/drawing/LineDash.hpp>
#include <com/sun/star/drawing/LineCap.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <tools/color.hxx>
using namespace ::com::sun::star;
@@ -92,9 +93,9 @@ void LinePropertiesHelper::AddDefaultsToMap(
::chart::tPropertyValueMap & rOutMap )
{
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_STYLE, drawing::LineStyle_SOLID );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINE_WIDTH, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINE_COLOR, 0x000000 ); // black
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_LINE_TRANSPARENCE, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_WIDTH, sal_Int32(0) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_COLOR, COL_BLACK );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_TRANSPARENCE, sal_Int16(0) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_JOINT, drawing::LineJoint_ROUND );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_CAP, drawing::LineCap_BUTT );
}
@@ -108,11 +109,11 @@ bool LinePropertiesHelper::IsLineVisible( const css::uno::Reference<
if( xLineProperties.is() )
{
drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
- xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
+ xLineProperties->getPropertyValue( u"LineStyle"_ustr ) >>= aLineStyle;
if( aLineStyle != drawing::LineStyle_NONE )
{
sal_Int16 nLineTransparence=0;
- xLineProperties->getPropertyValue( "LineTransparence" ) >>= nLineTransparence;
+ xLineProperties->getPropertyValue( u"LineTransparence"_ustr ) >>= nLineTransparence;
if(nLineTransparence!=100)
{
bRet = true;
@@ -135,14 +136,14 @@ void LinePropertiesHelper::SetLineVisible( const css::uno::Reference<
if( xLineProperties.is() )
{
drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
- xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
+ xLineProperties->getPropertyValue( u"LineStyle"_ustr ) >>= aLineStyle;
if( aLineStyle == drawing::LineStyle_NONE )
- xLineProperties->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_SOLID ) );
+ xLineProperties->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_SOLID ) );
sal_Int16 nLineTransparence=0;
- xLineProperties->getPropertyValue( "LineTransparence" ) >>= nLineTransparence;
+ xLineProperties->getPropertyValue( u"LineTransparence"_ustr ) >>= nLineTransparence;
if(nLineTransparence==100)
- xLineProperties->setPropertyValue( "LineTransparence", uno::Any( sal_Int16(0) ) );
+ xLineProperties->setPropertyValue( u"LineTransparence"_ustr, uno::Any( sal_Int16(0) ) );
}
}
catch( const uno::Exception & )
@@ -159,9 +160,9 @@ void LinePropertiesHelper::SetLineInvisible( const css::uno::Reference<
if( xLineProperties.is() )
{
drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
- xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
+ xLineProperties->getPropertyValue( u"LineStyle"_ustr ) >>= aLineStyle;
if( aLineStyle != drawing::LineStyle_NONE )
- xLineProperties->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_NONE ) );
+ xLineProperties->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_NONE ) );
}
}
catch( const uno::Exception & )
@@ -177,7 +178,7 @@ void LinePropertiesHelper::SetLineColor( const css::uno::Reference<
{
if( xLineProperties.is() )
{
- xLineProperties->setPropertyValue( "LineColor", uno::Any( nColor ) );
+ xLineProperties->setPropertyValue( u"LineColor"_ustr, uno::Any( nColor ) );
}
}
catch( const uno::Exception & )
diff --git a/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx b/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx
index ffd1808dfd22..5e68235d14cd 100644
--- a/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx
@@ -175,7 +175,7 @@ OUString LogarithmicRegressionCurveCalculator::ImplGetRepresentation(
addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
}
- if ( std::u16string_view(aBuf) == OUStringConcatenation(mYName + " = ") )
+ if ( std::u16string_view(aBuf) == Concat2View(mYName + " = ") )
aBuf.append( "0" );
return aBuf.makeStringAndClear();
diff --git a/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx b/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx
index aefd3f8f05aa..b9bfd1a303a7 100644
--- a/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx
@@ -42,18 +42,15 @@ void SAL_CALL MeanValueRegressionCurveCalculator::recalculateRegression(
const uno::Sequence< double >& /*aXValues*/,
const uno::Sequence< double >& aYValues )
{
- const sal_Int32 nDataLength = aYValues.getLength();
- sal_Int32 nMax = nDataLength;
+ sal_Int32 nMax = aYValues.getLength();
double fSumY = 0.0;
- const double * pY = aYValues.getConstArray();
- for( sal_Int32 i = 0; i < nDataLength; ++i )
+ for (double y : aYValues)
{
- if( std::isnan( pY[i] ) ||
- std::isinf( pY[i] ))
+ if (std::isnan(y) || std::isinf(y))
--nMax;
else
- fSumY += pY[i];
+ fSumY += y;
}
m_fCorrelationCoefficient = 0.0;
@@ -70,12 +67,11 @@ void SAL_CALL MeanValueRegressionCurveCalculator::recalculateRegression(
if( nMax > 1 )
{
double fErrorSum = 0.0;
- for( sal_Int32 i = 0; i < nDataLength; ++i )
+ for (double y : aYValues)
{
- if( !std::isnan( pY[i] ) &&
- !std::isinf( pY[i] ))
+ if (!std::isnan(y) && !std::isinf(y))
{
- double v = m_fMeanValue - pY[i];
+ double v = m_fMeanValue - y;
fErrorSum += (v*v);
}
}
@@ -116,7 +112,7 @@ OUString MeanValueRegressionCurveCalculator::ImplGetRepresentation(
{
*pFormulaLength -= aBuf.getLength();
if ( *pFormulaLength <= 0 )
- return "###";
+ return u"###"_ustr;
}
return ( aBuf + getFormattedString( xNumFormatter, nNumberFormatKey, m_fMeanValue, pFormulaLength ) );
}
diff --git a/chart2/source/tools/ModifyListenerCallBack.cxx b/chart2/source/tools/ModifyListenerCallBack.cxx
index 037ee7a7820d..758b25386f96 100644
--- a/chart2/source/tools/ModifyListenerCallBack.cxx
+++ b/chart2/source/tools/ModifyListenerCallBack.cxx
@@ -67,7 +67,7 @@ void SAL_CALL ModifyListenerCallBack_impl::disposing( const lang::EventObject& /
m_xBroadcaster.clear();
}
-void ModifyListenerCallBack_impl::startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyBroadcaster >& xBroadcaster )
+void ModifyListenerCallBack_impl::startListening( const css::uno::Reference< css::util::XModifyBroadcaster >& xBroadcaster )
{
if( m_xBroadcaster == xBroadcaster )
return;
@@ -97,7 +97,7 @@ ModifyListenerCallBack::~ModifyListenerCallBack()
stopListening();
}
-void ModifyListenerCallBack::startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyBroadcaster >& xBroadcaster )
+void ModifyListenerCallBack::startListening( const css::uno::Reference< css::util::XModifyBroadcaster >& xBroadcaster )
{
pModifyListener_impl->startListening( xBroadcaster );
}
diff --git a/chart2/source/tools/ModifyListenerHelper.cxx b/chart2/source/tools/ModifyListenerHelper.cxx
index 0213e97d9720..507e79fa32e2 100644
--- a/chart2/source/tools/ModifyListenerHelper.cxx
+++ b/chart2/source/tools/ModifyListenerHelper.cxx
@@ -18,9 +18,6 @@
*/
#include <ModifyListenerHelper.hxx>
-#include <WeakListenerAdapter.hxx>
-
-#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
diff --git a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
index 227a509ad3f0..a846d4d224f7 100644
--- a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
@@ -62,28 +62,30 @@ void SAL_CALL MovingAverageRegressionCurveCalculator::recalculateRegression(
case MovingAverageType::Central:
{
- calculateValuesCentral(aValues);
+ calculateValuesCentral(std::move(aValues));
break;
}
case MovingAverageType::AveragedAbscissa:
{
- calculateValues(aValues, true);
+ calculateValues(std::move(aValues), true);
break;
}
case MovingAverageType::Prior:
default:
{
- calculateValues(aValues, false);
+ calculateValues(std::move(aValues), false);
break;
}
}
}
void MovingAverageRegressionCurveCalculator::calculateValuesCentral(
- RegressionCalculationHelper::tDoubleVectorPair aValues)
+ const RegressionCalculationHelper::tDoubleVectorPair& aValues)
{
const size_t aSize = aValues.first.size();
+ if (aSize == 0)
+ return;
for (size_t i = mPeriod - 1; i < aSize; ++i)
{
double yAvg = 0.0;
@@ -104,7 +106,7 @@ void MovingAverageRegressionCurveCalculator::calculateValuesCentral(
}
void MovingAverageRegressionCurveCalculator::calculateValues(
- RegressionCalculationHelper::tDoubleVectorPair aValues, bool bUseXAvg)
+ const RegressionCalculationHelper::tDoubleVectorPair& aValues, bool bUseXAvg)
{
const size_t aSize = aValues.first.size();
for (size_t i = mPeriod - 1; i < aSize; ++i)
@@ -155,7 +157,15 @@ OUString MovingAverageRegressionCurveCalculator::ImplGetRepresentation(
const uno::Reference< util::XNumberFormatter >& /*xNumFormatter*/,
sal_Int32 /*nNumberFormatKey*/, sal_Int32* /*pFormulaLength = nullptr */ ) const
{
- return SchResId( STR_OBJECT_MOVING_AVERAGE_WITH_PARAMETERS );
+ OUString aRet = SchResId( STR_OBJECT_MOVING_AVERAGE_WITH_PARAMETERS );
+ // change text for Moving Average
+ OUString aWildcard( u"%PERIOD"_ustr );
+ sal_Int32 nIndex = aRet.indexOf( aWildcard );
+ if( nIndex != -1 )
+ { // replace period
+ aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), OUString::number(mPeriod) );
+ }
+ return aRet;
}
} // namespace chart
diff --git a/chart2/source/tools/NameContainer.cxx b/chart2/source/tools/NameContainer.cxx
index 23e0a2821d1c..3ca97e75b302 100644
--- a/chart2/source/tools/NameContainer.cxx
+++ b/chart2/source/tools/NameContainer.cxx
@@ -49,7 +49,7 @@ NameContainer::~NameContainer()
//XServiceInfo
OUString SAL_CALL NameContainer::getImplementationName()
{
- return "com.sun.star.comp.chart.XMLNameSpaceMap";
+ return u"com.sun.star.comp.chart.XMLNameSpaceMap"_ustr;
}
sal_Bool SAL_CALL NameContainer::supportsService( const OUString& ServiceName )
@@ -59,13 +59,13 @@ sal_Bool SAL_CALL NameContainer::supportsService( const OUString& ServiceName )
Sequence< OUString > SAL_CALL NameContainer::getSupportedServiceNames()
{
- return { "com.sun.star.xml.NamespaceMap" };
+ return { u"com.sun.star.xml.NamespaceMap"_ustr };
}
// XNameContainer
void SAL_CALL NameContainer::insertByName( const OUString& rName, const Any& rElement )
{
- if( m_aMap.find( rName ) != m_aMap.end() )
+ if( m_aMap.contains( rName ))
throw container::ElementExistException();
m_aMap.emplace( rName, rElement );
}
@@ -103,7 +103,7 @@ Sequence< OUString > SAL_CALL NameContainer::getElementNames()
sal_Bool SAL_CALL NameContainer::hasByName( const OUString& rName )
{
- return ( m_aMap.find( rName ) != m_aMap.end() );
+ return m_aMap.contains( rName );
}
// XElementAccess
diff --git a/chart2/source/tools/NumberFormatterWrapper.cxx b/chart2/source/tools/NumberFormatterWrapper.cxx
index d6e704d145d6..9687fd60e161 100644
--- a/chart2/source/tools/NumberFormatterWrapper.cxx
+++ b/chart2/source/tools/NumberFormatterWrapper.cxx
@@ -53,7 +53,7 @@ NumberFormatterWrapper::NumberFormatterWrapper( const uno::Reference< util::XNum
{
uno::Reference<beans::XPropertySet> xProp(m_xNumberFormatsSupplier,uno::UNO_QUERY);
- OUString sNullDate( "NullDate" );
+ OUString sNullDate( u"NullDate"_ustr );
if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(sNullDate) )
m_aNullDate = xProp->getPropertyValue(sNullDate);
SvNumberFormatsSupplierObj* pSupplierObj = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>( xSupplier );
@@ -66,12 +66,31 @@ NumberFormatterWrapper::~NumberFormatterWrapper()
{
}
+namespace
+{
+ bool getDate(const css::uno::Any& rAny, util::Date& rDate)
+ {
+ if (rAny >>= rDate)
+ return true;
+ util::DateTime aUtilDateTime;
+ if (rAny >>= aUtilDateTime)
+ {
+ rDate.Day = aUtilDateTime.Day;
+ rDate.Month = aUtilDateTime.Month;
+ rDate.Year = aUtilDateTime.Year;
+ return true;
+ }
+ SAL_WARN("chart2.tools", "neither a util::Date nor a util::DateTime");
+ return false;
+ }
+}
+
Date NumberFormatterWrapper::getNullDate() const
{
Date aRet(30,12,1899);
util::Date aUtilDate;
- if( m_aNullDate.hasValue() && (m_aNullDate >>= aUtilDate) )
+ if (m_aNullDate.hasValue() && getDate(m_aNullDate, aUtilDate))
{
aRet = Date(aUtilDate.Day,aUtilDate.Month,aUtilDate.Year);
}
@@ -102,8 +121,8 @@ OUString NumberFormatterWrapper::getFormattedString( sal_Int32 nNumberFormatKey,
nMonth = rDate.GetMonth();
nDay = rDate.GetDay();
util::Date aNewNullDate;
- m_aNullDate >>= aNewNullDate;
- m_pNumberFormatter->ChangeNullDate(aNewNullDate.Day,aNewNullDate.Month,aNewNullDate.Year);
+ if (getDate(m_aNullDate, aNewNullDate))
+ m_pNumberFormatter->ChangeNullDate(aNewNullDate.Day,aNewNullDate.Month,aNewNullDate.Year);
}
// tdf#130969: use UNLIMITED_PRECISION in case of GENERAL Number Format
if( m_pNumberFormatter->GetStandardPrec() != SvNumberFormatter::UNLIMITED_PRECISION )
diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx
index bcf92741f4b5..dd042698cc8e 100644
--- a/chart2/source/tools/OPropertySet.cxx
+++ b/chart2/source/tools/OPropertySet.cxx
@@ -40,23 +40,25 @@ using ::cppu::OPropertySetHelper;
namespace property
{
-OPropertySet::OPropertySet( ::osl::Mutex & par_rMutex ) :
- OBroadcastHelper( par_rMutex ),
+OPropertySet::OPropertySet( ) :
+ OBroadcastHelper( m_aMutex ),
// the following causes a warning; there seems to be no way to avoid it
OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )),
- m_rMutex( par_rMutex ),
m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false)
{
}
-OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMutex ) :
- OBroadcastHelper( par_rMutex ),
+OPropertySet::OPropertySet( const OPropertySet & rOther ) :
+ OBroadcastHelper( m_aMutex ),
// the following causes a warning; there seems to be no way to avoid it
OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )),
- m_rMutex( par_rMutex ),
+ css::lang::XTypeProvider(),
+ css::beans::XPropertyState(),
+ css::beans::XMultiPropertyStates(),
+ css::style::XStyleSupplier(),
m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false)
{
- MutexGuard aGuard( m_rMutex );
+ MutexGuard aGuard( m_aMutex );
m_aProperties = rOther.m_aProperties;
@@ -64,7 +66,7 @@ OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMut
for(auto& rProp : m_aProperties)
{
if( rProp.second.hasValue() &&
- rProp.second.getValueType().getTypeClass() == uno::TypeClass_INTERFACE )
+ rProp.second.getValueTypeClass() == uno::TypeClass_INTERFACE )
{
Reference< util::XCloneable > xCloneable;
if( rProp.second >>= xCloneable )
@@ -264,7 +266,6 @@ void SAL_CALL OPropertySet::setFastPropertyValue_NoBroadcast
{
aDefault.clear();
}
- SetPropertyValueByHandle( nHandle, rValue );
if( !m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault && aDefault.hasValue() && aDefault == rValue ) //#i98893# don't export defaults to file
SetPropertyToDefault( nHandle );
else
@@ -363,7 +364,7 @@ void SAL_CALL OPropertySet::setStyle( const Reference< style::XStyle >& xStyle )
{
if( ! SetStyle( xStyle ))
throw lang::IllegalArgumentException(
- "Empty Style",
+ u"Empty Style"_ustr,
static_cast< beans::XPropertySet * >( this ),
0 );
}
@@ -406,7 +407,7 @@ Sequence< beans::PropertyState > OPropertySet::GetPropertyStatesByHandle(
void OPropertySet::SetPropertyToDefault( sal_Int32 nHandle )
{
- tPropertyMap::iterator aFoundIter( m_aProperties.find( nHandle ) );
+ auto aFoundIter( m_aProperties.find( nHandle ) );
if( m_aProperties.end() != aFoundIter )
{
@@ -432,7 +433,7 @@ bool OPropertySet::GetPropertyValueByHandle(
{
bool bResult = false;
- tPropertyMap::const_iterator aFoundIter( m_aProperties.find( nHandle ) );
+ auto aFoundIter( m_aProperties.find( nHandle ) );
if( m_aProperties.end() != aFoundIter )
{
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index f95022510203..ed9a114184fd 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -19,30 +19,31 @@
#include <sal/config.h>
+#include <cstddef>
#include <map>
#include <ObjectIdentifier.hxx>
#include <TitleHelper.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <servicenames_charttypes.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <unonames.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <DataSeries.hxx>
+#include <RegressionCurveModel.hxx>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <o3tl/safeint.hxx>
+#include <o3tl/string_view.hxx>
+#include <utility>
namespace com::sun::star::drawing { class XShape; }
@@ -54,11 +55,11 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
-const char m_aMultiClick[] = "MultiClick";
-const char m_aDragMethodEquals[] = "DragMethod=";
-const char m_aDragParameterEquals[] = "DragParameter=";
-const char m_aProtocol[] = "CID/";
-const OUString m_aPieSegmentDragMethodServiceName("PieSegmentDragging");
+constexpr OUString m_aMultiClick = u"MultiClick"_ustr;
+constexpr OUString m_aDragMethodEquals = u"DragMethod="_ustr;
+constexpr OUString m_aDragParameterEquals = u"DragParameter="_ustr;
+constexpr OUString m_aProtocol = u"CID/"_ustr;
+constexpr OUString m_aPieSegmentDragMethodServiceName(u"PieSegmentDragging"_ustr);
namespace
{
@@ -87,15 +88,13 @@ OUString lcl_createClassificationStringForType( ObjectType eObjectType
{
if( !aRet.isEmpty() )
aRet.append(":");
- aRet.append( m_aDragMethodEquals );
- aRet.append( rDragMethodServiceName );
+ aRet.append( OUString::Concat(m_aDragMethodEquals) + rDragMethodServiceName );
if( !rDragParameterString.empty() )
{
if( !aRet.isEmpty() )
aRet.append(":");
- aRet.append( m_aDragParameterEquals );
- aRet.append( rDragParameterString );
+ aRet.append( OUString::Concat(m_aDragParameterEquals) + rDragParameterString );
}
}
return aRet.makeStringAndClear();
@@ -128,23 +127,20 @@ OUString lcl_getTitleParentParticle( TitleHelper::eTitleType aTitleType )
return aRet;
}
-Reference<XChartType> lcl_getFirstStockChartType( const Reference< frame::XModel >& xChartModel )
+rtl::Reference<ChartType> lcl_getFirstStockChartType( const rtl::Reference<::chart::ChartModel>& xChartModel )
{
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
if(!xDiagram.is())
return nullptr;
//iterate through all coordinate systems
- const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysList( xDiagram->getBaseCoordinateSystems() );
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysList( xDiagram->getBaseCoordinateSystems() );
for( rtl::Reference< BaseCoordinateSystem > const & coords : aCooSysList )
{
//iterate through all chart types in the current coordinate system
- const uno::Sequence< Reference< XChartType > > aChartTypeList( coords->getChartTypes() );
- for( Reference< XChartType > const & xChartType : aChartTypeList )
+ for( rtl::Reference< ChartType > const & xChartType : coords->getChartTypes2() )
{
- if(!xChartType.is())
- continue;
OUString aChartType = xChartType->getChartType();
if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
return xChartType;
@@ -153,79 +149,74 @@ Reference<XChartType> lcl_getFirstStockChartType( const Reference< frame::XModel
return nullptr;
}
-OUString lcl_getIndexStringAfterString( const OUString& rString, const OUString& rSearchString )
+std::u16string_view lcl_getIndexStringAfterString( std::u16string_view rString, std::u16string_view rSearchString )
{
- OUStringBuffer aRet;
-
- sal_Int32 nIndexStart = rString.lastIndexOf( rSearchString );
- if( nIndexStart != -1 )
- {
- nIndexStart += rSearchString.getLength();
- sal_Int32 nIndexEnd = rString.getLength();
- sal_Int32 nNextColon = rString.indexOf( ':', nIndexStart );
- if( nNextColon != -1 )
- nIndexEnd = nNextColon;
- aRet = rString.subView(nIndexStart,nIndexEnd-nIndexStart);
- }
-
- return aRet.makeStringAndClear();
+ size_t nIndexStart = rString.rfind( rSearchString );
+ if( nIndexStart == std::u16string_view::npos )
+ return std::u16string_view();
+ nIndexStart += rSearchString.size();
+ size_t nIndexEnd = rString.size();
+ size_t nNextColon = rString.find( ':', nIndexStart );
+ if( nNextColon != std::u16string_view::npos )
+ nIndexEnd = nNextColon;
+ return rString.substr(nIndexStart,nIndexEnd-nIndexStart);
}
-sal_Int32 lcl_StringToIndex( const OUString& rIndexString )
+sal_Int32 lcl_StringToIndex( std::u16string_view rIndexString )
{
sal_Int32 nRet = -1;
- if( !rIndexString.isEmpty() )
+ if( !rIndexString.empty() )
{
- nRet = rIndexString.toInt32();
+ nRet = o3tl::toInt32(rIndexString);
if( nRet < -1 )
nRet = -1;
}
return nRet;
}
-void lcl_parseCooSysIndices( sal_Int32& rnDiagram, sal_Int32& rnCooSys, const OUString& rString )
+void lcl_parseCooSysIndices( sal_Int32& rnDiagram, sal_Int32& rnCooSys, std::u16string_view rString )
{
- rnDiagram = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "D=" ) );
- rnCooSys = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "CS=" ) );
+ rnDiagram = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"D=" ) );
+ rnCooSys = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"CS=" ) );
}
-void lcl_parseAxisIndices( sal_Int32& rnDimensionIndex, sal_Int32& rnAxisIndex, const OUString& rString )
+void lcl_parseAxisIndices( sal_Int32& rnDimensionIndex, sal_Int32& rnAxisIndex, std::u16string_view rString )
{
- OUString aAxisIndexString = lcl_getIndexStringAfterString( rString, ":Axis=" );
+ std::u16string_view aAxisIndexString = lcl_getIndexStringAfterString( rString, u":Axis=" );
sal_Int32 nCharacterIndex=0;
- rnDimensionIndex = lcl_StringToIndex( aAxisIndexString.getToken( 0, ',', nCharacterIndex ) );
- rnAxisIndex = lcl_StringToIndex( aAxisIndexString.getToken( 0, ',', nCharacterIndex ) );
+ rnDimensionIndex = lcl_StringToIndex( o3tl::getToken(aAxisIndexString, 0, ',', nCharacterIndex ) );
+ rnAxisIndex = lcl_StringToIndex( o3tl::getToken(aAxisIndexString, 0, ',', nCharacterIndex ) );
}
-void lcl_parseGridIndices( sal_Int32& rnSubGridIndex, const OUString& rString )
+void lcl_parseGridIndices( sal_Int32& rnSubGridIndex, std::u16string_view rString )
{
rnSubGridIndex = -1;
- rnSubGridIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, ":SubGrid=" ) );
+ rnSubGridIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u":SubGrid=" ) );
}
-void lcl_parseSeriesIndices( sal_Int32& rnChartTypeIndex, sal_Int32& rnSeriesIndex, sal_Int32& rnPointIndex, const OUString& rString )
+void lcl_parseSeriesIndices( sal_Int32& rnChartTypeIndex, sal_Int32& rnSeriesIndex, sal_Int32& rnPointIndex, std::u16string_view rString )
{
- rnChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "CT=" ) );
- rnSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "Series=" ) );
- rnPointIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, "Point=" ) );
+ rnChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"CT=" ) );
+ rnSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"Series=" ) );
+ rnPointIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"Point=" ) );
}
-void lcl_getDiagramAndCooSys( const OUString& rObjectCID
- , const Reference< frame::XModel >& xChartModel
+void lcl_getDiagramAndCooSys( std::u16string_view rObjectCID
+ , const rtl::Reference<::chart::ChartModel>& xChartModel
, rtl::Reference< Diagram >& xDiagram
- , Reference< XCoordinateSystem >& xCooSys )
+ , rtl::Reference< BaseCoordinateSystem >& xCooSys )
{
sal_Int32 nDiagramIndex = -1;
sal_Int32 nCooSysIndex = -1;
lcl_parseCooSysIndices( nDiagramIndex, nCooSysIndex, rObjectCID );
- xDiagram = ChartModelHelper::findDiagram( xChartModel );//todo use nDiagramIndex when more than one diagram is possible in future
+ xDiagram = xChartModel->getFirstChartDiagram();//todo use nDiagramIndex when more than one diagram is possible in future
if( !xDiagram.is() )
return;
if( nCooSysIndex > -1 )
{
- uno::Sequence< Reference< XCoordinateSystem > > aCooSysList( xDiagram->getCoordinateSystems() );
- if( nCooSysIndex < aCooSysList.getLength() )
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysList( xDiagram->getBaseCoordinateSystems() );
+ if( o3tl::make_unsigned(nCooSysIndex) < aCooSysList.size() )
xCooSys = aCooSysList[nCooSysIndex];
}
}
@@ -236,8 +227,8 @@ ObjectIdentifier::ObjectIdentifier()
{
}
-ObjectIdentifier::ObjectIdentifier( const OUString& rObjectCID )
- :m_aObjectCID( rObjectCID )
+ObjectIdentifier::ObjectIdentifier( OUString aObjectCID )
+ :m_aObjectCID(std::move( aObjectCID ))
{
}
@@ -248,12 +239,11 @@ ObjectIdentifier::ObjectIdentifier( const Reference< drawing::XShape >& rxShape
ObjectIdentifier::ObjectIdentifier( const Any& rAny )
{
- const uno::Type& rType = rAny.getValueType();
- if ( rType == cppu::UnoType<OUString>::get() )
+ if (rAny.getValueType() == cppu::UnoType<OUString>::get())
{
rAny >>= m_aObjectCID;
}
- else if ( rType == cppu::UnoType< drawing::XShape >::get() )
+ else
{
rAny >>= m_xAdditionalShape;
}
@@ -265,11 +255,6 @@ bool ObjectIdentifier::operator==( const ObjectIdentifier& rOID ) const
( m_xAdditionalShape == rOID.m_xAdditionalShape );
}
-bool ObjectIdentifier::operator!=( const ObjectIdentifier& rOID ) const
-{
- return !operator==( rOID );
-}
-
bool ObjectIdentifier::operator<( const ObjectIdentifier& rOID ) const
{
bool bReturn = false;
@@ -293,41 +278,55 @@ bool ObjectIdentifier::operator<( const ObjectIdentifier& rOID ) const
}
OUString ObjectIdentifier::createClassifiedIdentifierForObject(
+ const rtl::Reference< ::chart::Title >& xTitle
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
+{
+ TitleHelper::eTitleType aTitleType;
+ OUString aRet;
+ const std::u16string_view aObjectID;
+ const std::u16string_view aDragMethodServiceName;
+ const std::u16string_view aDragParameterString;
+ if( TitleHelper::getTitleType( aTitleType, xTitle, xChartModel ) )
+ {
+ enum ObjectType eObjectType = OBJECTTYPE_TITLE;
+ OUString aParentParticle = lcl_getTitleParentParticle( aTitleType );
+ aRet = ObjectIdentifier::createClassifiedIdentifierWithParent(
+ eObjectType, aObjectID, aParentParticle, aDragMethodServiceName, aDragParameterString );
+ }
+ return aRet;
+}
+
+OUString ObjectIdentifier::createClassifiedIdentifierForObject(
const Reference< uno::XInterface >& xObject
- , ChartModel& rModel)
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
{
OUString aRet;
enum ObjectType eObjectType = OBJECTTYPE_UNKNOWN;
- const OUString aObjectID;
+ const std::u16string_view aObjectID;
OUString aParentParticle;
- const OUString aDragMethodServiceName;
- const OUString aDragParameterString;
+ const std::u16string_view aDragMethodServiceName;
+ const std::u16string_view aDragParameterString;
try
{
//title
- Reference< XTitle > xTitle( xObject, uno::UNO_QUERY );
- if( xTitle.is() )
- {
- TitleHelper::eTitleType aTitleType;
- if( TitleHelper::getTitleType( aTitleType, xTitle, rModel ) )
- {
- eObjectType = OBJECTTYPE_TITLE;
- aParentParticle = lcl_getTitleParentParticle( aTitleType );
- aRet = ObjectIdentifier::createClassifiedIdentifierWithParent(
- eObjectType, aObjectID, aParentParticle, aDragMethodServiceName, aDragParameterString );
- }
- return aRet;
+ if( ::chart::Title* pTitle = dynamic_cast<::chart::Title*>(xObject.get()) )
+ return createClassifiedIdentifierForObject(rtl::Reference<Title>(pTitle), xChartModel);
+ uno::Reference<chart2::XDataTable> xDataTable(xObject, uno::UNO_QUERY);
+ if (xDataTable.is())
+ {
+ return createClassifiedIdentifierForParticle(createParticleForDataTable(xChartModel));
}
//axis
- Reference< XAxis > xAxis( xObject, uno::UNO_QUERY );
+ rtl::Reference< Axis > xAxis = dynamic_cast<Axis*>( xObject.get() );
if( xAxis.is() )
{
- rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( xAxis, rModel.getFirstDiagram() ) );
- OUString aCooSysParticle( createParticleForCoordinateSystem( xCooSys, rModel ) );
+ rtl::Reference<Diagram> xDiagram = xChartModel->getFirstChartDiagram();
+ rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( xAxis, xDiagram ) );
+ OUString aCooSysParticle( createParticleForCoordinateSystem( xCooSys, xChartModel ) );
sal_Int32 nDimensionIndex=-1;
sal_Int32 nAxisIndex=-1;
AxisHelper::getIndicesForAxis( xAxis, xCooSys, nDimensionIndex, nAxisIndex );
@@ -339,7 +338,7 @@ OUString ObjectIdentifier::createClassifiedIdentifierForObject(
Reference< XLegend > xLegend( xObject, uno::UNO_QUERY );
if( xLegend.is() )
{
- return createClassifiedIdentifierForParticle( createParticleForLegend( rModel ) );
+ return createClassifiedIdentifierForParticle( createParticleForLegend( xChartModel ) );
}
//diagram
@@ -375,40 +374,37 @@ OUString ObjectIdentifier::createClassifiedIdentifierForObject(
}
OUString ObjectIdentifier::createClassifiedIdentifierForObject(
- const Reference< uno::XInterface >& xObject
- , const Reference< frame::XModel >& xChartModel )
+ const rtl::Reference< Legend >& xLegend
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
{
- OUString aRet;
-
- enum ObjectType eObjectType = OBJECTTYPE_UNKNOWN;
- const OUString aObjectID;
- OUString aParentParticle;
- const OUString aDragMethodServiceName;
- const OUString aDragParameterString;
-
try
{
- //title
- Reference< XTitle > xTitle( xObject, uno::UNO_QUERY );
- if( xTitle.is() )
+ if( xLegend.is() )
{
- TitleHelper::eTitleType aTitleType;
- if( TitleHelper::getTitleType( aTitleType, xTitle, xChartModel ) )
- {
- eObjectType = OBJECTTYPE_TITLE;
- aParentParticle = lcl_getTitleParentParticle( aTitleType );
- aRet = ObjectIdentifier::createClassifiedIdentifierWithParent(
- eObjectType, aObjectID, aParentParticle, aDragMethodServiceName, aDragParameterString );
- }
- return aRet;
-
+ return createClassifiedIdentifierForParticle( createParticleForLegend( xChartModel ) );
}
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ OSL_FAIL("give object could not be identified in createClassifiedIdentifierForObject");
+
+ return OUString();
+}
+OUString ObjectIdentifier::createClassifiedIdentifierForObject(
+ const rtl::Reference<::chart::Axis>& xAxis
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
+{
+ try
+ {
//axis
- Reference< XAxis > xAxis( xObject, uno::UNO_QUERY );
if( xAxis.is() )
{
- Reference< XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( xAxis, ChartModelHelper::findDiagram( xChartModel ) ) );
+ rtl::Reference<Diagram> xDiagram = xChartModel->getFirstChartDiagram();
+ rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( xAxis, xDiagram ) );
OUString aCooSysParticle( createParticleForCoordinateSystem( xCooSys, xChartModel ) );
sal_Int32 nDimensionIndex=-1;
sal_Int32 nAxisIndex=-1;
@@ -416,55 +412,26 @@ OUString ObjectIdentifier::createClassifiedIdentifierForObject(
OUString aAxisParticle( createParticleForAxis( nDimensionIndex, nAxisIndex ) );
return createClassifiedIdentifierForParticles( aCooSysParticle, aAxisParticle );
}
-
- //legend
- Reference< XLegend > xLegend( xObject, uno::UNO_QUERY );
- if( xLegend.is() )
- {
- return createClassifiedIdentifierForParticle( createParticleForLegend( xChartModel ) );
- }
-
- //diagram
- Reference< XDiagram > xDiagram( xObject, uno::UNO_QUERY );
- if( xDiagram.is() )
- {
- return createClassifiedIdentifierForParticle( createParticleForDiagram() );
- }
-
- //todo
- //XDataSeries
- //CooSys
- //charttype
- //datapoint?
- //Gridproperties
}
catch(const uno::Exception&)
{
DBG_UNHANDLED_EXCEPTION("chart2");
}
- if( eObjectType != OBJECTTYPE_UNKNOWN )
- {
- aRet = ObjectIdentifier::createClassifiedIdentifierWithParent(
- eObjectType, aObjectID, aParentParticle, aDragMethodServiceName, aDragParameterString );
- }
- else
- {
- OSL_FAIL("give object could not be identified in createClassifiedIdentifierForObject");
- }
+ OSL_FAIL("give object could not be identified in createClassifiedIdentifierForObject");
- return aRet;
+ return OUString();
}
OUString ObjectIdentifier::createClassifiedIdentifierForParticle(
- const OUString& rParticle )
+ std::u16string_view rParticle )
{
- return ObjectIdentifier::createClassifiedIdentifierForParticles( rParticle, OUString() );
+ return ObjectIdentifier::createClassifiedIdentifierForParticles( rParticle, u"" );
}
OUString ObjectIdentifier::createClassifiedIdentifierForParticles(
- const OUString& rParentParticle
- , const OUString& rChildParticle
+ std::u16string_view rParentParticle
+ , std::u16string_view rChildParticle
, std::u16string_view rDragMethodServiceName
, std::u16string_view rDragParameterString )
{
@@ -472,15 +439,15 @@ OUString ObjectIdentifier::createClassifiedIdentifierForParticles(
if( eObjectType == OBJECTTYPE_UNKNOWN )
eObjectType = ObjectIdentifier::getObjectType( rParentParticle );
- OUStringBuffer aRet( m_aProtocol );
- aRet.append( lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
- if(aRet.getLength() > static_cast<sal_Int32>(strlen(m_aProtocol)))
+ OUStringBuffer aRet( m_aProtocol +
+ lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
+ if(aRet.getLength() > m_aProtocol.getLength())
aRet.append("/");
- if(!rParentParticle.isEmpty())
+ if(!rParentParticle.empty())
{
aRet.append(rParentParticle);
- if( !rChildParticle.isEmpty() )
+ if( !rChildParticle.empty() )
aRet.append(":");
}
aRet.append(rChildParticle);
@@ -491,49 +458,23 @@ OUString ObjectIdentifier::createClassifiedIdentifierForParticles(
OUString ObjectIdentifier::createParticleForDiagram()
{
//TODO: if more than one diagram is implemented, add the correct diagram index here
- return "D=0";
-}
-
-OUString ObjectIdentifier::createParticleForCoordinateSystem(
- const Reference< XCoordinateSystem >& xCooSys
- , ChartModel& rModel )
-{
- OUString aRet;
-
- rtl::Reference< Diagram > xDiagram( rModel.getFirstChartDiagram() );
- if( xDiagram.is() )
- {
- sal_Int32 nCooSysIndex = 0;
- uno::Sequence< Reference< XCoordinateSystem > > aCooSysList( xDiagram->getCoordinateSystems() );
- for( ; nCooSysIndex < aCooSysList.getLength(); ++nCooSysIndex )
- {
- Reference< XCoordinateSystem > xCurrentCooSys( aCooSysList[nCooSysIndex] );
- if( xCooSys == xCurrentCooSys )
- {
- aRet = ObjectIdentifier::createParticleForDiagram() + ":CS=" + OUString::number( nCooSysIndex );
- break;
- }
- }
- }
-
- return aRet;
+ return u"D=0"_ustr;
}
OUString ObjectIdentifier::createParticleForCoordinateSystem(
- const Reference< XCoordinateSystem >& xCooSys
- , const Reference< frame::XModel >& xChartModel )
+ const rtl::Reference< BaseCoordinateSystem >& xCooSys
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
{
OUString aRet;
- rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
+ rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
if( xDiagram.is() )
{
- sal_Int32 nCooSysIndex = 0;
- uno::Sequence< Reference< XCoordinateSystem > > aCooSysList( xDiagram->getCoordinateSystems() );
- for( ; nCooSysIndex < aCooSysList.getLength(); ++nCooSysIndex )
+ std::size_t nCooSysIndex = 0;
+ const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysList( xDiagram->getBaseCoordinateSystems() );
+ for( ; nCooSysIndex < aCooSysList.size(); ++nCooSysIndex )
{
- Reference< XCoordinateSystem > xCurrentCooSys( aCooSysList[nCooSysIndex] );
- if( xCooSys == xCurrentCooSys )
+ if( xCooSys == aCooSysList[nCooSysIndex] )
{
aRet = ObjectIdentifier::createParticleForDiagram() + ":CS=" + OUString::number( nCooSysIndex );
break;
@@ -566,7 +507,7 @@ OUString ObjectIdentifier::createParticleForGrid(
OUString ObjectIdentifier::createClassifiedIdentifierForGrid(
const Reference< XAxis >& xAxis
- , const Reference< frame::XModel >& xChartModel
+ , const rtl::Reference<::chart::ChartModel>& xChartModel
, sal_Int32 nSubGridIndex )
{
//-1: main grid, 0: first subgrid etc
@@ -594,19 +535,18 @@ OUString ObjectIdentifier::createParticleForSeries(
OUString::number( nSeriesIndex );
}
-OUString ObjectIdentifier::createParticleForLegend( ChartModel& )
+
+OUString ObjectIdentifier::createParticleForLegend(
+ const rtl::Reference<::chart::ChartModel>& )
{
//todo: if more than one diagram is implemented, find the correct diagram which is owner of the given legend
return ObjectIdentifier::createParticleForDiagram() + ":" + getStringForType( OBJECTTYPE_LEGEND ) + "=";
}
-OUString ObjectIdentifier::createParticleForLegend(
- const Reference< frame::XModel >& )
+OUString ObjectIdentifier::createParticleForDataTable(const rtl::Reference<::chart::ChartModel>& /* xChartModel */)
{
- //todo: if more than one diagram is implemented, find the correct diagram which is owner of the given legend
-
- return ObjectIdentifier::createParticleForDiagram() + ":" + getStringForType( OBJECTTYPE_LEGEND ) + "=";
+ return ObjectIdentifier::createParticleForDiagram() + ":" + getStringForType(OBJECTTYPE_DATA_TABLE) + "=";
}
OUString ObjectIdentifier::createClassifiedIdentifier(
@@ -628,17 +568,15 @@ OUString ObjectIdentifier::createClassifiedIdentifierWithParent(
{
//e.g. "MultiClick/Series=2:Point=34"
- OUStringBuffer aRet( m_aProtocol );
- aRet.append( lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
- if(aRet.getLength() > static_cast<sal_Int32>(strlen(m_aProtocol)))
+ OUStringBuffer aRet( m_aProtocol +
+ lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
+ if(aRet.getLength() > m_aProtocol.getLength())
aRet.append("/");
aRet.append(rParentPartical);
if(!rParentPartical.empty())
aRet.append(":");
- aRet.append(getStringForType( eObjectType ));
- aRet.append("=");
- aRet.append(rParticleID);
+ aRet.append(getStringForType( eObjectType ) + "=" + rParticleID);
return aRet.makeStringAndClear();
}
@@ -662,89 +600,89 @@ OUString ObjectIdentifier::createPieSegmentDragParameterString(
}
bool ObjectIdentifier::parsePieSegmentDragParameterString(
- const OUString& rDragParameterString
+ std::u16string_view rDragParameterString
, sal_Int32& rOffsetPercent
, awt::Point& rMinimumPosition
, awt::Point& rMaximumPosition )
{
sal_Int32 nCharacterIndex = 0;
- OUString aValueString( rDragParameterString.getToken( 0, ',', nCharacterIndex ) );
- rOffsetPercent = aValueString.toInt32();
+ std::u16string_view aValueString( o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex ) );
+ rOffsetPercent = o3tl::toInt32(aValueString);
if( nCharacterIndex < 0 )
return false;
- aValueString = rDragParameterString.getToken( 0, ',', nCharacterIndex );
- rMinimumPosition.X = aValueString.toInt32();
+ aValueString = o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex );
+ rMinimumPosition.X = o3tl::toInt32(aValueString);
if( nCharacterIndex < 0 )
return false;
- aValueString = rDragParameterString.getToken( 0, ',', nCharacterIndex );
- rMinimumPosition.Y = aValueString.toInt32();
+ aValueString = o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex );
+ rMinimumPosition.Y = o3tl::toInt32(aValueString);
if( nCharacterIndex < 0 )
return false;
- aValueString = rDragParameterString.getToken( 0, ',', nCharacterIndex );
- rMaximumPosition.X = aValueString.toInt32();
+ aValueString = o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex );
+ rMaximumPosition.X = o3tl::toInt32(aValueString);
if( nCharacterIndex < 0 )
return false;
- aValueString = rDragParameterString.getToken( 0, ',', nCharacterIndex );
- rMaximumPosition.Y = aValueString.toInt32();
+ aValueString = o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex );
+ rMaximumPosition.Y = o3tl::toInt32(aValueString);
return nCharacterIndex >= 0;
}
-OUString ObjectIdentifier::getDragMethodServiceName( const OUString& rCID )
+std::u16string_view ObjectIdentifier::getDragMethodServiceName( std::u16string_view rCID )
{
- OUString aRet;
+ std::u16string_view aRet;
- sal_Int32 nIndexStart = rCID.indexOf( m_aDragMethodEquals );
- if( nIndexStart != -1 )
+ size_t nIndexStart = rCID.find( m_aDragMethodEquals );
+ if( nIndexStart != std::u16string_view::npos )
{
- nIndexStart = rCID.indexOf( '=', nIndexStart );
- if( nIndexStart != -1 )
+ nIndexStart = rCID.find( '=', nIndexStart );
+ if( nIndexStart != std::u16string_view::npos )
{
nIndexStart++;
- sal_Int32 nNextSlash = rCID.indexOf( '/', nIndexStart );
- if( nNextSlash != -1 )
+ size_t nNextSlash = rCID.find( '/', nIndexStart );
+ if( nNextSlash != std::u16string_view::npos )
{
sal_Int32 nIndexEnd = nNextSlash;
- sal_Int32 nNextColon = rCID.indexOf( ':', nIndexStart );
- if( nNextColon < nNextSlash )
+ size_t nNextColon = rCID.find( ':', nIndexStart );
+ if( nNextColon == std::u16string_view::npos || nNextColon < nNextSlash )
nIndexEnd = nNextColon;
- aRet = rCID.copy(nIndexStart,nIndexEnd-nIndexStart);
+ aRet = rCID.substr(nIndexStart,nIndexEnd-nIndexStart);
}
}
}
return aRet;
}
-OUString ObjectIdentifier::getDragParameterString( const OUString& rCID )
+std::u16string_view ObjectIdentifier::getDragParameterString( std::u16string_view rCID )
{
- OUString aRet;
+ std::u16string_view aRet;
- sal_Int32 nIndexStart = rCID.indexOf( m_aDragParameterEquals );
- if( nIndexStart != -1 )
+ size_t nIndexStart = rCID.find( m_aDragParameterEquals );
+ if( nIndexStart != std::u16string_view::npos )
{
- nIndexStart = rCID.indexOf( '=', nIndexStart );
- if( nIndexStart != -1 )
+ nIndexStart = rCID.find( '=', nIndexStart );
+ if( nIndexStart != std::u16string_view::npos )
{
nIndexStart++;
- sal_Int32 nNextSlash = rCID.indexOf( '/', nIndexStart );
- if( nNextSlash != -1 )
+ size_t nNextSlash = rCID.find( '/', nIndexStart );
+ if( nNextSlash != std::u16string_view::npos )
{
sal_Int32 nIndexEnd = nNextSlash;
- sal_Int32 nNextColon = rCID.indexOf( ':', nIndexStart );
- if( nNextColon < nNextSlash )
+ size_t nNextColon = rCID.find( ':', nIndexStart );
+ if( nNextColon == std::u16string_view::npos || nNextColon < nNextSlash )
nIndexEnd = nNextColon;
- aRet = rCID.copy(nIndexStart,nIndexEnd-nIndexStart);
+ aRet = rCID.substr(nIndexStart,nIndexEnd-nIndexStart);
}
}
}
return aRet;
}
-bool ObjectIdentifier::isDragableObject( const OUString& rClassifiedIdentifier )
+bool ObjectIdentifier::isDragableObject( std::u16string_view rClassifiedIdentifier )
{
bool bReturn = false;
ObjectType eObjectType = ObjectIdentifier::getObjectType( rClassifiedIdentifier );
@@ -759,8 +697,8 @@ bool ObjectIdentifier::isDragableObject( const OUString& rClassifiedIdentifier )
bReturn = true;
break;
default:
- OUString aDragMethodServiceName( ObjectIdentifier::getDragMethodServiceName( rClassifiedIdentifier ) );
- bReturn = !aDragMethodServiceName.isEmpty();
+ std::u16string_view aDragMethodServiceName( ObjectIdentifier::getDragMethodServiceName( rClassifiedIdentifier ) );
+ bReturn = !aDragMethodServiceName.empty();
break;
}
return bReturn;
@@ -780,7 +718,7 @@ bool ObjectIdentifier::isDragableObject() const
return bReturn;
}
-bool ObjectIdentifier::isRotateableObject( const OUString& rClassifiedIdentifier )
+bool ObjectIdentifier::isRotateableObject( std::u16string_view rClassifiedIdentifier )
{
bool bReturn = false;
ObjectType eObjectType = ObjectIdentifier::getObjectType( rClassifiedIdentifier );
@@ -797,7 +735,7 @@ bool ObjectIdentifier::isRotateableObject( const OUString& rClassifiedIdentifier
return bReturn;
}
-bool ObjectIdentifier::isMultiClickObject( const OUString& rClassifiedIdentifier )
+bool ObjectIdentifier::isMultiClickObject( std::u16string_view rClassifiedIdentifier )
{
//the name of a shape is it's ClassifiedIdentifier
@@ -806,27 +744,27 @@ bool ObjectIdentifier::isMultiClickObject( const OUString& rClassifiedIdentifier
//was selected before;
//!!!!! by definition the name of a MultiClickObject starts with "CID/MultiClick:"
- bool bRet = rClassifiedIdentifier.match( m_aMultiClick, strlen(m_aProtocol) );
+ bool bRet = o3tl::starts_with(rClassifiedIdentifier.substr( m_aProtocol.getLength() ), m_aMultiClick);
return bRet;
}
-bool ObjectIdentifier::areSiblings( const OUString& rCID1, const OUString& rCID2 )
+bool ObjectIdentifier::areSiblings( std::u16string_view rCID1, std::u16string_view rCID2 )
{
bool bRet=false;
- sal_Int32 nLastSign1 = rCID1.lastIndexOf( '=' );
- sal_Int32 nLastSign2 = rCID2.lastIndexOf( '=' );
- if( nLastSign1 == rCID1.indexOf( '=' ) )//CID cannot be sibling if only one "=" occurs
+ size_t nLastSign1 = rCID1.rfind( '=' );
+ size_t nLastSign2 = rCID2.rfind( '=' );
+ if( nLastSign1 == rCID1.find( '=' ) )//CID cannot be sibling if only one "=" occurs
bRet=false;
- else if( nLastSign2 == rCID2.indexOf( '=' ) )//CID cannot be sibling if only one "=" occurs
+ else if( nLastSign2 == rCID2.find( '=' ) )//CID cannot be sibling if only one "=" occurs
bRet=false;
else if( ObjectIdentifier::areIdenticalObjects( rCID1, rCID2 ) )
bRet=false;
else
{
- OUString aParent1( ObjectIdentifier::getFullParentParticle( rCID1 ) );
- if( !aParent1.isEmpty() )
+ std::u16string_view aParent1( ObjectIdentifier::getFullParentParticle( rCID1 ) );
+ if( !aParent1.empty() )
{
- OUString aParent2( ObjectIdentifier::getFullParentParticle( rCID2 ) );
+ std::u16string_view aParent2( ObjectIdentifier::getFullParentParticle( rCID2 ) );
bRet=aParent1 == aParent2;
}
//legend entries are special:
@@ -840,14 +778,14 @@ bool ObjectIdentifier::areSiblings( const OUString& rCID1, const OUString& rCID2
return bRet;
}
-bool ObjectIdentifier::areIdenticalObjects( const OUString& rCID1, const OUString& rCID2 )
+bool ObjectIdentifier::areIdenticalObjects( std::u16string_view rCID1, std::u16string_view rCID2 )
{
if( rCID1 == rCID2 )
return true;
//draggable pie or donut segments need special treatment, as their CIDs do change with offset
{
- if( rCID1.indexOf( m_aPieSegmentDragMethodServiceName ) < 0
- || rCID2.indexOf( m_aPieSegmentDragMethodServiceName ) < 0 )
+ if( rCID1.find( m_aPieSegmentDragMethodServiceName ) == std::u16string_view::npos
+ || rCID2.find( m_aPieSegmentDragMethodServiceName ) == std::u16string_view::npos )
return false;
OUString aID1( ObjectIdentifier::getObjectID( rCID1 ) );
@@ -935,76 +873,82 @@ OUString ObjectIdentifier::getStringForType( ObjectType eObjectType )
case OBJECTTYPE_DATA_STOCK_GAIN:
aRet="StockGain";
break;
+ case OBJECTTYPE_DATA_TABLE:
+ aRet="DataTable";
+ break;
default: //OBJECTTYPE_UNKNOWN
;
}
return aRet;
}
-ObjectType ObjectIdentifier::getObjectType( const OUString& rCID )
+ObjectType ObjectIdentifier::getObjectType( std::u16string_view aCID )
{
ObjectType eRet;
- sal_Int32 nLastSign = rCID.lastIndexOf( ':' );//last sign before the type string
- if(nLastSign==-1)
- nLastSign = rCID.lastIndexOf( '/' );
- if(nLastSign==-1)
+ size_t nLastSign = aCID.rfind( ':' );//last sign before the type string
+ if(nLastSign == std::u16string_view::npos)
+ nLastSign = aCID.rfind( '/' );
+ if(nLastSign == std::u16string_view::npos)
{
- sal_Int32 nEndIndex = rCID.lastIndexOf( '=' );
- if(nEndIndex==-1)
+ size_t nEndIndex = aCID.rfind( '=' );
+ if(nEndIndex == std::u16string_view::npos)
return OBJECTTYPE_UNKNOWN;
nLastSign = 0;
}
if( nLastSign>0 )
nLastSign++;
- if( rCID.match("Page",nLastSign) )
+ aCID = aCID.substr(nLastSign);
+ if( o3tl::starts_with(aCID, u"Page") )
eRet = OBJECTTYPE_PAGE;
- else if( rCID.match("Title",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Title") )
eRet = OBJECTTYPE_TITLE;
- else if( rCID.match("LegendEntry",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"LegendEntry") )
eRet = OBJECTTYPE_LEGEND_ENTRY;
- else if( rCID.match("Legend",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Legend") )
eRet = OBJECTTYPE_LEGEND;
- else if( rCID.match("DiagramWall",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"DiagramWall") )
eRet = OBJECTTYPE_DIAGRAM_WALL;
- else if( rCID.match("DiagramFloor",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"DiagramFloor") )
eRet = OBJECTTYPE_DIAGRAM_FLOOR;
- else if( rCID.match("D=",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"D=") )
eRet = OBJECTTYPE_DIAGRAM;
- else if( rCID.match("AxisUnitLabel",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"AxisUnitLabel") )
eRet = OBJECTTYPE_AXIS_UNITLABEL;
- else if( rCID.match("Axis",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Axis") )
eRet = OBJECTTYPE_AXIS;
- else if( rCID.match("Grid",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Grid") )
eRet = OBJECTTYPE_GRID;
- else if( rCID.match("SubGrid",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"SubGrid") )
eRet = OBJECTTYPE_SUBGRID;
- else if( rCID.match("Series",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Series") )
eRet = OBJECTTYPE_DATA_SERIES;
- else if( rCID.match("Point",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Point") )
eRet = OBJECTTYPE_DATA_POINT;
- else if( rCID.match("DataLabels",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"DataLabels") )
eRet = OBJECTTYPE_DATA_LABELS;
- else if( rCID.match("DataLabel",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"DataLabel") )
eRet = OBJECTTYPE_DATA_LABEL;
- else if( rCID.match("ErrorsX",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"ErrorsX") )
eRet = OBJECTTYPE_DATA_ERRORS_X;
- else if( rCID.match("ErrorsY",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"ErrorsY") )
eRet = OBJECTTYPE_DATA_ERRORS_Y;
- else if( rCID.match("ErrorsZ",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"ErrorsZ") )
eRet = OBJECTTYPE_DATA_ERRORS_Z;
- else if( rCID.match("Curve",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Curve") )
eRet = OBJECTTYPE_DATA_CURVE;
- else if( rCID.match("Equation",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Equation") )
eRet = OBJECTTYPE_DATA_CURVE_EQUATION;
- else if( rCID.match("Average",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"Average") )
eRet = OBJECTTYPE_DATA_AVERAGE_LINE;
- else if( rCID.match("StockRange",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"StockRange") )
eRet = OBJECTTYPE_DATA_STOCK_RANGE;
- else if( rCID.match("StockLoss",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"StockLoss") )
eRet = OBJECTTYPE_DATA_STOCK_LOSS;
- else if( rCID.match("StockGain",nLastSign) )
+ else if( o3tl::starts_with(aCID, u"StockGain") )
eRet = OBJECTTYPE_DATA_STOCK_GAIN;
+ else if( o3tl::starts_with(aCID, u"DataTable") )
+ eRet = OBJECTTYPE_DATA_TABLE;
else
eRet = OBJECTTYPE_UNKNOWN;
@@ -1060,20 +1004,19 @@ OUString ObjectIdentifier::createChildParticleWithIndex( ObjectType eObjectType,
OUStringBuffer aRet( getStringForType( eObjectType ) );
if( !aRet.isEmpty() )
{
- aRet.append("=");
- aRet.append(nIndex);
+ aRet.append("=" + OUString::number(nIndex));
}
return aRet.makeStringAndClear();
}
-sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( const OUString& rParticleOrCID )
+sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( std::u16string_view rParticleOrCID )
{
- const OUString aIndexString = lcl_getIndexStringAfterString( rParticleOrCID, "=" );
- return lcl_StringToIndex( aIndexString.getToken( 0, ',' ) );
+ const std::u16string_view aIndexString = lcl_getIndexStringAfterString( rParticleOrCID, u"=" );
+ return lcl_StringToIndex( o3tl::getToken(aIndexString, 0, ',' ) );
}
OUString ObjectIdentifier::createSeriesSubObjectStub( ObjectType eSubObjectType
- , const OUString& rSeriesParticle
+ , std::u16string_view rSeriesParticle
, std::u16string_view rDragMethodServiceName
, std::u16string_view rDragParameterString )
{
@@ -1089,75 +1032,59 @@ OUString ObjectIdentifier::createPointCID( std::u16string_view rPointCID_Stub, s
return rPointCID_Stub + OUString::number( nIndex );
}
-OUString ObjectIdentifier::getParticleID( const OUString& rCID )
+std::u16string_view ObjectIdentifier::getParticleID( std::u16string_view rCID )
{
- OUString aRet;
- sal_Int32 nLast = rCID.lastIndexOf('=');
- if(nLast>=0)
- aRet = rCID.copy(++nLast);
+ std::u16string_view aRet;
+ size_t nLast = rCID.rfind('=');
+ if(nLast != std::u16string_view::npos)
+ aRet = rCID.substr(++nLast);
return aRet;
}
-OUString ObjectIdentifier::getFullParentParticle( const OUString& rCID )
+std::u16string_view ObjectIdentifier::getFullParentParticle( std::u16string_view rCID )
{
- OUString aRet;
+ std::u16string_view aRet;
- sal_Int32 nStartPos = rCID.lastIndexOf('/');
- if( nStartPos>=0 )
+ size_t nStartPos = rCID.rfind('/');
+ if( nStartPos != std::u16string_view::npos )
{
nStartPos++;
- sal_Int32 nEndPos = rCID.lastIndexOf(':');
- if( nEndPos>=0 && nStartPos < nEndPos )
+ size_t nEndPos = rCID.rfind(':');
+ if( nEndPos != std::u16string_view::npos && nStartPos < nEndPos )
{
- aRet = rCID.copy(nStartPos,nEndPos-nStartPos);
+ aRet = rCID.substr(nStartPos,nEndPos-nStartPos);
}
}
return aRet;
}
-OUString ObjectIdentifier::getObjectID( const OUString& rCID )
+OUString ObjectIdentifier::getObjectID( std::u16string_view rCID )
{
OUString aRet;
- sal_Int32 nStartPos = rCID.lastIndexOf('/');
- if( nStartPos>=0 )
+ size_t nStartPos = rCID.rfind('/');
+ if( nStartPos != std::u16string_view::npos )
{
nStartPos++;
- sal_Int32 nEndPos = rCID.getLength();
- aRet = rCID.copy(nStartPos,nEndPos-nStartPos);
+ size_t nEndPos = rCID.size();
+ aRet = rCID.substr(nStartPos,nEndPos-nStartPos);
}
return aRet;
}
-bool ObjectIdentifier::isCID( const OUString& rName )
-{
- return !rName.isEmpty() && rName.match( m_aProtocol );
-}
-
-Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
- const OUString& rObjectCID,
- const Reference< chart2::XChartDocument >& xChartDocument )
-{
- return ObjectIdentifier::getObjectPropertySet(
- rObjectCID, Reference< frame::XModel >( xChartDocument ));
-}
-
-Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
- const OUString& rObjectCID
- , const rtl::Reference< ::chart::ChartModel >& xChartModel )
+bool ObjectIdentifier::isCID( std::u16string_view rName )
{
- return ObjectIdentifier::getObjectPropertySet(
- rObjectCID, Reference< frame::XModel >( xChartModel ));
+ return !rName.empty() && o3tl::starts_with( rName, m_aProtocol );
}
Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
- const OUString& rObjectCID
- , const Reference< frame::XModel >& xChartModel )
+ std::u16string_view rObjectCID
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
{
//return the model object that is indicated by rObjectCID
- if(rObjectCID.isEmpty())
+ if(rObjectCID.empty())
return nullptr;
if(!xChartModel.is())
return nullptr;
@@ -1166,26 +1093,24 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
try
{
ObjectType eObjectType = ObjectIdentifier::getObjectType( rObjectCID );
- OUString aParticleID = ObjectIdentifier::getParticleID( rObjectCID );
+ std::u16string_view aParticleID = ObjectIdentifier::getParticleID( rObjectCID );
rtl::Reference< Diagram > xDiagram;
- Reference< XCoordinateSystem > xCooSys;
+ rtl::Reference< BaseCoordinateSystem > xCooSys;
lcl_getDiagramAndCooSys( rObjectCID, xChartModel, xDiagram, xCooSys );
switch(eObjectType)
{
case OBJECTTYPE_PAGE:
{
- Reference< XChartDocument > xChartDocument( xChartModel, uno::UNO_QUERY );
- if( xChartDocument.is())
- xObjectProperties.set( xChartDocument->getPageBackground() );
+ xObjectProperties.set( xChartModel->getPageBackground() );
}
break;
case OBJECTTYPE_TITLE:
{
TitleHelper::eTitleType aTitleType = getTitleTypeForCID( rObjectCID );
- Reference< XTitle > xTitle( TitleHelper::getTitle( aTitleType, xChartModel ) );
- xObjectProperties.set( xTitle, uno::UNO_QUERY );
+ rtl::Reference< Title > xTitle( TitleHelper::getTitle( aTitleType, xChartModel ) );
+ xObjectProperties = xTitle;
}
break;
case OBJECTTYPE_LEGEND:
@@ -1219,10 +1144,10 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
sal_Int32 nAxisIndex = -1;
lcl_parseAxisIndices( nDimensionIndex, nAxisIndex, rObjectCID );
- Reference< chart2::XAxis > xAxis(
- AxisHelper::getAxis( nDimensionIndex, nAxisIndex, xCooSys ) );
+ rtl::Reference< Axis > xAxis =
+ AxisHelper::getAxis( nDimensionIndex, nAxisIndex, xCooSys );
if( xAxis.is() )
- xObjectProperties.set( xAxis, uno::UNO_QUERY );
+ xObjectProperties = xAxis;
}
break;
case OBJECTTYPE_AXIS_UNITLABEL:
@@ -1237,27 +1162,27 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
sal_Int32 nSubGridIndex = -1;
lcl_parseGridIndices( nSubGridIndex, rObjectCID );
- xObjectProperties.set( AxisHelper::getGridProperties( xCooSys , nDimensionIndex, nAxisIndex, nSubGridIndex ) );
+ xObjectProperties = AxisHelper::getGridProperties( xCooSys , nDimensionIndex, nAxisIndex, nSubGridIndex );
}
break;
case OBJECTTYPE_DATA_LABELS:
case OBJECTTYPE_DATA_SERIES:
{
- Reference< XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID(
+ rtl::Reference< DataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID(
rObjectCID, xChartModel ) );
if( xSeries.is() )
- xObjectProperties.set( xSeries, uno::UNO_QUERY );
+ xObjectProperties = xSeries;
break;
}
case OBJECTTYPE_DATA_LABEL:
case OBJECTTYPE_DATA_POINT:
{
- Reference< XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID(
- rObjectCID, xChartModel ) );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(
+ rObjectCID, xChartModel );
if(xSeries.is())
{
- sal_Int32 nIndex = aParticleID.toInt32();
+ sal_Int32 nIndex = o3tl::toInt32(aParticleID);
xObjectProperties = xSeries->getDataPointByIndex( nIndex );
}
break;
@@ -1266,26 +1191,22 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
case OBJECTTYPE_DATA_ERRORS_Y:
case OBJECTTYPE_DATA_ERRORS_Z:
{
- Reference< XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID(
- rObjectCID, xChartModel ) );
+ rtl::Reference< DataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID(
+ rObjectCID, xChartModel );
if(xSeries.is())
{
- Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
Reference< beans::XPropertySet > xErrorBarProp;
- if( xSeriesProp.is() )
- {
- OUString errorBar;
+ OUString errorBar;
- if ( eObjectType == OBJECTTYPE_DATA_ERRORS_X)
- errorBar = CHART_UNONAME_ERRORBAR_X;
- else if (eObjectType == OBJECTTYPE_DATA_ERRORS_Y)
- errorBar = CHART_UNONAME_ERRORBAR_Y;
- else
- errorBar = "ErrorBarZ";
+ if ( eObjectType == OBJECTTYPE_DATA_ERRORS_X)
+ errorBar = CHART_UNONAME_ERRORBAR_X;
+ else if (eObjectType == OBJECTTYPE_DATA_ERRORS_Y)
+ errorBar = CHART_UNONAME_ERRORBAR_Y;
+ else
+ errorBar = "ErrorBarZ";
- xSeriesProp->getPropertyValue( errorBar ) >>= xErrorBarProp;
- xObjectProperties = xErrorBarProp;
- }
+ xSeries->getPropertyValue( errorBar ) >>= xErrorBarProp;
+ xObjectProperties = std::move(xErrorBarProp);
}
break;
}
@@ -1293,19 +1214,19 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
case OBJECTTYPE_DATA_CURVE:
case OBJECTTYPE_DATA_CURVE_EQUATION:
{
- Reference< XRegressionCurveContainer > xRegressionContainer( ObjectIdentifier::getDataSeriesForCID(
- rObjectCID, xChartModel ), uno::UNO_QUERY );
+ rtl::Reference< DataSeries > xRegressionContainer = ObjectIdentifier::getDataSeriesForCID(
+ rObjectCID, xChartModel );
if(xRegressionContainer.is())
{
- sal_Int32 nIndex = aParticleID.toInt32();
- uno::Sequence< Reference< XRegressionCurve > > aCurveList =
- xRegressionContainer->getRegressionCurves();
- if( nIndex >= 0 && nIndex <aCurveList.getLength() )
+ sal_Int32 nIndex = o3tl::toInt32(aParticleID);
+ const std::vector< rtl::Reference< RegressionCurveModel > > & aCurveList =
+ xRegressionContainer->getRegressionCurves2();
+ if( nIndex >= 0 && o3tl::make_unsigned(nIndex) < aCurveList.size() )
{
if( eObjectType == OBJECTTYPE_DATA_CURVE_EQUATION )
- xObjectProperties.set( aCurveList[nIndex]->getEquationProperties());
+ xObjectProperties = aCurveList[nIndex]->getEquationProperties();
else
- xObjectProperties.set( aCurveList[nIndex], uno::UNO_QUERY );
+ xObjectProperties = aCurveList[nIndex];
}
}
break;
@@ -1314,20 +1235,25 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
break;
case OBJECTTYPE_DATA_STOCK_LOSS:
{
- Reference<XChartType> xChartType( lcl_getFirstStockChartType( xChartModel ) );
- Reference< beans::XPropertySet > xChartTypeProps( xChartType, uno::UNO_QUERY );
- if(xChartTypeProps.is())
- xChartTypeProps->getPropertyValue( "BlackDay" ) >>= xObjectProperties;
+ rtl::Reference<ChartType> xChartType( lcl_getFirstStockChartType( xChartModel ) );
+ if(xChartType.is())
+ xChartType->getPropertyValue( u"BlackDay"_ustr ) >>= xObjectProperties;
}
break;
case OBJECTTYPE_DATA_STOCK_GAIN:
{
- Reference<XChartType> xChartType( lcl_getFirstStockChartType( xChartModel ) );
- Reference< beans::XPropertySet > xChartTypeProps( xChartType, uno::UNO_QUERY );
- if(xChartTypeProps.is())
- xChartTypeProps->getPropertyValue( "WhiteDay" ) >>= xObjectProperties;
+ rtl::Reference<ChartType> xChartType( lcl_getFirstStockChartType( xChartModel ) );
+ if(xChartType.is())
+ xChartType->getPropertyValue( u"WhiteDay"_ustr ) >>= xObjectProperties;
}
break;
+ case OBJECTTYPE_DATA_TABLE:
+ {
+ if (xDiagram.is())
+ xObjectProperties.set(xDiagram->getDataTable(), uno::UNO_QUERY);
+ }
+ break;
+ break;
default: //OBJECTTYPE_UNKNOWN
break;
}
@@ -1339,12 +1265,12 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
return xObjectProperties;
}
-Reference< XAxis > ObjectIdentifier::getAxisForCID(
- const OUString& rObjectCID
- , const Reference< frame::XModel >& xChartModel )
+rtl::Reference< Axis > ObjectIdentifier::getAxisForCID(
+ std::u16string_view rObjectCID
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
{
rtl::Reference< Diagram > xDiagram;
- Reference< XCoordinateSystem > xCooSys;
+ rtl::Reference< BaseCoordinateSystem > xCooSys;
lcl_getDiagramAndCooSys( rObjectCID, xChartModel, xDiagram, xCooSys );
sal_Int32 nDimensionIndex = -1;
@@ -1354,14 +1280,12 @@ Reference< XAxis > ObjectIdentifier::getAxisForCID(
return AxisHelper::getAxis( nDimensionIndex, nAxisIndex, xCooSys );
}
-Reference< XDataSeries > ObjectIdentifier::getDataSeriesForCID(
- const OUString& rObjectCID
- , const Reference< frame::XModel >& xChartModel )
+rtl::Reference< DataSeries > ObjectIdentifier::getDataSeriesForCID(
+ std::u16string_view rObjectCID
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
{
- Reference< XDataSeries > xSeries;
-
rtl::Reference< Diagram > xDiagram;
- Reference< XCoordinateSystem > xCooSys;
+ rtl::Reference< BaseCoordinateSystem > xCooSys;
lcl_getDiagramAndCooSys( rObjectCID, xChartModel, xDiagram, xCooSys );
sal_Int32 nChartTypeIndex = -1;
@@ -1369,33 +1293,36 @@ Reference< XDataSeries > ObjectIdentifier::getDataSeriesForCID(
sal_Int32 nPointIndex = -1;
lcl_parseSeriesIndices( nChartTypeIndex, nSeriesIndex, nPointIndex, rObjectCID );
- Reference< XDataSeriesContainer > xDataSeriesContainer( DiagramHelper::getChartTypeByIndex( xDiagram, nChartTypeIndex ), uno::UNO_QUERY );
- if( xDataSeriesContainer.is() )
+ rtl::Reference< DataSeries > xSeries;
+ if (xDiagram)
{
- uno::Sequence< uno::Reference< XDataSeries > > aDataSeriesSeq( xDataSeriesContainer->getDataSeries() );
- if( nSeriesIndex >= 0 && nSeriesIndex < aDataSeriesSeq.getLength() )
- xSeries.set( aDataSeriesSeq[nSeriesIndex] );
+ rtl::Reference< ChartType > xDataSeriesContainer( xDiagram->getChartTypeByIndex( nChartTypeIndex ) );
+ if( xDataSeriesContainer.is() )
+ {
+ const std::vector< rtl::Reference< DataSeries > > & aDataSeriesSeq( xDataSeriesContainer->getDataSeries2() );
+ if( nSeriesIndex >= 0 && o3tl::make_unsigned(nSeriesIndex) < aDataSeriesSeq.size() )
+ xSeries = aDataSeriesSeq[nSeriesIndex];
+ }
}
-
return xSeries;
}
rtl::Reference< Diagram > ObjectIdentifier::getDiagramForCID(
- const OUString& rObjectCID
- , const uno::Reference< frame::XModel >& xChartModel )
+ std::u16string_view rObjectCID
+ , const rtl::Reference<::chart::ChartModel>& xChartModel )
{
rtl::Reference< Diagram > xDiagram;
- Reference< XCoordinateSystem > xCooSys;
+ rtl::Reference< BaseCoordinateSystem > xCooSys;
lcl_getDiagramAndCooSys( rObjectCID, xChartModel, xDiagram, xCooSys );
return xDiagram;
}
-TitleHelper::eTitleType ObjectIdentifier::getTitleTypeForCID( const OUString& rCID )
+TitleHelper::eTitleType ObjectIdentifier::getTitleTypeForCID( std::u16string_view rCID )
{
TitleHelper::eTitleType eRet( TitleHelper::MAIN_TITLE );
- OUString aParentParticle = ObjectIdentifier::getFullParentParticle( rCID );
+ std::u16string_view aParentParticle = ObjectIdentifier::getFullParentParticle( rCID );
const tTitleMap& rMap = lcl_getTitleMap();
tTitleMap::const_iterator aIt = std::find_if(rMap.begin(), rMap.end(),
[&aParentParticle](tTitleMap::const_reference rEntry) { return aParentParticle == rEntry.second; });
@@ -1405,7 +1332,7 @@ TitleHelper::eTitleType ObjectIdentifier::getTitleTypeForCID( const OUString& rC
return eRet;
}
-OUString ObjectIdentifier::getSeriesParticleFromCID( const OUString& rCID )
+OUString ObjectIdentifier::getSeriesParticleFromCID( std::u16string_view rCID )
{
sal_Int32 nDiagramIndex = -1;
sal_Int32 nCooSysIndex = -1;
@@ -1419,12 +1346,12 @@ OUString ObjectIdentifier::getSeriesParticleFromCID( const OUString& rCID )
return ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCooSysIndex, nChartTypeIndex, nSeriesIndex );
}
-OUString ObjectIdentifier::getMovedSeriesCID( const OUString& rObjectCID, bool bForward )
+OUString ObjectIdentifier::getMovedSeriesCID( std::u16string_view rObjectCID, bool bForward )
{
- sal_Int32 nDiagramIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, "CID/D=" ) );
- sal_Int32 nCooSysIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, "CS=" ) );
- sal_Int32 nChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, "CT=" ) );
- sal_Int32 nSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, "Series=" ) );
+ sal_Int32 nDiagramIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CID/D=" ) );
+ sal_Int32 nCooSysIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CS=" ) );
+ sal_Int32 nChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CT=" ) );
+ sal_Int32 nSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"Series=" ) );
if( bForward )
nSeriesIndex--;
diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index 3d7f1c07601b..f8921d73c266 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -381,7 +381,7 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation(
}
addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
}
- if ( std::u16string_view(aBuf) == OUStringConcatenation( mYName + " = ") )
+ if ( std::u16string_view(aBuf) == Concat2View( mYName + " = ") )
aBuf.append( "0" );
return aBuf.makeStringAndClear();
diff --git a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
index 01aa5b2548fb..504048641b59 100644
--- a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
@@ -174,8 +174,8 @@ OUString PotentialRegressionCurveCalculator::ImplGetRepresentation(
}
if( m_fSlope != 0.0 ) // add slope value
{
- aTmpBuf.append( mXName + "^" );
- aTmpBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope, pValueLength ));
+ aTmpBuf.append( mXName + "^" +
+ getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope, pValueLength ));
}
addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
}
diff --git a/chart2/source/tools/PropertyHelper.cxx b/chart2/source/tools/PropertyHelper.cxx
index cb3e860c0350..60c2b950a970 100644
--- a/chart2/source/tools/PropertyHelper.cxx
+++ b/chart2/source/tools/PropertyHelper.cxx
@@ -20,10 +20,13 @@
#include <PropertyHelper.hxx>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <docmodel/uno/UnoGradientTools.hxx>
#include <comphelper/sequence.hxx>
#include <osl/diagnose.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
+#include <o3tl/string_view.hxx>
+#include <utility>
#include <vector>
#include <algorithm>
#include <iterator>
@@ -37,8 +40,8 @@ namespace
{
struct lcl_EqualsElement
{
- explicit lcl_EqualsElement( const Any & rValue, const Reference< container::XNameAccess > & xAccess )
- : m_aValue( rValue ), m_xAccess( xAccess )
+ explicit lcl_EqualsElement( Any rValue, const Reference< container::XNameAccess > & xAccess )
+ : m_aValue(std::move( rValue )), m_xAccess( xAccess )
{
OSL_ASSERT( m_xAccess.is());
}
@@ -63,13 +66,13 @@ private:
struct lcl_StringMatches
{
- explicit lcl_StringMatches( const OUString & rCmpStr ) :
- m_aCmpStr( rCmpStr )
+ explicit lcl_StringMatches( OUString aCmpStr ) :
+ m_aCmpStr(std::move( aCmpStr ))
{}
- bool operator() ( const OUString & rStr )
+ bool operator() ( std::u16string_view rStr )
{
- return rStr.match( m_aCmpStr );
+ return o3tl::starts_with( rStr, m_aCmpStr );
}
private:
@@ -81,11 +84,11 @@ struct lcl_OUStringRestToInt32
explicit lcl_OUStringRestToInt32( sal_Int32 nPrefixLength ) :
m_nPrefixLength( nPrefixLength )
{}
- sal_Int32 operator() ( const OUString & rStr )
+ sal_Int32 operator() ( std::u16string_view rStr )
{
- if( m_nPrefixLength > rStr.getLength() )
+ if( m_nPrefixLength > static_cast<sal_Int32>(rStr.size()) )
return 0;
- return rStr.copy( m_nPrefixLength ).toInt32();
+ return o3tl::toInt32(rStr.substr( m_nPrefixLength ));
}
private:
sal_Int32 m_nPrefixLength;
@@ -111,56 +114,68 @@ OUString lcl_addNamedPropertyUniqueNameToTable(
const OUString & rPreferredName )
{
if( ! xNameContainer.is() ||
- ! rValue.hasValue() ||
- ( rValue.getValueType() != xNameContainer->getElementType()))
+ ! rValue.hasValue() )
+ return rPreferredName;
+
+ Any aValue(rValue);
+
+ if ( rValue.has<css::awt::Gradient>())
+ {
+ // tdf#158421 the lists for Gradients needs awt::Gradient2
+ // as type, convert input data if needed (and warn about it,
+ // the caller should be changed to offer the needed type)
+ SAL_WARN("chart2","input value needs to be awt::Gradient2");
+ const basegfx::BGradient aTemp(model::gradient::getFromAny(rValue));
+ aValue <<= model::gradient::createUnoGradient2(aTemp);
+ }
+
+ if ( aValue.getValueType() != xNameContainer->getElementType())
return rPreferredName;
try
{
Reference< container::XNameAccess > xNameAccess( xNameContainer, uno::UNO_QUERY_THROW );
- auto aNames( comphelper::sequenceToContainer<std::vector< OUString >>( xNameAccess->getElementNames()));
- std::vector< OUString >::const_iterator aIt(
- std::find_if( aNames.begin(), aNames.end(), lcl_EqualsElement( rValue, xNameAccess )));
+ const uno::Sequence<OUString> aElementNames = xNameAccess->getElementNames();
+ auto it = std::find_if( aElementNames.begin(), aElementNames.end(), lcl_EqualsElement( aValue, xNameAccess ));
+
+ // element found => return name
+ if( it != aElementNames.end())
+ return *it;
// element not found in container
- if( aIt == aNames.end())
+ OUString aUniqueName;
+
+ // check if preferred name is already used
+ if( !rPreferredName.isEmpty())
+ {
+ auto aIt = std::find( aElementNames.begin(), aElementNames.end(), rPreferredName );
+ if( aIt == aElementNames.end())
+ aUniqueName = rPreferredName;
+ }
+
+ if( aUniqueName.isEmpty())
{
- OUString aUniqueName;
-
- // check if preferred name is already used
- if( !rPreferredName.isEmpty())
- {
- aIt = std::find( aNames.begin(), aNames.end(), rPreferredName );
- if( aIt == aNames.end())
- aUniqueName = rPreferredName;
- }
-
- if( aUniqueName.isEmpty())
- {
- // create a unique id using the prefix plus a number
- std::vector< sal_Int32 > aNumbers;
- std::vector< OUString >::iterator aNonConstIt(
- std::partition( aNames.begin(), aNames.end(), lcl_StringMatches( rPrefix )));
- std::transform( aNames.begin(), aNonConstIt,
- back_inserter( aNumbers ),
- lcl_OUStringRestToInt32( rPrefix.getLength() ));
- std::vector< sal_Int32 >::const_iterator aMaxIt(
- std::max_element( aNumbers.begin(), aNumbers.end()));
-
- sal_Int32 nIndex = 1;
- if( aMaxIt != aNumbers.end())
- nIndex = (*aMaxIt) + 1;
-
- aUniqueName = rPrefix + OUString::number( nIndex );
- }
-
- OSL_ASSERT( !aUniqueName.isEmpty());
- xNameContainer->insertByName( aUniqueName, rValue );
- return aUniqueName;
+ auto aNames( comphelper::sequenceToContainer<std::vector< OUString >>( aElementNames ));
+ // create a unique id using the prefix plus a number
+ std::vector< sal_Int32 > aNumbers;
+ std::vector< OUString >::iterator aNonConstIt(
+ std::partition( aNames.begin(), aNames.end(), lcl_StringMatches( rPrefix )));
+ std::transform( aNames.begin(), aNonConstIt,
+ back_inserter( aNumbers ),
+ lcl_OUStringRestToInt32( rPrefix.getLength() ));
+ std::vector< sal_Int32 >::const_iterator aMaxIt(
+ std::max_element( aNumbers.begin(), aNumbers.end()));
+
+ sal_Int32 nIndex = 1;
+ if( aMaxIt != aNumbers.end())
+ nIndex = (*aMaxIt) + 1;
+
+ aUniqueName = rPrefix + OUString::number( nIndex );
}
- else
- // element found => return name
- return *aIt;
+
+ OSL_ASSERT( !aUniqueName.isEmpty());
+ xNameContainer->insertByName( aUniqueName, aValue );
+ return aUniqueName;
}
catch( const uno::Exception & )
{
@@ -183,11 +198,11 @@ OUString addLineDashUniqueNameToTable(
if( xFact.is())
{
Reference< container::XNameContainer > xNameCnt(
- xFact->createInstance( "com.sun.star.drawing.DashTable"),
+ xFact->createInstance( u"com.sun.star.drawing.DashTable"_ustr),
uno::UNO_QUERY );
if( xNameCnt.is())
return lcl_addNamedPropertyUniqueNameToTable(
- rValue, xNameCnt, "ChartDash ", rPreferredName );
+ rValue, xNameCnt, u"ChartDash "_ustr, rPreferredName );
}
return OUString();
}
@@ -200,11 +215,11 @@ OUString addGradientUniqueNameToTable(
if( xFact.is())
{
Reference< container::XNameContainer > xNameCnt(
- xFact->createInstance( "com.sun.star.drawing.GradientTable"),
+ xFact->createInstance( u"com.sun.star.drawing.GradientTable"_ustr),
uno::UNO_QUERY );
if( xNameCnt.is())
return lcl_addNamedPropertyUniqueNameToTable(
- rValue, xNameCnt, "ChartGradient ", rPreferredName );
+ rValue, xNameCnt, u"ChartGradient "_ustr, rPreferredName );
}
return OUString();
}
@@ -217,11 +232,11 @@ OUString addTransparencyGradientUniqueNameToTable(
if( xFact.is())
{
Reference< container::XNameContainer > xNameCnt(
- xFact->createInstance( "com.sun.star.drawing.TransparencyGradientTable"),
+ xFact->createInstance( u"com.sun.star.drawing.TransparencyGradientTable"_ustr),
uno::UNO_QUERY );
if( xNameCnt.is())
return lcl_addNamedPropertyUniqueNameToTable(
- rValue, xNameCnt, "ChartTransparencyGradient ", rPreferredName );
+ rValue, xNameCnt, u"ChartTransparencyGradient "_ustr, rPreferredName );
}
return OUString();
}
@@ -234,11 +249,11 @@ OUString addHatchUniqueNameToTable(
if( xFact.is())
{
Reference< container::XNameContainer > xNameCnt(
- xFact->createInstance( "com.sun.star.drawing.HatchTable"),
+ xFact->createInstance( u"com.sun.star.drawing.HatchTable"_ustr),
uno::UNO_QUERY );
if( xNameCnt.is())
return lcl_addNamedPropertyUniqueNameToTable(
- rValue, xNameCnt, "ChartHatch ", rPreferredName );
+ rValue, xNameCnt, u"ChartHatch "_ustr, rPreferredName );
}
return OUString();
}
@@ -251,11 +266,11 @@ OUString addBitmapUniqueNameToTable(
if( xFact.is())
{
Reference< container::XNameContainer > xNameCnt(
- xFact->createInstance( "com.sun.star.drawing.BitmapTable"),
+ xFact->createInstance( u"com.sun.star.drawing.BitmapTable"_ustr),
uno::UNO_QUERY );
if( xNameCnt.is())
return lcl_addNamedPropertyUniqueNameToTable(
- rValue, xNameCnt, "ChartBitmap ", rPreferredName );
+ rValue, xNameCnt, u"ChartBitmap "_ustr, rPreferredName );
}
return OUString();
}
diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx
index 2ea659f7b708..69a2951108a4 100644
--- a/chart2/source/tools/RangeHighlighter.cxx
+++ b/chart2/source/tools/RangeHighlighter.cxx
@@ -19,9 +19,10 @@
#include <RangeHighlighter.hxx>
#include <WeakListenerAdapter.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartModel.hxx>
#include <DataSourceHelper.hxx>
#include <ObjectIdentifier.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <Diagram.hxx>
@@ -29,11 +30,10 @@
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <comphelper/sequence.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/color.hxx>
using namespace ::com::sun::star;
@@ -48,13 +48,13 @@ const Color defaultPreferredColor = COL_LIGHTBLUE;
void lcl_fillRanges(
Sequence< chart2::data::HighlightedRange > & rOutRanges,
- const Sequence< OUString >& aRangeStrings,
+ const std::vector< OUString >& aRangeStrings,
Color nPreferredColor,
sal_Int32 nIndex = -1 )
{
- rOutRanges.realloc( aRangeStrings.getLength());
+ rOutRanges.realloc( aRangeStrings.size());
auto pOutRanges = rOutRanges.getArray();
- for( sal_Int32 i=0; i<aRangeStrings.getLength(); ++i )
+ for( size_t i=0; i<aRangeStrings.size(); ++i )
{
pOutRanges[i].RangeRepresentation = aRangeStrings[i];
pOutRanges[i].PreferredColor = sal_Int32(nPreferredColor);
@@ -69,8 +69,9 @@ namespace chart
{
RangeHighlighter::RangeHighlighter(
- const Reference< view::XSelectionSupplier > & xSelectionSupplier ) :
- m_xSelectionSupplier( xSelectionSupplier ),
+ const rtl::Reference< ChartModel > & xChartModel ) :
+ m_xSelectionSupplier(xChartModel->getCurrentController(), uno::UNO_QUERY),
+ m_xChartModel( xChartModel ),
m_nAddedListenerCount( 0 ),
m_bIncludeHiddenCells(true)
{
@@ -88,22 +89,18 @@ Sequence< chart2::data::HighlightedRange > SAL_CALL RangeHighlighter::getSelecte
void RangeHighlighter::determineRanges()
{
m_aSelectedRanges.realloc( 0 );
+ if( !m_xChartModel.is())
+ return;
if( !m_xSelectionSupplier.is())
return;
try
{
- Reference< frame::XController > xController( m_xSelectionSupplier, uno::UNO_QUERY );
- Reference< frame::XModel > xChartModel;
- if( xController.is())
- xChartModel.set( xController->getModel());
-
- m_bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( xChartModel );
+ m_bIncludeHiddenCells = m_xChartModel->isIncludeHiddenCells();
uno::Any aSelection( m_xSelectionSupplier->getSelection());
- const uno::Type& rType = aSelection.getValueType();
- if ( rType == cppu::UnoType<OUString>::get() )
+ if (aSelection.getValueType() == cppu::UnoType<OUString>::get())
{
// @todo??: maybe getSelection() should return a model object rather than a CID
@@ -113,7 +110,7 @@ void RangeHighlighter::determineRanges()
{
ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID );
sal_Int32 nIndex = ObjectIdentifier::getIndexFromParticleOrCID( aCID );
- Reference< chart2::XDataSeries > xDataSeries( ObjectIdentifier::getDataSeriesForCID( aCID, xChartModel ) );
+ rtl::Reference< DataSeries > xDataSeries( ObjectIdentifier::getDataSeriesForCID( aCID, m_xChartModel ) );
if( eObjectType == OBJECTTYPE_LEGEND_ENTRY )
{
OUString aParentParticel( ObjectIdentifier::getFullParentParticle( aCID ) );
@@ -135,7 +132,7 @@ void RangeHighlighter::determineRanges()
{
// select error bar ranges, or data series, if the style is
// not set to FROM_DATA
- fillRangesForErrorBars( ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ), xDataSeries );
+ fillRangesForErrorBars( ObjectIdentifier::getObjectPropertySet( aCID, m_xChartModel ), xDataSeries );
return;
}
else if( xDataSeries.is() )
@@ -147,7 +144,7 @@ void RangeHighlighter::determineRanges()
else if( eObjectType == OBJECTTYPE_AXIS )
{
// Axis (Categories)
- Reference< chart2::XAxis > xAxis( ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ), uno::UNO_QUERY );
+ Reference< chart2::XAxis > xAxis( ObjectIdentifier::getObjectPropertySet( aCID, m_xChartModel ), uno::UNO_QUERY );
if( xAxis.is())
{
fillRangesForCategories( xAxis );
@@ -161,7 +158,7 @@ void RangeHighlighter::determineRanges()
)
{
// Diagram
- rtl::Reference< ::chart::Diagram > xDia( ObjectIdentifier::getDiagramForCID( aCID, xChartModel ) );
+ rtl::Reference< ::chart::Diagram > xDia( ObjectIdentifier::getDiagramForCID( aCID, m_xChartModel ) );
if( xDia.is())
{
fillRangesForDiagram( xDia );
@@ -170,11 +167,9 @@ void RangeHighlighter::determineRanges()
}
}
}
- else if ( rType == cppu::UnoType< drawing::XShape >::get() )
+ else if (Reference<drawing::XShape> xShape; aSelection >>= xShape)
{
// #i12587# support for shapes in chart
- Reference< drawing::XShape > xShape;
- aSelection >>= xShape;
if ( xShape.is() )
{
return;
@@ -183,8 +178,7 @@ void RangeHighlighter::determineRanges()
else
{
//if nothing is selected select all ranges
- Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY_THROW );
- fillRangesForDiagram( xChartDoc->getFirstDiagram() );
+ fillRangesForDiagram( m_xChartModel->getFirstChartDiagram() );
return;
}
}
@@ -194,28 +188,13 @@ void RangeHighlighter::determineRanges()
}
}
-void RangeHighlighter::fillRangesForDiagram( const Reference< chart2::XDiagram > & xDiagram )
-{
- Sequence< OUString > aSelectedRanges( DataSourceHelper::getUsedDataRanges( xDiagram ));
- m_aSelectedRanges.realloc( aSelectedRanges.getLength());
- auto pSelectedRanges = m_aSelectedRanges.getArray();
- // @todo: merge ranges
- for( sal_Int32 i=0; i<aSelectedRanges.getLength(); ++i )
- {
- pSelectedRanges[i].RangeRepresentation = aSelectedRanges[i];
- pSelectedRanges[i].Index = -1;
- pSelectedRanges[i].PreferredColor = sal_Int32(defaultPreferredColor);
- pSelectedRanges[i].AllowMerginigWithOtherRanges = true;
- }
-}
-
void RangeHighlighter::fillRangesForDiagram( const rtl::Reference< Diagram > & xDiagram )
{
- Sequence< OUString > aSelectedRanges( DataSourceHelper::getUsedDataRanges( xDiagram ));
- m_aSelectedRanges.realloc( aSelectedRanges.getLength());
+ std::vector< OUString > aSelectedRanges( DataSourceHelper::getUsedDataRanges( xDiagram ));
+ m_aSelectedRanges.realloc( aSelectedRanges.size());
auto pSelectedRanges = m_aSelectedRanges.getArray();
// @todo: merge ranges
- for( sal_Int32 i=0; i<aSelectedRanges.getLength(); ++i )
+ for( size_t i=0; i<aSelectedRanges.size(); ++i )
{
pSelectedRanges[i].RangeRepresentation = aSelectedRanges[i];
pSelectedRanges[i].Index = -1;
@@ -246,7 +225,7 @@ void RangeHighlighter::fillRangesForErrorBars(
sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
bUsesRangesAsErrorBars =
( xErrorBar.is() &&
- (xErrorBar->getPropertyValue( "ErrorBarStyle") >>= nStyle) &&
+ (xErrorBar->getPropertyValue( u"ErrorBarStyle"_ustr) >>= nStyle) &&
nStyle == css::chart::ErrorBarStyle::FROM_DATA );
}
catch( const uno::Exception & )
@@ -280,19 +259,15 @@ void RangeHighlighter::fillRangesForCategories( const Reference< chart2::XAxis >
defaultPreferredColor );
}
-void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface > & xDataSeries, sal_Int32 nIndex )
+void RangeHighlighter::fillRangesForDataPoint( const rtl::Reference< DataSeries > & xDataSeries, sal_Int32 nIndex )
{
if( !xDataSeries.is())
return;
- Reference< chart2::data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY );
- if( !xSource.is() )
- return;
-
Color nPreferredColor = defaultPreferredColor;
std::vector< chart2::data::HighlightedRange > aHilightedRanges;
- const Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeqSeq( xSource->getDataSequences());
- for( Reference< chart2::data::XLabeledDataSequence > const & labelDataSeq : aLSeqSeq )
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aLSeqSeq( xDataSeries->getDataSequences2());
+ for( uno::Reference< chart2::data::XLabeledDataSequence > const & labelDataSeq : aLSeqSeq )
{
Reference< chart2::data::XDataSequence > xLabel( labelDataSeq->getLabel());
Reference< chart2::data::XDataSequence > xValues( labelDataSeq->getValues());
diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx
index ba9b497dac20..d7ae7f76a2fd 100644
--- a/chart2/source/tools/ReferenceSizeProvider.cxx
+++ b/chart2/source/tools/ReferenceSizeProvider.cxx
@@ -19,20 +19,20 @@
#include <ReferenceSizeProvider.hxx>
#include <RelativeSizeHelper.hxx>
-#include <ChartModelHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <ChartModel.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
#include <Diagram.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XTitled.hpp>
-#include <com/sun/star/chart2/XTitle.hpp>
-#include <com/sun/star/chart2/XDataSeries.hpp>
-#include <tools/diagnose_ex.h>
+#include <Legend.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <vector>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -42,7 +42,7 @@ namespace chart
ReferenceSizeProvider::ReferenceSizeProvider(
awt::Size aPageSize,
- const Reference< XChartDocument > & xChartDoc ) :
+ const rtl::Reference<::chart::ChartModel> & xChartDoc ) :
m_aPageSize( aPageSize ),
m_xChartDoc( xChartDoc ),
m_bUseAutoScale( getAutoResizeState( xChartDoc ) == AUTO_RESIZE_YES )
@@ -67,7 +67,7 @@ void ReferenceSizeProvider::setValuesAtTitle(
Reference< beans::XPropertySet > xTitleProp( xTitle, uno::UNO_QUERY_THROW );
awt::Size aOldRefSize;
bool bHasOldRefSize(
- xTitleProp->getPropertyValue( "ReferencePageSize") >>= aOldRefSize );
+ xTitleProp->getPropertyValue( u"ReferencePageSize"_ustr) >>= aOldRefSize );
// set from auto-resize on to off -> adapt font sizes at XFormattedStrings
if( bHasOldRefSize && ! useAutoScale())
@@ -92,36 +92,37 @@ void ReferenceSizeProvider::setValuesAtTitle(
void ReferenceSizeProvider::setValuesAtAllDataSeries()
{
- Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( m_xChartDoc ));
+ if (!m_xChartDoc)
+ return;
+ rtl::Reference< Diagram > xDiagram( m_xChartDoc->getFirstChartDiagram());
+ if (!xDiagram)
+ return;
// DataSeries/Points
- std::vector< Reference< XDataSeries > > aSeries(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeries =
+ xDiagram->getDataSeries();
for (auto const& elem : aSeries)
{
- Reference< beans::XPropertySet > xSeriesProp(elem, uno::UNO_QUERY );
- if( xSeriesProp.is())
+ // data points
+ Sequence< sal_Int32 > aPointIndexes;
+ try
{
- // data points
- Sequence< sal_Int32 > aPointIndexes;
- try
- {
- if( xSeriesProp->getPropertyValue( "AttributedDataPoints") >>= aPointIndexes )
- {
- for( sal_Int32 idx : std::as_const(aPointIndexes) )
- setValuesAtPropertySet(
- elem->getDataPointByIndex( idx ) );
- }
- }
- catch (const uno::Exception&)
+ // "AttributedDataPoints"
+ if( elem->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS) >>= aPointIndexes )
{
- DBG_UNHANDLED_EXCEPTION("chart2");
+ for (sal_Int32 idx : aPointIndexes)
+ setValuesAtPropertySet(
+ elem->getDataPointByIndex( idx ) );
}
-
- //it is important to correct the datapoint properties first as they do reference the series properties
- setValuesAtPropertySet( xSeriesProp );
}
+ catch (const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ //it is important to correct the datapoint properties first as they do reference the series properties
+ setValuesAtPropertySet( elem );
}
}
@@ -132,7 +133,7 @@ void ReferenceSizeProvider::setValuesAtPropertySet(
if( ! xProp.is())
return;
- static constexpr OUStringLiteral aRefSizeName = u"ReferencePageSize";
+ static constexpr OUString aRefSizeName = u"ReferencePageSize"_ustr;
try
{
@@ -173,7 +174,7 @@ void ReferenceSizeProvider::getAutoResizeFromPropSet(
{
try
{
- if( xProp->getPropertyValue( "ReferencePageSize" ).hasValue())
+ if( xProp->getPropertyValue( u"ReferencePageSize"_ustr ).hasValue())
eSingleState = AUTO_RESIZE_YES;
else
eSingleState = AUTO_RESIZE_NO;
@@ -218,84 +219,74 @@ void ReferenceSizeProvider::impl_getAutoResizeFromTitled(
with state NO, AUTO_RESIZE_AMBIGUOUS is returned.
*/
ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState(
- const Reference< XChartDocument > & xChartDoc )
+ const rtl::Reference<::chart::ChartModel> & xChartDoc )
{
AutoResizeState eResult = AUTO_RESIZE_UNKNOWN;
// Main Title
- Reference< XTitled > xDocTitled( xChartDoc, uno::UNO_QUERY );
- if( xDocTitled.is())
- impl_getAutoResizeFromTitled( xDocTitled, eResult );
- if( eResult == AUTO_RESIZE_AMBIGUOUS )
+ if( xChartDoc.is())
+ impl_getAutoResizeFromTitled( xChartDoc, eResult );
+ if (eResult == AUTO_RESIZE_AMBIGUOUS
+ || eResult == AUTO_RESIZE_UNKNOWN) // Unknown when xChartDoc is null.
return eResult;
// diagram is needed by the rest of the objects
- Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( xChartDoc );
+ rtl::Reference< Diagram > xDiagram = xChartDoc->getFirstChartDiagram();
if( ! xDiagram.is())
return eResult;
// Sub Title
- Reference< XTitled > xDiaTitled( xDiagram, uno::UNO_QUERY );
- if( xDiaTitled.is())
- impl_getAutoResizeFromTitled( xDiaTitled, eResult );
+ if( xDiagram.is())
+ impl_getAutoResizeFromTitled( xDiagram, eResult );
if( eResult == AUTO_RESIZE_AMBIGUOUS )
return eResult;
// Legend
- Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xLegendProp.is())
- getAutoResizeFromPropSet( xLegendProp, eResult );
+ rtl::Reference< Legend > xLegend( xDiagram->getLegend2() );
+ if( xLegend.is())
+ getAutoResizeFromPropSet( xLegend, eResult );
if( eResult == AUTO_RESIZE_AMBIGUOUS )
return eResult;
// Axes (incl. Axis Titles)
- const Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( Reference< XAxis > const & axis : aAxes )
+ const std::vector< rtl::Reference< Axis > > aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
+ for( rtl::Reference< Axis > const & axis : aAxes )
{
- Reference< beans::XPropertySet > xProp( axis, uno::UNO_QUERY );
- if( xProp.is())
- getAutoResizeFromPropSet( xProp, eResult );
- Reference< XTitled > xTitled( axis, uno::UNO_QUERY );
- if( xTitled.is())
- {
- impl_getAutoResizeFromTitled( xTitled, eResult );
- if( eResult == AUTO_RESIZE_AMBIGUOUS )
- return eResult;
- }
+ getAutoResizeFromPropSet( axis, eResult );
+ impl_getAutoResizeFromTitled( axis, eResult );
+ if( eResult == AUTO_RESIZE_AMBIGUOUS )
+ return eResult;
}
// DataSeries/Points
- std::vector< Reference< XDataSeries > > aSeries(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+ std::vector< rtl::Reference< DataSeries > > aSeries =
+ xDiagram->getDataSeries();
for (auto const& elem : aSeries)
{
- Reference< beans::XPropertySet > xSeriesProp(elem, uno::UNO_QUERY);
- if( xSeriesProp.is())
- {
- getAutoResizeFromPropSet( xSeriesProp, eResult );
- if( eResult == AUTO_RESIZE_AMBIGUOUS )
- return eResult;
+ getAutoResizeFromPropSet( elem, eResult );
+ if( eResult == AUTO_RESIZE_AMBIGUOUS )
+ return eResult;
- // data points
- Sequence< sal_Int32 > aPointIndexes;
- try
+ // data points
+ Sequence< sal_Int32 > aPointIndexes;
+ try
+ {
+ // "AttributedDataPoints"
+ if( elem->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS) >>= aPointIndexes )
{
- if( xSeriesProp->getPropertyValue( "AttributedDataPoints") >>= aPointIndexes )
+ for (sal_Int32 idx : aPointIndexes)
{
- for( sal_Int32 idx : std::as_const(aPointIndexes) )
- {
- getAutoResizeFromPropSet(
- elem->getDataPointByIndex( idx ), eResult );
- if( eResult == AUTO_RESIZE_AMBIGUOUS )
- return eResult;
- }
+ getAutoResizeFromPropSet(
+ elem->getDataPointByIndex( idx ), eResult );
+ if( eResult == AUTO_RESIZE_AMBIGUOUS )
+ return eResult;
}
}
- catch (const uno::Exception&)
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
+ }
+ catch (const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
}
}
@@ -315,29 +306,27 @@ void ReferenceSizeProvider::setAutoResizeState( ReferenceSizeProvider::AutoResiz
m_bUseAutoScale = (eNewState == AUTO_RESIZE_YES);
// Main Title
- impl_setValuesAtTitled( Reference< XTitled >( m_xChartDoc, uno::UNO_QUERY ));
+ impl_setValuesAtTitled( m_xChartDoc );
// diagram is needed by the rest of the objects
- Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( m_xChartDoc );
+ rtl::Reference< Diagram > xDiagram = m_xChartDoc->getFirstChartDiagram();
if( ! xDiagram.is())
return;
// Sub Title
- impl_setValuesAtTitled( Reference< XTitled >( xDiagram, uno::UNO_QUERY ));
+ impl_setValuesAtTitled( xDiagram );
// Legend
- Reference< beans::XPropertySet > xLegendProp( xDiagram->getLegend(), uno::UNO_QUERY );
- if( xLegendProp.is())
- setValuesAtPropertySet( xLegendProp );
+ rtl::Reference< Legend > xLegend( xDiagram->getLegend2() );
+ if( xLegend.is())
+ setValuesAtPropertySet( xLegend );
// Axes (incl. Axis Titles)
- const Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( Reference< XAxis > const & axis : aAxes )
+ const std::vector< rtl::Reference< Axis > > aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
+ for( rtl::Reference< Axis > const & axis : aAxes )
{
- Reference< beans::XPropertySet > xProp( axis, uno::UNO_QUERY );
- if( xProp.is())
- setValuesAtPropertySet( xProp );
- impl_setValuesAtTitled( Reference< XTitled >( axis, uno::UNO_QUERY ));
+ setValuesAtPropertySet( axis );
+ impl_setValuesAtTitled( axis );
}
// DataSeries/Points
diff --git a/chart2/source/tools/RegressionCurveCalculator.cxx b/chart2/source/tools/RegressionCurveCalculator.cxx
index fbf5d243bdb9..36cb6c4c621a 100644
--- a/chart2/source/tools/RegressionCurveCalculator.cxx
+++ b/chart2/source/tools/RegressionCurveCalculator.cxx
@@ -42,8 +42,8 @@ RegressionCurveCalculator::RegressionCurveCalculator()
, mForceIntercept(false)
, mInterceptValue(std::numeric_limits<double>::quiet_NaN())
, mPeriod(2)
- , mXName("x")
- , mYName("f(x)")
+ , mXName(u"x"_ustr)
+ , mYName(u"f(x)"_ustr)
, mnMovingType(0)
{
}
@@ -75,6 +75,8 @@ void RegressionCurveCalculator::setRegressionProperties(
sal_Int32 aPeriod,
sal_Int32 nMovingType )
{
+ if( aPeriod < 0 )
+ throw lang::IllegalArgumentException(u"aPeriod may not be < 0"_ustr, static_cast<cppu::OWeakObject*>(this), 3);
mDegree = aDegree;
mForceIntercept = aForceIntercept;
mInterceptValue = aInterceptValue;
@@ -88,19 +90,17 @@ OUString RegressionCurveCalculator::getFormattedString(
double fNumber, const sal_Int32* pStringLength /* = nullptr */ )
{
if ( pStringLength && *pStringLength <= 0 )
- return "###";
+ return u"###"_ustr;
OUString aResult;
if( xNumFormatter.is() )
{
- bool bStandard = ::cppu::any2bool( ::comphelper::getNumberFormatProperty( xNumFormatter, nNumberFormatKey, "StandardFormat" ) );
+ bool bStandard = ::cppu::any2bool( ::comphelper::getNumberFormatProperty( xNumFormatter, nNumberFormatKey, u"StandardFormat"_ustr ) );
if( pStringLength && bStandard )
{ // round fNumber to *pStringLength characters
const sal_Int32 nMinDigit = 6; // minimum significant digits for General format
sal_Int32 nSignificantDigit = ( *pStringLength <= nMinDigit ? nMinDigit : *pStringLength );
- aResult = OStringToOUString(
- ::rtl::math::doubleToString( fNumber, rtl_math_StringFormat_G1, nSignificantDigit, '.', true ),
- RTL_TEXTENCODING_ASCII_US );
+ aResult = ::rtl::math::doubleToUString( fNumber, rtl_math_StringFormat_G1, nSignificantDigit, '.', true );
// count characters different from significant digits (decimal separator, scientific notation)
sal_Int32 nExtraChar = aResult.getLength() - *pStringLength;
if ( nExtraChar > 0 && *pStringLength > nMinDigit )
@@ -108,9 +108,7 @@ OUString RegressionCurveCalculator::getFormattedString(
nSignificantDigit = *pStringLength - nExtraChar;
if ( nSignificantDigit < nMinDigit )
nSignificantDigit = nMinDigit;
- aResult = OStringToOUString(
- ::rtl::math::doubleToString( fNumber, rtl_math_StringFormat_G1, nSignificantDigit, '.', true ),
- RTL_TEXTENCODING_ASCII_US );
+ aResult = ::rtl::math::doubleToUString( fNumber, rtl_math_StringFormat_G1, nSignificantDigit, '.', true );
}
fNumber = ::rtl::math::stringToDouble( aResult, '.', ',' );
}
@@ -121,9 +119,7 @@ OUString RegressionCurveCalculator::getFormattedString(
sal_Int32 nStringLength = 4; // default length
if ( pStringLength )
nStringLength = *pStringLength;
- aResult = OStringToOUString(
- ::rtl::math::doubleToString( fNumber, rtl_math_StringFormat_G1, nStringLength, '.', true ),
- RTL_TEXTENCODING_ASCII_US );
+ aResult = ::rtl::math::doubleToUString( fNumber, rtl_math_StringFormat_G1, nStringLength, '.', true );
}
return aResult;
}
@@ -135,7 +131,7 @@ Sequence< geometry::RealPoint2D > SAL_CALL RegressionCurveCalculator::getCurveVa
sal_Bool /* bMaySkipPointsInCalculation */ )
{
if( nPointCount < 2 )
- throw lang::IllegalArgumentException("too few points", static_cast<cppu::OWeakObject*>(this), 2);
+ throw lang::IllegalArgumentException(u"too few points"_ustr, static_cast<cppu::OWeakObject*>(this), 2);
// determine if scaling and inverse scaling for x-values work
bool bDoXScaling( xScalingX.is());
@@ -209,11 +205,11 @@ void RegressionCurveCalculator::addStringToEquation(
void SAL_CALL RegressionCurveCalculator::setXYNames( const OUString& aXName, const OUString& aYName )
{
if ( aXName.isEmpty() )
- mXName = OUString ("x");
+ mXName = u"x"_ustr;
else
mXName = aXName;
if ( aYName.isEmpty() )
- mYName = OUString ("f(x)");
+ mYName = u"f(x)"_ustr;
else
mYName = aYName;
}
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index 1df7ac904da8..f7a773e5a0c8 100644
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cstddef>
+
#include <RegressionCurveHelper.hxx>
#include <MeanValueRegressionCurveCalculator.hxx>
#include <LinearRegressionCurveCalculator.hxx>
@@ -26,16 +30,19 @@
#include <ExponentialRegressionCurveCalculator.hxx>
#include <PotentialRegressionCurveCalculator.hxx>
#include <CommonConverters.hxx>
-#include "RegressionCurveModel.hxx"
+#include <RegressionCurveModel.hxx>
#include <ChartTypeHelper.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartType.hxx>
+#include <ChartModel.hxx>
+#include <DataSeries.hxx>
#include <ResId.hxx>
#include <strings.hrc>
-#include <DiagramHelper.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/XRegressionCurveCalculator.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-#include <tools/diagnose_ex.h>
+#include <com/sun/star/chart2/data/XDataSource.hpp>
+#include <o3tl/safeint.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/property.hxx>
using namespace ::com::sun::star;
@@ -85,15 +92,15 @@ OUString lcl_getServiceNameForType(SvxChartRegress eType)
namespace chart
{
-Reference< XRegressionCurve > RegressionCurveHelper::createMeanValueLine()
+rtl::Reference< RegressionCurveModel > RegressionCurveHelper::createMeanValueLine()
{
- return Reference< XRegressionCurve >( new MeanValueRegressionCurve );
+ return new MeanValueRegressionCurve;
}
-Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServiceName(
+rtl::Reference< RegressionCurveModel > RegressionCurveHelper::createRegressionCurveByServiceName(
std::u16string_view aServiceName )
{
- Reference< XRegressionCurve > xResult;
+ rtl::Reference< RegressionCurveModel > xResult;
// todo: use factory methods with service name
if( aServiceName == u"com.sun.star.chart2.LinearRegressionCurve" )
@@ -124,10 +131,10 @@ Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServ
return xResult;
}
-Reference< XRegressionCurveCalculator > RegressionCurveHelper::createRegressionCurveCalculatorByServiceName(
+rtl::Reference< RegressionCurveCalculator > RegressionCurveHelper::createRegressionCurveCalculatorByServiceName(
std::u16string_view aServiceName )
{
- Reference< XRegressionCurveCalculator > xResult;
+ rtl::Reference< RegressionCurveCalculator > xResult;
// todo: use factory methods with service name
if( aServiceName == u"com.sun.star.chart2.MeanValueRegressionCurve" )
@@ -163,18 +170,25 @@ Reference< XRegressionCurveCalculator > RegressionCurveHelper::createRegressionC
}
void RegressionCurveHelper::initializeCurveCalculator(
- const Reference< XRegressionCurveCalculator > & xOutCurveCalculator,
- const Reference< data::XDataSource > & xSource,
- bool bUseXValuesIfAvailable /* = true */ )
+ const rtl::Reference< RegressionCurveCalculator > & xOutCurveCalculator,
+ const rtl::Reference< ::chart::DataSeries > & xSeries,
+ const rtl::Reference<::chart::ChartModel> & xModel )
{
+ sal_Int32 nAxisType = AxisType::CATEGORY;
+ auto xChartType = xModel->getChartTypeOfSeries(xSeries);
+ if (xChartType.is())
+ nAxisType = xChartType->getAxisType(0); // x-axis
+
+ bool bUseXValuesIfAvailable = (nAxisType == AxisType::REALNUMBER);
+
if( ! (xOutCurveCalculator.is() &&
- xSource.is() ))
+ xSeries.is() ))
return;
Sequence< double > aXValues, aYValues;
bool bXValuesFound = false, bYValuesFound = false;
- Sequence< Reference< data::XLabeledDataSequence > > aDataSeqs( xSource->getDataSequences());
+ Sequence< Reference< data::XLabeledDataSequence > > aDataSeqs( xSeries->getDataSequences());
sal_Int32 i = 0;
for( i=0;
! (bXValuesFound && bYValuesFound) && i<aDataSeqs.getLength();
@@ -185,7 +199,7 @@ void RegressionCurveHelper::initializeCurveCalculator(
Reference< data::XDataSequence > xSeq( aDataSeqs[i]->getValues());
Reference< XPropertySet > xProp( xSeq, uno::UNO_QUERY_THROW );
OUString aRole;
- if( xProp->getPropertyValue( "Role" ) >>= aRole )
+ if( xProp->getPropertyValue( u"Role"_ustr ) >>= aRole )
{
if( bUseXValuesIfAvailable && !bXValuesFound && aRole == "values-x" )
{
@@ -223,19 +237,6 @@ void RegressionCurveHelper::initializeCurveCalculator(
xOutCurveCalculator->recalculateRegression( aXValues, aYValues );
}
-void RegressionCurveHelper::initializeCurveCalculator(
- const Reference< XRegressionCurveCalculator > & xOutCurveCalculator,
- const Reference< XDataSeries > & xSeries,
- const Reference< frame::XModel > & xModel )
-{
- sal_Int32 nAxisType = ChartTypeHelper::getAxisType(
- ChartModelHelper::getChartTypeOfSeries( xModel, xSeries ), 0 ); // x-axis
-
- initializeCurveCalculator( xOutCurveCalculator,
- uno::Reference< data::XDataSource >( xSeries, uno::UNO_QUERY ),
- (nAxisType == AxisType::REALNUMBER) );
-}
-
bool RegressionCurveHelper::hasMeanValueLine(
const uno::Reference< XRegressionCurveContainer > & xRegCnt )
{
@@ -260,6 +261,28 @@ bool RegressionCurveHelper::hasMeanValueLine(
return false;
}
+bool RegressionCurveHelper::hasMeanValueLine(
+ const rtl::Reference< DataSeries > & xRegCnt )
+{
+ if( !xRegCnt.is())
+ return false;
+
+ try
+ {
+ for( rtl::Reference< RegressionCurveModel > const & curve : xRegCnt->getRegressionCurves2() )
+ {
+ if( isMeanValueLine( curve ))
+ return true;
+ }
+ }
+ catch( const Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ return false;
+}
+
bool RegressionCurveHelper::isMeanValueLine(
const uno::Reference< chart2::XRegressionCurve > & xRegCurve )
{
@@ -269,7 +292,15 @@ bool RegressionCurveHelper::isMeanValueLine(
"com.sun.star.chart2.MeanValueRegressionCurve";
}
-uno::Reference< chart2::XRegressionCurve >
+bool RegressionCurveHelper::isMeanValueLine(
+ const rtl::Reference< RegressionCurveModel > & xRegCurve )
+{
+ return xRegCurve.is() &&
+ xRegCurve->getServiceName() ==
+ "com.sun.star.chart2.MeanValueRegressionCurve";
+}
+
+rtl::Reference< RegressionCurveModel >
RegressionCurveHelper::getMeanValueLine(
const uno::Reference< chart2::XRegressionCurveContainer > & xRegCnt )
{
@@ -282,6 +313,29 @@ uno::Reference< chart2::XRegressionCurve >
for( uno::Reference< XRegressionCurve > const & curve : aCurves )
{
if( isMeanValueLine( curve ))
+ return dynamic_cast<RegressionCurveModel*>(curve.get());
+ }
+ }
+ catch( const Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ }
+
+ return nullptr;
+}
+
+rtl::Reference< RegressionCurveModel >
+ RegressionCurveHelper::getMeanValueLine(
+ const rtl::Reference< DataSeries > & xRegCnt )
+{
+ if( xRegCnt.is())
+ {
+ try
+ {
+ for( rtl::Reference< RegressionCurveModel > const & curve : xRegCnt->getRegressionCurves2() )
+ {
+ if( isMeanValueLine( curve ))
return curve;
}
}
@@ -291,7 +345,7 @@ uno::Reference< chart2::XRegressionCurve >
}
}
- return uno::Reference< chart2::XRegressionCurve >();
+ return nullptr;
}
void RegressionCurveHelper::addMeanValueLine(
@@ -303,20 +357,38 @@ void RegressionCurveHelper::addMeanValueLine(
return;
// todo: use a valid context
- uno::Reference< XRegressionCurve > xCurve( createMeanValueLine() );
+ rtl::Reference< RegressionCurveModel > xCurve( createMeanValueLine() );
xRegCnt->addRegressionCurve( xCurve );
if( xSeriesProp.is())
{
- uno::Reference< XPropertySet > xProp( xCurve, uno::UNO_QUERY );
- if( xProp.is())
+ if( xCurve.is())
{
- xProp->setPropertyValue( "LineColor",
- xSeriesProp->getPropertyValue( "Color"));
+ xCurve->setPropertyValue( u"LineColor"_ustr,
+ xSeriesProp->getPropertyValue( u"Color"_ustr));
}
}
}
+void RegressionCurveHelper::addMeanValueLine(
+ rtl::Reference< DataSeries > const & xRegCnt,
+ const uno::Reference< XPropertySet > & xSeriesProp )
+{
+ if( !xRegCnt.is() ||
+ ::chart::RegressionCurveHelper::hasMeanValueLine( xRegCnt ) )
+ return;
+
+ // todo: use a valid context
+ rtl::Reference< RegressionCurveModel > xCurve( createMeanValueLine() );
+ xRegCnt->addRegressionCurve( xCurve );
+
+ if( xSeriesProp.is())
+ {
+ xCurve->setPropertyValue( u"LineColor"_ustr,
+ xSeriesProp->getPropertyValue( u"Color"_ustr));
+ }
+}
+
void RegressionCurveHelper::removeMeanValueLine(
Reference< XRegressionCurveContainer > const & xRegCnt )
{
@@ -346,13 +418,40 @@ void RegressionCurveHelper::removeMeanValueLine(
}
}
-uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::addRegressionCurve(
+void RegressionCurveHelper::removeMeanValueLine(
+ rtl::Reference< DataSeries > const & xRegCnt )
+{
+ if( !xRegCnt.is())
+ return;
+
+ try
+ {
+ for( rtl::Reference< RegressionCurveModel > const & curve : xRegCnt->getRegressionCurves2() )
+ {
+ if( isMeanValueLine( curve ))
+ {
+ xRegCnt->removeRegressionCurve( curve );
+ // attention: the iterator i has become invalid now
+
+ // note: assume that there is only one mean-value curve
+ // to remove multiple mean-value curves remove the break
+ break;
+ }
+ }
+ }
+ catch( const Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+}
+
+rtl::Reference< RegressionCurveModel > RegressionCurveHelper::addRegressionCurve(
SvxChartRegress eType,
uno::Reference< XRegressionCurveContainer > const & xRegressionCurveContainer,
const uno::Reference< beans::XPropertySet >& xPropertySource,
const uno::Reference< beans::XPropertySet >& xEquationProperties )
{
- uno::Reference< chart2::XRegressionCurve > xCurve;
+ rtl::Reference< RegressionCurveModel > xCurve;
if( !xRegressionCurveContainer.is() )
return xCurve;
@@ -367,24 +466,20 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::addRegressionC
if( !aServiceName.isEmpty())
{
// todo: use a valid context
- xCurve.set( createRegressionCurveByServiceName( aServiceName ) );
+ xCurve = createRegressionCurveByServiceName( aServiceName );
if( xEquationProperties.is())
xCurve->setEquationProperties( xEquationProperties );
- uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
- if( xProperties.is())
+ if( xPropertySource.is())
+ comphelper::copyProperties( xPropertySource, xCurve );
+ else
{
- if( xPropertySource.is())
- comphelper::copyProperties( xPropertySource, xProperties );
- else
+ uno::Reference< XPropertySet > xSeriesProp( xRegressionCurveContainer, uno::UNO_QUERY );
+ if( xSeriesProp.is())
{
- uno::Reference< XPropertySet > xSeriesProp( xRegressionCurveContainer, uno::UNO_QUERY );
- if( xSeriesProp.is())
- {
- xProperties->setPropertyValue( "LineColor",
- xSeriesProp->getPropertyValue( "Color"));
- }
+ xCurve->setPropertyValue( u"LineColor"_ustr,
+ xSeriesProp->getPropertyValue( u"Color"_ustr));
}
}
}
@@ -393,67 +488,98 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::addRegressionC
return xCurve;
}
+rtl::Reference< RegressionCurveModel > RegressionCurveHelper::addRegressionCurve(
+ SvxChartRegress eType,
+ rtl::Reference< DataSeries > const & xRegressionCurveContainer,
+ const uno::Reference< beans::XPropertySet >& xPropertySource,
+ const uno::Reference< beans::XPropertySet >& xEquationProperties )
+{
+ rtl::Reference< RegressionCurveModel > xCurve;
+
+ if( !xRegressionCurveContainer.is() )
+ return xCurve;
+
+ if( eType == SvxChartRegress::NONE )
+ {
+ OSL_FAIL("don't create a regression curve of type none");
+ return xCurve;
+ }
+
+ OUString aServiceName( lcl_getServiceNameForType( eType ));
+ if( !aServiceName.isEmpty())
+ {
+ // todo: use a valid context
+ xCurve = createRegressionCurveByServiceName( aServiceName );
+
+ if( xEquationProperties.is())
+ xCurve->setEquationProperties( xEquationProperties );
+
+ if( xPropertySource.is())
+ comphelper::copyProperties( xPropertySource, xCurve );
+ else
+ {
+ xCurve->setPropertyValue( u"LineColor"_ustr,
+ xRegressionCurveContainer->getPropertyValue( u"Color"_ustr));
+ }
+ }
+ xRegressionCurveContainer->addRegressionCurve( xCurve );
+
+ return xCurve;
+}
+
/** removes all regression curves that are not of type mean value
and returns true, if anything was removed
*/
bool RegressionCurveHelper::removeAllExceptMeanValueLine(
- uno::Reference< chart2::XRegressionCurveContainer > const & xRegCnt )
+ rtl::Reference< DataSeries > const & xRegCnt )
{
+ if( !xRegCnt.is())
+ return false;
+
bool bRemovedSomething = false;
- if( xRegCnt.is())
+ try
{
- try
+ std::vector< rtl::Reference< RegressionCurveModel > > aCurvesToDelete;
+ for( rtl::Reference< RegressionCurveModel > const & curve : xRegCnt->getRegressionCurves2() )
{
- const uno::Sequence< uno::Reference< chart2::XRegressionCurve > > aCurves(
- xRegCnt->getRegressionCurves());
- std::vector< uno::Reference< chart2::XRegressionCurve > > aCurvesToDelete;
- for( uno::Reference< chart2::XRegressionCurve > const & curve : aCurves )
- {
- if( ! isMeanValueLine( curve ))
- {
- aCurvesToDelete.push_back( curve );
- }
- }
-
- for (auto const& curveToDelete : aCurvesToDelete)
+ if( ! isMeanValueLine( curve ))
{
- xRegCnt->removeRegressionCurve(curveToDelete);
- bRemovedSomething = true;
+ aCurvesToDelete.push_back( curve );
}
}
- catch( const uno::Exception & )
+
+ for (auto const& curveToDelete : aCurvesToDelete)
{
- DBG_UNHANDLED_EXCEPTION("chart2");
+ xRegCnt->removeRegressionCurve(curveToDelete);
+ bRemovedSomething = true;
}
}
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
return bRemovedSomething;
}
void RegressionCurveHelper::removeEquations(
- uno::Reference< chart2::XRegressionCurveContainer > const & xRegCnt )
+ rtl::Reference< DataSeries > const & xRegCnt )
{
if( !xRegCnt.is())
return;
try
{
- const uno::Sequence< uno::Reference< chart2::XRegressionCurve > > aCurves(
- xRegCnt->getRegressionCurves());
- for( uno::Reference< chart2::XRegressionCurve > const & curve : aCurves )
+ for( rtl::Reference< RegressionCurveModel > const & curve : xRegCnt->getRegressionCurves2() )
{
if( !isMeanValueLine( curve ) )
{
- uno::Reference< chart2::XRegressionCurve > xRegCurve( curve );
- if( xRegCurve.is() )
+ uno::Reference< beans::XPropertySet > xEqProp( curve->getEquationProperties() ) ;
+ if( xEqProp.is())
{
- uno::Reference< beans::XPropertySet > xEqProp( xRegCurve->getEquationProperties() ) ;
- if( xEqProp.is())
- {
- xEqProp->setPropertyValue( "ShowEquation", uno::Any( false ));
- xEqProp->setPropertyValue( "XName", uno::Any( OUString("x") ));
- xEqProp->setPropertyValue( "YName", uno::Any( OUString("f(x) ") ));
- xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::Any( false ));
- }
+ xEqProp->setPropertyValue( u"ShowEquation"_ustr, uno::Any( false ));
+ xEqProp->setPropertyValue( u"XName"_ustr, uno::Any( u"x"_ustr ));
+ xEqProp->setPropertyValue( u"YName"_ustr, uno::Any( u"f(x) "_ustr ));
+ xEqProp->setPropertyValue( u"ShowCorrelationCoefficient"_ustr, uno::Any( false ));
}
}
}
@@ -464,7 +590,7 @@ void RegressionCurveHelper::removeEquations(
}
}
-uno::Reference< XRegressionCurve > RegressionCurveHelper::changeRegressionCurveType(
+rtl::Reference< RegressionCurveModel > RegressionCurveHelper::changeRegressionCurveType(
SvxChartRegress eType,
uno::Reference< XRegressionCurveContainer > const & xRegressionCurveContainer,
uno::Reference< XRegressionCurve > const & xRegressionCurve )
@@ -477,7 +603,7 @@ uno::Reference< XRegressionCurve > RegressionCurveHelper::changeRegressionCurveT
xRegressionCurve->getEquationProperties());
}
-uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getFirstCurveNotMeanValueLine(
+rtl::Reference< RegressionCurveModel > RegressionCurveHelper::getFirstCurveNotMeanValueLine(
const Reference< XRegressionCurveContainer > & xRegCnt )
{
if( !xRegCnt.is())
@@ -491,6 +617,30 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getFirstCurveN
{
if( ! isMeanValueLine( curve ))
{
+ return dynamic_cast<RegressionCurveModel*>(curve.get());
+ }
+ }
+ }
+ catch( const Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ return nullptr;
+}
+
+rtl::Reference< RegressionCurveModel > RegressionCurveHelper::getFirstCurveNotMeanValueLine(
+ const rtl::Reference< DataSeries > & xRegCnt )
+{
+ if( !xRegCnt.is())
+ return nullptr;
+
+ try
+ {
+ for( rtl::Reference< RegressionCurveModel > const & curve : xRegCnt->getRegressionCurves2() )
+ {
+ if( ! isMeanValueLine( curve ))
+ {
return curve;
}
}
@@ -503,8 +653,8 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getFirstCurveN
return nullptr;
}
-uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getRegressionCurveAtIndex(
- const Reference< XRegressionCurveContainer >& xCurveContainer,
+rtl::Reference< RegressionCurveModel > RegressionCurveHelper::getRegressionCurveAtIndex(
+ const rtl::Reference< DataSeries >& xCurveContainer,
sal_Int32 aIndex )
{
if( !xCurveContainer.is())
@@ -512,8 +662,8 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getRegressionC
try
{
- uno::Sequence< uno::Reference< chart2::XRegressionCurve > > aCurves(xCurveContainer->getRegressionCurves());
- if(0 <= aIndex && aIndex < aCurves.getLength())
+ const std::vector< rtl::Reference< RegressionCurveModel > > aCurves(xCurveContainer->getRegressionCurves2());
+ if(0 <= aIndex && o3tl::make_unsigned(aIndex) < aCurves.size())
{
if(!isMeanValueLine(aCurves[aIndex]))
return aCurves[aIndex];
@@ -601,7 +751,7 @@ SvxChartRegress RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine(
return eResult;
}
-OUString RegressionCurveHelper::getUINameForRegressionCurve( const Reference< XRegressionCurve >& xRegressionCurve )
+OUString RegressionCurveHelper::getUINameForRegressionCurve( const rtl::Reference< RegressionCurveModel >& xRegressionCurve )
{
OUString aResult = getRegressionCurveSpecificName(xRegressionCurve);
if (aResult.isEmpty())
@@ -615,17 +765,13 @@ OUString RegressionCurveHelper::getUINameForRegressionCurve( const Reference< XR
return aResult;
}
-OUString RegressionCurveHelper::getRegressionCurveGenericName(const Reference< XRegressionCurve >& xRegressionCurve)
+OUString RegressionCurveHelper::getRegressionCurveGenericName(const rtl::Reference< RegressionCurveModel >& xRegressionCurve)
{
OUString aResult;
if(!xRegressionCurve.is())
return aResult;
- Reference< lang::XServiceName > xServiceName( xRegressionCurve, uno::UNO_QUERY );
- if(!xServiceName.is())
- return aResult;
-
- OUString aServiceName(xServiceName->getServiceName());
+ OUString aServiceName(xRegressionCurve->getServiceName());
if( aServiceName == "com.sun.star.chart2.MeanValueRegressionCurve" )
{
@@ -658,23 +804,19 @@ OUString RegressionCurveHelper::getRegressionCurveGenericName(const Reference< X
return aResult;
}
-OUString RegressionCurveHelper::getRegressionCurveSpecificName(const Reference< XRegressionCurve >& xRegressionCurve)
+OUString RegressionCurveHelper::getRegressionCurveSpecificName(const rtl::Reference< RegressionCurveModel >& xRegressionCurve)
{
OUString aResult;
if(!xRegressionCurve.is())
return aResult;
- Reference<XPropertySet> xProperties( xRegressionCurve, uno::UNO_QUERY );
- if(!xProperties.is())
- return aResult;
-
- xProperties->getPropertyValue("CurveName") >>= aResult;
+ xRegressionCurve->getPropertyValue(u"CurveName"_ustr) >>= aResult;
return aResult;
}
-OUString RegressionCurveHelper::getRegressionCurveName( const Reference< XRegressionCurve >& xRegressionCurve )
+OUString RegressionCurveHelper::getRegressionCurveName( const rtl::Reference< RegressionCurveModel >& xRegressionCurve )
{
OUString aResult = getRegressionCurveSpecificName(xRegressionCurve);
if (aResult.isEmpty())
@@ -682,29 +824,6 @@ OUString RegressionCurveHelper::getRegressionCurveName( const Reference< XRegres
return aResult;
}
-std::vector< Reference< chart2::XRegressionCurve > >
- RegressionCurveHelper::getAllRegressionCurvesNotMeanValueLine(
- const Reference< chart2::XDiagram > & xDiagram )
-{
- std::vector< Reference< chart2::XRegressionCurve > > aResult;
- std::vector< Reference< chart2::XDataSeries > > aSeries( DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
- for (auto const& elem : aSeries)
- {
- Reference< chart2::XRegressionCurveContainer > xContainer(elem, uno::UNO_QUERY);
- if(xContainer.is())
- {
- const uno::Sequence< uno::Reference< chart2::XRegressionCurve > > aCurves(xContainer->getRegressionCurves());
- for( Reference< XRegressionCurve > const & curve : aCurves )
- {
- if( ! isMeanValueLine( curve ))
- aResult.push_back( curve );
- }
- }
- }
-
- return aResult;
-}
-
void RegressionCurveHelper::resetEquationPosition(
const Reference< chart2::XRegressionCurve > & xCurve )
{
@@ -713,7 +832,7 @@ void RegressionCurveHelper::resetEquationPosition(
try
{
- static const OUStringLiteral aPosPropertyName( u"RelativePosition" );
+ static constexpr OUString aPosPropertyName( u"RelativePosition"_ustr );
Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties()); // since m233: , uno::UNO_SET_THROW );
if( xEqProp->getPropertyValue( aPosPropertyName ).hasValue())
xEqProp->setPropertyValue( aPosPropertyName, uno::Any());
@@ -725,15 +844,15 @@ void RegressionCurveHelper::resetEquationPosition(
}
sal_Int32 RegressionCurveHelper::getRegressionCurveIndex(
- const Reference< chart2::XRegressionCurveContainer >& xContainer,
- const Reference< chart2::XRegressionCurve >& xCurve )
+ const rtl::Reference< DataSeries >& xContainer,
+ const rtl::Reference< RegressionCurveModel >& xCurve )
{
if( xContainer.is())
{
- uno::Sequence< uno::Reference< XRegressionCurve > > aCurves(
- xContainer->getRegressionCurves());
+ const std::vector< rtl::Reference< RegressionCurveModel > > & aCurves(
+ xContainer->getRegressionCurves2());
- for( sal_Int32 i = 0; i < aCurves.getLength(); ++i )
+ for( std::size_t i = 0; i < aCurves.size(); ++i )
{
if( xCurve == aCurves[i] )
return i;
@@ -742,7 +861,7 @@ sal_Int32 RegressionCurveHelper::getRegressionCurveIndex(
return -1;
}
-bool RegressionCurveHelper::hasEquation( const Reference< chart2::XRegressionCurve > & xCurve )
+bool RegressionCurveHelper::hasEquation( const rtl::Reference< RegressionCurveModel > & xCurve )
{
bool bHasEquation = false;
if( xCurve.is())
@@ -752,14 +871,28 @@ bool RegressionCurveHelper::hasEquation( const Reference< chart2::XRegressionCur
{
bool bShowEquation = false;
bool bShowCoefficient = false;
- xEquationProp->getPropertyValue( "ShowEquation") >>= bShowEquation;
- xEquationProp->getPropertyValue( "ShowCorrelationCoefficient") >>= bShowCoefficient;
+ xEquationProp->getPropertyValue( u"ShowEquation"_ustr) >>= bShowEquation;
+ xEquationProp->getPropertyValue( u"ShowCorrelationCoefficient"_ustr) >>= bShowCoefficient;
bHasEquation = bShowEquation || bShowCoefficient;
}
}
return bHasEquation;
}
+bool RegressionCurveHelper::MayHaveCorrelationCoefficient( const rtl::Reference< RegressionCurveModel > & xCurve )
+{
+ bool bMayHaveCorrelationCoefficient = true;
+ if( xCurve.is())
+ {
+ uno::Reference< beans::XPropertySet > xEquationProp( xCurve->getEquationProperties() );
+ if( xEquationProp.is() )
+ {
+ xEquationProp->getPropertyValue( u"MayHaveCorrelationCoefficient"_ustr) >>= bMayHaveCorrelationCoefficient;
+ }
+ }
+ return bMayHaveCorrelationCoefficient;
+}
+
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx
index d6cef7c2c8d8..1cf8d43e3874 100644
--- a/chart2/source/tools/RegressionCurveModel.cxx
+++ b/chart2/source/tools/RegressionCurveModel.cxx
@@ -17,8 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "RegressionCurveModel.hxx"
+#include <RegressionCurveModel.hxx>
#include <LinePropertiesHelper.hxx>
+#include <RegressionCurveCalculator.hxx>
#include <RegressionCurveHelper.hxx>
#include "RegressionEquation.hxx"
#include <CloneHelper.hxx>
@@ -26,7 +27,6 @@
#include <ModifyListenerHelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <tools/diagnose_ex.h>
namespace com::sun::star::uno { class XComponentContext; }
@@ -99,7 +99,7 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::BOUND );
}
-::chart::tPropertyValueMap GetStaticXXXDefaults()
+const ::chart::tPropertyValueMap & GetStaticXXXDefaults()
{
static ::chart::tPropertyValueMap aStaticDefaults =
[](){
@@ -139,7 +139,6 @@ namespace chart
{
RegressionCurveModel::RegressionCurveModel( tCurveType eCurveType ) :
- ::property::OPropertySet( m_aMutex ),
m_eRegressionCurveType( eCurveType ),
m_xModifyEventForwarder( new ModifyEventForwarder() ),
m_xEquationProperties( new RegressionEquation )
@@ -153,7 +152,7 @@ RegressionCurveModel::RegressionCurveModel( tCurveType eCurveType ) :
RegressionCurveModel::RegressionCurveModel( const RegressionCurveModel & rOther ) :
impl::RegressionCurveModel_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_eRegressionCurveType( rOther.m_eRegressionCurveType ),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
@@ -171,6 +170,12 @@ uno::Reference< chart2::XRegressionCurveCalculator > SAL_CALL
return RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( getServiceName());
}
+rtl::Reference< RegressionCurveCalculator >
+ RegressionCurveModel::getCurveCalculator()
+{
+ return RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( getServiceName());
+}
+
uno::Reference< beans::XPropertySet > SAL_CALL RegressionCurveModel::getEquationProperties()
{
return m_xEquationProperties;
@@ -184,30 +189,39 @@ void SAL_CALL RegressionCurveModel::setEquationProperties( const uno::Reference<
ModifyListenerHelper::removeListener( m_xEquationProperties, m_xModifyEventForwarder );
m_xEquationProperties.set( xEquationProperties );
+ setPropertyMayHaveR2();
ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
fireModifyEvent();
}
}
+void RegressionCurveModel::setPropertyMayHaveR2()
+{
+ if( m_xEquationProperties.is()) {
+ bool bMayHaveR2 = m_eRegressionCurveType != CURVE_TYPE_MOVING_AVERAGE;
+ m_xEquationProperties->setPropertyValue( u"MayHaveCorrelationCoefficient"_ustr, uno::Any( bMayHaveR2 ) );
+ }
+}
+
// ____ XServiceName ____
OUString SAL_CALL RegressionCurveModel::getServiceName()
{
switch( m_eRegressionCurveType )
{
case CURVE_TYPE_MEAN_VALUE:
- return "com.sun.star.chart2.MeanValueRegressionCurve";
+ return u"com.sun.star.chart2.MeanValueRegressionCurve"_ustr;
case CURVE_TYPE_LINEAR:
- return "com.sun.star.chart2.LinearRegressionCurve";
+ return u"com.sun.star.chart2.LinearRegressionCurve"_ustr;
case CURVE_TYPE_LOGARITHM:
- return "com.sun.star.chart2.LogarithmicRegressionCurve";
+ return u"com.sun.star.chart2.LogarithmicRegressionCurve"_ustr;
case CURVE_TYPE_EXPONENTIAL:
- return "com.sun.star.chart2.ExponentialRegressionCurve";
+ return u"com.sun.star.chart2.ExponentialRegressionCurve"_ustr;
case CURVE_TYPE_POWER:
- return "com.sun.star.chart2.PotentialRegressionCurve";
+ return u"com.sun.star.chart2.PotentialRegressionCurve"_ustr;
case CURVE_TYPE_POLYNOMIAL:
- return "com.sun.star.chart2.PolynomialRegressionCurve";
+ return u"com.sun.star.chart2.PolynomialRegressionCurve"_ustr;
case CURVE_TYPE_MOVING_AVERAGE:
- return "com.sun.star.chart2.MovingAverageRegressionCurve";
+ return u"com.sun.star.chart2.MovingAverageRegressionCurve"_ustr;
}
return OUString();
@@ -239,6 +253,7 @@ void SAL_CALL RegressionCurveModel::disposing( const lang::EventObject& /* Sourc
// ____ OPropertySet ____
void RegressionCurveModel::firePropertyChangeEvent()
{
+ setPropertyMayHaveR2();
fireModifyEvent();
}
@@ -289,7 +304,7 @@ MeanValueRegressionCurve::~MeanValueRegressionCurve()
OUString SAL_CALL MeanValueRegressionCurve::getImplementationName()
{
- return "com.sun.star.comp.chart2.MeanValueRegressionCurve";
+ return u"com.sun.star.comp.chart2.MeanValueRegressionCurve"_ustr;
}
sal_Bool SAL_CALL MeanValueRegressionCurve::supportsService( const OUString& rServiceName )
@@ -299,7 +314,7 @@ sal_Bool SAL_CALL MeanValueRegressionCurve::supportsService( const OUString& rSe
css::uno::Sequence< OUString > SAL_CALL MeanValueRegressionCurve::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.RegressionCurve", "com.sun.star.chart2.MeanValueRegressionCurve" };
+ return { u"com.sun.star.chart2.RegressionCurve"_ustr, u"com.sun.star.chart2.MeanValueRegressionCurve"_ustr };
}
uno::Reference< util::XCloneable > SAL_CALL MeanValueRegressionCurve::createClone()
@@ -319,7 +334,7 @@ LinearRegressionCurve::~LinearRegressionCurve()
OUString SAL_CALL LinearRegressionCurve::getImplementationName()
{
- return "com.sun.star.comp.chart2.LinearRegressionCurve";
+ return u"com.sun.star.comp.chart2.LinearRegressionCurve"_ustr;
}
sal_Bool SAL_CALL LinearRegressionCurve::supportsService( const OUString& rServiceName )
@@ -329,7 +344,7 @@ sal_Bool SAL_CALL LinearRegressionCurve::supportsService( const OUString& rServi
css::uno::Sequence< OUString > SAL_CALL LinearRegressionCurve::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.RegressionCurve", "com.sun.star.chart2.LinearRegressionCurve" };
+ return { u"com.sun.star.chart2.RegressionCurve"_ustr, u"com.sun.star.chart2.LinearRegressionCurve"_ustr };
}
uno::Reference< util::XCloneable > SAL_CALL LinearRegressionCurve::createClone()
@@ -349,7 +364,7 @@ LogarithmicRegressionCurve::~LogarithmicRegressionCurve()
OUString SAL_CALL LogarithmicRegressionCurve::getImplementationName()
{
- return "com.sun.star.comp.chart2.LogarithmicRegressionCurve";
+ return u"com.sun.star.comp.chart2.LogarithmicRegressionCurve"_ustr;
}
sal_Bool SAL_CALL LogarithmicRegressionCurve::supportsService( const OUString& rServiceName )
@@ -359,7 +374,7 @@ sal_Bool SAL_CALL LogarithmicRegressionCurve::supportsService( const OUString& r
css::uno::Sequence< OUString > SAL_CALL LogarithmicRegressionCurve::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.RegressionCurve", "com.sun.star.chart2.LogarithmicRegressionCurve" };
+ return { u"com.sun.star.chart2.RegressionCurve"_ustr, u"com.sun.star.chart2.LogarithmicRegressionCurve"_ustr };
}
uno::Reference< util::XCloneable > SAL_CALL LogarithmicRegressionCurve::createClone()
@@ -379,7 +394,7 @@ ExponentialRegressionCurve::~ExponentialRegressionCurve()
OUString SAL_CALL ExponentialRegressionCurve::getImplementationName()
{
- return "com.sun.star.comp.chart2.ExponentialRegressionCurve";
+ return u"com.sun.star.comp.chart2.ExponentialRegressionCurve"_ustr;
}
sal_Bool SAL_CALL ExponentialRegressionCurve::supportsService( const OUString& rServiceName )
@@ -389,7 +404,7 @@ sal_Bool SAL_CALL ExponentialRegressionCurve::supportsService( const OUString& r
css::uno::Sequence< OUString > SAL_CALL ExponentialRegressionCurve::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.RegressionCurve", "com.sun.star.chart2.ExponentialRegressionCurve" };
+ return { u"com.sun.star.chart2.RegressionCurve"_ustr, u"com.sun.star.chart2.ExponentialRegressionCurve"_ustr };
}
uno::Reference< util::XCloneable > SAL_CALL ExponentialRegressionCurve::createClone()
@@ -409,7 +424,7 @@ PotentialRegressionCurve::~PotentialRegressionCurve()
OUString SAL_CALL PotentialRegressionCurve::getImplementationName()
{
- return "com.sun.star.comp.chart2.PotentialRegressionCurve";
+ return u"com.sun.star.comp.chart2.PotentialRegressionCurve"_ustr;
}
sal_Bool SAL_CALL PotentialRegressionCurve::supportsService( const OUString& rServiceName )
@@ -419,7 +434,7 @@ sal_Bool SAL_CALL PotentialRegressionCurve::supportsService( const OUString& rSe
css::uno::Sequence< OUString > SAL_CALL PotentialRegressionCurve::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.RegressionCurve", "com.sun.star.chart2.PotentialRegressionCurve" };
+ return { u"com.sun.star.chart2.RegressionCurve"_ustr, u"com.sun.star.chart2.PotentialRegressionCurve"_ustr };
}
uno::Reference< util::XCloneable > SAL_CALL PotentialRegressionCurve::createClone()
@@ -439,7 +454,7 @@ PolynomialRegressionCurve::~PolynomialRegressionCurve()
OUString SAL_CALL PolynomialRegressionCurve::getImplementationName()
{
- return "com.sun.star.comp.chart2.PolynomialRegressionCurve";
+ return u"com.sun.star.comp.chart2.PolynomialRegressionCurve"_ustr;
}
sal_Bool SAL_CALL PolynomialRegressionCurve::supportsService( const OUString& rServiceName )
@@ -449,7 +464,7 @@ sal_Bool SAL_CALL PolynomialRegressionCurve::supportsService( const OUString& rS
css::uno::Sequence< OUString > SAL_CALL PolynomialRegressionCurve::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.RegressionCurve", "com.sun.star.chart2.PolynomialRegressionCurve" };
+ return { u"com.sun.star.chart2.RegressionCurve"_ustr, u"com.sun.star.chart2.PolynomialRegressionCurve"_ustr };
}
uno::Reference< util::XCloneable > SAL_CALL PolynomialRegressionCurve::createClone()
@@ -469,7 +484,7 @@ MovingAverageRegressionCurve::~MovingAverageRegressionCurve()
OUString SAL_CALL MovingAverageRegressionCurve::getImplementationName()
{
- return "com.sun.star.comp.chart2.MovingAverageRegressionCurve";
+ return u"com.sun.star.comp.chart2.MovingAverageRegressionCurve"_ustr;
}
sal_Bool SAL_CALL MovingAverageRegressionCurve::supportsService( const OUString& rServiceName )
@@ -479,7 +494,7 @@ sal_Bool SAL_CALL MovingAverageRegressionCurve::supportsService( const OUString&
css::uno::Sequence< OUString > SAL_CALL MovingAverageRegressionCurve::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.RegressionCurve", "com.sun.star.chart2.MovingAverageRegressionCurve" };
+ return { u"com.sun.star.chart2.RegressionCurve"_ustr, u"com.sun.star.chart2.MovingAverageRegressionCurve"_ustr };
}
uno::Reference< util::XCloneable > SAL_CALL MovingAverageRegressionCurve::createClone()
diff --git a/chart2/source/tools/RegressionEquation.cxx b/chart2/source/tools/RegressionEquation.cxx
index 637a1d7c6774..e487ec6d5242 100644
--- a/chart2/source/tools/RegressionEquation.cxx
+++ b/chart2/source/tools/RegressionEquation.cxx
@@ -33,7 +33,6 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/awt/Size.hpp>
-#include <tools/diagnose_ex.h>
#include <algorithm>
@@ -54,6 +53,7 @@ enum
PROP_EQUATION_XNAME,
PROP_EQUATION_YNAME,
PROP_EQUATION_SHOW_CORRELATION_COEFF,
+ PROP_EQUATION_MAY_HAVE_CORRELATION_COEFF,
PROP_EQUATION_REF_PAGE_SIZE,
PROP_EQUATION_REL_POS,
PROP_EQUATION_NUMBER_FORMAT
@@ -86,6 +86,12 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( "MayHaveCorrelationCoefficient",
+ PROP_EQUATION_MAY_HAVE_CORRELATION_COEFF,
+ cppu::UnoType<bool>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
+
rOutProperties.emplace_back( "ReferencePageSize",
PROP_EQUATION_REF_PAGE_SIZE,
cppu::UnoType<awt::Size>::get(),
@@ -115,9 +121,10 @@ void lcl_AddPropertiesToVector(
::chart::CharacterProperties::AddDefaultsToMap( aOutMap );
::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_EQUATION_SHOW, false );
- ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_EQUATION_XNAME, OUString("x") );
- ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_EQUATION_YNAME, OUString("f(x)") );
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_EQUATION_XNAME, u"x"_ustr );
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_EQUATION_YNAME, u"f(x)"_ustr );
::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_EQUATION_SHOW_CORRELATION_COEFF, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_EQUATION_MAY_HAVE_CORRELATION_COEFF, true );
//::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_EQUATION_SEPARATOR, OUString( '\n' ));
// override other defaults
@@ -165,13 +172,12 @@ namespace chart
{
RegressionEquation::RegressionEquation() :
- ::property::OPropertySet( m_aMutex ),
m_xModifyEventForwarder( new ModifyEventForwarder())
{}
RegressionEquation::RegressionEquation( const RegressionEquation & rOther ) :
impl::RegressionEquation_Base(rOther),
- ::property::OPropertySet( rOther, m_aMutex ),
+ ::property::OPropertySet( rOther ),
m_xModifyEventForwarder( new ModifyEventForwarder())
{}
@@ -262,7 +268,7 @@ void SAL_CALL RegressionEquation::setText( const uno::Sequence< uno::Reference<
OUString SAL_CALL RegressionEquation::getImplementationName()
{
- return "com.sun.star.comp.chart2.RegressionEquation";
+ return u"com.sun.star.comp.chart2.RegressionEquation"_ustr;
}
sal_Bool SAL_CALL RegressionEquation::supportsService( const OUString& rServiceName )
@@ -272,11 +278,11 @@ sal_Bool SAL_CALL RegressionEquation::supportsService( const OUString& rServiceN
css::uno::Sequence< OUString > SAL_CALL RegressionEquation::getSupportedServiceNames()
{
- return { "com.sun.star.chart2.RegressionEquation",
- "com.sun.star.beans.PropertySet",
- "com.sun.star.drawing.FillProperties",
- "com.sun.star.drawing.LineProperties",
- "com.sun.star.style.CharacterProperties" };
+ return { u"com.sun.star.chart2.RegressionEquation"_ustr,
+ u"com.sun.star.beans.PropertySet"_ustr,
+ u"com.sun.star.drawing.FillProperties"_ustr,
+ u"com.sun.star.drawing.LineProperties"_ustr,
+ u"com.sun.star.style.CharacterProperties"_ustr };
}
using impl::RegressionEquation_Base;
diff --git a/chart2/source/tools/RegressionEquation.hxx b/chart2/source/tools/RegressionEquation.hxx
index 9c26a6ad9d0f..8a500cd1d73c 100644
--- a/chart2/source/tools/RegressionEquation.hxx
+++ b/chart2/source/tools/RegressionEquation.hxx
@@ -24,7 +24,6 @@
#include <OPropertySet.hxx>
-#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <ModifyListenerHelper.hxx>
@@ -44,7 +43,6 @@ typedef ::cppu::WeakImplHelper<
}
class RegressionEquation final :
- public cppu::BaseMutex,
public impl::RegressionEquation_Base,
public ::property::OPropertySet
{
diff --git a/chart2/source/tools/RelativeSizeHelper.cxx b/chart2/source/tools/RelativeSizeHelper.cxx
index c1bdc28fcb35..4a3cd84cfb88 100644
--- a/chart2/source/tools/RelativeSizeHelper.cxx
+++ b/chart2/source/tools/RelativeSizeHelper.cxx
@@ -20,14 +20,13 @@
#include <RelativeSizeHelper.hxx>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <svx/unoshape.hxx>
#include <vector>
#include <algorithm>
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
-using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
@@ -45,7 +44,7 @@ double RelativeSizeHelper::calculate(
rOldReferenceSize.Height <= 0 )
return fValue;
- return min(
+ return std::min(
static_cast< double >( rNewReferenceSize.Width ) / static_cast< double >( rOldReferenceSize.Width ),
static_cast< double >( rNewReferenceSize.Height ) / static_cast< double >( rOldReferenceSize.Height ))
* fValue;
@@ -58,7 +57,7 @@ void RelativeSizeHelper::adaptFontSizes(
{
float fFontHeight = 0;
- vector< OUString > aProperties;
+ std::vector< OUString > aProperties;
aProperties.emplace_back("CharHeight" );
aProperties.emplace_back("CharHeightAsian" );
aProperties.emplace_back("CharHeightComplex" );
@@ -92,7 +91,7 @@ void RelativeSizeHelper::adaptFontSizes(
float fFontHeight = 0;
- vector< OUString > aProperties;
+ std::vector< OUString > aProperties;
aProperties.emplace_back("CharHeight" );
aProperties.emplace_back("CharHeightAsian" );
aProperties.emplace_back("CharHeightComplex" );
diff --git a/chart2/source/tools/Scaling.cxx b/chart2/source/tools/Scaling.cxx
index b49dab6d6fb9..940fe7e92521 100644
--- a/chart2/source/tools/Scaling.cxx
+++ b/chart2/source/tools/Scaling.cxx
@@ -29,10 +29,10 @@ namespace com::sun::star::uno { class XComponentContext; }
namespace
{
-constexpr OUStringLiteral lcl_aServiceName_Logarithmic = u"com.sun.star.chart2.LogarithmicScaling";
-constexpr OUStringLiteral lcl_aServiceName_Exponential = u"com.sun.star.chart2.ExponentialScaling";
-constexpr OUStringLiteral lcl_aServiceName_Linear = u"com.sun.star.chart2.LinearScaling";
-constexpr OUStringLiteral lcl_aServiceName_Power = u"com.sun.star.chart2.PowerScaling";
+constexpr OUString lcl_aServiceName_Logarithmic = u"com.sun.star.chart2.LogarithmicScaling"_ustr;
+constexpr OUString lcl_aServiceName_Exponential = u"com.sun.star.chart2.ExponentialScaling"_ustr;
+constexpr OUString lcl_aServiceName_Linear = u"com.sun.star.chart2.LinearScaling"_ustr;
+constexpr OUString lcl_aServiceName_Power = u"com.sun.star.chart2.PowerScaling"_ustr;
}
@@ -160,7 +160,7 @@ uno::Reference< XScaling > SAL_CALL
{
// ToDo: ApproxEqual ?
if( m_fSlope == 0 )
- throw uno::RuntimeException("Divide by zero exception");
+ throw uno::RuntimeException(u"Divide by zero exception"_ustr);
return new LinearScaling( 1.0 / m_fSlope, m_fOffset / m_fSlope );
}
@@ -208,7 +208,7 @@ uno::Reference< XScaling > SAL_CALL
{
// ToDo: ApproxEqual ?
if( m_fExponent == 0 )
- throw uno::RuntimeException("Divide by zero exception");
+ throw uno::RuntimeException(u"Divide by zero exception"_ustr);
return new PowerScaling( 1.0 / m_fExponent );
}
diff --git a/chart2/source/tools/SceneProperties.cxx b/chart2/source/tools/SceneProperties.cxx
index 9d5746ef649d..eb65d81c94db 100644
--- a/chart2/source/tools/SceneProperties.cxx
+++ b/chart2/source/tools/SceneProperties.cxx
@@ -18,6 +18,7 @@
*/
#include <SceneProperties.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
@@ -276,13 +277,13 @@ void SceneProperties::AddDefaultsToMap(
aMtx.Line4.Column1 = aMtx.Line4.Column2 = aMtx.Line4.Column3 = 0.0;
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCENE_TRANSF_MATRIX, aMtx );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCENE_DISTANCE, 4200 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCENE_FOCAL_LENGTH, 8000 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCENE_DISTANCE, sal_Int32(4200) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCENE_FOCAL_LENGTH, sal_Int32(8000) );
// PROP_SCENE_SHADOW_SLANT;
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCENE_SHADE_MODE, drawing::ShadeMode_SMOOTH );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >(
+ ::chart::PropertyHelper::setPropertyValueDefault(
rOutMap, PROP_SCENE_AMBIENT_COLOR, ChartTypeHelper::getDefaultAmbientLightColor(false,nullptr));
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCENE_TWO_SIDED_LIGHTING, true );
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index c8fad963deab..e853f1ce49d1 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -18,19 +18,19 @@
*/
#include <StatisticsHelper.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <ErrorBar.hxx>
#include <unonames.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/processfactory.hxx>
-#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/data/LabeledDataSequence.hpp>
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <cmath>
#include <limits>
@@ -69,7 +69,7 @@ double lcl_getVariance( const Sequence< double > & rData, sal_Int32 & rOutValidC
return (fQuadSum - fSum*fSum/fN) / fN;
}
-Reference< chart2::data::XLabeledDataSequence > lcl_getErrorBarLabeledSequence(
+uno::Reference< chart2::data::XLabeledDataSequence > lcl_getErrorBarLabeledSequence(
const Reference< chart2::data::XDataSource > & xDataSource,
bool bPositiveValue, bool bYError,
OUString & rOutRoleNameUsed )
@@ -81,8 +81,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getErrorBarLabeledSequence(
aRole.append( 'x');
OUString aPlainRole = aRole.makeStringAndClear();
- aRole.append( aPlainRole );
- aRole.append( '-' );
+ aRole.append( aPlainRole + "-" );
if( bPositiveValue )
aRole.append( "positive" );
@@ -90,14 +89,14 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getErrorBarLabeledSequence(
aRole.append( "negative" );
OUString aLongRole = aRole.makeStringAndClear();
- Reference< chart2::data::XLabeledDataSequence > xLSeq(
- ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aLongRole ));
+ uno::Reference< chart2::data::XLabeledDataSequence > xLSeq =
+ ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aLongRole );
// try role without "-negative" or "-positive" postfix
if( xLSeq.is())
rOutRoleNameUsed = aLongRole;
else
{
- xLSeq.set( ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aPlainRole ));
+ xLSeq = ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aPlainRole );
if( xLSeq.is())
rOutRoleNameUsed = aPlainRole;
else
@@ -113,7 +112,7 @@ void lcl_setRole(
{
Reference< beans::XPropertySet > xSeqProp( xNewSequence, uno::UNO_QUERY );
if( xSeqProp.is())
- xSeqProp->setPropertyValue( "Role", uno::Any( rRole ));
+ xSeqProp->setPropertyValue( u"Role"_ustr, uno::Any( rRole ));
}
void lcl_addSequenceToDataSource(
@@ -122,7 +121,7 @@ void lcl_addSequenceToDataSource(
const OUString & rRole )
{
Reference< chart2::data::XDataSink > xSink( xDataSource, uno::UNO_QUERY );
- Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
if( ! xSink.is() )
return;
@@ -134,7 +133,7 @@ void lcl_addSequenceToDataSource(
xDataSource->getDataSequences());
aSequences.realloc( aSequences.getLength() + 1 );
auto pSequences = aSequences.getArray();
- pSequences[ aSequences.getLength() - 1 ] = xLSeq;
+ pSequences[ aSequences.getLength() - 1 ] = std::move(xLSeq);
xSink->setData( aSequences );
}
@@ -144,7 +143,7 @@ void lcl_setXMLRangePropertyAtDataSequence(
{
try
{
- static const OUStringLiteral aXMLRangePropName( u"CachedXMLRange");
+ static constexpr OUString aXMLRangePropName( u"CachedXMLRange"_ustr);
Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY_THROW );
Reference< beans::XPropertySetInfo > xInfo( xProp->getPropertySetInfo());
if( xInfo.is() && xInfo->hasPropertyByName( aXMLRangePropName ))
@@ -188,20 +187,20 @@ double StatisticsHelper::getStandardError( const Sequence< double > & rData )
return sqrt( fVar ) / sqrt( double(nValCount) );
}
-Reference< chart2::data::XLabeledDataSequence > StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
+uno::Reference< chart2::data::XLabeledDataSequence > StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
const Reference< chart2::data::XDataSource > & xDataSource,
bool bPositiveValue,
bool bYError /* = true */ )
{
- Reference< chart2::data::XLabeledDataSequence > xResult;
+ uno::Reference< chart2::data::XLabeledDataSequence > xResult;
if( !xDataSource.is())
return xResult;
OUString aRole;
- Reference< chart2::data::XLabeledDataSequence > xLSeq(
- lcl_getErrorBarLabeledSequence( xDataSource, bPositiveValue, bYError, aRole ));
+ uno::Reference< chart2::data::XLabeledDataSequence > xLSeq =
+ lcl_getErrorBarLabeledSequence( xDataSource, bPositiveValue, bYError, aRole );
if( xLSeq.is())
- xResult.set( xLSeq );
+ xResult = std::move(xLSeq);
return xResult;
}
@@ -211,10 +210,10 @@ Reference< chart2::data::XDataSequence > StatisticsHelper::getErrorDataSequenceF
bool bPositiveValue,
bool bYError /* = true */ )
{
- Reference< chart2::data::XLabeledDataSequence > xLSeq(
+ uno::Reference< chart2::data::XLabeledDataSequence > xLSeq =
StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
xDataSource, bPositiveValue,
- bYError ));
+ bYError );
if( !xLSeq.is())
return Reference< chart2::data::XDataSequence >();
@@ -281,18 +280,17 @@ void StatisticsHelper::setErrorDataSequence(
}
Reference< beans::XPropertySet > StatisticsHelper::addErrorBars(
- const Reference< chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference< DataSeries > & xDataSeries,
sal_Int32 nStyle,
bool bYError /* = true */ )
{
Reference< beans::XPropertySet > xErrorBar;
- Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY );
- if( !xSeriesProp.is())
+ if( !xDataSeries.is())
return xErrorBar;
const OUString aPropName(
- bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
- if( !( xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar ) ||
+ bYError ? CHART_UNONAME_ERRORBAR_Y : CHART_UNONAME_ERRORBAR_X);
+ if( !( xDataSeries->getPropertyValue( aPropName ) >>= xErrorBar ) ||
!xErrorBar.is())
{
xErrorBar.set( new ErrorBar );
@@ -301,60 +299,59 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars(
OSL_ASSERT( xErrorBar.is());
if( xErrorBar.is())
{
- xErrorBar->setPropertyValue( "ErrorBarStyle", uno::Any( nStyle ));
+ xErrorBar->setPropertyValue( u"ErrorBarStyle"_ustr, uno::Any( nStyle ));
}
- xSeriesProp->setPropertyValue( aPropName, uno::Any( xErrorBar ));
+ xDataSeries->setPropertyValue( aPropName, uno::Any( xErrorBar ));
return xErrorBar;
}
Reference< beans::XPropertySet > StatisticsHelper::getErrorBars(
- const Reference< chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference< DataSeries > & xDataSeries,
bool bYError /* = true */ )
{
- Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY );
Reference< beans::XPropertySet > xErrorBar;
const OUString aPropName(
- bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
+ bYError ? CHART_UNONAME_ERRORBAR_Y : CHART_UNONAME_ERRORBAR_X);
- if ( xSeriesProp.is())
- xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar;
+ if ( xDataSeries.is())
+ xDataSeries->getPropertyValue( aPropName ) >>= xErrorBar;
return xErrorBar;
}
bool StatisticsHelper::hasErrorBars(
- const Reference< chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference< DataSeries > & xDataSeries,
bool bYError /* = true */ )
{
Reference< beans::XPropertySet > xErrorBar( getErrorBars( xDataSeries, bYError ));
sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
return ( xErrorBar.is() &&
- ( xErrorBar->getPropertyValue( "ErrorBarStyle") >>= nStyle ) &&
+ ( xErrorBar->getPropertyValue( u"ErrorBarStyle"_ustr) >>= nStyle ) &&
nStyle != css::chart::ErrorBarStyle::NONE );
}
void StatisticsHelper::removeErrorBars(
- const Reference< chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference< DataSeries > & xDataSeries,
bool bYError /* = true */ )
{
Reference< beans::XPropertySet > xErrorBar( getErrorBars( xDataSeries, bYError ));
if ( xErrorBar.is())
- xErrorBar->setPropertyValue( "ErrorBarStyle", uno::Any(
+ xErrorBar->setPropertyValue( u"ErrorBarStyle"_ustr, uno::Any(
css::chart::ErrorBarStyle::NONE ));
}
bool StatisticsHelper::usesErrorBarRanges(
- const Reference< chart2::XDataSeries > & xDataSeries,
+ const rtl::Reference< DataSeries > & xDataSeries,
bool bYError /* = true */ )
{
Reference< beans::XPropertySet > xErrorBar( getErrorBars( xDataSeries, bYError ));
sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
return ( xErrorBar.is() &&
- ( xErrorBar->getPropertyValue( "ErrorBarStyle") >>= nStyle ) &&
+ ( xErrorBar->getPropertyValue( u"ErrorBarStyle"_ustr) >>= nStyle ) &&
nStyle == css::chart::ErrorBarStyle::FROM_DATA );
}
diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx
index 0903459606bb..5db264e3505d 100644
--- a/chart2/source/tools/ThreeDHelper.cxx
+++ b/chart2/source/tools/ThreeDHelper.cxx
@@ -17,19 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <basegfx/numeric/ftools.hxx>
#include <ThreeDHelper.hxx>
-#include <DiagramHelper.hxx>
+#include <Diagram.hxx>
#include <ChartTypeHelper.hxx>
-#include <BaseGFXHelper.hxx>
+#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
#include <defines.hxx>
-#include <editeng/unoprnms.hxx>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/helpers.hxx>
#include <rtl/math.hxx>
@@ -46,17 +43,16 @@ using ::rtl::math::tan;
namespace
{
-bool lcl_isRightAngledAxesSetAndSupported( const Reference< beans::XPropertySet >& xSceneProperties )
+bool lcl_isRightAngledAxesSetAndSupported( const rtl::Reference< Diagram >& xDiagram )
{
- if( xSceneProperties.is() )
+ if( xDiagram.is() )
{
bool bRightAngledAxes = false;
- xSceneProperties->getPropertyValue( "RightAngledAxes") >>= bRightAngledAxes;
+ xDiagram->getPropertyValue( u"RightAngledAxes"_ustr) >>= bRightAngledAxes;
if(bRightAngledAxes)
{
- uno::Reference< chart2::XDiagram > xDiagram( xSceneProperties, uno::UNO_QUERY );
- if( ChartTypeHelper::isSupportingRightAngledAxes(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ) )
+ auto xChartType = xDiagram->getChartTypeByIndex(0);
+ if (xChartType.is() ? xChartType->isSupportingRightAngledAxes() : true)
{
return true;
}
@@ -65,235 +61,6 @@ bool lcl_isRightAngledAxesSetAndSupported( const Reference< beans::XPropertySet
return false;
}
-void lcl_RotateLightSource( const Reference< beans::XPropertySet >& xSceneProperties
- , const OUString& rLightSourceDirection
- , const OUString& rLightSourceOn
- , const ::basegfx::B3DHomMatrix& rRotationMatrix )
-{
- if( !xSceneProperties.is() )
- return;
-
- bool bLightOn = false;
- if( !(xSceneProperties->getPropertyValue( rLightSourceOn ) >>= bLightOn) )
- return;
-
- if( bLightOn )
- {
- drawing::Direction3D aLight;
- if( xSceneProperties->getPropertyValue( rLightSourceDirection ) >>= aLight )
- {
- ::basegfx::B3DVector aLightVector( BaseGFXHelper::Direction3DToB3DVector( aLight ) );
- aLightVector = rRotationMatrix*aLightVector;
-
- xSceneProperties->setPropertyValue( rLightSourceDirection
- , uno::Any( BaseGFXHelper::B3DVectorToDirection3D( aLightVector ) ) );
- }
- }
-}
-
-void lcl_rotateLights( const ::basegfx::B3DHomMatrix& rLightRottion, const Reference< beans::XPropertySet >& xSceneProperties )
-{
- if(!xSceneProperties.is())
- return;
-
- ::basegfx::B3DHomMatrix aLightRottion( rLightRottion );
- BaseGFXHelper::ReduceToRotationMatrix( aLightRottion );
-
- lcl_RotateLightSource( xSceneProperties, "D3DSceneLightDirection1", "D3DSceneLightOn1", aLightRottion );
- lcl_RotateLightSource( xSceneProperties, "D3DSceneLightDirection2", "D3DSceneLightOn2", aLightRottion );
- lcl_RotateLightSource( xSceneProperties, "D3DSceneLightDirection3", "D3DSceneLightOn3", aLightRottion );
- lcl_RotateLightSource( xSceneProperties, "D3DSceneLightDirection4", "D3DSceneLightOn4", aLightRottion );
- lcl_RotateLightSource( xSceneProperties, "D3DSceneLightDirection5", "D3DSceneLightOn5", aLightRottion );
- lcl_RotateLightSource( xSceneProperties, "D3DSceneLightDirection6", "D3DSceneLightOn6", aLightRottion );
- lcl_RotateLightSource( xSceneProperties, "D3DSceneLightDirection7", "D3DSceneLightOn7", aLightRottion );
- lcl_RotateLightSource( xSceneProperties, "D3DSceneLightDirection8", "D3DSceneLightOn8", aLightRottion );
-}
-
-::basegfx::B3DHomMatrix lcl_getInverseRotationMatrix( const Reference< beans::XPropertySet >& xSceneProperties )
-{
- ::basegfx::B3DHomMatrix aInverseRotation;
- double fXAngleRad=0.0;
- double fYAngleRad=0.0;
- double fZAngleRad=0.0;
- ThreeDHelper::getRotationAngleFromDiagram(
- xSceneProperties, fXAngleRad, fYAngleRad, fZAngleRad );
- aInverseRotation.rotate( 0.0, 0.0, -fZAngleRad );
- aInverseRotation.rotate( 0.0, -fYAngleRad, 0.0 );
- aInverseRotation.rotate( -fXAngleRad, 0.0, 0.0 );
- return aInverseRotation;
-}
-
-::basegfx::B3DHomMatrix lcl_getCompleteRotationMatrix( const Reference< beans::XPropertySet >& xSceneProperties )
-{
- ::basegfx::B3DHomMatrix aCompleteRotation;
- double fXAngleRad=0.0;
- double fYAngleRad=0.0;
- double fZAngleRad=0.0;
- ThreeDHelper::getRotationAngleFromDiagram(
- xSceneProperties, fXAngleRad, fYAngleRad, fZAngleRad );
- aCompleteRotation.rotate( fXAngleRad, fYAngleRad, fZAngleRad );
- return aCompleteRotation;
-}
-
-bool lcl_isEqual( const drawing::Direction3D& rA, const drawing::Direction3D& rB )
-{
- return ::rtl::math::approxEqual(rA.DirectionX, rB.DirectionX)
- && ::rtl::math::approxEqual(rA.DirectionY, rB.DirectionY)
- && ::rtl::math::approxEqual(rA.DirectionZ, rB.DirectionZ);
-}
-
-bool lcl_isLightScheme( const uno::Reference< beans::XPropertySet >& xDiagramProps, bool bRealistic )
-{
- if(!xDiagramProps.is())
- return false;
-
- bool bIsOn = false;
- xDiagramProps->getPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_2 ) >>= bIsOn;
- if(!bIsOn)
- return false;
-
- uno::Reference< chart2::XDiagram > xDiagram( xDiagramProps, uno::UNO_QUERY );
- uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
-
- sal_Int32 nColor = 0;
- xDiagramProps->getPropertyValue( UNO_NAME_3D_SCENE_LIGHTCOLOR_2 ) >>= nColor;
- if( nColor != ::chart::ChartTypeHelper::getDefaultDirectLightColor( !bRealistic, xChartType ) )
- return false;
-
- sal_Int32 nAmbientColor = 0;
- xDiagramProps->getPropertyValue( UNO_NAME_3D_SCENE_AMBIENTCOLOR ) >>= nAmbientColor;
- if( nAmbientColor != ::chart::ChartTypeHelper::getDefaultAmbientLightColor( !bRealistic, xChartType ) )
- return false;
-
- drawing::Direction3D aDirection(0,0,0);
- xDiagramProps->getPropertyValue( UNO_NAME_3D_SCENE_LIGHTDIRECTION_2 ) >>= aDirection;
-
- drawing::Direction3D aDefaultDirection( bRealistic
- ? ChartTypeHelper::getDefaultRealisticLightDirection(xChartType)
- : ChartTypeHelper::getDefaultSimpleLightDirection(xChartType) );
-
- //rotate default light direction when right angled axes are off but supported
- {
- bool bRightAngledAxes = false;
- xDiagramProps->getPropertyValue( "RightAngledAxes") >>= bRightAngledAxes;
- if(!bRightAngledAxes)
- {
- if( ChartTypeHelper::isSupportingRightAngledAxes(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ) )
- {
- ::basegfx::B3DHomMatrix aRotation( lcl_getCompleteRotationMatrix( xDiagramProps ) );
- BaseGFXHelper::ReduceToRotationMatrix( aRotation );
- ::basegfx::B3DVector aLightVector( BaseGFXHelper::Direction3DToB3DVector( aDefaultDirection ) );
- aLightVector = aRotation*aLightVector;
- aDefaultDirection = BaseGFXHelper::B3DVectorToDirection3D( aLightVector );
- }
- }
- }
-
- return lcl_isEqual( aDirection, aDefaultDirection );
-}
-
-bool lcl_isRealisticLightScheme( const uno::Reference< beans::XPropertySet >& xDiagramProps )
-{
- return lcl_isLightScheme( xDiagramProps, true /*bRealistic*/ );
-}
-bool lcl_isSimpleLightScheme( const uno::Reference< beans::XPropertySet >& xDiagramProps )
-{
- return lcl_isLightScheme( xDiagramProps, false /*bRealistic*/ );
-}
-void lcl_setLightsForScheme( const uno::Reference< beans::XPropertySet >& xDiagramProps, const ThreeDLookScheme& rScheme )
-{
- if(!xDiagramProps.is())
- return;
- if( rScheme == ThreeDLookScheme::ThreeDLookScheme_Unknown)
- return;
-
- xDiagramProps->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_2, uno::Any( true ) );
-
- uno::Reference< chart2::XDiagram > xDiagram( xDiagramProps, uno::UNO_QUERY );
- uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
- uno::Any aADirection( rScheme == ThreeDLookScheme::ThreeDLookScheme_Simple
- ? ChartTypeHelper::getDefaultSimpleLightDirection(xChartType)
- : ChartTypeHelper::getDefaultRealisticLightDirection(xChartType) );
-
- xDiagramProps->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTDIRECTION_2, aADirection );
- //rotate light direction when right angled axes are off but supported
- {
- bool bRightAngledAxes = false;
- xDiagramProps->getPropertyValue( "RightAngledAxes") >>= bRightAngledAxes;
- if(!bRightAngledAxes)
- {
- if( ChartTypeHelper::isSupportingRightAngledAxes( xChartType ) )
- {
- ::basegfx::B3DHomMatrix aRotation( lcl_getCompleteRotationMatrix( xDiagramProps ) );
- BaseGFXHelper::ReduceToRotationMatrix( aRotation );
- lcl_RotateLightSource( xDiagramProps, "D3DSceneLightDirection2", "D3DSceneLightOn2", aRotation );
- }
- }
- }
-
- sal_Int32 nColor = ::chart::ChartTypeHelper::getDefaultDirectLightColor(
- rScheme == ThreeDLookScheme::ThreeDLookScheme_Simple, xChartType);
- xDiagramProps->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTCOLOR_2, uno::Any( nColor ) );
-
- sal_Int32 nAmbientColor = ::chart::ChartTypeHelper::getDefaultAmbientLightColor(
- rScheme == ThreeDLookScheme::ThreeDLookScheme_Simple, xChartType);
- xDiagramProps->setPropertyValue( UNO_NAME_3D_SCENE_AMBIENTCOLOR, uno::Any( nAmbientColor ) );
-}
-
-bool lcl_isRealisticScheme( drawing::ShadeMode aShadeMode
- , sal_Int32 nRoundedEdges
- , sal_Int32 nObjectLines )
-{
- if(aShadeMode!=drawing::ShadeMode_SMOOTH)
- return false;
- if(nRoundedEdges!=5)
- return false;
- if(nObjectLines!=0)
- return false;
- return true;
-}
-
-bool lcl_isSimpleScheme( drawing::ShadeMode aShadeMode
- , sal_Int32 nRoundedEdges
- , sal_Int32 nObjectLines
- , const uno::Reference< XDiagram >& xDiagram )
-{
- if(aShadeMode!=drawing::ShadeMode_FLAT)
- return false;
- if(nRoundedEdges!=0)
- return false;
- if(nObjectLines==0)
- {
- uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
- return ChartTypeHelper::noBordersForSimpleScheme( xChartType );
- }
- if(nObjectLines!=1)
- return false;
- return true;
-}
-
-void lcl_setRealisticScheme( drawing::ShadeMode& rShadeMode
- , sal_Int32& rnRoundedEdges
- , sal_Int32& rnObjectLines )
-{
- rShadeMode = drawing::ShadeMode_SMOOTH;
- rnRoundedEdges = 5;
- rnObjectLines = 0;
-}
-
-void lcl_setSimpleScheme( drawing::ShadeMode& rShadeMode
- , sal_Int32& rnRoundedEdges
- , sal_Int32& rnObjectLines
- , const uno::Reference< XDiagram >& xDiagram )
-{
- rShadeMode = drawing::ShadeMode_FLAT;
- rnRoundedEdges = 0;
-
- uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
- rnObjectLines = ChartTypeHelper::noBordersForSimpleScheme( xChartType ) ? 0 : 1;
-}
-
} //end anonymous namespace
drawing::CameraGeometry ThreeDHelper::getDefaultCameraGeometry( bool bPie )
@@ -318,60 +85,6 @@ drawing::CameraGeometry ThreeDHelper::getDefaultCameraGeometry( bool bPie )
namespace
{
-::basegfx::B3DHomMatrix lcl_getCameraMatrix( const uno::Reference< beans::XPropertySet >& xSceneProperties )
-{
- drawing::HomogenMatrix aCameraMatrix;
-
- drawing::CameraGeometry aCG( ThreeDHelper::getDefaultCameraGeometry() );
- if( xSceneProperties.is() )
- xSceneProperties->getPropertyValue( "D3DCameraGeometry" ) >>= aCG;
-
- ::basegfx::B3DVector aVPN( BaseGFXHelper::Direction3DToB3DVector( aCG.vpn ) );
- ::basegfx::B3DVector aVUP( BaseGFXHelper::Direction3DToB3DVector( aCG.vup ) );
-
- //normalize vectors:
- aVPN.normalize();
- aVUP.normalize();
-
- ::basegfx::B3DVector aCross = ::basegfx::cross( aVUP, aVPN );
-
- //first line is VUP x VPN
- aCameraMatrix.Line1.Column1 = aCross[0];
- aCameraMatrix.Line1.Column2 = aCross[1];
- aCameraMatrix.Line1.Column3 = aCross[2];
- aCameraMatrix.Line1.Column4 = 0.0;
-
- //second line is VUP
- aCameraMatrix.Line2.Column1 = aVUP[0];
- aCameraMatrix.Line2.Column2 = aVUP[1];
- aCameraMatrix.Line2.Column3 = aVUP[2];
- aCameraMatrix.Line2.Column4 = 0.0;
-
- //third line is VPN
- aCameraMatrix.Line3.Column1 = aVPN[0];
- aCameraMatrix.Line3.Column2 = aVPN[1];
- aCameraMatrix.Line3.Column3 = aVPN[2];
- aCameraMatrix.Line3.Column4 = 0.0;
-
- //fourth line is 0 0 0 1
- aCameraMatrix.Line4.Column1 = 0.0;
- aCameraMatrix.Line4.Column2 = 0.0;
- aCameraMatrix.Line4.Column3 = 0.0;
- aCameraMatrix.Line4.Column4 = 1.0;
-
- return BaseGFXHelper::HomogenMatrixToB3DHomMatrix( aCameraMatrix );
-}
-
-double lcl_shiftAngleToIntervalMinusPiToPi( double fAngleRad )
-{
- //valid range: ]-Pi,Pi]
- while( fAngleRad<=-M_PI )
- fAngleRad+=(2*M_PI);
- while( fAngleRad>M_PI )
- fAngleRad-=(2*M_PI);
- return fAngleRad;
-}
-
void lcl_ensureIntervalMinus1To1( double& rSinOrCos )
{
if (rSinOrCos < -1.0)
@@ -890,172 +603,6 @@ void ThreeDHelper::adaptRadAnglesForRightAngledAxes( double& rfXAngleRad, double
rfYAngleRad = ThreeDHelper::getValueClippedToRange(rfYAngleRad, basegfx::deg2rad(ThreeDHelper::getYDegreeAngleLimitForRightAngledAxes()) );
}
-void ThreeDHelper::getRotationAngleFromDiagram(
- const Reference< beans::XPropertySet >& xSceneProperties, double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad )
-{
- //takes the camera and the transformation matrix into account
-
- rfXAngleRad = rfYAngleRad = rfZAngleRad = 0.0;
-
- if( !xSceneProperties.is() )
- return;
-
- //get camera rotation
- ::basegfx::B3DHomMatrix aFixCameraRotationMatrix( lcl_getCameraMatrix( xSceneProperties ) );
- BaseGFXHelper::ReduceToRotationMatrix( aFixCameraRotationMatrix );
-
- //get scene rotation
- ::basegfx::B3DHomMatrix aSceneRotation;
- {
- drawing::HomogenMatrix aHomMatrix;
- if( xSceneProperties->getPropertyValue( "D3DTransformMatrix") >>= aHomMatrix )
- {
- aSceneRotation = BaseGFXHelper::HomogenMatrixToB3DHomMatrix( aHomMatrix );
- BaseGFXHelper::ReduceToRotationMatrix( aSceneRotation );
- }
- }
-
- ::basegfx::B3DHomMatrix aResultRotation = aFixCameraRotationMatrix * aSceneRotation;
- ::basegfx::B3DTuple aRotation( BaseGFXHelper::GetRotationFromMatrix( aResultRotation ) );
-
- rfXAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getX());
- rfYAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getY());
- rfZAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getZ());
-
- if(rfZAngleRad<-M_PI_2 || rfZAngleRad>M_PI_2)
- {
- rfZAngleRad-=M_PI;
- rfXAngleRad-=M_PI;
- rfYAngleRad=(M_PI-rfYAngleRad);
-
- rfXAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfXAngleRad);
- rfYAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfYAngleRad);
- rfZAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfZAngleRad);
- }
-}
-
-void ThreeDHelper::switchRightAngledAxes( const Reference< beans::XPropertySet >& xSceneProperties, bool bRightAngledAxes )
-{
- try
- {
- if( xSceneProperties.is() )
- {
- bool bOldRightAngledAxes = false;
- xSceneProperties->getPropertyValue( "RightAngledAxes") >>= bOldRightAngledAxes;
- if( bOldRightAngledAxes!=bRightAngledAxes)
- {
- xSceneProperties->setPropertyValue( "RightAngledAxes", uno::Any( bRightAngledAxes ));
- if(bRightAngledAxes)
- {
- ::basegfx::B3DHomMatrix aInverseRotation( lcl_getInverseRotationMatrix( xSceneProperties ) );
- lcl_rotateLights( aInverseRotation, xSceneProperties );
- }
- else
- {
- ::basegfx::B3DHomMatrix aCompleteRotation( lcl_getCompleteRotationMatrix( xSceneProperties ) );
- lcl_rotateLights( aCompleteRotation, xSceneProperties );
- }
- }
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-}
-
-void ThreeDHelper::setRotationAngleToDiagram(
- const Reference< beans::XPropertySet >& xSceneProperties
- , double fXAngleRad, double fYAngleRad, double fZAngleRad )
-{
- //the rotation of the camera is not touched but taken into account
- //the rotation difference is applied to the transformation matrix
-
- //the light sources will be adapted also
-
- if( !xSceneProperties.is() )
- return;
-
- try
- {
- //remind old rotation for adaptation of light directions
- ::basegfx::B3DHomMatrix aInverseOldRotation( lcl_getInverseRotationMatrix( xSceneProperties ) );
-
- ::basegfx::B3DHomMatrix aInverseCameraRotation;
- {
- ::basegfx::B3DTuple aR( BaseGFXHelper::GetRotationFromMatrix(
- lcl_getCameraMatrix( xSceneProperties ) ) );
- aInverseCameraRotation.rotate( 0.0, 0.0, -aR.getZ() );
- aInverseCameraRotation.rotate( 0.0, -aR.getY(), 0.0 );
- aInverseCameraRotation.rotate( -aR.getX(), 0.0, 0.0 );
- }
-
- ::basegfx::B3DHomMatrix aCumulatedRotation;
- aCumulatedRotation.rotate( fXAngleRad, fYAngleRad, fZAngleRad );
-
- //calculate new scene matrix
- ::basegfx::B3DHomMatrix aSceneRotation = aInverseCameraRotation*aCumulatedRotation;
- BaseGFXHelper::ReduceToRotationMatrix( aSceneRotation );
-
- //set new rotation to transformation matrix
- xSceneProperties->setPropertyValue(
- "D3DTransformMatrix", uno::Any( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aSceneRotation )));
-
- //rotate lights if RightAngledAxes are not set or not supported
- bool bRightAngledAxes = false;
- xSceneProperties->getPropertyValue( "RightAngledAxes") >>= bRightAngledAxes;
- uno::Reference< chart2::XDiagram > xDiagram( xSceneProperties, uno::UNO_QUERY );
- if(!bRightAngledAxes || !ChartTypeHelper::isSupportingRightAngledAxes(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ) )
- {
- ::basegfx::B3DHomMatrix aNewRotation;
- aNewRotation.rotate( fXAngleRad, fYAngleRad, fZAngleRad );
- lcl_rotateLights( aNewRotation*aInverseOldRotation, xSceneProperties );
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-}
-
-void ThreeDHelper::getRotationFromDiagram( const uno::Reference< beans::XPropertySet >& xSceneProperties
- , sal_Int32& rnHorizontalAngleDegree, sal_Int32& rnVerticalAngleDegree )
-{
- double fXAngle, fYAngle, fZAngle;
- ThreeDHelper::getRotationAngleFromDiagram( xSceneProperties, fXAngle, fYAngle, fZAngle );
-
- if( !lcl_isRightAngledAxesSetAndSupported( xSceneProperties ) )
- {
- ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
- rnHorizontalAngleDegree, rnVerticalAngleDegree, fXAngle, fYAngle, fZAngle);
- rnVerticalAngleDegree*=-1;
- }
- else
- {
- rnHorizontalAngleDegree = basegfx::fround(basegfx::rad2deg(fXAngle));
- rnVerticalAngleDegree = basegfx::fround(-1.0 * basegfx::rad2deg(fYAngle));
- // nZRotation = basegfx::fround(-1.0 * basegfx::rad2deg(fZAngle));
- }
-
- rnHorizontalAngleDegree = NormAngle180(rnHorizontalAngleDegree);
- rnVerticalAngleDegree = NormAngle180(rnVerticalAngleDegree);
-}
-
-void ThreeDHelper::setRotationToDiagram( const uno::Reference< beans::XPropertySet >& xSceneProperties
- , sal_Int32 nHorizontalAngleDegree, sal_Int32 nVerticalYAngleDegree )
-{
- //todo: x and y is not equal to horz and vert in case of RightAngledAxes==false
- double fXAngle = basegfx::deg2rad(nHorizontalAngleDegree);
- double fYAngle = basegfx::deg2rad(-1 * nVerticalYAngleDegree);
- double fZAngle = 0.0;
-
- if( !lcl_isRightAngledAxesSetAndSupported( xSceneProperties ) )
- ThreeDHelper::convertElevationRotationDegToXYZAngleRad(
- nHorizontalAngleDegree, -1*nVerticalYAngleDegree, fXAngle, fYAngle, fZAngle );
-
- ThreeDHelper::setRotationAngleToDiagram( xSceneProperties, fXAngle, fYAngle, fZAngle );
-}
void ThreeDHelper::getCameraDistanceRange( double& rfMinimumDistance, double& rfMaximumDistance )
{
@@ -1073,57 +620,6 @@ void ThreeDHelper::ensureCameraDistanceRange( double& rfCameraDistance )
rfCameraDistance = fMax;
}
-double ThreeDHelper::getCameraDistance(
- const Reference< beans::XPropertySet >& xSceneProperties )
-{
- double fCameraDistance = FIXED_SIZE_FOR_3D_CHART_VOLUME;
-
- if( !xSceneProperties.is() )
- return fCameraDistance;
-
- try
- {
- drawing::CameraGeometry aCG( ThreeDHelper::getDefaultCameraGeometry() );
- xSceneProperties->getPropertyValue( "D3DCameraGeometry" ) >>= aCG;
- ::basegfx::B3DVector aVRP( BaseGFXHelper::Position3DToB3DVector( aCG.vrp ) );
- fCameraDistance = aVRP.getLength();
-
- ensureCameraDistanceRange( fCameraDistance );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
- return fCameraDistance;
-}
-
-void ThreeDHelper::setCameraDistance(
- const Reference< beans::XPropertySet >& xSceneProperties, double fCameraDistance )
-{
- if( !xSceneProperties.is() )
- return;
-
- try
- {
- if( fCameraDistance <= 0 )
- fCameraDistance = FIXED_SIZE_FOR_3D_CHART_VOLUME;
-
- drawing::CameraGeometry aCG( ThreeDHelper::getDefaultCameraGeometry() );
- xSceneProperties->getPropertyValue( "D3DCameraGeometry" ) >>= aCG;
- ::basegfx::B3DVector aVRP( BaseGFXHelper::Position3DToB3DVector( aCG.vrp ) );
- if( ::basegfx::fTools::equalZero( aVRP.getLength() ) )
- aVRP = ::basegfx::B3DVector(0,0,1);
- aVRP.setLength(fCameraDistance);
- aCG.vrp = BaseGFXHelper::B3DVectorToPosition3D( aVRP );
-
- xSceneProperties->setPropertyValue( "D3DCameraGeometry", uno::Any( aCG ));
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-}
-
double ThreeDHelper::CameraDistanceToPerspective( double fCameraDistance )
{
double fMin, fMax;
@@ -1152,142 +648,8 @@ double ThreeDHelper::PerspectiveToCameraDistance( double fPerspective )
return fRet;
}
-ThreeDLookScheme ThreeDHelper::detectScheme( const uno::Reference< XDiagram >& xDiagram )
-{
- ThreeDLookScheme aScheme = ThreeDLookScheme::ThreeDLookScheme_Unknown;
-
- sal_Int32 nRoundedEdges;
- sal_Int32 nObjectLines;
- ThreeDHelper::getRoundedEdgesAndObjectLines( xDiagram, nRoundedEdges, nObjectLines );
-
- //get shade mode and light settings:
- drawing::ShadeMode aShadeMode( drawing::ShadeMode_SMOOTH );
- uno::Reference< beans::XPropertySet > xDiagramProps( xDiagram, uno::UNO_QUERY );
- try
- {
- if( xDiagramProps.is() )
- xDiagramProps->getPropertyValue( "D3DSceneShadeMode" )>>= aShadeMode;
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- if( lcl_isSimpleScheme( aShadeMode, nRoundedEdges, nObjectLines, xDiagram ) )
- {
- if( lcl_isSimpleLightScheme(xDiagramProps) )
- aScheme = ThreeDLookScheme::ThreeDLookScheme_Simple;
- }
- else if( lcl_isRealisticScheme( aShadeMode, nRoundedEdges, nObjectLines ) )
- {
- if( lcl_isRealisticLightScheme(xDiagramProps) )
- aScheme = ThreeDLookScheme::ThreeDLookScheme_Realistic;
- }
-
- return aScheme;
-}
-
-void ThreeDHelper::setScheme( const uno::Reference< XDiagram >& xDiagram, ThreeDLookScheme aScheme )
-{
- if( aScheme == ThreeDLookScheme::ThreeDLookScheme_Unknown )
- return;
-
- drawing::ShadeMode aShadeMode;
- sal_Int32 nRoundedEdges;
- sal_Int32 nObjectLines;
-
- if( aScheme == ThreeDLookScheme::ThreeDLookScheme_Simple )
- lcl_setSimpleScheme(aShadeMode,nRoundedEdges,nObjectLines,xDiagram);
- else
- lcl_setRealisticScheme(aShadeMode,nRoundedEdges,nObjectLines);
-
- try
- {
- ThreeDHelper::setRoundedEdgesAndObjectLines( xDiagram, nRoundedEdges, nObjectLines );
-
- uno::Reference< beans::XPropertySet > xProp( xDiagram, uno::UNO_QUERY );
- if( xProp.is() )
- {
- drawing::ShadeMode aOldShadeMode;
- if( ! ( (xProp->getPropertyValue( "D3DSceneShadeMode" )>>=aOldShadeMode) &&
- aOldShadeMode == aShadeMode ))
- {
- xProp->setPropertyValue( "D3DSceneShadeMode", uno::Any( aShadeMode ));
- }
- }
-
- lcl_setLightsForScheme( xProp, aScheme );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
-}
-
-void ThreeDHelper::set3DSettingsToDefault( const uno::Reference< beans::XPropertySet >& xSceneProperties )
-{
- Reference< beans::XPropertyState > xState( xSceneProperties, uno::UNO_QUERY );
- if(xState.is())
- {
- xState->setPropertyToDefault( "D3DSceneDistance");
- xState->setPropertyToDefault( "D3DSceneFocalLength");
- }
- ThreeDHelper::setDefaultRotation( xSceneProperties );
- ThreeDHelper::setDefaultIllumination( xSceneProperties );
-}
-
-void ThreeDHelper::setDefaultRotation( const uno::Reference< beans::XPropertySet >& xSceneProperties, bool bPieOrDonut )
-{
- if( !xSceneProperties.is() )
- return;
-
- drawing::CameraGeometry aCameraGeo( ThreeDHelper::getDefaultCameraGeometry( bPieOrDonut ) );
- xSceneProperties->setPropertyValue( "D3DCameraGeometry", uno::Any( aCameraGeo ));
-
- ::basegfx::B3DHomMatrix aSceneRotation;
- if( bPieOrDonut )
- aSceneRotation.rotate( -M_PI/3.0, 0, 0 );
- xSceneProperties->setPropertyValue( "D3DTransformMatrix",
- uno::Any( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aSceneRotation )));
-}
-
-void ThreeDHelper::setDefaultRotation( const uno::Reference< beans::XPropertySet >& xSceneProperties )
-{
- bool bPieOrDonut( DiagramHelper::isPieOrDonutChart( uno::Reference< XDiagram >(xSceneProperties, uno::UNO_QUERY) ) );
- ThreeDHelper::setDefaultRotation( xSceneProperties, bPieOrDonut );
-}
-
-void ThreeDHelper::setDefaultIllumination( const uno::Reference< beans::XPropertySet >& xSceneProperties )
-{
- if( !xSceneProperties.is() )
- return;
-
- drawing::ShadeMode aShadeMode( drawing::ShadeMode_SMOOTH );
- try
- {
- xSceneProperties->getPropertyValue( "D3DSceneShadeMode" )>>= aShadeMode;
- xSceneProperties->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_1, uno::Any( false ) );
- xSceneProperties->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_3, uno::Any( false ) );
- xSceneProperties->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_4, uno::Any( false ) );
- xSceneProperties->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_5, uno::Any( false ) );
- xSceneProperties->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_6, uno::Any( false ) );
- xSceneProperties->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_7, uno::Any( false ) );
- xSceneProperties->setPropertyValue( UNO_NAME_3D_SCENE_LIGHTON_8, uno::Any( false ) );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
-
- ThreeDLookScheme aScheme = (aShadeMode == drawing::ShadeMode_FLAT)
- ? ThreeDLookScheme::ThreeDLookScheme_Simple
- : ThreeDLookScheme::ThreeDLookScheme_Realistic;
- lcl_setLightsForScheme( xSceneProperties, aScheme );
-}
-
void ThreeDHelper::getRoundedEdgesAndObjectLines(
- const uno::Reference< XDiagram > & xDiagram
+ const rtl::Reference< Diagram > & xDiagram
, sal_Int32& rnRoundedEdges, sal_Int32& rnObjectLines )
{
rnRoundedEdges = -1;
@@ -1299,17 +661,16 @@ void ThreeDHelper::getRoundedEdgesAndObjectLines(
drawing::LineStyle aLineStyle( drawing::LineStyle_SOLID );
- std::vector< uno::Reference< XDataSeries > > aSeriesList(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
+ std::vector< rtl::Reference< DataSeries > > aSeriesList =
+ xDiagram->getDataSeries();
sal_Int32 nSeriesCount = static_cast<sal_Int32>( aSeriesList.size() );
- OUString aPercentDiagonalPropertyName( "PercentDiagonal" );
- OUString aBorderStylePropertyName( "BorderStyle" );
+ OUString aPercentDiagonalPropertyName( u"PercentDiagonal"_ustr );
+ OUString aBorderStylePropertyName( u"BorderStyle"_ustr );
for( sal_Int32 nS = 0; nS < nSeriesCount; ++nS )
{
- uno::Reference< XDataSeries > xSeries( aSeriesList[nS] );
- uno::Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY );
+ const rtl::Reference< DataSeries >& xSeries( aSeriesList[nS] );
if(!nS)
{
rnRoundedEdges = 0;
@@ -1317,11 +678,11 @@ void ThreeDHelper::getRoundedEdgesAndObjectLines(
{
sal_Int16 nPercentDiagonal = 0;
- xProp->getPropertyValue( aPercentDiagonalPropertyName ) >>= nPercentDiagonal;
+ xSeries->getPropertyValue( aPercentDiagonalPropertyName ) >>= nPercentDiagonal;
rnRoundedEdges = static_cast< sal_Int32 >( nPercentDiagonal );
- if( DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries
- , aPercentDiagonalPropertyName, uno::Any(nPercentDiagonal) ) )
+ if( xSeries->hasAttributedDataPointDifferentValue(
+ aPercentDiagonalPropertyName, uno::Any(nPercentDiagonal) ) )
bDifferentRoundedEdges = true;
}
catch( const uno::Exception& )
@@ -1331,10 +692,10 @@ void ThreeDHelper::getRoundedEdgesAndObjectLines(
}
try
{
- xProp->getPropertyValue( aBorderStylePropertyName ) >>= aLineStyle;
+ xSeries->getPropertyValue( aBorderStylePropertyName ) >>= aLineStyle;
- if( DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries
- , aBorderStylePropertyName, uno::Any(aLineStyle) ) )
+ if( xSeries->hasAttributedDataPointDifferentValue(
+ aBorderStylePropertyName, uno::Any(aLineStyle) ) )
bDifferentObjectLines = true;
}
catch( const uno::Exception& )
@@ -1348,11 +709,11 @@ void ThreeDHelper::getRoundedEdgesAndObjectLines(
if( !bDifferentRoundedEdges )
{
sal_Int16 nPercentDiagonal = 0;
- xProp->getPropertyValue( aPercentDiagonalPropertyName ) >>= nPercentDiagonal;
+ xSeries->getPropertyValue( aPercentDiagonalPropertyName ) >>= nPercentDiagonal;
sal_Int32 nCurrentRoundedEdges = static_cast< sal_Int32 >( nPercentDiagonal );
if(nCurrentRoundedEdges!=rnRoundedEdges
- || DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries
- , aPercentDiagonalPropertyName, uno::Any( static_cast< sal_Int16 >(rnRoundedEdges) ) ) )
+ || xSeries->hasAttributedDataPointDifferentValue(
+ aPercentDiagonalPropertyName, uno::Any( static_cast< sal_Int16 >(rnRoundedEdges) ) ) )
{
bDifferentRoundedEdges = true;
}
@@ -1361,10 +722,10 @@ void ThreeDHelper::getRoundedEdgesAndObjectLines(
if( !bDifferentObjectLines )
{
drawing::LineStyle aCurrentLineStyle;
- xProp->getPropertyValue( aBorderStylePropertyName ) >>= aCurrentLineStyle;
+ xSeries->getPropertyValue( aBorderStylePropertyName ) >>= aCurrentLineStyle;
if(aCurrentLineStyle!=aLineStyle
- || DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries
- , aBorderStylePropertyName, uno::Any(aLineStyle) ) )
+ || xSeries->hasAttributedDataPointDifferentValue(
+ aBorderStylePropertyName, uno::Any(aLineStyle) ) )
bDifferentObjectLines = true;
}
}
@@ -1386,7 +747,7 @@ void ThreeDHelper::getRoundedEdgesAndObjectLines(
}
void ThreeDHelper::setRoundedEdgesAndObjectLines(
- const uno::Reference< XDiagram > & xDiagram
+ const rtl::Reference< Diagram > & xDiagram
, sal_Int32 nRoundedEdges, sal_Int32 nObjectLines )
{
if( (nRoundedEdges<0||nRoundedEdges>100) && nObjectLines!=0 && nObjectLines!=1 )
@@ -1399,28 +760,25 @@ void ThreeDHelper::setRoundedEdgesAndObjectLines(
uno::Any aALineStyle( aLineStyle);
uno::Any aARoundedEdges( static_cast< sal_Int16 >( nRoundedEdges ));
- std::vector< uno::Reference< XDataSeries > > aSeriesList(
- DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
- sal_Int32 nSeriesCount = static_cast<sal_Int32>( aSeriesList.size() );
- for( sal_Int32 nS = 0; nS < nSeriesCount; ++nS )
+ std::vector< rtl::Reference< DataSeries > > aSeriesList =
+ xDiagram->getDataSeries();
+ for( auto const& xSeries : aSeriesList)
{
- uno::Reference< XDataSeries > xSeries( aSeriesList[nS] );
-
if( nRoundedEdges>=0 && nRoundedEdges<=100 )
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "PercentDiagonal", aARoundedEdges );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"PercentDiagonal"_ustr, aARoundedEdges );
if( nObjectLines==0 || nObjectLines==1 )
- DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "BorderStyle", aALineStyle );
+ xSeries->setPropertyAlsoToAllAttributedDataPoints( u"BorderStyle"_ustr, aALineStyle );
}
}
-CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( const Reference< beans::XPropertySet >& xSceneProperties )
+CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( const rtl::Reference< ::chart::Diagram >& xDiagram )
{
CuboidPlanePosition eRet(CuboidPlanePosition_Left);
double fXAngleRad=0.0; double fYAngleRad=0.0; double fZAngleRad=0.0;
- ThreeDHelper::getRotationAngleFromDiagram( xSceneProperties, fXAngleRad, fYAngleRad, fZAngleRad );
- if( lcl_isRightAngledAxesSetAndSupported( xSceneProperties ) )
+ xDiagram->getRotationAngle( fXAngleRad, fYAngleRad, fZAngleRad );
+ if( lcl_isRightAngledAxesSetAndSupported( xDiagram ) )
{
ThreeDHelper::adaptRadAnglesForRightAngledAxes( fXAngleRad, fYAngleRad );
}
@@ -1429,13 +787,13 @@ CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeft
return eRet;
}
-CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( const Reference< beans::XPropertySet >& xSceneProperties )
+CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( const rtl::Reference< Diagram >& xDiagram )
{
CuboidPlanePosition eRet(CuboidPlanePosition_Back);
double fXAngleRad=0.0; double fYAngleRad=0.0; double fZAngleRad=0.0;
- ThreeDHelper::getRotationAngleFromDiagram( xSceneProperties, fXAngleRad, fYAngleRad, fZAngleRad );
- if( lcl_isRightAngledAxesSetAndSupported( xSceneProperties ) )
+ xDiagram->getRotationAngle( fXAngleRad, fYAngleRad, fZAngleRad );
+ if( lcl_isRightAngledAxesSetAndSupported( xDiagram ) )
{
ThreeDHelper::adaptRadAnglesForRightAngledAxes( fXAngleRad, fYAngleRad );
}
@@ -1444,13 +802,13 @@ CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBack
return eRet;
}
-CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( const Reference< beans::XPropertySet >& xSceneProperties )
+CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( const rtl::Reference< Diagram >& xDiagram )
{
CuboidPlanePosition eRet(CuboidPlanePosition_Bottom);
double fXAngleRad=0.0; double fYAngleRad=0.0; double fZAngleRad=0.0;
- ThreeDHelper::getRotationAngleFromDiagram( xSceneProperties, fXAngleRad, fYAngleRad, fZAngleRad );
- if( lcl_isRightAngledAxesSetAndSupported( xSceneProperties ) )
+ xDiagram->getRotationAngle( fXAngleRad, fYAngleRad, fZAngleRad );
+ if( lcl_isRightAngledAxesSetAndSupported( xDiagram ) )
{
ThreeDHelper::adaptRadAnglesForRightAngledAxes( fXAngleRad, fYAngleRad );
}
diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx
index 0078e0a29a6c..4a2bfa4f0315 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -18,16 +18,15 @@
*/
#include <TitleHelper.hxx>
+#include <Title.hxx>
#include <ChartModel.hxx>
-#include <ChartModelHelper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
#include <ReferenceSizeProvider.hxx>
#include <com/sun/star/chart2/FormattedString.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include <rtl/ustrbuf.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
namespace chart
@@ -41,7 +40,7 @@ namespace {
uno::Reference< XTitled > lcl_getTitleParentFromDiagram(
TitleHelper::eTitleType nTitleIndex
- , const uno::Reference< XDiagram >& xDiagram )
+ , const rtl::Reference< Diagram >& xDiagram )
{
uno::Reference< XTitled > xResult;
@@ -49,7 +48,7 @@ uno::Reference< XTitled > lcl_getTitleParentFromDiagram(
nTitleIndex == TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION )
{
bool bDummy = false;
- bool bIsVertical = DiagramHelper::getVertical( xDiagram, bDummy, bDummy );
+ bool bIsVertical = xDiagram && xDiagram->getVertical( bDummy, bDummy );
if( nTitleIndex == TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION )
nTitleIndex = bIsVertical ? TitleHelper::X_AXIS_TITLE : TitleHelper::Y_AXIS_TITLE;
@@ -61,27 +60,27 @@ uno::Reference< XTitled > lcl_getTitleParentFromDiagram(
{
case TitleHelper::SUB_TITLE:
if( xDiagram.is())
- xResult.set( xDiagram, uno::UNO_QUERY );
+ xResult = xDiagram;
break;
case TitleHelper::X_AXIS_TITLE:
if( xDiagram.is())
- xResult.set( AxisHelper::getAxis( 0, true, xDiagram ), uno::UNO_QUERY );
+ xResult = AxisHelper::getAxis( 0, true, xDiagram );
break;
case TitleHelper::Y_AXIS_TITLE:
if( xDiagram.is())
- xResult.set( AxisHelper::getAxis( 1, true, xDiagram ), uno::UNO_QUERY );
+ xResult = AxisHelper::getAxis( 1, true, xDiagram );
break;
case TitleHelper::Z_AXIS_TITLE:
if( xDiagram.is())
- xResult.set( AxisHelper::getAxis( 2, true, xDiagram ), uno::UNO_QUERY );
+ xResult = AxisHelper::getAxis( 2, true, xDiagram );
break;
case TitleHelper::SECONDARY_X_AXIS_TITLE:
if( xDiagram.is())
- xResult.set( AxisHelper::getAxis( 0, false, xDiagram ), uno::UNO_QUERY );
+ xResult = AxisHelper::getAxis( 0, false, xDiagram );
break;
case TitleHelper::SECONDARY_Y_AXIS_TITLE:
if( xDiagram.is())
- xResult.set( AxisHelper::getAxis( 1, false, xDiagram ), uno::UNO_QUERY );
+ xResult = AxisHelper::getAxis( 1, false, xDiagram );
break;
case TitleHelper::MAIN_TITLE:
@@ -94,7 +93,7 @@ uno::Reference< XTitled > lcl_getTitleParentFromDiagram(
}
uno::Reference< XTitled > lcl_getTitleParent( TitleHelper::eTitleType nTitleIndex
- , const uno::Reference< XDiagram >& xDiagram )
+ , const rtl::Reference< Diagram >& xDiagram )
{
uno::Reference< XTitled > xResult;
switch( nTitleIndex )
@@ -121,70 +120,72 @@ uno::Reference< XTitled > lcl_getTitleParent( TitleHelper::eTitleType nTitleInde
}
uno::Reference< XTitled > lcl_getTitleParent( TitleHelper::eTitleType nTitleIndex
- , const uno::Reference< frame::XModel >& xModel )
+ , const rtl::Reference<::chart::ChartModel>& xModel )
{
if(nTitleIndex == TitleHelper::MAIN_TITLE)
{
- uno::Reference< XTitled > xTitled( xModel, uno::UNO_QUERY );
- return xTitled;
+ return xModel;
}
- uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY );
- uno::Reference< XDiagram > xDiagram;
+ rtl::Reference< Diagram > xDiagram;
- if( xChartDoc.is())
- xDiagram.set( xChartDoc->getFirstDiagram());
+ if( xModel.is())
+ xDiagram = xModel->getFirstChartDiagram();
return lcl_getTitleParent( nTitleIndex, xDiagram );
}
}
-uno::Reference< XTitle > TitleHelper::getTitle( TitleHelper::eTitleType nTitleIndex
+rtl::Reference< Title > TitleHelper::getTitle( TitleHelper::eTitleType nTitleIndex
, ChartModel& rModel )
{
if(nTitleIndex == TitleHelper::MAIN_TITLE)
- return rModel.getTitleObject();
+ return rModel.getTitleObject2();
- uno::Reference< XDiagram > xDiagram = rModel.getFirstDiagram();
+ rtl::Reference< Diagram > xDiagram = rModel.getFirstChartDiagram();
uno::Reference< XTitled > xTitled( lcl_getTitleParent( nTitleIndex, xDiagram ) );
- if( xTitled.is())
- return xTitled->getTitleObject();
- return nullptr;
+ if( !xTitled )
+ return nullptr;
+ uno::Reference<XTitle> xTitle = xTitled->getTitleObject();
+ auto pTitle = dynamic_cast<Title*>(xTitle.get());
+ assert(!xTitle || pTitle);
+ return pTitle;
}
-uno::Reference< XTitle > TitleHelper::getTitle( TitleHelper::eTitleType nTitleIndex
- , const uno::Reference< frame::XModel >& xModel )
+rtl::Reference< Title > TitleHelper::getTitle( TitleHelper::eTitleType nTitleIndex
+ , const rtl::Reference<ChartModel>& xModel )
{
uno::Reference< XTitled > xTitled;
if(nTitleIndex == TitleHelper::MAIN_TITLE)
{
- xTitled.set( xModel, uno::UNO_QUERY );
+ xTitled = xModel;
}
else
{
- uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY );
- uno::Reference< XDiagram > xDiagram;
- if( xChartDoc.is())
- xDiagram.set( xChartDoc->getFirstDiagram());
+ rtl::Reference< Diagram > xDiagram;
+ if( xModel.is())
+ xDiagram = xModel->getFirstChartDiagram();
xTitled = lcl_getTitleParent( nTitleIndex, xDiagram );
}
- if( xTitled.is())
- return xTitled->getTitleObject();
- return nullptr;
+ if( !xTitled )
+ return nullptr;
+ uno::Reference<XTitle> xTitle = xTitled->getTitleObject();
+ Title* pTitle = dynamic_cast<Title*>(xTitle.get());
+ assert(!xTitle || pTitle);
+ return pTitle;
}
-uno::Reference< XTitle > TitleHelper::createOrShowTitle(
+rtl::Reference< Title > TitleHelper::createOrShowTitle(
TitleHelper::eTitleType eTitleType
, const OUString& rTitleText
- , const uno::Reference< frame::XModel >& xModel
+ , const rtl::Reference<ChartModel>& xModel
, const uno::Reference< uno::XComponentContext > & xContext )
{
- uno::Reference< chart2::XTitle > xTitled( TitleHelper::getTitle( eTitleType, xModel ) );
+ rtl::Reference< Title > xTitled( TitleHelper::getTitle( eTitleType, xModel ) );
if( xTitled.is())
{
- css::uno::Reference<css::beans::XPropertySet> xProps(xTitled, css::uno::UNO_QUERY_THROW);
- xProps->setPropertyValue("Visible",css::uno::Any(true));
+ xTitled->setPropertyValue(u"Visible"_ustr,css::uno::Any(true));
return xTitled;
}
else
@@ -193,20 +194,20 @@ uno::Reference< XTitle > TitleHelper::createOrShowTitle(
}
}
-uno::Reference< XTitle > TitleHelper::createTitle(
+rtl::Reference< Title > TitleHelper::createTitle(
TitleHelper::eTitleType eTitleType
, const OUString& rTitleText
- , const uno::Reference< frame::XModel >& xModel
+ , const rtl::Reference<ChartModel>& xModel
, const uno::Reference< uno::XComponentContext > & xContext
, ReferenceSizeProvider * pRefSizeProvider )
{
- uno::Reference< XTitle > xTitle;
+ rtl::Reference< ::chart::Title > xTitle;
uno::Reference< XTitled > xTitled( lcl_getTitleParent( eTitleType, xModel ) );
if( !xTitled.is() )
{
- uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ) );
- uno::Reference< chart2::XAxis > xAxis;
+ rtl::Reference< Diagram > xDiagram( xModel->getFirstChartDiagram() );
+ rtl::Reference< Axis > xAxis;
switch( eTitleType )
{
case TitleHelper::SECONDARY_X_AXIS_TITLE:
@@ -218,90 +219,80 @@ uno::Reference< XTitle > TitleHelper::createTitle(
default:
break;
}
- uno::Reference< beans::XPropertySet > xProps( xAxis, uno::UNO_QUERY );
- if( xProps.is() )
+ if( xAxis.is() )
{
- xProps->setPropertyValue( "Show", uno::Any( false ) );
+ xAxis->setPropertyValue( u"Show"_ustr, uno::Any( false ) );
xTitled = lcl_getTitleParent( eTitleType, xModel );
}
}
if(xTitled.is())
{
- uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ) );
+ rtl::Reference< Diagram > xDiagram( xModel->getFirstChartDiagram() );
- xTitle.set( xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.chart2.Title",
- xContext ), uno::UNO_QUERY );
+ xTitle = new ::chart::Title();
- if(xTitle.is())
+ // default char height (main: 13.0 == default)
+ float fDefaultCharHeightSub = 11.0;
+ float fDefaultCharHeightAxis = 9.0;
+ switch( eTitleType )
{
- // default char height (main: 13.0 == default)
- float fDefaultCharHeightSub = 11.0;
- float fDefaultCharHeightAxis = 9.0;
- switch( eTitleType )
- {
- case TitleHelper::SUB_TITLE:
- TitleHelper::setCompleteString(
- rTitleText, xTitle, xContext, & fDefaultCharHeightSub );
- break;
- case TitleHelper::X_AXIS_TITLE:
- case TitleHelper::Y_AXIS_TITLE:
- case TitleHelper::Z_AXIS_TITLE:
- case TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION:
- case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION:
- case TitleHelper::SECONDARY_X_AXIS_TITLE:
- case TitleHelper::SECONDARY_Y_AXIS_TITLE:
- TitleHelper::setCompleteString(
- rTitleText, xTitle, xContext, & fDefaultCharHeightAxis );
- break;
- default:
- TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
- break;
- }
+ case TitleHelper::SUB_TITLE:
+ TitleHelper::setCompleteString(
+ rTitleText, xTitle, xContext, & fDefaultCharHeightSub );
+ break;
+ case TitleHelper::X_AXIS_TITLE:
+ case TitleHelper::Y_AXIS_TITLE:
+ case TitleHelper::Z_AXIS_TITLE:
+ case TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION:
+ case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION:
+ case TitleHelper::SECONDARY_X_AXIS_TITLE:
+ case TitleHelper::SECONDARY_Y_AXIS_TITLE:
+ TitleHelper::setCompleteString(
+ rTitleText, xTitle, xContext, & fDefaultCharHeightAxis );
+ break;
+ default:
+ TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
+ break;
+ }
- // set/clear autoscale
- if( pRefSizeProvider )
- pRefSizeProvider->setValuesAtTitle( xTitle );
+ // set/clear autoscale
+ if( pRefSizeProvider )
+ pRefSizeProvider->setValuesAtTitle( xTitle );
- xTitled->setTitleObject( xTitle );
+ xTitled->setTitleObject( xTitle );
- //default rotation 90 degree for y axis title in normal coordinatesystems or for x axis title for swapped coordinatesystems
- if( eTitleType == TitleHelper::X_AXIS_TITLE ||
- eTitleType == TitleHelper::Y_AXIS_TITLE ||
- eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE ||
- eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE )
+ //default rotation 90 degree for y axis title in normal coordinatesystems or for x axis title for swapped coordinatesystems
+ if( eTitleType == TitleHelper::X_AXIS_TITLE ||
+ eTitleType == TitleHelper::Y_AXIS_TITLE ||
+ eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE ||
+ eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE )
+ {
+ try
{
- try
- {
- bool bDummy = false;
- bool bIsVertical = DiagramHelper::getVertical( xDiagram, bDummy, bDummy );
-
- Reference< beans::XPropertySet > xTitleProps( xTitle, uno::UNO_QUERY );
- if( xTitleProps.is() )
- {
- if( (!bIsVertical && eTitleType == TitleHelper::Y_AXIS_TITLE)
- || (bIsVertical && eTitleType == TitleHelper::X_AXIS_TITLE)
- || (!bIsVertical && eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE)
- || (bIsVertical && eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE) )
- {
- xTitleProps->setPropertyValue( "TextRotation", uno::Any( 90.0 ));
- }
- }
- }
- catch( const uno::Exception & )
+ bool bDummy = false;
+ bool bIsVertical = xDiagram->getVertical( bDummy, bDummy );
+
+ if( (!bIsVertical && eTitleType == TitleHelper::Y_AXIS_TITLE)
+ || (bIsVertical && eTitleType == TitleHelper::X_AXIS_TITLE)
+ || (!bIsVertical && eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE)
+ || (bIsVertical && eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE) )
{
- DBG_UNHANDLED_EXCEPTION("chart2");
+ xTitle->setPropertyValue( u"TextRotation"_ustr, uno::Any( 90.0 ));
}
}
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
}
}
return xTitle;
}
-OUString TitleHelper::getCompleteString( const uno::Reference< XTitle >& xTitle )
+OUString TitleHelper::getCompleteString( const rtl::Reference< Title >& xTitle )
{
if(!xTitle.is())
return OUString();
@@ -312,53 +303,89 @@ OUString TitleHelper::getCompleteString( const uno::Reference< XTitle >& xTitle
return aRet.makeStringAndClear();
}
+OUString TitleHelper::getUnstackedStr(const OUString& rNewText)
+{
+ //#i99841# remove linebreaks that were added for vertical stacking
+ OUStringBuffer aUnstackedStr;
+ OUStringBuffer aSource(rNewText);
+
+ bool bBreakIgnored = false;
+ sal_Int32 nLen = rNewText.getLength();
+ for (sal_Int32 nPos = 0; nPos < nLen; ++nPos)
+ {
+ sal_Unicode aChar = aSource[nPos];
+ if (aChar != '\n')
+ {
+ aUnstackedStr.append(aChar);
+ bBreakIgnored = false;
+ }
+ else if (aChar == '\n' && bBreakIgnored)
+ aUnstackedStr.append(aChar);
+ else
+ bBreakIgnored = true;
+ }
+ return aUnstackedStr.makeStringAndClear();
+}
+
+void TitleHelper::setFormattedString( const rtl::Reference< Title >& xTitle,
+ const css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& aNewFormattedTitle )
+{
+ if (!xTitle.is() || !aNewFormattedTitle.hasElements())
+ return;
+
+ bool bStacked = false;
+ xTitle->getPropertyValue(u"StackCharacters"_ustr) >>= bStacked;
+
+ if (bStacked)
+ {
+ for (uno::Reference< chart2::XFormattedString >const& formattedStr : aNewFormattedTitle)
+ {
+ formattedStr->setString(TitleHelper::getUnstackedStr(formattedStr->getString()));
+ }
+ }
+
+ xTitle->setText(aNewFormattedTitle);
+}
+
void TitleHelper::setCompleteString( const OUString& rNewText
- , const uno::Reference< XTitle >& xTitle
+ , const rtl::Reference< Title >& xTitle
, const uno::Reference< uno::XComponentContext > & xContext
- , const float * pDefaultCharHeight /* = 0 */ )
+ , const float * pDefaultCharHeight /* = 0 */
+ , bool bDialogTitle /*= false*/ )
{
- //the format of the first old text portion will be maintained if there is any
- if(!xTitle.is())
+ if (!xTitle.is())
return;
- OUString aNewText = rNewText;
-
bool bStacked = false;
- uno::Reference< beans::XPropertySet > xTitleProperties( xTitle, uno::UNO_QUERY );
- if( xTitleProperties.is() )
- xTitleProperties->getPropertyValue( "StackCharacters" ) >>= bStacked;
+ if( xTitle.is() )
+ xTitle->getPropertyValue( u"StackCharacters"_ustr ) >>= bStacked;
+ OUString aNewText = rNewText;
if( bStacked )
{
- //#i99841# remove linebreaks that were added for vertical stacking
- OUStringBuffer aUnstackedStr;
- OUStringBuffer aSource(rNewText);
-
- bool bBreakIgnored = false;
- sal_Int32 nLen = rNewText.getLength();
- for( sal_Int32 nPos = 0; nPos < nLen; ++nPos )
- {
- sal_Unicode aChar = aSource[nPos];
- if( aChar != '\n' )
- {
- aUnstackedStr.append( aChar );
- bBreakIgnored = false;
- }
- else if( aChar == '\n' && bBreakIgnored )
- aUnstackedStr.append( aChar );
- else
- bBreakIgnored = true;
- }
- aNewText = aUnstackedStr.makeStringAndClear();
+ aNewText = getUnstackedStr(rNewText);
}
uno::Sequence< uno::Reference< XFormattedString > > aNewStringList;
-
- uno::Sequence< uno::Reference< XFormattedString > > aOldStringList = xTitle->getText();
- if( aOldStringList.hasElements() )
+ uno::Sequence< uno::Reference< XFormattedString > > aOldStringList = xTitle->getText();
+ if( aOldStringList.hasElements())
{
- aNewStringList = { aOldStringList[0] };
- aNewStringList[0]->setString( aNewText );
+ const OUString aFullString = getCompleteString(xTitle);
+ if (bDialogTitle && aNewText.equals(getUnstackedStr(aFullString)))
+ {
+ // If the new title setted from a dialog window to a new string
+ // the first old text portion will be maintained if it's a new string,
+ // otherwise we use the original one.
+ aNewStringList = std::move(aOldStringList);
+ }
+ else
+ {
+ // If the new title setted from a dialog to a new string the first
+ // old text portion will be maintained if there was any. Also in case of ODF
+ // import which still not support non-uniform formatted titles
+ aNewStringList = { aOldStringList[0] };
+ aNewStringList[0]->setString(aNewText);
+ }
}
else
{
@@ -372,9 +399,9 @@ void TitleHelper::setCompleteString( const OUString& rNewText
try
{
uno::Any aFontSize( *pDefaultCharHeight );
- xFormattedString->setPropertyValue( "CharHeight", aFontSize );
- xFormattedString->setPropertyValue( "CharHeightAsian", aFontSize );
- xFormattedString->setPropertyValue( "CharHeightComplex", aFontSize );
+ xFormattedString->setPropertyValue( u"CharHeight"_ustr, aFontSize );
+ xFormattedString->setPropertyValue( u"CharHeightAsian"_ustr, aFontSize );
+ xFormattedString->setPropertyValue( u"CharHeightComplex"_ustr, aFontSize );
}
catch( const uno::Exception & )
{
@@ -386,7 +413,7 @@ void TitleHelper::setCompleteString( const OUString& rNewText
}
void TitleHelper::removeTitle( TitleHelper::eTitleType nTitleIndex
- , const css::uno::Reference< css::frame::XModel >& xModel )
+ , const rtl::Reference<ChartModel>& xModel )
{
uno::Reference< XTitled > xTitled( lcl_getTitleParent( nTitleIndex, xModel ) );
if( xTitled.is())
@@ -396,34 +423,13 @@ void TitleHelper::removeTitle( TitleHelper::eTitleType nTitleIndex
}
bool TitleHelper::getTitleType( eTitleType& rType
- , const css::uno::Reference< css::chart2::XTitle >& xTitle
- , ChartModel& rModel )
-{
- if( !xTitle.is() )
- return false;
-
- Reference< chart2::XTitle > xCurrentTitle;
- for( sal_Int32 nTitleType = TITLE_BEGIN; nTitleType < NORMAL_TITLE_END; nTitleType++ )
- {
- xCurrentTitle = TitleHelper::getTitle( static_cast<eTitleType>(nTitleType), rModel );
- if( xCurrentTitle == xTitle )
- {
- rType = static_cast<eTitleType>(nTitleType);
- return true;
- }
- }
-
- return false;
-}
-
-bool TitleHelper::getTitleType( eTitleType& rType
- , const css::uno::Reference< css::chart2::XTitle >& xTitle
- , const css::uno::Reference< css::frame::XModel >& xModel )
+ , const rtl::Reference< Title >& xTitle
+ , const rtl::Reference<ChartModel>& xModel )
{
if( !xTitle.is() || !xModel.is() )
return false;
- Reference< chart2::XTitle > xCurrentTitle;
+ rtl::Reference< Title > xCurrentTitle;
for( sal_Int32 nTitleType = TITLE_BEGIN; nTitleType < NORMAL_TITLE_END; nTitleType++ )
{
xCurrentTitle = TitleHelper::getTitle( static_cast<eTitleType>(nTitleType), xModel );
@@ -438,14 +444,11 @@ bool TitleHelper::getTitleType( eTitleType& rType
}
void TitleHelper::hideTitle( TitleHelper::eTitleType nTitleIndex
- , const css::uno::Reference< css::frame::XModel >& xModel)
+ , const rtl::Reference<ChartModel>& xModel)
{
- uno::Reference< chart2::XTitle > xTitled( TitleHelper::getTitle( nTitleIndex, xModel ) );
+ rtl::Reference< Title > xTitled( TitleHelper::getTitle( nTitleIndex, xModel ) );
if( xTitled.is())
- {
- css::uno::Reference<css::beans::XPropertySet> xProps(xTitled, css::uno::UNO_QUERY_THROW);
- xProps->setPropertyValue("Visible",css::uno::makeAny(false));
- }
+ xTitled->setPropertyValue(u"Visible"_ustr,css::uno::Any(false));
}
} //namespace chart
diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx
index fa069a631870..917135bef8aa 100644
--- a/chart2/source/tools/UncachedDataSequence.cxx
+++ b/chart2/source/tools/UncachedDataSequence.cxx
@@ -26,23 +26,20 @@
#include <algorithm>
#include <strings.hrc>
#include <ResId.hxx>
-#include <com/sun/star/chart2/XInternalDataProvider.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
-using ::osl::MutexGuard;
// necessary for MS compiler
-using ::comphelper::OPropertyContainer;
using ::chart::impl::UncachedDataSequence_Base;
namespace
{
-constexpr OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.UncachedDataSequence";
+constexpr OUString lcl_aServiceName = u"com.sun.star.comp.chart.UncachedDataSequence"_ustr;
enum
{
@@ -56,37 +53,32 @@ namespace chart
{
UncachedDataSequence::UncachedDataSequence(
- const rtl::Reference< InternalDataProvider > & xIntDataProv,
- const OUString & rRangeRepresentation )
- : OPropertyContainer( GetBroadcastHelper()),
- UncachedDataSequence_Base( GetMutex()),
- m_nNumberFormatKey(0),
- m_xDataProvider( xIntDataProv ),
- m_aSourceRepresentation( rRangeRepresentation ),
+ rtl::Reference< InternalDataProvider > xIntDataProv,
+ OUString aRangeRepresentation )
+ : m_nNumberFormatKey(0),
+ m_xDataProvider(std::move( xIntDataProv )),
+ m_aSourceRepresentation(std::move( aRangeRepresentation )),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
registerProperties();
}
UncachedDataSequence::UncachedDataSequence(
- const rtl::Reference< InternalDataProvider > & xIntDataProv,
- const OUString & rRangeRepresentation,
+ rtl::Reference< InternalDataProvider > xIntDataProv,
+ OUString aRangeRepresentation,
const OUString & rRole )
- : OPropertyContainer( GetBroadcastHelper()),
- UncachedDataSequence_Base( GetMutex()),
- m_nNumberFormatKey(0),
- m_xDataProvider( xIntDataProv ),
- m_aSourceRepresentation( rRangeRepresentation ),
+ : m_nNumberFormatKey(0),
+ m_xDataProvider(std::move( xIntDataProv )),
+ m_aSourceRepresentation(std::move( aRangeRepresentation )),
m_xModifyEventForwarder( new ModifyEventForwarder() )
{
registerProperties();
- setFastPropertyValue_NoBroadcast( PROP_PROPOSED_ROLE, uno::Any( rRole ));
+ std::unique_lock<std::mutex> aGuard;
+ setFastPropertyValue_NoBroadcast( aGuard, PROP_PROPOSED_ROLE, uno::Any( rRole ));
}
UncachedDataSequence::UncachedDataSequence( const UncachedDataSequence & rSource )
- : OPropertyContainer( GetBroadcastHelper()),
- UncachedDataSequence_Base( GetMutex()),
- m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
+ : m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
m_sRole( rSource.m_sRole ),
m_xDataProvider( rSource.m_xDataProvider ),
m_aSourceRepresentation( rSource.m_aSourceRepresentation ),
@@ -100,27 +92,27 @@ UncachedDataSequence::~UncachedDataSequence()
void UncachedDataSequence::registerProperties()
{
- registerProperty( "NumberFormatKey",
+ registerProperty( u"NumberFormatKey"_ustr,
PROP_NUMBERFORMAT_KEY,
0, // PropertyAttributes
& m_nNumberFormatKey,
cppu::UnoType<decltype(m_nNumberFormatKey)>::get() );
- registerProperty( "Role",
+ registerProperty( u"Role"_ustr,
PROP_PROPOSED_ROLE,
0, // PropertyAttributes
& m_sRole,
cppu::UnoType<decltype(m_sRole)>::get() );
- registerProperty( "CachedXMLRange",
+ registerProperty( u"CachedXMLRange"_ustr,
PROP_XML_RANGE,
0, // PropertyAttributes
& m_aXMLRange,
cppu::UnoType<decltype(m_aXMLRange)>::get() );
}
-IMPLEMENT_FORWARD_XINTERFACE2( UncachedDataSequence, UncachedDataSequence_Base, OPropertyContainer )
-IMPLEMENT_FORWARD_XTYPEPROVIDER2( UncachedDataSequence, UncachedDataSequence_Base, OPropertyContainer )
+IMPLEMENT_FORWARD_XINTERFACE2( UncachedDataSequence, UncachedDataSequence_Base, comphelper::OPropertyContainer2 )
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( UncachedDataSequence, UncachedDataSequence_Base, comphelper::OPropertyContainer2 )
// ____ XPropertySet ____
Reference< beans::XPropertySetInfo > SAL_CALL UncachedDataSequence::getPropertySetInfo()
@@ -158,46 +150,40 @@ css::uno::Sequence< OUString > SAL_CALL UncachedDataSequence::getSupportedServic
{
return {
lcl_aServiceName,
- "com.sun.star.chart2.data.DataSequence",
- "com.sun.star.chart2.data.NumericalDataSequence",
- "com.sun.star.chart2.data.TextualDataSequence"
+ u"com.sun.star.chart2.data.DataSequence"_ustr,
+ u"com.sun.star.chart2.data.NumericalDataSequence"_ustr,
+ u"com.sun.star.chart2.data.TextualDataSequence"_ustr
};
}
// ________ XNumericalDataSequence ________
Sequence< double > SAL_CALL UncachedDataSequence::getNumericalData()
{
- Sequence< double > aResult;
- MutexGuard aGuard( GetMutex() );
+ std::unique_lock<std::mutex> aGuard;
if( m_xDataProvider.is())
{
const Sequence< uno::Any > aValues( m_xDataProvider->getDataByRangeRepresentation( m_aSourceRepresentation ));
- aResult.realloc( aValues.getLength());
- std::transform( aValues.begin(), aValues.end(),
- aResult.getArray(), CommonFunctors::AnyToDouble());
+ return CommonFunctors::convertToSequence(aValues, CommonFunctors::ToDouble());
}
- return aResult;
+ return {};
}
// ________ XTextualDataSequence ________
Sequence< OUString > SAL_CALL UncachedDataSequence::getTextualData()
{
- Sequence< OUString > aResult;
- MutexGuard aGuard( GetMutex() );
+ std::unique_lock<std::mutex> aGuard;
if( m_xDataProvider.is())
{
const Sequence< uno::Any > aValues( m_xDataProvider->getDataByRangeRepresentation( m_aSourceRepresentation ));
- aResult.realloc( aValues.getLength());
- std::transform( aValues.begin(), aValues.end(),
- aResult.getArray(), CommonFunctors::AnyToString());
+ return CommonFunctors::convertToSequence(aValues, CommonFunctors::ToString());
}
- return aResult;
+ return {};
}
// ________ XDataSequence ________
Sequence< Any > SAL_CALL UncachedDataSequence::getData()
{
- MutexGuard aGuard( GetMutex() );
+ std::unique_lock<std::mutex> aGuard;
if( m_xDataProvider.is())
return m_xDataProvider->getDataByRangeRepresentation( m_aSourceRepresentation );
return Sequence< Any >();
@@ -213,7 +199,7 @@ Sequence< OUString > SAL_CALL UncachedDataSequence::generateLabel( chart2::data:
// auto-generated label
sal_Int32 nSeries = m_aSourceRepresentation.toInt32() + 1;
OUString aResString(::chart::SchResId(STR_DATA_UNNAMED_SERIES_WITH_INDEX));
- static const OUStringLiteral aReplacementStr(u"%NUMBER");
+ static constexpr OUString aReplacementStr(u"%NUMBER"_ustr);
sal_Int32 nIndex = aResString.indexOf(aReplacementStr);
OUString aName;
if( nIndex != -1 )
@@ -229,7 +215,7 @@ Sequence< OUString > SAL_CALL UncachedDataSequence::generateLabel( chart2::data:
// ____ XIndexReplace ____
void SAL_CALL UncachedDataSequence::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element )
{
- MutexGuard aGuard( GetMutex() );
+ std::unique_lock<std::mutex> aGuard;
Sequence< Any > aData( getData());
if( Index < aData.getLength() &&
m_xDataProvider.is() )
@@ -298,28 +284,12 @@ void SAL_CALL UncachedDataSequence::setModified( sal_Bool bModified )
// ____ XModifyBroadcaster (base of XModifiable) ____
void SAL_CALL UncachedDataSequence::addModifyListener( const Reference< util::XModifyListener >& aListener )
{
- try
- {
- Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
- xBroadcaster->addModifyListener( aListener );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
+ m_xModifyEventForwarder->addModifyListener( aListener );
}
void SAL_CALL UncachedDataSequence::removeModifyListener( const Reference< util::XModifyListener >& aListener )
{
- try
- {
- Reference< util::XModifyBroadcaster > xBroadcaster( m_xModifyEventForwarder, uno::UNO_QUERY_THROW );
- xBroadcaster->removeModifyListener( aListener );
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2");
- }
+ m_xModifyEventForwarder->removeModifyListener( aListener );
}
void UncachedDataSequence::fireModifyEvent()
diff --git a/chart2/source/tools/WeakListenerAdapter.cxx b/chart2/source/tools/WeakListenerAdapter.cxx
index 85b2f3b39a36..b456c5bdadf9 100644
--- a/chart2/source/tools/WeakListenerAdapter.cxx
+++ b/chart2/source/tools/WeakListenerAdapter.cxx
@@ -26,32 +26,12 @@ using ::com::sun::star::uno::Reference;
namespace chart
{
-WeakModifyListenerAdapter::WeakModifyListenerAdapter(
- const uno::WeakReference< util::XModifyListener > & xListener ) :
- WeakListenerAdapter< css::util::XModifyListener >( xListener )
-{}
-
-WeakModifyListenerAdapter::~WeakModifyListenerAdapter()
-{}
-
-void SAL_CALL WeakModifyListenerAdapter::modified( const lang::EventObject& aEvent )
-{
- Reference< util::XModifyListener > xModListener( getListener() );
- if( xModListener.is())
- xModListener->modified( aEvent );
-}
-
-WeakSelectionChangeListenerAdapter::WeakSelectionChangeListenerAdapter(
- const Reference< view::XSelectionChangeListener > & xListener ) :
- WeakListenerAdapter< css::view::XSelectionChangeListener >( xListener )
-{}
-
WeakSelectionChangeListenerAdapter::~WeakSelectionChangeListenerAdapter()
{}
void SAL_CALL WeakSelectionChangeListenerAdapter::selectionChanged( const lang::EventObject& aEvent )
{
- Reference< view::XSelectionChangeListener > xSelChgListener( getListener() );
+ Reference< view::XSelectionChangeListener > xSelChgListener( m_xListener );
if( xSelChgListener.is())
xSelChgListener->selectionChanged( aEvent );
}
diff --git a/chart2/source/tools/WrappedDefaultProperty.cxx b/chart2/source/tools/WrappedDefaultProperty.cxx
index 74d2b4b0aae0..00a94493eafc 100644
--- a/chart2/source/tools/WrappedDefaultProperty.cxx
+++ b/chart2/source/tools/WrappedDefaultProperty.cxx
@@ -18,10 +18,11 @@
*/
#include <WrappedDefaultProperty.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
+#include <utility>
using namespace ::com::sun::star;
@@ -32,9 +33,9 @@ namespace chart
WrappedDefaultProperty::WrappedDefaultProperty(
const OUString& rOuterName, const OUString& rInnerName,
- const uno::Any& rNewOuterDefault ) :
+ uno::Any aNewOuterDefault ) :
WrappedProperty( rOuterName, rInnerName ),
- m_aOuterDefaultValue( rNewOuterDefault )
+ m_aOuterDefaultValue(std::move( aNewOuterDefault ))
{}
WrappedDefaultProperty::~WrappedDefaultProperty()
diff --git a/chart2/source/tools/WrappedIgnoreProperty.cxx b/chart2/source/tools/WrappedIgnoreProperty.cxx
index 4e62dca5bd10..170aaa5b2e52 100644
--- a/chart2/source/tools/WrappedIgnoreProperty.cxx
+++ b/chart2/source/tools/WrappedIgnoreProperty.cxx
@@ -70,12 +70,12 @@ beans::PropertyState WrappedIgnoreProperty::getPropertyState( const Reference< b
void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
{
- rList.emplace_back( new WrappedIgnoreProperty( "LineStyle", uno::Any( drawing::LineStyle_SOLID ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "LineDashName", uno::Any( OUString() ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "LineColor", uno::Any( sal_Int32(0) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "LineTransparence", uno::Any( sal_Int16(0) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "LineWidth", uno::Any( sal_Int32(0) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "LineJoint", uno::Any( drawing::LineJoint_ROUND ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_SOLID ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"LineDashName"_ustr, uno::Any( OUString() ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"LineColor"_ustr, uno::Any( sal_Int32(0) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"LineTransparence"_ustr, uno::Any( sal_Int16(0) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"LineWidth"_ustr, uno::Any( sal_Int32(0) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"LineJoint"_ustr, uno::Any( drawing::LineJoint_ROUND ) ) );
}
void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
@@ -86,26 +86,26 @@ void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< std::unique_
void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
{
- rList.emplace_back( new WrappedIgnoreProperty( "FillStyle", uno::Any( drawing::FillStyle_SOLID ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillColor", uno::Any( sal_Int32(-1) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillTransparence", uno::Any( sal_Int16(0) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillTransparenceGradientName", uno::Any( OUString() ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillGradientName", uno::Any( OUString() ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillHatchName", uno::Any( OUString() ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillBackground", uno::Any( false ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillStyle"_ustr, uno::Any( drawing::FillStyle_SOLID ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillColor"_ustr, uno::Any( sal_Int32(-1) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillTransparence"_ustr, uno::Any( sal_Int16(0) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillTransparenceGradientName"_ustr, uno::Any( OUString() ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillGradientName"_ustr, uno::Any( OUString() ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillHatchName"_ustr, uno::Any( OUString() ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBackground"_ustr, uno::Any( false ) ) );
}
void WrappedIgnoreProperties::addIgnoreFillProperties_only_BitmapProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
{
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapOffsetX", uno::Any( sal_Int16(0) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapOffsetY", uno::Any( sal_Int16(0) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapPositionOffsetX", uno::Any( sal_Int16(0) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapPositionOffsetY", uno::Any( sal_Int16(0) ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapRectanglePoint", uno::Any( drawing::RectanglePoint_LEFT_TOP ) ) );
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapLogicalSize", uno::Any( false ) ) );//todo correct default?
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapSizeX", uno::Any( sal_Int32(10) ) ) );//todo which default?
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapSizeY", uno::Any( sal_Int32(10) ) ) );//todo which default?
- rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapMode", uno::Any( drawing::BitmapMode_REPEAT ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapOffsetX"_ustr, uno::Any( sal_Int16(0) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapOffsetY"_ustr, uno::Any( sal_Int16(0) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapPositionOffsetX"_ustr, uno::Any( sal_Int16(0) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapPositionOffsetY"_ustr, uno::Any( sal_Int16(0) ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapRectanglePoint"_ustr, uno::Any( drawing::RectanglePoint_LEFT_TOP ) ) );
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapLogicalSize"_ustr, uno::Any( false ) ) );//todo correct default?
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapSizeX"_ustr, uno::Any( sal_Int32(10) ) ) );//todo which default?
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapSizeY"_ustr, uno::Any( sal_Int32(10) ) ) );//todo which default?
+ rList.emplace_back( new WrappedIgnoreProperty( u"FillBitmapMode"_ustr, uno::Any( drawing::BitmapMode_REPEAT ) ) );
}
} //namespace chart
diff --git a/chart2/source/tools/WrappedProperty.cxx b/chart2/source/tools/WrappedProperty.cxx
index ee28aba86e68..8b0891c770f5 100644
--- a/chart2/source/tools/WrappedProperty.cxx
+++ b/chart2/source/tools/WrappedProperty.cxx
@@ -20,7 +20,8 @@
#include <WrappedProperty.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
@@ -29,9 +30,9 @@ using ::com::sun::star::uno::Reference;
namespace chart
{
-WrappedProperty::WrappedProperty( const OUString& rOuterName, const OUString& rInnerName)
- : m_aOuterName( rOuterName )
- , m_aInnerName( rInnerName )
+WrappedProperty::WrappedProperty( OUString aOuterName, OUString aInnerName)
+ : m_aOuterName(std::move( aOuterName ))
+ , m_aInnerName(std::move( aInnerName ))
{
}
WrappedProperty::~WrappedProperty()
diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx
index ead7f6d05bee..ae7ff6467c05 100644
--- a/chart2/source/tools/WrappedPropertySet.cxx
+++ b/chart2/source/tools/WrappedPropertySet.cxx
@@ -20,7 +20,7 @@
#include <WrappedPropertySet.hxx>
#include <cppuhelper/propshlp.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
namespace chart
@@ -66,7 +66,7 @@ Reference< beans::XPropertySetInfo > SAL_CALL WrappedPropertySet::getPropertySet
{
xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
- m_xInfo = xInfo;
+ m_xInfo = std::move(xInfo);
}
}
else
@@ -215,10 +215,9 @@ void SAL_CALL WrappedPropertySet::setPropertyValues( const Sequence< OUString >&
sal_Int32 nMinCount = std::min( rValueSeq.getLength(), rNameSeq.getLength() );
for(sal_Int32 nN=0; nN<nMinCount; nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
try
{
- setPropertyValue( aPropertyName, rValueSeq[nN] );
+ setPropertyValue( rNameSeq[nN], rValueSeq[nN] );
}
catch( const beans::UnknownPropertyException& )
{
@@ -242,8 +241,7 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyValues( const Sequence<
{
try
{
- OUString aPropertyName( rNameSeq[nN] );
- pRetSeq[nN] = getPropertyValue( aPropertyName );
+ pRetSeq[nN] = getPropertyValue( rNameSeq[nN] );
}
catch( const beans::UnknownPropertyException& )
{
@@ -313,8 +311,7 @@ Sequence< beans::PropertyState > SAL_CALL WrappedPropertySet::getPropertyStates(
auto pRetSeq = aRetSeq.getArray();
for(sal_Int32 nN=0; nN<rNameSeq.getLength(); nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
- pRetSeq[nN] = getPropertyState( aPropertyName );
+ pRetSeq[nN] = getPropertyState( rNameSeq[nN] );
}
}
return aRetSeq;
@@ -372,8 +369,7 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence
auto pRetSeq = aRetSeq.getArray();
for(sal_Int32 nN=0; nN<rNameSeq.getLength(); nN++)
{
- OUString aPropertyName( rNameSeq[nN] );
- pRetSeq[nN] = getPropertyDefault( aPropertyName );
+ pRetSeq[nN] = getPropertyDefault( rNameSeq[nN] );
}
}
return aRetSeq;
diff --git a/chart2/source/tools/XMLRangeHelper.cxx b/chart2/source/tools/XMLRangeHelper.cxx
index cc4749deee1f..3c5ed38e3130 100644
--- a/chart2/source/tools/XMLRangeHelper.cxx
+++ b/chart2/source/tools/XMLRangeHelper.cxx
@@ -20,7 +20,9 @@
#include <XMLRangeHelper.hxx>
#include <rtl/character.hxx>
#include <rtl/ustrbuf.hxx>
+#include <sal/log.hxx>
#include <osl/diagnose.h>
+#include <o3tl/string_view.hxx>
#include <algorithm>
@@ -103,7 +105,7 @@ void lcl_getXMLStringForCell( const ::chart::XMLRangeHelper::Cell & rCell, OUStr
}
void lcl_getSingleCellAddressFromXMLString(
- const OUString& rXMLString,
+ std::u16string_view rXMLString,
sal_Int32 nStartPos, sal_Int32 nEndPos,
::chart::XMLRangeHelper::Cell & rOutCell )
{
@@ -111,15 +113,15 @@ void lcl_getSingleCellAddressFromXMLString(
static const sal_Unicode aDollar( '$' );
static const sal_Unicode aLetterA( 'A' );
- OUString aCellStr = rXMLString.copy( nStartPos, nEndPos - nStartPos + 1 ).toAsciiUpperCase();
- const sal_Unicode* pStrArray = aCellStr.getStr();
- sal_Int32 nLength = aCellStr.getLength();
- sal_Int32 i = nLength - 1, nColumn = 0;
+ std::u16string_view aCellStr = rXMLString.substr( nStartPos, nEndPos - nStartPos + 1 );
+ const sal_Unicode* pStrArray = aCellStr.data();
+ sal_Int32 nLength = aCellStr.size();
+ sal_Int32 i = nLength - 1;
// parse number for row
while( rtl::isAsciiDigit( pStrArray[ i ] ) && i >= 0 )
i--;
- rOutCell.nRow = (aCellStr.copy( i + 1 )).toInt32() - 1;
+ rOutCell.nRow = (o3tl::toInt32(aCellStr.substr( i + 1 ))) - 1;
// a dollar in XML means absolute (whereas in UI it means relative)
if( pStrArray[ i ] == aDollar )
{
@@ -130,13 +132,21 @@ void lcl_getSingleCellAddressFromXMLString(
rOutCell.bRelativeRow = true;
// parse rest for column
- sal_Int32 nPower = 1;
- while( rtl::isAsciiAlpha( pStrArray[ i ] ))
+ assert(i <= 13);
+ sal_Int64 nPower = 1;
+ sal_Int64 nColumn = 0;
+ while( i >= 0 && rtl::isAsciiAlpha( pStrArray[ i ] ))
{
- nColumn += (pStrArray[ i ] - aLetterA + 1) * nPower;
+ nColumn += (rtl::toAsciiUpperCase(pStrArray[ i ]) - aLetterA + 1) * nPower;
i--;
nPower *= 26;
}
+ if (nColumn < SAL_MIN_INT32 || nColumn > SAL_MAX_INT32)
+ {
+ SAL_WARN("chart2", "out of range column");
+ nColumn = 0;
+ }
+
rOutCell.nColumn = nColumn - 1;
rOutCell.bRelativeColumn = true;
diff --git a/chart2/source/view/axes/DateScaling.cxx b/chart2/source/view/axes/DateScaling.cxx
index 15cb59635d69..f24f46a8e457 100644
--- a/chart2/source/view/axes/DateScaling.cxx
+++ b/chart2/source/view/axes/DateScaling.cxx
@@ -27,9 +27,9 @@
namespace
{
-constexpr OUStringLiteral lcl_aServiceName_DateScaling = u"com.sun.star.chart2.DateScaling";
-constexpr OUStringLiteral lcl_aServiceName_InverseDateScaling
- = u"com.sun.star.chart2.InverseDateScaling";
+constexpr OUString lcl_aServiceName_DateScaling = u"com.sun.star.chart2.DateScaling"_ustr;
+constexpr OUString lcl_aServiceName_InverseDateScaling
+ = u"com.sun.star.chart2.InverseDateScaling"_ustr;
const double lcl_fNumberOfMonths = 12.0;//todo: this needs to be offered by basic tools Date class if it should be more generic
}
diff --git a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
index eaf5c4347379..ea58ec912e19 100644
--- a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
+++ b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
@@ -74,32 +74,23 @@ double MergedMinimumAndMaximumSupplier::getMaximumX()
return fGlobalExtremum;
}
-double MergedMinimumAndMaximumSupplier::getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
+std::pair<double, double> MergedMinimumAndMaximumSupplier::getMinimumAndMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
{
- double fGlobalExtremum = std::numeric_limits<double>::infinity();
- for (auto const& elem : m_aMinimumAndMaximumSupplierList)
- {
- double fLocalExtremum = elem->getMinimumYInRange( fMinimumX, fMaximumX, nAxisIndex );
- if(fLocalExtremum<fGlobalExtremum)
- fGlobalExtremum=fLocalExtremum;
- }
- if(std::isinf(fGlobalExtremum))
- return std::numeric_limits<double>::quiet_NaN();
- return fGlobalExtremum;
-}
-
-double MergedMinimumAndMaximumSupplier::getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
-{
- double fGlobalExtremum = -std::numeric_limits<double>::infinity();
+ double fGlobalExtremumMin = std::numeric_limits<double>::infinity();
+ double fGlobalExtremumMax = -std::numeric_limits<double>::infinity();
for (auto const& elem : m_aMinimumAndMaximumSupplierList)
{
- double fLocalExtremum = elem->getMaximumYInRange( fMinimumX, fMaximumX, nAxisIndex );
- if(fLocalExtremum>fGlobalExtremum)
- fGlobalExtremum=fLocalExtremum;
+ std::pair<double, double> fLocalExtremum = elem->getMinimumAndMaximumYInRange( fMinimumX, fMaximumX, nAxisIndex );
+ if(fLocalExtremum.first<fGlobalExtremumMin)
+ fGlobalExtremumMin=fLocalExtremum.first;
+ if(fLocalExtremum.second>fGlobalExtremumMax)
+ fGlobalExtremumMax=fLocalExtremum.second;
}
- if(std::isinf(fGlobalExtremum))
- return std::numeric_limits<double>::quiet_NaN();
- return fGlobalExtremum;
+ if(std::isinf(fGlobalExtremumMin))
+ fGlobalExtremumMin = std::numeric_limits<double>::quiet_NaN();
+ if(std::isinf(fGlobalExtremumMax))
+ fGlobalExtremumMax = std::numeric_limits<double>::quiet_NaN();
+ return { fGlobalExtremumMin, fGlobalExtremumMax };
}
double MergedMinimumAndMaximumSupplier::getMinimumZ()
diff --git a/chart2/source/view/axes/Tickmarks.cxx b/chart2/source/view/axes/Tickmarks.cxx
index d10583c1b77d..c30f2f25d5e5 100644
--- a/chart2/source/view/axes/Tickmarks.cxx
+++ b/chart2/source/view/axes/Tickmarks.cxx
@@ -24,15 +24,16 @@
#include "VAxisProperties.hxx"
#include <osl/diagnose.h>
#include <com/sun/star/chart2/AxisType.hpp>
+#include <utility>
using namespace ::com::sun::star;
using ::basegfx::B2DVector;
namespace chart {
-TickInfo::TickInfo( const uno::Reference<chart2::XScaling>& xInverse )
+TickInfo::TickInfo( uno::Reference<chart2::XScaling> xInverse )
: fScaledTickValue( 0.0 )
-, xInverseScaling( xInverse )
+, xInverseScaling(std::move( xInverse ))
, aTickScreenPosition(0.0,0.0)
, nFactorForLimitedTextWidth(1)
, bPaintIt( true )
@@ -85,9 +86,9 @@ TickInfo* PureTickIter::nextInfo()
}
TickFactory::TickFactory(
- const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement )
- : m_rScale( rScale )
- , m_rIncrement( rIncrement )
+ ExplicitScaleData aScale, ExplicitIncrementData aIncrement )
+ : m_rScale(std::move( aScale ))
+ , m_rIncrement(std::move( aIncrement ))
{
//@todo: make sure that the scale is valid for the scaling
@@ -203,11 +204,6 @@ sal_Int32 TickFactory2D::getTickScreenDistance( TickIter& rIter )
return pFirstTickInfo->getScreenDistanceBetweenTicks( *pSecondTickInfo );
}
-const B2DVector & TickFactory2D::getXaxisStartPos() const
-{
- return m_aAxisStartScreenPosition2D;
-}
-
B2DVector TickFactory2D::getTickScreenPosition2D( double fScaledLogicTickValue ) const
{
B2DVector aRet(m_aAxisStartScreenPosition2D);
diff --git a/chart2/source/view/axes/Tickmarks.hxx b/chart2/source/view/axes/Tickmarks.hxx
index c712f6542b39..a983300effba 100644
--- a/chart2/source/view/axes/Tickmarks.hxx
+++ b/chart2/source/view/axes/Tickmarks.hxx
@@ -28,7 +28,6 @@
namespace chart { struct AxisProperties; }
namespace chart { struct TickmarkProperties; }
namespace com::sun::star::chart2 { class XScaling; }
-namespace com::sun::star::drawing { class XShape; }
namespace chart {
@@ -44,7 +43,7 @@ struct TickInfo
//methods:
TickInfo() = delete;
- explicit TickInfo( const css::uno::Reference<css::chart2::XScaling>& xInverse );
+ explicit TickInfo( css::uno::Reference<css::chart2::XScaling> xInverse );
/**
* Return a value associated with the tick mark. It's normally an original
@@ -83,8 +82,8 @@ class TickFactory
{
public:
TickFactory(
- const ExplicitScaleData& rScale
- , const ExplicitIncrementData& rIncrement );
+ ExplicitScaleData aScale
+ , ExplicitIncrementData aIncrement );
virtual ~TickFactory();
void getAllTicks( TickInfoArraysType& rAllTickInfos ) const;
@@ -132,7 +131,16 @@ public:
bool isHorizontalAxis() const;
bool isVerticalAxis() const;
- const ::basegfx::B2DVector & getXaxisStartPos() const;
+
+ const ::basegfx::B2DVector & getXaxisStartPos() const
+ {
+ return m_aAxisStartScreenPosition2D;
+ }
+
+ const ::basegfx::B2DVector & getXaxisEndPos() const
+ {
+ return m_aAxisEndScreenPosition2D;
+ }
private:
::basegfx::B2DVector getTickScreenPosition2D( double fScaledLogicTickValue ) const;
diff --git a/chart2/source/view/axes/Tickmarks_Dates.cxx b/chart2/source/view/axes/Tickmarks_Dates.cxx
index 854e661f67b4..869d46603fb7 100644
--- a/chart2/source/view/axes/Tickmarks_Dates.cxx
+++ b/chart2/source/view/axes/Tickmarks_Dates.cxx
@@ -23,6 +23,7 @@
#include <osl/diagnose.h>
#include <DateHelper.hxx>
#include <com/sun/star/chart/TimeUnit.hpp>
+#include <utility>
namespace chart
{
@@ -34,9 +35,9 @@ using ::com::sun::star::chart::TimeUnit::MONTH;
using ::com::sun::star::chart::TimeUnit::YEAR;
DateTickFactory::DateTickFactory(
- const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement )
- : m_aScale( rScale )
- , m_aIncrement( rIncrement )
+ ExplicitScaleData aScale, ExplicitIncrementData aIncrement )
+ : m_aScale(std::move( aScale ))
+ , m_aIncrement(std::move( aIncrement ))
{
//@todo: make sure that the scale is valid for the scaling
diff --git a/chart2/source/view/axes/Tickmarks_Dates.hxx b/chart2/source/view/axes/Tickmarks_Dates.hxx
index 0a21401924cc..bc75bad4e04b 100644
--- a/chart2/source/view/axes/Tickmarks_Dates.hxx
+++ b/chart2/source/view/axes/Tickmarks_Dates.hxx
@@ -27,8 +27,8 @@ class DateTickFactory
{
public:
DateTickFactory(
- const ExplicitScaleData& rScale
- , const ExplicitIncrementData& rIncrement );
+ ExplicitScaleData aScale
+ , ExplicitIncrementData aIncrement );
~DateTickFactory();
void getAllTicks( TickInfoArraysType& rAllTickInfos ) const;
diff --git a/chart2/source/view/axes/Tickmarks_Equidistant.cxx b/chart2/source/view/axes/Tickmarks_Equidistant.cxx
index 11778d694416..663d45819842 100644
--- a/chart2/source/view/axes/Tickmarks_Equidistant.cxx
+++ b/chart2/source/view/axes/Tickmarks_Equidistant.cxx
@@ -23,6 +23,7 @@
#include <float.h>
#include <limits>
+#include <utility>
namespace chart
{
@@ -70,9 +71,9 @@ double EquidistantTickFactory::getMaximumAtIncrement( double fMax, const Explici
}
EquidistantTickFactory::EquidistantTickFactory(
- const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement )
- : m_rScale( rScale )
- , m_rIncrement( rIncrement )
+ ExplicitScaleData aScale, ExplicitIncrementData aIncrement )
+ : m_rScale(std::move( aScale ))
+ , m_rIncrement(std::move( aIncrement ))
{
//@todo: make sure that the scale is valid for the scaling
@@ -170,7 +171,7 @@ void EquidistantTickFactory::addSubTicks( sal_Int32 nDepth, uno::Sequence< uno::
}
aSubTicks.realloc(nRealSubTickCount);
- rParentTicks.getArray()[nDepth] = aSubTicks;
+ rParentTicks.getArray()[nDepth] = std::move(aSubTicks);
if(static_cast<sal_Int32>(m_rIncrement.SubIncrements.size())>nDepth)
addSubTicks( nDepth+1, rParentTicks );
}
@@ -408,7 +409,7 @@ void EquidistantTickFactory::getAllTicksShifted( TickInfoArraysType& rAllTickInf
{
ExplicitIncrementData aShiftedIncrement( m_rIncrement );
aShiftedIncrement.BaseValue = m_rIncrement.BaseValue-m_rIncrement.Distance/2.0;
- EquidistantTickFactory( m_rScale, aShiftedIncrement ).getAllTicks(rAllTickInfos);
+ EquidistantTickFactory( m_rScale, std::move(aShiftedIncrement) ).getAllTicks(rAllTickInfos);
}
EquidistantTickIter::EquidistantTickIter( const uno::Sequence< uno::Sequence< double > >& rTicks
diff --git a/chart2/source/view/axes/Tickmarks_Equidistant.hxx b/chart2/source/view/axes/Tickmarks_Equidistant.hxx
index bb6553339fc0..6068903cb6e7 100644
--- a/chart2/source/view/axes/Tickmarks_Equidistant.hxx
+++ b/chart2/source/view/axes/Tickmarks_Equidistant.hxx
@@ -101,8 +101,8 @@ class EquidistantTickFactory
{
public:
EquidistantTickFactory(
- const ExplicitScaleData& rScale
- , const ExplicitIncrementData& rIncrement );
+ ExplicitScaleData aScale
+ , ExplicitIncrementData aIncrement );
~EquidistantTickFactory();
void getAllTicks( TickInfoArraysType& rAllTickInfos ) const;
diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx
index 3844a1074df9..6578a3d5d092 100644
--- a/chart2/source/view/axes/VAxisBase.cxx
+++ b/chart2/source/view/axes/VAxisBase.cxx
@@ -21,11 +21,10 @@
#include <ShapeFactory.hxx>
#include <ExplicitCategoriesProvider.hxx>
#include "Tickmarks.hxx"
-#include <com/sun/star/drawing/XShapes.hpp>
+#include <Axis.hxx>
+#include <VSeriesPlotter.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <osl/diagnose.h>
@@ -85,10 +84,10 @@ void VAxisBase::initAxisLabelProperties( const css::awt::Size& rFontReferenceSiz
m_bUseTextLabels = true;
}
- m_aAxisLabelProperties.nNumberFormatKey = m_aAxisProperties.m_nNumberFormatKey;
+ m_aAxisLabelProperties.m_nNumberFormatKey = m_aAxisProperties.m_nNumberFormatKey;
m_aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel);
if( m_aAxisProperties.m_bComplexCategories && m_aAxisProperties.m_nAxisType == AxisType::CATEGORY )
- m_aAxisLabelProperties.eStaggering = AxisLabelStaggering::SideBySide;
+ m_aAxisLabelProperties.m_eStaggering = AxisLabelStaggering::SideBySide;
}
bool VAxisBase::isDateAxis() const
@@ -136,11 +135,10 @@ bool VAxisBase::isAnythingToDraw()
if(!(m_xLogicTarget.is()&&m_xFinalTarget.is()))
return false;
- uno::Reference< beans::XPropertySet > xProps( m_aAxisProperties.m_xAxisModel, uno::UNO_QUERY );
- if( xProps.is() )
+ if( m_aAxisProperties.m_xAxisModel.is() )
{
bool bShow = false;
- xProps->getPropertyValue( "Show" ) >>= bShow;
+ m_aAxisProperties.m_xAxisModel->getPropertyValue( u"Show"_ustr ) >>= bShow;
if( !bShow )
return false;
}
@@ -184,10 +182,12 @@ bool VAxisBase::prepareShapeCreation()
return true;
//create named group shape
- m_xGroupShape_Shapes = createGroupShape( m_xLogicTarget, m_nDimension==2 ? m_aCID : "");
+ m_xGroupShape_Shapes = createGroupShape( m_xLogicTarget, m_nDimension==2 ? m_aCID : u""_ustr);
- if( m_aAxisProperties.m_bDisplayLabels )
+ if (m_aAxisProperties.m_bDisplayLabels)
m_xTextTarget = ShapeFactory::createGroup2D( m_xFinalTarget, m_aCID );
+ if (m_aAxisProperties.m_bDisplayDataTable)
+ m_xDataTableTarget = ShapeFactory::createGroup2D(m_xFinalTarget);
return true;
}
@@ -242,6 +242,13 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter )
}
}
+void VAxisBase::createDataTableView(std::vector<std::unique_ptr<VSeriesPlotter>>& /*rSeriesPlotterList*/,
+ uno::Reference<util::XNumberFormatsSupplier> const& /*xNumberFormatsSupplier*/,
+ rtl::Reference<::chart::ChartModel> const& /*xChartDoc*/,
+ css::uno::Reference<css::uno::XComponentContext> const& /*rComponentContext*/)
+{
+}
+
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx
index 31badb749c9d..4b1a8de92750 100644
--- a/chart2/source/view/axes/VAxisBase.hxx
+++ b/chart2/source/view/axes/VAxisBase.hxx
@@ -23,10 +23,16 @@
#include "Tickmarks.hxx"
namespace com::sun::star::util { class XNumberFormatsSupplier; }
+namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
+class VSeriesPlotter;
+class DataTableView;
+class ChartModel;
+class LegendEntryProvider;
+
class VAxisBase : public VAxisOrGridBase
{
public:
@@ -59,6 +65,13 @@ public:
void setExtraLinePositionAtOtherAxis( double fCrossingAt );
+ virtual void createDataTableView(std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
+ css::uno::Reference<css::util::XNumberFormatsSupplier> const& xNumberFormatsSupplier,
+ rtl::Reference<::chart::ChartModel> const& xChartDoc,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext);
+
+ const std::shared_ptr<DataTableView> & getDataTableView() { return m_pDataTableView; }
+
protected: //methods
static size_t getIndexOfLongestLabel( const css::uno::Sequence<OUString>& rLabels );
void removeTextShapesFromTicks();
@@ -79,6 +92,9 @@ protected: //member
rtl::Reference< SvxShapeGroupAnyD > m_xGroupShape_Shapes;
rtl::Reference< SvxShapeGroupAnyD > m_xTextTarget;
+ rtl::Reference< SvxShapeGroupAnyD > m_xDataTableTarget;
+
+ std::shared_ptr<DataTableView> m_pDataTableView;
/**
* This typically consists of 2 TickInfo vectors (i.e. the outer vector
diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx
index 295ad21a68e6..639adc811d3d 100644
--- a/chart2/source/view/axes/VAxisProperties.cxx
+++ b/chart2/source/view/axes/VAxisProperties.cxx
@@ -19,17 +19,17 @@
#include "VAxisProperties.hxx"
#include <ViewDefines.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
-#include <ChartModelHelper.hxx>
+#include <ChartModel.hxx>
#include <ExplicitCategoriesProvider.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/XAxis.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <rtl/math.hxx>
+#include <utility>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -152,9 +152,10 @@ TickmarkProperties AxisProperties::getBiggestTickmarkProperties()
return aTickmarkProperties;
}
-AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel
- , ExplicitCategoriesProvider* pExplicitCategoriesProvider )
- : m_xAxisModel(xAxisModel)
+AxisProperties::AxisProperties(rtl::Reference<::chart::Axis> xAxisModel,
+ ExplicitCategoriesProvider* pExplicitCategoriesProvider,
+ rtl::Reference<::chart::DataTable> const& xDataTableModel)
+ : m_xAxisModel(std::move(xAxisModel))
, m_nDimensionIndex(0)
, m_bIsMainAxis(true)
, m_bSwapXAndY(false)
@@ -163,6 +164,8 @@ AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel
, m_eTickmarkPos( css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS )
, m_bCrossingAxisHasReverseDirection(false)
, m_bCrossingAxisIsCategoryAxes(false)
+ , m_bDisplayDataTable(false)
+ , m_bDataTableAlignAxisValuesWithColumns(false)
, m_bDisplayLabels( true )
, m_bTryStaggeringFirst( false )
, m_nNumberFormatKey(0)
@@ -172,6 +175,7 @@ AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel
, m_bComplexCategories(false)
, m_pExplicitCategoriesProvider(pExplicitCategoriesProvider)
, m_bLimitSpaceForLabels(false)
+ , m_xDataTableModel(xDataTableModel)
{
}
@@ -207,11 +211,11 @@ void AxisProperties::initAxisPositioning( const uno::Reference< beans::XProperty
{
if( AxisHelper::isAxisPositioningEnabled() )
{
- xAxisProp->getPropertyValue("CrossoverPosition") >>= m_eCrossoverType;
+ xAxisProp->getPropertyValue(u"CrossoverPosition"_ustr) >>= m_eCrossoverType;
if( m_eCrossoverType == css::chart::ChartAxisPosition_VALUE )
{
double fValue = 0.0;
- xAxisProp->getPropertyValue("CrossoverValue") >>= fValue;
+ xAxisProp->getPropertyValue(u"CrossoverValue"_ustr) >>= fValue;
if( m_bCrossingAxisIsCategoryAxes )
fValue = ::rtl::math::round(fValue);
@@ -220,8 +224,8 @@ void AxisProperties::initAxisPositioning( const uno::Reference< beans::XProperty
else if( m_eCrossoverType == css::chart::ChartAxisPosition_ZERO )
m_pfMainLinePositionAtOtherAxis = 0.0;
- xAxisProp->getPropertyValue("LabelPosition") >>= m_eLabelPos;
- xAxisProp->getPropertyValue("MarkPosition") >>= m_eTickmarkPos;
+ xAxisProp->getPropertyValue(u"LabelPosition"_ustr) >>= m_eLabelPos;
+ xAxisProp->getPropertyValue(u"MarkPosition"_ustr) >>= m_eTickmarkPos;
}
else
{
@@ -240,13 +244,11 @@ void AxisProperties::initAxisPositioning( const uno::Reference< beans::XProperty
void AxisProperties::init( bool bCartesian )
{
- uno::Reference< beans::XPropertySet > xProp =
- uno::Reference<beans::XPropertySet>::query( m_xAxisModel );
- if( !xProp.is() )
+ if( !m_xAxisModel.is() )
return;
if( m_nDimensionIndex<2 )
- initAxisPositioning( xProp );
+ initAxisPositioning( m_xAxisModel );
ScaleData aScaleData = m_xAxisModel->getScaleData();
if( m_nDimensionIndex==0 )
@@ -255,6 +257,11 @@ void AxisProperties::init( bool bCartesian )
if( bCartesian )
{
+ if ((!m_bSwapXAndY && m_nDimensionIndex == 0) || (m_bSwapXAndY && m_nDimensionIndex == 1))
+ {
+ m_bDisplayDataTable = m_xDataTableModel.is();
+ }
+
if( m_nDimensionIndex == 0 && m_nAxisType == AxisType::CATEGORY
&& m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() )
m_bComplexCategories = true;
@@ -294,19 +301,19 @@ void AxisProperties::init( bool bCartesian )
try
{
//init LineProperties
- m_aLineProperties.initFromPropertySet( xProp );
+ m_aLineProperties.initFromPropertySet( m_xAxisModel );
//init display labels
- xProp->getPropertyValue( "DisplayLabels" ) >>= m_bDisplayLabels;
+ m_xAxisModel->getPropertyValue( u"DisplayLabels"_ustr ) >>= m_bDisplayLabels;
// Init layout strategy hint for axis labels.
// Compatibility option: starting from LibreOffice 5.1 the rotated
// layout is preferred to staggering for axis labels.
- xProp->getPropertyValue( "TryStaggeringFirst" ) >>= m_bTryStaggeringFirst;
+ m_xAxisModel->getPropertyValue( u"TryStaggeringFirst"_ustr ) >>= m_bTryStaggeringFirst;
//init TickmarkProperties
- xProp->getPropertyValue( "MajorTickmarks" ) >>= m_nMajorTickmarks;
- xProp->getPropertyValue( "MinorTickmarks" ) >>= m_nMinorTickmarks;
+ m_xAxisModel->getPropertyValue( u"MajorTickmarks"_ustr ) >>= m_nMajorTickmarks;
+ m_xAxisModel->getPropertyValue( u"MinorTickmarks"_ustr ) >>= m_nMinorTickmarks;
sal_Int32 nMaxDepth = 0;
if(m_nMinorTickmarks!=0)
@@ -325,51 +332,60 @@ void AxisProperties::init( bool bCartesian )
{
TOOLS_WARN_EXCEPTION("chart2", "" );
}
+
+ if (m_bDisplayDataTable)
+ {
+ m_bDataTableAlignAxisValuesWithColumns = (m_nDimensionIndex == 0);
+
+ if (m_nDimensionIndex == 0)
+ {
+ m_bDisplayLabels = false;
+ }
+
+ }
}
AxisLabelProperties::AxisLabelProperties()
- : m_aFontReferenceSize( ChartModelHelper::getDefaultPageSize() )
+ : m_aFontReferenceSize( ChartModel::getDefaultPageSize() )
, m_aMaximumSpaceForLabels( 0 , 0, m_aFontReferenceSize.Width, m_aFontReferenceSize.Height )
- , nNumberFormatKey(0)
- , eStaggering( AxisLabelStaggering::SideBySide )
- , bLineBreakAllowed( false )
- , bOverlapAllowed( false )
- , bStackCharacters( false )
- , fRotationAngleDegree( 0.0 )
- , nRhythm( 1 )
+ , m_nNumberFormatKey(0)
+ , m_eStaggering( AxisLabelStaggering::SideBySide )
+ , m_bLineBreakAllowed( false )
+ , m_bOverlapAllowed( false )
+ , m_bStackCharacters( false )
+ , m_fRotationAngleDegree( 0.0 )
+ , m_nRhythm( 1 )
{
}
-void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel )
+void AxisLabelProperties::init( const rtl::Reference< Axis >& xAxisModel )
{
- uno::Reference< beans::XPropertySet > xProp =
- uno::Reference<beans::XPropertySet>::query( xAxisModel );
- if(!xProp.is())
+ if(!xAxisModel.is())
return;
try
{
- xProp->getPropertyValue( "TextBreak" ) >>= bLineBreakAllowed;
- xProp->getPropertyValue( "TextOverlap" ) >>= bOverlapAllowed;
- xProp->getPropertyValue( "StackCharacters" ) >>= bStackCharacters;
- xProp->getPropertyValue( "TextRotation" ) >>= fRotationAngleDegree;
+ xAxisModel->getPropertyValue( u"TextBreak"_ustr ) >>= m_bLineBreakAllowed;
+ xAxisModel->getPropertyValue( u"TextOverlap"_ustr ) >>= m_bOverlapAllowed;
+ xAxisModel->getPropertyValue( u"StackCharacters"_ustr ) >>= m_bStackCharacters;
+ xAxisModel->getPropertyValue( u"TextRotation"_ustr ) >>= m_fRotationAngleDegree;
css::chart::ChartAxisArrangeOrderType eArrangeOrder;
- xProp->getPropertyValue( "ArrangeOrder" ) >>= eArrangeOrder;
+ xAxisModel->getPropertyValue( u"ArrangeOrder"_ustr ) >>= eArrangeOrder;
switch(eArrangeOrder)
{
case css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE:
- eStaggering = AxisLabelStaggering::SideBySide;
+ m_eStaggering = AxisLabelStaggering::SideBySide;
break;
case css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN:
- eStaggering = AxisLabelStaggering::StaggerEven;
+ m_eStaggering = AxisLabelStaggering::StaggerEven;
break;
case css::chart::ChartAxisArrangeOrderType_STAGGER_ODD:
- eStaggering = AxisLabelStaggering::StaggerOdd;
+ m_eStaggering = AxisLabelStaggering::StaggerOdd;
break;
default:
- eStaggering = AxisLabelStaggering::StaggerAuto;
+ m_eStaggering = AxisLabelStaggering::StaggerAuto;
break;
}
}
@@ -381,14 +397,14 @@ void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel )
bool AxisLabelProperties::isStaggered() const
{
- return ( eStaggering == AxisLabelStaggering::StaggerOdd || eStaggering == AxisLabelStaggering::StaggerEven );
+ return ( m_eStaggering == AxisLabelStaggering::StaggerOdd || m_eStaggering == AxisLabelStaggering::StaggerEven );
}
void AxisLabelProperties::autoRotate45()
{
- fRotationAngleDegree = 45;
- bLineBreakAllowed = false;
- eStaggering = AxisLabelStaggering::SideBySide;
+ m_fRotationAngleDegree = 45;
+ m_bLineBreakAllowed = false;
+ m_eStaggering = AxisLabelStaggering::SideBySide;
}
} //namespace chart
diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx
index 454ea1097c86..0cc23602b541 100644
--- a/chart2/source/view/axes/VAxisProperties.hxx
+++ b/chart2/source/view/axes/VAxisProperties.hxx
@@ -19,7 +19,9 @@
#pragma once
#include "TickmarkProperties.hxx"
+#include <Axis.hxx>
#include <LabelAlignment.hxx>
+#include <DataTable.hxx>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
@@ -27,6 +29,7 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/uno/Any.hxx>
+#include <rtl/ref.hxx>
#include <vector>
#include <optional>
@@ -58,20 +61,20 @@ struct AxisLabelProperties final
css::awt::Size m_aFontReferenceSize;//reference size to calculate the font height
css::awt::Rectangle m_aMaximumSpaceForLabels;//Labels need to be clipped in order to fit into this rectangle
- sal_Int32 nNumberFormatKey;
+ sal_Int32 m_nNumberFormatKey;
- AxisLabelStaggering eStaggering;
+ AxisLabelStaggering m_eStaggering;
- bool bLineBreakAllowed;
- bool bOverlapAllowed;
+ bool m_bLineBreakAllowed;
+ bool m_bOverlapAllowed;
- bool bStackCharacters;
- double fRotationAngleDegree;
+ bool m_bStackCharacters;
+ double m_fRotationAngleDegree;
- sal_Int32 nRhythm; //show only each nth label with n==nRhythm
+ sal_Int32 m_nRhythm; //show only each nth label with n==nRhythm
//methods:
- void init( const css::uno::Reference< css::chart2::XAxis >& xAxisModel );
+ void init( const rtl::Reference< ::chart::Axis >& xAxisModel );
bool isStaggered() const;
@@ -90,7 +93,7 @@ struct AxisLabelAlignment
struct AxisProperties final
{
- css::uno::Reference<css::chart2::XAxis> m_xAxisModel;
+ rtl::Reference<::chart::Axis> m_xAxisModel;
sal_Int32 m_nDimensionIndex;
bool m_bIsMainAxis;//not secondary axis
@@ -108,7 +111,11 @@ struct AxisProperties final
AxisLabelAlignment maLabelAlignment;
- bool m_bDisplayLabels;
+ // Data table
+ bool m_bDisplayDataTable;
+ bool m_bDataTableAlignAxisValuesWithColumns;
+
+ bool m_bDisplayLabels;
// Compatibility option: starting from LibreOffice 5.1 the rotated
// layout is preferred to staggering for axis labels.
@@ -136,10 +143,13 @@ struct AxisProperties final
bool m_bLimitSpaceForLabels;
+ rtl::Reference<::chart::DataTable> m_xDataTableModel;
+
//methods:
- AxisProperties( const css::uno::Reference< css::chart2::XAxis >& xAxisModel
- , ExplicitCategoriesProvider* pExplicitCategoriesProvider );
+ AxisProperties(rtl::Reference<::chart::Axis> xAxisModel,
+ ExplicitCategoriesProvider* pExplicitCategoriesProvider,
+ rtl::Reference<::chart::DataTable> const& xDataTableModel);
void init(bool bCartesian=false);//init from model data (m_xAxisModel)
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 120513ee9831..81fc3dbee032 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -23,18 +23,23 @@
#include <PropertyMapper.hxx>
#include <NumberFormatterWrapper.hxx>
#include <LabelPositionHelper.hxx>
-#include <TrueGuard.hxx>
#include <BaseGFXHelper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include "Tickmarks_Equidistant.hxx"
#include <ExplicitCategoriesProvider.hxx>
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/XAxis.hpp>
+#include <o3tl/safeint.hxx>
#include <rtl/math.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/color.hxx>
#include <svx/unoshape.hxx>
#include <svx/unoshtxt.hxx>
+#include <VSeriesPlotter.hxx>
+#include <DataTableView.hxx>
+#include <ChartModel.hxx>
+
+#include <comphelper/scopeguard.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -75,36 +80,41 @@ VCartesianAxis::~VCartesianAxis()
static void lcl_ResizeTextShapeToFitAvailableSpace( SvxShapeText& rShape2DText,
const AxisLabelProperties& rAxisLabelProperties,
- const OUString& rLabel,
+ std::u16string_view rLabel,
const tNameSequence& rPropNames,
const tAnySequence& rPropValues,
const bool bIsHorizontalAxis )
{
- const sal_Int32 nFullSize = bIsHorizontalAxis ? rAxisLabelProperties.m_aFontReferenceSize.Height : rAxisLabelProperties.m_aFontReferenceSize.Width;
+ bool bTextHorizontal = rAxisLabelProperties.m_fRotationAngleDegree != 0.0;
+ bool bIsDirectionVertical = bIsHorizontalAxis && bTextHorizontal;
+ const sal_Int32 nFullSize = bIsDirectionVertical ? rAxisLabelProperties.m_aFontReferenceSize.Height : rAxisLabelProperties.m_aFontReferenceSize.Width;
- if( !nFullSize || !rLabel.getLength() )
+ if( !nFullSize || rLabel.empty() )
return;
- sal_Int32 nMaxLabelsSize = bIsHorizontalAxis ? rAxisLabelProperties.m_aMaximumSpaceForLabels.Height : rAxisLabelProperties.m_aMaximumSpaceForLabels.Width;
- const sal_Int32 nAvgCharWidth = rShape2DText.getSize().Width / rLabel.getLength();
- const sal_Int32 nTextSize = bIsHorizontalAxis ? ShapeFactory::getSizeAfterRotation(rShape2DText, rAxisLabelProperties.fRotationAngleDegree).Height :
- ShapeFactory::getSizeAfterRotation(rShape2DText, rAxisLabelProperties.fRotationAngleDegree).Width;
+ const sal_Int32 nAvgCharWidth = rShape2DText.getSize().Width / rLabel.size();
+
+ sal_Int32 nMaxLabelsSize = bIsDirectionVertical ? rAxisLabelProperties.m_aMaximumSpaceForLabels.Height : rAxisLabelProperties.m_aMaximumSpaceForLabels.Width;
+
+ awt::Size aSizeAfterRotation = ShapeFactory::getSizeAfterRotation(rShape2DText, rAxisLabelProperties.m_fRotationAngleDegree);
+
+ const sal_Int32 nTextSize = bIsDirectionVertical ? aSizeAfterRotation.Height : aSizeAfterRotation.Width;
if( !nAvgCharWidth )
return;
- static const OUStringLiteral sDots = u"...";
+ static constexpr OUString sDots = u"..."_ustr;
const sal_Int32 nCharsToRemove = ( nTextSize - nMaxLabelsSize ) / nAvgCharWidth + 1;
- sal_Int32 nNewLen = rLabel.getLength() - nCharsToRemove - sDots.getLength();
+ sal_Int32 nNewLen = rLabel.size() - nCharsToRemove - sDots.getLength();
// Prevent from showing only dots
if (nNewLen < 0)
- nNewLen = ( rLabel.getLength() >= sDots.getLength() ) ? sDots.getLength() : rLabel.getLength();
+ nNewLen = ( sal_Int32(rLabel.size()) >= sDots.getLength() ) ? sDots.getLength() : rLabel.size();
bool bCrop = nCharsToRemove > 0;
if( !bCrop )
return;
- OUString aNewLabel = rLabel.copy( 0, nNewLen );
+ OUString aNewLabel( rLabel.substr( 0, nNewLen ) );
if( nNewLen > sDots.getLength() )
aNewLabel += sDots;
rShape2DText.setString( aNewLabel );
@@ -127,9 +137,9 @@ static rtl::Reference<SvxShapeText> createSingleLabel(
return nullptr;
// #i78696# use mathematically correct rotation now
- const double fRotationAnglePi(-basegfx::deg2rad(rAxisLabelProperties.fRotationAngleDegree));
+ const double fRotationAnglePi(-basegfx::deg2rad(rAxisLabelProperties.m_fRotationAngleDegree));
uno::Any aATransformation = ShapeFactory::makeTransformation( rAnchorScreenPosition2D, fRotationAnglePi );
- OUString aLabel = ShapeFactory::getStackedString( rLabel, rAxisLabelProperties.bStackCharacters );
+ OUString aLabel = ShapeFactory::getStackedString( rLabel, rAxisLabelProperties.m_bStackCharacters );
rtl::Reference<SvxShapeText> xShape2DText =
ShapeFactory::createText( xTarget, aLabel, rPropNames, rPropValues, aATransformation );
@@ -138,7 +148,7 @@ static rtl::Reference<SvxShapeText> createSingleLabel(
lcl_ResizeTextShapeToFitAvailableSpace(*xShape2DText, rAxisLabelProperties, aLabel, rPropNames, rPropValues, bIsHorizontalAxis);
LabelPositionHelper::correctPositionForRotation( xShape2DText
- , rAxisProperties.maLabelAlignment.meAlignment, rAxisLabelProperties.fRotationAngleDegree, rAxisProperties.m_bComplexCategories );
+ , rAxisProperties.maLabelAlignment.meAlignment, rAxisLabelProperties.m_fRotationAngleDegree, rAxisProperties.m_bComplexCategories );
return xShape2DText;
}
@@ -201,7 +211,7 @@ static bool doesOverlap( const rtl::Reference<SvxShapeText>& xShape1
static void removeShapesAtWrongRhythm( TickIter& rIter
, sal_Int32 nCorrectRhythm
, sal_Int32 nMaxTickToCheck
- , const Reference< drawing::XShapes >& xTarget )
+ , const rtl::Reference< SvxShapeGroupAnyD >& xTarget )
{
sal_Int32 nTick = 0;
for( TickInfo* pTickInfo = rIter.firstInfo()
@@ -424,7 +434,7 @@ static void getAxisLabelProperties(
const AxisLabelProperties& rAxisLabelProp,
sal_Int32 nLimitedSpaceForText, bool bLimitedHeight )
{
- Reference<beans::XPropertySet> xProps(rAxisProp.m_xAxisModel, uno::UNO_QUERY);
+ Reference<beans::XPropertySet> xProps(rAxisProp.m_xAxisModel);
PropertyMapper::getTextLabelMultiPropertyLists(
xProps, rPropNames, rPropValues, false, nLimitedSpaceForText, bLimitedHeight, false);
@@ -507,16 +517,16 @@ bool VCartesianAxis::isBreakOfLabelsAllowed(
{
if( m_aTextLabels.getLength() > 100 )
return false;
- if( !rAxisLabelProperties.bLineBreakAllowed )
+ if( !rAxisLabelProperties.m_bLineBreakAllowed )
return false;
- if( rAxisLabelProperties.bStackCharacters )
+ if( rAxisLabelProperties.m_bStackCharacters )
return false;
//no break for value axis
if( !m_bUseTextLabels )
return false;
- if( !( rAxisLabelProperties.fRotationAngleDegree == 0.0 ||
- rAxisLabelProperties.fRotationAngleDegree == 90.0 ||
- rAxisLabelProperties.fRotationAngleDegree == 270.0 ) )
+ if( !( rAxisLabelProperties.m_fRotationAngleDegree == 0.0 ||
+ rAxisLabelProperties.m_fRotationAngleDegree == 90.0 ||
+ rAxisLabelProperties.m_fRotationAngleDegree == 270.0 ) )
return false;
//no break for complex vertical category axis
if( !m_aAxisProperties.m_bSwapXAndY )
@@ -532,26 +542,26 @@ bool canAutoAdjustLabelPlacement(
const AxisLabelProperties& rAxisLabelProperties, bool bIsHorizontalAxis, bool bIsVerticalAxis)
{
// joined prerequisite checks for auto rotate and auto stagger
- if( rAxisLabelProperties.bOverlapAllowed )
+ if( rAxisLabelProperties.m_bOverlapAllowed )
return false;
- if( rAxisLabelProperties.bLineBreakAllowed ) // auto line break may conflict with...
+ if( rAxisLabelProperties.m_bLineBreakAllowed ) // auto line break may conflict with...
return false;
- if( rAxisLabelProperties.fRotationAngleDegree != 0.0 )
+ if( rAxisLabelProperties.m_fRotationAngleDegree != 0.0 )
return false;
// automatic adjusting labels only works for
// horizontal axis with horizontal text
// or vertical axis with vertical text
if( bIsHorizontalAxis )
- return !rAxisLabelProperties.bStackCharacters;
+ return !rAxisLabelProperties.m_bStackCharacters;
if( bIsVerticalAxis )
- return rAxisLabelProperties.bStackCharacters;
+ return rAxisLabelProperties.m_bStackCharacters;
return false;
}
bool isAutoStaggeringOfLabelsAllowed(
const AxisLabelProperties& rAxisLabelProperties, bool bIsHorizontalAxis, bool bIsVerticalAxis )
{
- if( rAxisLabelProperties.eStaggering != AxisLabelStaggering::StaggerAuto )
+ if( rAxisLabelProperties.m_eStaggering != AxisLabelStaggering::StaggerAuto )
return false;
return canAutoAdjustLabelPlacement(rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis);
}
@@ -656,7 +666,7 @@ void VCartesianAxis::createAllTickInfos( TickInfoArraysType& rAllTickInfos )
TickIter* VCartesianAxis::createLabelTickIterator( sal_Int32 nTextLevel )
{
- if( nTextLevel>=0 && nTextLevel < static_cast< sal_Int32 >(m_aAllTickInfos.size()) )
+ if( nTextLevel>=0 && o3tl::make_unsigned(nTextLevel) < m_aAllTickInfos.size() )
return new PureTickIter( m_aAllTickInfos[nTextLevel] );
return nullptr;
}
@@ -715,21 +725,31 @@ bool VCartesianAxis::createTextShapes(
}
}
- if (!isBreakOfLabelsAllowed(rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis) &&
+ bool bIsBreakOfLabelsAllowed = isBreakOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis );
+ if (!bIsBreakOfLabelsAllowed &&
!isAutoStaggeringOfLabelsAllowed(rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis) &&
!rAxisLabelProperties.isStaggered())
+ {
return createTextShapesSimple(xTarget, rTickIter, rAxisLabelProperties, pTickFactory);
+ }
FixedNumberFormatter aFixedNumberFormatter(
- m_xNumberFormatsSupplier, rAxisLabelProperties.nNumberFormatKey );
+ m_xNumberFormatsSupplier, rAxisLabelProperties.m_nNumberFormatKey );
bool bIsStaggered = rAxisLabelProperties.isStaggered();
B2DVector aTextToTickDistance = pTickFactory->getDistanceAxisTickToText(m_aAxisProperties, true);
sal_Int32 nLimitedSpaceForText = -1;
- if( isBreakOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis ) )
+ if (bIsBreakOfLabelsAllowed)
{
- nLimitedSpaceForText = nScreenDistanceBetweenTicks;
+ if (!m_aAxisProperties.m_bLimitSpaceForLabels)
+ {
+ basegfx::B2DVector nDeltaVector = pTickFactory->getXaxisEndPos() - pTickFactory->getXaxisStartPos();
+ nLimitedSpaceForText = nDeltaVector.getX();
+ }
+ if (nScreenDistanceBetweenTicks > 0)
+ nLimitedSpaceForText = nScreenDistanceBetweenTicks;
+
if( bIsStaggered )
nLimitedSpaceForText *= 2;
@@ -742,14 +762,14 @@ bool VCartesianAxis::createTextShapes(
}
// recalculate the nLimitedSpaceForText in case of 90 and 270 degree if the text break is true
- if ( rAxisLabelProperties.fRotationAngleDegree == 90.0 || rAxisLabelProperties.fRotationAngleDegree == 270.0 )
+ if ( rAxisLabelProperties.m_fRotationAngleDegree == 90.0 || rAxisLabelProperties.m_fRotationAngleDegree == 270.0 )
{
nLimitedSpaceForText = rAxisLabelProperties.m_aMaximumSpaceForLabels.Height;
m_aAxisProperties.m_bLimitSpaceForLabels = false;
}
// recalculate the nLimitedSpaceForText in case of vertical category axis if the text break is true
- if ( m_aAxisProperties.m_bSwapXAndY && bIsVerticalAxis && rAxisLabelProperties.fRotationAngleDegree == 0.0 )
+ if ( m_aAxisProperties.m_bSwapXAndY && bIsVerticalAxis && rAxisLabelProperties.m_fRotationAngleDegree == 0.0 )
{
nLimitedSpaceForText = pTickFactory->getXaxisStartPos().getX();
m_aAxisProperties.m_bLimitSpaceForLabels = false;
@@ -790,21 +810,21 @@ bool VCartesianAxis::createTextShapes(
pPREPreviousVisibleTickInfo : pPreviousVisibleTickInfo;
//don't create labels which does not fit into the rhythm
- if( nTick%rAxisLabelProperties.nRhythm != 0 )
+ if( nTick%rAxisLabelProperties.m_nRhythm != 0 )
continue;
//don't create labels for invisible ticks
if( !pTickInfo->bPaintIt )
continue;
- if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed )
+ if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.m_bOverlapAllowed )
{
// Overlapping is not allowed. If the label overlaps with its
// neighboring label, try increasing the tick interval (or rhythm
// as it's called) and start over.
if( lcl_doesShapeOverlapWithTickmark( *pLastVisibleNeighbourTickInfo->xTextShape
- , rAxisLabelProperties.fRotationAngleDegree
+ , rAxisLabelProperties.m_fRotationAngleDegree
, pTickInfo->aTickScreenPosition ) )
{
// This tick overlaps with its neighbor. Try to stagger (if
@@ -814,11 +834,11 @@ bool VCartesianAxis::createTextShapes(
if( !bIsStaggered && isAutoStaggeringOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis ) )
{
bIsStaggered = true;
- rAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven;
+ rAxisLabelProperties.m_eStaggering = AxisLabelStaggering::StaggerEven;
pLastVisibleNeighbourTickInfo = pPREPreviousVisibleTickInfo;
if( !pLastVisibleNeighbourTickInfo ||
!lcl_doesShapeOverlapWithTickmark( *pLastVisibleNeighbourTickInfo->xTextShape
- , rAxisLabelProperties.fRotationAngleDegree
+ , rAxisLabelProperties.m_fRotationAngleDegree
, pTickInfo->aTickScreenPosition ) )
bOverlapsAfterAutoStagger = false;
}
@@ -829,8 +849,8 @@ bool VCartesianAxis::createTextShapes(
// Increment the visible tick intervals (if that's
// allowed) and start over.
- rAxisLabelProperties.nRhythm++;
- removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.nRhythm, nTick, xTarget );
+ rAxisLabelProperties.m_nRhythm++;
+ removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.m_nRhythm, nTick, xTarget );
return false;
}
}
@@ -856,37 +876,41 @@ bool VCartesianAxis::createTextShapes(
//create single label
if(!pTickInfo->xTextShape.is())
+ {
pTickInfo->xTextShape = createSingleLabel( xTarget
, aAnchorScreenPosition2D, aLabel
, rAxisLabelProperties, m_aAxisProperties
, aPropNames, aPropValues, bIsHorizontalAxis );
+ }
if(!pTickInfo->xTextShape.is())
continue;
- recordMaximumTextSize( *pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree );
+ recordMaximumTextSize( *pTickInfo->xTextShape, rAxisLabelProperties.m_fRotationAngleDegree );
// Label has multiple lines and the words are broken
- if( nLimitedSpaceForText>0 && !rAxisLabelProperties.bOverlapAllowed
- && rAxisLabelProperties.fRotationAngleDegree == 0.0
- && lcl_hasWordBreak( pTickInfo->xTextShape ) )
+ if (nLimitedSpaceForText > 0
+ && !rAxisLabelProperties.m_bOverlapAllowed
+ && rAxisLabelProperties.m_fRotationAngleDegree == 0.0
+ && nTick > 0
+ && lcl_hasWordBreak(pTickInfo->xTextShape))
{
// Label has multiple lines and belongs to a complex category
// axis. Rotate 90 degrees to try to avoid overlaps.
if ( m_aAxisProperties.m_bComplexCategories )
{
- rAxisLabelProperties.fRotationAngleDegree = 90;
+ rAxisLabelProperties.m_fRotationAngleDegree = 90;
}
- rAxisLabelProperties.bLineBreakAllowed = false;
- m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree;
+ rAxisLabelProperties.m_bLineBreakAllowed = false;
+ m_aAxisLabelProperties.m_fRotationAngleDegree = rAxisLabelProperties.m_fRotationAngleDegree;
removeTextShapesFromTicks();
return false;
}
//if NO OVERLAP -> remove overlapping shapes
- if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed )
+ if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.m_bOverlapAllowed )
{
// Check if the label still overlaps with its neighbor.
- if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree ) )
+ if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.m_fRotationAngleDegree ) )
{
// It overlaps. Check if staggering helps.
bool bOverlapsAfterAutoStagger = true;
@@ -898,11 +922,11 @@ bool VCartesianAxis::createTextShapes(
|| m_aAxisProperties.m_bTryStaggeringFirst )
{
bIsStaggered = true;
- rAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven;
+ rAxisLabelProperties.m_eStaggering = AxisLabelStaggering::StaggerEven;
pLastVisibleNeighbourTickInfo = pPREPreviousVisibleTickInfo;
if( !pLastVisibleNeighbourTickInfo ||
!lcl_doesShapeOverlapWithTickmark( *pLastVisibleNeighbourTickInfo->xTextShape
- , rAxisLabelProperties.fRotationAngleDegree
+ , rAxisLabelProperties.m_fRotationAngleDegree
, pTickInfo->aTickScreenPosition ) )
bOverlapsAfterAutoStagger = false;
}
@@ -919,15 +943,15 @@ bool VCartesianAxis::createTextShapes(
// The nRhythm parameter is reset to 1 since the layout
// used for text labels is changed.
rAxisLabelProperties.autoRotate45();
- m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree; // Store it for future runs.
+ m_aAxisLabelProperties.m_fRotationAngleDegree = rAxisLabelProperties.m_fRotationAngleDegree; // Store it for future runs.
removeTextShapesFromTicks();
- rAxisLabelProperties.nRhythm = 1;
+ rAxisLabelProperties.m_nRhythm = 1;
return false;
}
// Try incrementing the tick interval and start over.
- rAxisLabelProperties.nRhythm++;
- removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.nRhythm, nTick, xTarget );
+ rAxisLabelProperties.m_nRhythm++;
+ removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.m_nRhythm, nTick, xTarget );
return false;
}
}
@@ -944,7 +968,7 @@ bool VCartesianAxis::createTextShapesSimple(
AxisLabelProperties& rAxisLabelProperties, TickFactory2D const * pTickFactory )
{
FixedNumberFormatter aFixedNumberFormatter(
- m_xNumberFormatsSupplier, rAxisLabelProperties.nNumberFormatKey );
+ m_xNumberFormatsSupplier, rAxisLabelProperties.m_nNumberFormatKey );
const bool bIsHorizontalAxis = pTickFactory->isHorizontalAxis();
const bool bIsVerticalAxis = pTickFactory->isVerticalAxis();
@@ -979,28 +1003,28 @@ bool VCartesianAxis::createTextShapesSimple(
const TickInfo* pLastVisibleNeighbourTickInfo = pPreviousVisibleTickInfo;
//don't create labels which does not fit into the rhythm
- if( nTick%rAxisLabelProperties.nRhythm != 0 )
+ if( nTick%rAxisLabelProperties.m_nRhythm != 0 )
continue;
//don't create labels for invisible ticks
if( !pTickInfo->bPaintIt )
continue;
- if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed )
+ if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.m_bOverlapAllowed )
{
// Overlapping is not allowed. If the label overlaps with its
// neighboring label, try increasing the tick interval (or rhythm
// as it's called) and start over.
if( lcl_doesShapeOverlapWithTickmark( *pLastVisibleNeighbourTickInfo->xTextShape
- , rAxisLabelProperties.fRotationAngleDegree
+ , rAxisLabelProperties.m_fRotationAngleDegree
, pTickInfo->aTickScreenPosition ) )
{
// This tick overlaps with its neighbor. Increment the visible
// tick intervals (if that's allowed) and start over.
- rAxisLabelProperties.nRhythm++;
- removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.nRhythm, nTick, xTarget );
+ rAxisLabelProperties.m_nRhythm++;
+ removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.m_nRhythm, nTick, xTarget );
return false;
}
}
@@ -1032,13 +1056,13 @@ bool VCartesianAxis::createTextShapesSimple(
if(!pTickInfo->xTextShape.is())
continue;
- recordMaximumTextSize( *pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree );
+ recordMaximumTextSize( *pTickInfo->xTextShape, rAxisLabelProperties.m_fRotationAngleDegree );
//if NO OVERLAP -> remove overlapping shapes
- if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed )
+ if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.m_bOverlapAllowed )
{
// Check if the label still overlaps with its neighbor.
- if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree ) )
+ if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.m_fRotationAngleDegree ) )
{
// It overlaps.
if( isAutoRotatingOfLabelsAllowed(rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis) )
@@ -1049,15 +1073,15 @@ bool VCartesianAxis::createTextShapesSimple(
// The nRhythm parameter is reset to 1 since the layout
// used for text labels is changed.
rAxisLabelProperties.autoRotate45();
- m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree; // Store it for future runs.
+ m_aAxisLabelProperties.m_fRotationAngleDegree = rAxisLabelProperties.m_fRotationAngleDegree; // Store it for future runs.
removeTextShapesFromTicks();
- rAxisLabelProperties.nRhythm = 1;
+ rAxisLabelProperties.m_nRhythm = 1;
return false;
}
// Try incrementing the tick interval and start over.
- rAxisLabelProperties.nRhythm++;
- removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.nRhythm, nTick, xTarget );
+ rAxisLabelProperties.m_nRhythm++;
+ removeShapesAtWrongRhythm( rTickIter, rAxisLabelProperties.m_nRhythm, nTick, xTarget );
return false;
}
}
@@ -1556,14 +1580,14 @@ sal_Int32 VCartesianAxis::estimateMaximumAutoMainIncrementCount()
// tdf#48041: do not duplicate the value labels because of rounding
if (m_aAxisProperties.m_nAxisType != css::chart2::AxisType::DATE)
{
- FixedNumberFormatter aFixedNumberFormatterTest(m_xNumberFormatsSupplier, m_aAxisLabelProperties.nNumberFormatKey);
+ FixedNumberFormatter aFixedNumberFormatterTest(m_xNumberFormatsSupplier, m_aAxisLabelProperties.m_nNumberFormatKey);
OUString sPreviousValueLabel;
sal_Int32 nSameLabel = 0;
- for (sal_Int32 nLabel = 0; nLabel < static_cast<sal_Int32>(m_aAllTickInfos[0].size()); ++nLabel)
+ for (auto const & nLabel: m_aAllTickInfos[0])
{
Color nColor = COL_AUTO;
bool bHasColor = false;
- OUString sValueLabel = aFixedNumberFormatterTest.getFormattedString(m_aAllTickInfos[0][nLabel].fScaledTickValue, nColor, bHasColor);
+ OUString sValueLabel = aFixedNumberFormatterTest.getFormattedString(nLabel.fScaledTickValue, nColor, bHasColor);
if (sValueLabel == sPreviousValueLabel)
{
nSameLabel++;
@@ -1610,7 +1634,7 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel
std::unique_ptr<TickIter> apTickIter(createLabelTickIterator(nTextLevel));
if (apTickIter)
{
- double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
+ double fRotationAngleDegree = m_aAxisLabelProperties.m_fRotationAngleDegree;
if( nTextLevel>0 )
{
lcl_shiftLabels(*apTickIter, aCumulatedLabelsDistance);
@@ -1630,8 +1654,8 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel
{
if( !m_aAllTickInfos.empty() )
{
- LabelIterator aInnerIter( m_aAllTickInfos[0], rAxisLabelProperties.eStaggering, true );
- LabelIterator aOuterIter( m_aAllTickInfos[0], rAxisLabelProperties.eStaggering, false );
+ LabelIterator aInnerIter( m_aAllTickInfos[0], rAxisLabelProperties.m_eStaggering, true );
+ LabelIterator aOuterIter( m_aAllTickInfos[0], rAxisLabelProperties.m_eStaggering, false );
lcl_shiftLabels( aOuterIter
, lcl_getLabelsDistance( aInnerIter
@@ -1640,16 +1664,55 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel
}
}
+void VCartesianAxis::createDataTableShape(std::unique_ptr<TickFactory2D> const& rpTickFactory2D)
+{
+ // Check if we can create the data table shape
+ // Data table view and m_bDisplayDataTable must be true
+ if (!m_pDataTableView || !m_aAxisProperties.m_bDisplayDataTable)
+ return;
+
+ m_pDataTableView->initializeShapes(m_xDataTableTarget);
+ basegfx::B2DVector aStart = rpTickFactory2D->getXaxisStartPos();
+ basegfx::B2DVector aEnd = rpTickFactory2D->getXaxisEndPos();
+
+ rpTickFactory2D->updateScreenValues(m_aAllTickInfos);
+
+ sal_Int32 nDistance = -1;
+
+ std::unique_ptr<TickIter> apTickIter(createLabelTickIterator(0));
+ if (apTickIter)
+ {
+ nDistance = TickFactory2D::getTickScreenDistance(*apTickIter);
+ if (getTextLevelCount() > 1)
+ nDistance *= 2;
+ }
+
+ if (nDistance <= 0)
+ {
+ // we only have one data series so we have no TickMarks, therefore calculate and use the table size
+ auto rDelta = aEnd - aStart;
+ nDistance = basegfx::fround(rDelta.getX());
+ }
+
+ if (nDistance > 0)
+ {
+ m_pDataTableView->createShapes(aStart, aEnd, nDistance);
+ }
+}
+
void VCartesianAxis::createLabels()
{
if( !prepareShapeCreation() )
return;
+ std::unique_ptr<TickFactory2D> apTickFactory2D(createTickFactory2D()); // throws on failure
+
+ createDataTableShape(apTickFactory2D);
+
//create labels
if (!m_aAxisProperties.m_bDisplayLabels)
return;
- std::unique_ptr<TickFactory2D> apTickFactory2D(createTickFactory2D()); // throws on failure
TickFactory2D* pTickFactory2D = apTickFactory2D.get();
//get the transformed screen values for all tickmarks in aAllTickInfos
@@ -1677,15 +1740,15 @@ void VCartesianAxis::createLabels()
AxisLabelProperties aComplexProps(m_aAxisLabelProperties);
if( m_aAxisProperties.m_bComplexCategories )
{
- aComplexProps.bLineBreakAllowed = true;
- aComplexProps.bOverlapAllowed = aComplexProps.fRotationAngleDegree != 0.0;
+ aComplexProps.m_bLineBreakAllowed = true;
+ aComplexProps.m_bOverlapAllowed = aComplexProps.m_fRotationAngleDegree != 0.0;
if( nTextLevel > 0 )
{
//multilevel labels: 0 or 90 by default
if( m_aAxisProperties.m_bSwapXAndY )
- aComplexProps.fRotationAngleDegree = 90.0;
+ aComplexProps.m_fRotationAngleDegree = 90.0;
else
- aComplexProps.fRotationAngleDegree = 0.0;
+ aComplexProps.m_fRotationAngleDegree = 0.0;
}
}
AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties;
@@ -1696,11 +1759,20 @@ void VCartesianAxis::createLabels()
}
}
doStaggeringOfLabels( m_aAxisLabelProperties, pTickFactory2D );
+
+ if (m_pDataTableView)
+ {
+ sal_Int32 x = m_xTextTarget->getPosition().X;
+ sal_Int32 y = m_xTextTarget->getPosition().Y;
+ sal_Int32 height = m_xTextTarget->getSize().Height;
+ m_pDataTableView->changePosition(x, y + height);
+ }
}
void VCartesianAxis::createMaximumLabels()
{
- TrueGuard aRecordMaximumTextSize(m_bRecordMaximumTextSize);
+ m_bRecordMaximumTextSize = true;
+ const comphelper::ScopeGuard aGuard([this]() { m_bRecordMaximumTextSize = false; });
if( !prepareShapeCreation() )
return;
@@ -1720,10 +1792,10 @@ void VCartesianAxis::createMaximumLabels()
AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties );
if( isAutoStaggeringOfLabelsAllowed( aAxisLabelProperties, pTickFactory2D->isHorizontalAxis(), pTickFactory2D->isVerticalAxis() ) )
- aAxisLabelProperties.eStaggering = AxisLabelStaggering::StaggerEven;
+ aAxisLabelProperties.m_eStaggering = AxisLabelStaggering::StaggerEven;
- aAxisLabelProperties.bOverlapAllowed = true;
- aAxisLabelProperties.bLineBreakAllowed = false;
+ aAxisLabelProperties.m_bOverlapAllowed = true;
+ aAxisLabelProperties.m_bLineBreakAllowed = false;
sal_Int32 nTextLevelCount = getTextLevelCount();
for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ )
{
@@ -1766,7 +1838,7 @@ void VCartesianAxis::updatePositions()
static_cast<sal_Int32>(aTickScreenPos2D.getX())
,static_cast<sal_Int32>(aTickScreenPos2D.getY()));
- double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
+ double fRotationAngleDegree = m_aAxisLabelProperties.m_fRotationAngleDegree;
if( nDepth > 0 )
{
//multilevel labels: 0 or 90 by default
@@ -1783,7 +1855,7 @@ void VCartesianAxis::updatePositions()
//set new position
try
{
- xShape2DText->SvxShape::setPropertyValue( "Transformation", aATransformation );
+ xShape2DText->SvxShape::setPropertyValue( u"Transformation"_ustr, aATransformation );
}
catch( const uno::Exception& )
{
@@ -1835,12 +1907,12 @@ void VCartesianAxis::createShapes()
if( !prepareShapeCreation() )
return;
- std::unique_ptr<TickFactory2D> apTickFactory2D(createTickFactory2D()); // throws on failure
- TickFactory2D* pTickFactory2D = apTickFactory2D.get();
-
//create line shapes
if(m_nDimension==2)
{
+ std::unique_ptr<TickFactory2D> apTickFactory2D(createTickFactory2D()); // throws on failure
+ TickFactory2D* pTickFactory2D = apTickFactory2D.get();
+
//create extra long ticks to separate complex categories (create them only there where the labels are)
if( isComplexCategoryAxis() )
{
@@ -1858,7 +1930,7 @@ void VCartesianAxis::createShapes()
std::unique_ptr< TickIter > apTickIter(createLabelTickIterator( nTextLevel ));
if( apTickIter )
{
- double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
+ double fRotationAngleDegree = m_aAxisLabelProperties.m_fRotationAngleDegree;
if( nTextLevel > 0 )
{
//Multi-level Labels: default to 0 or 90
@@ -1920,7 +1992,7 @@ void VCartesianAxis::createShapes()
m_xGroupShape_Shapes, aPoints
, &m_aAxisProperties.m_aLineProperties );
//because of this name this line will be used for marking the axis
- ::chart::ShapeFactory::setShapeName( xShape, "MarkHandles" );
+ ::chart::ShapeFactory::setShapeName( xShape, u"MarkHandles"_ustr );
}
//create an additional line at NULL
if( !AxisHelper::isAxisPositioningEnabled() )
@@ -1944,6 +2016,20 @@ void VCartesianAxis::createShapes()
createLabels();
}
+void VCartesianAxis::createDataTableView(std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
+ Reference<util::XNumberFormatsSupplier> const& xNumberFormatsSupplier,
+ rtl::Reference<::chart::ChartModel> const& xChartDoc,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext)
+{
+ if (!m_aAxisProperties.m_bDisplayDataTable)
+ return;
+
+ m_pDataTableView.reset(new DataTableView(xChartDoc, m_aAxisProperties.m_xDataTableModel, rComponentContext, m_aAxisProperties.m_bDataTableAlignAxisValuesWithColumns));
+ m_pDataTableView->initializeValues(rSeriesPlotterList);
+ m_xNumberFormatsSupplier = xNumberFormatsSupplier;
+}
+
+
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/axes/VCartesianAxis.hxx b/chart2/source/view/axes/VCartesianAxis.hxx
index 94e9b2ab967a..210f36dd4802 100644
--- a/chart2/source/view/axes/VCartesianAxis.hxx
+++ b/chart2/source/view/axes/VCartesianAxis.hxx
@@ -23,7 +23,6 @@
namespace chart
{
-
class VCartesianAxis : public VAxisBase
{
// public methods
@@ -99,6 +98,10 @@ public:
::basegfx::B2DVector aScreenPos;
};
+ void createDataTableView(std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
+ css::uno::Reference<css::util::XNumberFormatsSupplier> const& xNumberFormatsSupplier,
+ rtl::Reference<::chart::ChartModel> const& xChartDoc,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext) override;
private: //methods
/**
* Go through all tick label positions and decide which labels to display
@@ -153,6 +156,8 @@ private: //methods
::basegfx::B2DVector getScreenPosition( double fLogicX, double fLogicY, double fLogicZ ) const;
ScreenPosAndLogicPos getScreenPosAndLogicPos( double fLogicX, double fLogicY, double fLogicZ ) const;
+
+ void createDataTableShape(std::unique_ptr<TickFactory2D> const& rTickFactory2D);
};
} //namespace chart
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
index 71c280f45007..dbaeee1788ca 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
@@ -22,10 +22,13 @@
#include "VCartesianAxis.hxx"
#include <BaseCoordinateSystem.hxx>
#include <AxisIndexDefines.hxx>
+#include <Axis.hxx>
+#include <DataTable.hxx>
+#include <Diagram.hxx>
#include <AxisHelper.hxx>
#include <cppuhelper/implbase.hxx>
#include <ChartModel.hxx>
-#include <com/sun/star/chart2/XCoordinateSystem.hpp>
+#include <GridProperties.hxx>
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
@@ -79,7 +82,7 @@ void VCartesianCoordinateSystem::createGridShapes()
for( sal_Int32 nDimensionIndex=0; nDimensionIndex<3; nDimensionIndex++)
{
sal_Int32 nAxisIndex = MAIN_AXIS_INDEX;
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, nAxisIndex, m_xCooSysModel ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDimensionIndex, nAxisIndex, m_xCooSysModel );
if(!xAxis.is() || !AxisHelper::shouldAxisBeDisplayed( xAxis, m_xCooSysModel ))
continue;
@@ -98,16 +101,17 @@ void VCartesianCoordinateSystem::createGridShapes()
}
void VCartesianCoordinateSystem::createVAxisList(
- const uno::Reference<chart2::XChartDocument> & xChartDoc
- , const awt::Size& rFontReferenceSize
- , const awt::Rectangle& rMaximumSpaceForLabels
- , bool bLimitSpaceForLabels
- )
+ const rtl::Reference<::chart::ChartModel> & xChartDoc,
+ const awt::Size& rFontReferenceSize,
+ const awt::Rectangle& rMaximumSpaceForLabels,
+ bool bLimitSpaceForLabels,
+ std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
+ uno::Reference<uno::XComponentContext> const& rComponentContext)
{
// note: using xChartDoc itself as XNumberFormatsSupplier would cause
// a leak from VCartesianAxis due to cyclic reference
uno::Reference<util::XNumberFormatsSupplier> const xNumberFormatsSupplier(
- dynamic_cast<ChartModel&>(*xChartDoc).getNumberFormatsSupplier());
+ xChartDoc->getNumberFormatsSupplier());
m_aAxisMap.clear();
@@ -126,16 +130,17 @@ void VCartesianCoordinateSystem::createVAxisList(
sal_Int32 nMaxAxisIndex = m_xCooSysModel->getMaximumAxisIndexByDimension(nDimensionIndex);
for( sal_Int32 nAxisIndex = 0; nAxisIndex <= nMaxAxisIndex; nAxisIndex++ )
{
- Reference< XAxis > xAxis = getAxisByDimension(nDimensionIndex,nAxisIndex);
+ rtl::Reference< Axis > xAxis = getAxisByDimension(nDimensionIndex,nAxisIndex);
if(!xAxis.is() || !AxisHelper::shouldAxisBeDisplayed( xAxis, m_xCooSysModel ))
continue;
- AxisProperties aAxisProperties(xAxis,getExplicitCategoriesProvider());
+ rtl::Reference<Diagram> xDiagram(xChartDoc->getFirstChartDiagram());
+ AxisProperties aAxisProperties(xAxis, &m_xCooSysModel->getExplicitCategoriesProvider(*xChartDoc), xDiagram->getDataTableRef());
aAxisProperties.m_nDimensionIndex = nDimensionIndex;
aAxisProperties.m_bSwapXAndY = bSwapXAndY;
aAxisProperties.m_bIsMainAxis = (nAxisIndex==0);
aAxisProperties.m_bLimitSpaceForLabels = bLimitSpaceForLabels;
- Reference< XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( xAxis, m_xCooSysModel ) );
+ rtl::Reference< Axis > xCrossingMainAxis = AxisHelper::getCrossingMainAxis( xAxis, m_xCooSysModel );
if( xCrossingMainAxis.is() )
{
ScaleData aCrossingScale( xCrossingMainAxis->getScaleData() );
@@ -150,8 +155,8 @@ void VCartesianCoordinateSystem::createVAxisList(
aAxisProperties.m_xAxisTextProvider = new TextualDataProvider( m_aSeriesNamesForZAxis );
//for the z axis copy the positioning properties from the x axis (or from the y axis for swapped coordinate systems)
- Reference< XAxis > xSisterAxis( AxisHelper::getCrossingMainAxis( xCrossingMainAxis, m_xCooSysModel ) );
- aAxisProperties.initAxisPositioning( Reference< beans::XPropertySet >( xSisterAxis, uno::UNO_QUERY) );
+ rtl::Reference< Axis > xSisterAxis = AxisHelper::getCrossingMainAxis( xCrossingMainAxis, m_xCooSysModel );
+ aAxisProperties.initAxisPositioning( xSisterAxis );
}
aAxisProperties.init(true);
if(aAxisProperties.m_bDisplayLabels)
@@ -163,6 +168,7 @@ void VCartesianCoordinateSystem::createVAxisList(
apVAxis->set3DWallPositions( m_eLeftWallPos, m_eBackWallPos, m_eBottomPos );
apVAxis->initAxisLabelProperties(rFontReferenceSize,rMaximumSpaceForLabels);
+ apVAxis->createDataTableView(rSeriesPlotterList, xNumberFormatsSupplier, xChartDoc, rComponentContext);
}
}
}
@@ -175,16 +181,13 @@ void VCartesianCoordinateSystem::initVAxisInList()
sal_Int32 nDimensionCount = m_xCooSysModel->getDimension();
bool bSwapXAndY = getPropertySwapXAndYAxis();
- for (auto const& elem : m_aAxisMap)
+ for (auto const& [nIndexPair, pVAxis] : m_aAxisMap)
{
- VAxisBase* pVAxis = elem.second.get();
- if( pVAxis )
+ if (pVAxis)
{
- sal_Int32 nDimensionIndex = elem.first.first;
- sal_Int32 nAxisIndex = elem.first.second;
+ auto [nDimensionIndex, nAxisIndex] = nIndexPair;
pVAxis->setExplicitScaleAndIncrement( getExplicitScale( nDimensionIndex, nAxisIndex ), getExplicitIncrement( nDimensionIndex, nAxisIndex ) );
- pVAxis->initPlotter(m_xLogicTargetForAxes,m_xFinalTarget
- , createCIDForAxis( nDimensionIndex, nAxisIndex ) );
+ pVAxis->initPlotter(m_xLogicTargetForAxes, m_xFinalTarget, createCIDForAxis( nDimensionIndex, nAxisIndex ) );
if(nDimensionCount==2)
pVAxis->setTransformationSceneToScreen( m_aMatrixSceneToScreen );
pVAxis->setScales( getExplicitScales(nDimensionIndex,nAxisIndex), bSwapXAndY );
@@ -200,13 +203,12 @@ void VCartesianCoordinateSystem::updateScalesAndIncrementsOnAxes()
sal_Int32 nDimensionCount = m_xCooSysModel->getDimension();
bool bSwapXAndY = getPropertySwapXAndYAxis();
- for (auto const& elem : m_aAxisMap)
+ for (auto const& [nIndexPair, pVAxis] : m_aAxisMap)
{
- VAxisBase* pVAxis = elem.second.get();
- if( pVAxis )
+ if (pVAxis)
{
- sal_Int32 nDimensionIndex = elem.first.first;
- sal_Int32 nAxisIndex = elem.first.second;
+ auto [nDimensionIndex, nAxisIndex] = nIndexPair;
+
pVAxis->setExplicitScaleAndIncrement( getExplicitScale( nDimensionIndex, nAxisIndex ), getExplicitIncrement( nDimensionIndex, nAxisIndex ) );
if(nDimensionCount==2)
pVAxis->setTransformationSceneToScreen( m_aMatrixSceneToScreen );
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.hxx b/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
index e26239225261..968d97a21099 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.hxx
@@ -31,10 +31,12 @@ public:
virtual ~VCartesianCoordinateSystem() override;
virtual void createVAxisList(
- const css::uno::Reference< css::chart2::XChartDocument> &ChartDoc
- , const css::awt::Size& rFontReferenceSize
- , const css::awt::Rectangle& rMaximumSpaceForLabels
- , bool bLimitSpaceForLabels ) override;
+ const rtl::Reference<::chart::ChartModel> &ChartDoc,
+ const css::awt::Size& rFontReferenceSize,
+ const css::awt::Rectangle& rMaximumSpaceForLabels,
+ bool bLimitSpaceForLabels,
+ std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext) override;
virtual void initVAxisInList() override;
virtual void updateScalesAndIncrementsOnAxes() override;
diff --git a/chart2/source/view/axes/VCartesianGrid.cxx b/chart2/source/view/axes/VCartesianGrid.cxx
index 19e60b4ecabd..ef00c97f14b5 100644
--- a/chart2/source/view/axes/VCartesianGrid.cxx
+++ b/chart2/source/view/axes/VCartesianGrid.cxx
@@ -25,6 +25,7 @@
#include <CommonConverters.hxx>
#include <AxisHelper.hxx>
#include <VLineProperties.hxx>
+#include <GridProperties.hxx>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
@@ -74,23 +75,11 @@ GridLinePoints::GridLinePoints( const PlottingPositionHelper* pPosHelper, sal_In
pPosHelper->doLogicScaling( &MaxX,&MaxY,&MaxZ );
if(!pPosHelper->isMathematicalOrientationX())
- {
- double fHelp = MinX;
- MinX = MaxX;
- MaxX = fHelp;
- }
+ std::swap( MinX, MaxX );
if(!pPosHelper->isMathematicalOrientationY())
- {
- double fHelp = MinY;
- MinY = MaxY;
- MaxY = fHelp;
- }
+ std::swap( MinY, MaxY );
if(pPosHelper->isMathematicalOrientationZ())//z axis in draw is reverse to mathematical
- {
- double fHelp = MinZ;
- MinZ = MaxZ;
- MaxZ = fHelp;
- }
+ std::swap( MinZ, MaxZ );
bool bSwapXY = pPosHelper->isSwapXAndY();
//P0: point on 'back' wall, not on 'left' wall
@@ -161,9 +150,9 @@ static void addLine3D( std::vector<std::vector<css::drawing::Position3D>>& rPoin
}
VCartesianGrid::VCartesianGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
- , const Sequence< Reference< beans::XPropertySet > > & rGridPropertiesList )
+ , std::vector< rtl::Reference< ::chart::GridProperties > > aGridPropertiesList )
: VAxisOrGridBase( nDimensionIndex, nDimensionCount )
- , m_aGridPropertiesList( rGridPropertiesList )
+ , m_aGridPropertiesList( std::move(aGridPropertiesList) )
{
m_pPosHelper = new PlottingPositionHelper();
}
@@ -175,10 +164,10 @@ VCartesianGrid::~VCartesianGrid()
}
void VCartesianGrid::fillLinePropertiesFromGridModel( std::vector<VLineProperties>& rLinePropertiesList
- , const Sequence< Reference< beans::XPropertySet > > & rGridPropertiesList )
+ , const std::vector< rtl::Reference< ::chart::GridProperties > > & rGridPropertiesList )
{
rLinePropertiesList.clear();
- if( !rGridPropertiesList.hasElements() )
+ if( rGridPropertiesList.empty() )
return;
VLineProperties aLineProperties;
@@ -194,7 +183,7 @@ void VCartesianGrid::fillLinePropertiesFromGridModel( std::vector<VLinePropertie
void VCartesianGrid::createShapes()
{
- if(!m_aGridPropertiesList.hasElements())
+ if(m_aGridPropertiesList.empty())
return;
//somehow equal to axis tickmarks
@@ -273,7 +262,7 @@ void VCartesianGrid::createShapes()
aHandleLineProperties.LineStyle <<= drawing::LineStyle_NONE;
rtl::Reference<SvxShapePolyPolygon> xHandleShape =
ShapeFactory::createLine2D( xTarget, aHandlesPoints, &aHandleLineProperties );
- ::chart::ShapeFactory::setShapeName( xHandleShape, "HandlesOnly" );
+ ::chart::ShapeFactory::setShapeName( xHandleShape, u"HandlesOnly"_ustr );
}
else //if(2!=m_nDimension)
{
diff --git a/chart2/source/view/axes/VCartesianGrid.hxx b/chart2/source/view/axes/VCartesianGrid.hxx
index 2302a1d5a69f..d41bcc4d466f 100644
--- a/chart2/source/view/axes/VCartesianGrid.hxx
+++ b/chart2/source/view/axes/VCartesianGrid.hxx
@@ -21,30 +21,30 @@
#include "VAxisOrGridBase.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
-namespace chart { struct VLineProperties; }
-
namespace chart
{
+class GridProperties;
+struct VLineProperties;
class VCartesianGrid : public VAxisOrGridBase
{
// public methods
public:
VCartesianGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
- , const css::uno::Sequence<
- css::uno::Reference< css::beans::XPropertySet > >& rGridPropertiesList //main grid, subgrid, subsubgrid etc
+ , std::vector<
+ rtl::Reference< ::chart::GridProperties > > aGridPropertiesList //main grid, subgrid, subsubgrid etc
);
virtual ~VCartesianGrid() override;
virtual void createShapes() override;
static void fillLinePropertiesFromGridModel( std::vector<VLineProperties>& rLinePropertiesList
- , const css::uno::Sequence<
- css::uno::Reference< css::beans::XPropertySet > >& rGridPropertiesList );
+ , const std::vector<
+ rtl::Reference< ::chart::GridProperties > >& rGridPropertiesList );
private:
- css::uno::Sequence<
- css::uno::Reference< css::beans::XPropertySet > > m_aGridPropertiesList; //main grid, subgrid, subsubgrid etc
+ std::vector<
+ rtl::Reference< ::chart::GridProperties > > m_aGridPropertiesList; //main grid, subgrid, subsubgrid etc
};
} //namespace chart
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx
index 44f17c7d915f..ff8b6dd0be13 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -18,26 +18,30 @@
*/
#include <BaseGFXHelper.hxx>
+#include <ChartView.hxx>
+#include <DateHelper.hxx>
#include <VCoordinateSystem.hxx>
#include "VCartesianCoordinateSystem.hxx"
#include "VPolarCoordinateSystem.hxx"
#include <BaseCoordinateSystem.hxx>
+#include <GridProperties.hxx>
+#include <ChartModel.hxx>
#include <ScaleAutomatism.hxx>
#include <ShapeFactory.hxx>
#include <servicenames_coosystems.hxx>
#include <ObjectIdentifier.hxx>
#include <ExplicitCategoriesProvider.hxx>
+#include <Axis.hxx>
#include "VAxisBase.hxx"
#include <defines.hxx>
-#include <chartview/ExplicitValueProvider.hxx>
#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/XCoordinateSystem.hpp>
-#include <comphelper/sequence.hxx>
-#include <tools/diagnose_ex.h>
+#include <rtl/math.hxx>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
#include <limits>
+#include <utility>
namespace chart
{
@@ -65,8 +69,8 @@ std::unique_ptr<VCoordinateSystem> VCoordinateSystem::createCoordinateSystem(
return pRet;
}
-VCoordinateSystem::VCoordinateSystem( const rtl::Reference< BaseCoordinateSystem >& xCooSys )
- : m_xCooSysModel(xCooSys)
+VCoordinateSystem::VCoordinateSystem( rtl::Reference< BaseCoordinateSystem > xCooSys )
+ : m_xCooSysModel(std::move(xCooSys))
, m_eLeftWallPos(CuboidPlanePosition_Left)
, m_eBackWallPos(CuboidPlanePosition_Back)
, m_eBottomPos(CuboidPlanePosition_Bottom)
@@ -182,33 +186,30 @@ uno::Sequence< sal_Int32 > VCoordinateSystem::getCoordinateSystemResolution(
return aResolution;
}
-Reference< XAxis > VCoordinateSystem::getAxisByDimension( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
+rtl::Reference< Axis > VCoordinateSystem::getAxisByDimension( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
{
if( m_xCooSysModel.is() )
- return m_xCooSysModel->getAxisByDimension( nDimensionIndex, nAxisIndex );
+ return m_xCooSysModel->getAxisByDimension2( nDimensionIndex, nAxisIndex );
return nullptr;
}
-Sequence< Reference< beans::XPropertySet > > VCoordinateSystem::getGridListFromAxis( const Reference< XAxis >& xAxis )
+std::vector< rtl::Reference< ::chart::GridProperties > > VCoordinateSystem::getGridListFromAxis( const rtl::Reference< Axis >& xAxis )
{
- std::vector< Reference< beans::XPropertySet > > aRet;
+ std::vector< rtl::Reference< ::chart::GridProperties > > aRet;
if( xAxis.is() )
{
- aRet.push_back( xAxis->getGridProperties() );
- auto aSubGrids( comphelper::sequenceToContainer<std::vector< Reference< beans::XPropertySet > > >( xAxis->getSubGridProperties() ) );
+ aRet.push_back( xAxis->getGridProperties2() );
+ std::vector<rtl::Reference<::chart::GridProperties>> aSubGrids = xAxis->getSubGridProperties2();
aRet.insert( aRet.end(), aSubGrids.begin(), aSubGrids.end() );
}
- return comphelper::containerToSequence( aRet );
+ return aRet;
}
void VCoordinateSystem::impl_adjustDimension( sal_Int32& rDimensionIndex )
{
- if( rDimensionIndex<0 )
- rDimensionIndex=0;
- if( rDimensionIndex>2 )
- rDimensionIndex=2;
+ rDimensionIndex = std::clamp<sal_Int32>(rDimensionIndex, 0, 2);
}
void VCoordinateSystem::impl_adjustDimensionAndIndex( sal_Int32& rDimensionIndex, sal_Int32& rAxisIndex ) const
@@ -219,16 +220,6 @@ void VCoordinateSystem::impl_adjustDimensionAndIndex( sal_Int32& rDimensionIndex
rAxisIndex = 0;
}
-void VCoordinateSystem::setExplicitCategoriesProvider( ExplicitCategoriesProvider* pExplicitCategoriesProvider /*takes ownership*/ )
-{
- m_apExplicitCategoriesProvider.reset(pExplicitCategoriesProvider);
-}
-
-ExplicitCategoriesProvider* VCoordinateSystem::getExplicitCategoriesProvider()
-{
- return m_apExplicitCategoriesProvider.get();
-}
-
std::vector< ExplicitScaleData > VCoordinateSystem::getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
{
std::vector< ExplicitScaleData > aRet(m_aExplicitScales);
@@ -322,11 +313,12 @@ sal_Int32 VCoordinateSystem::getMaximumAxisIndexByDimension( sal_Int32 nDimensio
}
void VCoordinateSystem::createVAxisList(
- const uno::Reference<chart2::XChartDocument> & /* xChartDoc */
- , const awt::Size& /* rFontReferenceSize */
- , const awt::Rectangle& /* rMaximumSpaceForLabels */
- , bool /* bLimitSpaceForLabels */
- )
+ const rtl::Reference<::chart::ChartModel> & /* xChartDoc */,
+ const awt::Size& /* rFontReferenceSize */,
+ const awt::Rectangle& /* rMaximumSpaceForLabels */,
+ bool /* bLimitSpaceForLabels */,
+ std::vector<std::unique_ptr<VSeriesPlotter>>& /*rSeriesPlotterList*/,
+ uno::Reference<uno::XComponentContext> const& /*rComponentContext*/)
{
}
@@ -364,8 +356,32 @@ void VCoordinateSystem::prepareAutomaticAxisScaling( ScaleAutomatism& rScaleAuto
{
// y dimension
ExplicitScaleData aScale = getExplicitScale( 0, 0 );
- fMin = m_aMergedMinMaxSupplier.getMinimumYInRange(aScale.Minimum,aScale.Maximum, nAxisIndex);
- fMax = m_aMergedMinMaxSupplier.getMaximumYInRange(aScale.Minimum,aScale.Maximum, nAxisIndex);
+ if (!aScale.m_bShiftedCategoryPosition && aScale.AxisType == AxisType::DATE)
+ {
+ double fMaximum = aScale.Maximum;
+ // tdf#146066 Increase maximum date value by one month/year,
+ // because the automatic scaling of the Y axis was incorrect when the last Y value was the highest value.
+ Date aMaxDate(aScale.NullDate);
+ aMaxDate.AddDays(::rtl::math::approxFloor(fMaximum));
+ switch (aScale.TimeResolution)
+ {
+ case css::chart::TimeUnit::MONTH:
+ aMaxDate = DateHelper::GetDateSomeMonthsAway(aMaxDate, 1);
+ break;
+ case css::chart::TimeUnit::YEAR:
+ aMaxDate = DateHelper::GetDateSomeYearsAway(aMaxDate, 1);
+ break;
+ }
+ fMaximum = aMaxDate - aScale.NullDate;
+ fMin = m_aMergedMinMaxSupplier.getMinimumAndMaximumYInRange(aScale.Minimum, aScale.Maximum, nAxisIndex).first;
+ fMax = m_aMergedMinMaxSupplier.getMinimumAndMaximumYInRange(aScale.Minimum, fMaximum, nAxisIndex).second;
+ }
+ else
+ {
+ auto fTmp = m_aMergedMinMaxSupplier.getMinimumAndMaximumYInRange(aScale.Minimum, aScale.Maximum, nAxisIndex);
+ fMin = fTmp.first;
+ fMax = fTmp.second;
+ }
}
else if( nDimIndex == 2 )
{
@@ -398,7 +414,7 @@ VAxisBase* VCoordinateSystem::getVAxis( sal_Int32 nDimensionIndex, sal_Int32 nAx
tFullAxisIndex aFullAxisIndex( nDimensionIndex, nAxisIndex );
tVAxisMap::const_iterator aIt = m_aAxisMap.find( aFullAxisIndex );
- if( aIt != m_aAxisMap.end() )
+ if (aIt != m_aAxisMap.cend())
pRet = aIt->second.get();
return pRet;
@@ -434,26 +450,26 @@ void VCoordinateSystem::set3DWallPositions( CuboidPlanePosition eLeftWallPos, Cu
void VCoordinateSystem::createMaximumAxesLabels()
{
- for (auto const& elem : m_aAxisMap)
+ for (auto const&[unused, pVAxis] : m_aAxisMap)
{
- VAxisBase* pVAxis = elem.second.get();
- if( pVAxis )
+ (void)unused;
+ if (pVAxis)
{
- if(pVAxis->getDimensionCount()==2)
- pVAxis->setTransformationSceneToScreen( m_aMatrixSceneToScreen );
+ if (pVAxis->getDimensionCount() == 2)
+ pVAxis->setTransformationSceneToScreen(m_aMatrixSceneToScreen);
pVAxis->createMaximumLabels();
}
}
}
void VCoordinateSystem::createAxesLabels()
{
- for (auto const& elem : m_aAxisMap)
+ for (auto const&[unused, pVAxis] : m_aAxisMap)
{
- VAxisBase* pVAxis = elem.second.get();
- if( pVAxis )
+ (void)unused;
+ if (pVAxis)
{
- if(pVAxis->getDimensionCount()==2)
- pVAxis->setTransformationSceneToScreen( m_aMatrixSceneToScreen );
+ if (pVAxis->getDimensionCount() == 2)
+ pVAxis->setTransformationSceneToScreen(m_aMatrixSceneToScreen);
pVAxis->createLabels();
}
}
@@ -461,12 +477,12 @@ void VCoordinateSystem::createAxesLabels()
void VCoordinateSystem::updatePositions()
{
- for (auto const& elem : m_aAxisMap)
+ for (auto const&[unused, pVAxis] : m_aAxisMap)
{
- VAxisBase* pVAxis = elem.second.get();
- if( pVAxis )
+ (void)unused;
+ if (pVAxis)
{
- if(pVAxis->getDimensionCount()==2)
+ if (pVAxis->getDimensionCount() == 2)
pVAxis->setTransformationSceneToScreen( m_aMatrixSceneToScreen );
pVAxis->updatePositions();
}
@@ -475,24 +491,24 @@ void VCoordinateSystem::updatePositions()
void VCoordinateSystem::createAxesShapes()
{
- for (auto const& elem : m_aAxisMap)
+ for (auto const&[aFullAxisIndex, pVAxis] : m_aAxisMap)
{
- VAxisBase* pVAxis = elem.second.get();
- if( pVAxis )
+ if (pVAxis)
{
- if(pVAxis->getDimensionCount()==2)
+ auto const&[nDimensionIndex, nAxisIndex] = aFullAxisIndex;
+
+ if (pVAxis->getDimensionCount() == 2)
pVAxis->setTransformationSceneToScreen( m_aMatrixSceneToScreen );
- tFullAxisIndex aFullAxisIndex = elem.first;
- if( aFullAxisIndex.second == 0 )
+ if (nAxisIndex == 0)
{
- if( aFullAxisIndex.first == 0 )
+ if (nDimensionIndex == 0)
{
if( m_aExplicitScales[1].AxisType!=AxisType::CATEGORY )
pVAxis->setExtraLinePositionAtOtherAxis(
m_aExplicitScales[1].Origin );
}
- else if( aFullAxisIndex.first == 1 )
+ else if (nDimensionIndex == 1)
{
if( m_aExplicitScales[0].AxisType!=AxisType::CATEGORY )
pVAxis->setExtraLinePositionAtOtherAxis(
@@ -527,7 +543,7 @@ bool VCoordinateSystem::getPropertySwapXAndYAxis() const
bool bSwapXAndY = false;
if( m_xCooSysModel.is()) try
{
- m_xCooSysModel->getPropertyValue( "SwapXAndYAxis" ) >>= bSwapXAndY;
+ m_xCooSysModel->getPropertyValue( u"SwapXAndYAxis"_ustr ) >>= bSwapXAndY;
}
catch( const uno::Exception& )
{
@@ -546,10 +562,10 @@ void VCoordinateSystem::setSeriesNamesForAxis( const Sequence< OUString >& rSeri
}
sal_Int32 VCoordinateSystem::getNumberFormatKeyForAxis(
- const Reference< chart2::XAxis >& xAxis
- , const Reference<chart2::XChartDocument>& xChartDoc)
+ const rtl::Reference< Axis >& xAxis
+ , const rtl::Reference<::chart::ChartModel>& xChartDoc)
{
- return ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
+ return ChartView::getExplicitNumberFormatKeyForAxis(
xAxis, m_xCooSysModel, xChartDoc);
}
diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx
index fad802e107a8..91fec413dbcc 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.cxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.cxx
@@ -22,10 +22,10 @@
#include "VPolarAngleAxis.hxx"
#include "VPolarGrid.hxx"
#include <ShapeFactory.hxx>
+#include <Axis.hxx>
#include <NumberFormatterWrapper.hxx>
#include <PolarLabelPositionHelper.hxx>
#include <PlottingPositionHelper.hxx>
-#include <com/sun/star/chart2/XAxis.hpp>
#include <tools/color.hxx>
#include <memory>
@@ -33,7 +33,6 @@
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
VPolarAngleAxis::VPolarAngleAxis( const AxisProperties& rAxisProperties
, const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
@@ -54,13 +53,13 @@ void VPolarAngleAxis::createTextShapes_ForAngleAxis(
, double fLogicZ )
{
FixedNumberFormatter aFixedNumberFormatter(
- m_xNumberFormatsSupplier, rAxisLabelProperties.nNumberFormatKey );
+ m_xNumberFormatsSupplier, rAxisLabelProperties.m_nNumberFormatKey );
//prepare text properties for multipropertyset-interface of shape
tNameSequence aPropNames;
tAnySequence aPropValues;
- uno::Reference< beans::XPropertySet > xProps( m_aAxisProperties.m_xAxisModel, uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xProps( m_aAxisProperties.m_xAxisModel );
PropertyMapper::getTextLabelMultiPropertyLists( xProps, aPropNames, aPropValues, false, -1, false, false );
LabelPositionHelper::doDynamicFontResize( aPropValues, aPropNames, xProps
, rAxisLabelProperties.m_aFontReferenceSize );
@@ -80,7 +79,7 @@ void VPolarAngleAxis::createTextShapes_ForAngleAxis(
; pTickInfo = rTickIter.nextInfo(), nTick++ )
{
//don't create labels which does not fit into the rhythm
- if( nTick%rAxisLabelProperties.nRhythm != 0)
+ if( nTick%rAxisLabelProperties.m_nRhythm != 0)
continue;
//don't create labels for invisible ticks
@@ -113,17 +112,17 @@ void VPolarAngleAxis::createTextShapes_ForAngleAxis(
double fLogicAngle = pTickInfo->getUnscaledTickValue();
LabelAlignment eLabelAlignment(LABEL_ALIGN_CENTER);
- PolarLabelPositionHelper aPolarLabelPositionHelper(m_pPosHelper.get(), 2/*nDimensionCount*/, xTarget);
+ PolarLabelPositionHelper aPolarLabelPositionHelper(&m_aPosHelper, 2/*nDimensionCount*/, xTarget);
sal_Int32 nScreenValueOffsetInRadiusDirection = m_aAxisLabelProperties.m_aMaximumSpaceForLabels.Height/15;
awt::Point aAnchorScreenPosition2D( aPolarLabelPositionHelper.getLabelScreenPositionAndAlignmentForLogicValues(
eLabelAlignment, fLogicAngle, fLogicRadius, fLogicZ, nScreenValueOffsetInRadiusDirection ));
LabelPositionHelper::changeTextAdjustment( aPropValues, aPropNames, eLabelAlignment );
// #i78696# use mathematically correct rotation now
- const double fRotationAnglePi(-basegfx::deg2rad(rAxisLabelProperties.fRotationAngleDegree));
+ const double fRotationAnglePi(-basegfx::deg2rad(rAxisLabelProperties.m_fRotationAngleDegree));
uno::Any aATransformation = ShapeFactory::makeTransformation( aAnchorScreenPosition2D, fRotationAnglePi );
- OUString aStackedLabel = ShapeFactory::getStackedString( aLabel, rAxisLabelProperties.bStackCharacters );
+ OUString aStackedLabel = ShapeFactory::getStackedString( aLabel, rAxisLabelProperties.m_bStackCharacters );
pTickInfo->xTextShape = ShapeFactory::createText( xTarget, aStackedLabel, aPropNames, aPropValues, aATransformation );
}
@@ -156,7 +155,7 @@ void VPolarAngleAxis::createLabels()
if( !prepareShapeCreation() )
return;
- double fLogicRadius = m_pPosHelper->getOuterLogicRadius();
+ double fLogicRadius = m_aPosHelper.getOuterLogicRadius();
if( !m_aAxisProperties.m_bDisplayLabels )
return;
@@ -170,7 +169,7 @@ void VPolarAngleAxis::createLabels()
removeTextShapesFromTicks();
AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties );
- aAxisLabelProperties.bOverlapAllowed = true;
+ aAxisLabelProperties.m_bOverlapAllowed = true;
double const fLogicZ = 1.0;//as defined
createTextShapes_ForAngleAxis( m_xTextTarget, aTickIter
, aAxisLabelProperties
@@ -185,16 +184,16 @@ void VPolarAngleAxis::createShapes()
if( !prepareShapeCreation() )
return;
- double fLogicRadius = m_pPosHelper->getOuterLogicRadius();
+ double fLogicRadius = m_aPosHelper.getOuterLogicRadius();
double const fLogicZ = 1.0;//as defined
//create axis main lines
drawing::PointSequenceSequence aPoints(1);
- VPolarGrid::createLinePointSequence_ForAngleAxis( aPoints, m_aAllTickInfos, m_aIncrement, m_aScale, m_pPosHelper.get(), fLogicRadius, fLogicZ );
+ VPolarGrid::createLinePointSequence_ForAngleAxis( aPoints, m_aAllTickInfos, m_aIncrement, m_aScale, &m_aPosHelper, fLogicRadius, fLogicZ );
rtl::Reference<SvxShapePolyPolygon> xShape = ShapeFactory::createLine2D(
m_xGroupShape_Shapes, aPoints, &m_aAxisProperties.m_aLineProperties );
//because of this name this line will be used for marking the axis
- ::chart::ShapeFactory::setShapeName( xShape, "MarkHandles" );
+ ::chart::ShapeFactory::setShapeName( xShape, u"MarkHandles"_ustr );
//create labels
createLabels();
diff --git a/chart2/source/view/axes/VPolarAxis.cxx b/chart2/source/view/axes/VPolarAxis.cxx
index d9dfe08ec6f5..89f65fee3745 100644
--- a/chart2/source/view/axes/VPolarAxis.cxx
+++ b/chart2/source/view/axes/VPolarAxis.cxx
@@ -25,7 +25,6 @@
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
std::shared_ptr<VPolarAxis> VPolarAxis::createAxis( const AxisProperties& rAxisProperties
, const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
@@ -40,9 +39,8 @@ VPolarAxis::VPolarAxis( const AxisProperties& rAxisProperties
, const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
, sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount )
: VAxisBase( nDimensionIndex, nDimensionCount, rAxisProperties, xNumberFormatsSupplier )
- , m_pPosHelper( new PolarPlottingPositionHelper() )
{
- PlotterBase::m_pPosHelper = m_pPosHelper.get();
+ PlotterBase::m_pPosHelper = &m_aPosHelper;
}
VPolarAxis::~VPolarAxis()
diff --git a/chart2/source/view/axes/VPolarAxis.hxx b/chart2/source/view/axes/VPolarAxis.hxx
index 42e22ae7dfe9..dc6233a71e02 100644
--- a/chart2/source/view/axes/VPolarAxis.hxx
+++ b/chart2/source/view/axes/VPolarAxis.hxx
@@ -19,13 +19,12 @@
#pragma once
#include "VAxisBase.hxx"
+#include <PlottingPositionHelper.hxx>
#include <memory>
namespace chart
{
-class PolarPlottingPositionHelper;
-
class VPolarAxis : public VAxisBase
{
public:
@@ -45,7 +44,7 @@ protected:
, sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount );
protected: //member
- std::unique_ptr<PolarPlottingPositionHelper> m_pPosHelper;
+ PolarPlottingPositionHelper m_aPosHelper;
std::vector< ExplicitIncrementData > m_aIncrements;
};
diff --git a/chart2/source/view/axes/VPolarCoordinateSystem.cxx b/chart2/source/view/axes/VPolarCoordinateSystem.cxx
index 5bc585097b77..99cb69430703 100644
--- a/chart2/source/view/axes/VPolarCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VPolarCoordinateSystem.cxx
@@ -22,14 +22,16 @@
#include "VPolarAxis.hxx"
#include <BaseCoordinateSystem.hxx>
#include <AxisIndexDefines.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
+#include <Diagram.hxx>
+#include <DataTable.hxx>
#include <ChartModel.hxx>
-#include <com/sun/star/chart2/XCoordinateSystem.hpp>
+#include <GridProperties.hxx>
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
VPolarCoordinateSystem::VPolarCoordinateSystem( const rtl::Reference< BaseCoordinateSystem >& xCooSys )
@@ -66,16 +68,17 @@ uno::Sequence< sal_Int32 > VPolarCoordinateSystem::getCoordinateSystemResolution
}
void VPolarCoordinateSystem::createVAxisList(
- const uno::Reference<chart2::XChartDocument> & xChartDoc
- , const awt::Size& rFontReferenceSize
- , const awt::Rectangle& rMaximumSpaceForLabels
- , bool //bLimitSpaceForLabels
- )
+ const rtl::Reference<::chart::ChartModel> & xChartDoc,
+ const awt::Size& rFontReferenceSize,
+ const awt::Rectangle& rMaximumSpaceForLabels,
+ bool /*bLimitSpaceForLabels*/,
+ std::vector<std::unique_ptr<VSeriesPlotter>>& /*rSeriesPlotterList*/,
+ css::uno::Reference<css::uno::XComponentContext> const& /*rComponentContext*/)
{
// note: using xChartDoc itself as XNumberFormatsSupplier would cause
// a leak from VPolarAxis due to cyclic reference
uno::Reference<util::XNumberFormatsSupplier> const xNumberFormatsSupplier(
- dynamic_cast<ChartModel&>(*xChartDoc).getNumberFormatsSupplier());
+ xChartDoc->getNumberFormatsSupplier());
m_aAxisMap.clear();
sal_Int32 nDimensionCount = m_xCooSysModel->getDimension();
@@ -87,10 +90,12 @@ void VPolarCoordinateSystem::createVAxisList(
sal_Int32 nMaxAxisIndex = m_xCooSysModel->getMaximumAxisIndexByDimension(nDimensionIndex);
for( sal_Int32 nAxisIndex = 0; nAxisIndex <= nMaxAxisIndex; nAxisIndex++ )
{
- Reference< XAxis > xAxis( getAxisByDimension(nDimensionIndex,nAxisIndex) );
+ rtl::Reference< Axis > xAxis = getAxisByDimension(nDimensionIndex,nAxisIndex);
if(!xAxis.is() || !AxisHelper::shouldAxisBeDisplayed( xAxis, m_xCooSysModel ))
continue;
- AxisProperties aAxisProperties(xAxis,getExplicitCategoriesProvider());
+
+ rtl::Reference<Diagram> xDiagram(xChartDoc->getFirstChartDiagram());
+ AxisProperties aAxisProperties(xAxis, &m_xCooSysModel->getExplicitCategoriesProvider(*xChartDoc), xDiagram->getDataTableRef());
aAxisProperties.init();
if(aAxisProperties.m_bDisplayLabels)
aAxisProperties.m_nNumberFormatKey = getNumberFormatKeyForAxis(xAxis, xChartDoc);
@@ -170,7 +175,7 @@ void VPolarCoordinateSystem::createGridShapes()
{
sal_Int32 nAxisIndex = MAIN_AXIS_INDEX;
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, nAxisIndex, m_xCooSysModel ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDimensionIndex, nAxisIndex, m_xCooSysModel );
if(!xAxis.is() || !AxisHelper::shouldAxisBeDisplayed( xAxis, m_xCooSysModel ))
continue;
diff --git a/chart2/source/view/axes/VPolarCoordinateSystem.hxx b/chart2/source/view/axes/VPolarCoordinateSystem.hxx
index 95c1094260c9..a2ea0220f8bc 100644
--- a/chart2/source/view/axes/VPolarCoordinateSystem.hxx
+++ b/chart2/source/view/axes/VPolarCoordinateSystem.hxx
@@ -35,10 +35,12 @@ public:
, const css::awt::Size& rPageResolution ) override;
virtual void createVAxisList(
- const css::uno::Reference< css::chart2::XChartDocument> & xChartDoc
- , const css::awt::Size& rFontReferenceSize
- , const css::awt::Rectangle& rMaximumSpaceForLabels
- , bool bLimitSpaceForLabels ) override;
+ const rtl::Reference<::chart::ChartModel> &ChartDoc,
+ const css::awt::Size& rFontReferenceSize,
+ const css::awt::Rectangle& rMaximumSpaceForLabels,
+ bool bLimitSpaceForLabels,
+ std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext) override;
virtual void initVAxisInList() override;
virtual void updateScalesAndIncrementsOnAxes() override;
diff --git a/chart2/source/view/axes/VPolarGrid.cxx b/chart2/source/view/axes/VPolarGrid.cxx
index f64349d97662..44d4ec1381b6 100644
--- a/chart2/source/view/axes/VPolarGrid.cxx
+++ b/chart2/source/view/axes/VPolarGrid.cxx
@@ -20,6 +20,7 @@
#include "VPolarGrid.hxx"
#include "VCartesianGrid.hxx"
#include "Tickmarks.hxx"
+#include <GridProperties.hxx>
#include <PlottingPositionHelper.hxx>
#include <ShapeFactory.hxx>
#include <ObjectIdentifier.hxx>
@@ -38,12 +39,11 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
VPolarGrid::VPolarGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
- , const uno::Sequence< Reference< beans::XPropertySet > > & rGridPropertiesList )
+ , std::vector< rtl::Reference< ::chart::GridProperties > > aGridPropertiesList )
: VAxisOrGridBase( nDimensionIndex, nDimensionCount )
- , m_aGridPropertiesList( rGridPropertiesList )
- , m_pPosHelper( new PolarPlottingPositionHelper() )
+ , m_aGridPropertiesList( std::move(aGridPropertiesList) )
{
- PlotterBase::m_pPosHelper = m_pPosHelper.get();
+ PlotterBase::m_pPosHelper = &m_aPosHelper;
}
VPolarGrid::~VPolarGrid()
@@ -203,7 +203,7 @@ void VPolarGrid::create2DRadiusGrid( const rtl::Reference<SvxShapeGroupAnyD>& xL
drawing::PointSequenceSequence aPoints(1);
VPolarGrid::createLinePointSequence_ForAngleAxis( aPoints, rAngleTickInfos
- , rAngleIncrement, rAngleScale, m_pPosHelper.get(), fLogicRadius, fLogicZ );
+ , rAngleIncrement, rAngleScale, &m_aPosHelper, fLogicRadius, fLogicZ );
if(aPoints[0].getLength())
appendPointSequence( aAllPoints, aPoints );
}
@@ -211,7 +211,7 @@ void VPolarGrid::create2DRadiusGrid( const rtl::Reference<SvxShapeGroupAnyD>& xL
rtl::Reference<SvxShapePolyPolygon> xShape = ShapeFactory::createLine2D(
xTarget, aAllPoints, &rLinePropertiesList[nDepth] );
//because of this name this line will be used for marking
- ::chart::ShapeFactory::setShapeName( xShape, "MarkHandles" );
+ ::chart::ShapeFactory::setShapeName( xShape, u"MarkHandles"_ustr );
}
}
@@ -220,7 +220,7 @@ void VPolarGrid::createShapes()
OSL_PRECOND(m_xLogicTarget.is()&&m_xFinalTarget.is(),"Axis is not proper initialized");
if(!(m_xLogicTarget.is()&&m_xFinalTarget.is()))
return;
- if(!m_aGridPropertiesList.hasElements())
+ if(m_aGridPropertiesList.empty())
return;
//create all scaled tickmark values
diff --git a/chart2/source/view/axes/VPolarGrid.hxx b/chart2/source/view/axes/VPolarGrid.hxx
index c5a9df7bb6e9..5c0a21bb4733 100644
--- a/chart2/source/view/axes/VPolarGrid.hxx
+++ b/chart2/source/view/axes/VPolarGrid.hxx
@@ -20,6 +20,7 @@
#include "VAxisOrGridBase.hxx"
#include "Tickmarks.hxx"
+#include <PlottingPositionHelper.hxx>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <memory>
@@ -27,16 +28,15 @@ namespace chart { struct VLineProperties; }
namespace chart
{
-
-class PolarPlottingPositionHelper;
+class GridProperties;
class VPolarGrid : public VAxisOrGridBase
{
// public methods
public:
VPolarGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
- , const css::uno::Sequence<
- css::uno::Reference< css::beans::XPropertySet > > & rGridPropertiesList //main grid, subgrid, subsubgrid etc
+ , std::vector<
+ rtl::Reference< ::chart::GridProperties > > aGridPropertiesList //main grid, subgrid, subsubgrid etc
);
virtual ~VPolarGrid() override;
@@ -53,9 +53,9 @@ public:
, double fLogicRadius, double fLogicZ );
private: //member
- css::uno::Sequence<
- css::uno::Reference< css::beans::XPropertySet > > m_aGridPropertiesList;//main grid, subgrid, subsubgrid etc
- std::unique_ptr<PolarPlottingPositionHelper> m_pPosHelper;
+ std::vector<
+ rtl::Reference< ::chart::GridProperties > > m_aGridPropertiesList;//main grid, subgrid, subsubgrid etc
+ PolarPlottingPositionHelper m_aPosHelper;
std::vector< ExplicitIncrementData > m_aIncrements;
void getAllTickInfos( sal_Int32 nDimensionIndex, TickInfoArraysType& rAllTickInfos ) const;
diff --git a/chart2/source/view/axes/VPolarRadiusAxis.cxx b/chart2/source/view/axes/VPolarRadiusAxis.cxx
index 73e153705db6..f93315410e96 100644
--- a/chart2/source/view/axes/VPolarRadiusAxis.cxx
+++ b/chart2/source/view/axes/VPolarRadiusAxis.cxx
@@ -20,6 +20,7 @@
#include "VPolarRadiusAxis.hxx"
#include "VCartesianAxis.hxx"
#include <PlottingPositionHelper.hxx>
+#include <Axis.hxx>
#include <CommonConverters.hxx>
#include "Tickmarks_Equidistant.hxx"
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index e5409ce5dff1..65b3c8721f5f 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -24,25 +24,25 @@
#include <ExplicitCategoriesProvider.hxx>
#include <ObjectIdentifier.hxx>
#include "Splines.hxx"
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <LabelPositionHelper.hxx>
#include <Clipping.hxx>
#include <Stripe.hxx>
#include <DateHelper.hxx>
#include <unonames.hxx>
-#include <ConfigAccess.hxx>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <sal/log.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
-#include <com/sun/star/drawing/DoubleSequence.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <officecfg/Office/Compatibility.hxx>
+#include <officecfg/Office/Chart.hxx>
#include <limits>
@@ -51,33 +51,32 @@ namespace chart
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
+AreaChart::AreaChart( const rtl::Reference<ChartType>& xChartTypeModel
, sal_Int32 nDimensionCount
, bool bCategoryXAxis
, bool bNoArea
)
: VSeriesPlotter( xChartTypeModel, nDimensionCount, bCategoryXAxis )
- , m_pMainPosHelper(new PlottingPositionHelper())
, m_bArea(!bNoArea)
, m_bLine(bNoArea)
- , m_bSymbol( ChartTypeHelper::isSupportingSymbolProperties(xChartTypeModel,nDimensionCount) )
+ , m_bSymbol(xChartTypeModel.is() ? xChartTypeModel->isSupportingSymbolProperties(nDimensionCount) : false)
, m_eCurveStyle(CurveStyle_LINES)
, m_nCurveResolution(20)
, m_nSplineOrder(3)
{
+ PlotterBase::m_pPosHelper = &m_aMainPosHelper;
+ VSeriesPlotter::m_pMainPosHelper = &m_aMainPosHelper;
+
m_pMainPosHelper->AllowShiftXAxisPos(true);
m_pMainPosHelper->AllowShiftZAxisPos(true);
- PlotterBase::m_pPosHelper = m_pMainPosHelper.get();
- VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper.get();
-
try
{
- if( m_xChartTypeModelProps.is() )
+ if( m_xChartTypeModel.is() )
{
- m_xChartTypeModelProps->getPropertyValue(CHART_UNONAME_CURVE_STYLE) >>= m_eCurveStyle;
- m_xChartTypeModelProps->getPropertyValue(CHART_UNONAME_CURVE_RESOLUTION) >>= m_nCurveResolution;
- m_xChartTypeModelProps->getPropertyValue(CHART_UNONAME_SPLINE_ORDER) >>= m_nSplineOrder;
+ m_xChartTypeModel->getPropertyValue(CHART_UNONAME_CURVE_STYLE) >>= m_eCurveStyle;
+ m_xChartTypeModel->getPropertyValue(CHART_UNONAME_CURVE_RESOLUTION) >>= m_nCurveResolution;
+ m_xChartTypeModel->getPropertyValue(CHART_UNONAME_SPLINE_ORDER) >>= m_nSplineOrder;
}
}
catch( uno::Exception& e )
@@ -395,7 +394,7 @@ bool AreaChart::impl_createLine( VDataSeries* pSeries
, pSeries->getPropertiesOfSeries()
, PropertyMapper::getPropertyNameMapForLineSeriesProperties() );
//because of this name this line will be used for marking
- ::chart::ShapeFactory::setShapeName(xShape, "MarkHandles");
+ ::chart::ShapeFactory::setShapeName(xShape, u"MarkHandles"_ustr);
}
return true;
}
@@ -446,7 +445,7 @@ bool AreaChart::impl_createArea( VDataSeries* pSeries
std::vector<std::vector<css::drawing::Position3D>> aClippedPoly;
Clipping::clipPolygonAtRectangle( aPoly, pPosHelper->getScaledLogicClipDoubleRect(), aClippedPoly, false );
ShapeFactory::closePolygon(aClippedPoly); //again necessary after clipping
- aPoly = aClippedPoly;
+ aPoly = std::move(aClippedPoly);
}
if(!ShapeFactory::hasPolygonAnyLines(aPoly))
@@ -456,26 +455,22 @@ bool AreaChart::impl_createArea( VDataSeries* pSeries
pPosHelper->transformScaledLogicToScene( aPoly );
//create area:
+ rtl::Reference< SvxShape > xShape;
if(m_nDimension==3)
{
- rtl::Reference< SvxShape > xShape = ShapeFactory::createArea3D( xSeriesGroupShape_Shapes
+ xShape = ShapeFactory::createArea3D( xSeriesGroupShape_Shapes
, aPoly, getTransformedDepth() );
- PropertyMapper::setMappedProperties( *xShape
- , pSeries->getPropertiesOfSeries()
- , PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
- //because of this name this line will be used for marking
- ShapeFactory::setShapeName(xShape, "MarkHandles");
}
else //m_nDimension!=3
{
- SdrPathObj* pShape = ShapeFactory::createArea2D( xSeriesGroupShape_Shapes
+ xShape = ShapeFactory::createArea2D( xSeriesGroupShape_Shapes
, aPoly );
- PropertyMapper::setPropertyNameMapForFilledSeriesProperties(
- pShape
- , pSeries->getPropertiesOfSeries());
- //because of this name this line will be used for marking
- ShapeFactory::setShapeName(pShape, "MarkHandles");
}
+ PropertyMapper::setMappedProperties( *xShape
+ , pSeries->getPropertiesOfSeries()
+ , PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
+ //because of this name this line will be used for marking
+ ::chart::ShapeFactory::setShapeName(xShape, u"MarkHandles"_ustr);
return true;
}
@@ -609,7 +604,8 @@ void AreaChart::createShapes()
bool bDateCategory = (m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis());
- std::vector<std::map< sal_Int32, double > > aLogicYSumMapByX(nEndIndex);//one for each different nAttachedAxisIndex
+ // indexed by {nIndex, nAttachedAxisIndex}
+ std::map< std::pair<sal_Int32, sal_Int32>, double > aLogicYSumMapByX;
for( auto const& rZSlot : m_aZSlots )
{
//iterate through all x slots in this category to get 100percent sum
@@ -623,22 +619,19 @@ void AreaChart::createShapes()
if (bDateCategory)
pSeries->doSortByXValues();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
- std::map< sal_Int32, double >& rLogicYSumMap = aLogicYSumMapByX[nIndex];
- sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
- rLogicYSumMap.insert({nAttachedAxisIndex, 0.0});
-
- m_pPosHelper = &getPlottingPositionHelper(nAttachedAxisIndex);
-
double fAdd = pSeries->getYValue( nIndex );
if( !std::isnan(fAdd) && !std::isinf(fAdd) )
- rLogicYSumMap[nAttachedAxisIndex] += fabs( fAdd );
+ aLogicYSumMapByX[ {nIndex, nAttachedAxisIndex} ] += fabs( fAdd );
}
}
}
}
+ const bool bUseErrorRectangle = officecfg::Office::Chart::ErrorProperties::ErrorRectangle::get();
+
sal_Int32 nZ=1;
for( auto const& rZSlot : m_aZSlots )
{
@@ -689,11 +682,12 @@ void AreaChart::createShapes()
fLogicY = fabs( fLogicY );
double fLogicValueForLabeDisplay = fLogicY;
- std::map< sal_Int32, double >& rLogicYSumMap = aLogicYSumMapByX[nIndex];
- if (rPosHelper.isPercentY() && rLogicYSumMap[nAttachedAxisIndex] != 0.0)
- {
- fLogicY = fabs( fLogicY )/rLogicYSumMap[nAttachedAxisIndex];
- }
+ double fLogicSumForX = 0.0;
+ auto it = aLogicYSumMapByX.find({nIndex, nAttachedAxisIndex});
+ if (it != aLogicYSumMapByX.end())
+ fLogicSumForX = it->second;
+ if (rPosHelper.isPercentY() && fLogicSumForX != 0.0)
+ fLogicY = fabs( fLogicY ) / fLogicSumForX;
if( std::isnan(fLogicX) || std::isinf(fLogicX)
|| std::isnan(fLogicY) || std::isinf(fLogicY)
@@ -703,7 +697,7 @@ void AreaChart::createShapes()
{
std::vector<std::vector<css::drawing::Position3D>>& rPolygon = pSeries->m_aPolyPolygonShape3D;
sal_Int32& rIndex = pSeries->m_nPolygonIndex;
- if( 0<= rIndex && rIndex < static_cast<sal_Int32>(rPolygon.size()) )
+ if( 0<= rIndex && o3tl::make_unsigned(rIndex) < rPolygon.size() )
{
if( !rPolygon[ rIndex ].empty() )
rIndex++; //start a new polygon for the next point if the current poly is not empty
@@ -774,8 +768,8 @@ void AreaChart::createShapes()
{
bool bShowPositive = false;
bool bShowNegative = false;
- xErrorBarProp->getPropertyValue("ShowPositiveError") >>= bShowPositive;
- xErrorBarProp->getPropertyValue("ShowNegativeError") >>= bShowNegative;
+ xErrorBarProp->getPropertyValue(u"ShowPositiveError"_ustr) >>= bShowPositive;
+ xErrorBarProp->getPropertyValue(u"ShowNegativeError"_ustr) >>= bShowNegative;
bCreateYErrorBar = bShowPositive || bShowNegative;
}
@@ -784,8 +778,8 @@ void AreaChart::createShapes()
{
bool bShowPositive = false;
bool bShowNegative = false;
- xErrorBarProp->getPropertyValue("ShowPositiveError") >>= bShowPositive;
- xErrorBarProp->getPropertyValue("ShowNegativeError") >>= bShowNegative;
+ xErrorBarProp->getPropertyValue(u"ShowPositiveError"_ustr) >>= bShowPositive;
+ xErrorBarProp->getPropertyValue(u"ShowNegativeError"_ustr) >>= bShowNegative;
bCreateXErrorBar = bShowPositive || bShowNegative;
}
}
@@ -797,13 +791,6 @@ void AreaChart::createShapes()
!bCreateXErrorBar && !pSeries->getDataPointLabelIfLabel(nIndex) )
continue;
- //create a group shape for this point and add to the series shape:
- OUString aPointCID = ObjectIdentifier::createPointCID(
- pSeries->getPointCID_Stub(), nIndex );
- rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes(
- createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
- uno::Reference<drawing::XShape> xPointGroupShape_Shape( static_cast<cppu::OWeakObject*>(xPointGroupShape_Shapes.get()), uno::UNO_QUERY );
-
{
nCreatedPoints++;
@@ -813,6 +800,13 @@ void AreaChart::createShapes()
{
if(m_nDimension!=3)
{
+ //create a group shape for this point and add to the series shape:
+ OUString aPointCID = ObjectIdentifier::createPointCID(
+ pSeries->getPointCID_Stub(), nIndex );
+ rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes;
+ if (pSymbolProperties->Style == SymbolStyle_STANDARD || pSymbolProperties->Style == SymbolStyle_GRAPHIC)
+ xPointGroupShape_Shapes = createGroupShape(xSeriesGroupShape_Shapes,aPointCID);
+
if (pSymbolProperties->Style != SymbolStyle_NONE)
{
aSymbolSize.DirectionX = pSymbolProperties->Size.Width;
@@ -837,7 +831,7 @@ void AreaChart::createShapes()
}
}
//create error bars or rectangles, depending on configuration
- if ( ConfigAccess::getUseErrorRectangle() )
+ if ( bUseErrorRectangle )
{
if ( bCreateXErrorBar || bCreateYErrorBar )
{
@@ -918,13 +912,9 @@ void AreaChart::createShapes()
createDataLabel( m_xTextTarget, *pSeries, nIndex
, fLogicValueForLabeDisplay
- , rLogicYSumMap[nAttachedAxisIndex], aScreenPosition2D, eAlignment, nOffset );
+ , fLogicSumForX, aScreenPosition2D, eAlignment, nOffset );
}
}
-
- //remove PointGroupShape if empty
- if(!xPointGroupShape_Shapes->getCount())
- xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape);
}
}//next series in x slot (next y slot)
diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx
index 23d8adb0b4f1..411b9d6642aa 100644
--- a/chart2/source/view/charttypes/AreaChart.hxx
+++ b/chart2/source/view/charttypes/AreaChart.hxx
@@ -21,6 +21,7 @@
#include <memory>
#include <VSeriesPlotter.hxx>
+#include <PlottingPositionHelper.hxx>
#include <com/sun/star/chart2/CurveStyle.hpp>
namespace chart
@@ -32,7 +33,7 @@ class AreaChart : public VSeriesPlotter
public:
AreaChart() = delete;
- AreaChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ AreaChart( const rtl::Reference< ::chart::ChartType >& xChartTypeModel
, sal_Int32 nDimensionCount
, bool bCategoryXAxis, bool bNoArea=false
);
@@ -64,8 +65,7 @@ private: //methods
, std::vector<std::vector<css::drawing::Position3D>> &aPoly );
private: //member
- std::unique_ptr<PlottingPositionHelper>
- m_pMainPosHelper;
+ PlottingPositionHelper m_aMainPosHelper;
bool m_bArea;//false -> line or symbol only
bool m_bLine;
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 938355192e35..38a497707d22 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -20,6 +20,7 @@
#include "BarChart.hxx"
#include "BarPositionHelper.hxx"
+#include <ChartType.hxx>
#include <ShapeFactory.hxx>
#include <CommonConverters.hxx>
#include <ObjectIdentifier.hxx>
@@ -34,9 +35,7 @@
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <rtl/math.hxx>
-#include <sal/log.hxx>
-#include <tools/diagnose_ex.h>
-#include <unordered_set>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -44,20 +43,19 @@ using namespace ::com::sun::star;
using namespace ::rtl::math;
using namespace ::com::sun::star::chart2;
-BarChart::BarChart( const uno::Reference<XChartType>& xChartTypeModel
+BarChart::BarChart( const rtl::Reference<ChartType>& xChartTypeModel
, sal_Int32 nDimensionCount )
: VSeriesPlotter( xChartTypeModel, nDimensionCount )
- , m_pMainPosHelper( new BarPositionHelper() )
{
- PlotterBase::m_pPosHelper = m_pMainPosHelper.get();
- VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper.get();
+ PlotterBase::m_pPosHelper = &m_aMainPosHelper;
+ VSeriesPlotter::m_pMainPosHelper = &m_aMainPosHelper;
try
{
- if( m_xChartTypeModelProps.is() )
+ if( m_xChartTypeModel.is() )
{
- m_xChartTypeModelProps->getPropertyValue( "OverlapSequence" ) >>= m_aOverlapSequence;
- m_xChartTypeModelProps->getPropertyValue( "GapwidthSequence" ) >>= m_aGapwidthSequence;
+ m_xChartTypeModel->getPropertyValue( u"OverlapSequence"_ustr ) >>= m_aOverlapSequence;
+ m_xChartTypeModel->getPropertyValue( u"GapwidthSequence"_ustr ) >>= m_aGapwidthSequence;
}
}
catch( const uno::Exception& )
@@ -124,9 +122,7 @@ drawing::Direction3D BarChart::getPreferredDiagramAspectRatio() const
}
if( m_pMainPosHelper && m_pMainPosHelper->isSwapXAndY() )
{
- double fTemp = aRet.DirectionX;
- aRet.DirectionX = aRet.DirectionY;
- aRet.DirectionY = fTemp;
+ std::swap(aRet.DirectionX, aRet.DirectionY);
}
}
else
@@ -307,7 +303,7 @@ rtl::Reference< SvxShape > BarChart::createDataPoint3D_Bar(
if( xObjectProperties.is() )
{
sal_Int16 nPercentDiagonal = 0;
- xObjectProperties->getPropertyValue( "PercentDiagonal" ) >>= nPercentDiagonal;
+ xObjectProperties->getPropertyValue( u"PercentDiagonal"_ustr ) >>= nPercentDiagonal;
if( nPercentDiagonal < 5 )
bRoundedEdges = false;
}
@@ -450,8 +446,7 @@ void BarChart::createShapes()
for (rtl::Reference<SvxShape> const & rShape : aShapeSet)
{
- E3dScene* pScene = dynamic_cast<E3dScene*>(rShape->GetSdrObject());
- if(nullptr != pScene)
+ if(E3dScene* pScene = DynCastE3dScene(rShape->GetSdrObject()))
{
aSceneSet.insert(pScene->getRootE3dSceneFromE3dObject());
}
@@ -511,14 +506,14 @@ void BarChart::createShapes()
{
for( auto const& rZSlot : m_aZSlots )
{
- BarPositionHelper* pPosHelper = m_pMainPosHelper.get();
+ BarPositionHelper* pPosHelper = &m_aMainPosHelper;
if( !rZSlot.empty() )
{
sal_Int32 nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries();
//2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
if(!pPosHelper)
- pPosHelper = m_pMainPosHelper.get();
+ pPosHelper = &m_aMainPosHelper;
}
PlotterBase::m_pPosHelper = pPosHelper;
@@ -547,8 +542,6 @@ void BarChart::createShapes()
getSeriesGroupShape(pSeries.get(), xSeriesTarget) );
rtl::Reference<SvxShapePolyPolygon> xShape( ShapeFactory::createLine2D(
xSeriesGroupShape_Shapes, aPoly ) );
- PropertyMapper::setMappedProperties( *xShape, pSeries->getPropertiesOfSeries()
- , PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
}
}
}
@@ -562,10 +555,10 @@ void BarChart::doZSlot(
bool& bDrawConnectionLines, bool& bDrawConnectionLinesInited,
const std::vector< VDataSeriesGroup >& rZSlot,
const sal_Int32 nZ, const sal_Int32 nPointIndex, const sal_Int32 nStartIndex,
- rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveEquationTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveEquationTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
std::unordered_set<rtl::Reference<SvxShape>>& aShapeSet,
std::map< VDataSeries*, FormerBarPoint >& aSeriesFormerPointMap,
std::map< sal_Int32, double >& aLogicYSumMap)
@@ -578,7 +571,7 @@ void BarChart::doZSlot(
//2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
BarPositionHelper* pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
if(!pPosHelper)
- pPosHelper = m_pMainPosHelper.get();
+ pPosHelper = &m_aMainPosHelper;
PlotterBase::m_pPosHelper = pPosHelper;
@@ -637,10 +630,10 @@ void BarChart::doXSlot(
const VDataSeriesGroup& rXSlot,
bool& bDrawConnectionLines, bool& bDrawConnectionLinesInited,
const sal_Int32 nZ, const sal_Int32 nPointIndex, const sal_Int32 nStartIndex,
- rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveEquationTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveEquationTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
std::unordered_set<rtl::Reference<SvxShape>>& aShapeSet,
std::map< VDataSeries*, FormerBarPoint >& aSeriesFormerPointMap,
std::map< sal_Int32, double >& aLogicYSumMap,
@@ -661,7 +654,7 @@ void BarChart::doXSlot(
if(!pSeries)
continue;
- bool bHasFillColorMapping = pSeries->hasPropertyMapping("FillColor");
+ bool bHasFillColorMapping = pSeries->hasPropertyMapping(u"FillColor"_ustr);
bool bOnlyConnectionLinesForThisPoint = false;
@@ -691,10 +684,10 @@ void BarChart::doXSlot(
aShapeSet.insert(xSeriesGroupShape_Shapes);
aShapeSet.insert(xSeriesBackgroundShape_Shapes);
// Suspend setting rects dirty for the duration of this call
- E3dScene* pScene = dynamic_cast<E3dScene*>(xSeriesGroupShape_Shapes->GetSdrObject());
+ E3dScene* pScene = DynCastE3dScene(xSeriesGroupShape_Shapes->GetSdrObject());
if (pScene)
pScene->SuspendReportingDirtyRects();
- pScene = dynamic_cast<E3dScene*>(xSeriesBackgroundShape_Shapes->GetSdrObject());
+ pScene = DynCastE3dScene(xSeriesBackgroundShape_Shapes->GetSdrObject());
if (pScene)
pScene->SuspendReportingDirtyRects();
@@ -715,6 +708,27 @@ void BarChart::doXSlot(
if( std::isnan( fLogicBarHeight )) //no value at this category
continue;
+ // Handle "invert negative"
+ {
+ bool bInvertNeg(false);
+ uno::Reference< beans::XPropertySet > xPointProperties = pSeries->getPropertiesOfPoint(nPointIndex);
+
+ // check point properties, and if none then series properties
+ try {
+ xPointProperties->getPropertyValue(u"InvertNegative"_ustr) >>= bInvertNeg;
+ } catch (const uno::Exception&)
+ {
+ uno::Reference< beans::XPropertySet > xSeriesProperties =
+ pSeries->getPropertiesOfSeries();
+ try {
+ xSeriesProperties->getPropertyValue(u"InvertNegative"_ustr) >>= bInvertNeg;
+ } catch (const uno::Exception&)
+ {}
+ }
+
+ if (bInvertNeg) fLogicBarHeight = fabs(fLogicBarHeight);
+ }
+
double fLogicValueForLabeDisplay = fLogicBarHeight;
fLogicBarHeight-=fBaseValue;
@@ -757,7 +771,7 @@ void BarChart::doXSlot(
sal_Int32 nGeometry3D = DataPointGeometry3D::CUBOID;
if(m_nDimension==3) try
{
- xDataPointProperties->getPropertyValue( "Geometry3D") >>= nGeometry3D;
+ xDataPointProperties->getPropertyValue( u"Geometry3D"_ustr) >>= nGeometry3D;
}
catch( const uno::Exception& )
{
@@ -858,6 +872,7 @@ void BarChart::doXSlot(
//create partial point
if( !approxEqual(fLowerYValue,fUpperYValue) )
{
+ rtl::Reference< SvxShape > xShape;
if( m_nDimension==3 )
{
drawing::Position3D aLogicBottom (fLogicX,fLogicYStart,fLogicZ);
@@ -892,54 +907,41 @@ void BarChart::doXSlot(
if( fTopHeight < 0 )
fTopHeight *= -1.0;
- rtl::Reference< SvxShape > xShape = createDataPoint3D_Bar(
+ xShape = createDataPoint3D_Bar(
xSeriesGroupShape_Shapes, aTransformedBottom, aSize, fTopHeight, nRotateZAngleHundredthDegree
, xDataPointProperties, nGeometry3D );
-
- if(bHasFillColorMapping)
- {
- double nPropVal = pSeries->getValueByProperty(nPointIndex, "FillColor");
- if(!std::isnan(nPropVal))
- {
- xShape->setPropertyValue("FillColor", uno::Any(static_cast<sal_Int32>(nPropVal)));
- }
- }
- //set name/classified ObjectID (CID)
- ShapeFactory::setShapeName(xShape
- , ObjectIdentifier::createPointCID(
- pSeries->getPointCID_Stub(),nPointIndex) );
}
else //m_nDimension!=3
{
- // performance improvement: alloc the sequence before the rendering
- // otherwise we have 2 realloc calls
- std::vector<std::vector<css::drawing::Position3D>> aPoly;
- aPoly.resize(1);
drawing::Position3D aLeftUpperPoint( fLogicX-fLogicBarWidth/2.0,fUpperYValue,fLogicZ );
drawing::Position3D aRightUpperPoint( fLogicX+fLogicBarWidth/2.0,fUpperYValue,fLogicZ );
-
- AddPointToPoly( aPoly, drawing::Position3D( fLogicX-fLogicBarWidth/2.0,fLowerYValue,fLogicZ) );
- AddPointToPoly( aPoly, drawing::Position3D( fLogicX+fLogicBarWidth/2.0,fLowerYValue,fLogicZ) );
- AddPointToPoly( aPoly, aRightUpperPoint );
- AddPointToPoly( aPoly, aLeftUpperPoint );
- AddPointToPoly( aPoly, drawing::Position3D( fLogicX-fLogicBarWidth/2.0,fLowerYValue,fLogicZ) );
+ std::vector<std::vector<css::drawing::Position3D>> aPoly
+ {
+ { // inner vector
+ drawing::Position3D( fLogicX-fLogicBarWidth/2.0,fLowerYValue,fLogicZ),
+ drawing::Position3D( fLogicX+fLogicBarWidth/2.0,fLowerYValue,fLogicZ),
+ aRightUpperPoint,
+ aLeftUpperPoint,
+ drawing::Position3D( fLogicX-fLogicBarWidth/2.0,fLowerYValue,fLogicZ)
+ }
+ };
pPosHelper->transformScaledLogicToScene( aPoly );
- std::optional<sal_Int32> xFillColor;
- if(bHasFillColorMapping)
+ xShape = ShapeFactory::createArea2D( xSeriesGroupShape_Shapes, aPoly );
+ PropertyMapper::setMappedProperties( *xShape, xDataPointProperties, PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
+ }
+
+ if(bHasFillColorMapping)
+ {
+ double nPropVal = pSeries->getValueByProperty(nPointIndex, u"FillColor"_ustr);
+ if(!std::isnan(nPropVal))
{
- double nPropVal = pSeries->getValueByProperty(nPointIndex, "FillColor");
- if(!std::isnan(nPropVal))
- xFillColor = static_cast<sal_Int32>(nPropVal);
+ xShape->setPropertyValue(u"FillColor"_ustr, uno::Any(static_cast<sal_Int32>(nPropVal)));
}
- SdrPathObj* pShape = ShapeFactory::createArea2D( xSeriesGroupShape_Shapes, aPoly, /*bSetZOrderToZero*/false );
- PropertyMapper::setPropertyNameMapForFilledSeriesProperties(pShape, xDataPointProperties, xFillColor);
-
- //set name/classified ObjectID (CID)
- ShapeFactory::setShapeName(pShape
- , ObjectIdentifier::createPointCID(
- pSeries->getPointCID_Stub(),nPointIndex) );
}
-
+ //set name/classified ObjectID (CID)
+ ShapeFactory::setShapeName(xShape
+ , ObjectIdentifier::createPointCID(
+ pSeries->getPointCID_Stub(),nPointIndex) );
}
//create error bar
diff --git a/chart2/source/view/charttypes/BarChart.hxx b/chart2/source/view/charttypes/BarChart.hxx
index 5e9ab5e49f48..ff46786afcbb 100644
--- a/chart2/source/view/charttypes/BarChart.hxx
+++ b/chart2/source/view/charttypes/BarChart.hxx
@@ -21,10 +21,10 @@
#include <memory>
#include <VSeriesPlotter.hxx>
+#include "BarPositionHelper.hxx"
namespace chart
{
-class BarPositionHelper;
class BarChart : public VSeriesPlotter
{
@@ -32,7 +32,7 @@ class BarChart : public VSeriesPlotter
public:
BarChart() = delete;
- BarChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ BarChart( const rtl::Reference< ::chart::ChartType >& xChartTypeModel
, sal_Int32 nDimensionCount );
virtual ~BarChart() override;
@@ -84,10 +84,10 @@ private: //methods
void doZSlot(
bool& bDrawConnectionLines, bool& bDrawConnectionLinesInited, const std::vector< VDataSeriesGroup >& rZSlot,
sal_Int32 nZ, sal_Int32 nPointIndex, sal_Int32 nStartIndex,
- rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveEquationTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveEquationTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
std::unordered_set<rtl::Reference<SvxShape>>& aShapeSet,
std::map< VDataSeries*, FormerBarPoint >& aSeriesFormerPointMap,
std::map< sal_Int32, double >& aLogicYSumMap);
@@ -96,10 +96,10 @@ private: //methods
const VDataSeriesGroup& rXSlot,
bool& bDrawConnectionLines, bool& bDrawConnectionLinesInited,
sal_Int32 nZ, sal_Int32 nPointIndex, sal_Int32 nStartIndex,
- rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveEquationTarget,
- rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xRegressionCurveEquationTarget,
+ const rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
std::unordered_set<rtl::Reference<SvxShape>>& aShapeSet,
std::map< VDataSeries*, FormerBarPoint >& aSeriesFormerPointMap,
std::map< sal_Int32, double >& aLogicYSumMap,
@@ -109,7 +109,7 @@ private: //methods
sal_Int32 nAttachedAxisIndex);
private: //member
- std::unique_ptr<BarPositionHelper> m_pMainPosHelper;
+ BarPositionHelper m_aMainPosHelper;
css::uno::Sequence< sal_Int32 > m_aOverlapSequence;
css::uno::Sequence< sal_Int32 > m_aGapwidthSequence;
};
diff --git a/chart2/source/view/charttypes/BarPositionHelper.cxx b/chart2/source/view/charttypes/BarPositionHelper.cxx
index f8ac3e7d62ef..279d998a02e4 100644
--- a/chart2/source/view/charttypes/BarPositionHelper.cxx
+++ b/chart2/source/view/charttypes/BarPositionHelper.cxx
@@ -23,7 +23,6 @@
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
BarPositionHelper::BarPositionHelper()
: CategoryPositionHelper( 1 )
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index fc7fcdd2597b..32593df5d036 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -22,6 +22,7 @@
#include <ShapeFactory.hxx>
#include <ObjectIdentifier.hxx>
#include <LabelPositionHelper.hxx>
+#include <ChartType.hxx>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <sal/log.hxx>
@@ -32,9 +33,8 @@
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
-BubbleChart::BubbleChart( const uno::Reference<XChartType>& xChartTypeModel
+BubbleChart::BubbleChart( const rtl::Reference<ChartType>& xChartTypeModel
, sal_Int32 nDimensionCount )
: VSeriesPlotter( xChartTypeModel, nDimensionCount, false )
, m_fMaxLogicBubbleSize( 0.0 )
@@ -202,8 +202,8 @@ void BubbleChart::createShapes()
if(!pSeries)
continue;
- bool bHasFillColorMapping = pSeries->hasPropertyMapping("FillColor");
- bool bHasBorderColorMapping = pSeries->hasPropertyMapping("LineColor");
+ bool bHasFillColorMapping = pSeries->hasPropertyMapping(u"FillColor"_ustr);
+ bool bHasBorderColorMapping = pSeries->hasPropertyMapping(u"LineColor"_ustr);
rtl::Reference<SvxShapeGroupAnyD> xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries.get(), xSeriesTarget);
@@ -217,8 +217,31 @@ void BubbleChart::createShapes()
double fLogicY = pSeries->getYValue(nIndex);
double fBubbleSize = pSeries->getBubble_Size( nIndex );
- if( fBubbleSize<0.0 )
- continue;
+ bool bInvertNeg(false);
+ uno::Reference< beans::XPropertySet > xPointProperties =
+ pSeries->getPropertiesOfPoint(nIndex);
+
+ // check point properties, and if none then series
+ // properties
+ try {
+ xPointProperties->getPropertyValue(u"InvertNegative"_ustr) >>= bInvertNeg;
+ } catch (const uno::Exception&)
+ {
+ uno::Reference< beans::XPropertySet > xSeriesProperties =
+ pSeries->getPropertiesOfSeries();
+ try {
+ xSeriesProperties->getPropertyValue(u"InvertNegative"_ustr) >>= bInvertNeg;
+ } catch (const uno::Exception&)
+ {}
+ }
+
+ if( fBubbleSize<0.0 ) {
+ if (bInvertNeg) {
+ fBubbleSize = -fBubbleSize;
+ } else {
+ continue;
+ }
+ }
if( fBubbleSize == 0.0 || std::isnan(fBubbleSize) )
continue;
@@ -238,9 +261,15 @@ void BubbleChart::createShapes()
rPosHelper.transformLogicToScene(fLogicX, fLogicY, fLogicZ, false));
//better performance for big data
+ uno::Reference< beans::XPropertySet > xProps(pSeries->getPropertiesOfPoint( nIndex ));
+ sal_Int16 nFillTransparency(0);
+ xProps->getPropertyValue(u"FillTransparence"_ustr) >>= nFillTransparency;
+ const bool bIsTransparent(nFillTransparency != 0);
+
FormerPoint aFormerPoint( aSeriesFormerPointMap[pSeries.get()] );
rPosHelper.setCoordinateSystemResolution(m_aCoordinateSystemResolution);
if (!pSeries->isAttributedDataPoint(nIndex)
+ && !bIsTransparent // don't short-cut if there's transparency
&& rPosHelper.isSameForGivenResolution(
aFormerPoint.m_fX, aFormerPoint.m_fY, aFormerPoint.m_fZ,
aScaledLogicPosition.PositionX, aScaledLogicPosition.PositionY,
@@ -261,7 +290,6 @@ void BubbleChart::createShapes()
pSeries->getPointCID_Stub(), nIndex );
rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes(
createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
- uno::Reference<drawing::XShape> xPointGroupShape_Shape = xPointGroupShape_Shapes;
{
nCreatedPoints++;
@@ -277,22 +305,22 @@ void BubbleChart::createShapes()
if(bHasFillColorMapping)
{
- double nPropVal = pSeries->getValueByProperty(nIndex, "FillColor");
+ double nPropVal = pSeries->getValueByProperty(nIndex, u"FillColor"_ustr);
if(!std::isnan(nPropVal))
{
- xShape->SvxShape::setPropertyValue("FillColor", uno::Any(static_cast<sal_Int32>(nPropVal)));
+ xShape->SvxShape::setPropertyValue(u"FillColor"_ustr, uno::Any(static_cast<sal_Int32>(nPropVal)));
}
}
if(bHasBorderColorMapping)
{
- double nPropVal = pSeries->getValueByProperty(nIndex, "LineColor");
+ double nPropVal = pSeries->getValueByProperty(nIndex, u"LineColor"_ustr);
if(!std::isnan(nPropVal))
{
- xShape->SvxShape::setPropertyValue("LineColor", uno::Any(static_cast<sal_Int32>(nPropVal)));
+ xShape->SvxShape::setPropertyValue(u"LineColor"_ustr, uno::Any(static_cast<sal_Int32>(nPropVal)));
}
}
- ::chart::ShapeFactory::setShapeName( xShape, "MarkHandles" );
+ ::chart::ShapeFactory::setShapeName( xShape, u"MarkHandles"_ustr );
//create data point label
if( pSeries->getDataPointLabelIfLabel(nIndex) )
@@ -345,7 +373,7 @@ void BubbleChart::createShapes()
//remove PointGroupShape if empty
if(!xPointGroupShape_Shapes->getCount())
- xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape);
+ xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shapes);
}//next series in x slot (next y slot)
}//next x slot
diff --git a/chart2/source/view/charttypes/BubbleChart.hxx b/chart2/source/view/charttypes/BubbleChart.hxx
index 06d1d1200340..c25e5b6345bf 100644
--- a/chart2/source/view/charttypes/BubbleChart.hxx
+++ b/chart2/source/view/charttypes/BubbleChart.hxx
@@ -30,7 +30,7 @@ class BubbleChart : public VSeriesPlotter
public:
BubbleChart() = delete;
- BubbleChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ BubbleChart( const rtl::Reference< ::chart::ChartType >& xChartTypeModel
, sal_Int32 nDimensionCount );
virtual ~BubbleChart() override;
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index 44fcd600bd49..d7e338017905 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -18,6 +18,7 @@
*/
#include "CandleStickChart.hxx"
+#include <ChartType.hxx>
#include <ShapeFactory.hxx>
#include <CommonConverters.hxx>
#include <ExplicitCategoriesProvider.hxx>
@@ -25,21 +26,19 @@
#include "BarPositionHelper.hxx"
#include <DateHelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
-CandleStickChart::CandleStickChart( const uno::Reference<XChartType>& xChartTypeModel
+CandleStickChart::CandleStickChart( const rtl::Reference<ChartType>& xChartTypeModel
, sal_Int32 nDimensionCount )
: VSeriesPlotter( xChartTypeModel, nDimensionCount )
- , m_pMainPosHelper( new BarPositionHelper() )
{
- PlotterBase::m_pPosHelper = m_pMainPosHelper.get();
- VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper.get();
+ PlotterBase::m_pPosHelper = &m_aMainPosHelper;
+ VSeriesPlotter::m_pMainPosHelper = &m_aMainPosHelper;
}
CandleStickChart::~CandleStickChart()
@@ -104,15 +103,15 @@ void CandleStickChart::createShapes()
tAnySequence aWhiteBox_Values, aBlackBox_Values;
try
{
- if( m_xChartTypeModelProps.is() )
+ if( m_xChartTypeModel.is() )
{
- m_xChartTypeModelProps->getPropertyValue( "ShowFirst" ) >>= bShowFirst;
+ m_xChartTypeModel->getPropertyValue( u"ShowFirst"_ustr ) >>= bShowFirst;
uno::Reference< beans::XPropertySet > xWhiteDayProps;
uno::Reference< beans::XPropertySet > xBlackDayProps;
- m_xChartTypeModelProps->getPropertyValue( "Japanese" ) >>= bJapaneseStyle;
- m_xChartTypeModelProps->getPropertyValue( "WhiteDay" ) >>= xWhiteDayProps;
- m_xChartTypeModelProps->getPropertyValue( "BlackDay" ) >>= xBlackDayProps;
+ m_xChartTypeModel->getPropertyValue( u"Japanese"_ustr ) >>= bJapaneseStyle;
+ m_xChartTypeModel->getPropertyValue( u"WhiteDay"_ustr ) >>= xWhiteDayProps;
+ m_xChartTypeModel->getPropertyValue( u"BlackDay"_ustr ) >>= xBlackDayProps;
tPropertyNameValueMap aWhiteBox_Map;
PropertyMapper::getValueMap( aWhiteBox_Map, PropertyMapper::getPropertyNameMapForFillAndLineProperties(), xWhiteDayProps );
@@ -136,14 +135,14 @@ void CandleStickChart::createShapes()
{
for( auto const& rZSlot : m_aZSlots )
{
- BarPositionHelper* pPosHelper = m_pMainPosHelper.get();
+ BarPositionHelper* pPosHelper = &m_aMainPosHelper;
if( !rZSlot.empty() )
{
sal_Int32 nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries();
//2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
if(!pPosHelper)
- pPosHelper = m_pMainPosHelper.get();
+ pPosHelper = &m_aMainPosHelper;
}
PlotterBase::m_pPosHelper = pPosHelper;
@@ -200,9 +199,7 @@ void CandleStickChart::createShapes()
drawing::Position3D aPosMiddleMinimum( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Min ,0 ,true ) );
drawing::Position3D aPosMiddleMaximum( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Max ,0 ,true ) );
- rtl::Reference<SvxShapeGroupAnyD> xLossGainTarget( xGainTarget );
- if(bBlack)
- xLossGainTarget = xLossTarget;
+ rtl::Reference<SvxShapeGroupAnyD> xLossGainTarget(bBlack ? xLossTarget : xGainTarget);
uno::Reference< beans::XPropertySet > xPointProp( pSeries->getPropertiesOfPoint( nIndex ));
rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes;
@@ -215,10 +212,10 @@ void CandleStickChart::createShapes()
//create min-max line
if( isValidPosition(aPosMiddleMinimum) && isValidPosition(aPosMiddleMaximum) )
{
- std::vector<std::vector<css::drawing::Position3D>> aPoly;
- sal_Int32 nLineIndex =0;
- AddPointToPoly( aPoly, aPosMiddleMinimum, nLineIndex);
- AddPointToPoly( aPoly, aPosMiddleMaximum, nLineIndex);
+ std::vector<std::vector<css::drawing::Position3D>> aPoly
+ {
+ { aPosMiddleMinimum, aPosMiddleMaximum }
+ };
rtl::Reference<SvxShapePolyPolygon> xShape =
ShapeFactory::createLine2D( xPointGroupShape_Shapes, aPoly);
diff --git a/chart2/source/view/charttypes/CandleStickChart.hxx b/chart2/source/view/charttypes/CandleStickChart.hxx
index eddee6b72e12..3202cf0d7eaf 100644
--- a/chart2/source/view/charttypes/CandleStickChart.hxx
+++ b/chart2/source/view/charttypes/CandleStickChart.hxx
@@ -20,11 +20,11 @@
#pragma once
#include <memory>
+#include "BarPositionHelper.hxx"
#include <VSeriesPlotter.hxx>
namespace chart
{
-class BarPositionHelper;
class CandleStickChart : public VSeriesPlotter
{
@@ -32,7 +32,7 @@ class CandleStickChart : public VSeriesPlotter
public:
CandleStickChart() = delete;
- CandleStickChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ CandleStickChart( const rtl::Reference< ::chart::ChartType >& xChartTypeModel
, sal_Int32 nDimensionCount );
virtual ~CandleStickChart() override;
@@ -47,7 +47,7 @@ public:
virtual LegendSymbolStyle getLegendSymbolStyle() override;
private: //member
- std::unique_ptr<BarPositionHelper> m_pMainPosHelper;
+ BarPositionHelper m_aMainPosHelper;
};
} //namespace chart
diff --git a/chart2/source/view/charttypes/ConfigAccess.cxx b/chart2/source/view/charttypes/ConfigAccess.cxx
deleted file mode 100644
index ce02c4817e0a..000000000000
--- a/chart2/source/view/charttypes/ConfigAccess.cxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- 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 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 .
- */
-
-#include <ConfigAccess.hxx>
-
-#include <unotools/configitem.hxx>
-#include <o3tl/any.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-namespace chart
-{
-using namespace ::com::sun::star;
-
-namespace
-{
-class ChartConfigItem : public ::utl::ConfigItem
-{
-private:
- virtual void ImplCommit() override;
-
-public:
- ChartConfigItem();
-
- bool getUseErrorRectangle();
- virtual void Notify(const uno::Sequence<OUString>& aPropertyNames) override;
-};
-}
-
-ChartConfigItem::ChartConfigItem()
- : ConfigItem("Office.Chart/ErrorProperties")
-{
-}
-
-void ChartConfigItem::ImplCommit() {}
-void ChartConfigItem::Notify(const uno::Sequence<OUString>&) {}
-
-bool ChartConfigItem::getUseErrorRectangle()
-{
- uno::Sequence<OUString> aNames{ "ErrorRectangle" };
-
- auto b = o3tl::tryAccess<bool>(GetProperties(aNames)[0]);
- return b && *b;
-}
-
-namespace ConfigAccess
-{
-bool getUseErrorRectangle()
-{
- //a ChartConfigItem Singleton
- static ChartConfigItem SINGLETON;
- bool bResult(SINGLETON.getUseErrorRectangle());
- return bResult;
-}
-} //namespace ConfigAccess
-
-} //namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/charttypes/HistogramChart.cxx b/chart2/source/view/charttypes/HistogramChart.cxx
new file mode 100644
index 000000000000..3324d61a3f82
--- /dev/null
+++ b/chart2/source/view/charttypes/HistogramChart.cxx
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 "HistogramChart.hxx"
+
+#include <ChartType.hxx>
+#include <../chart2/inc/ChartModel.hxx>
+#include <ShapeFactory.hxx>
+#include <CommonConverters.hxx>
+#include <ObjectIdentifier.hxx>
+#include <LabelPositionHelper.hxx>
+#include <AxisIndexDefines.hxx>
+#include <Clipping.hxx>
+#include <DateHelper.hxx>
+#include <svx/scene3d.hxx>
+#include <comphelper/scopeguard.hxx>
+
+#include <com/sun/star/chart/DataLabelPlacement.hpp>
+
+#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
+#include <rtl/math.hxx>
+#include <comphelper/diagnose_ex.hxx>
+
+namespace chart
+{
+using namespace ::com::sun::star;
+using namespace ::rtl::math;
+using namespace ::com::sun::star::chart2;
+
+HistogramChart::HistogramChart(const rtl::Reference<ChartType>& xChartTypeModel,
+ sal_Int32 nDimensionCount)
+ : BarChart(xChartTypeModel, nDimensionCount)
+{
+ // We only support 2 dimensional histogram charts
+ assert(nDimensionCount == 2 && "HistogramChart only supports 2D charts");
+
+ // Runtime check for all builds
+ if (nDimensionCount != 2)
+ {
+ // Log a warning or throw an exception if appropriate
+ SAL_WARN("chart2", "HistogramChart created with invalid dimension count. Forcing 2D.");
+ }
+
+ PlotterBase::m_pPosHelper = &m_aMainPosHelper;
+ VSeriesPlotter::m_pMainPosHelper = &m_aMainPosHelper;
+
+ try
+ {
+ if (m_xChartTypeModel.is())
+ m_xChartTypeModel->getPropertyValue(u"GapwidthSequence"_ustr) >>= m_aGapwidthSequence;
+ }
+ catch (const uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "");
+ }
+}
+
+HistogramChart::~HistogramChart() {}
+
+css::drawing::Direction3D HistogramChart::getPreferredDiagramAspectRatio() const
+{
+ // Return the preferred aspect ratio for the histogram chart
+ return css::drawing::Direction3D(-1, -1, -1);
+}
+
+PlottingPositionHelper& HistogramChart::getPlottingPositionHelper(sal_Int32 nAxisIndex) const
+{
+ PlottingPositionHelper& rPosHelper = VSeriesPlotter::getPlottingPositionHelper(nAxisIndex);
+ BarPositionHelper* pHistogramPosHelper = dynamic_cast<BarPositionHelper*>(&rPosHelper);
+ if (pHistogramPosHelper && nAxisIndex >= 0)
+ {
+ if (nAxisIndex < m_aGapwidthSequence.getLength())
+ pHistogramPosHelper->setOuterDistance(m_aGapwidthSequence[nAxisIndex] / 100.0);
+ }
+ return rPosHelper;
+}
+
+void HistogramChart::addSeries(std::unique_ptr<VDataSeries> pSeries, sal_Int32 zSlot,
+ sal_Int32 xSlot, sal_Int32 ySlot)
+{
+ if (!pSeries)
+ return;
+
+ if (m_nDimension == 2)
+ {
+ sal_Int32 nAxisIndex = pSeries->getAttachedAxisIndex();
+ zSlot = nAxisIndex;
+
+ if (!pSeries->getGroupBarsPerAxis())
+ zSlot = 0;
+ if (zSlot >= static_cast<sal_Int32>(m_aZSlots.size()))
+ m_aZSlots.resize(zSlot + 1);
+ }
+ VSeriesPlotter::addSeries(std::move(pSeries), zSlot, xSlot, ySlot);
+ adaptGapWidthForHistogram();
+}
+
+void HistogramChart::adaptGapWidthForHistogram()
+{
+ VDataSeries* pFirstSeries = getFirstSeries();
+ if (!pFirstSeries)
+ return;
+
+ sal_Int32 nAxisIndex = pFirstSeries->getAttachedAxisIndex();
+ sal_Int32 nUseThisIndex = nAxisIndex;
+ if (nUseThisIndex < 0 || nUseThisIndex >= m_aGapwidthSequence.getLength())
+ nUseThisIndex = 0;
+
+ auto aGapwidthSequenceRange = asNonConstRange(m_aGapwidthSequence);
+ for (sal_Int32 nN = 0; nN < m_aGapwidthSequence.getLength(); nN++)
+ {
+ aGapwidthSequenceRange[nN] = 0; // Set gap width to 0
+ }
+}
+
+void HistogramChart::createShapes()
+{
+ if (m_aZSlots.empty()) //No data series Available
+ return;
+
+ OSL_ENSURE(
+ m_xLogicTarget.is() && m_xFinalTarget.is(),
+ "HistogramChart is not properly initialized"); // Ensuring chart is properly initialized
+ if (!(m_xLogicTarget.is() && m_xFinalTarget.is()))
+ return;
+
+ adaptGapWidthForHistogram();
+
+ BarChart::createShapes();
+}
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/view/charttypes/HistogramChart.hxx b/chart2/source/view/charttypes/HistogramChart.hxx
new file mode 100644
index 000000000000..907d1e08f45b
--- /dev/null
+++ b/chart2/source/view/charttypes/HistogramChart.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 "BarChart.hxx"
+#include "BarPositionHelper.hxx"
+#include <memory>
+
+namespace chart
+{
+class HistogramChart : public BarChart
+{
+public:
+ HistogramChart() = delete;
+
+ HistogramChart(const rtl::Reference<ChartType>& xChartTypeModel, sal_Int32 nDimensionCount);
+ virtual ~HistogramChart() override;
+
+ virtual void createShapes() override;
+ virtual void addSeries(std::unique_ptr<VDataSeries> pSeries, sal_Int32 zSlot, sal_Int32 xSlot,
+ sal_Int32 ySlot) override;
+
+ virtual css::drawing::Direction3D getPreferredDiagramAspectRatio() const override;
+
+private:
+ virtual PlottingPositionHelper& getPlottingPositionHelper(sal_Int32 nAxisIndex) const override;
+
+ void adaptGapWidthForHistogram();
+
+private:
+ BarPositionHelper m_aMainPosHelper;
+ css::uno::Sequence<sal_Int32> m_aGapwidthSequence;
+};
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx
index 5507e30e0579..3570fe2042a4 100644
--- a/chart2/source/view/charttypes/NetChart.cxx
+++ b/chart2/source/view/charttypes/NetChart.cxx
@@ -27,14 +27,15 @@
#include <Clipping.hxx>
#include <PolarLabelPositionHelper.hxx>
#include <DateHelper.hxx>
+#include <ChartType.hxx>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
-#include <com/sun/star/drawing/XShapes.hpp>
#include <officecfg/Office/Compatibility.hxx>
#include <limits>
@@ -44,7 +45,7 @@ namespace chart
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-NetChart::NetChart( const uno::Reference<XChartType>& xChartTypeModel
+NetChart::NetChart( const rtl::Reference<ChartType>& xChartTypeModel
, sal_Int32 nDimensionCount
, bool bNoArea
, std::unique_ptr<PlottingPositionHelper> pPlottingPositionHelper
@@ -111,7 +112,7 @@ drawing::Direction3D NetChart::getPreferredDiagramAspectRatio() const
}
bool NetChart::impl_createLine( VDataSeries* pSeries
- , std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly
+ , const std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly
, PlottingPositionHelper const * pPosHelper )
{
//return true if a line was created successfully
@@ -157,13 +158,13 @@ bool NetChart::impl_createLine( VDataSeries* pSeries
, pSeries->getPropertiesOfSeries()
, PropertyMapper::getPropertyNameMapForLineSeriesProperties() );
//because of this name this line will be used for marking
- ::chart::ShapeFactory::setShapeName(xShape, "MarkHandles");
+ ::chart::ShapeFactory::setShapeName(xShape, u"MarkHandles"_ustr);
}
return true;
}
bool NetChart::impl_createArea( VDataSeries* pSeries
- , std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly
+ , const std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly
, std::vector<std::vector<css::drawing::Position3D>> const * pPreviousSeriesPoly
, PlottingPositionHelper const * pPosHelper )
{
@@ -211,7 +212,7 @@ bool NetChart::impl_createArea( VDataSeries* pSeries
std::vector<std::vector<css::drawing::Position3D>> aClippedPoly;
Clipping::clipPolygonAtRectangle( aPoly, pPosHelper->getScaledLogicClipDoubleRect(), aClippedPoly, false );
ShapeFactory::closePolygon(aClippedPoly); //again necessary after clipping
- aPoly = aClippedPoly;
+ aPoly = std::move(aClippedPoly);
}
if(!ShapeFactory::hasPolygonAnyLines(aPoly))
@@ -221,12 +222,14 @@ bool NetChart::impl_createArea( VDataSeries* pSeries
pPosHelper->transformScaledLogicToScene( aPoly );
//create area:
- SdrPathObj* pShape = ShapeFactory::createArea2D( xSeriesGroupShape_Shapes
- , aPoly );
- PropertyMapper::setPropertyNameMapForFilledSeriesProperties(pShape
- , pSeries->getPropertiesOfSeries() );
+ rtl::Reference<SvxShapePolyPolygon>
+ xShape = ShapeFactory::createArea2D( xSeriesGroupShape_Shapes
+ , aPoly );
+ PropertyMapper::setMappedProperties( *xShape
+ , pSeries->getPropertiesOfSeries()
+ , PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
//because of this name this line will be used for marking
- ::chart::ShapeFactory::setShapeName(pShape, "MarkHandles");
+ ::chart::ShapeFactory::setShapeName(xShape, u"MarkHandles"_ustr);
return true;
}
@@ -438,7 +441,7 @@ void NetChart::createShapes()
{
std::vector<std::vector<css::drawing::Position3D>>& rPolygon = pSeries->m_aPolyPolygonShape3D;
sal_Int32& rIndex = pSeries->m_nPolygonIndex;
- if( 0<= rIndex && rIndex < static_cast<sal_Int32>(rPolygon.size()) )
+ if( 0<= rIndex && o3tl::make_unsigned(rIndex) < rPolygon.size() )
{
if( !rPolygon[ rIndex ].empty() )
rIndex++; //start a new polygon for the next point if the current poly is not empty
@@ -526,7 +529,6 @@ void NetChart::createShapes()
pSeries->getPointCID_Stub(), nIndex );
rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes(
createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
- uno::Reference<drawing::XShape> xPointGroupShape_Shape( xPointGroupShape_Shapes );
{
//create data point
@@ -624,7 +626,7 @@ void NetChart::createShapes()
//remove PointGroupShape if empty
if(!xPointGroupShape_Shapes->getCount())
- xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape);
+ xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shapes);
}//next series in x slot (next y slot)
}//next x slot
diff --git a/chart2/source/view/charttypes/NetChart.hxx b/chart2/source/view/charttypes/NetChart.hxx
index 9883ba118ac2..a536daf15fd2 100644
--- a/chart2/source/view/charttypes/NetChart.hxx
+++ b/chart2/source/view/charttypes/NetChart.hxx
@@ -31,7 +31,7 @@ class NetChart : public VSeriesPlotter
public:
NetChart() = delete;
- NetChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ NetChart( const rtl::Reference< ::chart::ChartType >& xChartTypeModel
, sal_Int32 nDimensionCount
, bool bNoArea
, std::unique_ptr<PlottingPositionHelper> pPlottingPositionHelper //takes ownership
@@ -53,11 +53,11 @@ public:
private: //methods
void impl_createSeriesShapes();
bool impl_createArea( VDataSeries* pSeries
- , std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly
+ , const std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly
, std::vector<std::vector<css::drawing::Position3D>> const * pPreviousSeriesPoly
, PlottingPositionHelper const * pPosHelper );
bool impl_createLine( VDataSeries* pSeries
- , std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly
+ , const std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly
, PlottingPositionHelper const * pPosHelper );
private: //member
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index 2fd709500d29..3fc7968fa23f 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -20,23 +20,22 @@
#include <BaseGFXHelper.hxx>
#include <VLineProperties.hxx>
#include "PieChart.hxx"
-#include <PlottingPositionHelper.hxx>
#include <ShapeFactory.hxx>
#include <PolarLabelPositionHelper.hxx>
#include <CommonConverters.hxx>
#include <ObjectIdentifier.hxx>
-
+#include <ChartType.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
+#include "../../model/main/DataPointProperties.hxx"
+#include <LinePropertiesHelper.hxx>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
-#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/chart2/XColorScheme.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <sal/log.hxx>
#include <osl/diagnose.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/helpers.hxx>
#include <limits>
@@ -44,6 +43,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
namespace chart {
@@ -104,7 +104,7 @@ struct PieChart::ShapeParam
namespace
{
-::basegfx::B2IRectangle lcl_getRect(const uno::Reference<drawing::XShape>& xShape)
+::basegfx::B2IRectangle lcl_getRect(const rtl::Reference<SvxShape>& xShape)
{
::basegfx::B2IRectangle aRect;
if (xShape.is())
@@ -125,18 +125,6 @@ bool lcl_isInsidePage(const awt::Point& rPos, const awt::Size& rSize, const awt:
} //end anonymous namespace
-class PiePositionHelper : public PolarPlottingPositionHelper
-{
-public:
- PiePositionHelper( double fAngleDegreeOffset );
-
- bool getInnerAndOuterRadius( double fCategoryX, double& fLogicInnerRadius, double& fLogicOuterRadius, bool bUseRings, double fMaxOffset ) const;
-
-public:
- //Distance between different category rings, seen relative to width of a ring:
- double m_fRingDistance; //>=0 m_fRingDistance=1 --> distance == width
-};
-
PiePositionHelper::PiePositionHelper( double fAngleDegreeOffset )
: m_fRingDistance(0.0)
{
@@ -191,38 +179,63 @@ bool PiePositionHelper::getInnerAndOuterRadius( double fCategoryX
return true;
}
-PieChart::PieChart( const uno::Reference<XChartType>& xChartTypeModel
+
+bool PiePositionHelper::clockwiseWedges() const
+{
+ const ExplicitScaleData& rAngleScale = m_bSwapXAndY ? m_aScales[1] : m_aScales[0];
+ return rAngleScale.Orientation == AxisOrientation_REVERSE;
+}
+
+
+PieChart::PieChart( const rtl::Reference<ChartType>& xChartTypeModel
, sal_Int32 nDimensionCount
, bool bExcludingPositioning )
: VSeriesPlotter( xChartTypeModel, nDimensionCount )
- , m_pPosHelper( new PiePositionHelper( (m_nDimension==3) ? 0.0 : 90.0 ) )
+ , m_aPosHelper( (m_nDimension==3) ? 0.0 : 90.0 )
, m_bUseRings(false)
, m_bSizeExcludesLabelsAndExplodedSegments(bExcludingPositioning)
+ , m_eSubType(PieChartSubType_NONE)
+ , m_nSplitPos(2)
, m_fMaxOffset(std::numeric_limits<double>::quiet_NaN())
{
- PlotterBase::m_pPosHelper = m_pPosHelper.get();
- VSeriesPlotter::m_pMainPosHelper = m_pPosHelper.get();
- m_pPosHelper->m_fRadiusOffset = 0.0;
- m_pPosHelper->m_fRingDistance = 0.0;
+ PlotterBase::m_pPosHelper = &m_aPosHelper;
+ VSeriesPlotter::m_pMainPosHelper = &m_aPosHelper;
+ m_aPosHelper.m_fRadiusOffset = 0.0;
+ m_aPosHelper.m_fRingDistance = 0.0;
- uno::Reference< beans::XPropertySet > xChartTypeProps( xChartTypeModel, uno::UNO_QUERY );
- if( !xChartTypeProps.is() )
+ if( !xChartTypeModel.is() )
return;
try
{
- xChartTypeProps->getPropertyValue( "UseRings") >>= m_bUseRings;
+ xChartTypeModel->getFastPropertyValue(PROP_PIECHARTTYPE_USE_RINGS) >>= m_bUseRings; // "UseRings"
if( m_bUseRings )
{
- m_pPosHelper->m_fRadiusOffset = 1.0;
+ m_aPosHelper.m_fRadiusOffset = 1.0;
if( nDimensionCount==3 )
- m_pPosHelper->m_fRingDistance = 0.1;
+ m_aPosHelper.m_fRingDistance = 0.1;
}
}
catch( const uno::Exception& )
{
TOOLS_WARN_EXCEPTION("chart2", "" );
}
+ try
+ {
+ xChartTypeModel->getFastPropertyValue(PROP_PIECHARTTYPE_SUBTYPE) >>= m_eSubType; // "SubType"
+ }
+ catch( const uno::Exception& )
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
+ try
+ {
+ xChartTypeModel->getFastPropertyValue(PROP_PIECHARTTYPE_SPLIT_POS) >>= m_nSplitPos; // "CompositeSize"
+ }
+ catch( const uno::Exception& )
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
}
PieChart::~PieChart()
@@ -232,7 +245,7 @@ PieChart::~PieChart()
void PieChart::setScales( std::vector< ExplicitScaleData >&& rScales, bool /* bSwapXAndYAxis */ )
{
OSL_ENSURE(m_nDimension<=static_cast<sal_Int32>(rScales.size()),"Dimension of Plotter does not fit two dimension of given scale sequence");
- m_pPosHelper->setScales( std::move(rScales), true );
+ m_aPosHelper.setScales( std::move(rScales), true );
}
drawing::Direction3D PieChart::getPreferredDiagramAspectRatio() const
@@ -248,45 +261,144 @@ bool PieChart::shouldSnapRectToUsedArea()
}
rtl::Reference<SvxShape> PieChart::createDataPoint(
+ const SubPieType e_subType,
const rtl::Reference<SvxShapeGroupAnyD>& xTarget,
const uno::Reference<beans::XPropertySet>& xObjectProperties,
- const ShapeParam& rParam )
+ const ShapeParam& rParam,
+ const sal_Int32 nPointCount,
+ const bool bConcentricExplosion)
{
//transform position:
drawing::Direction3D aOffset;
- if (rParam.mfExplodePercentage != 0.0)
- {
- double fAngle = rParam.mfUnitCircleStartAngleDegree + rParam.mfUnitCircleWidthAngleDegree/2.0;
- double fRadius = (rParam.mfUnitCircleOuterRadius-rParam.mfUnitCircleInnerRadius)*rParam.mfExplodePercentage;
- drawing::Position3D aOrigin = m_pPosHelper->transformUnitCircleToScene(0, 0, rParam.mfLogicZ);
- drawing::Position3D aNewOrigin = m_pPosHelper->transformUnitCircleToScene(fAngle, fRadius, rParam.mfLogicZ);
- aOffset = aNewOrigin - aOrigin;
+ double fExplodedInnerRadius = rParam.mfUnitCircleInnerRadius;
+ double fExplodedOuterRadius = rParam.mfUnitCircleOuterRadius;
+ double fStartAngle = rParam.mfUnitCircleStartAngleDegree;
+ double fWidthAngle = rParam.mfUnitCircleWidthAngleDegree;
+
+ if (rParam.mfExplodePercentage != 0.0) {
+ double fRadius = (fExplodedOuterRadius-fExplodedInnerRadius)*rParam.mfExplodePercentage;
+
+ if (bConcentricExplosion) {
+
+ // For concentric explosion, increase the radius but retain the original
+ // arc length of all ring segments together. This results in a gap
+ // that's evenly divided among all segments, assuming they all have
+ // the same explosion percentage
+ assert(fExplodedInnerRadius >= 0 && fExplodedOuterRadius > 0);
+ double fAngleRatio = (fExplodedInnerRadius + fExplodedOuterRadius) /
+ (fExplodedInnerRadius + fExplodedOuterRadius + 2 * fRadius);
+
+ assert(nPointCount > 0);
+ double fAngleGap = 360 * (1.0 - fAngleRatio) / nPointCount;
+ fStartAngle += fAngleGap / 2;
+ fWidthAngle -= fAngleGap;
+
+ fExplodedInnerRadius += fRadius;
+ fExplodedOuterRadius += fRadius;
+
+ } else {
+ // For the non-concentric explosion case, keep the original radius
+ // but shift the circle origin
+ double fAngle = fStartAngle + fWidthAngle/2.0;
+
+ drawing::Position3D aOrigin = m_aPosHelper.transformUnitCircleToScene(0, 0, rParam.mfLogicZ);
+ drawing::Position3D aNewOrigin = m_aPosHelper.transformUnitCircleToScene(fAngle, fRadius, rParam.mfLogicZ);
+ aOffset = aNewOrigin - aOrigin;
+ }
+ } else {
+ drawing::Position3D aOrigin, aNewOrigin;
+ switch (e_subType) {
+ case SubPieType::LEFT:
+ // Draw the main pie for bar-of-pie/pie-of-pie smaller and to the left
+ aOrigin = m_aPosHelper.transformUnitCircleToScene(0, 0, rParam.mfLogicZ);
+ aNewOrigin = m_aPosHelper.transformUnitCircleToScene(180, 0.75, rParam.mfLogicZ);
+ aOffset = aNewOrigin - aOrigin;
+ fExplodedOuterRadius *= m_fLeftScale;
+ break;
+ case SubPieType::RIGHT:
+ // Draw the sub-pie for pie-of-pie much smaller and to the right
+ aOrigin = m_aPosHelper.transformUnitCircleToScene(0, 0, rParam.mfLogicZ);
+ aNewOrigin = m_aPosHelper.transformUnitCircleToScene(0, 0.75, rParam.mfLogicZ);
+ aOffset = aNewOrigin - aOrigin;
+ fExplodedOuterRadius *= m_fRightScale;
+ break;
+ case SubPieType::NONE:
+ default:
+ // no change
+ break;
+ }
}
+
//create point
rtl::Reference<SvxShape> xShape;
if(m_nDimension==3)
{
xShape = ShapeFactory::createPieSegment( xTarget
- , rParam.mfUnitCircleStartAngleDegree, rParam.mfUnitCircleWidthAngleDegree
- , rParam.mfUnitCircleInnerRadius, rParam.mfUnitCircleOuterRadius
- , aOffset, B3DHomMatrixToHomogenMatrix( m_pPosHelper->getUnitCartesianToScene() )
+ , fStartAngle, fWidthAngle
+ , fExplodedInnerRadius, fExplodedOuterRadius
+ , aOffset, B3DHomMatrixToHomogenMatrix( m_aPosHelper.getUnitCartesianToScene() )
, rParam.mfDepth );
}
else
{
xShape = ShapeFactory::createPieSegment2D( xTarget
- , rParam.mfUnitCircleStartAngleDegree, rParam.mfUnitCircleWidthAngleDegree
- , rParam.mfUnitCircleInnerRadius, rParam.mfUnitCircleOuterRadius
- , aOffset, B3DHomMatrixToHomogenMatrix( m_pPosHelper->getUnitCartesianToScene() ) );
+ , fStartAngle, fWidthAngle
+ , fExplodedInnerRadius, fExplodedOuterRadius
+ , aOffset, B3DHomMatrixToHomogenMatrix( m_aPosHelper.getUnitCartesianToScene() ) );
}
PropertyMapper::setMappedProperties( *xShape, xObjectProperties, PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
return xShape;
}
+rtl::Reference<SvxShape> PieChart::createBarDataPoint(
+ const rtl::Reference<SvxShapeGroupAnyD>& xTarget,
+ const uno::Reference<beans::XPropertySet>& xObjectProperties,
+ const ShapeParam& rParam,
+ double fBarSegBottom, double fBarSegTop)
+{
+ // Draw the bar for bar-of-pie small and to the right. Width and
+ // position are hard-coded for now.
+
+ css::awt::Point aPos;
+ css::awt::Size aSz;
+
+ getBarRect(&aPos, &aSz, fBarSegBottom, fBarSegTop, rParam);
+
+ const tNameSequence emptyNameSeq;
+ const tAnySequence emptyValSeq;
+ //create point
+ rtl::Reference<SvxShape> xShape = ShapeFactory::createRectangle(
+ xTarget,
+ aSz, aPos,
+ emptyNameSeq, emptyValSeq);
+
+ PropertyMapper::setMappedProperties( *xShape, xObjectProperties, PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
+ return xShape;
+}
+
+void PieChart::getBarRect(css::awt::Point *pPos, css::awt::Size *pSz,
+ double fBarBottom, double fBarTop, const ShapeParam& rParam) const
+{
+ double x0 = m_aPosHelper.transformUnitCircleToScene(0, m_fBarLeft, 0).PositionX;
+ double x1 = m_aPosHelper.transformUnitCircleToScene(0, m_fBarRight, 0).PositionX;
+ double y0 = m_aPosHelper.transformUnitCircleToScene(
+ 90, fBarBottom, 0).PositionY;
+ double y1 = m_aPosHelper.transformUnitCircleToScene(
+ 90, fBarTop, 0).PositionY;
+
+ drawing::Position3D aP0(x0, y0, rParam.mfLogicZ);
+ drawing::Position3D aP1(x1, y1, rParam.mfLogicZ);
+
+ *pPos = css::awt::Point(aP0.PositionX, aP1.PositionY);
+ *pSz = css::awt::Size(fabs(aP0.PositionX - aP1.PositionX),
+ fabs(aP0.PositionY - aP1.PositionY));
+}
+
void PieChart::createTextLabelShape(
const rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
- VDataSeries& rSeries, sal_Int32 nPointIndex, ShapeParam& rParam )
+ VDataSeries& rSeries, sal_Int32 nPointIndex, ShapeParam& rParam ,
+ enum SubPieType eType)
{
if (!rSeries.getDataPointLabelIfLabel(nPointIndex))
// There is no text label for this data point. Nothing to do.
@@ -306,7 +418,12 @@ void PieChart::createTextLabelShape(
///get the required label placement type. Available placements are
///`AVOID_OVERLAP`, `CENTER`, `OUTSIDE` and `INSIDE`;
sal_Int32 nLabelPlacement = rSeries.getLabelPlacement(
- nPointIndex, m_xChartTypeModel, m_pPosHelper->isSwapXAndY());
+ nPointIndex, m_xChartTypeModel, m_aPosHelper.isSwapXAndY());
+
+ // has an X/Y offset (relative to the OUTSIDE label default position) been provided?
+ const bool bHasCustomLabelPlacement = nLabelPlacement == css::chart::DataLabelPlacement::CUSTOM;
+ if (bHasCustomLabelPlacement)
+ nLabelPlacement = css::chart::DataLabelPlacement::OUTSIDE;
///when the placement is of `AVOID_OVERLAP` type a later rearrangement of
///the label position is allowed; the `createTextLabelShape` treats the
@@ -314,8 +431,7 @@ void PieChart::createTextLabelShape(
double nVal = rSeries.getYValue(nPointIndex);
//AVOID_OVERLAP is in fact "Best fit" in the UI.
- bool bMovementAllowed = nLabelPlacement == css::chart::DataLabelPlacement::AVOID_OVERLAP
- || nLabelPlacement == css::chart::DataLabelPlacement::CUSTOM;
+ bool bMovementAllowed = nLabelPlacement == css::chart::DataLabelPlacement::AVOID_OVERLAP;
if( bMovementAllowed )
nLabelPlacement = css::chart::DataLabelPlacement::CENTER;
@@ -334,19 +450,40 @@ void PieChart::createTextLabelShape(
else if( nLabelPlacement == css::chart::DataLabelPlacement::INSIDE )
nScreenValueOffsetInRadiusDirection = (m_nDimension!=3) ? -150 : 0;//todo maybe calculate this font height dependent
+ double fRadiusScale;
+ double fXShift;
+ switch (eType) {
+ case SubPieType::LEFT:
+ fRadiusScale = m_fLeftScale;
+ fXShift = m_fLeftShift;
+ break;
+ case SubPieType::RIGHT:
+ fRadiusScale = m_fRightScale;
+ fXShift = m_fRightShift;
+ break;
+ default:
+ fRadiusScale = 1.0;
+ fXShift = 0;
+ }
+
+ ::basegfx::B3DVector aShift(fXShift, 0, 0);
+
///the scene position of the label anchor point is calculated (see notes for
///`PolarLabelPositionHelper::getLabelScreenPositionAndAlignmentForUnitCircleValues`),
///and immediately transformed into the screen position.
- PolarLabelPositionHelper aPolarPosHelper(m_pPosHelper.get(),m_nDimension,m_xLogicTarget);
+ PolarLabelPositionHelper aPolarPosHelper(&m_aPosHelper,m_nDimension,m_xLogicTarget);
awt::Point aScreenPosition2D(
aPolarPosHelper.getLabelScreenPositionAndAlignmentForUnitCircleValues(eAlignment, nLabelPlacement
, rParam.mfUnitCircleStartAngleDegree, rParam.mfUnitCircleWidthAngleDegree
- , rParam.mfUnitCircleInnerRadius, rParam.mfUnitCircleOuterRadius, rParam.mfLogicZ+0.5, 0 ));
+ , rParam.mfUnitCircleInnerRadius, rParam.mfUnitCircleOuterRadius * fRadiusScale
+ , rParam.mfLogicZ+0.5, 0, aShift));
///the screen position of the pie/donut center is calculated.
PieLabelInfo aPieLabelInfo;
aPieLabelInfo.aFirstPosition = basegfx::B2IVector( aScreenPosition2D.X, aScreenPosition2D.Y );
- awt::Point aOrigin( aPolarPosHelper.transformSceneToScreenPosition( m_pPosHelper->transformUnitCircleToScene( 0.0, 0.0, rParam.mfLogicZ+1.0 ) ) );
+ awt::Point aOrigin( aPolarPosHelper.transformSceneToScreenPosition(
+ m_aPosHelper.transformUnitCircleToScene( 0.0, 0.0,
+ rParam.mfLogicZ+1.0, aShift ) ) );
aPieLabelInfo.aOrigin = basegfx::B2IVector( aOrigin.X, aOrigin.Y );
///add a scaling independent Offset if requested
@@ -360,39 +497,83 @@ void PieChart::createTextLabelShape(
// compute outer pie radius
awt::Point aOuterCirclePoint = PlottingPositionHelper::transformSceneToScreenPosition(
- m_pPosHelper->transformUnitCircleToScene(
+ m_aPosHelper.transformUnitCircleToScene(
0,
- rParam.mfUnitCircleOuterRadius,
- 0 ),
+ rParam.mfUnitCircleOuterRadius * fRadiusScale,
+ 0 ,
+ aShift),
m_xLogicTarget, m_nDimension );
basegfx::B2IVector aRadiusVector(
aOuterCirclePoint.X - aPieLabelInfo.aOrigin.getX(),
aOuterCirclePoint.Y - aPieLabelInfo.aOrigin.getY() );
double fSquaredPieRadius = aRadiusVector.scalar(aRadiusVector);
double fPieRadius = sqrt( fSquaredPieRadius );
- double fAngleDegree
- = rParam.mfUnitCircleStartAngleDegree + rParam.mfUnitCircleWidthAngleDegree / 2.0;
- while (fAngleDegree > 360.0)
- fAngleDegree -= 360.0;
- while (fAngleDegree < 0.0)
- fAngleDegree += 360.0;
+ const double fHalfWidthAngleDegree = rParam.mfUnitCircleWidthAngleDegree / 2.0;
+ // fAngleDegree: the angle through the center of the slice / the bisecting ray
+ const double fAngleDegree
+ = NormAngle360(rParam.mfUnitCircleStartAngleDegree + fHalfWidthAngleDegree);
+ // aOuterPosition: slice midpoint on the circumference,
+ // which is where an outside/custom label would be connected
awt::Point aOuterPosition = PlottingPositionHelper::transformSceneToScreenPosition(
- m_pPosHelper->transformUnitCircleToScene(fAngleDegree, rParam.mfUnitCircleOuterRadius, 0),
+ m_aPosHelper.transformUnitCircleToScene(fAngleDegree,
+ rParam.mfUnitCircleOuterRadius * fRadiusScale, 0, aShift),
m_xLogicTarget, m_nDimension);
aPieLabelInfo.aOuterPosition = basegfx::B2IVector(aOuterPosition.X, aOuterPosition.Y);
- // set the maximum text width to be used when text wrapping is enabled
+ /* There are basically three places where a label could be placed in a pie chart
+ * 1.) outside the slice
+ * -typically used for long labels or charts with many, thin slices
+ * 2.) inside the slice (center or edge)
+ * -typically used for charts with 5 or less slices
+ * 3.) in a custom location
+ * -typically set (by auto-positioning I presume) when labels overlap
+ *
+ * Selecting a good width for the text is critical to achieving good-looking labels.
+ * Our bestFit algorithm completely depends on a good starting guess.
+ * Lots of room for improvement here...
+ * Warning: complication due to 3D ovals (so can't use normal circle functions),
+ * donuts(m_bUseRings), auto re-scaling of the pie chart, etc.
+ *
+ * Based on observation, Microsoft uses 1/5 of the chart space as its text limit,
+ * although it will reduce the width (as long as it is not a custom position)
+ * if doing so means that the now-taller-text will fit inside the slice,
+ * so best if we do the same for our charts.
+ */
+
+ // set the maximum text width to be used when text wrapping is enabled (default text wrap is on)
+ /* A reasonable start for bestFitting a 90deg slice oriented on an Axis is 80% of the radius */
double fTextMaximumFrameWidth = 0.8 * fPieRadius;
- if (nLabelPlacement == css::chart::DataLabelPlacement::OUTSIDE
- && m_aAvailableOuterRect.getWidth())
+ const double fCompatMaxTextLen = m_aAvailableOuterRect.getWidth() / 5.0;
+ if (m_aAvailableOuterRect.getWidth())
{
- if ((fAngleDegree >= 67.5 && fAngleDegree <= 112.5)
- || (fAngleDegree >= 247.5 && fAngleDegree <= 292.5))
- fTextMaximumFrameWidth = m_aAvailableOuterRect.getWidth() / 3.0;
- else
- fTextMaximumFrameWidth = 0.85 * (m_aAvailableOuterRect.getWidth() / 2.0 - fPieRadius);
+ if (bHasCustomLabelPlacement)
+ {
+ // if a custom width has been provided, then use that of course,
+ // otherwise use the interoperability-compliant 1/5 of the chart space as max width
+ const awt::Size aCustomSize = rSeries.getLabelCustomSize(nPointIndex);
+ if (aCustomSize.Width > 0)
+ fTextMaximumFrameWidth = aCustomSize.Width;
+ else
+ fTextMaximumFrameWidth = fCompatMaxTextLen;
+ }
+ else if (nLabelPlacement == css::chart::DataLabelPlacement::OUTSIDE)
+ {
+ // use up to 80% of the available space from the slice edge to the edge of the chart
+ const sal_Int32 nOuterX = aPieLabelInfo.aOuterPosition.getX();
+ if (fAngleDegree < 90 || fAngleDegree > 270) // label is placed on the right side
+ fTextMaximumFrameWidth = 0.8 * abs(m_aAvailableOuterRect.getWidth() - nOuterX);
+ else // label is placed on the left side
+ fTextMaximumFrameWidth = 0.8 * nOuterX;
+
+ // limited of course to the 1/5 maximum allowed for compatibility
+ fTextMaximumFrameWidth = std::min(fTextMaximumFrameWidth, fCompatMaxTextLen);
+ }
}
+ /* TODO: better guesses for INSIDE: does the slice better handle wide text or tall/wrapped text?
+ * * wide: center near X-axis, shorter text content, slice > 90degree wide
+ * * tall: center near Y-axis, longer text content, many categories shown
+ */
sal_Int32 nTextMaximumFrameWidth = ceil(fTextMaximumFrameWidth);
///the text shape for the label is created
@@ -402,13 +583,13 @@ void PieChart::createTextLabelShape(
///a new `PieLabelInfo` instance is initialized with all the info related to
///the current label in order to simplify later label position rearrangement;
- uno::Reference< container::XChild > xChild( aPieLabelInfo.xTextShape, uno::UNO_QUERY );
+ rtl::Reference< SvxShape > xChild = aPieLabelInfo.xTextShape;
///text shape could be empty; in that case there is no need to add label info
if( !xChild.is() )
return;
- aPieLabelInfo.xLabelGroupShape.set( xChild->getParent(), uno::UNO_QUERY );
+ aPieLabelInfo.xLabelGroupShape = dynamic_cast<SvxShapeGroupAnyD*>(xChild->getParent().get());
if (bMovementAllowed && !m_bUseRings)
{
@@ -416,28 +597,56 @@ void PieChart::createTextLabelShape(
* First off the routine try to place the label inside the related pie slice,
* if this is not possible the label is placed outside.
*/
- if (rSeries.getLabelPlacement(nPointIndex, m_xChartTypeModel, m_pPosHelper->isSwapXAndY())
- == css::chart::DataLabelPlacement::CUSTOM
- || !performLabelBestFitInnerPlacement(rParam, aPieLabelInfo))
+
+ /* Note: bestFit surprisingly does not adjust the width of the label,
+ * so having an optimal width already set when createDataLabel ran earlier
+ * is crucial (and currently lacking)!
+ * TODO: * change bestFit to treat the width as a max width, and reduce if beneficial
+ */
+ if (!performLabelBestFitInnerPlacement(rParam, aPieLabelInfo,
+ fRadiusScale, aShift))
{
if (m_aAvailableOuterRect.getWidth())
{
- if ((fAngleDegree >= 67.5 && fAngleDegree <= 112.5)
- || (fAngleDegree >= 247.5 && fAngleDegree <= 292.5))
- fTextMaximumFrameWidth = m_aAvailableOuterRect.getWidth() / 3.0;
- else
- fTextMaximumFrameWidth
- = 0.85 * (m_aAvailableOuterRect.getWidth() / 2.0 - fPieRadius);
- nTextMaximumFrameWidth = ceil(fTextMaximumFrameWidth);
+ /* This tried to bestFit, but it didn't fit. So how best to handle this?
+ *
+ * Two possible cases relating to compatibility
+ * 1.) It did fit for Microsoft, but our bestFit wasn't able to do the same
+ * * In that case, the best response is to be as small as possible
+ * (the distance from the chart edge to where the label attaches to the slice)
+ * to avoid scaling the diagram with too long outside labels,
+ * and to encourage fixing the bestFit algorithm.
+ * 2.) It didn't fit for Microsoft either (possible, but less likely situation)
+ * * In that case, the compatible max length would be best
+ * * can expect the chart space has been properly sized to handle the max length
+ *
+ * In the native LO case, it is also best to be as small as possible,
+ * so that the user creating the diagram is annoyed and makes the chart area larger.
+ *
+ * Therefore, handle this by making the label as small as possible.
+ *
+ * Complication (tdf122765.pptx): it is possible for the aOuterPosition
+ * to be outside of the available outer rectangle (somehow),
+ * so in that bizarre case just try the positive value of the result...
+ */
+ const sal_Int32 nOuterX = aPieLabelInfo.aOuterPosition.getX();
+ if (fAngleDegree < 90 || fAngleDegree > 270) // label is placed on the right side
+ fTextMaximumFrameWidth = 0.8 * abs(m_aAvailableOuterRect.getWidth() - nOuterX);
+ else // label is placed on the left side
+ fTextMaximumFrameWidth = 0.8 * nOuterX;
+
+ nTextMaximumFrameWidth = ceil(std::min(fTextMaximumFrameWidth, fCompatMaxTextLen));
}
+ // find the position to connect an Outside label to
nScreenValueOffsetInRadiusDirection = (m_nDimension != 3) ? 150 : 0;
aScreenPosition2D
= aPolarPosHelper.getLabelScreenPositionAndAlignmentForUnitCircleValues(
eAlignment, css::chart::DataLabelPlacement::OUTSIDE,
rParam.mfUnitCircleStartAngleDegree,
rParam.mfUnitCircleWidthAngleDegree, rParam.mfUnitCircleInnerRadius,
- rParam.mfUnitCircleOuterRadius, rParam.mfLogicZ + 0.5, 0);
+ rParam.mfUnitCircleOuterRadius * fRadiusScale,
+ rParam.mfLogicZ + 0.5, 0, aShift);
aPieLabelInfo.aFirstPosition
= basegfx::B2IVector(aScreenPosition2D.X, aScreenPosition2D.Y);
@@ -452,21 +661,21 @@ void PieChart::createTextLabelShape(
}
uno::Reference<drawing::XShapes> xShapes(xChild->getParent(), uno::UNO_QUERY);
+ /* question: why remove and rebuild? Can't the existing one just be changed? */
xShapes->remove(aPieLabelInfo.xTextShape);
aPieLabelInfo.xTextShape
= createDataLabel(xTextTarget, rSeries, nPointIndex, nVal, rParam.mfLogicYSum,
aScreenPosition2D, eAlignment, 0, nTextMaximumFrameWidth);
- xChild.clear();
- xChild.set(uno::Reference<container::XChild>(aPieLabelInfo.xTextShape, uno::UNO_QUERY));
+ xChild = aPieLabelInfo.xTextShape;
if (!xChild.is())
return;
- aPieLabelInfo.xLabelGroupShape.set(xChild->getParent(), uno::UNO_QUERY);
+ aPieLabelInfo.xLabelGroupShape = dynamic_cast<SvxShapeGroupAnyD*>(xChild->getParent().get());
}
}
- bool bShowLeaderLine = rSeries.getPropertiesOfSeries()
- ->getPropertyValue("ShowCustomLeaderLines")
+ bool bShowLeaderLine = rSeries.getModel()
+ ->getFastPropertyValue(PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES) // "ShowCustomLeaderLines"
.get<sal_Bool>();
if (m_bPieLabelsAllowToMove)
{
@@ -493,43 +702,41 @@ void PieChart::createTextLabelShape(
{
sal_Int32 nX1 = aPieLabelInfo.aOuterPosition.getX();
sal_Int32 nY1 = aPieLabelInfo.aOuterPosition.getY();
- sal_Int32 nX2 = nX1;
- sal_Int32 nY2 = nY1;
- if (nX1 < aRect.getMinX())
- nX2 = aRect.getMinX();
- else if (nX1 > aRect.getMaxX())
- nX2 = aRect.getMaxX();
-
- if (nY1 < aRect.getMinY())
- nY2 = aRect.getMinY();
- else if (nY1 > aRect.getMaxY())
- nY2 = aRect.getMaxY();
-
- sal_Int32 nSquaredDistanceFromOrigin
+ const sal_Int32 nX2 = std::clamp(nX1, aRect.getMinX(), aRect.getMaxX());
+ const sal_Int32 nY2 = std::clamp(nY1, aRect.getMinY(), aRect.getMaxY());
+
+ const sal_Int32 nLabelSquaredDistanceFromOrigin
= (nX2 - aOrigin.X) * (nX2 - aOrigin.X) + (nY2 - aOrigin.Y) * (nY2 - aOrigin.Y);
+ // can't use fSquaredPieRadius for 3D charts, since no longer a true circle
+ const sal_Int32 nPieEdgeSquaredDistanceFromOrigin
+ = (nX1 - aOrigin.X) * (nX1 - aOrigin.X) + (nY1 - aOrigin.Y) * (nY1 - aOrigin.Y);
// tdf#138018 Don't show leader line when custom positioned data label is inside pie chart
- if (nSquaredDistanceFromOrigin > fSquaredPieRadius)
+ if (nLabelSquaredDistanceFromOrigin > nPieEdgeSquaredDistanceFromOrigin)
{
//when the line is very short compared to the page size don't create one
::basegfx::B2DVector aLength(nX1 - nX2, nY1 - nY2);
- double fPageDiagonaleLength = sqrt(double(nPageWidth) * double(nPageWidth)
- + double(nPageHeight) * double(nPageHeight));
+ double fPageDiagonaleLength = std::hypot(nPageWidth, nPageHeight);
if ((aLength.getLength() / fPageDiagonaleLength) >= 0.01)
{
drawing::PointSequenceSequence aPoints{ { {nX1, nY1}, {nX2, nY2} } };
- uno::Reference<beans::XPropertySet> xProp(aPieLabelInfo.xTextShape,
- uno::UNO_QUERY);
VLineProperties aVLineProperties;
- if (xProp.is())
- {
- sal_Int32 nColor = 0;
- xProp->getPropertyValue("CharColor") >>= nColor;
- //automatic font color does not work for lines -> fallback to black
- if (nColor != -1)
- aVLineProperties.Color <<= nColor;
- }
+
+ sal_Int32 nColor = 0;
+ nColor = rSeries.getModel()
+ ->getFastPropertyValue(
+ DataPointProperties::PROP_DATAPOINT_BORDER_COLOR)
+ .get<sal_Int32>();
+ if (nColor != -1)
+ aVLineProperties.Color <<= nColor;
+ sal_Int32 nWidth = 0;
+ nWidth = rSeries.getModel()
+ ->getFastPropertyValue(LinePropertiesHelper::PROP_LINE_WIDTH)
+ .get<sal_Int32>();
+ if (nWidth != -1)
+ aVLineProperties.Width <<= nWidth;
+
ShapeFactory::createLine2D(xTextTarget, aPoints, &aVLineProperties);
}
}
@@ -545,6 +752,58 @@ void PieChart::createTextLabelShape(
m_aLabelInfoList.push_back(aPieLabelInfo);
}
+// Put labels in one bar of a bar-of-pie chart. This is quite basic and doesn't
+// deal with the possibility of the bar being too small for the label text.
+void PieChart::createBarLabelShape(
+ const rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
+ VDataSeries& rSeries, sal_Int32 nPointIndex, double fBarBottom,
+ double fBarTop, ShapeParam& rParam)
+{
+ if (!rSeries.getDataPointLabelIfLabel(nPointIndex))
+ // There is no text label for this data point. Nothing to do.
+ return;
+
+ // Ignore the label placement specification, and just center all labels
+ const LabelAlignment eAlignment(LABEL_ALIGN_CENTER);
+
+ css::awt::Point aPos;
+ css::awt::Size aSz;
+
+ getBarRect(&aPos, &aSz, fBarBottom, fBarTop, rParam);
+
+ // The screen position of the label anchor point is the center of the bar
+ awt::Point aScreenPosition2D(
+ aPos.X + aSz.Width/2.0,
+ aPos.Y + aSz.Height/2.0);
+
+ const double fTextMaximumFrameWidth = 0.8 * (m_fBarRight - m_fBarLeft);
+ const sal_Int32 nTextMaximumFrameWidth = ceil(fTextMaximumFrameWidth);
+
+ ///the text shape for the label is created
+ PieLabelInfo aPieLabelInfo;
+ const double nVal = rSeries.getYValue(nPointIndex);
+ aPieLabelInfo.xTextShape = createDataLabel(
+ xTextTarget, rSeries, nPointIndex, nVal, rParam.mfLogicYSum,
+ aScreenPosition2D, eAlignment, 0, nTextMaximumFrameWidth);
+
+ ///a new `PieLabelInfo` instance is initialized with all the info related to
+ ///the current label in order to simplify later label position rearrangement;
+ rtl::Reference< SvxShape > xChild = aPieLabelInfo.xTextShape;
+
+ ///text shape could be empty; in that case there is no need to add label info
+ if( !xChild.is() )
+ return;
+
+ aPieLabelInfo.xLabelGroupShape = dynamic_cast<SvxShapeGroupAnyD*>(xChild->getParent().get());
+ aPieLabelInfo.fValue = nVal;
+ aPieLabelInfo.bMovementAllowed = false;
+ aPieLabelInfo.bMoved = false;
+ aPieLabelInfo.xTextTarget = xTextTarget;
+ aPieLabelInfo.bShowLeaderLine = false;
+
+ m_aLabelInfoList.push_back(aPieLabelInfo);
+}
+
void PieChart::addSeries( std::unique_ptr<VDataSeries> pSeries, sal_Int32 /* zSlot */, sal_Int32 /* xSlot */, sal_Int32 /* ySlot */ )
{
VSeriesPlotter::addSeries( std::move(pSeries), 0, -1, 0 );
@@ -571,19 +830,20 @@ double PieChart::getMaxOffset()
return m_fMaxOffset;
VDataSeries* pSeries = rSeriesList.front().get();
- uno::Reference< beans::XPropertySet > xSeriesProp( pSeries->getPropertiesOfSeries() );
- if( !xSeriesProp.is() )
+ rtl::Reference< DataSeries > xSeries( pSeries->getModel() );
+ if( !xSeries.is() )
return m_fMaxOffset;
double fExplodePercentage=0.0;
- xSeriesProp->getPropertyValue( "Offset") >>= fExplodePercentage;
+ xSeries->getPropertyValue( u"Offset"_ustr) >>= fExplodePercentage;
if(fExplodePercentage>m_fMaxOffset)
m_fMaxOffset=fExplodePercentage;
if(!m_bSizeExcludesLabelsAndExplodedSegments)
{
uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProp->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
+ // "AttributedDataPoints"
+ if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList )
{
for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
{
@@ -591,7 +851,7 @@ double PieChart::getMaxOffset()
if(xPointProp.is())
{
fExplodePercentage=0.0;
- xPointProp->getPropertyValue( "Offset") >>= fExplodePercentage;
+ xPointProp->getPropertyValue( u"Offset"_ustr) >>= fExplodePercentage;
if(fExplodePercentage>m_fMaxOffset)
m_fMaxOffset=fExplodePercentage;
}
@@ -607,14 +867,10 @@ double PieChart::getMaximumX()
return m_aZSlots.front().size()+0.5+fMaxOffset;
return 1.5+fMaxOffset;
}
-double PieChart::getMinimumYInRange( double /* fMinimumX */, double /* fMaximumX */, sal_Int32 /* nAxisIndex */ )
-{
- return 0.0;
-}
-double PieChart::getMaximumYInRange( double /* fMinimumX */, double /* fMaximumX */, sal_Int32 /* nAxisIndex */ )
+std::pair<double, double> PieChart::getMinimumAndMaximumYInRange( double /* fMinimumX */, double /* fMaximumX */, sal_Int32 /* nAxisIndex */ )
{
- return 1.0;
+ return { 0.0, 1.0 };
}
bool PieChart::isExpandBorderToIncrementRhythm( sal_Int32 /* nDimensionIndex */ )
@@ -642,6 +898,47 @@ bool PieChart::isSeparateStackingForDifferentSigns( sal_Int32 /* nDimensionIndex
return false;
}
+// Determine left endpoints of connecting lines. These will terminate either
+// at the corners of the composite wedge (if the wedge is small enough), or
+// tangent to the left pie circle (if the wedge is larger). The endpoints
+// are at the returned values (xl0, +/-yl0).
+// static
+void PieChart::leftConnEndpoints(double* xl0_p, double* yl0_p,
+ const PieDataSrcBase *pDataSrc,
+ const VDataSeries *pSeries,
+ const ShapeParam &aParam)
+{
+ const sal_Int32 nEnd = pDataSrc->getNPoints(pSeries, SubPieType::LEFT);
+ const double compFrac = pDataSrc->getData(pSeries, nEnd - 1,
+ SubPieType::LEFT) / aParam.mfLogicYSum;
+
+ // Assuming temporarily that the left circle is at the origin,
+ // the tangent point (xp0, yp0) on the left circle satisfies
+ // (1) xp0 = (1-r) / t
+ // (2) xp0^2 + yp0^2 = 1
+ // where the left-hand circle has radius 1, the right-hand circle
+ // has radius r, and the right-hand circle is centered at (t, 0).
+ const double r0 = aParam.mfUnitCircleOuterRadius * m_fLeftScale;
+ const double rho = m_fRightScale / m_fLeftScale;
+ const double xp0 = (1 - rho) / (m_fRightShift - m_fLeftShift);
+ // Determine if the composite wedge is large enough that the
+ // connecting lines hit the tangent point, instead of the corners of
+ // the wedge
+ assert(abs(xp0) <= 1.0);
+ const double theta = acos(xp0);
+
+ double xl0, yl0;
+ if (compFrac < theta / M_PI) {
+ xl0 = r0 * cos(compFrac * M_PI);
+ yl0 = r0 * sin(compFrac * M_PI);
+ } else {
+ xl0 = r0 * xp0;
+ yl0 = sqrt(r0 * r0 - xl0 * xl0);
+ }
+ *xl0_p = xl0;
+ *yl0_p = yl0;
+}
+
void PieChart::createShapes()
{
///a ZSlot is a vector< vector< VDataSeriesGroup > >. There is only one
@@ -694,22 +991,14 @@ void PieChart::createShapes()
///the angle axis scale range is [0, 1]. The max_offset parameter is used
///for exploded pie chart and its value is 0.5.
- ///the `explodeable` ring is the first one except when the radius axis
- ///orientation is reversed (always!?) and we are dealing with a donut: in
- ///such a case the `explodeable` ring is the last one.
- std::vector< VDataSeriesGroup >::size_type nExplodeableSlot = 0;
- if( m_pPosHelper->isMathematicalOrientationRadius() && m_bUseRings )
- nExplodeableSlot = m_aZSlots.front().size()-1;
-
m_aLabelInfoList.clear();
m_fMaxOffset = std::numeric_limits<double>::quiet_NaN();
sal_Int32 n3DRelativeHeight = 100;
- uno::Reference< beans::XPropertySet > xPropertySet( m_xChartTypeModel, uno::UNO_QUERY );
- if ( (m_nDimension==3) && xPropertySet.is())
+ if ( (m_nDimension==3) && m_xChartTypeModel.is())
{
try
{
- uno::Any aAny = xPropertySet->getPropertyValue( "3DRelativeHeight" );
+ uno::Any aAny = m_xChartTypeModel->getFastPropertyValue( PROP_PIECHARTTYPE_3DRELATIVEHEIGHT ); // "3DRelativeHeight"
aAny >>= n3DRelativeHeight;
}
catch (const uno::Exception&) { }
@@ -720,8 +1009,6 @@ void PieChart::createShapes()
///(m_bUseRings||fSlotX<0.5)
for( double fSlotX=0; aXSlotIter != aXSlotEnd && (m_bUseRings||fSlotX<0.5 ); ++aXSlotIter, fSlotX+=1.0 )
{
- ShapeParam aParam;
-
std::vector< std::unique_ptr<VDataSeries> >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
if(pSeriesList->empty())//there should be only one series in each x slot
continue;
@@ -729,17 +1016,17 @@ void PieChart::createShapes()
if(!pSeries)
continue;
- bool bHasFillColorMapping = pSeries->hasPropertyMapping("FillColor");
-
/// The angle degree offset is set by the same property of the
/// data series.
/// Counter-clockwise offset from the 3 o'clock position.
- m_pPosHelper->m_fAngleDegreeOffset = pSeries->getStartingAngle();
+ m_aPosHelper.m_fAngleDegreeOffset = pSeries->getStartingAngle();
///iterate through all points to get the sum of all entries of
///the current data series
sal_Int32 nPointIndex=0;
sal_Int32 nPointCount=pSeries->getTotalPointCount();
+ ShapeParam aParam;
+
for( nPointIndex = 0; nPointIndex < nPointCount; nPointIndex++ )
{
double fY = pSeries->getYValue( nPointIndex );
@@ -752,134 +1039,434 @@ void PieChart::createShapes()
aParam.mfLogicYSum += fabs(fY);
}
- if (aParam.mfLogicYSum == 0.0)
+ if (aParam.mfLogicYSum == 0.0) {
// Total sum of all Y values in this series is zero. Skip the whole series.
continue;
+ }
- double fLogicYForNextPoint = 0.0;
- ///iterate through all points to create shapes
- for( nPointIndex = 0; nPointIndex < nPointCount; nPointIndex++ )
+ PieDataSrcBase *pDataSrc = nullptr;
+ PieDataSrc normalPieSrc;
+ OfPieDataSrc ofPieSrc(m_nSplitPos);
+
+ // Default to regular pie if too few points for of-pie
+ ::css::chart2::PieChartSubType eSubType =
+ nPointCount >= OfPieDataSrc::minPoints ?
+ m_eSubType :
+ PieChartSubType_NONE;
+
+ switch (eSubType) {
+ case PieChartSubType_NONE:
+ pDataSrc = &normalPieSrc;
+ createOneRing(SubPieType::NONE, fSlotX, aParam, xSeriesTarget,
+ xTextTarget, pSeries, pDataSrc, n3DRelativeHeight);
+ break;
+ case PieChartSubType_BAR:
{
- double fLogicInnerRadius, fLogicOuterRadius;
-
- ///compute the maximum relative distance offset of the current slice
- ///from the pie center
- ///it is worth noting that after the first invocation the maximum
- ///offset value is cached, so it is evaluated only once per each
- ///call to `createShapes`
- double fOffset = getMaxOffset();
-
- ///compute the outer and the inner radius for the current ring slice
- bool bIsVisible = m_pPosHelper->getInnerAndOuterRadius( fSlotX+1.0, fLogicInnerRadius, fLogicOuterRadius, m_bUseRings, fOffset );
- if( !bIsVisible )
- continue;
+ pDataSrc = &ofPieSrc;
+ createOneRing(SubPieType::LEFT, 0, aParam, xSeriesTarget,
+ xTextTarget, pSeries, pDataSrc, n3DRelativeHeight);
+ createOneBar(SubPieType::RIGHT, aParam, xSeriesTarget,
+ xTextTarget, pSeries, pDataSrc, n3DRelativeHeight);
+
+ //
+ // Draw connecting lines
+ //
+ double xl0, xl1, yl0, yl1, x0, y0, x1, y1, y2, y3;
+
+ leftConnEndpoints(&xl0, &yl0, pDataSrc, pSeries, aParam);
+
+ xl0 += m_fLeftShift;
+
+ // Coordinates of bar top left corner
+ xl1 = m_fBarLeft;
+ yl1 = m_fFullBarHeight / 2;
+
+ x0 = m_aPosHelper.transformUnitCircleToScene(0, xl0, 0).PositionX;
+ y0 = m_aPosHelper.transformUnitCircleToScene(90, yl0, 0).PositionY;
+ x1 = m_aPosHelper.transformUnitCircleToScene(0, xl1, 0).PositionX;
+ y1 = m_aPosHelper.transformUnitCircleToScene(90, yl1, 0).PositionY;
+ y2 = m_aPosHelper.transformUnitCircleToScene(90, -yl0, 0).PositionY;
+ y3 = m_aPosHelper.transformUnitCircleToScene(90, -yl1, 0).PositionY;
+
+ std::vector<std::vector<css::drawing::Position3D>> linePts;
+ linePts.resize(2);
+ linePts[0].push_back(css::drawing::Position3D(x0, y0, aParam.mfLogicZ));
+ linePts[0].push_back(css::drawing::Position3D(x1, y1, aParam.mfLogicZ));
+ linePts[1].push_back(css::drawing::Position3D(x0, y2, aParam.mfLogicZ));
+ linePts[1].push_back(css::drawing::Position3D(x1, y3, aParam.mfLogicZ));
+
+ VLineProperties aVLineProperties; // default black
+
+ //create line
+ rtl::Reference<SvxShapeGroupAnyD> xSeriesGroupShape_Shapes =
+ getSeriesGroupShape(pSeries, xSeriesTarget);
+ rtl::Reference<SvxShape> xShape = ShapeFactory::createLine2D(
+ xSeriesGroupShape_Shapes, linePts, &aVLineProperties);
+
+ // need to set properties?
+ //PropertyMapper::setMappedProperties( *xShape, xObjectProperties,
+ // PropertyMapper::getPropertyNameMapForLineSeriesProperties() );
- aParam.mfDepth = getTransformedDepth() * (n3DRelativeHeight / 100.0);
+ break;
+ }
+ case PieChartSubType_PIE:
+ {
+ pDataSrc = &ofPieSrc;
+ createOneRing(SubPieType::LEFT, 0, aParam, xSeriesTarget,
+ xTextTarget, pSeries, pDataSrc, n3DRelativeHeight);
+ createOneRing(SubPieType::RIGHT, 0, aParam, xSeriesTarget,
+ xTextTarget, pSeries, pDataSrc, n3DRelativeHeight);
+
+ //
+ // Draw connecting lines
+ //
+ double xl0, xl1, yl0, yl1, x0, y0, x1, y1, y2, y3;
+
+ leftConnEndpoints(&xl0, &yl0, pDataSrc, pSeries, aParam);
+
+ // Translated, per below
+ xl0 += m_fLeftShift - m_fRightShift;
+
+ // Compute tangent point on the right-hand circle of the line
+ // through (xl0, yl0). If we translate things so the right-hand
+ // circle is centered on the origin, then this point (x,y)
+ // satisfies these two equations, where r1 is the radius of the
+ // right-hand circle:
+ // (1) x^2 + y^2 = r1^2
+ // (2) (y - yl0) / (x - xl0) = -x / y
+ const double r1 = aParam.mfUnitCircleOuterRadius * m_fRightScale;
+ xl1 = (r1*r1 * xl0 + yl0 * r1 * sqrt(xl0*xl0 + yl0*yl0 - r1*r1)) /
+ (xl0*xl0 + yl0*yl0);
+ yl1 = sqrt(r1*r1 - xl1*xl1);
+
+ // Now translate back to the coordinates we use
+ xl0 += m_fRightShift;
+ xl1 += m_fRightShift;
+
+ x0 = m_aPosHelper.transformUnitCircleToScene(0, xl0, 0).PositionX;
+ y0 = m_aPosHelper.transformUnitCircleToScene(90, yl0, 0).PositionY;
+ x1 = m_aPosHelper.transformUnitCircleToScene(0, xl1, 0).PositionX;
+ y1 = m_aPosHelper.transformUnitCircleToScene(90, yl1, 0).PositionY;
+ y2 = m_aPosHelper.transformUnitCircleToScene(90, -yl0, 0).PositionY;
+ y3 = m_aPosHelper.transformUnitCircleToScene(90, -yl1, 0).PositionY;
+
+ std::vector<std::vector<css::drawing::Position3D>> linePts;
+ linePts.resize(2);
+ linePts[0].push_back(css::drawing::Position3D(x0, y0, aParam.mfLogicZ));
+ linePts[0].push_back(css::drawing::Position3D(x1, y1, aParam.mfLogicZ));
+ linePts[1].push_back(css::drawing::Position3D(x0, y2, aParam.mfLogicZ));
+ linePts[1].push_back(css::drawing::Position3D(x1, y3, aParam.mfLogicZ));
+
+ VLineProperties aVLineProperties; // default black
+
+ //create line
+ rtl::Reference<SvxShapeGroupAnyD> xSeriesGroupShape_Shapes =
+ getSeriesGroupShape(pSeries, xSeriesTarget);
+ rtl::Reference<SvxShape> xShape = ShapeFactory::createLine2D(
+ xSeriesGroupShape_Shapes, linePts, &aVLineProperties);
- rtl::Reference<SvxShapeGroupAnyD> xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries, xSeriesTarget);
- ///collect data point information (logic coordinates, style ):
- double fLogicYValue = fabs(pSeries->getYValue( nPointIndex ));
- if( std::isnan(fLogicYValue) )
- continue;
- if(fLogicYValue==0.0)//@todo: continue also if the resolution is too small
- continue;
- double fLogicYPos = fLogicYForNextPoint;
- fLogicYForNextPoint += fLogicYValue;
+ break;
+ }
+ default:
+ assert(false); // this shouldn't happen
+ }
+ }//next x slot
+}
+
+static sal_Int32 propIndex(
+ sal_Int32 nPointIndex,
+ enum SubPieType eType,
+ const PieDataSrcBase *pDataSrc,
+ const VDataSeries* pSeries)
+{
+
+ switch (eType) {
+ case SubPieType::LEFT:
+ if (nPointIndex == pDataSrc->getNPoints(pSeries,
+ SubPieType::LEFT) - 1) {
+ return pSeries->getTotalPointCount();
+ } else {
+ return nPointIndex;
+ }
+ break;
+ case SubPieType::RIGHT:
+ return pDataSrc->getNPoints(pSeries, SubPieType::LEFT) +
+ nPointIndex - 1;
+ break;
+ case SubPieType::NONE:
+ return nPointIndex;
+ break;
+ default: // shouldn't happen
+ assert(false);
+ return 0; // suppress compile warning
+ }
+}
+
+
+void PieChart::createOneRing(
+ enum SubPieType eType,
+ double fSlotX,
+ ShapeParam& aParam,
+ const rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
+ const rtl::Reference<SvxShapeGroup>& xTextTarget,
+ VDataSeries* pSeries,
+ const PieDataSrcBase *pDataSrc,
+ sal_Int32 n3DRelativeHeight)
+{
+ bool bHasFillColorMapping = pSeries->hasPropertyMapping(u"FillColor"_ustr);
+
+ sal_Int32 nRingPtCnt = pDataSrc->getNPoints(pSeries, eType);
+
+ // Find sum of entries for this ring or sub-pie
+ double ringSum = 0;
+ for (sal_Int32 nPointIndex = 0; nPointIndex < nRingPtCnt; nPointIndex++ ) {
+ double fY = pDataSrc->getData(pSeries, nPointIndex, eType);
+ if (!std::isnan(fY) ) ringSum += fY;
+ }
+
+ // determine the starting angle around the ring
+ auto sAngle = [&]()
+ {
+ if (eType == SubPieType::LEFT) {
+ // Left of-pie has the "composite" wedge (the one expanded in the right
+ // subgraph) facing to the right in the chart, to allow the expansion
+ // lines to meet it
+ const double compositeVal = pDataSrc->getData(pSeries, nRingPtCnt - 1, eType);
+ const double degAng = compositeVal * 360 / (ringSum * 2);
+ return m_aPosHelper.clockwiseWedges() ? 360 - degAng : degAng;
+ } else {
+ /// The angle degree offset is set by the same property of the
+ /// data series.
+ /// Counter-clockwise offset from the 3 o'clock position.
+ return static_cast<double>(pSeries->getStartingAngle());
+ }
+ };
+
+ m_aPosHelper.m_fAngleDegreeOffset = sAngle();
+
+ ///the `explodeable` ring is the first one except when the radius axis
+ ///orientation is reversed (always!?) and we are dealing with a donut: in
+ ///such a case the `explodeable` ring is the last one.
+ std::vector< VDataSeriesGroup >::size_type nExplodeableSlot = 0;
+ if( m_aPosHelper.isMathematicalOrientationRadius() && m_bUseRings )
+ nExplodeableSlot = m_aZSlots.front().size()-1;
+
+ double fLogicYForNextPoint = 0.0;
+ ///iterate through all points to create shapes
+ for(sal_Int32 nPointIndex = 0; nPointIndex < nRingPtCnt; nPointIndex++ )
+ {
+ double fLogicInnerRadius, fLogicOuterRadius;
+
+ ///compute the maximum relative distance offset of the current slice
+ ///from the pie center
+ ///it is worth noting that after the first invocation the maximum
+ ///offset value is cached, so it is evaluated only once per each
+ ///call to `createShapes`
+ double fOffset = getMaxOffset();
+
+ ///compute the outer and the inner radius for the current ring slice
+ bool bIsVisible = m_aPosHelper.getInnerAndOuterRadius( fSlotX+1.0, fLogicInnerRadius, fLogicOuterRadius, m_bUseRings, fOffset );
+ if( !bIsVisible )
+ continue;
+
+ aParam.mfDepth = getTransformedDepth() * (n3DRelativeHeight / 100.0);
- uno::Reference< beans::XPropertySet > xPointProperties = pSeries->getPropertiesOfPoint( nPointIndex );
+ rtl::Reference<SvxShapeGroupAnyD> xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries, xSeriesTarget);
- //iterate through all subsystems to create partial points
+ ///collect data point information (logic coordinates, style ):
+ double fLogicYValue = pDataSrc->getData(pSeries, nPointIndex, eType);
+ if( std::isnan(fLogicYValue) )
+ continue;
+ if(fLogicYValue==0.0)//@todo: continue also if the resolution is too small
+ continue;
+ double fLogicYPos = fLogicYForNextPoint;
+ fLogicYForNextPoint += fLogicYValue;
+
+ uno::Reference< beans::XPropertySet > xPointProperties =
+ pDataSrc->getProps(pSeries, nPointIndex, eType);
+
+ //iterate through all subsystems to create partial points
+ {
+ //logic values on angle axis:
+ double fLogicStartAngleValue = fLogicYPos / ringSum;
+ double fLogicEndAngleValue = (fLogicYPos+fLogicYValue) / ringSum;
+
+ ///note that the explode percentage is set to the `Offset`
+ ///property of the current data series entry only for slices
+ ///belonging to the outer ring
+ aParam.mfExplodePercentage = 0.0;
+ bool bDoExplode = ( nExplodeableSlot == static_cast< std::vector< VDataSeriesGroup >::size_type >(fSlotX) );
+ if(bDoExplode) try
{
- //logic values on angle axis:
- double fLogicStartAngleValue = fLogicYPos / aParam.mfLogicYSum;
- double fLogicEndAngleValue = (fLogicYPos+fLogicYValue) / aParam.mfLogicYSum;
-
- ///note that the explode percentage is set to the `Offset`
- ///property of the current data series entry only for slices
- ///belonging to the outer ring
- aParam.mfExplodePercentage = 0.0;
- bool bDoExplode = ( nExplodeableSlot == static_cast< std::vector< VDataSeriesGroup >::size_type >(fSlotX) );
- if(bDoExplode) try
- {
- xPointProperties->getPropertyValue( "Offset") >>= aParam.mfExplodePercentage;
- }
- catch( const uno::Exception& )
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
+ xPointProperties->getPropertyValue( u"Offset"_ustr) >>= aParam.mfExplodePercentage;
+ }
+ catch( const uno::Exception& )
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
- ///see notes for `PolarPlottingPositionHelper` methods
- ///transform to unit circle:
- aParam.mfUnitCircleWidthAngleDegree = m_pPosHelper->getWidthAngleDegree( fLogicStartAngleValue, fLogicEndAngleValue );
- aParam.mfUnitCircleStartAngleDegree = m_pPosHelper->transformToAngleDegree( fLogicStartAngleValue );
- aParam.mfUnitCircleInnerRadius = m_pPosHelper->transformToRadius( fLogicInnerRadius );
- aParam.mfUnitCircleOuterRadius = m_pPosHelper->transformToRadius( fLogicOuterRadius );
-
- ///create data point
- aParam.mfLogicZ = -1.0; // For 3D pie chart label position
- rtl::Reference<SvxShape> xPointShape =
- createDataPoint(
- xSeriesGroupShape_Shapes, xPointProperties, aParam);
-
- ///point color:
- if (!pSeries->hasPointOwnColor(nPointIndex) && m_xColorScheme.is())
- {
- xPointShape->setPropertyValue("FillColor",
- uno::Any(m_xColorScheme->getColorByIndex( nPointIndex )));
- }
+ ///see notes for `PolarPlottingPositionHelper` methods
+ ///transform to unit circle:
+ aParam.mfUnitCircleWidthAngleDegree = m_aPosHelper.getWidthAngleDegree( fLogicStartAngleValue, fLogicEndAngleValue );
+ aParam.mfUnitCircleStartAngleDegree = m_aPosHelper.transformToAngleDegree( fLogicStartAngleValue );
+ aParam.mfUnitCircleInnerRadius = m_aPosHelper.transformToRadius( fLogicInnerRadius );
+ aParam.mfUnitCircleOuterRadius = m_aPosHelper.transformToRadius( fLogicOuterRadius );
+
+ ///create data point
+ aParam.mfLogicZ = -1.0; // For 3D pie chart label position
+
+ // Do concentric explosion if it's a donut chart with more than one series
+ const bool bConcentricExplosion = m_bUseRings && (m_aZSlots.front().size() > 1);
+ rtl::Reference<SvxShape> xPointShape =
+ createDataPoint(eType, xSeriesGroupShape_Shapes,
+ xPointProperties, aParam, nRingPtCnt,
+ bConcentricExplosion);
+
+ // Handle coloring of the composite wedge
+ sal_Int32 nPropIdx = propIndex(nPointIndex, eType, pDataSrc,
+ pSeries);
+
+ ///point color:
+ if (!pSeries->hasPointOwnColor(nPropIdx) && m_xColorScheme.is())
+ {
+ xPointShape->setPropertyValue(u"FillColor"_ustr,
+ uno::Any(m_xColorScheme->getColorByIndex( nPropIdx )));
+ }
- if(bHasFillColorMapping)
+ if(bHasFillColorMapping)
+ {
+ double nPropVal = pSeries->getValueByProperty(nPropIdx, u"FillColor"_ustr);
+ if(!std::isnan(nPropVal))
{
- double nPropVal = pSeries->getValueByProperty(nPointIndex, "FillColor");
- if(!std::isnan(nPropVal))
- {
- xPointShape->setPropertyValue("FillColor", uno::Any(static_cast<sal_Int32>( nPropVal)));
- }
+ xPointShape->setPropertyValue(u"FillColor"_ustr, uno::Any(static_cast<sal_Int32>( nPropVal)));
}
+ }
- ///create label
- createTextLabelShape(xTextTarget, *pSeries, nPointIndex, aParam);
+ ///create label, *except* for composite wedge
+ if (!(eType == SubPieType::LEFT && nPointIndex == pDataSrc->getNPoints(pSeries,
+ SubPieType::LEFT) - 1)) {
+ createTextLabelShape(xTextTarget, *pSeries, nPropIdx, aParam, eType);
+ }
- if(!bDoExplode)
- {
- ShapeFactory::setShapeName( xPointShape
- , ObjectIdentifier::createPointCID( pSeries->getPointCID_Stub(), nPointIndex ) );
- }
- else try
- {
- ///enable dragging of outer segments
-
- double fAngle = aParam.mfUnitCircleStartAngleDegree + aParam.mfUnitCircleWidthAngleDegree/2.0;
- double fMaxDeltaRadius = aParam.mfUnitCircleOuterRadius-aParam.mfUnitCircleInnerRadius;
- drawing::Position3D aOrigin = m_pPosHelper->transformUnitCircleToScene( fAngle, aParam.mfUnitCircleOuterRadius, aParam.mfLogicZ );
- drawing::Position3D aNewOrigin = m_pPosHelper->transformUnitCircleToScene( fAngle, aParam.mfUnitCircleOuterRadius + fMaxDeltaRadius, aParam.mfLogicZ );
-
- sal_Int32 nOffsetPercent( static_cast<sal_Int32>(aParam.mfExplodePercentage * 100.0) );
-
- awt::Point aMinimumPosition( PlottingPositionHelper::transformSceneToScreenPosition(
- aOrigin, m_xLogicTarget, m_nDimension ) );
- awt::Point aMaximumPosition( PlottingPositionHelper::transformSceneToScreenPosition(
- aNewOrigin, m_xLogicTarget, m_nDimension ) );
-
- //enable dragging of piesegments
- OUString aPointCIDStub( ObjectIdentifier::createSeriesSubObjectStub( OBJECTTYPE_DATA_POINT
- , pSeries->getSeriesParticle()
- , ObjectIdentifier::getPieSegmentDragMethodServiceName()
- , ObjectIdentifier::createPieSegmentDragParameterString(
- nOffsetPercent, aMinimumPosition, aMaximumPosition )
- ) );
-
- ShapeFactory::setShapeName( xPointShape
- , ObjectIdentifier::createPointCID( aPointCIDStub, nPointIndex ) );
- }
- catch( const uno::Exception& )
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- }//next series in x slot (next y slot)
- }//next category
- }//next x slot
+ if(!bDoExplode)
+ {
+ ShapeFactory::setShapeName( xPointShape
+ , ObjectIdentifier::createPointCID(
+ pSeries->getPointCID_Stub(), nPropIdx ) );
+ }
+ else try
+ {
+ ///enable dragging of outer segments
+
+ double fAngle = aParam.mfUnitCircleStartAngleDegree + aParam.mfUnitCircleWidthAngleDegree/2.0;
+ double fMaxDeltaRadius = aParam.mfUnitCircleOuterRadius-aParam.mfUnitCircleInnerRadius;
+ drawing::Position3D aOrigin = m_aPosHelper.transformUnitCircleToScene( fAngle, aParam.mfUnitCircleOuterRadius, aParam.mfLogicZ );
+ drawing::Position3D aNewOrigin = m_aPosHelper.transformUnitCircleToScene( fAngle, aParam.mfUnitCircleOuterRadius + fMaxDeltaRadius, aParam.mfLogicZ );
+
+ sal_Int32 nOffsetPercent( static_cast<sal_Int32>(aParam.mfExplodePercentage * 100.0) );
+
+ awt::Point aMinimumPosition( PlottingPositionHelper::transformSceneToScreenPosition(
+ aOrigin, m_xLogicTarget, m_nDimension ) );
+ awt::Point aMaximumPosition( PlottingPositionHelper::transformSceneToScreenPosition(
+ aNewOrigin, m_xLogicTarget, m_nDimension ) );
+
+ //enable dragging of piesegments
+ OUString aPointCIDStub( ObjectIdentifier::createSeriesSubObjectStub( OBJECTTYPE_DATA_POINT
+ , pSeries->getSeriesParticle()
+ , ObjectIdentifier::getPieSegmentDragMethodServiceName()
+ , ObjectIdentifier::createPieSegmentDragParameterString(
+ nOffsetPercent, aMinimumPosition, aMaximumPosition )
+ ) );
+
+ ShapeFactory::setShapeName( xPointShape
+ , ObjectIdentifier::createPointCID( aPointCIDStub,
+ nPropIdx ) );
+ }
+ catch( const uno::Exception& )
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "" );
+ }
+ }//next series in x slot (next y slot)
+ }//next category
+}
+
+void PieChart::createOneBar(
+ enum SubPieType eType,
+ ShapeParam& aParam,
+ const rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
+ const rtl::Reference<SvxShapeGroup>& xTextTarget,
+ VDataSeries* pSeries,
+ const PieDataSrcBase *pDataSrc,
+ sal_Int32 n3DRelativeHeight)
+{
+ bool bHasFillColorMapping = pSeries->hasPropertyMapping(u"FillColor"_ustr);
+
+ sal_Int32 nBarPtCnt = pDataSrc->getNPoints(pSeries, eType);
+
+ // Find sum of entries for this bar chart
+ double barSum = 0;
+ for (sal_Int32 nPointIndex = 0; nPointIndex < nBarPtCnt; nPointIndex++ ) {
+ double fY = pDataSrc->getData(pSeries, nPointIndex, eType);
+ if (!std::isnan(fY) ) barSum += fY;
+ }
+
+ double fBarBottom = 0.0;
+ double fBarTop = -0.5; // make the bar go from -0.5 to 0.5
+ ///iterate through all points to create shapes
+ for(sal_Int32 nPointIndex = 0; nPointIndex < nBarPtCnt; nPointIndex++ )
+ {
+ aParam.mfDepth = getTransformedDepth() * (n3DRelativeHeight / 100.0);
+
+ rtl::Reference<SvxShapeGroupAnyD> xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries, xSeriesTarget);
+
+ ///collect data point information (logic coordinates, style ):
+ double fY = pDataSrc->getData(pSeries, nPointIndex, eType) / barSum;
+ if( std::isnan(fY) )
+ continue;
+ if(fY==0.0)//@todo: continue also if the resolution is too small
+ continue;
+ fBarBottom = fBarTop;
+ fBarTop += fY;
+
+ uno::Reference< beans::XPropertySet > xPointProperties =
+ pDataSrc->getProps(pSeries, nPointIndex, eType);
+
+ ///create data point
+ aParam.mfLogicZ = -1.0; // For 3D pie chart label position
+
+ rtl::Reference<SvxShape> xPointShape =
+ createBarDataPoint(xSeriesGroupShape_Shapes,
+ xPointProperties, aParam,
+ fBarBottom, fBarTop);
+
+ sal_Int32 nPropIdx = propIndex(nPointIndex, eType, pDataSrc, pSeries);
+
+ ///point color:
+ if (!pSeries->hasPointOwnColor(nPropIdx) && m_xColorScheme.is())
+ {
+ xPointShape->setPropertyValue(u"FillColor"_ustr,
+ uno::Any(m_xColorScheme->getColorByIndex( nPropIdx )));
+ }
+
+
+ if(bHasFillColorMapping)
+ {
+ double nPropVal = pSeries->getValueByProperty(nPropIdx, u"FillColor"_ustr);
+ if(!std::isnan(nPropVal))
+ {
+ xPointShape->setPropertyValue(u"FillColor"_ustr, uno::Any(static_cast<sal_Int32>( nPropVal)));
+ }
+ }
+
+ ///create label
+ createBarLabelShape(xTextTarget, *pSeries, nPropIdx, fBarBottom,
+ fBarTop, aParam);
+
+ ShapeFactory::setShapeName( xPointShape,
+ ObjectIdentifier::createPointCID( pSeries->getPointCID_Stub(),
+ nPropIdx ) );
+ }//next category
}
PieChart::PieLabelInfo::PieLabelInfo()
@@ -1129,7 +1716,7 @@ bool PieChart::tryMoveLabels( PieLabelInfo const * pFirstBorder, PieLabelInfo co
PieLabelInfo* p2 = pCenter->pNext;
//return true when successful
- bool bLabelOrderIsAntiClockWise = m_pPosHelper->isMathematicalOrientationAngle();
+ bool bLabelOrderIsAntiClockWise = m_aPosHelper.isMathematicalOrientationAngle();
///two loops are performed simultaneously: the outer loop iterates on
///`PieLabelInfo` objects in the list starting from the central element
@@ -1239,7 +1826,7 @@ void PieChart::rearrangeLabelToAvoidOverlapIfRequested( const awt::Size& rPageSi
if(!bMoveableFound)
return;
- double fPageDiagonaleLength = sqrt( double(rPageSize.Width)*double(rPageSize.Width) + double(rPageSize.Height)*double(rPageSize.Height) );
+ double fPageDiagonaleLength = std::hypot(rPageSize.Width, rPageSize.Height);
if( fPageDiagonaleLength == 0.0 )
return;
@@ -1269,20 +1856,11 @@ void PieChart::rearrangeLabelToAvoidOverlapIfRequested( const awt::Size& rPageSi
{
if( labelInfo.bMoved && labelInfo.bShowLeaderLine )
{
+ const basegfx::B2IRectangle aRect(lcl_getRect(labelInfo.xLabelGroupShape));
sal_Int32 nX1 = labelInfo.aOuterPosition.getX();
sal_Int32 nY1 = labelInfo.aOuterPosition.getY();
- sal_Int32 nX2 = nX1;
- sal_Int32 nY2 = nY1;
- ::basegfx::B2IRectangle aRect( lcl_getRect( labelInfo.xLabelGroupShape ) );
- if( nX1 < aRect.getMinX() )
- nX2 = aRect.getMinX();
- else if( nX1 > aRect.getMaxX() )
- nX2 = aRect.getMaxX();
-
- if( nY1 < aRect.getMinY() )
- nY2 = aRect.getMinY();
- else if( nY1 > aRect.getMaxY() )
- nY2 = aRect.getMaxY();
+ const sal_Int32 nX2 = std::clamp(nX1, aRect.getMinX(), aRect.getMaxX());
+ const sal_Int32 nY2 = std::clamp(nY1, aRect.getMinY(), aRect.getMaxY());
//when the line is very short compared to the page size don't create one
::basegfx::B2DVector aLength(nX1-nX2, nY1-nY2);
@@ -1291,11 +1869,10 @@ void PieChart::rearrangeLabelToAvoidOverlapIfRequested( const awt::Size& rPageSi
drawing::PointSequenceSequence aPoints{ { {nX1, nY1}, {nX2, nY2} } };
- uno::Reference< beans::XPropertySet > xProp( labelInfo.xTextShape, uno::UNO_QUERY);
- if( xProp.is() )
+ if( labelInfo.xTextShape.is() )
{
sal_Int32 nColor = 0;
- xProp->getPropertyValue("CharColor") >>= nColor;
+ labelInfo.xTextShape->SvxShape::getPropertyValue(u"CharColor"_ustr) >>= nColor;
if( nColor != -1 )//automatic font color does not work for lines -> fallback to black
aVLineProperties.Color <<= nColor;
}
@@ -1380,7 +1957,9 @@ void PieChart::rearrangeLabelToAvoidOverlapIfRequested( const awt::Size& rPageSi
* 4. the top edge when 225 < alpha < 315.
*
**/
-bool PieChart::performLabelBestFitInnerPlacement(ShapeParam& rShapeParam, PieLabelInfo const & rPieLabelInfo)
+bool PieChart::performLabelBestFitInnerPlacement(ShapeParam& rShapeParam,
+ PieLabelInfo const & rPieLabelInfo, double fRadiusScale,
+ const ::basegfx::B3DVector& aShift)
{
SAL_INFO( "chart2.pie.label.bestfit.inside",
"** PieChart::performLabelBestFitInnerPlacement invoked **" );
@@ -1393,12 +1972,13 @@ bool PieChart::performLabelBestFitInnerPlacement(ShapeParam& rShapeParam, PieLab
// get the middle point of the arc representing the pie slice border
double fLogicZ = rShapeParam.mfLogicZ + 1.0;
- awt::Point aMiddleArcPoint = PlottingPositionHelper::transformSceneToScreenPosition(
- m_pPosHelper->transformUnitCircleToScene(
+ drawing::Position3D aUnitCirclePt = m_aPosHelper.transformUnitCircleToScene(
fBisectingRayAngleDeg,
- rShapeParam.mfUnitCircleOuterRadius,
- fLogicZ ),
- m_xLogicTarget, m_nDimension );
+ rShapeParam.mfUnitCircleOuterRadius * fRadiusScale,
+ fLogicZ,
+ aShift);
+ awt::Point aMiddleArcPoint = PlottingPositionHelper::transformSceneToScreenPosition(
+ aUnitCirclePt, m_xLogicTarget, m_nDimension );
// compute the pie radius
basegfx::B2IVector aPieCenter = rPieLabelInfo.aOrigin;
@@ -1411,7 +1991,7 @@ bool PieChart::performLabelBestFitInnerPlacement(ShapeParam& rShapeParam, PieLab
// the bb is moved as much as possible near to the border of the pie,
// anyway a small offset from the border is present (0.025 * pie radius)
const double fPieBorderOffset = 0.025;
- fPieRadius = fPieRadius - fPieRadius * fPieBorderOffset;
+ fPieRadius *= (1 - fPieBorderOffset);
SAL_INFO( "chart2.pie.label.bestfit.inside",
" pie sector:" );
@@ -1480,8 +2060,7 @@ bool PieChart::performLabelBestFitInnerPlacement(ShapeParam& rShapeParam, PieLab
// compute the length of the diagonal vector d,
// that is the distance between P and F
- double fSquaredDistancePF = fDistancePM * fDistancePM + fOrthogonalEdgeLength * fOrthogonalEdgeLength;
- double fDistancePF = sqrt( fSquaredDistancePF );
+ double fDistancePF = std::hypot(fDistancePM, fOrthogonalEdgeLength);
SAL_INFO( "chart2.pie.label.bestfit.inside",
" width = " << fLabelWidth );
@@ -1691,6 +2270,94 @@ bool PieChart::performLabelBestFitInnerPlacement(ShapeParam& rShapeParam, PieLab
return true;
}
+//=======================
+// class PieDataSrc
+//=======================
+double PieDataSrc::getData(const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ [[maybe_unused]] enum SubPieType eType) const
+{
+ return fabs(pSeries->getYValue( nPtIdx ));
+}
+
+sal_Int32 PieDataSrc::getNPoints(const VDataSeries* pSeries,
+ [[maybe_unused]] enum SubPieType eType) const
+{
+ assert(eType == SubPieType::NONE);
+ return pSeries->getTotalPointCount();
+}
+
+uno::Reference< beans::XPropertySet > PieDataSrc::getProps(
+ const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ [[maybe_unused]] enum SubPieType eType) const
+{
+ assert(eType == SubPieType::NONE);
+ return pSeries->getPropertiesOfPoint(nPtIdx);
+}
+
+
+//=======================
+// class OfPieDataSrc
+//=======================
+
+// Support data splits only of the type "last n entries go in right subchart",
+// for now.
+// TODO
+
+sal_Int32 OfPieDataSrc::getNPoints(const VDataSeries* pSeries,
+ enum SubPieType eType) const
+{
+ if (eType == SubPieType::LEFT) {
+ return pSeries->getTotalPointCount() - m_nSplitPos + 1;
+ } else {
+ assert(eType == SubPieType::RIGHT);
+ return m_nSplitPos;
+ }
+}
+
+double OfPieDataSrc::getData(const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ enum SubPieType eType) const
+{
+ const sal_Int32 n = pSeries->getTotalPointCount() - m_nSplitPos;
+ if (eType == SubPieType::LEFT) {
+ // nPtIdx should be in [0, n]
+ if (nPtIdx < n) {
+ return fabs(pSeries->getYValue( nPtIdx ));
+ } else {
+ // composite wedge
+ assert(nPtIdx == n);
+ double total = 0;
+ for (sal_Int32 i = n; i < n + m_nSplitPos; ++i) {
+ total += pSeries->getYValue(i);
+ }
+ return total;
+ }
+ } else {
+ assert(eType == SubPieType::RIGHT);
+ return fabs(pSeries->getYValue(nPtIdx + n));
+ }
+}
+
+uno::Reference< beans::XPropertySet > OfPieDataSrc::getProps(
+ const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ enum SubPieType eType) const
+{
+ const sal_Int32 nPts = pSeries->getTotalPointCount();
+ const sal_Int32 n = nPts - m_nSplitPos;
+ if (eType == SubPieType::LEFT) {
+ // nPtIdx should be in [0, n]
+ if (nPtIdx < n) {
+ return pSeries->getPropertiesOfPoint( nPtIdx );
+ } else {
+ // The aggregated wedge
+ assert(nPtIdx == n);
+ return pSeries->getPropertiesOfPoint(nPts);
+ }
+ } else {
+ assert(eType == SubPieType::RIGHT);
+ return pSeries->getPropertiesOfPoint(nPtIdx + n);
+ }
+}
+
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/charttypes/PieChart.hxx b/chart2/source/view/charttypes/PieChart.hxx
index 5bd25eed53e6..a4d92f68fc52 100644
--- a/chart2/source/view/charttypes/PieChart.hxx
+++ b/chart2/source/view/charttypes/PieChart.hxx
@@ -21,13 +21,109 @@
#include <memory>
#include <VSeriesPlotter.hxx>
+#include <PlottingPositionHelper.hxx>
#include <basegfx/vector/b2ivector.hxx>
#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
namespace chart
{
-class PiePositionHelper;
+class PiePositionHelper : public PolarPlottingPositionHelper
+{
+public:
+ PiePositionHelper( double fAngleDegreeOffset );
+
+ bool getInnerAndOuterRadius( double fCategoryX, double& fLogicInnerRadius, double& fLogicOuterRadius, bool bUseRings, double fMaxOffset ) const;
+
+ // Determine if the pie wedges are ordered clockwise (returns true) or
+ // counterclockwise (returns false)
+ bool clockwiseWedges() const;
+
+public:
+ //Distance between different category rings, seen relative to width of a ring:
+ double m_fRingDistance; //>=0 m_fRingDistance=1 --> distance == width
+};
+
+enum class SubPieType {
+ NONE, // solo pie or donut
+ LEFT, // left pie in pie-of-pie
+ RIGHT // right pie in pie-of-pie
+};
+
+
+//=======================
+// class PieDataSrcBase
+//=======================
+class PieDataSrcBase
+{
+public:
+ PieDataSrcBase() = default;
+ virtual ~PieDataSrcBase() = default;
+
+ // Number of data points for given pie subtype
+ virtual sal_Int32 getNPoints(const VDataSeries* pSeries,
+ enum SubPieType eType) const = 0;
+
+ // Get the value for the given pie wedge, for the given subtype
+ virtual double getData(const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ enum SubPieType eType) const = 0;
+
+ // Get the properties for the wedge and subtype
+ virtual uno::Reference< beans::XPropertySet > getProps(
+ const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ enum SubPieType eType) const = 0;
+};
+
+//=======================
+// class PieDataSrc
+//=======================
+class PieDataSrc : public PieDataSrcBase
+{
+public:
+ sal_Int32 getNPoints(const VDataSeries* pSeries,
+ enum SubPieType eType) const;
+
+ double getData(const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ [[maybe_unused]]enum SubPieType eType) const;
+
+ virtual uno::Reference< beans::XPropertySet > getProps(
+ const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ enum SubPieType eType) const;
+};
+
+//=======================
+// class OfPieDataSrc
+//=======================
+class OfPieDataSrc : public PieDataSrcBase
+{
+public:
+ OfPieDataSrc(sal_Int32 nSplitPos):
+ m_nSplitPos(nSplitPos)
+ {}
+
+ // Minimum sensible number of data points
+ static constexpr sal_Int32 minPoints = 4;
+
+ sal_Int32 getNPoints(const VDataSeries* pSeries,
+ enum SubPieType eType) const;
+
+ double getData(const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ enum SubPieType eType) const;
+
+ virtual uno::Reference< beans::XPropertySet > getProps(
+ const VDataSeries* pSeries, sal_Int32 nPtIdx,
+ enum SubPieType eType) const;
+private:
+ double m_nSplitPos;
+};
+
+//=======================
+// class PieChart
+//=======================
class PieChart : public VSeriesPlotter
{
struct ShapeParam;
@@ -35,7 +131,7 @@ class PieChart : public VSeriesPlotter
public:
PieChart() = delete;
- PieChart( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ PieChart( const rtl::Reference< ::chart::ChartType >& xChartTypeModel
, sal_Int32 nDimensionCount, bool bExcludingPositioning );
virtual ~PieChart() override;
@@ -53,8 +149,7 @@ public:
//MinimumAndMaximumSupplier
virtual double getMinimumX() override;
virtual double getMaximumX() override;
- virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
- virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
+ virtual std::pair<double, double> getMinimumAndMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex ) override;
virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex ) override;
@@ -65,10 +160,18 @@ public:
private: //methods
rtl::Reference<SvxShape>
createDataPoint(
+ enum SubPieType eType,
const rtl::Reference<SvxShapeGroupAnyD>& xTarget,
const css::uno::Reference<css::beans::XPropertySet>& xObjectProperties,
- const ShapeParam& rParam );
+ const ShapeParam& rParam,
+ const sal_Int32 nPointCount,
+ const bool bConcentricExplosion);
+ rtl::Reference<SvxShape> createBarDataPoint(
+ const rtl::Reference<SvxShapeGroupAnyD>& xTarget,
+ const uno::Reference<beans::XPropertySet>& xObjectProperties,
+ const ShapeParam& rParam,
+ double fBarSegBottom, double fBarSegTop);
/** This method creates a text shape for a label of a data point.
*
* @param xTextTarget
@@ -82,7 +185,15 @@ private: //methods
*/
void createTextLabelShape(
const rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
- VDataSeries& rSeries, sal_Int32 nPointIndex, ShapeParam& rParam );
+ VDataSeries& rSeries, sal_Int32 nPointIndex, ShapeParam& rParam ,
+ enum SubPieType eType );
+
+ /** Same as createTextLabelShape(), but for bar-of-pie bar charts.
+ */
+ void createBarLabelShape(
+ const rtl::Reference<SvxShapeGroupAnyD>& xTextTarget,
+ VDataSeries& rSeries, sal_Int32 nPointIndex,
+ double fBarBottom, double fBarTop, ShapeParam& rParam);
/** This method sets `m_fMaxOffset` to the maximum `Offset` property and
* returns it. There is a `Offset` property for each entry in a data
@@ -105,13 +216,66 @@ struct PieLabelInfo;
, const css::awt::Size& rPageSize );
bool performLabelBestFitInnerPlacement( ShapeParam& rShapeParam
- , PieLabelInfo const & rPieLabelInfo );
+ , PieLabelInfo const & rPieLabelInfo
+ , double fRadiusScale
+ , const ::basegfx::B3DVector& aShift);
+
+ // A standalone pie, one pie in a pie-of-pie, or one ring of a donut
+ void createOneRing([[maybe_unused]]enum SubPieType eType
+ , double fSlotX
+ , ShapeParam& aParam
+ , const rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget
+ , const rtl::Reference<SvxShapeGroup>& xTextTarget
+ , VDataSeries* pSeries
+ , const PieDataSrcBase *pDataSrc
+ , sal_Int32 n3DRelativeHeight);
+
+ // A bar chart in a bar-of-pie
+ void createOneBar(
+ enum SubPieType eType,
+ ShapeParam& aParam,
+ const rtl::Reference<SvxShapeGroupAnyD>& xSeriesTarget,
+ const rtl::Reference<SvxShapeGroup>& xTextTarget,
+ VDataSeries* pSeries,
+ const PieDataSrcBase *pDataSrc,
+ sal_Int32 n3DRelativeHeight);
+
+ void getBarRect(css::awt::Point *pPos, css::awt::Size *pSz,
+ double fBarBottom, double fBarTop, const ShapeParam& rParam) const;
+
+ // Determine left endpoints of connecting lines. These will terminate either
+ // at the corners of the composite wedge (if the wedge is small enough), or
+ // tangent to the left pie circle (if the wedge is larger). The endpoints
+ // are at the returned values (xl0, +/-yl0).
+ static void leftConnEndpoints(double* xl0_p, double* yl0_p,
+ const PieDataSrcBase *pDataSrc,
+ const VDataSeries *pSeries,
+ const ShapeParam &aParam);
private: //member
- std::unique_ptr<PiePositionHelper>
- m_pPosHelper;
+ // Constants for of-pie charts. Some of these will want to become
+ // user-selectable values. TODO
+
+ // Radius scalings for left and right of-pie subcharts
+ static constexpr double m_fLeftScale = 2.0/3;
+ static constexpr double m_fRightScale = 1.0/3;
+ // Shifts left/right for of-pie subcharts
+ static constexpr double m_fLeftShift = -0.75;
+ static constexpr double m_fRightShift = 0.75;
+ // Height of bar-of-pie bar
+ static constexpr double m_fFullBarHeight = 1.0;
+ // Bar-of-pie bar left side position
+ static constexpr double m_fBarLeft = 0.75;
+ // Bar-of-pie bar right side position
+ static constexpr double m_fBarRight = 1.25;
+
+ PiePositionHelper m_aPosHelper;
+
bool m_bUseRings;
bool m_bSizeExcludesLabelsAndExplodedSegments;
+ ::css::chart2::PieChartSubType m_eSubType;
+ // Number of entries in an of-pie composite wedge
+ double m_nSplitPos;
struct PieLabelInfo
{
@@ -119,8 +283,8 @@ private: //member
bool moveAwayFrom( const PieLabelInfo* pFix, const css::awt::Size& rPageSize
, bool bMoveHalfWay, bool bMoveClockwise );
- css::uno::Reference< css::drawing::XShape > xTextShape;
- css::uno::Reference< css::drawing::XShape > xLabelGroupShape;
+ rtl::Reference< SvxShapeText > xTextShape;
+ rtl::Reference< SvxShapeGroupAnyD > xLabelGroupShape;
::basegfx::B2IVector aFirstPosition;
::basegfx::B2IVector aOuterPosition;
::basegfx::B2IVector aOrigin;
@@ -138,6 +302,7 @@ private: //member
double m_fMaxOffset; /// cached max offset value (init'ed to NaN)
};
+
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx
index bd54b266345a..15980b638bc8 100644
--- a/chart2/source/view/charttypes/Splines.cxx
+++ b/chart2/source/view/charttypes/Splines.cxx
@@ -19,12 +19,11 @@
#include "Splines.hxx"
#include <osl/diagnose.h>
-#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
#include <vector>
#include <algorithm>
-#include <memory>
+#include <optional>
#include <cmath>
#include <limits>
@@ -121,7 +120,7 @@ lcl_SplineCalculation::lcl_SplineCalculation(
m_fYp1( fY1FirstDerivation ),
m_fYpN( fYnFirstDerivation ),
m_nKLow( 0 ),
- m_nKHigh( rSortedPoints.size() - 1 ),
+ m_nKHigh( m_aPoints.size() - 1 ),
m_fLastInterpolatedValue(std::numeric_limits<double>::infinity())
{
Calculate();
@@ -133,7 +132,7 @@ lcl_SplineCalculation::lcl_SplineCalculation(
m_fYp1( 0.0 ), /*dummy*/
m_fYpN( 0.0 ), /*dummy*/
m_nKLow( 0 ),
- m_nKHigh( rSortedPoints.size() - 1 ),
+ m_nKHigh( m_aPoints.size() - 1 ),
m_fLastInterpolatedValue(std::numeric_limits<double>::infinity())
{
CalculatePeriodic();
@@ -411,26 +410,19 @@ bool createParameterT(const tPointVecType& rUniquePoints, double* t)
bool bIsSuccessful = true;
const lcl_tSizeType n = rUniquePoints.size() - 1;
t[0]=0.0;
- double dx = 0.0;
- double dy = 0.0;
- double fDiffMax = 1.0; //dummy values
double fDenominator = 0.0; // initialized for summing up
for (lcl_tSizeType i=1; i<=n ; ++i)
{ // 4th root(dx^2+dy^2)
- dx = rUniquePoints[i].first - rUniquePoints[i-1].first;
- dy = rUniquePoints[i].second - rUniquePoints[i-1].second;
- // scaling to avoid underflow or overflow
- fDiffMax = std::max(fabs(dx), fabs(dy));
- if (fDiffMax == 0.0)
+ double dx = rUniquePoints[i].first - rUniquePoints[i-1].first;
+ double dy = rUniquePoints[i].second - rUniquePoints[i-1].second;
+ if (dx == 0 && dy == 0)
{
bIsSuccessful = false;
break;
}
else
{
- dx /= fDiffMax;
- dy /= fDiffMax;
- fDenominator += sqrt(sqrt(dx * dx + dy * dy)) * sqrt(fDiffMax);
+ fDenominator += sqrt(std::hypot(dx, dy));
}
}
if (fDenominator == 0.0)
@@ -444,13 +436,9 @@ bool createParameterT(const tPointVecType& rUniquePoints, double* t)
double fNumerator = 0.0;
for (lcl_tSizeType i=1; i<=j ; ++i)
{
- dx = rUniquePoints[i].first - rUniquePoints[i-1].first;
- dy = rUniquePoints[i].second - rUniquePoints[i-1].second;
- fDiffMax = std::max(fabs(dx), fabs(dy));
- // same as above, so should not be zero
- dx /= fDiffMax;
- dy /= fDiffMax;
- fNumerator += sqrt(sqrt(dx * dx + dy * dy)) * sqrt(fDiffMax);
+ double dx = rUniquePoints[i].first - rUniquePoints[i-1].first;
+ double dy = rUniquePoints[i].second - rUniquePoints[i-1].second;
+ fNumerator += sqrt(std::hypot(dx, dy));
}
t[j] = fNumerator / fDenominator;
@@ -581,8 +569,8 @@ void SplineCalculater::CalculateCubicSplines(
// generate a spline for each coordinate. It holds the complete
// information to calculate each point of the curve
- std::unique_ptr<lcl_SplineCalculation> aSplineX;
- std::unique_ptr<lcl_SplineCalculation> aSplineY;
+ std::optional<lcl_SplineCalculation> aSplineX;
+ std::optional<lcl_SplineCalculation> aSplineY;
// lcl_SplineCalculation* aSplineZ; the z-coordinates of all points in
// a data series are equal. No spline calculation needed, but copy
// coordinate to output
@@ -592,16 +580,15 @@ void SplineCalculater::CalculateCubicSplines(
pOld[ 0 ].PositionZ == pOld[nMaxIndexPoints].PositionZ &&
nMaxIndexPoints >=2 )
{ // periodic spline
- aSplineX.reset(new lcl_SplineCalculation( std::move(aInputX)));
- aSplineY.reset(new lcl_SplineCalculation( std::move(aInputY)));
- // aSplineZ = new lcl_SplineCalculation( aInputZ) ;
+ aSplineX.emplace(std::move(aInputX));
+ aSplineY.emplace(std::move(aInputY));
}
else // generate the kind "natural spline"
{
double fXDerivation = std::numeric_limits<double>::infinity();
double fYDerivation = std::numeric_limits<double>::infinity();
- aSplineX.reset(new lcl_SplineCalculation( std::move(aInputX), fXDerivation, fXDerivation ));
- aSplineY.reset(new lcl_SplineCalculation( std::move(aInputY), fYDerivation, fYDerivation ));
+ aSplineX.emplace(std::move(aInputX), fXDerivation, fXDerivation);
+ aSplineY.emplace(std::move(aInputY), fYDerivation, fYDerivation);
}
// fill result polygon with calculated values
@@ -690,29 +677,23 @@ void SplineCalculater::CalculateBSplines(
continue; // need at least 2 points, degree p needs at least n+1 points
// next piece of series
- std::unique_ptr<double[]> t(new double [n+1]);
- if (!createParameterT(aPointsIn, t.get()))
+ std::vector<double> t(n + 1);
+ if (!createParameterT(aPointsIn, t.data()))
{
continue; // next piece of series
}
lcl_tSizeType m = n + p + 1;
- std::unique_ptr<double[]> u(new double [m+1]);
- createKnotVector(n, p, t.get(), u.get());
+ std::vector<double> u(m + 1);
+ createKnotVector(n, p, t.data(), u.data());
// The matrix N contains the B-spline basis functions applied to parameters.
// In each row only p+1 adjacent elements are non-zero. The starting
// column in a higher row is equal or greater than in the lower row.
// To store this matrix the non-zero elements are shifted to column 0
// and the amount of shifting is remembered in an array.
- std::unique_ptr<double*[]> aMatN(new double*[n+1]);
- for (lcl_tSizeType row = 0; row <=n; ++row)
- {
- aMatN[row] = new double[p+1];
- for (sal_uInt32 col = 0; col <= p; ++col)
- aMatN[row][col] = 0.0;
- }
- std::unique_ptr<lcl_tSizeType[]> aShift(new lcl_tSizeType[n+1]);
+ std::vector<std::vector<double>> aMatN(n + 1, std::vector<double>(p + 1));
+ std::vector<lcl_tSizeType> aShift(n + 1);
aMatN[0][0] = 1.0; //all others are zero
aShift[0] = 0;
aMatN[n][0] = 1.0;
@@ -732,7 +713,7 @@ void SplineCalculater::CalculateBSplines(
// index in reduced matrix aMatN = (index in full matrix N) - (i-p)
aShift[k] = i - p;
- applyNtoParameterT(i, t[k], p, u.get(), aMatN[k]);
+ applyNtoParameterT(i, t[k], p, u.data(), aMatN[k].data());
} // next row k
// Get matrix C of control points from the matrix equation aMatN * C = aPointsIn
@@ -742,9 +723,6 @@ void SplineCalculater::CalculateBSplines(
lcl_tSizeType c = 0; // true column index
double fDivisor = 1.0; // used for diagonal element
double fEliminate = 1.0; // used for the element, that will become zero
- double fHelp;
- tPointType aHelp;
- lcl_tSizeType nHelp; // used in triangle change
bool bIsSuccessful = true;
for (c = 0 ; c <= n && bIsSuccessful; ++c)
{
@@ -764,18 +742,9 @@ void SplineCalculater::CalculateBSplines(
// exchange total row r with total row c if necessary
if (r != c)
{
- for ( sal_uInt32 i = 0; i <= p ; ++i)
- {
- fHelp = aMatN[r][i];
- aMatN[r][i] = aMatN[c][i];
- aMatN[c][i] = fHelp;
- }
- aHelp = aPointsIn[r];
- aPointsIn[r] = aPointsIn[c];
- aPointsIn[c] = aHelp;
- nHelp = aShift[r];
- aShift[r] = aShift[c];
- aShift[c] = nHelp;
+ std::swap( aMatN[r], aMatN[c] );
+ std::swap( aPointsIn[r], aPointsIn[c] );
+ std::swap( aShift[r], aShift[c] );
}
// divide row c, so that element(c,c) becomes 1
@@ -843,7 +812,7 @@ void SplineCalculater::CalculateBSplines(
pNew[nNewSize -1 ].PositionX = aPointsIn[n].first;
pNew[nNewSize -1 ].PositionY = aPointsIn[n].second;
pNew[nNewSize -1 ].PositionZ = fZCoordinate;
- std::unique_ptr<double[]> aP(new double[m+1]);
+ std::vector<double> aP(m + 1);
lcl_tSizeType nLow = 0;
for ( lcl_tSizeType nTIndex = 0; nTIndex <= n-1; ++nTIndex)
{
@@ -895,10 +864,6 @@ void SplineCalculater::CalculateBSplines(
}
}
}
- for (lcl_tSizeType row = 0; row <=n; ++row)
- {
- delete[] aMatN[row];
- }
} // next piece of the series
}
diff --git a/chart2/source/view/charttypes/Splines.hxx b/chart2/source/view/charttypes/Splines.hxx
index b83c13931b47..500536d84ca4 100644
--- a/chart2/source/view/charttypes/Splines.hxx
+++ b/chart2/source/view/charttypes/Splines.hxx
@@ -22,7 +22,6 @@
#include <sal/types.h>
#include <vector>
-namespace com::sun::star::drawing { struct PolyPolygonShape3D; }
namespace com::sun::star::drawing { struct Position3D; }
namespace chart
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index af54871ff49d..94d5a55bec32 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <cstddef>
#include <limits>
#include <memory>
#include <VSeriesPlotter.hxx>
@@ -25,18 +26,23 @@
#include <ShapeFactory.hxx>
#include <Diagram.hxx>
#include <BaseCoordinateSystem.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
#include <CommonConverters.hxx>
#include <ExplicitCategoriesProvider.hxx>
+#include <FormattedString.hxx>
#include <ObjectIdentifier.hxx>
#include <StatisticsHelper.hxx>
#include <PlottingPositionHelper.hxx>
#include <LabelPositionHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <Clipping.hxx>
#include <servicenames_charttypes.hxx>
#include <NumberFormatterWrapper.hxx>
#include <DataSeriesHelper.hxx>
+#include <RegressionCurveModel.hxx>
#include <RegressionCurveHelper.hxx>
#include <VLegendSymbolFactory.hxx>
#include <FormattedStringHelper.hxx>
@@ -48,6 +54,7 @@
//only for creation: @todo remove if all plotter are uno components and instantiated via servicefactory
#include "BarChart.hxx"
+#include "HistogramChart.hxx"
#include "PieChart.hxx"
#include "AreaChart.hxx"
#include "CandleStickChart.hxx"
@@ -61,9 +68,9 @@
#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/MovingAverageType.hpp>
#include <com/sun/star/chart2/XDataPointCustomLabelField.hpp>
-#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <o3tl/safeint.hxx>
#include <tools/color.hxx>
#include <tools/UnitConversion.hxx>
#include <rtl/ustrbuf.hxx>
@@ -71,13 +78,13 @@
#include <basegfx/vector/b2dvector.hxx>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <unotools/localedatawrapper.hxx>
#include <comphelper/sequence.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
#include <functional>
@@ -90,6 +97,7 @@ namespace chart {
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -137,12 +145,11 @@ sal_Int32 VDataSeriesGroup::getSeriesCount() const
return m_aSeriesVector.size();
}
-VSeriesPlotter::VSeriesPlotter( const uno::Reference<XChartType>& xChartTypeModel
+VSeriesPlotter::VSeriesPlotter( rtl::Reference<ChartType> xChartTypeModel
, sal_Int32 nDimensionCount, bool bCategoryXAxis )
: PlotterBase( nDimensionCount )
, m_pMainPosHelper( nullptr )
- , m_xChartTypeModel(xChartTypeModel)
- , m_xChartTypeModelProps( uno::Reference< beans::XPropertySet >::query( xChartTypeModel ))
+ , m_xChartTypeModel(std::move(xChartTypeModel))
, m_bCategoryXAxis(bCategoryXAxis)
, m_nTimeResolution(css::chart::TimeUnit::DAY)
, m_aNullDate(30,12,1899)
@@ -193,7 +200,7 @@ void VSeriesPlotter::addSeries( std::unique_ptr<VDataSeries> pSeries, sal_Int32
pSeries->setXValuesIfNone( m_pExplicitCategoriesProvider->getOriginalCategories() );
}
- if(zSlot<0 || zSlot>=static_cast<sal_Int32>(m_aZSlots.size()))
+ if(zSlot<0 || o3tl::make_unsigned(zSlot)>=m_aZSlots.size())
{
//new z slot
std::vector< VDataSeriesGroup > aZSlot;
@@ -205,7 +212,7 @@ void VSeriesPlotter::addSeries( std::unique_ptr<VDataSeries> pSeries, sal_Int32
//existing zslot
std::vector< VDataSeriesGroup >& rXSlots = m_aZSlots[zSlot];
- if(xSlot<0 || xSlot>=static_cast<sal_Int32>(rXSlots.size()))
+ if(xSlot<0 || o3tl::make_unsigned(xSlot)>=rXSlots.size())
{
//append the series to already existing x series
rXSlots.emplace_back( std::move(pSeries) );
@@ -394,7 +401,7 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
try
{
- const uno::Reference< css::beans::XPropertySet >& xPropertySet(
+ const uno::Reference< css::beans::XPropertySet > xPropertySet(
rDataSeries.getPropertiesOfPoint( nPointIndex ) );
if( xPropertySet.is() )
{
@@ -437,7 +444,7 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
{
uno::Reference< beans::XPropertySet > xProps( rDataSeries.getPropertiesOfPoint( nPointIndex ) );
if( xProps.is() )
- xProps->getPropertyValue( "CharHeight") >>= fViewFontSize;
+ xProps->getPropertyValue( u"CharHeight"_ustr) >>= fViewFontSize;
fViewFontSize = convertPointToMm100(fViewFontSize);
}
@@ -463,18 +470,18 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
//prepare text
bool bTextWrap = false;
- OUString aSeparator(" ");
+ OUString aSeparator(u" "_ustr);
double fRotationDegrees = 0.0;
try
{
uno::Reference< beans::XPropertySet > xPointProps( rDataSeries.getPropertiesOfPoint( nPointIndex ) );
if(xPointProps.is())
{
- xPointProps->getPropertyValue( "TextWordWrap" ) >>= bTextWrap;
- xPointProps->getPropertyValue( "LabelSeparator" ) >>= aSeparator;
+ xPointProps->getPropertyValue( u"TextWordWrap"_ustr ) >>= bTextWrap;
+ xPointProps->getPropertyValue( u"LabelSeparator"_ustr ) >>= aSeparator;
// Extract the optional text rotation through the
// "TextRotation" property attached to the passed data point.
- xPointProps->getPropertyValue( "TextRotation" ) >>= fRotationDegrees;
+ xPointProps->getPropertyValue( u"TextRotation"_ustr ) >>= fRotationDegrees;
}
}
catch( const uno::Exception& )
@@ -513,8 +520,8 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
OUString aRole;
if ( m_xChartTypeModel )
aRole = m_xChartTypeModel->getRoleOfSequenceForSeriesLabel();
- const uno::Reference< XDataSeries >& xSeries( rDataSeries.getModel() );
- pTextList[i] = DataSeriesHelper::getDataSeriesLabel( xSeries, aRole );
+ const rtl::Reference< DataSeries >& xSeries( rDataSeries.getModel() );
+ pTextList[i] = xSeries->getLabelForRole( aRole );
break;
}
case DataPointCustomLabelFieldType_PERCENTAGE:
@@ -571,8 +578,8 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
OUString aRole;
if ( m_xChartTypeModel )
aRole = m_xChartTypeModel->getRoleOfSequenceForSeriesLabel();
- const uno::Reference< XDataSeries >& xSeries( rDataSeries.getModel() );
- pTextList[1] = DataSeriesHelper::getDataSeriesLabel( xSeries, aRole );
+ const rtl::Reference< DataSeries >& xSeries( rDataSeries.getModel() );
+ pTextList[1] = xSeries->getLabelForRole( aRole );
}
if( pLabel->ShowNumber )
@@ -592,7 +599,7 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
}
}
- for( auto const & line : std::as_const(aTextList) )
+ for (auto const& line : aTextList)
{
if( !line.isEmpty() )
{
@@ -674,7 +681,7 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
// set maximum text width
uno::Any aTextMaximumFrameWidth( nTextWidth );
- xTextShape->SvxShape::setPropertyValue( "TextMaximumFrameWidth", aTextMaximumFrameWidth );
+ xTextShape->SvxShape::setPropertyValue( u"TextMaximumFrameWidth"_ustr, aTextMaximumFrameWidth );
// compute the total lines of text
aTextSize = xTextShape->getSize();
@@ -686,7 +693,7 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
if( fRotationDegrees != 0.0 )
{
const double fDegreesPi( -basegfx::deg2rad(fRotationDegrees) );
- xTextShape->SvxShape::setPropertyValue( "Transformation", ShapeFactory::makeTransformation( aScreenPosition2D, fDegreesPi ) );
+ xTextShape->SvxShape::setPropertyValue( u"Transformation"_ustr, ShapeFactory::makeTransformation( aScreenPosition2D, fDegreesPi ) );
LabelPositionHelper::correctPositionForRotation( xTextShape, eAlignment, fRotationDegrees, true /*bRotateAroundCenter*/ );
}
@@ -698,26 +705,20 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
{
xTextShape->setPosition(aRelPos);
if( !m_xChartTypeModel->getChartType().equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE) &&
- rDataSeries.getPropertiesOfSeries()->getPropertyValue( "ShowCustomLeaderLines" ).get<sal_Bool>())
+ // "ShowCustomLeaderLines"
+ rDataSeries.getModel()->getFastPropertyValue( PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES ).get<sal_Bool>())
{
+ const basegfx::B2IRectangle aRect(
+ BaseGFXHelper::makeRectangle(aRelPos, xTextShape->getSize()));
sal_Int32 nX1 = rScreenPosition2D.X;
sal_Int32 nY1 = rScreenPosition2D.Y;
- sal_Int32 nX2 = nX1;
- sal_Int32 nY2 = nY1;
- ::basegfx::B2IRectangle aRect(BaseGFXHelper::makeRectangle(aRelPos, xTextShape->getSize()));
- if (nX1 < aRelPos.X)
- nX2 = aRelPos.X;
- else if (nX1 > aRect.getMaxX())
- nX2 = aRect.getMaxX();
-
- if (nY1 < aRect.getMinY())
- nY2 = aRect.getMinY();
- else if (nY1 > aRect.getMaxY())
- nY2 = aRect.getMaxY();
+ const sal_Int32 nX2 = std::clamp(nX1, aRelPos.X, aRect.getMaxX());
+ const sal_Int32 nY2 = std::clamp(nY1, aRect.getMinY(), aRect.getMaxY());
//when the line is very short compared to the page size don't create one
::basegfx::B2DVector aLength(nX1 - nX2, nY1 - nY2);
- double fPageDiagonaleLength = sqrt(double(m_aPageReferenceSize.Width)*double(m_aPageReferenceSize.Width) + double(m_aPageReferenceSize.Height)*double(m_aPageReferenceSize.Height));
+ double fPageDiagonaleLength
+ = std::hypot(m_aPageReferenceSize.Width, m_aPageReferenceSize.Height);
if ((aLength.getLength() / fPageDiagonaleLength) >= 0.01)
{
drawing::PointSequenceSequence aPoints{ { {nX1, nY1}, {nX2, nY2} } };
@@ -731,13 +732,11 @@ rtl::Reference<SvxShapeText> VSeriesPlotter::createDataLabel( const rtl::Referen
// in case legend symbol has to be displayed, text shape position is
// slightly changed.
- const awt::Point aUnrotatedTextPos(xTextShape->getPosition());
if( xSymbol.is() )
{
- const awt::Point aOldTextPos( xTextShape->getPosition() );
- awt::Point aNewTextPos( aOldTextPos );
+ awt::Point aNewTextPos(xTextShape->getPosition());
- awt::Point aSymbolPosition( aUnrotatedTextPos );
+ awt::Point aSymbolPosition(aNewTextPos);
awt::Size aSymbolSize( xSymbol->getSize() );
awt::Size aTextSize = xTextShape->getSize();
@@ -805,8 +804,8 @@ double lcl_getErrorBarLogicLength(
{
double fPercent = 0;
if( xProp->getPropertyValue( bPositive
- ? OUString("PositiveError")
- : OUString("NegativeError") ) >>= fPercent )
+ ? u"PositiveError"_ustr
+ : u"NegativeError"_ustr ) >>= fPercent )
{
if( nIndex >=0 && nIndex < rData.getLength() &&
! std::isnan( rData[nIndex] ) &&
@@ -819,16 +818,16 @@ double lcl_getErrorBarLogicLength(
break;
case css::chart::ErrorBarStyle::ABSOLUTE:
xProp->getPropertyValue( bPositive
- ? OUString("PositiveError")
- : OUString("NegativeError") ) >>= fResult;
+ ? u"PositiveError"_ustr
+ : u"NegativeError"_ustr ) >>= fResult;
break;
case css::chart::ErrorBarStyle::ERROR_MARGIN:
{
// todo: check if this is really what's called error-margin
double fPercent = 0;
if( xProp->getPropertyValue( bPositive
- ? OUString("PositiveError")
- : OUString("NegativeError") ) >>= fPercent )
+ ? u"PositiveError"_ustr
+ : u"NegativeError"_ustr ) >>= fPercent )
{
double fMaxValue = -std::numeric_limits<double>::infinity();
for(double d : rData)
@@ -948,7 +947,7 @@ void VSeriesPlotter::createErrorBar(
, const double* pfScaledLogicX
)
{
- if( !ChartTypeHelper::isSupportingStatisticProperties( m_xChartTypeModel, m_nDimension ) )
+ if (!m_xChartTypeModel->isSupportingStatisticProperties(m_nDimension))
return;
if( ! xErrorBarProperties.is())
@@ -960,9 +959,9 @@ void VSeriesPlotter::createErrorBar(
bool bShowNegative = false;
sal_Int32 nErrorBarStyle = css::chart::ErrorBarStyle::VARIANCE;
- xErrorBarProperties->getPropertyValue( "ShowPositiveError") >>= bShowPositive;
- xErrorBarProperties->getPropertyValue( "ShowNegativeError") >>= bShowNegative;
- xErrorBarProperties->getPropertyValue( "ErrorBarStyle") >>= nErrorBarStyle;
+ xErrorBarProperties->getPropertyValue( u"ShowPositiveError"_ustr) >>= bShowPositive;
+ xErrorBarProperties->getPropertyValue( u"ShowNegativeError"_ustr) >>= bShowNegative;
+ xErrorBarProperties->getPropertyValue( u"ErrorBarStyle"_ustr) >>= nErrorBarStyle;
if(!bShowPositive && !bShowNegative)
return;
@@ -1041,7 +1040,21 @@ void VSeriesPlotter::createErrorBar(
fLocalX-=fLength;
aNegative = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
}
- bCreateNegativeBorder = m_pPosHelper->isLogicVisible( fLocalX, fLocalY, fZ);
+ if (std::isfinite(aNegative.PositionX) &&
+ std::isfinite(aNegative.PositionY) &&
+ std::isfinite(aNegative.PositionZ)) {
+ bCreateNegativeBorder = m_pPosHelper->isLogicVisible( fLocalX, fLocalY, fZ);
+ } else {
+ // If error bars result in a numerical problem (e.g., an
+ // error bar on a logarithmic chart that results in a point
+ // <= 0) then just turn off the error bar.
+ //
+ // TODO: This perhaps should display a warning, so the user
+ // knows why a bar is not appearing.
+ // TODO: This test could also be added to the positive case,
+ // though a numerical overflow there is less likely.
+ bShowNegative = false;
+ }
}
else
bShowNegative = false;
@@ -1088,10 +1101,7 @@ void VSeriesPlotter::addErrorBorder(
,const rtl::Reference<SvxShapeGroupAnyD>& rTarget
,const uno::Reference< beans::XPropertySet >& rErrorBorderProp )
{
- std::vector<std::vector<css::drawing::Position3D>> aPoly;
- sal_Int32 nSequenceIndex = 0;
- AddPointToPoly( aPoly, rPos0, nSequenceIndex );
- AddPointToPoly( aPoly, rPos1, nSequenceIndex );
+ std::vector<std::vector<css::drawing::Position3D>> aPoly { { rPos0, rPos1} };
rtl::Reference<SvxShapePolyPolygon> xShape = ShapeFactory::createLine2D(
rTarget, aPoly );
PropertyMapper::setMappedProperties( *xShape, rErrorBorderProp,
@@ -1129,7 +1139,7 @@ void VSeriesPlotter::createErrorRectangle(
rtl::Reference<SvxShapeGroupAnyD> xErrorBorder_ShapesY =
getErrorBarsGroupShape( rVDataSeries, rTarget, true );
- if( !ChartTypeHelper::isSupportingStatisticProperties( m_xChartTypeModel, m_nDimension ) )
+ if (!m_xChartTypeModel->isSupportingStatisticProperties(m_nDimension))
return;
try
@@ -1144,15 +1154,15 @@ void VSeriesPlotter::createErrorRectangle(
if ( bUseXErrorData )
{
- xErrorBorderPropX->getPropertyValue( "ErrorBarStyle" ) >>= nErrorBorderStyleX;
- xErrorBorderPropX->getPropertyValue( "ShowPositiveError") >>= bShowXPositive;
- xErrorBorderPropX->getPropertyValue( "ShowNegativeError") >>= bShowXNegative;
+ xErrorBorderPropX->getPropertyValue( u"ErrorBarStyle"_ustr ) >>= nErrorBorderStyleX;
+ xErrorBorderPropX->getPropertyValue( u"ShowPositiveError"_ustr) >>= bShowXPositive;
+ xErrorBorderPropX->getPropertyValue( u"ShowNegativeError"_ustr) >>= bShowXNegative;
}
if ( bUseYErrorData )
{
- xErrorBorderPropY->getPropertyValue( "ErrorBarStyle" ) >>= nErrorBorderStyleY;
- xErrorBorderPropY->getPropertyValue( "ShowPositiveError") >>= bShowYPositive;
- xErrorBorderPropY->getPropertyValue( "ShowNegativeError") >>= bShowYNegative;
+ xErrorBorderPropY->getPropertyValue( u"ErrorBarStyle"_ustr ) >>= nErrorBorderStyleY;
+ xErrorBorderPropY->getPropertyValue( u"ShowPositiveError"_ustr) >>= bShowYPositive;
+ xErrorBorderPropY->getPropertyValue( u"ShowNegativeError"_ustr) >>= bShowYNegative;
}
if ( bUseXErrorData && nErrorBorderStyleX == css::chart::ErrorBarStyle::NONE )
@@ -1178,8 +1188,8 @@ void VSeriesPlotter::createErrorRectangle(
double fScaledX = fX;
m_pPosHelper->doLogicScaling( &fScaledX, nullptr, nullptr );
- uno::Sequence< double > aDataX( rVDataSeries.getAllX() );
- uno::Sequence< double > aDataY( rVDataSeries.getAllY() );
+ const uno::Sequence< double >& aDataX( rVDataSeries.getAllX() );
+ const uno::Sequence< double >& aDataY( rVDataSeries.getAllY() );
double fPosX = 0.0;
double fPosY = 0.0;
@@ -1293,24 +1303,23 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries const & rVDataSer
{
if(m_nDimension!=2)
return;
- uno::Reference< XRegressionCurveContainer > xContainer( rVDataSeries.getModel(), uno::UNO_QUERY );
+ const rtl::Reference< DataSeries >& xContainer( rVDataSeries.getModel() );
if(!xContainer.is())
return;
if (!m_pPosHelper)
return;
- uno::Sequence< uno::Reference< XRegressionCurve > > aCurveList = xContainer->getRegressionCurves();
+ const std::vector< rtl::Reference< ::chart::RegressionCurveModel > > & aCurveList = xContainer->getRegressionCurves2();
- for(sal_Int32 nN=0; nN<aCurveList.getLength(); nN++)
+ for(std::size_t nN=0; nN<aCurveList.size(); nN++)
{
- uno::Reference< XRegressionCurveCalculator > xCalculator( aCurveList[nN]->getCalculator() );
+ const auto & rCurve = aCurveList[nN];
+ uno::Reference< XRegressionCurveCalculator > xCalculator( rCurve->getCalculator() );
if( !xCalculator.is())
continue;
- uno::Reference< beans::XPropertySet > xProperties( aCurveList[nN], uno::UNO_QUERY );
-
- bool bAverageLine = RegressionCurveHelper::isMeanValueLine( aCurveList[nN] );
+ bool bAverageLine = RegressionCurveHelper::isMeanValueLine( rCurve );
sal_Int32 aDegree = 2;
sal_Int32 aPeriod = 2;
@@ -1320,16 +1329,16 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries const & rVDataSer
bool bForceIntercept = false;
double aInterceptValue = 0.0;
- if ( xProperties.is() && !bAverageLine )
+ if ( !bAverageLine )
{
- xProperties->getPropertyValue( "PolynomialDegree") >>= aDegree;
- xProperties->getPropertyValue( "MovingAveragePeriod") >>= aPeriod;
- xProperties->getPropertyValue( "MovingAverageType") >>= aMovingAverageType;
- xProperties->getPropertyValue( "ExtrapolateForward") >>= aExtrapolateForward;
- xProperties->getPropertyValue( "ExtrapolateBackward") >>= aExtrapolateBackward;
- xProperties->getPropertyValue( "ForceIntercept") >>= bForceIntercept;
+ rCurve->getPropertyValue( u"PolynomialDegree"_ustr) >>= aDegree;
+ rCurve->getPropertyValue( u"MovingAveragePeriod"_ustr) >>= aPeriod;
+ rCurve->getPropertyValue( u"MovingAverageType"_ustr) >>= aMovingAverageType;
+ rCurve->getPropertyValue( u"ExtrapolateForward"_ustr) >>= aExtrapolateForward;
+ rCurve->getPropertyValue( u"ExtrapolateBackward"_ustr) >>= aExtrapolateBackward;
+ rCurve->getPropertyValue( u"ForceIntercept"_ustr) >>= bForceIntercept;
if (bForceIntercept)
- xProperties->getPropertyValue( "InterceptValue") >>= aInterceptValue;
+ rCurve->getPropertyValue( u"InterceptValue"_ustr) >>= aInterceptValue;
}
double fChartMinX = m_pPosHelper->getLogicMinX();
@@ -1414,26 +1423,26 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries const & rVDataSer
drawing::PolyPolygonShape3D aClippedPoly;
Clipping::clipPolygonAtRectangle( aRegressionPoly, m_pPosHelper->getScaledLogicClipDoubleRect(), aClippedPoly );
- aRegressionPoly = aClippedPoly;
+ aRegressionPoly = std::move(aClippedPoly);
m_pPosHelper->transformScaledLogicToScene( aRegressionPoly );
awt::Point aDefaultPos;
if( aRegressionPoly.SequenceX.hasElements() && aRegressionPoly.SequenceX[0].hasElements() )
{
VLineProperties aVLineProperties;
- aVLineProperties.initFromPropertySet( xProperties );
+ aVLineProperties.initFromPropertySet( rCurve );
//create an extra group shape for each curve for selection handling
rtl::Reference<SvxShapeGroupAnyD> xRegressionGroupShapes =
createGroupShape( xTarget, rVDataSeries.getDataCurveCID( nN, bAverageLine ) );
rtl::Reference<SvxShapePolyPolygon> xShape = ShapeFactory::createLine2D(
xRegressionGroupShapes, PolyToPointSequence( aRegressionPoly ), &aVLineProperties );
- ShapeFactory::setShapeName( xShape, "MarkHandles" );
+ ShapeFactory::setShapeName( xShape, u"MarkHandles"_ustr );
aDefaultPos = xShape->getPosition();
}
// curve equation and correlation coefficient
- uno::Reference< beans::XPropertySet > xEquationProperties( aCurveList[nN]->getEquationProperties());
+ uno::Reference< beans::XPropertySet > xEquationProperties( rCurve->getEquationProperties());
if( xEquationProperties.is())
{
createRegressionCurveEquationShapes(
@@ -1476,8 +1485,8 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
bool bShowEquation = false;
bool bShowCorrCoeff = false;
- if(!(( xEquationProperties->getPropertyValue( "ShowEquation") >>= bShowEquation ) &&
- ( xEquationProperties->getPropertyValue( "ShowCorrelationCoefficient") >>= bShowCorrCoeff )))
+ if(!(( xEquationProperties->getPropertyValue( u"ShowEquation"_ustr) >>= bShowEquation ) &&
+ ( xEquationProperties->getPropertyValue( u"ShowCorrelationCoefficient"_ustr) >>= bShowCorrCoeff )))
return;
if( ! (bShowEquation || bShowCorrCoeff))
@@ -1492,10 +1501,10 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
if ( bShowEquation )
{
OUString aXName, aYName;
- if ( !(xEquationProperties->getPropertyValue( "XName" ) >>= aXName) )
- aXName = OUString( "x" );
- if ( !(xEquationProperties->getPropertyValue( "YName" ) >>= aYName) )
- aYName = OUString( "f(x)" );
+ if ( !(xEquationProperties->getPropertyValue( u"XName"_ustr ) >>= aXName) )
+ aXName = u"x"_ustr;
+ if ( !(xEquationProperties->getPropertyValue( u"YName"_ustr ) >>= aYName) )
+ aYName = u"f(x)"_ustr;
xRegressionCurveCalculator->setXYNames( aXName, aYName );
}
@@ -1547,7 +1556,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
awt::Point aScreenPosition2D;
chart2::RelativePosition aRelativePosition;
- if( xEquationProperties->getPropertyValue( "RelativePosition") >>= aRelativePosition )
+ if( xEquationProperties->getPropertyValue( u"RelativePosition"_ustr) >>= aRelativePosition )
{
//@todo decide whether x is primary or secondary
double fX = aRelativePosition.Primary*m_aPageReferenceSize.Width;
@@ -1665,13 +1674,13 @@ double VSeriesPlotter::getMaximumX()
return fMaximum;
}
-double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
+std::pair<double, double> VSeriesPlotter::getMinimumAndMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
{
if( !m_bCategoryXAxis || ( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() ) )
{
double fMinY, fMaxY;
getMinimumAndMaximumYInContinuousXRange( fMinY, fMaxY, fMinimumX, fMaximumX, nAxisIndex );
- return fMinY;
+ return { fMinY, fMaxY };
}
double fMinimum = std::numeric_limits<double>::infinity();
@@ -1693,40 +1702,10 @@ double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, s
}
}
if(std::isinf(fMinimum))
- return std::numeric_limits<double>::quiet_NaN();
- return fMinimum;
-}
-
-double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
-{
- if( !m_bCategoryXAxis || ( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() ) )
- {
- double fMinY, fMaxY;
- getMinimumAndMaximumYInContinuousXRange( fMinY, fMaxY, fMinimumX, fMaximumX, nAxisIndex );
- return fMaxY;
- }
-
- double fMinimum = std::numeric_limits<double>::infinity();
- double fMaximum = -std::numeric_limits<double>::infinity();
- for( std::vector< VDataSeriesGroup > & rXSlots : m_aZSlots)
- {
- for(VDataSeriesGroup & rXSlot : rXSlots)
- {
- double fLocalMinimum, fLocalMaximum;
- rXSlot.calculateYMinAndMaxForCategoryRange(
- static_cast<sal_Int32>(fMinimumX-1.0) //first category (index 0) matches with real number 1.0
- , static_cast<sal_Int32>(fMaximumX-1.0) //first category (index 0) matches with real number 1.0
- , isSeparateStackingForDifferentSigns( 1 )
- , fLocalMinimum, fLocalMaximum, nAxisIndex );
- if(fMaximum<fLocalMaximum)
- fMaximum=fLocalMaximum;
- if(fMinimum>fLocalMinimum)
- fMinimum=fLocalMinimum;
- }
- }
+ fMinimum = std::numeric_limits<double>::quiet_NaN();
if(std::isinf(fMaximum))
- return std::numeric_limits<double>::quiet_NaN();
- return fMaximum;
+ fMaximum = std::numeric_limits<double>::quiet_NaN();
+ return { fMinimum, fMaximum };
}
double VSeriesPlotter::getMinimumZ()
@@ -1934,117 +1913,65 @@ namespace {
class PerXMinMaxCalculator
{
typedef std::pair<double, double> MinMaxType;
- typedef std::map<size_t, MinMaxType> SeriesMinMaxType;
+ typedef std::vector<MinMaxType> SeriesMinMaxType;
typedef std::map<double, SeriesMinMaxType> GroupMinMaxType;
- typedef std::unordered_map<double, MinMaxType> TotalStoreType;
GroupMinMaxType m_SeriesGroup;
+ size_t mnNumSeries;
size_t mnCurSeries;
public:
- PerXMinMaxCalculator() : mnCurSeries(0) {}
+ PerXMinMaxCalculator(size_t numSeries) : mnNumSeries(numSeries), mnCurSeries(0) {}
void nextSeries() { ++mnCurSeries; }
void setValue(double fX, double fY)
{
- SeriesMinMaxType* pStore = getByXValue(fX); // get storage for given X value.
- if (!pStore)
- // This shouldn't happen!
- return;
+ SeriesMinMaxType& rStore = m_SeriesGroup[fX]; // get storage for given X value.
+ if (rStore.empty())
+ rStore.resize(mnNumSeries, { std::numeric_limits<double>::max(), std::numeric_limits<double>::min() });
- SeriesMinMaxType::iterator it = pStore->lower_bound(mnCurSeries);
- if (it != pStore->end() && !pStore->key_comp()(mnCurSeries, it->first))
- {
- MinMaxType& r = it->second;
- // A min-max pair already exists for this series. Update it.
- if (fY < r.first)
- r.first = fY;
- if (r.second < fY)
- r.second = fY;
- }
- else
- {
- // No existing pair. Insert a new one.
- pStore->insert(
- it, SeriesMinMaxType::value_type(
- mnCurSeries, MinMaxType(fY,fY)));
- }
+ MinMaxType& r = rStore[mnCurSeries];
+ if (fY < r.first)
+ r.first = fY;
+ if (r.second < fY)
+ r.second = fY;
}
void getTotalRange(double& rfMin, double& rfMax) const
{
- TotalStoreType aStore;
- getTotalStore(aStore);
-
- if (aStore.empty())
+ if (m_SeriesGroup.empty())
{
rfMin = std::numeric_limits<double>::quiet_NaN();
rfMax = std::numeric_limits<double>::quiet_NaN();
return;
}
- TotalStoreType::const_iterator it = aStore.begin(), itEnd = aStore.end();
- rfMin = it->second.first;
- rfMax = it->second.second;
- for (++it; it != itEnd; ++it)
- {
- if (rfMin > it->second.first)
- rfMin = it->second.first;
- if (rfMax < it->second.second)
- rfMax = it->second.second;
- }
- }
+ rfMin = std::numeric_limits<double>::max();
+ rfMax = std::numeric_limits<double>::min();
-private:
- /**
- * Parse all data and reduce them into a set of global Y value ranges per
- * X value.
- */
- void getTotalStore(TotalStoreType& rStore) const
- {
- TotalStoreType aStore;
+ /**
+ * For each, X value, calculate Y value range
+ */
for (auto const& it : m_SeriesGroup)
{
- double fX = it.first;
-
const SeriesMinMaxType& rSeries = it.second;
- for (auto const& series : rSeries)
+ MinMaxType aPerXMinMax { std::numeric_limits<double>::max(), 0.0 };
+ for (MinMaxType const& series : rSeries)
{
- double fYMin = series.second.first, fYMax = series.second.second;
- TotalStoreType::iterator itr = aStore.find(fX);
- if (itr == aStore.end())
- // New min-max pair for give X value.
- aStore.emplace(fX, std::pair<double,double>(fYMin,fYMax));
- else
- {
- MinMaxType& r = itr->second;
- if (fYMin < r.first)
- r.first = fYMin; // min y-value
+ double fYMin = series.first, fYMax = series.second;
+ if (fYMin < aPerXMinMax.first)
+ aPerXMinMax.first = fYMin; // min y-value
- r.second += fYMax; // accumulative max y-value.
- }
+ aPerXMinMax.second += fYMax; // accumulative max y-value.
}
- }
- rStore.swap(aStore);
- }
- SeriesMinMaxType* getByXValue(double fX)
- {
- GroupMinMaxType::iterator it = m_SeriesGroup.find(fX);
- if (it == m_SeriesGroup.end())
- {
- std::pair<GroupMinMaxType::iterator,bool> r =
- m_SeriesGroup.insert(std::make_pair(fX, SeriesMinMaxType{}));
-
- if (!r.second)
- // insertion failed.
- return nullptr;
-
- it = r.first;
+ if (rfMin > aPerXMinMax.first)
+ rfMin = aPerXMinMax.first;
+ if (rfMax < aPerXMinMax.second)
+ rfMax = aPerXMinMax.second;
}
-
- return &it->second;
}
+
};
}
@@ -2059,17 +1986,26 @@ void VDataSeriesGroup::getMinimumAndMaximumYInContinuousXRange(
// No data series. Bail out.
return;
- PerXMinMaxCalculator aRangeCalc;
+ size_t nNumSeries = 0;
for (const std::unique_ptr<VDataSeries> & pSeries : m_aSeriesVector)
{
if (!pSeries)
continue;
+ if (nAxisIndex != pSeries->getAttachedAxisIndex())
+ continue;
+ nNumSeries++;
+ }
+
+ PerXMinMaxCalculator aRangeCalc(nNumSeries);
+ for (const std::unique_ptr<VDataSeries> & pSeries : m_aSeriesVector)
+ {
+ if (!pSeries)
+ continue;
+ if (nAxisIndex != pSeries->getAttachedAxisIndex())
+ continue;
for (sal_Int32 i = 0, n = pSeries->getTotalPointCount(); i < n; ++i)
{
- if (nAxisIndex != pSeries->getAttachedAxisIndex())
- continue;
-
double fX = pSeries->getXValue(i);
if (std::isnan(fX))
continue;
@@ -2289,12 +2225,84 @@ OUString VSeriesPlotter::getCategoryName( sal_Int32 nPointIndex ) const
return OUString();
}
-uno::Sequence< OUString > VSeriesPlotter::getSeriesNames() const
+namespace {
+// The following it to support rendering order for combo charts. A chart type
+// with a lower rendering order is rendered before (i.e., behind) a chart with a
+// higher rendering order. The rendering orders are based on rough guesses about
+// how much one chart (type) will obscure another chart (type). The intent is to
+// minimize obscuring of data, by putting charts that generally cover more
+// pixels (e.g., area charts) behind ones that generally cover fewer (e.g., line
+// charts).
+struct ROrderPair
+{
+ ROrderPair(OUString n, sal_Int32 r) : chartName(std::move(n)), renderOrder(r) {}
+
+ OUString chartName;
+ sal_Int32 renderOrder;
+};
+
+const ROrderPair pairList[] = {
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_AREA, 0),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_BAR, 6), // bar & column are same
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN, 6),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM, 9),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_LINE, 8),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER, 5),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_PIE, 1),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_NET, 3),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET, 2),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK, 7),
+ ROrderPair(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE, 4)
+};
+} // unnamed
+
+sal_Int32 VSeriesPlotter::getRenderOrder() const
+{
+ OUString aChartType = m_xChartTypeModel->getChartType();
+ for (const auto& elem : pairList) {
+ if (aChartType.equalsIgnoreAsciiCase(elem.chartName)) {
+ return elem.renderOrder;
+ }
+ }
+ SAL_WARN("chart2", "Unsupported chart type in getRenderOrder()");
+ return 0;
+}
+
+std::vector<VDataSeries const*> VSeriesPlotter::getAllSeries() const
+{
+ std::vector<VDataSeries const*> aAllSeries;
+ for (std::vector<VDataSeriesGroup> const & rXSlot : m_aZSlots)
+ {
+ for(VDataSeriesGroup const & rGroup : rXSlot)
+ {
+ for (std::unique_ptr<VDataSeries> const & p : rGroup.m_aSeriesVector)
+ aAllSeries.push_back(p.get());
+ }
+ }
+ return aAllSeries;
+}
+
+
+std::vector<VDataSeries*> VSeriesPlotter::getAllSeries()
+{
+ std::vector<VDataSeries*> aAllSeries;
+ for (std::vector<VDataSeriesGroup> const & rXSlot : m_aZSlots)
+ {
+ for(VDataSeriesGroup const & rGroup : rXSlot)
+ {
+ for (std::unique_ptr<VDataSeries> const & p : rGroup.m_aSeriesVector)
+ aAllSeries.push_back(p.get());
+ }
+ }
+ return aAllSeries;
+}
+
+uno::Sequence<OUString> VSeriesPlotter::getSeriesNames() const
{
std::vector<OUString> aRetVector;
OUString aRole;
- if( m_xChartTypeModel.is() )
+ if (m_xChartTypeModel.is())
aRole = m_xChartTypeModel->getRoleOfSequenceForSeriesLabel();
for (auto const& rGroup : m_aZSlots)
@@ -2305,10 +2313,10 @@ uno::Sequence< OUString > VSeriesPlotter::getSeriesNames() const
if (!rSeriesGroup.m_aSeriesVector.empty())
{
VDataSeries const * pSeries = rSeriesGroup.m_aSeriesVector[0].get();
- uno::Reference< XDataSeries > xSeries( pSeries ? pSeries->getModel() : nullptr );
+ rtl::Reference< DataSeries > xSeries( pSeries ? pSeries->getModel() : nullptr );
if( xSeries.is() )
{
- OUString aSeriesName( DataSeriesHelper::getDataSeriesLabel( xSeries, aRole ) );
+ OUString aSeriesName( xSeries->getLabelForRole( aRole ) );
aRetVector.push_back( aSeriesName );
}
}
@@ -2317,6 +2325,25 @@ uno::Sequence< OUString > VSeriesPlotter::getSeriesNames() const
return comphelper::containerToSequence( aRetVector );
}
+uno::Sequence<OUString> VSeriesPlotter::getAllSeriesNames() const
+{
+ std::vector<OUString> aRetVector;
+
+ OUString aRole;
+ if (m_xChartTypeModel.is())
+ aRole = m_xChartTypeModel->getRoleOfSequenceForSeriesLabel();
+
+ for (VDataSeries const* pSeries : getAllSeries())
+ {
+ if (pSeries)
+ {
+ OUString aSeriesName(pSeries->getModel()->getLabelForRole(aRole));
+ aRetVector.push_back(aSeriesName);
+ }
+ }
+ return comphelper::containerToSequence(aRetVector);
+}
+
void VSeriesPlotter::setPageReferenceSize( const css::awt::Size & rPageRefSize )
{
m_aPageReferenceSize = rPageRefSize;
@@ -2341,7 +2368,7 @@ void VSeriesPlotter::setCoordinateSystemResolution( const Sequence< sal_Int32 >&
bool VSeriesPlotter::WantToPlotInFrontOfAxisLine()
{
- return ChartTypeHelper::isSeriesInFrontOfAxisLine( m_xChartTypeModel );
+ return m_xChartTypeModel->isSeriesInFrontOfAxisLine();
}
bool VSeriesPlotter::shouldSnapRectToUsedArea()
@@ -2368,7 +2395,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntries(
try
{
- xCooSys->getPropertyValue( "SwapXAndYAxis" ) >>= bSwapXAndY;
+ xCooSys->getPropertyValue( u"SwapXAndYAxis"_ustr ) >>= bSwapXAndY;
}
catch( const uno::Exception& )
{
@@ -2388,7 +2415,8 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntries(
if (!pSeries)
continue;
- if (!pSeries->getPropertiesOfSeries()->getPropertyValue("ShowLegendEntry").get<sal_Bool>())
+ // "ShowLegendEntry"
+ if (!pSeries->getModel()->getFastPropertyValue(PROP_DATASERIES_SHOW_LEGEND_ENTRY).get<sal_Bool>())
{
continue;
}
@@ -2434,18 +2462,45 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntries(
return aResult;
}
-std::vector<VDataSeries*> VSeriesPlotter::getAllSeries()
+std::vector<ViewLegendSymbol> VSeriesPlotter::createSymbols(const awt::Size& rEntryKeyAspectRatio
+ , const rtl::Reference<SvxShapeGroupAnyD>& xTarget
+ , const Reference<uno::XComponentContext>& xContext)
{
- std::vector<VDataSeries*> aAllSeries;
- for (std::vector<VDataSeriesGroup> const & rXSlot : m_aZSlots)
+ std::vector<ViewLegendSymbol> aResult;
+
+ if( xTarget.is() )
{
- for(VDataSeriesGroup const & rGroup : rXSlot)
+ bool bBreak = false;
+ bool bFirstSeries = true;
+
+ for (std::vector<VDataSeriesGroup> const & rGroupVector : m_aZSlots)
{
- for (std::unique_ptr<VDataSeries> const & p : rGroup.m_aSeriesVector)
- aAllSeries.push_back(p.get());
+ for (VDataSeriesGroup const & rGroup : rGroupVector)
+ {
+ for (std::unique_ptr<VDataSeries> const & pSeries : rGroup.m_aSeriesVector)
+ {
+ if (!pSeries)
+ continue;
+
+ std::vector<ViewLegendSymbol> aSeriesSymbols = createSymbolsForSeries(rEntryKeyAspectRatio, *pSeries, xTarget, xContext);
+
+ //add series entries to the result now
+
+ // use only the first series if VaryColorsByPoint is set for the first series
+ if (bFirstSeries && pSeries->isVaryColorsByPoint())
+ bBreak = true;
+
+ bFirstSeries = false;
+
+ aResult.insert(aResult.end(), aSeriesSymbols.begin(), aSeriesSymbols.end());
+ }
+ if (bBreak)
+ return aResult;
+ }
}
}
- return aAllSeries;
+
+ return aResult;
}
namespace
@@ -2455,7 +2510,7 @@ bool lcl_HasVisibleLine( const uno::Reference< beans::XPropertySet >& xProps, bo
bool bHasVisibleLine = false;
rbHasDashedLine = false;
drawing::LineStyle aLineStyle = drawing::LineStyle_NONE;
- if( xProps.is() && ( xProps->getPropertyValue( "LineStyle") >>= aLineStyle ) )
+ if( xProps.is() && ( xProps->getPropertyValue( u"LineStyle"_ustr) >>= aLineStyle ) )
{
if( aLineStyle != drawing::LineStyle_NONE )
bHasVisibleLine = true;
@@ -2468,19 +2523,11 @@ bool lcl_HasVisibleLine( const uno::Reference< beans::XPropertySet >& xProps, bo
bool lcl_HasRegressionCurves( const VDataSeries& rSeries, bool& rbHasDashedLine )
{
bool bHasRegressionCurves = false;
- Reference< XRegressionCurveContainer > xRegrCont( rSeries.getModel(), uno::UNO_QUERY );
- if( xRegrCont.is())
+ const rtl::Reference< DataSeries >& xRegrCont( rSeries.getModel() );
+ for( const rtl::Reference< RegressionCurveModel > & rCurve : xRegrCont->getRegressionCurves2() )
{
- Sequence< Reference< XRegressionCurve > > aCurves( xRegrCont->getRegressionCurves() );
- sal_Int32 i = 0, nCount = aCurves.getLength();
- for( i=0; i<nCount; ++i )
- {
- if( aCurves[i].is() )
- {
- bHasRegressionCurves = true;
- lcl_HasVisibleLine( uno::Reference< beans::XPropertySet >( aCurves[i], uno::UNO_QUERY ), rbHasDashedLine );
- }
- }
+ bHasRegressionCurves = true;
+ lcl_HasVisibleLine( rCurve, rbHasDashedLine );
}
return bHasRegressionCurves;
}
@@ -2596,7 +2643,7 @@ rtl::Reference< SvxShapeGroup > VSeriesPlotter::createLegendSymbolForPoint(
// the default properties for the data point are the data series properties.
// If a data point has own attributes overwrite them
- Reference< beans::XPropertySet > xSeriesProps( rSeries.getPropertiesOfSeries() );
+ const Reference< beans::XPropertySet >& xSeriesProps( rSeries.getPropertiesOfSeries() );
Reference< beans::XPropertySet > xPointSet( xSeriesProps );
if( rSeries.isAttributedDataPoint( nPointIndex ) )
xPointSet.set( rSeries.getPropertiesOfPoint( nPointIndex ));
@@ -2614,7 +2661,7 @@ rtl::Reference< SvxShapeGroup > VSeriesPlotter::createLegendSymbolForPoint(
OSL_ASSERT( xPointSet.is());
xPointSet->setPropertyValue(
- "Color", uno::Any( m_xColorScheme->getColorByIndex( nPointIndex )));
+ u"Color"_ustr, uno::Any( m_xColorScheme->getColorByIndex( nPointIndex )));
}
}
@@ -2646,10 +2693,11 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
CHART2_SERVICE_NAME_CHARTTYPE_PIE);
try
{
- if (bIsPie && m_xChartTypeModelProps.is())
+ if (bIsPie)
{
bool bDonut = false;
- if ((m_xChartTypeModelProps->getPropertyValue("UseRings") >>= bDonut) && bDonut)
+ // "UseRings"
+ if ((m_xChartTypeModel->getFastPropertyValue(PROP_PIECHARTTYPE_USE_RINGS) >>= bDonut) && bDonut)
bIsPie = false;
}
}
@@ -2665,7 +2713,8 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
Sequence<sal_Int32> deletedLegendEntries;
try
{
- rSeries.getPropertiesOfSeries()->getPropertyValue("DeletedLegendEntries") >>= deletedLegendEntries;
+ // "DeletedLegendEntries"
+ rSeries.getModel()->getFastPropertyValue(PROP_DATASERIES_DELETED_LEGEND_ENTRIES) >>= deletedLegendEntries;
}
catch (const uno::Exception&)
{
@@ -2673,7 +2722,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
for( sal_Int32 nIdx=0; nIdx<aCategoryNames.getLength(); ++nIdx )
{
bool deletedLegendEntry = false;
- for (const auto& deletedLegendEntryIdx : std::as_const(deletedLegendEntries))
+ for (const auto& deletedLegendEntryIdx : deletedLegendEntries)
{
if (nIdx == deletedLegendEntryIdx)
{
@@ -2694,7 +2743,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
// set CID to symbol for selection
if( xShape.is() )
{
- aEntry.xSymbol = xSymbolGroup;
+ aEntry.xSymbol = std::move(xSymbolGroup);
OUString aChildParticle( ObjectIdentifier::createChildParticleWithIndex( OBJECTTYPE_DATA_POINT, nIdx ) );
aChildParticle = ObjectIdentifier::addChildParticle( aChildParticle, ObjectIdentifier::createChildParticleWithIndex( OBJECTTYPE_LEGEND_ENTRY, 0 ) );
@@ -2706,7 +2755,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
aLabelText = aCategoryNames[nIdx];
if( xShape.is() || !aLabelText.isEmpty() )
{
- aEntry.aLabel = FormattedStringHelper::createFormattedStringSequence( xContext, aLabelText, xTextProperties );
+ aEntry.xLabel = FormattedStringHelper::createFormattedString( aLabelText, xTextProperties );
aResult.push_back(aEntry);
}
}
@@ -2723,7 +2772,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
// set CID to symbol for selection
if( xShape.is())
{
- aEntry.xSymbol = xSymbolGroup;
+ aEntry.xSymbol = std::move(xSymbolGroup);
OUString aChildParticle( ObjectIdentifier::createChildParticleWithIndex( OBJECTTYPE_LEGEND_ENTRY, 0 ) );
OUString aCID = ObjectIdentifier::createClassifiedIdentifierForParticles( rSeries.getSeriesParticle(), aChildParticle );
@@ -2731,55 +2780,52 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
}
// label
- aLabelText = DataSeriesHelper::getDataSeriesLabel( rSeries.getModel(), m_xChartTypeModel.is() ? m_xChartTypeModel->getRoleOfSequenceForSeriesLabel() : "values-y");
- aEntry.aLabel = FormattedStringHelper::createFormattedStringSequence( xContext, aLabelText, xTextProperties );
+ aLabelText = rSeries.getModel()->getLabelForRole( m_xChartTypeModel.is() ? m_xChartTypeModel->getRoleOfSequenceForSeriesLabel() : u"values-y"_ustr);
+ aEntry.xLabel = FormattedStringHelper::createFormattedString( aLabelText, xTextProperties );
aResult.push_back(aEntry);
}
// don't show legend entry of regression curve & friends if this type of chart
// doesn't support statistics #i63016#, fdo#37197
- if (!ChartTypeHelper::isSupportingStatisticProperties( m_xChartTypeModel, m_nDimension ))
+ if (!m_xChartTypeModel->isSupportingStatisticProperties(m_nDimension))
return aResult;
- Reference< XRegressionCurveContainer > xRegrCont( rSeries.getModel(), uno::UNO_QUERY );
+ const rtl::Reference< DataSeries >& xRegrCont = rSeries.getModel();
if( xRegrCont.is())
{
- Sequence< Reference< XRegressionCurve > > aCurves( xRegrCont->getRegressionCurves());
- sal_Int32 i = 0, nCount = aCurves.getLength();
+ const std::vector< rtl::Reference< RegressionCurveModel > > & aCurves = xRegrCont->getRegressionCurves2();
+ sal_Int32 i = 0, nCount = aCurves.size();
for( i=0; i<nCount; ++i )
{
- if( aCurves[i].is() )
+ //label
+ OUString aResStr( RegressionCurveHelper::getUINameForRegressionCurve( aCurves[i] ) );
+ replaceParamterInString( aResStr, u"%SERIESNAME", aLabelText );
+ aEntry.xLabel = FormattedStringHelper::createFormattedString( aResStr, xTextProperties );
+
+ // symbol
+ rtl::Reference<SvxShapeGroup> xSymbolGroup(ShapeFactory::createGroup2D( xTarget ));
+
+ // create the symbol
+ rtl::Reference<SvxShapeGroup> xShape = VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
+ xSymbolGroup, LegendSymbolStyle::Line,
+ aCurves[i],
+ VLegendSymbolFactory::PropertyType::Line, uno::Any() );
+
+ // set CID to symbol for selection
+ if( xShape.is())
{
- //label
- OUString aResStr( RegressionCurveHelper::getUINameForRegressionCurve( aCurves[i] ) );
- replaceParamterInString( aResStr, "%SERIESNAME", aLabelText );
- aEntry.aLabel = FormattedStringHelper::createFormattedStringSequence( xContext, aResStr, xTextProperties );
-
- // symbol
- rtl::Reference<SvxShapeGroup> xSymbolGroup(ShapeFactory::createGroup2D( xTarget ));
-
- // create the symbol
- rtl::Reference<SvxShapeGroup> xShape = VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
- xSymbolGroup, LegendSymbolStyle::Line,
- Reference< beans::XPropertySet >( aCurves[i], uno::UNO_QUERY ),
- VLegendSymbolFactory::PropertyType::Line, uno::Any() );
-
- // set CID to symbol for selection
- if( xShape.is())
- {
- aEntry.xSymbol = xSymbolGroup;
-
- bool bAverageLine = RegressionCurveHelper::isMeanValueLine( aCurves[i] );
- ObjectType eObjectType = bAverageLine ? OBJECTTYPE_DATA_AVERAGE_LINE : OBJECTTYPE_DATA_CURVE;
- OUString aChildParticle( ObjectIdentifier::createChildParticleWithIndex( eObjectType, i ) );
- aChildParticle = ObjectIdentifier::addChildParticle( aChildParticle, ObjectIdentifier::createChildParticleWithIndex( OBJECTTYPE_LEGEND_ENTRY, 0 ) );
- OUString aCID = ObjectIdentifier::createClassifiedIdentifierForParticles( rSeries.getSeriesParticle(), aChildParticle );
- ShapeFactory::setShapeName( xShape, aCID );
- }
+ aEntry.xSymbol = std::move(xSymbolGroup);
- aResult.push_back(aEntry);
+ bool bAverageLine = RegressionCurveHelper::isMeanValueLine( aCurves[i] );
+ ObjectType eObjectType = bAverageLine ? OBJECTTYPE_DATA_AVERAGE_LINE : OBJECTTYPE_DATA_CURVE;
+ OUString aChildParticle( ObjectIdentifier::createChildParticleWithIndex( eObjectType, i ) );
+ aChildParticle = ObjectIdentifier::addChildParticle( aChildParticle, ObjectIdentifier::createChildParticleWithIndex( OBJECTTYPE_LEGEND_ENTRY, 0 ) );
+ OUString aCID = ObjectIdentifier::createClassifiedIdentifierForParticles( rSeries.getSeriesParticle(), aChildParticle );
+ ShapeFactory::setShapeName( xShape, aCID );
}
+
+ aResult.push_back(aEntry);
}
}
}
@@ -2790,8 +2836,42 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
return aResult;
}
+std::vector<ViewLegendSymbol> VSeriesPlotter::createSymbolsForSeries(
+ const awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
+ , const rtl::Reference<SvxShapeGroupAnyD>& xTarget
+ , const Reference<uno::XComponentContext>& xContext)
+{
+ std::vector<ViewLegendSymbol> aResult;
+
+ if (!(xTarget.is() && xContext.is()))
+ return aResult;
+
+ try
+ {
+ ViewLegendSymbol aEntry;
+ // symbol
+ rtl::Reference<SvxShapeGroup> xSymbolGroup(ShapeFactory::createGroup2D(xTarget));
+
+ // create the symbol
+ rtl::Reference<SvxShapeGroup> xShape = createLegendSymbolForSeries(rEntryKeyAspectRatio, rSeries, xSymbolGroup );
+
+ // set CID to symbol for selection
+ if (xShape.is())
+ {
+ aEntry.xSymbol = std::move(xSymbolGroup);
+ aResult.push_back(aEntry);
+ }
+ }
+ catch (const uno::Exception &)
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2" );
+ }
+ return aResult;
+}
+
VSeriesPlotter* VSeriesPlotter::createSeriesPlotter(
- const uno::Reference<XChartType>& xChartTypeModel
+ const rtl::Reference<ChartType>& xChartTypeModel
, sal_Int32 nDimensionCount
, bool bExcludingPositioning )
{
@@ -2805,6 +2885,8 @@ VSeriesPlotter* VSeriesPlotter::createSeriesPlotter(
pRet = new BarChart(xChartTypeModel,nDimensionCount);
else if( aChartType.equalsIgnoreAsciiCase( CHART2_SERVICE_NAME_CHARTTYPE_BAR ) )
pRet = new BarChart(xChartTypeModel,nDimensionCount);
+ else if( aChartType.equalsIgnoreAsciiCase( CHART2_SERVICE_NAME_CHARTTYPE_HISTOGRAM ) )
+ pRet = new HistogramChart(xChartTypeModel, nDimensionCount);
else if( aChartType.equalsIgnoreAsciiCase( CHART2_SERVICE_NAME_CHARTTYPE_AREA ) )
pRet = new AreaChart(xChartTypeModel,nDimensionCount,true);
else if( aChartType.equalsIgnoreAsciiCase( CHART2_SERVICE_NAME_CHARTTYPE_LINE ) )
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index 8deea35e2d48..1806483ff598 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -19,11 +19,13 @@
#include <ShapeFactory.hxx>
#include <VDiagram.hxx>
+#include <Diagram.hxx>
#include <PropertyMapper.hxx>
#include <ViewDefines.hxx>
#include <Stripe.hxx>
#include <ObjectIdentifier.hxx>
#include <DiagramHelper.hxx>
+#include <ChartType.hxx>
#include <BaseGFXHelper.hxx>
#include <ChartTypeHelper.hxx>
#include <ThreeDHelper.hxx>
@@ -31,7 +33,7 @@
#include <editeng/unoprnms.hxx>
#include <svx/scene3d.hxx>
#include <svx/e3dsceneupdater.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -39,7 +41,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
VDiagram::VDiagram(
- const uno::Reference<XDiagram> & xDiagram, const drawing::Direction3D& rPreferredAspectRatio,
+ const rtl::Reference<Diagram> & xDiagram, const drawing::Direction3D& rPreferredAspectRatio,
sal_Int32 nDimension )
: m_nDimensionCount(nDimension)
, m_xDiagram(xDiagram)
@@ -52,13 +54,12 @@ VDiagram::VDiagram(
if( m_nDimensionCount != 3)
return;
- uno::Reference< beans::XPropertySet > xSourceProp( m_xDiagram, uno::UNO_QUERY );
- ThreeDHelper::getRotationAngleFromDiagram( xSourceProp, m_fXAnglePi, m_fYAnglePi, m_fZAnglePi );
- if( ChartTypeHelper::isSupportingRightAngledAxes(
- DiagramHelper::getChartTypeByIndex( m_xDiagram, 0 ) ) )
+ xDiagram->getRotationAngle( m_fXAnglePi, m_fYAnglePi, m_fZAnglePi );
+ auto xChartType = m_xDiagram->getChartTypeByIndex(0);
+ if (xChartType.is() ? xChartType->isSupportingRightAngledAxes() : true)
{
- if(xSourceProp.is())
- xSourceProp->getPropertyValue("RightAngledAxes") >>= m_bRightAngledAxes;
+ if(xDiagram.is())
+ xDiagram->getPropertyValue(u"RightAngledAxes"_ustr) >>= m_bRightAngledAxes;
if( m_bRightAngledAxes )
{
ThreeDHelper::adaptRadAnglesForRightAngledAxes( m_fXAnglePi, m_fYAnglePi );
@@ -137,12 +138,12 @@ void VDiagram::createShapes_2d()
rtl::Reference<SvxShapeGroupAnyD> xOuterGroup_Shapes = ShapeFactory::createGroup2D(m_xTarget);
m_xOuterGroupShape = xOuterGroup_Shapes;
- rtl::Reference<SvxShapeGroupAnyD> xGroupForWall( ShapeFactory::createGroup2D(xOuterGroup_Shapes,"PlotAreaExcludingAxes") );
+ rtl::Reference<SvxShapeGroupAnyD> xGroupForWall( ShapeFactory::createGroup2D(xOuterGroup_Shapes,u"PlotAreaExcludingAxes"_ustr) );
//create independent group shape as container for datapoints and such things
- m_xCoordinateRegionShape = ShapeFactory::createGroup2D(xOuterGroup_Shapes,"testonly;CooContainer=XXX_CID");
+ m_xCoordinateRegionShape = ShapeFactory::createGroup2D(xOuterGroup_Shapes,u"testonly;CooContainer=XXX_CID"_ustr);
- bool bAddFloorAndWall = DiagramHelper::isSupportingFloorAndWall( m_xDiagram );
+ bool bAddFloorAndWall = m_xDiagram->isSupportingFloorAndWall();
//add back wall
{
@@ -182,7 +183,7 @@ void VDiagram::createShapes_2d()
static E3dScene* lcl_getE3dScene( const rtl::Reference<SvxShapeGroupAnyD>& xShape )
{
- return dynamic_cast< E3dScene* >(xShape->GetSdrObject());
+ return DynCastE3dScene(xShape->GetSdrObject());
}
static void lcl_setLightSources(
@@ -431,17 +432,20 @@ void VDiagram::createShapes_3d()
return;
//create shape
- rtl::Reference<Svx3DSceneObject> xShapes = ShapeFactory::createGroup3D( m_xTarget, "PlotAreaExcludingAxes" );
+ rtl::Reference<Svx3DSceneObject> xShapes = ShapeFactory::createGroup3D( m_xTarget, u"PlotAreaExcludingAxes"_ustr );
m_xOuterGroupShape = xShapes;
rtl::Reference<SvxShapeGroupAnyD> xOuterGroup_Shapes = m_xOuterGroupShape;
//create additional group to manipulate the aspect ratio of the whole diagram:
- xOuterGroup_Shapes = ShapeFactory::createGroup3D( xOuterGroup_Shapes );
+ {
+ rtl::Reference<Svx3DSceneObject> xAdditionalGroup = ShapeFactory::createGroup3D( xOuterGroup_Shapes );
+ xOuterGroup_Shapes = xAdditionalGroup;
- m_xAspectRatio3D = xOuterGroup_Shapes;
+ m_xAspectRatio3D = std::move(xAdditionalGroup);
+ }
- bool bAddFloorAndWall = DiagramHelper::isSupportingFloorAndWall( m_xDiagram );
+ bool bAddFloorAndWall = m_xDiagram->isSupportingFloorAndWall();
const bool bDoubleSided = false;
@@ -456,8 +460,8 @@ void VDiagram::createShapes_3d()
aWallCID.clear();
rtl::Reference<Svx3DSceneObject> xWallGroup_Shapes = ShapeFactory::createGroup3D( xOuterGroup_Shapes, aWallCID );
- CuboidPlanePosition eLeftWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) );
- CuboidPlanePosition eBackWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) );
+ CuboidPlanePosition eLeftWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( m_xDiagram ) );
+ CuboidPlanePosition eBackWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( m_xDiagram ) );
//add left wall
{
@@ -519,27 +523,25 @@ void VDiagram::createShapes_3d()
try
{
- uno::Reference< beans::XPropertySet > xSourceProp( m_xDiagram, uno::UNO_QUERY_THROW );
-
//perspective
{
//ignore distance and focal length from file format and model completely
//use vrp only to indicate the distance of the camera and thus influence the perspective
m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_DISTANCE, uno::Any(
- static_cast<sal_Int32>(ThreeDHelper::getCameraDistance( xSourceProp ))));
+ static_cast<sal_Int32>(m_xDiagram->getCameraDistance())));
m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_PERSPECTIVE,
- xSourceProp->getPropertyValue( UNO_NAME_3D_SCENE_PERSPECTIVE));
+ m_xDiagram->getPropertyValue( UNO_NAME_3D_SCENE_PERSPECTIVE));
}
//light
{
m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_SHADE_MODE,
- xSourceProp->getPropertyValue( UNO_NAME_3D_SCENE_SHADE_MODE));
+ m_xDiagram->getPropertyValue( UNO_NAME_3D_SCENE_SHADE_MODE));
m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_AMBIENTCOLOR,
- xSourceProp->getPropertyValue( UNO_NAME_3D_SCENE_AMBIENTCOLOR));
+ m_xDiagram->getPropertyValue( UNO_NAME_3D_SCENE_AMBIENTCOLOR));
m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING,
- xSourceProp->getPropertyValue( UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING));
- lcl_setLightSources( xSourceProp, m_xOuterGroupShape );
+ m_xDiagram->getPropertyValue( UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING));
+ lcl_setLightSources( m_xDiagram, m_xOuterGroupShape );
}
//rotation
@@ -583,7 +585,7 @@ void VDiagram::createShapes_3d()
ShapeFactory::createStripe(xOuterGroup_Shapes, aStripe
, xFloorProp, PropertyMapper::getPropertyNameMapForFillAndLineProperties(), bDoubleSided );
- CuboidPlanePosition eBottomPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) );
+ CuboidPlanePosition eBottomPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( m_xDiagram ) );
if( !bAddFloorAndWall || (eBottomPos!=CuboidPlanePosition_Bottom) )
{
//we always need this object as dummy object for correct scene dimensions
@@ -599,7 +601,7 @@ void VDiagram::createShapes_3d()
//create an additional scene for the smaller inner coordinate region:
{
- rtl::Reference<Svx3DSceneObject> xShapes2 = ShapeFactory::createGroup3D( xOuterGroup_Shapes,"testonly;CooContainer=XXX_CID" );
+ rtl::Reference<Svx3DSceneObject> xShapes2 = ShapeFactory::createGroup3D( xOuterGroup_Shapes,u"testonly;CooContainer=XXX_CID"_ustr );
m_xCoordinateRegionShape = xShapes2;
try
diff --git a/chart2/source/view/inc/DataTableView.hxx b/chart2/source/view/inc/DataTableView.hxx
new file mode 100644
index 000000000000..f6a1ab2c97b6
--- /dev/null
+++ b/chart2/source/view/inc/DataTableView.hxx
@@ -0,0 +1,88 @@
+/* -*- 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 <svx/unoshape.hxx>
+#include <svx/unodraw/SvxTableShape.hxx>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/table/XTable.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <DataTable.hxx>
+#include "VLineProperties.hxx"
+
+namespace chart
+{
+class VSeriesPlotter;
+class ChartModel;
+class LegendEntryProvider;
+
+/**
+ * DataTableView is responsible to create the table object, set the cell
+ * properties accordingly to the model and fill it with the chart series
+ * data.
+ */
+class DataTableView final
+{
+private:
+ rtl::Reference<::chart::ChartModel> m_xChartModel;
+ // the target shape
+ rtl::Reference<SvxShapeGroupAnyD> m_xTarget;
+ // the data table shape
+ rtl::Reference<SvxTableShape> m_xTableShape;
+ // the data table model
+ rtl::Reference<DataTable> m_xDataTableModel;
+ css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
+ css::uno::Reference<css::table::XTable> m_xTable;
+ VLineProperties m_aLineProperties;
+ std::vector<VSeriesPlotter*> m_pSeriesPlotterList;
+
+ // data series names
+ std::vector<OUString> m_aDataSeriesNames;
+ // X axis names
+ std::vector<OUString> m_aXValues;
+ // list of data series values
+ std::vector<std::vector<OUString>> m_pDataSeriesValues;
+
+ // if the header vales should be aligned with the x-axis vales
+ bool m_bAlignAxisValuesWithColumns;
+
+ /** Set the char and paragraph properties for the input (value) cell */
+ void setCellCharAndParagraphProperties(
+ const css::uno::Reference<css::beans::XPropertySet>& xPropertySet);
+
+ /** Set the common cell properties (for all cells in the data table,
+ * including headers)
+ */
+ void setCellProperties(const css::uno::Reference<css::beans::XPropertySet>& xPropertySet,
+ bool bLeft, bool bTop, bool bRight, bool bBottom);
+
+public:
+ DataTableView(rtl::Reference<::chart::ChartModel> const& xChartDoc,
+ rtl::Reference<DataTable> const& rDataTableModel,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext,
+ bool bAlignAxisValuesWithColumns);
+
+ /** Initializes and prepares the target and data table shape */
+ void initializeShapes(const rtl::Reference<SvxShapeGroupAnyD>& xTarget);
+
+ /** Prepares the values of the chart, which will be shown it the data table */
+ void initializeValues(std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList);
+
+ /** Creates the data table and fills the values */
+ void createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd,
+ sal_Int32 nAxisStepWidth);
+
+ /** Repositions the data table shape */
+ void changePosition(sal_Int32 x, sal_Int32 y);
+};
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/LabelPositionHelper.hxx b/chart2/source/view/inc/LabelPositionHelper.hxx
index 63125d621731..eacca4b6025d 100644
--- a/chart2/source/view/inc/LabelPositionHelper.hxx
+++ b/chart2/source/view/inc/LabelPositionHelper.hxx
@@ -26,9 +26,7 @@
#include <svx/unoshape.hxx>
namespace com::sun::star::drawing { struct Position3D; }
-namespace com::sun::star::drawing { class XShapes; }
namespace com::sun::star::awt { struct Size; }
-namespace com::sun::star::drawing { class XShape; }
namespace chart
{
@@ -39,7 +37,7 @@ public:
LabelPositionHelper() = delete;
LabelPositionHelper(
sal_Int32 nDimensionCount
- , const rtl::Reference<SvxShapeGroupAnyD>& xLogicTarget );
+ , rtl::Reference<SvxShapeGroupAnyD> xLogicTarget );
virtual ~LabelPositionHelper();
css::awt::Point transformSceneToScreenPosition(
diff --git a/chart2/source/view/inc/LegendEntryProvider.hxx b/chart2/source/view/inc/LegendEntryProvider.hxx
index e0133771cd27..ce7722b0edfd 100644
--- a/chart2/source/view/inc/LegendEntryProvider.hxx
+++ b/chart2/source/view/inc/LegendEntryProvider.hxx
@@ -36,6 +36,7 @@ namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
+class FormattedString;
enum class LegendSymbolStyle
{
@@ -62,8 +63,16 @@ struct ViewLegendEntry
/** The descriptive text for a legend entry.
*/
- css::uno::Sequence<
- css::uno::Reference< css::chart2::XFormattedString2 > > aLabel;
+ rtl::Reference< ::chart::FormattedString > xLabel;
+};
+
+
+struct ViewLegendSymbol
+{
+ /** The legend symbol that represents a data series or other
+ information contained in the legend
+ */
+ rtl::Reference<SvxShapeGroup> xSymbol;
};
class LegendEntryProvider
diff --git a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
index cbb5e55ba74a..1d72ccf11c8f 100644
--- a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
+++ b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
@@ -34,8 +34,7 @@ public:
virtual double getMaximumX() = 0;
//problem y maybe not is always the second border to ask for
- virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
- virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
+ virtual std::pair<double, double> getMinimumAndMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
//problem: z maybe not independent in future
virtual double getMinimumZ() = 0;
@@ -59,7 +58,7 @@ class MergedMinimumAndMaximumSupplier final : public MinimumAndMaximumSupplier
{
public:
MergedMinimumAndMaximumSupplier();
- virtual ~MergedMinimumAndMaximumSupplier();
+ ~MergedMinimumAndMaximumSupplier();
void addMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
bool hasMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
@@ -68,8 +67,7 @@ public:
//--MinimumAndMaximumSupplier
virtual double getMinimumX() override;
virtual double getMaximumX() override;
- virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
- virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
+ virtual std::pair<double, double> getMinimumAndMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
virtual double getMinimumZ() override;
virtual double getMaximumZ() override;
diff --git a/chart2/source/view/inc/PlotterBase.hxx b/chart2/source/view/inc/PlotterBase.hxx
index 73695507fd48..675370355baf 100644
--- a/chart2/source/view/inc/PlotterBase.hxx
+++ b/chart2/source/view/inc/PlotterBase.hxx
@@ -24,8 +24,6 @@
namespace com::sun::star::drawing { struct HomogenMatrix; }
namespace com::sun::star::drawing { struct Position3D; }
-namespace com::sun::star::drawing { class XShapes; }
-namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace chart { struct ExplicitScaleData; }
@@ -33,7 +31,6 @@ namespace chart
{
class PlottingPositionHelper;
-class ShapeFactory;
/** This class provides methods for setting axis scales and for performing
* scene to screen transformations. It is used as the base class for all
diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx
index c0480a4e3b2c..cd6753daac96 100644
--- a/chart2/source/view/inc/PlottingPositionHelper.hxx
+++ b/chart2/source/view/inc/PlottingPositionHelper.hxx
@@ -34,15 +34,12 @@
#include <rtl/ref.hxx>
#include <svx/unoshape.hxx>
-namespace com::sun::star::drawing { class XShapes; }
namespace com::sun::star::drawing { struct HomogenMatrix; }
namespace com::sun::star::drawing { struct PolyPolygonShape3D; }
namespace chart
{
-class ShapeFactory;
-
/** allows the transformation of numeric values from one
coordinate-system into another. Values may be transformed using
any mapping.
@@ -225,12 +222,17 @@ public:
css::drawing::Position3D
transformAngleRadiusToScene( double fLogicValueOnAngleAxis, double fLogicValueOnRadiusAxis, double fLogicZ, bool bDoScaling=true ) const;
- /** It returns the scene coordinates of the passed point: this point is
- * described through a normalized cylindrical coordinate system.
- * (For a pie chart the origin of the coordinate system is the pie center).
+ /** Return the scene coordinates of the passed point: this point is
+ * described through a normalized cylindrical coordinate system, with an
+ * optional offset.
+ * (For a standard pie chart the origin of the coordinate system is the
+ * pie center; for an of-pie chart the components of the aOffset
+ * parameter are not all zero).
*/
css::drawing::Position3D
- transformUnitCircleToScene( double fUnitAngleDegree, double fUnitRadius, double fLogicZ ) const;
+ transformUnitCircleToScene( double fUnitAngleDegree
+ , double fUnitRadius, double fLogicZ
+ , const ::basegfx::B3DVector& aOffset = ::basegfx::B3DVector()) const;
using PlottingPositionHelper::transformScaledLogicToScene;
@@ -400,11 +402,7 @@ inline bool PlottingPositionHelper::clipYRange( double& rMin, double& rMax ) con
{
//returns true if something remains
if( rMin > rMax )
- {
- double fHelp = rMin;
- rMin = rMax;
- rMax = fHelp;
- }
+ std::swap( rMin, rMax );
if( rMin > getLogicMaxY() )
return false;
if( rMax < getLogicMinY() )
diff --git a/chart2/source/view/inc/PolarLabelPositionHelper.hxx b/chart2/source/view/inc/PolarLabelPositionHelper.hxx
index 84f4ff1dc83c..c980495f68c8 100644
--- a/chart2/source/view/inc/PolarLabelPositionHelper.hxx
+++ b/chart2/source/view/inc/PolarLabelPositionHelper.hxx
@@ -59,7 +59,8 @@ public:
, double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree
, double fUnitCircleInnerRadius, double fUnitCircleOuterRadius
, double fLogicZ
- , sal_Int32 nScreenValueOffsetInRadiusDirection ) const;
+ , sal_Int32 nScreenValueOffsetInRadiusDirection
+ , const ::basegfx::B3DVector& aOffset = ::basegfx::B3DVector()) const;
private:
PolarPlottingPositionHelper* m_pPosHelper;
diff --git a/chart2/source/view/inc/PropertyMapper.hxx b/chart2/source/view/inc/PropertyMapper.hxx
index 652a6a05131c..c4d9a1fa2577 100644
--- a/chart2/source/view/inc/PropertyMapper.hxx
+++ b/chart2/source/view/inc/PropertyMapper.hxx
@@ -20,7 +20,6 @@
#include <sal/config.h>
-#include <optional>
#include <unordered_map>
#include <com/sun/star/uno/Sequence.h>
@@ -28,7 +27,6 @@
namespace com::sun::star::beans { class XPropertySet; }
class SvxShape;
-class SdrPathObj;
namespace chart
{
@@ -102,9 +100,6 @@ public:
static const tPropertyNameMap& getPropertyNameMapForTextShapeProperties();
static const tPropertyNameMap& getPropertyNameMapForFilledSeriesProperties();
- static void setPropertyNameMapForFilledSeriesProperties(SdrPathObj* pShape,
- const css::uno::Reference< css::beans::XPropertySet >& xSource,
- std::optional<sal_Int32> xFillColor = {});
static const tPropertyNameMap& getPropertyNameMapForLineSeriesProperties();
static const tPropertyNameMap& getPropertyNameMapForTextLabelProperties();
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index c9e7aab8384a..271b44b733bd 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -27,20 +27,18 @@
#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <svx/unoshape.hxx>
+#include <svx/unodraw/SvxTableShape.hxx>
#include <svx/unopage.hxx>
namespace chart { struct VLineProperties; }
namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::chart2 { class XFormattedString; }
namespace com::sun::star::drawing { class XShape; }
-namespace com::sun::star::drawing { class XShapes; }
namespace com::sun::star::drawing { struct HomogenMatrix; }
namespace com::sun::star::drawing { struct PolyPolygonShape3D; }
namespace com::sun::star::drawing { struct Position3D; }
namespace com::sun::star::graphic { class XGraphic; }
-namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace com::sun::star::drawing { struct Direction3D; }
-class SdrPathObj;
namespace chart
{
@@ -148,10 +146,9 @@ public:
, const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon
, double fDepth);
- static SdrPathObj*
+ static rtl::Reference<SvxShapePolyPolygon>
createArea2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget
- , const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon
- , bool bSetZOrderToZero = true);
+ , const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon);
static rtl::Reference<SvxShapePolyPolygon>
createSymbol2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget
@@ -205,7 +202,7 @@ public:
static rtl::Reference<SvxShapeText>
createText(const rtl::Reference<SvxShapeGroupAnyD>& xTarget
- , css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString
+ , const css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString
, const tNameSequence& rPropNames
, const tAnySequence& rPropValues
, const css::uno::Any& rATransformation);
@@ -218,6 +215,8 @@ public:
const css::uno::Reference< css::beans::XPropertySet > & xTextProperties,
double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth );
+ static rtl::Reference<SvxTableShape> createTable(rtl::Reference<SvxShapeGroupAnyD> const& xTarget, OUString const& rName = OUString());
+
static rtl::Reference<SvxShapeRect>
createInvisibleRectangle(
const rtl::Reference<SvxShapeGroupAnyD>& xTarget
@@ -249,8 +248,6 @@ public:
static void setShapeName( const rtl::Reference< SvxShape >& xShape
, const OUString& rName );
- static void setShapeName( SdrPathObj* pPath
- , const OUString& rName );
static OUString getShapeName( const css::uno::Reference< css::drawing::XShape >& xShape );
@@ -259,7 +256,7 @@ public:
static OUString getStackedString( const OUString& rString, bool bStacked );
static bool hasPolygonAnyLines( const std::vector<std::vector<css::drawing::Position3D>>& rPoly );
- static bool isPolygonEmptyOrSinglePoint( css::drawing::PolyPolygonShape3D& rPoly );
+ static bool isPolygonEmptyOrSinglePoint( const css::drawing::PolyPolygonShape3D& rPoly );
static bool isPolygonEmptyOrSinglePoint( const std::vector<std::vector<css::drawing::Position3D>>& rPoly );
static void closePolygon( css::drawing::PolyPolygonShape3D& rPoly );
static void closePolygon( std::vector<std::vector<css::drawing::Position3D>>& rPoly );
diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx
index 2beac4a05631..381f137d4c09 100644
--- a/chart2/source/view/inc/VCoordinateSystem.hxx
+++ b/chart2/source/view/inc/VCoordinateSystem.hxx
@@ -20,6 +20,7 @@
#include "MinimumAndMaximumSupplier.hxx"
#include <ThreeDHelper.hxx>
+#include "VSeriesPlotter.hxx"
#include <chartview/ExplicitScaleValues.hxx>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/uno/Sequence.h>
@@ -30,8 +31,6 @@
#include <memory>
#include <vector>
-namespace chart { class ExplicitCategoriesProvider; }
-namespace chart { class ScaleAutomatism; }
namespace com::sun::star::awt { struct Rectangle; }
namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::beans { class XPropertySet; }
@@ -40,12 +39,16 @@ namespace com::sun::star::chart2 { class XChartDocument; }
namespace com::sun::star::chart2 { class XCoordinateSystem; }
namespace com::sun::star::drawing { class XShapes; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
-
+namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
+class ExplicitCategoriesProvider;
+class ScaleAutomatism;
+class ChartModel;
+class Axis;
class BaseCoordinateSystem;
-
+class GridProperties;
class VAxisBase;
class VCoordinateSystem
@@ -74,9 +77,6 @@ public:
ExplicitScaleData getExplicitScale( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
ExplicitIncrementData getExplicitIncrement( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
- void setExplicitCategoriesProvider( ExplicitCategoriesProvider* /*takes ownership*/ );
- ExplicitCategoriesProvider* getExplicitCategoriesProvider();
-
// returns a complete scale set for a given dimension and index; for example if nDimensionIndex==1 and nAxisIndex==2 you get returned the secondary x axis, main y axis and main z axis
std::vector< ExplicitScaleData > getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
// returns a complete increment set for a given dimension and index; for example if nDimensionIndex==1 and nAxisIndex==2 you get returned the secondary x axis, main y axis and main z axis
@@ -115,10 +115,12 @@ public:
* Create "view" axis objects 'VAxis' from the coordinate system model.
*/
virtual void createVAxisList(
- const css::uno::Reference< css::chart2::XChartDocument> & xChartDoc
- , const css::awt::Size& rFontReferenceSize
- , const css::awt::Rectangle& rMaximumSpaceForLabels
- , bool bLimitSpaceForLabels );
+ const rtl::Reference<::chart::ChartModel> & xChartDoc,
+ const css::awt::Size& rFontReferenceSize,
+ const css::awt::Rectangle& rMaximumSpaceForLabels,
+ bool bLimitSpaceForLabels,
+ std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext);
virtual void initVAxisInList();
virtual void updateScalesAndIncrementsOnAxes();
@@ -138,22 +140,20 @@ public:
void setSeriesNamesForAxis( const css::uno::Sequence< OUString >& rSeriesNames );
protected: //methods
- VCoordinateSystem( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
+ VCoordinateSystem( rtl::Reference< ::chart::BaseCoordinateSystem > xCooSys );
- css::uno::Reference< css::chart2::XAxis >
+ rtl::Reference< ::chart::Axis >
getAxisByDimension( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
- static css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > >
- getGridListFromAxis( const css::uno::Reference< css::chart2::XAxis >& xAxis );
+ static std::vector< rtl::Reference< ::chart::GridProperties > >
+ getGridListFromAxis( const rtl::Reference< ::chart::Axis >& xAxis );
VAxisBase* getVAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
OUString createCIDForAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
OUString createCIDForGrid( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
- sal_Int32 getNumberFormatKeyForAxis( const css::uno::Reference<
- css::chart2::XAxis >& xAxis
- , const css::uno::Reference<
- css::chart2::XChartDocument>& xChartDoc);
+ sal_Int32 getNumberFormatKeyForAxis( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference<::chart::ChartModel>& xChartDoc);
private: //methods
static void impl_adjustDimension( sal_Int32& rDimensionIndex );
@@ -197,8 +197,6 @@ private:
tFullExplicitScaleMap m_aSecondaryExplicitScales;
tFullExplicitIncrementMap m_aSecondaryExplicitIncrements;
-
- std::unique_ptr< ExplicitCategoriesProvider > m_apExplicitCategoriesProvider;
};
} //namespace chart
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index 11d916510961..aeb7bd01cfc6 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -20,8 +20,9 @@
#include "PropertyMapper.hxx"
+#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
-#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
+#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
@@ -32,15 +33,12 @@
#include <map>
namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XChartType; }
-namespace com::sun::star::chart2 { class XDataSeries; }
namespace com::sun::star::chart2::data { class XDataSequence; }
-namespace com::sun::star::chart2 { struct DataPointLabel; }
-namespace com::sun::star::chart2 { struct Symbol; }
-namespace com::sun::star::drawing { class XShapes; }
namespace chart
{
+class ChartType;
+class DataSeries;
class VDataSequence
{
@@ -52,22 +50,21 @@ public:
sal_Int32 detectNumberFormatKey( sal_Int32 index ) const;
sal_Int32 getLength() const;
- css::uno::Reference<css::chart2::data::XDataSequence> Model;
-
- mutable css::uno::Sequence<double> Doubles;
+ css::uno::Reference<css::chart2::data::XDataSequence> m_xModel;
+ mutable css::uno::Sequence<double> m_aValues;
};
class VDataSeries final
{
public:
- VDataSeries( const css::uno::Reference<css::chart2::XDataSeries>& xDataSeries );
+ VDataSeries( const rtl::Reference<::chart::DataSeries>& xDataSeries );
~VDataSeries();
VDataSeries(const VDataSeries&) = delete;
const VDataSeries& operator=(const VDataSeries&) = delete;
- const css::uno::Reference<css::chart2::XDataSeries>& getModel() const;
+ const rtl::Reference<::chart::DataSeries>& getModel() const;
void setCategoryXAxis();
void setXValues( const css::uno::Reference<css::chart2::data::XDataSequence>& xValues );
@@ -107,15 +104,16 @@ public:
sal_Int32 detectNumberFormatKey( sal_Int32 nPointIndex ) const;
sal_Int32 getLabelPlacement(
- sal_Int32 nPointIndex, const css::uno::Reference<css::chart2::XChartType>& xChartType,
+ sal_Int32 nPointIndex, const rtl::Reference<::chart::ChartType>& xChartType,
bool bSwapXAndY ) const;
css::awt::Point getLabelPosition( css::awt::Point aTextShapePos, sal_Int32 nPointIndex ) const;
bool isLabelCustomPos( sal_Int32 nPointIndex ) const;
+ css::awt::Size getLabelCustomSize(sal_Int32 nPointIndex) const;
css::uno::Reference<css::beans::XPropertySet> getPropertiesOfPoint( sal_Int32 index ) const;
- css::uno::Reference<css::beans::XPropertySet> getPropertiesOfSeries() const;
+ const css::uno::Reference<css::beans::XPropertySet> & getPropertiesOfSeries() const;
css::chart2::Symbol* getSymbolProperties( sal_Int32 index ) const;
@@ -194,7 +192,7 @@ public: //member
rtl::Reference<SvxShapeGroupAnyD> m_xBackSubGroupShape;
private: //member
- css::uno::Reference<css::chart2::XDataSeries> m_xDataSeries;
+ rtl::Reference<::chart::DataSeries> m_xDataSeries;
css::uno::Reference<css::beans::XPropertySet> m_xDataSeriesProps; // cached
//all points given by the model data (here are not only the visible points meant)
@@ -238,20 +236,19 @@ private: //member
sal_Int32 m_nGlobalSeriesIndex;
//some cached values for data labels as they are very expensive
- mutable std::unique_ptr<css::chart2::DataPointLabel>
- m_apLabel_Series;
- mutable std::unique_ptr<tNameSequence> m_apLabelPropNames_Series;
- mutable std::unique_ptr<tAnySequence> m_apLabelPropValues_Series;
- mutable std::unique_ptr<css::chart2::Symbol> m_apSymbolProperties_Series;
-
- mutable std::unique_ptr<css::chart2::DataPointLabel>
- m_apLabel_AttributedPoint;
- mutable std::unique_ptr<tNameSequence> m_apLabelPropNames_AttributedPoint;
- mutable std::unique_ptr<tAnySequence> m_apLabelPropValues_AttributedPoint;
- mutable std::unique_ptr<css::chart2::Symbol> m_apSymbolProperties_AttributedPoint;
- mutable std::unique_ptr<css::chart2::Symbol>
- m_apSymbolProperties_InvisibleSymbolForSelection;
- mutable sal_Int32 m_nCurrentAttributedPoint;
+ mutable std::optional<css::chart2::DataPointLabel>
+ m_oLabel_Series;
+ mutable std::optional<tNameSequence> m_oLabelPropNames_Series;
+ mutable std::optional<tAnySequence> m_oLabelPropValues_Series;
+ mutable std::optional<css::chart2::Symbol> m_oSymbolProperties_Series;
+
+ mutable std::optional<css::chart2::DataPointLabel>
+ m_oLabel_AttributedPoint;
+ mutable std::optional<tNameSequence> m_oLabelPropNames_AttributedPoint;
+ mutable std::optional<tAnySequence> m_oLabelPropValues_AttributedPoint;
+ mutable std::optional<css::chart2::Symbol> m_oSymbolProperties_AttributedPoint;
+ mutable std::optional<css::chart2::Symbol> m_oSymbolProperties_InvisibleSymbolForSelection;
+ mutable sal_Int32 m_nCurrentAttributedPoint;
css::awt::Size m_aReferenceSize;
sal_Int32 m_nMissingValueTreatment;
diff --git a/chart2/source/view/inc/VDiagram.hxx b/chart2/source/view/inc/VDiagram.hxx
index 7d8dd3069479..3b2d21336a03 100644
--- a/chart2/source/view/inc/VDiagram.hxx
+++ b/chart2/source/view/inc/VDiagram.hxx
@@ -23,17 +23,12 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <svx/unoshape.hxx>
-
-namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::chart2 { class XDiagram; }
-namespace com::sun::star::lang { class XMultiServiceFactory; }
-namespace com::sun::star::drawing { class XShape; }
+#include <rtl/ref.hxx>
namespace chart
{
-
-class ShapeFactory;
+class Diagram;
/** The VDiagram is responsible to generate the visible parts of the Diagram
that is wall, floor, axes and data series.
@@ -44,7 +39,7 @@ diagram.
class VDiagram final
{
public: //methods
- VDiagram( const css::uno::Reference<css::chart2::XDiagram>& xDiagram,
+ VDiagram( const rtl::Reference<::chart::Diagram>& xDiagram,
const css::drawing::Direction3D& rPreferredAspectRatio,
sal_Int32 nDimension );
~VDiagram();
@@ -92,11 +87,11 @@ private: //members
rtl::Reference<SvxShapeGroupAnyD> m_xCoordinateRegionShape;
rtl::Reference<SvxShapeRect> m_xWall2D;
- sal_Int32 m_nDimensionCount;
- css::uno::Reference< css::chart2::XDiagram > m_xDiagram;
+ sal_Int32 m_nDimensionCount;
+ rtl::Reference< ::chart::Diagram > m_xDiagram;
css::drawing::Direction3D m_aPreferredAspectRatio;
- css::uno::Reference< css::beans::XPropertySet > m_xAspectRatio3D;
+ rtl::Reference< Svx3DSceneObject > m_xAspectRatio3D;
double m_fXAnglePi;
double m_fYAnglePi;
diff --git a/chart2/source/view/inc/VLegendSymbolFactory.hxx b/chart2/source/view/inc/VLegendSymbolFactory.hxx
index f637a5894912..055af7560338 100644
--- a/chart2/source/view/inc/VLegendSymbolFactory.hxx
+++ b/chart2/source/view/inc/VLegendSymbolFactory.hxx
@@ -25,9 +25,6 @@
namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::drawing { class XShape; }
-namespace com::sun::star::drawing { class XShapes; }
-namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace com::sun::star::uno { class Any; }
namespace chart::VLegendSymbolFactory
diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index 83d97bc8b671..57e5ee3db3f4 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -49,6 +49,7 @@ namespace com::sun::star {
namespace chart {
+class ChartType;
class NumberFormatterWrapper;
class AxesNumberFormats
@@ -161,8 +162,7 @@ public:
virtual double getMinimumX() override;
virtual double getMaximumX() override;
- virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
- virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
+ virtual std::pair<double, double> getMinimumAndMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
virtual double getMinimumZ() override;
virtual double getMaximumZ() override;
@@ -215,10 +215,22 @@ public:
const css::uno::Reference< css::uno::XComponentContext >& xContext
);
- std::vector< VDataSeries* > getAllSeries();
+ std::vector<ViewLegendSymbol> createSymbols(
+ const css::awt::Size& rEntryKeyAspectRatio
+ , const rtl::Reference<SvxShapeGroupAnyD>& xTarget
+ , const css::uno::Reference<css::uno::XComponentContext>& xContext);
+
+ std::vector<ViewLegendSymbol> createSymbolsForSeries(
+ const css::awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
+ , const rtl::Reference<SvxShapeGroupAnyD>& xTarget
+ , const css::uno::Reference<css::uno::XComponentContext>& xContext);
+
+ std::vector<VDataSeries*> getAllSeries();
+ std::vector<VDataSeries const*> getAllSeries() const;
// This method creates a series plotter of the requested type; e.g. : return new PieChart...
- static VSeriesPlotter* createSeriesPlotter( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ static VSeriesPlotter* createSeriesPlotter( const rtl::Reference< ::chart::ChartType >& xChartTypeModel
, sal_Int32 nDimensionCount
, bool bExcludingPositioning /*for pie and donut charts labels and exploded segments are excluded from the given size*/);
@@ -232,8 +244,13 @@ public:
void setExplicitCategoriesProvider( ExplicitCategoriesProvider* pExplicitCategoriesProvider );
+ ExplicitCategoriesProvider* getExplicitCategoriesProvider() { return m_pExplicitCategoriesProvider; }
+
//get series names for the z axis labels
- css::uno::Sequence< OUString > getSeriesNames() const;
+ css::uno::Sequence<OUString> getSeriesNames() const;
+
+ //get all series names
+ css::uno::Sequence<OUString> getAllSeriesNames() const;
void setPageReferenceSize( const css::awt::Size & rPageRefSize );
//better performance for big data
@@ -252,9 +269,16 @@ public:
bool WantToPlotInFrontOfAxisLine();
virtual bool shouldSnapRectToUsedArea();
+ /// This method returns a text string representation of the passed numeric
+ /// value by exploiting a NumberFormatterWrapper object.
+ OUString getLabelTextForValue(VDataSeries const & rDataSeries, sal_Int32 nPointIndex,
+ double fValue, bool bAsPercentage);
+
+ sal_Int32 getRenderOrder() const;
+
protected:
- VSeriesPlotter( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ VSeriesPlotter( rtl::Reference< ::chart::ChartType > xChartTypeModel
, sal_Int32 nDimensionCount
, bool bCategoryXAxis=true );
@@ -320,13 +344,6 @@ protected:
, sal_Int32 nOffset=0
, sal_Int32 nTextWidth = 0 );
- /// This method returns a text string representation of the passed numeric
- /// value by exploiting a NumberFormatterWrapper object.
- OUString getLabelTextForValue( VDataSeries const & rDataSeries
- , sal_Int32 nPointIndex
- , double fValue
- , bool bAsPercentage );
-
/** creates two T-shaped error bars in both directions (up/down or
left/right depending on the bVertical parameter)
@@ -398,8 +415,7 @@ protected:
protected:
PlottingPositionHelper* m_pMainPosHelper;
- css::uno::Reference< css::chart2::XChartType > m_xChartTypeModel;
- css::uno::Reference< css::beans::XPropertySet > m_xChartTypeModelProps;
+ rtl::Reference< ::chart::ChartType > m_xChartTypeModel;
std::vector< std::vector< VDataSeriesGroup > > m_aZSlots;
diff --git a/chart2/source/view/main/AxisUsage.hxx b/chart2/source/view/main/AxisUsage.hxx
new file mode 100644
index 000000000000..51a32a59b0e1
--- /dev/null
+++ b/chart2/source/view/main/AxisUsage.hxx
@@ -0,0 +1,143 @@
+/* -*- 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 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 .
+ */
+
+#pragma once
+
+#include <sal/types.h>
+#include <memory>
+#include <map>
+
+#include <VCoordinateSystem.hxx>
+#include <AxisHelper.hxx>
+#include <ScaleAutomatism.hxx>
+
+namespace chart
+{
+//first index is the dimension, second index is the axis index that indicates whether this is a main or secondary axis
+typedef std::pair<sal_Int32, sal_Int32> tFullAxisIndex;
+typedef std::map<VCoordinateSystem*, tFullAxisIndex> tCoordinateSystemMap;
+
+/** This class handles a collection of coordinate systems and is used for
+ * executing some action on all coordinate systems such as
+ * "prepareAutomaticAxisScaling" and "setExplicitScaleAndIncrement".
+ * Moreover it contains the "aAutoScaling" object that is an instance of
+ * the "ScaleAutomatism" class. The initialization of "aAutoScaling" is
+ * performed in the "SeriesPlotterContainer::initAxisUsageList" method and is
+ * used in the "SeriesPlotterContainer::doAutoScaling" for calculating explicit
+ * scale and increment objects (see "SeriesPlotterContainer::doAutoScaling").
+ */
+class AxisUsage
+{
+public:
+ AxisUsage()
+ : aAutoScaling(AxisHelper::createDefaultScale(), Date(Date::SYSTEM))
+ {
+ }
+
+ void addCoordinateSystem(VCoordinateSystem* pCooSys, sal_Int32 nDimensionIndex,
+ sal_Int32 nAxisIndex)
+ {
+ if (!pCooSys)
+ return;
+
+ tFullAxisIndex aFullAxisIndex(nDimensionIndex, nAxisIndex);
+ tCoordinateSystemMap::const_iterator aFound(aCoordinateSystems.find(pCooSys));
+
+ //use one scale only once for each coordinate system
+ //main axis are preferred over secondary axis
+ //value scales are preferred
+ if (aFound != aCoordinateSystems.end())
+ {
+ sal_Int32 nFoundAxisIndex = aFound->second.second;
+ if (nFoundAxisIndex < nAxisIndex)
+ return;
+ sal_Int32 nFoundDimension = aFound->second.first;
+ if (nFoundDimension == 1)
+ return;
+ if (nFoundDimension < nDimensionIndex)
+ return;
+ }
+ aCoordinateSystems[pCooSys] = std::move(aFullAxisIndex);
+
+ //set maximum scale index
+ auto aIter = aMaxIndexPerDimension.find(nDimensionIndex);
+ if (aIter != aMaxIndexPerDimension.end())
+ {
+ sal_Int32 nCurrentMaxIndex = aIter->second;
+ if (nCurrentMaxIndex < nAxisIndex)
+ aMaxIndexPerDimension[nDimensionIndex] = nAxisIndex;
+ }
+ else
+ aMaxIndexPerDimension[nDimensionIndex] = nAxisIndex;
+ }
+
+ std::vector<VCoordinateSystem*> getCoordinateSystems(sal_Int32 nDimensionIndex,
+ sal_Int32 nAxisIndex)
+ {
+ std::vector<VCoordinateSystem*> aRet;
+
+ for (auto const& coordinateSystem : aCoordinateSystems)
+ {
+ if (coordinateSystem.second.first != nDimensionIndex)
+ continue;
+ if (coordinateSystem.second.second != nAxisIndex)
+ continue;
+ aRet.push_back(coordinateSystem.first);
+ }
+
+ return aRet;
+ }
+
+ sal_Int32 getMaxAxisIndexForDimension(sal_Int32 nDimensionIndex)
+ {
+ sal_Int32 nRet = -1;
+ auto aIter = aMaxIndexPerDimension.find(nDimensionIndex);
+ if (aIter != aMaxIndexPerDimension.end())
+ nRet = aIter->second;
+ return nRet;
+ }
+
+ void prepareAutomaticAxisScaling(ScaleAutomatism& rScaleAutomatism, sal_Int32 nDimIndex,
+ sal_Int32 nAxisIndex)
+ {
+ std::vector<VCoordinateSystem*> aVCooSysList = getCoordinateSystems(nDimIndex, nAxisIndex);
+ for (VCoordinateSystem* pVCoordinateSystem : aVCooSysList)
+ pVCoordinateSystem->prepareAutomaticAxisScaling(rScaleAutomatism, nDimIndex,
+ nAxisIndex);
+ }
+
+ void setExplicitScaleAndIncrement(sal_Int32 nDimIndex, sal_Int32 nAxisIndex,
+ const ExplicitScaleData& rScale,
+ const ExplicitIncrementData& rInc)
+ {
+ std::vector<VCoordinateSystem*> aVCooSysList = getCoordinateSystems(nDimIndex, nAxisIndex);
+ for (VCoordinateSystem* pVCoordinateSystem : aVCooSysList)
+ pVCoordinateSystem->setExplicitScaleAndIncrement(nDimIndex, nAxisIndex, rScale, rInc);
+ }
+
+ ScaleAutomatism aAutoScaling;
+
+private:
+ tCoordinateSystemMap aCoordinateSystems;
+ std::map<sal_Int32, sal_Int32> aMaxIndexPerDimension;
+};
+
+} //end chart2 namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 37e78c116b76..84903cd42609 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -19,10 +19,15 @@
#include "ChartItemPool.hxx"
#include <chartview/ChartSfxItemIds.hxx>
+#include <DataSeries.hxx>
+#include <FormattedString.hxx>
+#include <Legend.hxx>
+#include <Axis.hxx>
#include <svx/chrtitem.hxx>
#include <svx/sdangitm.hxx>
#include <svx/svdpool.hxx>
#include <svx/svx3ditems.hxx>
+#include <svx/ChartColorPaletteType.hxx>
#include <svl/intitem.hxx>
#include <editeng/editeng.hxx>
#include <editeng/brushitem.hxx>
@@ -43,167 +48,170 @@
namespace chart
{
-ChartItemPool::ChartItemPool():
- SfxItemPool( "ChartItemPool" , SCHATTR_START, SCHATTR_END, nullptr, nullptr ),
- pItemInfos(new SfxItemInfo[SCHATTR_END - SCHATTR_START + 1])
+static ItemInfoPackage& getItemInfoPackageChart()
{
- /**************************************************************************
- * PoolDefaults
- **************************************************************************/
- std::vector<SfxPoolItem*>* ppPoolDefaults = new std::vector<SfxPoolItem*>(SCHATTR_END - SCHATTR_START + 1);
- std::vector<SfxPoolItem*>& rPoolDefaults = *ppPoolDefaults;
- rPoolDefaults[SCHATTR_DATADESCR_SHOW_NUMBER - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_NUMBER);
- rPoolDefaults[SCHATTR_DATADESCR_SHOW_PERCENTAGE- SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_PERCENTAGE);
- rPoolDefaults[SCHATTR_DATADESCR_SHOW_CATEGORY - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_CATEGORY);
- rPoolDefaults[SCHATTR_DATADESCR_SHOW_SYMBOL - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_SYMBOL);
- rPoolDefaults[SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME);
- rPoolDefaults[SCHATTR_DATADESCR_WRAP_TEXT - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_WRAP_TEXT);
- rPoolDefaults[SCHATTR_DATADESCR_SEPARATOR - SCHATTR_START] = new SfxStringItem(SCHATTR_DATADESCR_SEPARATOR," ");
- rPoolDefaults[SCHATTR_DATADESCR_PLACEMENT - SCHATTR_START] = new SfxInt32Item(SCHATTR_DATADESCR_PLACEMENT,0);
- rPoolDefaults[SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, std::vector < sal_Int32 >() );
- rPoolDefaults[SCHATTR_DATADESCR_NO_PERCENTVALUE - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE);
- rPoolDefaults[SCHATTR_DATADESCR_CUSTOM_LEADER_LINES - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_CUSTOM_LEADER_LINES, true);
- rPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE - SCHATTR_START] = new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
- rPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_SOURCE - SCHATTR_START] = new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
-
- //legend
- rPoolDefaults[SCHATTR_LEGEND_POS - SCHATTR_START] = new SfxInt32Item(SCHATTR_LEGEND_POS, sal_Int32(css::chart2::LegendPosition_LINE_END) );
- rPoolDefaults[SCHATTR_LEGEND_SHOW - SCHATTR_START] = new SfxBoolItem(SCHATTR_LEGEND_SHOW, true);
- rPoolDefaults[SCHATTR_LEGEND_NO_OVERLAY - SCHATTR_START] = new SfxBoolItem(SCHATTR_LEGEND_NO_OVERLAY, true);
-
- //text
- rPoolDefaults[SCHATTR_TEXT_DEGREES - SCHATTR_START] = new SdrAngleItem(SCHATTR_TEXT_DEGREES, 0_deg100);
- rPoolDefaults[SCHATTR_TEXT_STACKED - SCHATTR_START] = new SfxBoolItem(SCHATTR_TEXT_STACKED,false);
-
- //statistic
- rPoolDefaults[SCHATTR_STAT_AVERAGE - SCHATTR_START] = new SfxBoolItem (SCHATTR_STAT_AVERAGE);
- rPoolDefaults[SCHATTR_STAT_KIND_ERROR - SCHATTR_START] = new SvxChartKindErrorItem (SvxChartKindError::NONE, SCHATTR_STAT_KIND_ERROR);
- rPoolDefaults[SCHATTR_STAT_PERCENT - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_PERCENT);
- rPoolDefaults[SCHATTR_STAT_BIGERROR - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_BIGERROR);
- rPoolDefaults[SCHATTR_STAT_CONSTPLUS - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTPLUS);
- rPoolDefaults[SCHATTR_STAT_CONSTMINUS - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTMINUS);
- rPoolDefaults[SCHATTR_STAT_INDICATE - SCHATTR_START] = new SvxChartIndicateItem (SvxChartIndicate::NONE, SCHATTR_STAT_INDICATE);
- rPoolDefaults[SCHATTR_STAT_RANGE_POS - SCHATTR_START] = new SfxStringItem (SCHATTR_STAT_RANGE_POS, OUString());
- rPoolDefaults[SCHATTR_STAT_RANGE_NEG - SCHATTR_START] = new SfxStringItem (SCHATTR_STAT_RANGE_NEG, OUString());
- rPoolDefaults[SCHATTR_STAT_ERRORBAR_TYPE - SCHATTR_START] = new SfxBoolItem(SCHATTR_STAT_ERRORBAR_TYPE, true);
-
- rPoolDefaults[SCHATTR_STYLE_DEEP - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_DEEP, false);
- rPoolDefaults[SCHATTR_STYLE_3D - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_3D, false);
- rPoolDefaults[SCHATTR_STYLE_VERTICAL - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_VERTICAL, false);
- rPoolDefaults[SCHATTR_STYLE_BASETYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_STYLE_BASETYPE, 0);
- rPoolDefaults[SCHATTR_STYLE_LINES - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_LINES, false);
- rPoolDefaults[SCHATTR_STYLE_PERCENT - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_PERCENT, false);
- rPoolDefaults[SCHATTR_STYLE_STACKED - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_STACKED, false);
- rPoolDefaults[SCHATTR_STYLE_SPLINES - SCHATTR_START] = new SfxInt32Item (SCHATTR_STYLE_SPLINES, 0); //Bug: was Bool! test ->Fileformat (touches only 5's)
- rPoolDefaults[SCHATTR_STYLE_SYMBOL - SCHATTR_START] = new SfxInt32Item (SCHATTR_STYLE_SYMBOL, 0);
- rPoolDefaults[SCHATTR_STYLE_SHAPE - SCHATTR_START] = new SfxInt32Item (SCHATTR_STYLE_SHAPE, 0);
-
- rPoolDefaults[SCHATTR_AXIS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS,2); //2 = Y-Axis!!!
-
- //axis scale
- rPoolDefaults[SCHATTR_AXISTYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXISTYPE, CHART_AXIS_REALNUMBER);
- rPoolDefaults[SCHATTR_AXIS_REVERSE - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_REVERSE,false);
- rPoolDefaults[SCHATTR_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_MIN);
- rPoolDefaults[SCHATTR_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_MIN);
- rPoolDefaults[SCHATTR_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_MAX);
- rPoolDefaults[SCHATTR_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_MAX);
- rPoolDefaults[SCHATTR_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN);
- rPoolDefaults[SCHATTR_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_STEP_MAIN);
- rPoolDefaults[SCHATTR_AXIS_MAIN_TIME_UNIT - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_MAIN_TIME_UNIT,2);
- rPoolDefaults[SCHATTR_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP);
- rPoolDefaults[SCHATTR_AXIS_STEP_HELP - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_STEP_HELP,0);
- rPoolDefaults[SCHATTR_AXIS_HELP_TIME_UNIT - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_HELP_TIME_UNIT,2);
- rPoolDefaults[SCHATTR_AXIS_AUTO_TIME_RESOLUTION - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_TIME_RESOLUTION);
- rPoolDefaults[SCHATTR_AXIS_TIME_RESOLUTION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_TIME_RESOLUTION,2);
- rPoolDefaults[SCHATTR_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LOGARITHM);
- rPoolDefaults[SCHATTR_AXIS_AUTO_DATEAXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS);
- rPoolDefaults[SCHATTR_AXIS_ALLOW_DATEAXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_ALLOW_DATEAXIS);
- rPoolDefaults[SCHATTR_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN);
- rPoolDefaults[SCHATTR_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_ORIGIN);
-
- //axis position
- rPoolDefaults[SCHATTR_AXIS_TICKS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_TICKS,CHAXIS_MARK_OUTER);
- rPoolDefaults[SCHATTR_AXIS_HELPTICKS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_HELPTICKS,0);
- rPoolDefaults[SCHATTR_AXIS_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_POSITION,0);
- rPoolDefaults[SCHATTR_AXIS_POSITION_VALUE - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_POSITION_VALUE);
- rPoolDefaults[SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT - SCHATTR_START] = new SfxUInt32Item(SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT,0);
- rPoolDefaults[SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION,false);
- rPoolDefaults[SCHATTR_AXIS_LABEL_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_LABEL_POSITION,0);
- rPoolDefaults[SCHATTR_AXIS_MARK_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_MARK_POSITION,0);
-
- //axis label
- rPoolDefaults[SCHATTR_AXIS_SHOWDESCR - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWDESCR,false);
- rPoolDefaults[SCHATTR_AXIS_LABEL_ORDER - SCHATTR_START] = new SvxChartTextOrderItem(SvxChartTextOrder::SideBySide, SCHATTR_AXIS_LABEL_ORDER);
- rPoolDefaults[SCHATTR_AXIS_LABEL_OVERLAP - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LABEL_OVERLAP,false);
- rPoolDefaults[SCHATTR_AXIS_LABEL_BREAK - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LABEL_BREAK, false );
-
- rPoolDefaults[SCHATTR_SYMBOL_BRUSH - SCHATTR_START] = new SvxBrushItem(SCHATTR_SYMBOL_BRUSH);
- rPoolDefaults[SCHATTR_STOCK_VOLUME - SCHATTR_START] = new SfxBoolItem(SCHATTR_STOCK_VOLUME,false);
- rPoolDefaults[SCHATTR_STOCK_UPDOWN - SCHATTR_START] = new SfxBoolItem(SCHATTR_STOCK_UPDOWN,false);
- rPoolDefaults[SCHATTR_SYMBOL_SIZE - SCHATTR_START] = new SvxSizeItem(SCHATTR_SYMBOL_SIZE,Size(0,0));
- rPoolDefaults[SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY - SCHATTR_START] = new SfxBoolItem(SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY, false);
-
- // new for New Chart
- rPoolDefaults[SCHATTR_BAR_OVERLAP - SCHATTR_START] = new SfxInt32Item(SCHATTR_BAR_OVERLAP,0);
- rPoolDefaults[SCHATTR_BAR_GAPWIDTH - SCHATTR_START] = new SfxInt32Item(SCHATTR_BAR_GAPWIDTH,0);
- rPoolDefaults[SCHATTR_BAR_CONNECT - SCHATTR_START] = new SfxBoolItem(SCHATTR_BAR_CONNECT, false);
- rPoolDefaults[SCHATTR_NUM_OF_LINES_FOR_BAR - SCHATTR_START] = new SfxInt32Item( SCHATTR_NUM_OF_LINES_FOR_BAR, 0 );
- rPoolDefaults[SCHATTR_SPLINE_ORDER - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_ORDER, 3 );
- rPoolDefaults[SCHATTR_SPLINE_RESOLUTION - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_RESOLUTION, 20 );
- rPoolDefaults[SCHATTR_GROUP_BARS_PER_AXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, false);
- rPoolDefaults[SCHATTR_STARTING_ANGLE - SCHATTR_START] = new SdrAngleItem( SCHATTR_STARTING_ANGLE, 9000_deg100 );
- rPoolDefaults[SCHATTR_CLOCKWISE - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, false );
-
- rPoolDefaults[SCHATTR_MISSING_VALUE_TREATMENT - SCHATTR_START] = new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT, 0);
- rPoolDefaults[SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, std::vector < sal_Int32 >() );
- rPoolDefaults[SCHATTR_INCLUDE_HIDDEN_CELLS - SCHATTR_START] = new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, true);
- rPoolDefaults[SCHATTR_HIDE_LEGEND_ENTRY - SCHATTR_START] = new SfxBoolItem(SCHATTR_HIDE_LEGEND_ENTRY, false);
-
- rPoolDefaults[SCHATTR_AXIS_FOR_ALL_SERIES - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES, 0);
-
- rPoolDefaults[SCHATTR_REGRESSION_TYPE - SCHATTR_START] = new SvxChartRegressItem (SvxChartRegress::NONE, SCHATTR_REGRESSION_TYPE);
- rPoolDefaults[SCHATTR_REGRESSION_SHOW_EQUATION - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_EQUATION, false);
- rPoolDefaults[SCHATTR_REGRESSION_SHOW_COEFF - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_COEFF, false);
- rPoolDefaults[SCHATTR_REGRESSION_DEGREE - SCHATTR_START] = new SfxInt32Item(SCHATTR_REGRESSION_DEGREE, 2);
- rPoolDefaults[SCHATTR_REGRESSION_PERIOD - SCHATTR_START] = new SfxInt32Item(SCHATTR_REGRESSION_PERIOD, 2);
- rPoolDefaults[SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD);
- rPoolDefaults[SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD);
- rPoolDefaults[SCHATTR_REGRESSION_SET_INTERCEPT - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SET_INTERCEPT, false);
- rPoolDefaults[SCHATTR_REGRESSION_INTERCEPT_VALUE - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_REGRESSION_INTERCEPT_VALUE);
- rPoolDefaults[SCHATTR_REGRESSION_CURVE_NAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_CURVE_NAME, OUString());
- rPoolDefaults[SCHATTR_REGRESSION_XNAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_XNAME, "x");
- rPoolDefaults[SCHATTR_REGRESSION_YNAME - SCHATTR_START] = new SfxStringItem(SCHATTR_REGRESSION_YNAME, "f(x)");
- rPoolDefaults[SCHATTR_REGRESSION_MOVING_TYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_REGRESSION_MOVING_TYPE, css::chart2::MovingAverageType::Prior);
-
- /**************************************************************************
- * ItemInfos
- **************************************************************************/
- const sal_uInt16 nMax = SCHATTR_END - SCHATTR_START + 1;
- for( sal_uInt16 i = 0; i < nMax; i++ )
+ class ItemInfoPackageChart : public ItemInfoPackage
{
- pItemInfos[i]._nSID = 0;
- pItemInfos[i]._bPoolable = true;
- }
-
- // slot ids differing from which ids
- pItemInfos[SCHATTR_SYMBOL_BRUSH - SCHATTR_START]._nSID = SID_ATTR_BRUSH;
- pItemInfos[SCHATTR_STYLE_SYMBOL - SCHATTR_START]._nSID = SID_ATTR_SYMBOLTYPE;
- pItemInfos[SCHATTR_SYMBOL_SIZE - SCHATTR_START]._nSID = SID_ATTR_SYMBOLSIZE;
+ typedef std::array<ItemInfoStatic, SCHATTR_END - SCHATTR_START + 1> ItemInfoArrayChart;
+ ItemInfoArrayChart maItemInfos {{
+ // m_nWhich, m_pItem, m_nSlotID, m_nItemInfoFlags
+ { SCHATTR_DATADESCR_SHOW_NUMBER, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_NUMBER), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_SHOW_PERCENTAGE, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_PERCENTAGE), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_SHOW_CATEGORY, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_CATEGORY), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_SHOW_SYMBOL, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_SYMBOL), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_WRAP_TEXT, new SfxBoolItem(SCHATTR_DATADESCR_WRAP_TEXT), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_SEPARATOR, new SfxStringItem(SCHATTR_DATADESCR_SEPARATOR,u" "_ustr), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_PLACEMENT, new SfxInt32Item(SCHATTR_DATADESCR_PLACEMENT,0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, std::vector < sal_Int32 >() ), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_NO_PERCENTVALUE, new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_CUSTOM_LEADER_LINES, new SfxBoolItem(SCHATTR_DATADESCR_CUSTOM_LEADER_LINES, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_PERCENT_NUMBERFORMAT_VALUE, new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME), 0, SFX_ITEMINFOFLAG_NONE },
+
+ //legend
+ { SCHATTR_LEGEND_POS, new SfxInt32Item(SCHATTR_LEGEND_POS, sal_Int32(css::chart2::LegendPosition_LINE_END) ), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_LEGEND_SHOW, new SfxBoolItem(SCHATTR_LEGEND_SHOW, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_LEGEND_NO_OVERLAY, new SfxBoolItem(SCHATTR_LEGEND_NO_OVERLAY, true), 0, SFX_ITEMINFOFLAG_NONE },
+
+ //text
+ { SCHATTR_TEXT_DEGREES, new SdrAngleItem(SCHATTR_TEXT_DEGREES, 0_deg100), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_TEXT_STACKED, new SfxBoolItem(SCHATTR_TEXT_STACKED,false), 0, SFX_ITEMINFOFLAG_NONE },
+
+ //statistic
+ { SCHATTR_STAT_AVERAGE, new SfxBoolItem (SCHATTR_STAT_AVERAGE), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_KIND_ERROR, new SvxChartKindErrorItem (SvxChartKindError::NONE, SCHATTR_STAT_KIND_ERROR), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_PERCENT, new SvxDoubleItem (0.0, SCHATTR_STAT_PERCENT), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_BIGERROR, new SvxDoubleItem (0.0, SCHATTR_STAT_BIGERROR), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_CONSTPLUS, new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTPLUS), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_CONSTMINUS, new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTMINUS), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_INDICATE, new SvxChartIndicateItem (SvxChartIndicate::NONE, SCHATTR_STAT_INDICATE), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_RANGE_POS, new SfxStringItem (SCHATTR_STAT_RANGE_POS, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_RANGE_NEG, new SfxStringItem (SCHATTR_STAT_RANGE_NEG, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STAT_ERRORBAR_TYPE, new SfxBoolItem(SCHATTR_STAT_ERRORBAR_TYPE, true), 0, SFX_ITEMINFOFLAG_NONE },
+
+ { SCHATTR_STYLE_DEEP, new SfxBoolItem (SCHATTR_STYLE_DEEP, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_3D, new SfxBoolItem (SCHATTR_STYLE_3D, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_VERTICAL, new SfxBoolItem (SCHATTR_STYLE_VERTICAL, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_BASETYPE, new SfxInt32Item(SCHATTR_STYLE_BASETYPE, 0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_LINES, new SfxBoolItem (SCHATTR_STYLE_LINES, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_PERCENT, new SfxBoolItem (SCHATTR_STYLE_PERCENT, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_STACKED, new SfxBoolItem (SCHATTR_STYLE_STACKED, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_SPLINES, new SfxInt32Item (SCHATTR_STYLE_SPLINES, 0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_SYMBOL, new SfxInt32Item (SCHATTR_STYLE_SYMBOL, 0), SID_ATTR_SYMBOLTYPE, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STYLE_SHAPE, new SfxInt32Item (SCHATTR_STYLE_SHAPE, 0), 0, SFX_ITEMINFOFLAG_NONE },
+
+ { SCHATTR_AXIS, new SfxInt32Item(SCHATTR_AXIS,2), 0, SFX_ITEMINFOFLAG_NONE },
+
+ //axis scale
+ { SCHATTR_AXISTYPE, new SfxInt32Item(SCHATTR_AXISTYPE, CHART_AXIS_REALNUMBER), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_REVERSE, new SfxBoolItem(SCHATTR_AXIS_REVERSE,false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_AUTO_MIN, new SfxBoolItem(SCHATTR_AXIS_AUTO_MIN), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_MIN, new SvxDoubleItem(0.0, SCHATTR_AXIS_MIN), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_AUTO_MAX, new SfxBoolItem(SCHATTR_AXIS_AUTO_MAX), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_MAX, new SvxDoubleItem(0.0, SCHATTR_AXIS_MAX), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_AUTO_STEP_MAIN, new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_STEP_MAIN, new SvxDoubleItem(0.0, SCHATTR_AXIS_STEP_MAIN), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_MAIN_TIME_UNIT, new SfxInt32Item(SCHATTR_AXIS_MAIN_TIME_UNIT,2), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_AUTO_STEP_HELP, new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_STEP_HELP, new SfxInt32Item(SCHATTR_AXIS_STEP_HELP,0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_HELP_TIME_UNIT, new SfxInt32Item(SCHATTR_AXIS_HELP_TIME_UNIT,2), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_AUTO_TIME_RESOLUTION, new SfxBoolItem(SCHATTR_AXIS_AUTO_TIME_RESOLUTION), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_TIME_RESOLUTION, new SfxInt32Item(SCHATTR_AXIS_TIME_RESOLUTION,2), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_LOGARITHM, new SfxBoolItem(SCHATTR_AXIS_LOGARITHM), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_AUTO_DATEAXIS, new SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_ALLOW_DATEAXIS, new SfxBoolItem(SCHATTR_AXIS_ALLOW_DATEAXIS), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_AUTO_ORIGIN, new SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_ORIGIN, new SvxDoubleItem(0.0, SCHATTR_AXIS_ORIGIN), 0, SFX_ITEMINFOFLAG_NONE },
+
+ //axis position
+ { SCHATTR_AXIS_TICKS, new SfxInt32Item(SCHATTR_AXIS_TICKS,CHAXIS_MARK_OUTER), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_HELPTICKS, new SfxInt32Item(SCHATTR_AXIS_HELPTICKS,0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_POSITION, new SfxInt32Item(SCHATTR_AXIS_POSITION,0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_POSITION_VALUE, new SvxDoubleItem(0.0, SCHATTR_AXIS_POSITION_VALUE), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT, new SfxUInt32Item(SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT,0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION, new SfxBoolItem(SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION,false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_LABEL_POSITION, new SfxInt32Item(SCHATTR_AXIS_LABEL_POSITION,0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_MARK_POSITION, new SfxInt32Item(SCHATTR_AXIS_MARK_POSITION,0), 0, SFX_ITEMINFOFLAG_NONE },
+
+ //axis label
+ { SCHATTR_AXIS_SHOWDESCR, new SfxBoolItem(SCHATTR_AXIS_SHOWDESCR,false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_LABEL_ORDER, new SvxChartTextOrderItem(SvxChartTextOrder::SideBySide, SCHATTR_AXIS_LABEL_ORDER), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_LABEL_OVERLAP, new SfxBoolItem(SCHATTR_AXIS_LABEL_OVERLAP,false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AXIS_LABEL_BREAK, new SfxBoolItem(SCHATTR_AXIS_LABEL_BREAK, false ), 0, SFX_ITEMINFOFLAG_NONE },
+
+ { SCHATTR_SYMBOL_BRUSH, new SvxBrushItem(SCHATTR_SYMBOL_BRUSH), SID_ATTR_BRUSH, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STOCK_VOLUME, new SfxBoolItem(SCHATTR_STOCK_VOLUME,false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STOCK_UPDOWN, new SfxBoolItem(SCHATTR_STOCK_UPDOWN,false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_SYMBOL_SIZE, new SvxSizeItem(SCHATTR_SYMBOL_SIZE,Size(0,0)), SID_ATTR_SYMBOLSIZE, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY, new SfxBoolItem(SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY, false), 0, SFX_ITEMINFOFLAG_NONE },
+
+ // new for New Chart
+ { SCHATTR_BAR_OVERLAP, new SfxInt32Item(SCHATTR_BAR_OVERLAP,0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_BAR_GAPWIDTH, new SfxInt32Item(SCHATTR_BAR_GAPWIDTH,0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_BAR_CONNECT, new SfxBoolItem(SCHATTR_BAR_CONNECT, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_NUM_OF_LINES_FOR_BAR, new SfxInt32Item( SCHATTR_NUM_OF_LINES_FOR_BAR, 0 ), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_SPLINE_ORDER, new SfxInt32Item( SCHATTR_SPLINE_ORDER, 3 ), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_SPLINE_RESOLUTION, new SfxInt32Item( SCHATTR_SPLINE_RESOLUTION, 20 ), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_GROUP_BARS_PER_AXIS, new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_STARTING_ANGLE, new SdrAngleItem( SCHATTR_STARTING_ANGLE, 9000_deg100 ), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_CLOCKWISE, new SfxBoolItem( SCHATTR_CLOCKWISE, false ), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_MISSING_VALUE_TREATMENT, new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT, 0), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, std::vector < sal_Int32 >() ), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_INCLUDE_HIDDEN_CELLS, new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, true), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_HIDE_LEGEND_ENTRY, new SfxBoolItem(SCHATTR_HIDE_LEGEND_ENTRY, false), 0, SFX_ITEMINFOFLAG_NONE },
+
+ { SCHATTR_AXIS_FOR_ALL_SERIES, new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES, 0), 0, SFX_ITEMINFOFLAG_NONE },
+
+ { SCHATTR_REGRESSION_TYPE, new SvxChartRegressItem (SvxChartRegress::NONE, SCHATTR_REGRESSION_TYPE), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_SHOW_EQUATION, new SfxBoolItem(SCHATTR_REGRESSION_SHOW_EQUATION, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_SHOW_COEFF, new SfxBoolItem(SCHATTR_REGRESSION_SHOW_COEFF, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_DEGREE, new SfxInt32Item(SCHATTR_REGRESSION_DEGREE, 2), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_PERIOD, new SfxInt32Item(SCHATTR_REGRESSION_PERIOD, 2), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD, new SvxDoubleItem(0.0, SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD, new SvxDoubleItem(0.0, SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_SET_INTERCEPT, new SfxBoolItem(SCHATTR_REGRESSION_SET_INTERCEPT, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_INTERCEPT_VALUE, new SvxDoubleItem(0.0, SCHATTR_REGRESSION_INTERCEPT_VALUE), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_CURVE_NAME, new SfxStringItem(SCHATTR_REGRESSION_CURVE_NAME, OUString()), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_XNAME, new SfxStringItem(SCHATTR_REGRESSION_XNAME, u"x"_ustr), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_YNAME, new SfxStringItem(SCHATTR_REGRESSION_YNAME, u"f(x)"_ustr), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_REGRESSION_MOVING_TYPE, new SfxInt32Item(SCHATTR_REGRESSION_MOVING_TYPE, css::chart2::MovingAverageType::Prior), 0, SFX_ITEMINFOFLAG_NONE },
+
+ { SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, new SfxBoolItem(SCHATTR_DATA_TABLE_HORIZONTAL_BORDER, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATA_TABLE_VERTICAL_BORDER, new SfxBoolItem(SCHATTR_DATA_TABLE_VERTICAL_BORDER, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATA_TABLE_OUTLINE, new SfxBoolItem(SCHATTR_DATA_TABLE_OUTLINE, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_DATA_TABLE_KEYS, new SfxBoolItem(SCHATTR_DATA_TABLE_KEYS, false), 0, SFX_ITEMINFOFLAG_NONE },
+ { SCHATTR_COLOR_PALETTE, new SvxChartColorPaletteItem(ChartColorPaletteType::Unknown, 0, SCHATTR_COLOR_PALETTE), 0, SFX_ITEMINFOFLAG_NONE }
+
+ }};
+
+ virtual const ItemInfoStatic& getItemInfoStatic(size_t nIndex) const override { return maItemInfos[nIndex]; }
+
+ public:
+ virtual size_t size() const override { return maItemInfos.size(); }
+ virtual const ItemInfo& getItemInfo(size_t nIndex, SfxItemPool& /*rPool*/) override { return maItemInfos[nIndex]; }
+ };
+
+ static std::unique_ptr<ItemInfoPackageChart> g_aItemInfoPackageChart;
+ if (!g_aItemInfoPackageChart)
+ g_aItemInfoPackageChart.reset(new ItemInfoPackageChart);
+ return *g_aItemInfoPackageChart;
+}
- SetDefaults(ppPoolDefaults);
- SetItemInfos(pItemInfos.get());
+ChartItemPool::ChartItemPool()
+: SfxItemPool(u"ChartItemPool"_ustr)
+{
+ registerItemInfoPackage(getItemInfoPackageChart());
}
-ChartItemPool::ChartItemPool(const ChartItemPool& rPool):
- SfxItemPool(rPool)
+ChartItemPool::ChartItemPool(const ChartItemPool& rPool)
+: SfxItemPool(rPool)
{
}
ChartItemPool::~ChartItemPool()
{
- Delete();
- // release and delete static pool default items
- ReleaseDefaults(true);
+ sendShutdownHint();
}
rtl::Reference<SfxItemPool> ChartItemPool::Clone() const
@@ -216,48 +224,22 @@ MapUnit ChartItemPool::GetMetric(sal_uInt16 /* nWhich */) const
return MapUnit::Map100thMM;
}
-static rtl::Reference<SfxItemPool> g_Pool1, g_Pool2, g_Pool3;
-
-/** If we let the libc runtime clean us up, we trigger a crash */
-namespace
-{
-class TerminateListener : public ::cppu::WeakImplHelper< css::frame::XTerminateListener >
+rtl::Reference<SfxItemPool> ChartItemPool::CreateChartItemPool()
{
- void SAL_CALL queryTermination( const css::lang::EventObject& ) override
- {}
- void SAL_CALL notifyTermination( const css::lang::EventObject& ) override
- {
- g_Pool1.clear();
- g_Pool2.clear();
- g_Pool3.clear();
- }
- virtual void SAL_CALL disposing( const ::css::lang::EventObject& ) override
- {}
-};
-};
-
-SfxItemPool& ChartItemPool::GetGlobalChartItemPool()
-{
- if (!g_Pool1)
- {
- // similar logic to SdrModel's pool, but with our chart pool tagged on the end
- g_Pool1 = new SdrItemPool(nullptr);
- g_Pool2 = EditEngine::CreatePool();
- g_Pool3 = new ChartItemPool();
- g_Pool1->SetSecondaryPool(g_Pool2.get());
-
- g_Pool1->SetDefaultMetric(MapUnit::Map100thMM);
- g_Pool1->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, true) );
- g_Pool1->SetPoolDefaultItem(makeSvx3DPercentDiagonalItem (5));
-
- g_Pool2->SetSecondaryPool(g_Pool3.get());
- g_Pool1->FreezeIdRanges();
-
- css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create(comphelper::getProcessComponentContext());
- css::uno::Reference< css::frame::XTerminateListener > xListener( new TerminateListener );
- xDesktop->addTerminateListener( xListener );
- }
- return *g_Pool1;
+ // There are various default values which want to call
+ // OutputDevice::GetDefaultFont. Unfortunately, when processing
+ // UNO methods which may get called from out of process, this
+ // happens on a thread that does not take the SolarMutex, which
+ // causes trouble in ImplFontCache.
+ // Trying to take the SolarMutex when initialising these default
+ // leads to ABBA deadlocks.
+ // So rather just trigger the initialisation of these things here.
+ StaticDataSeriesDefaults();
+ StaticAxisDefaults();
+ StaticLegendDefaults();
+ StaticFormattedStringDefaults();
+
+ return new ChartItemPool();
}
} // namespace chart
diff --git a/chart2/source/view/main/ChartItemPool.hxx b/chart2/source/view/main/ChartItemPool.hxx
index 2ac440183740..558ab3c6e2fc 100644
--- a/chart2/source/view/main/ChartItemPool.hxx
+++ b/chart2/source/view/main/ChartItemPool.hxx
@@ -26,21 +26,16 @@ namespace chart
{
class ChartItemPool : public SfxItemPool
{
-private:
- std::unique_ptr<SfxItemInfo[]> pItemInfos;
-
+public:
ChartItemPool();
ChartItemPool(const ChartItemPool& rPool);
-
-protected:
virtual ~ChartItemPool() override;
-public:
virtual rtl::Reference<SfxItemPool> Clone() const override;
MapUnit GetMetric(sal_uInt16 nWhich) const override;
- /// get the pure chart item pool
- static SfxItemPool& GetGlobalChartItemPool();
+ /// creates a pure chart item pool
+ static rtl::Reference<SfxItemPool> CreateChartItemPool();
};
} // namespace chart
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index d1ec2a672571..60192c88fdef 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -19,9 +19,13 @@
#include <config_feature_desktop.h>
+#include "SeriesPlotterContainer.hxx"
+
#include <ChartView.hxx>
#include <chartview/DrawModelWrapper.hxx>
#include <Diagram.hxx>
+#include <ChartType.hxx>
+#include <DataSeries.hxx>
#include <NumberFormatterWrapper.hxx>
#include <VDiagram.hxx>
#include "VTitle.hxx"
@@ -32,6 +36,7 @@
#include <VSeriesPlotter.hxx>
#include <CommonConverters.hxx>
#include <TitleHelper.hxx>
+#include <Legend.hxx>
#include <LegendHelper.hxx>
#include "VLegend.hxx"
#include <PropertyMapper.hxx>
@@ -42,13 +47,16 @@
#include <DiagramHelper.hxx>
#include <RelativePositionHelper.hxx>
#include <servicenames.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
+#include "AxisUsage.hxx"
#include <AxisIndexDefines.hxx>
#include <BaseGFXHelper.hxx>
#include <DataSeriesHelper.hxx>
#include <DateHelper.hxx>
#include <ExplicitCategoriesProvider.hxx>
#include <defines.hxx>
+#include <comphelper/dumpxmltostring.hxx>
#include <unonames.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/eeitem.hxx>
@@ -62,22 +70,20 @@
#include <unotools/streamwrap.hxx>
#include <svx/svdpage.hxx>
#include <svx/unopage.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
#include <svx/unofill.hxx>
#include <drawinglayer/XShapeDumper.hxx>
+#include <sfx2/objsh.hxx>
#include <time.h>
-#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp>
@@ -101,897 +107,19 @@
#include <rtl/ustring.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/stream.hxx>
#include <memory>
#include <libxml/xmlwriter.h>
-namespace com::sun::star::chart2 { class XChartDocument; }
namespace chart {
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Any;
-namespace {
-
-typedef std::pair< sal_Int32, sal_Int32 > tFullAxisIndex; //first index is the dimension, second index is the axis index that indicates whether this is a main or secondary axis
-typedef std::map< VCoordinateSystem*, tFullAxisIndex > tCoordinateSystemMap;
-
-/** This class handles a collection of coordinate systems and is used for
- * executing some action on all coordinate systems such as
- * `prepareAutomaticAxisScaling` and `setExplicitScaleAndIncrement`.
- * Moreover it contains the `aAutoScaling` object that is an instance of
- * the `ScaleAutomatism` class. The initialization of `aAutoScaling` is
- * performed in the `SeriesPlotterContainer::initAxisUsageList` method and is
- * used in the `SeriesPlotterContainer::doAutoScaling` for calculating explicit
- * scale and increment objects (see `SeriesPlotterContainer::doAutoScaling`).
- */
-struct AxisUsage
-{
- AxisUsage();
- ~AxisUsage();
-
- void addCoordinateSystem( VCoordinateSystem* pCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
- std::vector< VCoordinateSystem* > getCoordinateSystems( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
- sal_Int32 getMaxAxisIndexForDimension( sal_Int32 nDimensionIndex );
-
- void prepareAutomaticAxisScaling( ScaleAutomatism& rScaleAutomatism, sal_Int32 nDimIndex, sal_Int32 nAxisIndex );
- void setExplicitScaleAndIncrement( sal_Int32 nDimIndex, sal_Int32 nAxisIndex, const ExplicitScaleData& rScale, const ExplicitIncrementData& rInc );
-
- ScaleAutomatism aAutoScaling;
-
-private:
- tCoordinateSystemMap aCoordinateSystems;
- std::map< sal_Int32, sal_Int32 > aMaxIndexPerDimension;
-};
-
-AxisUsage::AxisUsage()
- : aAutoScaling(AxisHelper::createDefaultScale(), Date(Date::SYSTEM))
-{
-}
-
-AxisUsage::~AxisUsage()
-{
- aCoordinateSystems.clear();
-}
-
-void AxisUsage::addCoordinateSystem( VCoordinateSystem* pCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
-{
- if(!pCooSys)
- return;
-
- tFullAxisIndex aFullAxisIndex( nDimensionIndex, nAxisIndex );
- tCoordinateSystemMap::const_iterator aFound( aCoordinateSystems.find(pCooSys) );
-
- //use one scale only once for each coordinate system
- //main axis are preferred over secondary axis
- //value scales are preferred
- if(aFound!=aCoordinateSystems.end())
- {
- sal_Int32 nFoundAxisIndex = aFound->second.second;
- if( nFoundAxisIndex < nAxisIndex )
- return;
- sal_Int32 nFoundDimension = aFound->second.first;
- if( nFoundDimension ==1 )
- return;
- if( nFoundDimension < nDimensionIndex )
- return;
- }
- aCoordinateSystems[pCooSys] = aFullAxisIndex;
-
- //set maximum scale index
- std::map< sal_Int32, sal_Int32 >::const_iterator aIter = aMaxIndexPerDimension.find(nDimensionIndex);
- if( aIter != aMaxIndexPerDimension.end() )
- {
- sal_Int32 nCurrentMaxIndex = aIter->second;
- if( nCurrentMaxIndex < nAxisIndex )
- aMaxIndexPerDimension[nDimensionIndex]=nAxisIndex;
- }
- else
- aMaxIndexPerDimension[nDimensionIndex]=nAxisIndex;
-}
-
-std::vector< VCoordinateSystem* > AxisUsage::getCoordinateSystems( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
-{
- std::vector< VCoordinateSystem* > aRet;
-
- for (auto const& coordinateSystem : aCoordinateSystems)
- {
- if( coordinateSystem.second.first != nDimensionIndex )
- continue;
- if( coordinateSystem.second.second != nAxisIndex )
- continue;
- aRet.push_back( coordinateSystem.first );
- }
-
- return aRet;
-}
-
-sal_Int32 AxisUsage::getMaxAxisIndexForDimension( sal_Int32 nDimensionIndex )
-{
- sal_Int32 nRet = -1;
- std::map< sal_Int32, sal_Int32 >::const_iterator aIter = aMaxIndexPerDimension.find(nDimensionIndex);
- if( aIter != aMaxIndexPerDimension.end() )
- nRet = aIter->second;
- return nRet;
-}
-
-void AxisUsage::prepareAutomaticAxisScaling( ScaleAutomatism& rScaleAutomatism, sal_Int32 nDimIndex, sal_Int32 nAxisIndex )
-{
- std::vector<VCoordinateSystem*> aVCooSysList = getCoordinateSystems(nDimIndex, nAxisIndex);
- for (VCoordinateSystem * i : aVCooSysList)
- i->prepareAutomaticAxisScaling(rScaleAutomatism, nDimIndex, nAxisIndex);
-}
-
-void AxisUsage::setExplicitScaleAndIncrement(
- sal_Int32 nDimIndex, sal_Int32 nAxisIndex, const ExplicitScaleData& rScale, const ExplicitIncrementData& rInc )
-{
- std::vector<VCoordinateSystem*> aVCooSysList = getCoordinateSystems(nDimIndex, nAxisIndex);
- for (VCoordinateSystem* i : aVCooSysList)
- i->setExplicitScaleAndIncrement(nDimIndex, nAxisIndex, rScale, rInc);
-}
-
-typedef std::vector<std::unique_ptr<VSeriesPlotter> > SeriesPlottersType;
-
-/** This class is a container of `SeriesPlotter` objects (such as `PieChart`
- * instances). It is used for initializing coordinate systems, axes and scales
- * of all series plotters which belongs to the container.
- */
-class SeriesPlotterContainer
-{
-public:
- explicit SeriesPlotterContainer( std::vector< std::unique_ptr<VCoordinateSystem> >& rVCooSysList );
- ~SeriesPlotterContainer();
-
- /** It is used to set coordinate systems (`m_rVCooSysList`), this method
- * is invoked by `ChartView::createShapes2D` before of
- * `ChartView::impl_createDiagramAndContent`.
- * Coordinate systems are retrieved through the `XCoordinateSystemContainer`
- * interface implemented by a diagram object which is provided by the
- * `ChartModel` object passed to the method (`rChartModel.getFirstDiagram()`).
- *
- * It is used for creating series plotters and appending them
- * to `m_aSeriesPlotterList`. The created series plotters are initialized
- * through data (number formats supplier, color scheme, data series),
- * extracted from the chart model or the diagram objects. An exception is
- * the explicit category provider that is retrieved through the
- * `VCoordinateSystem` object used by the series plotter.
- *
- * It sets the minimum-maximum supplier for a coordinate system:
- * this supplier is the series plotter itself which utilizes the given
- * coordinate system. In fact `VSeriesPlotter` has `MinimumMaximumSupplier`
- * as one of its base classes.
- * Hence, for instance, a `PieChart`, which is a series plotter, is
- * a `MinimumMaximumSupplier`, too.
- */
- void initializeCooSysAndSeriesPlotter( ChartModel& rModel );
-
- /** This method is invoked by `ChartView::impl_createDiagramAndContent`.
- * It iterates on every axis of every coordinate systems, and if the axis
- * is not yet present in `m_aAxisUsageList` it creates a new `AxisUsage`
- * object and initialize its `aAutoScaling` member to the `ScaleData`
- * object of the current axis.
- */
- void initAxisUsageList(const Date& rNullDate);
-
- /**
- * Perform automatic axis scaling and determine the amount and spacing of
- * increments. It assumes that the caller has determined the size of the
- * largest axis label text object prior to calling this method.
- *
- * The new axis scaling data will be stored in the VCoordinateSystem
- * objects. The label alignment direction for each axis will also get
- * determined during this process, and stored in VAxis.
- *
- * This method is invoked by `ChartView::impl_createDiagramAndContent`
- * soon after `initAxisUsageList`.
- * It initializes explicit scale and increment objects for all coordinate
- * systems in `m_rVCooSysList`.
- * This action is achieved by iterating on the `m_aAxisUsageList` container,
- * and performing 3 steps:
- * 1- call `VCoordinateSystem::prepareAutomaticAxisScaling` for setting
- * scaling parameters of the `aAutoScaling` member (a `ScaleAutomatism`
- * object) for the current `AxisUsage` instance
- * (see `VCoordinateSystem::prepareAutomaticAxisScaling`);
- * 2- calculate the explicit scale and increment objects
- * (see ScaleAutomatism::calculateExplicitScaleAndIncrement);
- * 3- set the explicit scale and increment objects for each coordinate
- * system.
- */
- void doAutoScaling( ChartModel& rModel );
-
- /**
- * After auto-scaling is performed, call this method to set the explicit
- * scaling and increment data to all relevant VAxis objects.
- */
- void updateScalesAndIncrementsOnAxes();
-
- /**
- * After auto-scaling is performed, call this method to set the explicit
- * scaling data to all the plotters.
- */
- void setScalesFromCooSysToPlotter();
-
- void setNumberFormatsFromAxes();
- drawing::Direction3D getPreferredAspectRatio();
-
- SeriesPlottersType& getSeriesPlotterList() { return m_aSeriesPlotterList; }
- std::vector< std::unique_ptr<VCoordinateSystem> >& getCooSysList() { return m_rVCooSysList; }
- std::vector< LegendEntryProvider* > getLegendEntryProviderList();
-
- void AdaptScaleOfYAxisWithoutAttachedSeries( ChartModel& rModel );
-
- bool isCategoryPositionShifted(
- const chart2::ScaleData& rSourceScale, bool bHasComplexCategories );
-
-private:
- /** A vector of series plotters.
- */
- SeriesPlottersType m_aSeriesPlotterList;
-
- /** A vector of coordinate systems.
- */
- std::vector< std::unique_ptr<VCoordinateSystem> >& m_rVCooSysList;
-
- /** A map whose key is a `XAxis` interface and the related value is
- * an object of `AxisUsage` type.
- */
- std::map< uno::Reference< XAxis >, AxisUsage > m_aAxisUsageList;
-
- /**
- * Max axis index of all dimensions. Currently this can be either 0 or 1
- * since we only support primary and secondary axes per dimension. The
- * value of 0 means all dimensions have only primary axis, while 1 means
- * at least one dimension has a secondary axis.
- */
- sal_Int32 m_nMaxAxisIndex;
-
- bool m_bChartTypeUsesShiftedCategoryPositionPerDefault;
- sal_Int32 m_nDefaultDateNumberFormat;
-};
-
-SeriesPlotterContainer::SeriesPlotterContainer( std::vector< std::unique_ptr<VCoordinateSystem> >& rVCooSysList )
- : m_rVCooSysList( rVCooSysList )
- , m_nMaxAxisIndex(0)
- , m_bChartTypeUsesShiftedCategoryPositionPerDefault(false)
- , m_nDefaultDateNumberFormat(0)
-{
-}
-
-SeriesPlotterContainer::~SeriesPlotterContainer()
-{
- // - remove plotter from coordinatesystems
- for(auto & nC : m_rVCooSysList)
- nC->clearMinimumAndMaximumSupplierList();
-}
-
-std::vector< LegendEntryProvider* > SeriesPlotterContainer::getLegendEntryProviderList()
-{
- std::vector< LegendEntryProvider* > aRet( m_aSeriesPlotterList.size() );
- sal_Int32 nN = 0;
- for( const std::unique_ptr<VSeriesPlotter>& aPlotter : m_aSeriesPlotterList)
- aRet[nN++] = aPlotter.get();
- return aRet;
-}
-
-VCoordinateSystem* findInCooSysList( const std::vector< std::unique_ptr<VCoordinateSystem> >& rVCooSysList
- , const rtl::Reference< BaseCoordinateSystem >& xCooSys )
-{
- for(auto & pVCooSys : rVCooSysList)
- {
- if(pVCooSys->getModel()==xCooSys)
- return pVCooSys.get();
- }
- return nullptr;
-}
-
-VCoordinateSystem* lcl_getCooSysForPlotter( const std::vector< std::unique_ptr<VCoordinateSystem> >& rVCooSysList, MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier )
-{
- if(!pMinimumAndMaximumSupplier)
- return nullptr;
- for(auto & pVCooSys : rVCooSysList)
- {
- if(pVCooSys->hasMinimumAndMaximumSupplier( pMinimumAndMaximumSupplier ))
- return pVCooSys.get();
- }
- return nullptr;
-}
-
-VCoordinateSystem* addCooSysToList( std::vector< std::unique_ptr<VCoordinateSystem> >& rVCooSysList
- , const rtl::Reference< BaseCoordinateSystem >& xCooSys
- , ChartModel& rChartModel )
-{
- VCoordinateSystem* pExistingVCooSys = findInCooSysList( rVCooSysList, xCooSys );
- if( pExistingVCooSys )
- return pExistingVCooSys;
-
- std::unique_ptr<VCoordinateSystem> pVCooSys = VCoordinateSystem::createCoordinateSystem(xCooSys );
- if(!pVCooSys)
- return nullptr;
-
- OUString aCooSysParticle( ObjectIdentifier::createParticleForCoordinateSystem( xCooSys, rChartModel ) );
- pVCooSys->setParticle(aCooSysParticle);
-
- pVCooSys->setExplicitCategoriesProvider( new ExplicitCategoriesProvider(xCooSys, rChartModel) );
- rVCooSysList.push_back( std::move(pVCooSys) );
- return rVCooSysList.back().get();
-}
-
-void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
- ChartModel& rChartModel )
-{
- rtl::Reference< Diagram > xDiagram = rChartModel.getFirstChartDiagram();
- if( !xDiagram.is())
- return;
-
- uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( &rChartModel );
- if( rChartModel.hasInternalDataProvider() && DiagramHelper::isSupportingDateAxis( xDiagram ) )
- m_nDefaultDateNumberFormat=DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
-
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
- if(!nDimensionCount)
- {
- //@todo handle mixed dimension
- nDimensionCount = 2;
- }
-
- bool bSortByXValues = false;
- bool bConnectBars = false;
- bool bGroupBarsPerAxis = true;
- bool bIncludeHiddenCells = true;
- bool bSecondaryYaxisVisible = true;
- sal_Int32 nStartingAngle = 90;
- sal_Int32 n3DRelativeHeight = 100;
- try
- {
- xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= bSortByXValues;
- xDiagram->getPropertyValue( "ConnectBars" ) >>= bConnectBars;
- xDiagram->getPropertyValue( "GroupBarsPerAxis" ) >>= bGroupBarsPerAxis;
- xDiagram->getPropertyValue( "IncludeHiddenCells" ) >>= bIncludeHiddenCells;
- xDiagram->getPropertyValue( "StartingAngle" ) >>= nStartingAngle;
-
- if (nDimensionCount == 3)
- {
- xDiagram->getPropertyValue( "3DRelativeHeight" ) >>= n3DRelativeHeight;
- }
- }
- catch( const uno::Exception & )
- {
- DBG_UNHANDLED_EXCEPTION("chart2" );
- }
-
- //prepare for autoscaling and shape creation
- // - create plotter for charttypes (for each first scale group at each plotter, as they are independent)
- // - add series to plotter (thus each charttype can provide minimum and maximum values for autoscaling)
- // - add plotter to coordinate systems
-
- //iterate through all coordinate systems
- uno::Reference< XColorScheme > xColorScheme( xDiagram->getDefaultColorScheme());
- auto & rCooSysList = xDiagram->getBaseCoordinateSystems();
- sal_Int32 nGlobalSeriesIndex = 0;//for automatic symbols
- for( sal_Int32 nCS = 0; nCS < static_cast<sal_Int32>(rCooSysList.size()); ++nCS )
- {
- rtl::Reference< BaseCoordinateSystem > xCooSys( rCooSysList[nCS] );
- VCoordinateSystem* pVCooSys = addCooSysToList(m_rVCooSysList,xCooSys,rChartModel);
- // Let's check whether the secondary Y axis is visible
- try
- {
- if (xCooSys->getMaximumAxisIndexByDimension(1) > 0)
- {
- Reference< beans::XPropertySet > xAxisProp(xCooSys->getAxisByDimension(1, 1), uno::UNO_QUERY);
- xAxisProp->getPropertyValue("Show") >>= bSecondaryYaxisVisible;
- }
- }
- catch (const lang::IndexOutOfBoundsException&)
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- //iterate through all chart types in the current coordinate system
- uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xCooSys->getChartTypes() );
- for( sal_Int32 nT = 0; nT < aChartTypeList.getLength(); ++nT )
- {
- uno::Reference< XChartType > xChartType( aChartTypeList[nT] );
- if(nDimensionCount == 3 && xChartType->getChartType().equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE))
- {
- uno::Reference< beans::XPropertySet > xPropertySet( xChartType, uno::UNO_QUERY );
- if (xPropertySet.is())
- {
- try
- {
- sal_Int32 n3DRelativeHeightOldValue(100);
- uno::Any aAny = xPropertySet->getPropertyValue( "3DRelativeHeight" );
- aAny >>= n3DRelativeHeightOldValue;
- if (n3DRelativeHeightOldValue != n3DRelativeHeight)
- xPropertySet->setPropertyValue( "3DRelativeHeight", uno::Any(n3DRelativeHeight) );
- }
- catch (const uno::Exception&) { }
- }
- }
-
- if(nT==0)
- m_bChartTypeUsesShiftedCategoryPositionPerDefault = ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( xChartType );
-
- bool bExcludingPositioning = DiagramHelper::getDiagramPositioningMode( xDiagram ) == DiagramPositioningMode_EXCLUDING;
- VSeriesPlotter* pPlotter = VSeriesPlotter::createSeriesPlotter( xChartType, nDimensionCount, bExcludingPositioning );
- if( !pPlotter )
- continue;
-
- m_aSeriesPlotterList.push_back( std::unique_ptr<VSeriesPlotter>(pPlotter) );
- pPlotter->setNumberFormatsSupplier( xNumberFormatsSupplier );
- pPlotter->setColorScheme( xColorScheme );
- if(pVCooSys)
- pPlotter->setExplicitCategoriesProvider( pVCooSys->getExplicitCategoriesProvider() );
- sal_Int32 nMissingValueTreatment = DiagramHelper::getCorrectedMissingValueTreatment( xDiagram, xChartType );
-
- if(pVCooSys)
- pVCooSys->addMinimumAndMaximumSupplier(pPlotter);
-
- uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
- OSL_ASSERT( xDataSeriesContainer.is());
- if( !xDataSeriesContainer.is() )
- continue;
-
- sal_Int32 zSlot=-1;
- sal_Int32 xSlot=-1;
- sal_Int32 ySlot=-1;
- uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
- for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS )
- {
- uno::Reference< XDataSeries > const & xDataSeries = aSeriesList[nS];
- if(!xDataSeries.is())
- continue;
- if( !bIncludeHiddenCells && !DataSeriesHelper::hasUnhiddenData(xDataSeries) )
- continue;
-
- std::unique_ptr<VDataSeries> pSeries(new VDataSeries( xDataSeries ));
-
- pSeries->setGlobalSeriesIndex(nGlobalSeriesIndex);
- nGlobalSeriesIndex++;
-
- if( bSortByXValues )
- pSeries->doSortByXValues();
-
- pSeries->setConnectBars( bConnectBars );
- pSeries->setGroupBarsPerAxis( bGroupBarsPerAxis );
- pSeries->setStartingAngle( nStartingAngle );
-
- pSeries->setMissingValueTreatment( nMissingValueTreatment );
-
- OUString aSeriesParticle( ObjectIdentifier::createParticleForSeries( 0, nCS, nT, nS ) );
- pSeries->setParticle(aSeriesParticle);
-
- OUString aRole( ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( xChartType ) );
- pSeries->setRoleOfSequenceForDataLabelNumberFormatDetection(aRole);
-
- //ignore secondary axis for charttypes that do not support them
- if( pSeries->getAttachedAxisIndex() != MAIN_AXIS_INDEX &&
- ( !ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount ) ||
- !bSecondaryYaxisVisible ) )
- {
- pSeries->setAttachedAxisIndex(MAIN_AXIS_INDEX);
- }
-
- StackingDirection eDirection = pSeries->getStackingDirection();
- switch(eDirection)
- {
- case StackingDirection_NO_STACKING:
- xSlot++; ySlot=-1;
- if(zSlot<0)
- zSlot=0;
- break;
- case StackingDirection_Y_STACKING:
- ySlot++;
- if(xSlot<0)
- xSlot=0;
- if(zSlot<0)
- zSlot=0;
- break;
- case StackingDirection_Z_STACKING:
- zSlot++; xSlot=-1; ySlot=-1;
- break;
- default:
- // UNO enums have one additional auto-generated case
- break;
- }
- pPlotter->addSeries( std::move(pSeries), zSlot, xSlot, ySlot );
- }
- }
- }
-
- //transport seriesnames to the coordinatesystems if needed
- if( m_aSeriesPlotterList.empty() )
- return;
-
- uno::Sequence< OUString > aSeriesNames;
- bool bSeriesNamesInitialized = false;
- for(auto & pVCooSys : m_rVCooSysList)
- {
- if( pVCooSys->needSeriesNamesForAxis() )
- {
- if(!bSeriesNamesInitialized)
- {
- aSeriesNames = m_aSeriesPlotterList[0]->getSeriesNames();
- bSeriesNamesInitialized = true;
- }
- pVCooSys->setSeriesNamesForAxis( aSeriesNames );
- }
- }
-}
-
-bool SeriesPlotterContainer::isCategoryPositionShifted(
- const chart2::ScaleData& rSourceScale, bool bHasComplexCategories )
-{
- if (rSourceScale.AxisType == AxisType::CATEGORY)
- return bHasComplexCategories || rSourceScale.ShiftedCategoryPosition || m_bChartTypeUsesShiftedCategoryPositionPerDefault;
-
- if (rSourceScale.AxisType == AxisType::DATE)
- return rSourceScale.ShiftedCategoryPosition;
-
- return rSourceScale.AxisType == AxisType::SERIES;
-}
-
-void SeriesPlotterContainer::initAxisUsageList(const Date& rNullDate)
-{
- m_aAxisUsageList.clear();
-
- // Loop through coordinate systems in the diagram (though for now
- // there should only be one coordinate system per diagram).
- for (auto & pVCooSys : m_rVCooSysList)
- {
- uno::Reference<XCoordinateSystem> xCooSys = pVCooSys->getModel();
- sal_Int32 nDimCount = xCooSys->getDimension();
- bool bComplexCategoryAllowed = ChartTypeHelper::isSupportingComplexCategory(AxisHelper::getChartTypeByIndex(xCooSys, 0));
-
- for (sal_Int32 nDimIndex = 0; nDimIndex < nDimCount; ++nDimIndex)
- {
- bool bDateAxisAllowed = ChartTypeHelper::isSupportingDateAxis(
- AxisHelper::getChartTypeByIndex(xCooSys, 0), nDimIndex);
-
- // Each dimension may have primary and secondary axes.
- const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimIndex);
- for (sal_Int32 nAxisIndex = 0; nAxisIndex <= nMaxAxisIndex; ++nAxisIndex)
- {
- uno::Reference<XAxis> xAxis = xCooSys->getAxisByDimension(nDimIndex, nAxisIndex);
-
- if (!xAxis.is())
- continue;
-
- if (m_aAxisUsageList.find(xAxis) == m_aAxisUsageList.end())
- {
- // Create axis usage object for this axis.
-
- chart2::ScaleData aSourceScale = xAxis->getScaleData();
- ExplicitCategoriesProvider* pCatProvider = pVCooSys->getExplicitCategoriesProvider();
- if (nDimIndex == 0)
- AxisHelper::checkDateAxis( aSourceScale, pCatProvider, bDateAxisAllowed );
-
- bool bHasComplexCat = pCatProvider && pCatProvider->hasComplexCategories() && bComplexCategoryAllowed;
- aSourceScale.ShiftedCategoryPosition = isCategoryPositionShifted(aSourceScale, bHasComplexCat);
-
- m_aAxisUsageList[xAxis].aAutoScaling = ScaleAutomatism(aSourceScale, rNullDate);
- }
-
- AxisUsage& rAxisUsage = m_aAxisUsageList[xAxis];
- rAxisUsage.addCoordinateSystem(pVCooSys.get(), nDimIndex, nAxisIndex);
- }
- }
- }
-
- // Determine the highest axis index of all dimensions.
- m_nMaxAxisIndex = 0;
- for (const auto & pVCooSys : m_rVCooSysList)
- {
- uno::Reference<XCoordinateSystem> xCooSys = pVCooSys->getModel();
- sal_Int32 nDimCount = xCooSys->getDimension();
-
- for (sal_Int32 nDimIndex = 0; nDimIndex < nDimCount; ++nDimIndex)
- {
- for (auto & axisUsage : m_aAxisUsageList)
- {
- sal_Int32 nLocalMax = axisUsage.second.getMaxAxisIndexForDimension(nDimIndex);
- if (m_nMaxAxisIndex < nLocalMax)
- m_nMaxAxisIndex = nLocalMax;
- }
- }
- }
-}
-
-void SeriesPlotterContainer::setScalesFromCooSysToPlotter()
-{
- //set scales to plotter to enable them to provide the preferred scene AspectRatio
- for( const std::unique_ptr<VSeriesPlotter>& aPlotter : m_aSeriesPlotterList )
- {
- VSeriesPlotter* pSeriesPlotter = aPlotter.get();
- VCoordinateSystem* pVCooSys = lcl_getCooSysForPlotter( m_rVCooSysList, pSeriesPlotter );
- if(pVCooSys)
- {
- pSeriesPlotter->setScales( pVCooSys->getExplicitScales(0,0), pVCooSys->getPropertySwapXAndYAxis() );
- sal_Int32 nMaxAxisIndex = pVCooSys->getMaximumAxisIndexByDimension(1);//only additional value axis are relevant for series plotter
- for( sal_Int32 nI=1; nI<=nMaxAxisIndex; nI++ )
- pSeriesPlotter->addSecondaryValueScale( pVCooSys->getExplicitScale(1,nI), nI );
- }
- }
-}
-
-void SeriesPlotterContainer::setNumberFormatsFromAxes()
-{
- //set numberformats to plotter to enable them to display the data labels in the numberformat of the axis
- for( const std::unique_ptr<VSeriesPlotter>& aPlotter : m_aSeriesPlotterList )
- {
- VSeriesPlotter* pSeriesPlotter = aPlotter.get();
- VCoordinateSystem* pVCooSys = lcl_getCooSysForPlotter( m_rVCooSysList, pSeriesPlotter );
- if(pVCooSys)
- {
- AxesNumberFormats aAxesNumberFormats;
- const uno::Reference< XCoordinateSystem >& xCooSys = pVCooSys->getModel();
- sal_Int32 nDimensionCount = xCooSys->getDimension();
- for(sal_Int32 nDimensionIndex=0; nDimensionIndex<nDimensionCount; ++nDimensionIndex)
- {
- const sal_Int32 nMaximumAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
- for(sal_Int32 nAxisIndex=0; nAxisIndex<=nMaximumAxisIndex; ++nAxisIndex)
- {
- try
- {
- Reference< beans::XPropertySet > xAxisProp( xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ), uno::UNO_QUERY );
- if( xAxisProp.is())
- {
- sal_Int32 nNumberFormatKey(0);
- if( xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey )
- {
- aAxesNumberFormats.setFormat( nNumberFormatKey, nDimensionIndex, nAxisIndex );
- }
- else if( nDimensionIndex==0 )
- {
- //provide a default date format for date axis with own data
- aAxesNumberFormats.setFormat( m_nDefaultDateNumberFormat, nDimensionIndex, nAxisIndex );
- }
- }
- }
- catch( const lang::IndexOutOfBoundsException& )
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- }
- }
- }
- }
-}
-
-void SeriesPlotterContainer::updateScalesAndIncrementsOnAxes()
-{
- for(auto & nC : m_rVCooSysList)
- nC->updateScalesAndIncrementsOnAxes();
-}
-
-void SeriesPlotterContainer::doAutoScaling( ChartModel& rChartModel )
-{
- if (m_aSeriesPlotterList.empty() || m_aAxisUsageList.empty())
- // We need these two containers populated to do auto-scaling. Bail out.
- return;
-
- //iterate over the main scales first than secondary axis
- for (sal_Int32 nAxisIndex = 0; nAxisIndex <= m_nMaxAxisIndex; ++nAxisIndex)
- {
- // - first do autoscale for all x and z scales (because they are treated independent)
- for (auto & axisUsage : m_aAxisUsageList)
- {
- AxisUsage& rAxisUsage = axisUsage.second;
-
- rAxisUsage.prepareAutomaticAxisScaling(rAxisUsage.aAutoScaling, 0, nAxisIndex);
- rAxisUsage.prepareAutomaticAxisScaling(rAxisUsage.aAutoScaling, 2, nAxisIndex);
-
- ExplicitScaleData aExplicitScale;
- ExplicitIncrementData aExplicitIncrement;
- rAxisUsage.aAutoScaling.calculateExplicitScaleAndIncrement( aExplicitScale, aExplicitIncrement );
-
- rAxisUsage.setExplicitScaleAndIncrement(0, nAxisIndex, aExplicitScale, aExplicitIncrement);
- rAxisUsage.setExplicitScaleAndIncrement(2, nAxisIndex, aExplicitScale, aExplicitIncrement);
- }
-
- // - second do autoscale for the dependent y scales (the coordinate systems are prepared with x and z scales already )
- for (auto & axisUsage : m_aAxisUsageList)
- {
- AxisUsage& rAxisUsage = axisUsage.second;
-
- rAxisUsage.prepareAutomaticAxisScaling(rAxisUsage.aAutoScaling, 1, nAxisIndex);
-
- ExplicitScaleData aExplicitScale;
- ExplicitIncrementData aExplicitIncrement;
- rAxisUsage.aAutoScaling.calculateExplicitScaleAndIncrement( aExplicitScale, aExplicitIncrement );
-
- rAxisUsage.setExplicitScaleAndIncrement(0, nAxisIndex, aExplicitScale, aExplicitIncrement);
- rAxisUsage.setExplicitScaleAndIncrement(1, nAxisIndex, aExplicitScale, aExplicitIncrement);
- rAxisUsage.setExplicitScaleAndIncrement(2, nAxisIndex, aExplicitScale, aExplicitIncrement);
- }
- }
- AdaptScaleOfYAxisWithoutAttachedSeries( rChartModel );
-}
-
-void SeriesPlotterContainer::AdaptScaleOfYAxisWithoutAttachedSeries( ChartModel& rModel )
-{
- //issue #i80518#
- for( sal_Int32 nAxisIndex=0; nAxisIndex<=m_nMaxAxisIndex; nAxisIndex++ )
- {
- for (auto & axisUsage : m_aAxisUsageList)
- {
- AxisUsage& rAxisUsage = axisUsage.second;
- std::vector< VCoordinateSystem* > aVCooSysList_Y = rAxisUsage.getCoordinateSystems( 1, nAxisIndex );
- if( aVCooSysList_Y.empty() )
- continue;
-
- uno::Reference< XDiagram > xDiagram( rModel.getFirstDiagram() );
- if (!xDiagram.is())
- continue;
-
- bool bSeriesAttachedToThisAxis = false;
- sal_Int32 nAttachedAxisIndex = -1;
- {
- std::vector< Reference< XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
- for (auto const& series : aSeriesVector)
- {
- sal_Int32 nCurrentIndex = DataSeriesHelper::getAttachedAxisIndex(series);
- if( nAxisIndex == nCurrentIndex )
- {
- bSeriesAttachedToThisAxis = true;
- break;
- }
- else if( nAttachedAxisIndex<0 || nAttachedAxisIndex>nCurrentIndex )
- nAttachedAxisIndex=nCurrentIndex;
- }
- }
-
- if (bSeriesAttachedToThisAxis || nAttachedAxisIndex < 0)
- continue;
-
- for(VCoordinateSystem* nC : aVCooSysList_Y)
- {
- nC->prepareAutomaticAxisScaling( rAxisUsage.aAutoScaling, 1, nAttachedAxisIndex );
-
- ExplicitScaleData aExplicitScaleSource = nC->getExplicitScale( 1,nAttachedAxisIndex );
- ExplicitIncrementData aExplicitIncrementSource = nC->getExplicitIncrement( 1,nAttachedAxisIndex );
-
- ExplicitScaleData aExplicitScaleDest = nC->getExplicitScale( 1,nAxisIndex );
- ExplicitIncrementData aExplicitIncrementDest = nC->getExplicitIncrement( 1,nAxisIndex );
-
- aExplicitScaleDest.Orientation = aExplicitScaleSource.Orientation;
- aExplicitScaleDest.Scaling = aExplicitScaleSource.Scaling;
- aExplicitScaleDest.AxisType = aExplicitScaleSource.AxisType;
-
- aExplicitIncrementDest.BaseValue = aExplicitIncrementSource.BaseValue;
-
- ScaleData aScale( rAxisUsage.aAutoScaling.getScale() );
- if( !aScale.Minimum.hasValue() )
- {
- bool bNewMinOK = true;
- double fMax=0.0;
- if( aScale.Maximum >>= fMax )
- bNewMinOK = (aExplicitScaleSource.Minimum <= fMax);
- if( bNewMinOK )
- aExplicitScaleDest.Minimum = aExplicitScaleSource.Minimum;
- }
- else
- aExplicitIncrementDest.BaseValue = aExplicitScaleDest.Minimum;
-
- if( !aScale.Maximum.hasValue() )
- {
- bool bNewMaxOK = true;
- double fMin=0.0;
- if( aScale.Minimum >>= fMin )
- bNewMaxOK = (fMin <= aExplicitScaleSource.Maximum);
- if( bNewMaxOK )
- aExplicitScaleDest.Maximum = aExplicitScaleSource.Maximum;
- }
- if( !aScale.Origin.hasValue() )
- aExplicitScaleDest.Origin = aExplicitScaleSource.Origin;
-
- if( !aScale.IncrementData.Distance.hasValue() )
- aExplicitIncrementDest.Distance = aExplicitIncrementSource.Distance;
-
- bool bAutoMinorInterval = true;
- if( aScale.IncrementData.SubIncrements.hasElements() )
- bAutoMinorInterval = !( aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() );
- if( bAutoMinorInterval )
- {
- if( !aExplicitIncrementDest.SubIncrements.empty() && !aExplicitIncrementSource.SubIncrements.empty() )
- aExplicitIncrementDest.SubIncrements[0].IntervalCount =
- aExplicitIncrementSource.SubIncrements[0].IntervalCount;
- }
-
- nC->setExplicitScaleAndIncrement( 1, nAxisIndex, aExplicitScaleDest, aExplicitIncrementDest );
- }
- }
- }
-
- if( !AxisHelper::isAxisPositioningEnabled() )
- return;
-
- //correct origin for y main axis (the origin is where the other main axis crosses)
- sal_Int32 nAxisIndex=0;
- sal_Int32 nDimensionIndex=1;
- for (auto & axisUsage : m_aAxisUsageList)
- {
- AxisUsage& rAxisUsage = axisUsage.second;
- std::vector< VCoordinateSystem* > aVCooSysList = rAxisUsage.getCoordinateSystems(nDimensionIndex,nAxisIndex);
- size_t nC;
- for( nC=0; nC < aVCooSysList.size(); nC++)
- {
- ExplicitScaleData aExplicitScale( aVCooSysList[nC]->getExplicitScale( nDimensionIndex, nAxisIndex ) );
- ExplicitIncrementData aExplicitIncrement( aVCooSysList[nC]->getExplicitIncrement( nDimensionIndex, nAxisIndex ) );
-
- Reference< chart2::XCoordinateSystem > xCooSys( aVCooSysList[nC]->getModel() );
- Reference< XAxis > xAxis( xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) );
- Reference< beans::XPropertySet > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( xAxis, xCooSys ), uno::UNO_QUERY );
-
- if( xCrossingMainAxis.is() )
- {
- css::chart::ChartAxisPosition eCrossingMainAxisPos( css::chart::ChartAxisPosition_ZERO );
- xCrossingMainAxis->getPropertyValue("CrossoverPosition") >>= eCrossingMainAxisPos;
- if( eCrossingMainAxisPos == css::chart::ChartAxisPosition_VALUE )
- {
- double fValue = 0.0;
- xCrossingMainAxis->getPropertyValue("CrossoverValue") >>= fValue;
- aExplicitScale.Origin = fValue;
- }
- else if( eCrossingMainAxisPos == css::chart::ChartAxisPosition_ZERO )
- aExplicitScale.Origin = 0.0;
- else if( eCrossingMainAxisPos == css::chart::ChartAxisPosition_START )
- aExplicitScale.Origin = aExplicitScale.Minimum;
- else if( eCrossingMainAxisPos == css::chart::ChartAxisPosition_END )
- aExplicitScale.Origin = aExplicitScale.Maximum;
- }
-
- aVCooSysList[nC]->setExplicitScaleAndIncrement( nDimensionIndex, nAxisIndex, aExplicitScale, aExplicitIncrement );
- }
- }
-}
-
-drawing::Direction3D SeriesPlotterContainer::getPreferredAspectRatio()
-{
- drawing::Direction3D aPreferredAspectRatio(1.0,1.0,1.0);
-
- //get a list of all preferred aspect ratios and combine them
- //first with special demands wins (less or equal zero <-> arbitrary)
- double fx, fy, fz;
- fx = fy = fz = -1.0;
- for( const std::unique_ptr<VSeriesPlotter>& aPlotter : m_aSeriesPlotterList )
- {
- drawing::Direction3D aSingleRatio( aPlotter->getPreferredDiagramAspectRatio() );
- if( fx<0 && aSingleRatio.DirectionX>0 )
- fx = aSingleRatio.DirectionX;
-
- if( fy<0 && aSingleRatio.DirectionY>0 )
- {
- if( fx>0 && aSingleRatio.DirectionX>0 )
- fy = fx*aSingleRatio.DirectionY/aSingleRatio.DirectionX;
- else if( fz>0 && aSingleRatio.DirectionZ>0 )
- fy = fz*aSingleRatio.DirectionY/aSingleRatio.DirectionZ;
- else
- fy = aSingleRatio.DirectionY;
- }
-
- if( fz<0 && aSingleRatio.DirectionZ>0 )
- {
- if( fx>0 && aSingleRatio.DirectionX>0 )
- fz = fx*aSingleRatio.DirectionZ/aSingleRatio.DirectionX;
- else if( fy>0 && aSingleRatio.DirectionY>0 )
- fz = fy*aSingleRatio.DirectionZ/aSingleRatio.DirectionY;
- else
- fz = aSingleRatio.DirectionZ;
- }
-
- if( fx>0 && fy>0 && fz>0 )
- break;
- }
- aPreferredAspectRatio = drawing::Direction3D(fx, fy, fz);
- return aPreferredAspectRatio;
-}
-
-}
-
struct CreateShapeParam2D
{
css::awt::Rectangle maRemainingSpace;
@@ -1028,18 +156,13 @@ struct CreateShapeParam2D
mbUseFixedInnerSize(false) {}
};
-const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId()
-{
- static const comphelper::UnoIdInit theExplicitValueProviderUnoTunnelId;
- return theExplicitValueProviderUnoTunnelId.getSeq();
-}
+
ChartView::ChartView(
- uno::Reference<uno::XComponentContext> const & xContext,
+ uno::Reference<uno::XComponentContext> xContext,
ChartModel& rModel)
- : m_xCC(xContext)
+ : m_xCC(std::move(xContext))
, mrChartModel(rModel)
- , m_aListenerContainer( m_aMutex )
, m_bViewDirty(true)
, m_bInViewUpdate(false)
, m_bViewUpdatePending(false)
@@ -1101,10 +224,10 @@ void ChartView::impl_deleteCoordinateSystems()
// datatransfer::XTransferable
namespace
{
-constexpr OUStringLiteral lcl_aGDIMetaFileMIMEType(
- u"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" );
-constexpr OUStringLiteral lcl_aGDIMetaFileMIMETypeHighContrast(
- u"application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" );
+constexpr OUString lcl_aGDIMetaFileMIMEType(
+ u"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\""_ustr );
+constexpr OUString lcl_aGDIMetaFileMIMETypeHighContrast(
+ u"application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\""_ustr );
} // anonymous namespace
void ChartView::getMetaFile( const uno::Reference< io::XOutputStream >& xOutStream
@@ -1117,21 +240,21 @@ void ChartView::getMetaFile( const uno::Reference< io::XOutputStream >& xOutStre
uno::Reference< drawing::XGraphicExportFilter > xExporter = drawing::GraphicExportFilter::create( m_xCC );
uno::Sequence< beans::PropertyValue > aFilterData{
- comphelper::makePropertyValue("ExportOnlyBackground", false),
- comphelper::makePropertyValue("HighContrast", bUseHighContrast),
- comphelper::makePropertyValue("Version", sal_Int32(SOFFICE_FILEFORMAT_50)),
- comphelper::makePropertyValue("CurrentPage", uno::Reference< uno::XInterface >( static_cast<cppu::OWeakObject*>(m_xDrawPage.get()), uno::UNO_QUERY )),
+ comphelper::makePropertyValue(u"ExportOnlyBackground"_ustr, false),
+ comphelper::makePropertyValue(u"HighContrast"_ustr, bUseHighContrast),
+ comphelper::makePropertyValue(u"Version"_ustr, sal_Int32(SOFFICE_FILEFORMAT_50)),
+ comphelper::makePropertyValue(u"CurrentPage"_ustr, uno::Reference< uno::XInterface >( static_cast<cppu::OWeakObject*>(m_xDrawPage.get()), uno::UNO_QUERY )),
//#i75867# poor quality of ole's alternative view with 3D scenes and zoomfactors besides 100%
- comphelper::makePropertyValue("ScaleXNumerator", m_nScaleXNumerator),
- comphelper::makePropertyValue("ScaleXDenominator", m_nScaleXDenominator),
- comphelper::makePropertyValue("ScaleYNumerator", m_nScaleYNumerator),
- comphelper::makePropertyValue("ScaleYDenominator", m_nScaleYDenominator)
+ comphelper::makePropertyValue(u"ScaleXNumerator"_ustr, m_nScaleXNumerator),
+ comphelper::makePropertyValue(u"ScaleXDenominator"_ustr, m_nScaleXDenominator),
+ comphelper::makePropertyValue(u"ScaleYNumerator"_ustr, m_nScaleYNumerator),
+ comphelper::makePropertyValue(u"ScaleYDenominator"_ustr, m_nScaleYDenominator)
};
uno::Sequence< beans::PropertyValue > aProps{
- comphelper::makePropertyValue("FilterName", OUString("SVM")),
- comphelper::makePropertyValue("OutputStream", xOutStream),
- comphelper::makePropertyValue("FilterData", aFilterData)
+ comphelper::makePropertyValue(u"FilterName"_ustr, u"SVM"_ustr),
+ comphelper::makePropertyValue(u"OutputStream"_ustr, xOutStream),
+ comphelper::makePropertyValue(u"FilterData"_ustr, aFilterData)
};
xExporter->setSourceDocument( m_xDrawPage );
@@ -1172,8 +295,8 @@ uno::Sequence< datatransfer::DataFlavor > SAL_CALL ChartView::getTransferDataFla
{
return
{
- { lcl_aGDIMetaFileMIMEType, "GDIMetaFile", cppu::UnoType<uno::Sequence< sal_Int8 >>::get() },
- { lcl_aGDIMetaFileMIMETypeHighContrast, "GDIMetaFile", cppu::UnoType<uno::Sequence< sal_Int8 >>::get() }
+ { lcl_aGDIMetaFileMIMEType, u"GDIMetaFile"_ustr, cppu::UnoType<uno::Sequence< sal_Int8 >>::get() },
+ { lcl_aGDIMetaFileMIMETypeHighContrast, u"GDIMetaFile"_ustr, cppu::UnoType<uno::Sequence< sal_Int8 >>::get() }
};
}
sal_Bool SAL_CALL ChartView::isDataFlavorSupported( const datatransfer::DataFlavor& aFlavor )
@@ -1182,12 +305,6 @@ sal_Bool SAL_CALL ChartView::isDataFlavorSupported( const datatransfer::DataFlav
aFlavor.MimeType == lcl_aGDIMetaFileMIMETypeHighContrast );
}
-// ____ XUnoTunnel ___
-::sal_Int64 SAL_CALL ChartView::getSomething( const uno::Sequence< ::sal_Int8 >& aIdentifier )
-{
- return comphelper::getSomethingImpl<ExplicitValueProvider>(aIdentifier, this);
-}
-
// lang::XServiceInfo
OUString SAL_CALL ChartView::getImplementationName()
@@ -1219,19 +336,19 @@ static ::basegfx::B3DHomMatrix createTransformationSceneToScreen(
namespace
{
-bool lcl_IsPieOrDonut( const uno::Reference< XDiagram >& xDiagram )
+bool lcl_IsPieOrDonut( const rtl::Reference< Diagram >& xDiagram )
{
//special treatment for pie charts
//the size is checked after complete creation to get the datalabels into the given space
//todo: this is just a workaround at the moment for pie and donut labels
- return DiagramHelper::isPieOrDonutChart( xDiagram );
+ return xDiagram->isPieOrDonutChart();
}
void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDrawModelWrapper, ChartModel& rModel)
{
//get writing mode from parent document:
- if( !SvtCTLOptions().IsCTLFontEnabled() )
+ if( !SvtCTLOptions::IsCTLFontEnabled() )
return;
try
@@ -1244,20 +361,20 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
uno::Reference< container::XNameAccess > xStylesFamilies( xStyleFamiliesSupplier->getStyleFamilies() );
if( xStylesFamilies.is() )
{
- if( !xStylesFamilies->hasByName( "PageStyles" ) )
+ if( !xStylesFamilies->hasByName( u"PageStyles"_ustr ) )
{
//draw/impress is parent document
uno::Reference< lang::XMultiServiceFactory > xFatcory( xParentProps, uno::UNO_QUERY );
if( xFatcory.is() )
{
- uno::Reference< beans::XPropertySet > xDrawDefaults( xFatcory->createInstance( "com.sun.star.drawing.Defaults" ), uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet > xDrawDefaults( xFatcory->createInstance( u"com.sun.star.drawing.Defaults"_ustr ), uno::UNO_QUERY );
if( xDrawDefaults.is() )
- xDrawDefaults->getPropertyValue( "WritingMode" ) >>= nWritingMode;
+ xDrawDefaults->getPropertyValue( u"WritingMode"_ustr ) >>= nWritingMode;
}
}
else
{
- uno::Reference< container::XNameAccess > xPageStyles( xStylesFamilies->getByName( "PageStyles" ), uno::UNO_QUERY );
+ uno::Reference< container::XNameAccess > xPageStyles( xStylesFamilies->getByName( u"PageStyles"_ustr ), uno::UNO_QUERY );
if( xPageStyles.is() )
{
OUString aPageStyle;
@@ -1284,7 +401,7 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
{
static OUString aChartCLSID = SvGlobalName( SO3_SCH_CLASSID ).GetHexName();
OUString aCLSID;
- xEmbeddedProps->getPropertyValue( "CLSID" ) >>= aCLSID;
+ xEmbeddedProps->getPropertyValue( u"CLSID"_ustr ) >>= aCLSID;
if( aCLSID == aChartCLSID )
{
uno::Reference< text::XTextContent > xEmbeddedObject( xEmbeddedProps, uno::UNO_QUERY );
@@ -1296,14 +413,14 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
uno::Reference< beans::XPropertySet > xAnchorProps( xAnchor, uno::UNO_QUERY );
if( xAnchorProps.is() )
{
- xAnchorProps->getPropertyValue( "WritingMode" ) >>= nWritingMode;
+ xAnchorProps->getPropertyValue( u"WritingMode"_ustr ) >>= nWritingMode;
}
uno::Reference< text::XText > xText( xAnchor->getText() );
if( xText.is() )
{
uno::Reference< beans::XPropertySet > xTextCursorProps( xText->createTextCursor(), uno::UNO_QUERY );
if( xTextCursorProps.is() )
- xTextCursorProps->getPropertyValue( "PageStyleName" ) >>= aPageStyle;
+ xTextCursorProps->getPropertyValue( u"PageStyleName"_ustr ) >>= aPageStyle;
}
}
}
@@ -1320,7 +437,7 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
{
uno::Reference< beans::XPropertySet > xTextCursorProps( xText->createTextCursor(), uno::UNO_QUERY );
if( xTextCursorProps.is() )
- xTextCursorProps->getPropertyValue( "PageStyleName" ) >>= aPageStyle;
+ xTextCursorProps->getPropertyValue( u"PageStyleName"_ustr ) >>= aPageStyle;
}
}
if(aPageStyle.isEmpty())
@@ -1329,10 +446,10 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
else
{
//Calc is parent document
- Reference< com::sun::star::beans::XPropertySetInfo > xInfo = xParentProps->getPropertySetInfo();
- if (xInfo->hasPropertyByName("PageStyle"))
+ Reference< css::beans::XPropertySetInfo > xInfo = xParentProps->getPropertySetInfo();
+ if (xInfo->hasPropertyByName(u"PageStyle"_ustr))
{
- xParentProps->getPropertyValue( "PageStyle" ) >>= aPageStyle;
+ xParentProps->getPropertyValue( u"PageStyle"_ustr ) >>= aPageStyle;
}
if(aPageStyle.isEmpty())
aPageStyle = "Default";
@@ -1340,11 +457,11 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
if( nWritingMode == -1 || nWritingMode == text::WritingMode2::PAGE )
{
uno::Reference< beans::XPropertySet > xPageStyle( xPageStyles->getByName( aPageStyle ), uno::UNO_QUERY );
- Reference< com::sun::star::beans::XPropertySetInfo > xInfo = xPageStyle->getPropertySetInfo();
- if (xInfo->hasPropertyByName("WritingMode"))
+ Reference< css::beans::XPropertySetInfo > xInfo = xPageStyle->getPropertySetInfo();
+ if (xInfo->hasPropertyByName(u"WritingMode"_ustr))
{
if( xPageStyle.is() )
- xPageStyle->getPropertyValue( "WritingMode" ) >>= nWritingMode;
+ xPageStyle->getPropertyValue( u"WritingMode"_ustr ) >>= nWritingMode;
}
}
}
@@ -1354,7 +471,7 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
if( nWritingMode != -1 && nWritingMode != text::WritingMode2::PAGE )
{
if( pDrawModelWrapper )
- pDrawModelWrapper->GetItemPool().SetPoolDefaultItem(SvxFrameDirectionItem(static_cast<SvxFrameDirection>(nWritingMode), EE_PARA_WRITINGDIR) );
+ pDrawModelWrapper->GetItemPool().SetUserDefaultItem(SvxFrameDirectionItem(static_cast<SvxFrameDirection>(nWritingMode), EE_PARA_WRITINGDIR) );
}
}
catch( const uno::Exception& )
@@ -1369,7 +486,7 @@ sal_Int16 lcl_getDefaultWritingModeFromPool( const std::shared_ptr<DrawModelWrap
if(!pDrawModelWrapper)
return nWritingMode;
- const SfxPoolItem& rItem = pDrawModelWrapper->GetItemPool().GetDefaultItem(EE_PARA_WRITINGDIR);
+ const SfxPoolItem& rItem = pDrawModelWrapper->GetItemPool().GetUserOrPoolDefaultItem(EE_PARA_WRITINGDIR);
nWritingMode
= static_cast<sal_Int16>(static_cast<const SvxFrameDirectionItem&>(rItem).GetValue());
return nWritingMode;
@@ -1382,11 +499,11 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
//return the used rectangle
awt::Rectangle aUsedOuterRect(rParam.maRemainingSpace.X, rParam.maRemainingSpace.Y, 0, 0);
- uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
+ rtl::Reference< Diagram > xDiagram( mrChartModel.getFirstChartDiagram() );
if( !xDiagram.is())
return aUsedOuterRect;
- sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
if(!nDimensionCount)
{
//@todo handle mixed dimension
@@ -1396,31 +513,28 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
basegfx::B2IRectangle aAvailableOuterRect = BaseGFXHelper::makeRectangle(rParam.maRemainingSpace);
const std::vector< std::unique_ptr<VCoordinateSystem> >& rVCooSysList( rParam.mpSeriesPlotterContainer->getCooSysList() );
- SeriesPlottersType& rSeriesPlotterList = rParam.mpSeriesPlotterContainer->getSeriesPlotterList();
+ auto& rSeriesPlotterList = rParam.mpSeriesPlotterContainer->getSeriesPlotterList();
//create VAxis, so they can give necessary information for automatic scaling
- uno::Reference<chart2::XChartDocument> const xChartDoc(&mrChartModel);
uno::Reference<util::XNumberFormatsSupplier> const xNumberFormatsSupplier(
mrChartModel.getNumberFormatsSupplier());
- size_t nC = 0;
- for( nC=0; nC < rVCooSysList.size(); nC++)
+
+ for (auto& rpVCooSys : rVCooSysList)
{
- VCoordinateSystem* pVCooSys = rVCooSysList[nC].get();
- if(nDimensionCount==3)
+ if (nDimensionCount == 3)
{
- uno::Reference<beans::XPropertySet> xSceneProperties( xDiagram, uno::UNO_QUERY );
- CuboidPlanePosition eLeftWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( xSceneProperties ) );
- CuboidPlanePosition eBackWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( xSceneProperties ) );
- CuboidPlanePosition eBottomPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( xSceneProperties ) );
- pVCooSys->set3DWallPositions( eLeftWallPos, eBackWallPos, eBottomPos );
+ CuboidPlanePosition eLeftWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( xDiagram ) );
+ CuboidPlanePosition eBackWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( xDiagram ) );
+ CuboidPlanePosition eBottomPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( xDiagram ) );
+ rpVCooSys->set3DWallPositions( eLeftWallPos, eBackWallPos, eBottomPos );
}
-
- pVCooSys->createVAxisList(xChartDoc, rPageSize, rParam.maRemainingSpace, rParam.mbUseFixedInnerSize);
+ rpVCooSys->createVAxisList(&mrChartModel, rPageSize, rParam.maRemainingSpace,
+ rParam.mbUseFixedInnerSize, rSeriesPlotterList, getComponentContext());
}
// - prepare list of all axis and how they are used
Date aNullDate = NumberFormatterWrapper( xNumberFormatsSupplier ).getNullDate();
- rParam.mpSeriesPlotterContainer->initAxisUsageList(aNullDate);
+ rParam.mpSeriesPlotterContainer->initAxisUsageList(aNullDate, mrChartModel);
rParam.mpSeriesPlotterContainer->doAutoScaling( mrChartModel );
rParam.mpSeriesPlotterContainer->setScalesFromCooSysToPlotter();
rParam.mpSeriesPlotterContainer->setNumberFormatsFromAxes();
@@ -1452,15 +566,14 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
// - create axis and grids for all coordinate systems
//init all coordinate systems
- for( nC=0; nC < rVCooSysList.size(); nC++)
+ for (auto& rpVCooSys : rVCooSysList)
{
- VCoordinateSystem* pVCooSys = rVCooSysList[nC].get();
- pVCooSys->initPlottingTargets(xSeriesTargetInFrontOfAxis,xTextTargetShapes,xSeriesTargetBehindAxis);
+ rpVCooSys->initPlottingTargets(xSeriesTargetInFrontOfAxis, xTextTargetShapes, xSeriesTargetBehindAxis);
- pVCooSys->setTransformationSceneToScreen( B3DHomMatrixToHomogenMatrix(
+ rpVCooSys->setTransformationSceneToScreen( B3DHomMatrixToHomogenMatrix(
createTransformationSceneToScreen( aVDiagram.getCurrentRectangle() ) ));
- pVCooSys->initVAxisInList();
+ rpVCooSys->initVAxisInList();
}
//calculate resulting size respecting axis label layout and fontscaling
@@ -1498,7 +611,9 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
|| aConsumedOuterRect.getMaxX() < aAvailableOuterRect.getMaxX()
|| aConsumedOuterRect.getMinY() > aAvailableOuterRect.getMinY()
|| aConsumedOuterRect.getMinY() < aAvailableOuterRect.getMaxY() )
+ {
bLessSpaceConsumedThanExpected = true;
+ }
}
if (bLessSpaceConsumedThanExpected && !rParam.mbUseFixedInnerSize)
@@ -1506,20 +621,28 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
aVDiagram.adjustInnerSize( aConsumedOuterRect );
pVCooSys->setTransformationSceneToScreen( B3DHomMatrixToHomogenMatrix(
createTransformationSceneToScreen( aVDiagram.getCurrentRectangle() ) ));
+
+ // Need to re-adjust again if the labels have changed height because of
+ // text can break. Ideally this shouldn't be needed, but the chart height
+ // isn't readjusted otherwise.
+ pVCooSys->createAxesLabels();
+ aConsumedOuterRect = ShapeFactory::getRectangleOfShape(*xBoundingShape);
+ aVDiagram.adjustInnerSize(aConsumedOuterRect);
+ pVCooSys->setTransformationSceneToScreen(B3DHomMatrixToHomogenMatrix(
+ createTransformationSceneToScreen(aVDiagram.getCurrentRectangle())));
+
}
pVCooSys->updatePositions();//todo: logically this belongs to the condition above, but it seems also to be necessary to give the axes group shapes the right bounding rects for hit test - probably caused by bug i106183 -> check again if fixed
}
//create axes and grids for the final size
- for( nC=0; nC < rVCooSysList.size(); nC++)
+ for (auto& rpVCooSys : rVCooSysList)
{
- VCoordinateSystem* pVCooSys = rVCooSysList[nC].get();
-
- pVCooSys->setTransformationSceneToScreen( B3DHomMatrixToHomogenMatrix(
+ rpVCooSys->setTransformationSceneToScreen( B3DHomMatrixToHomogenMatrix(
createTransformationSceneToScreen( aVDiagram.getCurrentRectangle() ) ));
- pVCooSys->createAxesShapes();
- pVCooSys->createGridShapes();
+ rpVCooSys->createAxesShapes();
+ rpVCooSys->createGridShapes();
}
// - create data series for all charttypes
@@ -1537,7 +660,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
}
pSeriesPlotter->initPlotter( xSeriesTarget,xTextTargetShapes,OUString() );
pSeriesPlotter->setPageReferenceSize( rPageSize );
- VCoordinateSystem* pVCooSys = lcl_getCooSysForPlotter( rVCooSysList, pSeriesPlotter );
+ VCoordinateSystem* pVCooSys = SeriesPlotterContainer::getCooSysForPlotter( rVCooSysList, pSeriesPlotter );
if(nDimensionCount==2)
pSeriesPlotter->setTransformationSceneToScreen( pVCooSys->getTransformationSceneToScreen() );
//better performance for big data
@@ -1578,17 +701,16 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
ShapeFactory::removeSubShapes( xTextTargetShapes );
//set new transformation
- for( nC=0; nC < rVCooSysList.size(); nC++)
+ for (auto& rpVCooSys : rVCooSysList)
{
- VCoordinateSystem* pVCooSys = rVCooSysList[nC].get();
- pVCooSys->setTransformationSceneToScreen( B3DHomMatrixToHomogenMatrix(
- createTransformationSceneToScreen( aNewInnerRect ) ));
+ auto aMatrix = createTransformationSceneToScreen(aNewInnerRect);
+ rpVCooSys->setTransformationSceneToScreen(B3DHomMatrixToHomogenMatrix(aMatrix));
}
// - create data series for all charttypes
for( std::unique_ptr<VSeriesPlotter>& aPlotter : rSeriesPlotterList )
{
- VCoordinateSystem* pVCooSys = lcl_getCooSysForPlotter( rVCooSysList, aPlotter.get() );
+ VCoordinateSystem* pVCooSys = SeriesPlotterContainer::getCooSysForPlotter( rVCooSysList, aPlotter.get() );
if(nDimensionCount==2)
aPlotter->setTransformationSceneToScreen( pVCooSys->getTransformationSceneToScreen() );
// Now we can move data labels in case of pie or donut chart!
@@ -1618,11 +740,11 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
if(bSnapRectToUsedArea)
{
if (rParam.mbUseFixedInnerSize)
- m_aResultingDiagramRectangleExcludingAxes = getRectangleOfObject( "PlotAreaExcludingAxes" );
+ m_aResultingDiagramRectangleExcludingAxes = getRectangleOfObject( u"PlotAreaExcludingAxes"_ustr );
else
{
::basegfx::B2IRectangle aConsumedInnerRect = aVDiagram.getCurrentRectangle();
- m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle( aConsumedInnerRect.getMinX(), aConsumedInnerRect.getMinY(), aConsumedInnerRect.getWidth(), aConsumedInnerRect.getHeight() );
+ m_aResultingDiagramRectangleExcludingAxes = BaseGFXHelper::toAwtRectangle(aConsumedInnerRect);
}
}
else
@@ -1632,7 +754,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
else
{
::basegfx::B2IRectangle aConsumedInnerRect = aVDiagram.getCurrentRectangle();
- m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle( aConsumedInnerRect.getMinX(), aConsumedInnerRect.getMinY(), aConsumedInnerRect.getWidth(), aConsumedInnerRect.getHeight() );
+ m_aResultingDiagramRectangleExcludingAxes = BaseGFXHelper::toAwtRectangle(aConsumedInnerRect);
}
}
@@ -1642,8 +764,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
awt::Size aSize(rParam.maRemainingSpace.Width, rParam.maRemainingSpace.Height);
bool bPosSizeExcludeAxesProperty = true;
- uno::Reference< beans::XPropertySet > xDiaProps( xDiagram, uno::UNO_QUERY_THROW );
- xDiaProps->getPropertyValue("PosSizeExcludeAxes") >>= bPosSizeExcludeAxesProperty;
+ xDiagram->getPropertyValue(u"PosSizeExcludeAxes"_ustr) >>= bPosSizeExcludeAxesProperty;
if (rParam.mbUseFixedInnerSize || bPosSizeExcludeAxesProperty)
{
aPos = awt::Point( m_aResultingDiagramRectangleExcludingAxes.X, m_aResultingDiagramRectangleExcludingAxes.Y );
@@ -1657,7 +778,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
}
bool ChartView::getExplicitValuesForAxis(
- uno::Reference< XAxis > xAxis
+ const rtl::Reference< Axis >& xAxis
, ExplicitScaleData& rExplicitScale
, ExplicitIncrementData& rExplicitIncrement )
{
@@ -1668,8 +789,8 @@ bool ChartView::getExplicitValuesForAxis(
if(!xAxis.is())
return false;
- rtl::Reference< BaseCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemOfAxis(xAxis, mrChartModel.getFirstDiagram() );
- const VCoordinateSystem* pVCooSys = findInCooSysList(m_aVCooSysList,xCooSys);
+ rtl::Reference< BaseCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemOfAxis(xAxis, mrChartModel.getFirstChartDiagram() );
+ const VCoordinateSystem* pVCooSys = SeriesPlotterContainer::findInCooSysList(m_aVCooSysList, xCooSys);
if(!pVCooSys)
return false;
@@ -1717,13 +838,17 @@ SdrPage* ChartView::getSdrPage()
return nullptr;
}
-uno::Reference< drawing::XShape > ChartView::getShapeForCID( const OUString& rObjectCID )
+rtl::Reference< SvxShape > ChartView::getShapeForCID( const OUString& rObjectCID )
{
SolarMutexGuard aSolarGuard;
SdrObject* pObj = DrawModelWrapper::getNamedSdrObject( rObjectCID, this->getSdrPage() );
- if( pObj )
- return uno::Reference< drawing::XShape >( pObj->getUnoShape(), uno::UNO_QUERY);
- return nullptr;
+ if( !pObj )
+ return nullptr;
+
+ uno::Reference< drawing::XShape > xShape = pObj->getUnoShape();
+ rtl::Reference<SvxShape> xShape2 = dynamic_cast<SvxShape*>(xShape.get());
+ assert(xShape2 || !xShape);
+ return xShape2;
}
awt::Rectangle ChartView::getDiagramRectangleExcludingAxes()
@@ -1737,7 +862,7 @@ awt::Rectangle ChartView::getRectangleOfObject( const OUString& rObjectCID, bool
impl_updateView();
awt::Rectangle aRet;
- uno::Reference< drawing::XShape > xShape( getShapeForCID(rObjectCID) );
+ rtl::Reference< SvxShape > xShape = getShapeForCID(rObjectCID);
if(xShape.is())
{
//special handling for axis for old api:
@@ -1746,18 +871,21 @@ awt::Rectangle ChartView::getRectangleOfObject( const OUString& rObjectCID, bool
if( eObjectType == OBJECTTYPE_AXIS || eObjectType == OBJECTTYPE_DIAGRAM )
{
SolarMutexGuard aSolarGuard;
- SdrObject* pRootSdrObject = SdrObject::getSdrObjectFromXShape( xShape );
+ SdrObject* pRootSdrObject = xShape->GetSdrObject();
if( pRootSdrObject )
{
SdrObjList* pRootList = pRootSdrObject->GetSubList();
if( pRootList )
{
- OUString aShapeName = "MarkHandles";
+ OUString aShapeName = u"MarkHandles"_ustr;
if( eObjectType == OBJECTTYPE_DIAGRAM )
aShapeName = "PlotAreaIncludingAxes";
SdrObject* pShape = DrawModelWrapper::getNamedSdrObject( aShapeName, pRootList );
if( pShape )
- xShape.set( pShape->getUnoShape(), uno::UNO_QUERY);
+ {
+ xShape = dynamic_cast<SvxShape*>(pShape->getUnoShape().get());
+ assert(xShape);
+ }
}
}
}
@@ -1768,7 +896,7 @@ awt::Rectangle ChartView::getRectangleOfObject( const OUString& rObjectCID, bool
if( bSnapRect )
{
//for rotated objects the shape size and position differs from the visible rectangle
- SdrObject* pSdrObject = SdrObject::getSdrObjectFromXShape( xShape );
+ SdrObject* pSdrObject = xShape->GetSdrObject();
if( pSdrObject )
{
tools::Rectangle aSnapRect( pSdrObject->GetSnapRect() );
@@ -1786,180 +914,42 @@ std::shared_ptr< DrawModelWrapper > ChartView::getDrawModelWrapper()
namespace
{
-sal_Int32 lcl_getDiagramTitleSpace()
-{
- return 200; //=0,2 cm spacing
-}
-bool lcl_getPropertySwapXAndYAxis( const rtl::Reference< Diagram >& xDiagram )
-{
- bool bSwapXAndY = false;
- if( xDiagram.is() )
- {
- const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysList( xDiagram->getBaseCoordinateSystems() );
- if( !aCooSysList.empty() )
- {
- try
- {
- aCooSysList[0]->getPropertyValue( "SwapXAndYAxis" ) >>= bSwapXAndY;
- }
- catch( const uno::Exception& )
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- }
- }
- return bSwapXAndY;
-}
-
-}
-
-sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
- const Reference< chart2::XAxis >& xAxis
- , const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
- , const Reference<chart2::XChartDocument>& xChartDoc)
-{
- return AxisHelper::getExplicitNumberFormatKeyForAxis( xAxis, xCorrespondingCoordinateSystem, xChartDoc
- , true /*bSearchForParallelAxisIfNothingIsFound*/ );
-}
+constexpr double constPageLayoutDistancePercentage = 0.02;
+constexpr sal_Int32 constPageLayoutFixedDistance = 350;
-sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( const uno::Reference< beans::XPropertySet >& xSeriesOrPointProp )
+bool getAvailablePosAndSizeForDiagram(
+ CreateShapeParam2D& rParam, const awt::Size & rPageSize, rtl::Reference<Diagram> const& xDiagram)
{
- sal_Int32 nFormat=0;
- if( !xSeriesOrPointProp.is() )
- return nFormat;
+ rParam.mbUseFixedInnerSize = false;
- try
- {
- xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat;
- }
- catch (const beans::UnknownPropertyException&) {}
+ //@todo: we need a size dependent on the axis labels
+ rtl::Reference<ChartType> xChartType;
+ if (xDiagram)
+ xChartType = xDiagram->getChartTypeByIndex(0);
- if(nFormat<0)
- nFormat=0;
- return nFormat;
-}
+ sal_Int32 nXDistance = sal_Int32(rPageSize.Width * constPageLayoutDistancePercentage);
+ sal_Int32 nYDistance = sal_Int32(rPageSize.Height * constPageLayoutDistancePercentage);
-sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
- const uno::Reference< beans::XPropertySet >& xSeriesOrPointProp,
- const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
-{
- sal_Int32 nFormat=0;
- if( !xSeriesOrPointProp.is() )
- return nFormat;
- if( !(xSeriesOrPointProp->getPropertyValue("PercentageNumberFormat") >>= nFormat) )
+ // Only pie chart uses fixed size margins
+ if (xChartType.is() && xChartType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_PIE)
{
- nFormat = DiagramHelper::getPercentNumberFormat( xNumberFormatsSupplier );
+ nXDistance = constPageLayoutFixedDistance;
+ nYDistance = constPageLayoutFixedDistance;
}
- if(nFormat<0)
- nFormat=0;
- return nFormat;
-}
-
-awt::Rectangle ExplicitValueProvider::AddSubtractAxisTitleSizes(
- ChartModel& rModel
- , ExplicitValueProvider* pChartView
- , const awt::Rectangle& rPositionAndSize, bool bSubtract )
-{
- awt::Rectangle aRet(rPositionAndSize);
-
- //add axis title sizes to the diagram size
- uno::Reference< chart2::XTitle > xTitle_Height( TitleHelper::getTitle( TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION, rModel ) );
- uno::Reference< chart2::XTitle > xTitle_Width( TitleHelper::getTitle( TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION, rModel ) );
- uno::Reference< chart2::XTitle > xSecondTitle_Height( TitleHelper::getTitle( TitleHelper::SECONDARY_X_AXIS_TITLE, rModel ) );
- uno::Reference< chart2::XTitle > xSecondTitle_Width( TitleHelper::getTitle( TitleHelper::SECONDARY_Y_AXIS_TITLE, rModel ) );
- if( xTitle_Height.is() || xTitle_Width.is() || xSecondTitle_Height.is() || xSecondTitle_Width.is() )
- {
- ExplicitValueProvider* pExplicitValueProvider = pChartView;
- if( pExplicitValueProvider )
- {
- //detect whether x axis points into x direction or not
- if( lcl_getPropertySwapXAndYAxis( rModel.getFirstChartDiagram() ) )
- {
- std::swap( xTitle_Height, xTitle_Width );
- std::swap( xSecondTitle_Height, xSecondTitle_Width );
- }
-
- sal_Int32 nTitleSpaceWidth = 0;
- sal_Int32 nTitleSpaceHeight = 0;
- sal_Int32 nSecondTitleSpaceWidth = 0;
- sal_Int32 nSecondTitleSpaceHeight = 0;
- if( xTitle_Height.is() )
- {
- OUString aCID_X( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle_Height, rModel ) );
- nTitleSpaceHeight = pExplicitValueProvider->getRectangleOfObject( aCID_X, true ).Height;
- if( nTitleSpaceHeight )
- nTitleSpaceHeight+=lcl_getDiagramTitleSpace();
- }
- if( xTitle_Width.is() )
- {
- OUString aCID_Y( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle_Width, rModel ) );
- nTitleSpaceWidth = pExplicitValueProvider->getRectangleOfObject( aCID_Y, true ).Width;
- if(nTitleSpaceWidth)
- nTitleSpaceWidth+=lcl_getDiagramTitleSpace();
- }
- if( xSecondTitle_Height.is() )
- {
- OUString aCID_X( ObjectIdentifier::createClassifiedIdentifierForObject( xSecondTitle_Height, rModel ) );
- nSecondTitleSpaceHeight = pExplicitValueProvider->getRectangleOfObject( aCID_X, true ).Height;
- if( nSecondTitleSpaceHeight )
- nSecondTitleSpaceHeight+=lcl_getDiagramTitleSpace();
- }
- if( xSecondTitle_Width.is() )
- {
- OUString aCID_Y( ObjectIdentifier::createClassifiedIdentifierForObject( xSecondTitle_Width, rModel ) );
- nSecondTitleSpaceWidth += pExplicitValueProvider->getRectangleOfObject( aCID_Y, true ).Width;
- if( nSecondTitleSpaceWidth )
- nSecondTitleSpaceWidth+=lcl_getDiagramTitleSpace();
- }
- if( bSubtract )
- {
- aRet.X += nTitleSpaceWidth;
- aRet.Y += nSecondTitleSpaceHeight;
- aRet.Width -= (nTitleSpaceWidth + nSecondTitleSpaceWidth);
- aRet.Height -= (nTitleSpaceHeight + nSecondTitleSpaceHeight);
- }
- else
- {
-
- aRet.X -= nTitleSpaceWidth;
- aRet.Y -= nSecondTitleSpaceHeight;
- aRet.Width += nTitleSpaceWidth + nSecondTitleSpaceWidth;
- aRet.Height += nTitleSpaceHeight + nSecondTitleSpaceHeight;
- }
- }
- }
- return aRet;
-}
-
-namespace {
-
-double lcl_getPageLayoutDistancePercentage()
-{
- return 0.02;
-}
-
-bool getAvailablePosAndSizeForDiagram(
- CreateShapeParam2D& rParam, const awt::Size & rPageSize, const uno::Reference< beans::XPropertySet >& xProp)
-{
- rParam.mbUseFixedInnerSize = false;
-
- //@todo: we need a size dependent on the axis labels
- sal_Int32 nYDistance = static_cast<sal_Int32>(rPageSize.Height*lcl_getPageLayoutDistancePercentage());
- sal_Int32 nXDistance = static_cast<sal_Int32>(rPageSize.Width*lcl_getPageLayoutDistancePercentage());
rParam.maRemainingSpace.X += nXDistance;
rParam.maRemainingSpace.Width -= 2*nXDistance;
rParam.maRemainingSpace.Y += nYDistance;
rParam.maRemainingSpace.Height -= 2*nYDistance;
bool bPosSizeExcludeAxes = false;
- if( xProp.is() )
- xProp->getPropertyValue( "PosSizeExcludeAxes" ) >>= bPosSizeExcludeAxes;
+ if( xDiagram.is() )
+ xDiagram->getPropertyValue( u"PosSizeExcludeAxes"_ustr ) >>= bPosSizeExcludeAxes;
//size:
css::chart2::RelativeSize aRelativeSize;
- if( xProp.is() && (xProp->getPropertyValue( "RelativeSize" )>>=aRelativeSize) )
+ if( xDiagram.is() && (xDiagram->getPropertyValue( u"RelativeSize"_ustr )>>=aRelativeSize) )
{
rParam.maRemainingSpace.Height = static_cast<sal_Int32>(aRelativeSize.Secondary*rPageSize.Height);
rParam.maRemainingSpace.Width = static_cast<sal_Int32>(aRelativeSize.Primary*rPageSize.Width);
@@ -1971,7 +961,7 @@ bool getAvailablePosAndSizeForDiagram(
//position:
chart2::RelativePosition aRelativePosition;
- if( xProp.is() && (xProp->getPropertyValue( "RelativePosition" )>>=aRelativePosition) )
+ if( xDiagram.is() && (xDiagram->getPropertyValue( u"RelativePosition"_ustr )>>=aRelativePosition) )
{
//@todo decide whether x is primary or secondary
@@ -2000,7 +990,7 @@ bool getAvailablePosAndSizeForDiagram(
return true;
}
-enum TitleAlignment { ALIGN_LEFT, ALIGN_TOP, ALIGN_RIGHT, ALIGN_BOTTOM, ALIGN_Z };
+enum class TitleAlignment { ALIGN_LEFT, ALIGN_TOP, ALIGN_RIGHT, ALIGN_BOTTOM, ALIGN_Z };
void changePositionOfAxisTitle( VTitle* pVTitle, TitleAlignment eAlignment
, awt::Rectangle const & rDiagramPlusAxesRect, const awt::Size & rPageSize )
@@ -2010,32 +1000,30 @@ void changePositionOfAxisTitle( VTitle* pVTitle, TitleAlignment eAlignment
awt::Point aNewPosition(0,0);
awt::Size aTitleSize = pVTitle->getFinalSize();
- sal_Int32 nYDistance = static_cast<sal_Int32>(rPageSize.Height*lcl_getPageLayoutDistancePercentage());
- sal_Int32 nXDistance = static_cast<sal_Int32>(rPageSize.Width*lcl_getPageLayoutDistancePercentage());
- switch( eAlignment )
+ sal_Int32 nYDistance = static_cast<sal_Int32>(rPageSize.Height * constPageLayoutDistancePercentage);
+ sal_Int32 nXDistance = static_cast<sal_Int32>(rPageSize.Width * constPageLayoutDistancePercentage);
+ switch (eAlignment)
{
- case ALIGN_TOP:
+ case TitleAlignment::ALIGN_TOP:
aNewPosition = awt::Point( rDiagramPlusAxesRect.X + rDiagramPlusAxesRect.Width/2
, rDiagramPlusAxesRect.Y - aTitleSize.Height/2 - nYDistance );
break;
- case ALIGN_BOTTOM:
+ case TitleAlignment::ALIGN_BOTTOM:
aNewPosition = awt::Point( rDiagramPlusAxesRect.X + rDiagramPlusAxesRect.Width/2
, rDiagramPlusAxesRect.Y + rDiagramPlusAxesRect.Height + aTitleSize.Height/2 + nYDistance );
break;
- case ALIGN_LEFT:
+ case TitleAlignment::ALIGN_LEFT:
aNewPosition = awt::Point( rDiagramPlusAxesRect.X - aTitleSize.Width/2 - nXDistance
, rDiagramPlusAxesRect.Y + rDiagramPlusAxesRect.Height/2 );
break;
- case ALIGN_RIGHT:
+ case TitleAlignment::ALIGN_RIGHT:
aNewPosition = awt::Point( rDiagramPlusAxesRect.X + rDiagramPlusAxesRect.Width + aTitleSize.Width/2 + nXDistance
, rDiagramPlusAxesRect.Y + rDiagramPlusAxesRect.Height/2 );
break;
- case ALIGN_Z:
+ case TitleAlignment::ALIGN_Z:
aNewPosition = awt::Point( rDiagramPlusAxesRect.X + rDiagramPlusAxesRect.Width + aTitleSize.Width/2 + nXDistance
, rDiagramPlusAxesRect.Y + rDiagramPlusAxesRect.Height - aTitleSize.Height/2 );
break;
- default:
- break;
}
sal_Int32 nMaxY = rPageSize.Height - aTitleSize.Height/2;
@@ -2065,7 +1053,7 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
std::shared_ptr<VTitle> apVTitle;
// #i109336# Improve auto positioning in chart
- double fPercentage = lcl_getPageLayoutDistancePercentage();
+ double fPercentage = constPageLayoutDistancePercentage;
sal_Int32 nXDistance = static_cast< sal_Int32 >( rPageSize.Width * fPercentage );
sal_Int32 nYDistance = static_cast< sal_Int32 >( rPageSize.Height * fPercentage );
if ( eType == TitleHelper::MAIN_TITLE )
@@ -2081,7 +1069,7 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
nXDistance = 450; // 1/100 mm
}
- uno::Reference< XTitle > xTitle( TitleHelper::getTitle( eType, rModel ) );
+ rtl::Reference< Title > xTitle( TitleHelper::getTitle( eType, rModel ) );
OUString aCompleteString = TitleHelper::getCompleteString(xTitle);
if (aCompleteString.isEmpty() || !VTitle::isVisible(xTitle))
return apVTitle;
@@ -2108,7 +1096,7 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
bYAxisTitle = true;
}
apVTitle = std::make_shared<VTitle>(xTitle);
- OUString aCID = ObjectIdentifier::createClassifiedIdentifierForObject(xTitle, rModel);
+ OUString aCID = ObjectIdentifier::createClassifiedIdentifierForObject(xTitle, &rModel);
apVTitle->init(xPageShapes, aCID);
apVTitle->createShapes(awt::Point(0, 0), rPageSize, aTextMaxWidth, bYAxisTitle);
awt::Size aTitleUnrotatedSize = apVTitle->getUnrotatedSize();
@@ -2118,8 +1106,7 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
rbAutoPosition = true;
awt::Point aNewPosition(0,0);
chart2::RelativePosition aRelativePosition;
- uno::Reference<beans::XPropertySet> xProp(xTitle, uno::UNO_QUERY);
- if (xProp.is() && (xProp->getPropertyValue("RelativePosition") >>= aRelativePosition))
+ if (xTitle.is() && (xTitle->getPropertyValue(u"RelativePosition"_ustr) >>= aRelativePosition))
{
rbAutoPosition = false;
@@ -2131,28 +1118,42 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
aNewPosition = RelativePositionHelper::getCenterOfAnchoredObject(
awt::Point(static_cast<sal_Int32>(fX),static_cast<sal_Int32>(fY))
, aTitleUnrotatedSize, aRelativePosition.Anchor, fAnglePi );
+
+ const bool bInfiniteY = std::isinf(aRelativePosition.Secondary);
+ if (bInfiniteY)
+ {
+ SAL_WARN("chart2", "infinite aRelativePosition.Secondary position, using ALIGN_BOTTOM");
+ aNewPosition.Y = rRemainingSpace.Y + rRemainingSpace.Height - aTitleSize.Height/2 - nYDistance;
+ }
+
+ const bool bInfiniteX = std::isinf(aRelativePosition.Primary);
+ if (bInfiniteX)
+ {
+ SAL_WARN("chart2", "infinite aRelativePosition.Primary position, using ALIGN_RIGHT");
+ aNewPosition.X = rRemainingSpace.X + rRemainingSpace.Width - aTitleSize.Width/2 - nXDistance;
+ }
}
else //auto position
{
switch( eAlignment )
{
- case ALIGN_TOP:
+ case TitleAlignment::ALIGN_TOP:
aNewPosition = awt::Point( rRemainingSpace.X + rRemainingSpace.Width/2
, rRemainingSpace.Y + aTitleSize.Height/2 + nYDistance );
break;
- case ALIGN_BOTTOM:
+ case TitleAlignment::ALIGN_BOTTOM:
aNewPosition = awt::Point( rRemainingSpace.X + rRemainingSpace.Width/2
, rRemainingSpace.Y + rRemainingSpace.Height - aTitleSize.Height/2 - nYDistance );
break;
- case ALIGN_LEFT:
+ case TitleAlignment::ALIGN_LEFT:
aNewPosition = awt::Point( rRemainingSpace.X + aTitleSize.Width/2 + nXDistance
, rRemainingSpace.Y + rRemainingSpace.Height/2 );
break;
- case ALIGN_RIGHT:
+ case TitleAlignment::ALIGN_RIGHT:
aNewPosition = awt::Point( rRemainingSpace.X + rRemainingSpace.Width - aTitleSize.Width/2 - nXDistance
, rRemainingSpace.Y + rRemainingSpace.Height/2 );
break;
- default:
+ case TitleAlignment::ALIGN_Z:
break;
}
@@ -2162,32 +1163,32 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
//remaining space
switch( eAlignment )
{
- case ALIGN_TOP:
+ case TitleAlignment::ALIGN_TOP:
// Push the remaining space down from top.
rRemainingSpace.Y += ( aTitleSize.Height + nYDistance );
rRemainingSpace.Height -= ( aTitleSize.Height + nYDistance );
break;
- case ALIGN_BOTTOM:
+ case TitleAlignment::ALIGN_BOTTOM:
// Push the remaining space up from bottom.
rRemainingSpace.Height -= ( aTitleSize.Height + nYDistance );
break;
- case ALIGN_LEFT:
+ case TitleAlignment::ALIGN_LEFT:
// Push the remaining space to the right from left edge.
rRemainingSpace.X += ( aTitleSize.Width + nXDistance );
rRemainingSpace.Width -= ( aTitleSize.Width + nXDistance );
break;
- case ALIGN_RIGHT:
+ case TitleAlignment::ALIGN_RIGHT:
// Push the remaining space to the left from right edge.
rRemainingSpace.Width -= ( aTitleSize.Width + nXDistance );
break;
- default:
+ case TitleAlignment::ALIGN_Z:
break;
}
return apVTitle;
}
-bool lcl_createLegend( const uno::Reference< XLegend > & xLegend
+bool lcl_createLegend( const rtl::Reference< Legend > & xLegend
, const rtl::Reference<SvxShapeGroupAnyD>& xPageShapes
, const uno::Reference< uno::XComponentContext > & xContext
, awt::Rectangle & rRemainingSpace
@@ -2311,7 +1312,7 @@ void formatPage(
}
}
-void lcl_removeEmptyGroupShapes( SdrObject& rParent )
+void lcl_removeEmptyGroupShapes( const SdrObject& rParent )
{
SdrObjList* pObjList = rParent.getChildrenOfSdrObject();
if (!pObjList || pObjList->GetObjCount() == 0)
@@ -2327,8 +1328,7 @@ void lcl_removeEmptyGroupShapes( SdrObject& rParent )
if (pChildObjList->GetObjCount() == 0)
{
//remove empty group shape
- SdrObject* pRemoved = pObjList->NbcRemoveObject(nIdx);
- SdrObject::Free( pRemoved );
+ pObjList->NbcRemoveObject(nIdx);
}
else
lcl_removeEmptyGroupShapes(*pChildSdrObject);
@@ -2349,11 +1349,11 @@ void ChartView::impl_refreshAddIn()
try
{
uno::Reference< util::XRefreshable > xAddIn;
- xProp->getPropertyValue( "AddIn" ) >>= xAddIn;
+ xProp->getPropertyValue( u"AddIn"_ustr ) >>= xAddIn;
if( xAddIn.is() )
{
bool bRefreshAddInAllowed = true;
- xProp->getPropertyValue( "RefreshAddInAllowed" ) >>= bRefreshAddInAllowed;
+ xProp->getPropertyValue( u"RefreshAddInAllowed"_ustr ) >>= bRefreshAddInAllowed;
if( bRefreshAddInAllowed )
xAddIn->refresh();
}
@@ -2368,7 +1368,7 @@ void ChartView::createShapes()
{
SolarMutexGuard aSolarGuard;
- osl::MutexGuard aTimedGuard(maTimeMutex);
+ std::unique_lock aTimedGuard(maTimeMutex);
if(mrChartModel.isTimeBased())
{
maTimeBased.bTimeBased = true;
@@ -2393,9 +1393,12 @@ void ChartView::createShapes()
if(!mxRootShape.is())
mxRootShape = ShapeFactory::getOrCreateChartRootShape( m_xDrawPage );
- SdrPage* pPage = ChartView::getSdrPage();
- if(pPage) //it is necessary to use the implementation here as the uno page does not provide a propertyset
+ SdrPage* pPage = getSdrPage();
+
+ if (pPage) //it is necessary to use the implementation here as the uno page does not provide a propertyset
+ {
pPage->SetSize(Size(aPageSize.Width,aPageSize.Height));
+ }
else
{
OSL_FAIL("could not set page size correctly");
@@ -2421,6 +1424,35 @@ void SAL_CALL ChartView::disposing( const lang::EventObject& /* rSource */ )
{
}
+namespace
+{
+// Disables setting the chart's modified state, as well as its parent's (if exists).
+// Painting a chart must not set these states.
+struct ChartModelDisableSetModified
+{
+ ChartModel& mrChartModel;
+ SfxObjectShell* mpParentShell;
+ bool mbWasUnmodified;
+ ChartModelDisableSetModified(ChartModel& rChartModel)
+ : mrChartModel(rChartModel)
+ , mpParentShell(SfxObjectShell::GetShellFromComponent(rChartModel.getParent()))
+ , mbWasUnmodified(!rChartModel.isModified())
+ {
+ if (mpParentShell && mpParentShell->IsEnableSetModified())
+ mpParentShell->EnableSetModified(false);
+ else
+ mpParentShell = nullptr;
+ }
+ ~ChartModelDisableSetModified()
+ {
+ if (mbWasUnmodified && mrChartModel.isModified())
+ mrChartModel.setModified(false);
+ if (mpParentShell)
+ mpParentShell->EnableSetModified(true);
+ }
+};
+}
+
void ChartView::impl_updateView( bool bCheckLockedCtrler )
{
if( !m_pDrawModelWrapper )
@@ -2443,7 +1475,7 @@ void ChartView::impl_updateView( bool bCheckLockedCtrler )
//m_bRefreshAddIn = false;
try
{
- impl_notifyModeChangeListener("invalid");
+ impl_notifyModeChangeListener(u"invalid"_ustr);
//prepare draw model
{
@@ -2451,6 +1483,9 @@ void ChartView::impl_updateView( bool bCheckLockedCtrler )
m_pDrawModelWrapper->lockControllers();
}
+ // Rendering the chart must not set its (or its parent) modified status
+ ChartModelDisableSetModified dontSetModified(mrChartModel);
+
//create chart view
{
m_bViewDirty = false;
@@ -2486,7 +1521,7 @@ void ChartView::impl_updateView( bool bCheckLockedCtrler )
m_pDrawModelWrapper->unlockControllers();
}
- impl_notifyModeChangeListener("valid");
+ impl_notifyModeChangeListener(u"valid"_ustr);
//m_bRefreshAddIn = bOldRefreshAddIn;
}
@@ -2498,7 +1533,7 @@ void SAL_CALL ChartView::modified( const lang::EventObject& /* aEvent */ )
if( m_bInViewUpdate )
m_bViewUpdatePending = true;
- impl_notifyModeChangeListener("dirty");
+ impl_notifyModeChangeListener(u"dirty"_ustr);
}
//SfxListener
@@ -2567,16 +1602,11 @@ void ChartView::impl_notifyModeChangeListener( const OUString& rNewMode )
{
try
{
- comphelper::OInterfaceContainerHelper2* pIC = m_aListenerContainer
- .getContainer( cppu::UnoType<util::XModeChangeListener>::get());
- if( pIC )
+ std::unique_lock g(m_aMutex);
+ if( m_aModeChangeListeners.getLength(g) )
{
util::ModeChangeEvent aEvent( static_cast< uno::XWeak* >( this ), rNewMode );
- comphelper::OInterfaceIteratorHelper2 aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- static_cast< util::XModeChangeListener* >( aIt.next() )->modeChanged( aEvent );
- }
+ m_aModeChangeListeners.notifyEach( g, &css::util::XModeChangeListener::modeChanged, aEvent);
}
}
catch( const uno::Exception& )
@@ -2589,13 +1619,13 @@ void ChartView::impl_notifyModeChangeListener( const OUString& rNewMode )
void SAL_CALL ChartView::addModeChangeListener( const uno::Reference< util::XModeChangeListener >& xListener )
{
- m_aListenerContainer.addInterface(
- cppu::UnoType<util::XModeChangeListener>::get(), xListener );
+ std::unique_lock g(m_aMutex);
+ m_aModeChangeListeners.addInterface(g, xListener );
}
void SAL_CALL ChartView::removeModeChangeListener( const uno::Reference< util::XModeChangeListener >& xListener )
{
- m_aListenerContainer.removeInterface(
- cppu::UnoType<util::XModeChangeListener>::get(), xListener );
+ std::unique_lock g(m_aMutex);
+ m_aModeChangeListeners.removeInterface(g, xListener );
}
void SAL_CALL ChartView::addModeChangeApproveListener( const uno::Reference< util::XModeChangeApproveListener >& /* _rxListener */ )
{
@@ -2644,7 +1674,7 @@ void SAL_CALL ChartView::setPropertyValue( const OUString& rPropertyName
{
awt::Size aNewResolution;
if( ! (rValue >>= aNewResolution) )
- throw lang::IllegalArgumentException( "Property 'Resolution' requires value of type awt::Size", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property 'Resolution' requires value of type awt::Size"_ustr, nullptr, 0 );
if( m_aPageResolution.Width!=aNewResolution.Width || m_aPageResolution.Height!=aNewResolution.Height )
{
@@ -2662,29 +1692,25 @@ void SAL_CALL ChartView::setPropertyValue( const OUString& rPropertyName
//#i75867# poor quality of ole's alternative view with 3D scenes and zoomfactors besides 100%
uno::Sequence< beans::PropertyValue > aZoomFactors;
if( ! (rValue >>= aZoomFactors) )
- throw lang::IllegalArgumentException( "Property 'ZoomFactors' requires value of type Sequence< PropertyValue >", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property 'ZoomFactors' requires value of type Sequence< PropertyValue >"_ustr, nullptr, 0 );
- sal_Int32 nFilterArgs = aZoomFactors.getLength();
- const beans::PropertyValue* pDataValues = aZoomFactors.getConstArray();
- while( nFilterArgs-- )
+ for (auto& propval : aZoomFactors)
{
- if ( pDataValues->Name == "ScaleXNumerator" )
- pDataValues->Value >>= m_nScaleXNumerator;
- else if ( pDataValues->Name == "ScaleXDenominator" )
- pDataValues->Value >>= m_nScaleXDenominator;
- else if ( pDataValues->Name == "ScaleYNumerator" )
- pDataValues->Value >>= m_nScaleYNumerator;
- else if ( pDataValues->Name == "ScaleYDenominator" )
- pDataValues->Value >>= m_nScaleYDenominator;
-
- pDataValues++;
+ if (propval.Name == "ScaleXNumerator")
+ propval.Value >>= m_nScaleXNumerator;
+ else if (propval.Name == "ScaleXDenominator")
+ propval.Value >>= m_nScaleXDenominator;
+ else if (propval.Name == "ScaleYNumerator")
+ propval.Value >>= m_nScaleYNumerator;
+ else if (propval.Name == "ScaleYDenominator")
+ propval.Value >>= m_nScaleYDenominator;
}
}
else if( rPropertyName == "SdrViewIsInEditMode" )
{
//#i77362 change notification for changes on additional shapes are missing
if( ! (rValue >>= m_bSdrViewIsInEditMode) )
- throw lang::IllegalArgumentException( "Property 'SdrViewIsInEditMode' requires value of type sal_Bool", nullptr, 0 );
+ throw lang::IllegalArgumentException( u"Property 'SdrViewIsInEditMode' requires value of type sal_Bool"_ustr, nullptr, 0 );
}
else
throw beans::UnknownPropertyException( "unknown property was tried to set to chart wizard " + rPropertyName, nullptr );
@@ -2789,18 +1815,23 @@ Reference< uno::XInterface > ChartView::createInstanceWithArguments( const OUStr
uno::Sequence< OUString > ChartView::getAvailableServiceNames()
{
- uno::Sequence< OUString > aServiceNames{ "com.sun.star.drawing.DashTable",
- "com.sun.star.drawing.GradientTable",
- "com.sun.star.drawing.HatchTable",
- "com.sun.star.drawing.BitmapTable",
- "com.sun.star.drawing.TransparencyGradientTable",
- "com.sun.star.drawing.MarkerTable" };
+ uno::Sequence< OUString > aServiceNames{ u"com.sun.star.drawing.DashTable"_ustr,
+ u"com.sun.star.drawing.GradientTable"_ustr,
+ u"com.sun.star.drawing.HatchTable"_ustr,
+ u"com.sun.star.drawing.BitmapTable"_ustr,
+ u"com.sun.star.drawing.TransparencyGradientTable"_ustr,
+ u"com.sun.star.drawing.MarkerTable"_ustr };
return aServiceNames;
}
-OUString ChartView::dump()
+OUString ChartView::dump(OUString const & kind)
{
+ if (kind.isEmpty()) {
+ return comphelper::dumpXmlToString([this](auto writer) { return dumpAsXml(writer); });
+ }
+
+ // kind == "shapes":
#if HAVE_FEATURE_DESKTOP
// Used for unit tests and in chartcontroller only, no need to drag in this when cross-compiling
// for non-desktop
@@ -2847,7 +1878,7 @@ void ChartView::dumpAsXml(xmlTextWriterPtr pWriter) const
void ChartView::setViewDirty()
{
- osl::MutexGuard aGuard(maTimeMutex);
+ std::unique_lock aGuard(maTimeMutex);
m_bViewDirty = true;
}
@@ -2870,10 +1901,9 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
aParam.maRemainingSpace.Height = rPageSize.Height;
//create the group shape for diagram and axes first to have title and legends on top of it
- uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
- uno::Reference< beans::XPropertySet > xProp(xDiagram, uno::UNO_QUERY);
+ rtl::Reference< Diagram > xDiagram( mrChartModel.getFirstChartDiagram() );
bool bHasRelativeSize = false;
- if( xProp.is() && xProp->getPropertyValue("RelativeSize").hasValue() )
+ if( xDiagram.is() && xDiagram->getPropertyValue(u"RelativeSize"_ustr).hasValue() )
bHasRelativeSize = true;
OUString aDiagramCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, OUString::number( 0 ) ) );//todo: other index if more than one diagram is possible
@@ -2882,11 +1912,11 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
aParam.mxMarkHandles = ShapeFactory::createInvisibleRectangle(
xDiagramPlusAxesPlusMarkHandlesGroup_Shapes, awt::Size(0,0));
- ShapeFactory::setShapeName(aParam.mxMarkHandles, "MarkHandles");
+ ShapeFactory::setShapeName(aParam.mxMarkHandles, u"MarkHandles"_ustr);
aParam.mxPlotAreaWithAxes = ShapeFactory::createInvisibleRectangle(
xDiagramPlusAxesPlusMarkHandlesGroup_Shapes, awt::Size(0, 0));
- ShapeFactory::setShapeName(aParam.mxPlotAreaWithAxes, "PlotAreaIncludingAxes");
+ ShapeFactory::setShapeName(aParam.mxPlotAreaWithAxes, u"PlotAreaIncludingAxes"_ustr);
aParam.mxDiagramWithAxesShapes = ShapeFactory::createGroup2D(xDiagramPlusAxesPlusMarkHandlesGroup_Shapes);
@@ -2897,13 +1927,13 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
lcl_createTitle(
TitleHelper::MAIN_TITLE, mxRootShape, mrChartModel,
- aParam.maRemainingSpace, rPageSize, ALIGN_TOP, bAutoPositionDummy);
+ aParam.maRemainingSpace, rPageSize, TitleAlignment::ALIGN_TOP, bAutoPositionDummy);
if (!bHasRelativeSize && (aParam.maRemainingSpace.Width <= 0 || aParam.maRemainingSpace.Height <= 0))
return;
lcl_createTitle(
TitleHelper::SUB_TITLE, mxRootShape, mrChartModel,
- aParam.maRemainingSpace, rPageSize, ALIGN_TOP, bAutoPositionDummy );
+ aParam.maRemainingSpace, rPageSize, TitleAlignment::ALIGN_TOP, bAutoPositionDummy );
if (!bHasRelativeSize && (aParam.maRemainingSpace.Width <= 0 || aParam.maRemainingSpace.Height <= 0))
return;
@@ -2911,7 +1941,7 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
aParam.mpSeriesPlotterContainer->initializeCooSysAndSeriesPlotter( mrChartModel );
if(maTimeBased.bTimeBased && maTimeBased.nFrame != 0)
{
- SeriesPlottersType& rSeriesPlotter = aParam.mpSeriesPlotterContainer->getSeriesPlotterList();
+ auto& rSeriesPlotter = aParam.mpSeriesPlotterContainer->getSeriesPlotterList();
size_t n = rSeriesPlotter.size();
for(size_t i = 0; i < n; ++i)
{
@@ -2928,7 +1958,7 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
}
lcl_createLegend(
- LegendHelper::getLegend( mrChartModel ), mxRootShape, m_xCC,
+ LegendHelper::getLegend( mrChartModel ), mxRootShape, getComponentContext(),
aParam.maRemainingSpace, rPageSize, mrChartModel, aParam.mpSeriesPlotterContainer->getLegendEntryProviderList(),
lcl_getDefaultWritingModeFromPool( m_pDrawModelWrapper ) );
@@ -2939,9 +1969,9 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
return;
bool bDummy = false;
- bool bIsVertical = DiagramHelper::getVertical(xDiagram, bDummy, bDummy);
+ bool bIsVertical = xDiagram && xDiagram->getVertical(bDummy, bDummy);
- if (getAvailablePosAndSizeForDiagram(aParam, rPageSize, xProp))
+ if (getAvailablePosAndSizeForDiagram(aParam, rPageSize, xDiagram))
{
awt::Rectangle aUsedOuterRect = impl_createDiagramAndContent(aParam, rPageSize);
@@ -2954,15 +1984,15 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
//correct axis title position
awt::Rectangle aDiagramPlusAxesRect( aUsedOuterRect );
if (aParam.mbAutoPosTitleX)
- changePositionOfAxisTitle(aParam.mpVTitleX.get(), ALIGN_BOTTOM, aDiagramPlusAxesRect, rPageSize);
+ changePositionOfAxisTitle(aParam.mpVTitleX.get(), TitleAlignment::ALIGN_BOTTOM, aDiagramPlusAxesRect, rPageSize);
if (aParam.mbAutoPosTitleY)
- changePositionOfAxisTitle(aParam.mpVTitleY.get(), ALIGN_LEFT, aDiagramPlusAxesRect, rPageSize);
+ changePositionOfAxisTitle(aParam.mpVTitleY.get(), TitleAlignment::ALIGN_LEFT, aDiagramPlusAxesRect, rPageSize);
if (aParam.mbAutoPosTitleZ)
- changePositionOfAxisTitle(aParam.mpVTitleZ.get(), ALIGN_Z, aDiagramPlusAxesRect, rPageSize);
+ changePositionOfAxisTitle(aParam.mpVTitleZ.get(), TitleAlignment::ALIGN_Z, aDiagramPlusAxesRect, rPageSize);
if (aParam.mbAutoPosSecondTitleX)
- changePositionOfAxisTitle(aParam.mpVTitleSecondX.get(), bIsVertical? ALIGN_RIGHT : ALIGN_TOP, aDiagramPlusAxesRect, rPageSize);
+ changePositionOfAxisTitle(aParam.mpVTitleSecondX.get(), bIsVertical? TitleAlignment::ALIGN_RIGHT : TitleAlignment::ALIGN_TOP, aDiagramPlusAxesRect, rPageSize);
if (aParam.mbAutoPosSecondTitleY)
- changePositionOfAxisTitle(aParam.mpVTitleSecondY.get(), bIsVertical? ALIGN_TOP : ALIGN_RIGHT, aDiagramPlusAxesRect, rPageSize);
+ changePositionOfAxisTitle(aParam.mpVTitleSecondY.get(), bIsVertical? TitleAlignment::ALIGN_TOP : TitleAlignment::ALIGN_RIGHT, aDiagramPlusAxesRect, rPageSize);
}
//cleanup: remove all empty group shapes to avoid grey border lines:
@@ -2971,7 +2001,7 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
if(maTimeBased.bTimeBased && maTimeBased.nFrame % 60 == 0)
{
// create copy of the data for next frame
- SeriesPlottersType& rSeriesPlotter = aParam.mpSeriesPlotterContainer->getSeriesPlotterList();
+ auto& rSeriesPlotter = aParam.mpSeriesPlotterContainer->getSeriesPlotterList();
size_t n = rSeriesPlotter.size();
maTimeBased.m_aDataSeriesList.clear();
maTimeBased.m_aDataSeriesList.resize(n);
@@ -3000,47 +2030,193 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
bool ChartView::createAxisTitleShapes2D( CreateShapeParam2D& rParam, const css::awt::Size& rPageSize, bool bHasRelativeSize )
{
- uno::Reference<XDiagram> xDiagram = mrChartModel.getFirstDiagram();
+ rtl::Reference<Diagram> xDiagram = mrChartModel.getFirstChartDiagram();
- Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
- sal_Int32 nDimension = DiagramHelper::getDimension( xDiagram );
+ rtl::Reference< ChartType > xChartType;
+ sal_Int32 nDimension = 0;
+ if (xDiagram)
+ {
+ xChartType = xDiagram->getChartTypeByIndex( 0 );
+ nDimension = xDiagram->getDimension();
+ }
- if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 0 ) )
+ if (xChartType.is() ? xChartType->isSupportingMainAxis(nDimension, 0) : true)
rParam.mpVTitleX = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION, mxRootShape, mrChartModel
- , rParam.maRemainingSpace, rPageSize, ALIGN_BOTTOM, rParam.mbAutoPosTitleX );
+ , rParam.maRemainingSpace, rPageSize, TitleAlignment::ALIGN_BOTTOM, rParam.mbAutoPosTitleX );
if (!bHasRelativeSize && (rParam.maRemainingSpace.Width <= 0 || rParam.maRemainingSpace.Height <= 0))
return false;
- if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 1 ) )
+ if (xChartType.is() ? xChartType->isSupportingMainAxis(nDimension, 1) : true)
rParam.mpVTitleY = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION, mxRootShape, mrChartModel
- , rParam.maRemainingSpace, rPageSize, ALIGN_LEFT, rParam.mbAutoPosTitleY );
+ , rParam.maRemainingSpace, rPageSize, TitleAlignment::ALIGN_LEFT, rParam.mbAutoPosTitleY );
if (!bHasRelativeSize && (rParam.maRemainingSpace.Width <= 0 || rParam.maRemainingSpace.Height <= 0))
return false;
- if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 2 ) )
+ if (xChartType.is() ? xChartType->isSupportingMainAxis(nDimension, 2) : true)
rParam.mpVTitleZ = lcl_createTitle( TitleHelper::Z_AXIS_TITLE, mxRootShape, mrChartModel
- , rParam.maRemainingSpace, rPageSize, ALIGN_RIGHT, rParam.mbAutoPosTitleZ );
+ , rParam.maRemainingSpace, rPageSize, TitleAlignment::ALIGN_RIGHT, rParam.mbAutoPosTitleZ );
if (!bHasRelativeSize && (rParam.maRemainingSpace.Width <= 0 || rParam.maRemainingSpace.Height <= 0))
return false;
bool bDummy = false;
- bool bIsVertical = DiagramHelper::getVertical( xDiagram, bDummy, bDummy );
+ bool bIsVertical = xDiagram && xDiagram->getVertical( bDummy, bDummy );
- if( ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimension ) )
+ if (xChartType.is() ? xChartType->isSupportingSecondaryAxis(nDimension) : true)
rParam.mpVTitleSecondX = lcl_createTitle( TitleHelper::SECONDARY_X_AXIS_TITLE, mxRootShape, mrChartModel
- , rParam.maRemainingSpace, rPageSize, bIsVertical? ALIGN_RIGHT : ALIGN_TOP, rParam.mbAutoPosSecondTitleX );
+ , rParam.maRemainingSpace, rPageSize, bIsVertical? TitleAlignment::ALIGN_RIGHT : TitleAlignment::ALIGN_TOP, rParam.mbAutoPosSecondTitleX );
if (!bHasRelativeSize && (rParam.maRemainingSpace.Width <= 0 || rParam.maRemainingSpace.Height <= 0))
return false;
- if( ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimension ) )
+ if (xChartType.is() ? xChartType->isSupportingSecondaryAxis(nDimension) : true)
rParam.mpVTitleSecondY = lcl_createTitle( TitleHelper::SECONDARY_Y_AXIS_TITLE, mxRootShape, mrChartModel
- , rParam.maRemainingSpace, rPageSize, bIsVertical? ALIGN_TOP : ALIGN_RIGHT, rParam.mbAutoPosSecondTitleY );
+ , rParam.maRemainingSpace, rPageSize, bIsVertical? TitleAlignment::ALIGN_TOP : TitleAlignment::ALIGN_RIGHT, rParam.mbAutoPosSecondTitleY );
if (!bHasRelativeSize && (rParam.maRemainingSpace.Width <= 0 || rParam.maRemainingSpace.Height <= 0))
return false;
return true;
}
+namespace
+{
+constexpr sal_Int32 constDiagramTitleSpace = 200; //=0,2 cm spacing
+
+bool lcl_getPropertySwapXAndYAxis(const rtl::Reference<Diagram>& xDiagram)
+{
+ bool bSwapXAndY = false;
+
+ if (xDiagram.is())
+ {
+ const std::vector<rtl::Reference<BaseCoordinateSystem>> aCooSysList(
+ xDiagram->getBaseCoordinateSystems());
+ if (!aCooSysList.empty())
+ {
+ try
+ {
+ aCooSysList[0]->getPropertyValue(u"SwapXAndYAxis"_ustr) >>= bSwapXAndY;
+ }
+ catch (const uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "");
+ }
+ }
+ }
+ return bSwapXAndY;
+}
+
+} // end anonymous namespace
+
+sal_Int32 ChartView::getExplicitNumberFormatKeyForAxis(
+ const rtl::Reference<::chart::Axis>& xAxis,
+ const rtl::Reference<::chart::BaseCoordinateSystem>& xCorrespondingCoordinateSystem,
+ const rtl::Reference<::chart::ChartModel>& xChartDoc)
+{
+ return AxisHelper::getExplicitNumberFormatKeyForAxis(
+ xAxis, xCorrespondingCoordinateSystem, xChartDoc,
+ true /*bSearchForParallelAxisIfNothingIsFound*/);
+}
+
+sal_Int32 ChartView::getExplicitPercentageNumberFormatKeyForDataLabel(
+ const uno::Reference<beans::XPropertySet>& xSeriesOrPointProp,
+ const uno::Reference<util::XNumberFormatsSupplier>& xNumberFormatsSupplier)
+{
+ sal_Int32 nFormat = 0;
+ if (!xSeriesOrPointProp.is())
+ return nFormat;
+ if (!(xSeriesOrPointProp->getPropertyValue(u"PercentageNumberFormat"_ustr) >>= nFormat))
+ {
+ nFormat = DiagramHelper::getPercentNumberFormat(xNumberFormatsSupplier);
+ }
+ if (nFormat < 0)
+ nFormat = 0;
+ return nFormat;
+}
+
+awt::Rectangle ChartView::AddSubtractAxisTitleSizes(
+ ChartModel& rModel, ChartView* pChartView, const awt::Rectangle& rPositionAndSize,
+ bool bSubtract)
+{
+ awt::Rectangle aRet(rPositionAndSize);
+
+ //add axis title sizes to the diagram size
+ rtl::Reference<::chart::Title> xTitle_Height(
+ TitleHelper::getTitle(TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION, rModel));
+ rtl::Reference<::chart::Title> xTitle_Width(
+ TitleHelper::getTitle(TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION, rModel));
+ rtl::Reference<::chart::Title> xSecondTitle_Height(
+ TitleHelper::getTitle(TitleHelper::SECONDARY_X_AXIS_TITLE, rModel));
+ rtl::Reference<::chart::Title> xSecondTitle_Width(
+ TitleHelper::getTitle(TitleHelper::SECONDARY_Y_AXIS_TITLE, rModel));
+ if (xTitle_Height.is() || xTitle_Width.is() || xSecondTitle_Height.is()
+ || xSecondTitle_Width.is())
+ {
+ if (pChartView)
+ {
+ //detect whether x axis points into x direction or not
+ if (lcl_getPropertySwapXAndYAxis(rModel.getFirstChartDiagram()))
+ {
+ std::swap(xTitle_Height, xTitle_Width);
+ std::swap(xSecondTitle_Height, xSecondTitle_Width);
+ }
+
+ sal_Int32 nTitleSpaceWidth = 0;
+ sal_Int32 nTitleSpaceHeight = 0;
+ sal_Int32 nSecondTitleSpaceWidth = 0;
+ sal_Int32 nSecondTitleSpaceHeight = 0;
+
+ if (xTitle_Height.is())
+ {
+ OUString aCID_X(
+ ObjectIdentifier::createClassifiedIdentifierForObject(xTitle_Height, &rModel));
+ nTitleSpaceHeight
+ = pChartView->getRectangleOfObject(aCID_X, true).Height;
+ if (nTitleSpaceHeight)
+ nTitleSpaceHeight += constDiagramTitleSpace;
+ }
+ if (xTitle_Width.is())
+ {
+ OUString aCID_Y(
+ ObjectIdentifier::createClassifiedIdentifierForObject(xTitle_Width, &rModel));
+ nTitleSpaceWidth = pChartView->getRectangleOfObject(aCID_Y, true).Width;
+ if (nTitleSpaceWidth)
+ nTitleSpaceWidth += constDiagramTitleSpace;
+ }
+ if (xSecondTitle_Height.is())
+ {
+ OUString aCID_X(ObjectIdentifier::createClassifiedIdentifierForObject(
+ xSecondTitle_Height, &rModel));
+ nSecondTitleSpaceHeight
+ = pChartView->getRectangleOfObject(aCID_X, true).Height;
+ if (nSecondTitleSpaceHeight)
+ nSecondTitleSpaceHeight += constDiagramTitleSpace;
+ }
+ if (xSecondTitle_Width.is())
+ {
+ OUString aCID_Y(ObjectIdentifier::createClassifiedIdentifierForObject(
+ xSecondTitle_Width, &rModel));
+ nSecondTitleSpaceWidth
+ += pChartView->getRectangleOfObject(aCID_Y, true).Width;
+ if (nSecondTitleSpaceWidth)
+ nSecondTitleSpaceWidth += constDiagramTitleSpace;
+ }
+ if (bSubtract)
+ {
+ aRet.X += nTitleSpaceWidth;
+ aRet.Y += nSecondTitleSpaceHeight;
+ aRet.Width -= (nTitleSpaceWidth + nSecondTitleSpaceWidth);
+ aRet.Height -= (nTitleSpaceHeight + nSecondTitleSpaceHeight);
+ }
+ else
+ {
+ aRet.X -= nTitleSpaceWidth;
+ aRet.Y -= nSecondTitleSpaceHeight;
+ aRet.Width += nTitleSpaceWidth + nSecondTitleSpaceWidth;
+ aRet.Height += nTitleSpaceHeight + nSecondTitleSpaceHeight;
+ }
+ }
+ }
+ return aRet;
+}
+
} //namespace chart
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
diff --git a/chart2/source/view/main/Clipping.cxx b/chart2/source/view/main/Clipping.cxx
index 7509f53fb28d..713e88c26bd0 100644
--- a/chart2/source/view/main/Clipping.cxx
+++ b/chart2/source/view/main/Clipping.cxx
@@ -21,6 +21,7 @@
#include <CommonConverters.hxx>
#include <BaseGFXHelper.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/drawing/Position3D.hpp>
@@ -217,7 +218,7 @@ void lcl_addPointToPoly( std::vector<std::vector<css::drawing::Position3D>>& rPo
}
//make sure that we have enough polygons
- if(nPolygonIndex >= static_cast<sal_Int32>(rPoly.size()) )
+ if(o3tl::make_unsigned(nPolygonIndex) >= rPoly.size() )
{
rPoly.resize(nPolygonIndex+1);
rResultPointCount.resize(nPolygonIndex+1,0);
diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx
new file mode 100644
index 000000000000..6911e9cd5560
--- /dev/null
+++ b/chart2/source/view/main/DataTableView.cxx
@@ -0,0 +1,574 @@
+/* -*- 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 <DataTableView.hxx>
+#include <VSeriesPlotter.hxx>
+#include <ShapeFactory.hxx>
+#include <ExplicitCategoriesProvider.hxx>
+#include <ChartModel.hxx>
+#include <ObjectIdentifier.hxx>
+
+#include <svx/svdotable.hxx>
+
+#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
+#include <com/sun/star/table/TableBorder.hpp>
+#include <com/sun/star/table/BorderLineStyle.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/drawing/LineDash.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/util/XBroadcaster.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <o3tl/unit_conversion.hxx>
+
+using namespace css;
+
+namespace chart
+{
+namespace
+{
+void setTopCell(const uno::Reference<beans::XPropertySet>& xPropertySet)
+{
+ xPropertySet->setPropertyValue(u"FillColor"_ustr, uno::Any(Color(0xFFFFFF)));
+ xPropertySet->setPropertyValue(u"TextVerticalAdjust"_ustr,
+ uno::Any(drawing::TextVerticalAdjust_TOP));
+ xPropertySet->setPropertyValue(u"ParaAdjust"_ustr, uno::Any(style::ParagraphAdjust_CENTER));
+
+ table::BorderLine2 aBorderLine;
+ aBorderLine.LineWidth = 0;
+ aBorderLine.Color = 0x000000;
+
+ xPropertySet->setPropertyValue(u"TopBorder"_ustr, uno::Any(aBorderLine));
+ xPropertySet->setPropertyValue(u"LeftBorder"_ustr, uno::Any(aBorderLine));
+}
+
+void copyProperty(const uno::Reference<beans::XPropertySet>& xOut,
+ const uno::Reference<beans::XPropertySet>& xIn, OUString const& sPropertyName)
+{
+ xOut->setPropertyValue(sPropertyName, xIn->getPropertyValue(sPropertyName));
+}
+
+uno::Reference<text::XTextRange> getFirstParagraph(uno::Reference<text::XText> const& xText)
+{
+ uno::Reference<text::XTextRange> xParagraph;
+ uno::Reference<container::XEnumerationAccess> xEnumAccess(xText, uno::UNO_QUERY);
+ if (!xEnumAccess.is())
+ return xParagraph;
+ uno::Reference<container::XEnumeration> xEnumeration(xEnumAccess->createEnumeration());
+ xParagraph.set(xEnumeration->nextElement(), uno::UNO_QUERY);
+ return xParagraph;
+}
+
+uno::Reference<beans::XPropertySet>
+getFirstParagraphProperties(uno::Reference<text::XText> const& xText)
+{
+ uno::Reference<beans::XPropertySet> xPropertySet;
+ auto xParagraph = getFirstParagraph(xText);
+ if (!xParagraph.is())
+ return xPropertySet;
+ xPropertySet.set(xParagraph, uno::UNO_QUERY);
+ return xPropertySet;
+}
+
+} // end anonymous namespace
+
+DataTableView::DataTableView(
+ rtl::Reference<::chart::ChartModel> const& xChartModel,
+ rtl::Reference<DataTable> const& rDataTableModel,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext,
+ bool bAlignAxisValuesWithColumns)
+ : m_xChartModel(xChartModel)
+ , m_xDataTableModel(rDataTableModel)
+ , m_xComponentContext(rComponentContext)
+ , m_bAlignAxisValuesWithColumns(bAlignAxisValuesWithColumns)
+{
+ m_aLineProperties.initFromPropertySet(uno::Reference<beans::XPropertySet>(m_xDataTableModel));
+}
+
+void DataTableView::setCellCharAndParagraphProperties(
+ const uno::Reference<beans::XPropertySet>& xPropertySet)
+{
+ uno::Reference<beans::XPropertySet> xDataTableProperties(m_xDataTableModel);
+
+ copyProperty(xPropertySet, xDataTableProperties, u"CharColor"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontFamily"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontFamilyAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontFamilyComplex"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontCharSet"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontCharSetAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontCharSetComplex"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontName"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontNameAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontNameComplex"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontPitch"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontPitchAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontPitchComplex"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontStyleName"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontStyleNameAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharFontStyleNameComplex"_ustr);
+
+ copyProperty(xPropertySet, xDataTableProperties, u"CharHeight"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharHeightAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharHeightComplex"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharKerning"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharLocale"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharLocaleAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharLocaleComplex"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharPosture"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharPostureAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharPostureComplex"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharRelief"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharShadowed"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharStrikeout"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharUnderline"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharUnderlineColor"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharUnderlineHasColor"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharOverline"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharOverlineColor"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharOverlineHasColor"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharWeight"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharWeightAsian"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharWeightComplex"_ustr);
+ copyProperty(xPropertySet, xDataTableProperties, u"CharWordMode"_ustr);
+
+ drawing::FillStyle eFillStyle = drawing::FillStyle_NONE;
+ xDataTableProperties->getPropertyValue(u"FillStyle"_ustr) >>= eFillStyle;
+ if (eFillStyle == drawing::FillStyle_SOLID)
+ {
+ sal_Int32 aColor = 0;
+ if (xDataTableProperties->getPropertyValue(u"FillColor"_ustr) >>= aColor)
+ xPropertySet->setPropertyValue(u"CharBackColor"_ustr, uno::Any(aColor));
+ }
+
+ xPropertySet->setPropertyValue(u"ParaAdjust"_ustr, uno::Any(style::ParagraphAdjust_CENTER));
+}
+
+void DataTableView::setCellProperties(const css::uno::Reference<beans::XPropertySet>& xPropertySet,
+ bool bLeft, bool bTop, bool bRight, bool bBottom)
+{
+ xPropertySet->setPropertyValue(u"FillColor"_ustr, uno::Any(Color(0xFFFFFF)));
+
+ float fFontHeight = 0.0;
+ m_xDataTableModel->getPropertyValue(u"CharHeight"_ustr) >>= fFontHeight;
+ fFontHeight = o3tl::convert(fFontHeight, o3tl::Length::pt, o3tl::Length::mm100);
+ sal_Int32 nXDistance = std::round(fFontHeight * 0.18f);
+ sal_Int32 nYDistance = std::round(fFontHeight * 0.30f);
+
+ xPropertySet->setPropertyValue(u"TextLeftDistance"_ustr, uno::Any(nXDistance));
+ xPropertySet->setPropertyValue(u"TextRightDistance"_ustr, uno::Any(nXDistance));
+ xPropertySet->setPropertyValue(u"TextUpperDistance"_ustr, uno::Any(nYDistance));
+ xPropertySet->setPropertyValue(u"TextLowerDistance"_ustr, uno::Any(nYDistance));
+
+ xPropertySet->setPropertyValue(u"TextVerticalAdjust"_ustr,
+ uno::Any(drawing::TextVerticalAdjust_TOP));
+
+ drawing::LineStyle eStyle = drawing::LineStyle_NONE;
+ m_aLineProperties.LineStyle >>= eStyle;
+
+ if (eStyle != drawing::LineStyle_NONE)
+ {
+ table::BorderLine2 aBorderLine;
+
+ sal_Int32 nWidth = 0;
+ m_aLineProperties.Width >>= nWidth;
+ aBorderLine.LineWidth = o3tl::convert(nWidth, o3tl::Length::mm100, o3tl::Length::twip);
+
+ sal_Int32 nColor = 0;
+ m_aLineProperties.Color >>= nColor;
+ aBorderLine.Color = nColor;
+
+ aBorderLine.LineStyle = table::BorderLineStyle::SOLID;
+
+ if (eStyle == drawing::LineStyle_DASH)
+ {
+ OUString aDashName;
+ m_aLineProperties.DashName >>= aDashName;
+ if (!aDashName.isEmpty() && m_xChartModel.is())
+ {
+ uno::Reference<container::XNameContainer> xDashTable(
+ m_xChartModel->createInstance(u"com.sun.star.drawing.DashTable"_ustr),
+ uno::UNO_QUERY);
+ if (xDashTable.is() && xDashTable->hasByName(aDashName))
+ {
+ drawing::LineDash aLineDash;
+ xDashTable->getByName(aDashName) >>= aLineDash;
+
+ if (aLineDash.Dots == 0 && aLineDash.Dashes == 0)
+ aBorderLine.LineStyle = table::BorderLineStyle::SOLID;
+ else if (aLineDash.Dots == 1 && aLineDash.Dashes == 0)
+ aBorderLine.LineStyle = table::BorderLineStyle::DOTTED;
+ else if (aLineDash.Dots == 0 && aLineDash.Dashes == 1)
+ aBorderLine.LineStyle = table::BorderLineStyle::DASHED;
+ else if (aLineDash.Dots == 1 && aLineDash.Dashes == 1)
+ aBorderLine.LineStyle = table::BorderLineStyle::DASH_DOT;
+ else if (aLineDash.Dots == 2 && aLineDash.Dashes == 1)
+ aBorderLine.LineStyle = table::BorderLineStyle::DASH_DOT_DOT;
+ else
+ aBorderLine.LineStyle = table::BorderLineStyle::DASHED;
+ }
+ }
+ }
+
+ if (bLeft)
+ xPropertySet->setPropertyValue(u"LeftBorder"_ustr, uno::Any(aBorderLine));
+ if (bTop)
+ xPropertySet->setPropertyValue(u"TopBorder"_ustr, uno::Any(aBorderLine));
+ if (bRight)
+ xPropertySet->setPropertyValue(u"RightBorder"_ustr, uno::Any(aBorderLine));
+ if (bBottom)
+ xPropertySet->setPropertyValue(u"BottomBorder"_ustr, uno::Any(aBorderLine));
+ }
+}
+
+void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd,
+ sal_Int32 nAxisStepWidth)
+{
+ if (!m_xTarget.is())
+ return;
+
+ // Remove shapes first before we add the new ones
+ ShapeFactory::removeSubShapes(m_xTarget);
+ auto sParticle = ObjectIdentifier::createParticleForDataTable(m_xChartModel);
+ auto sCID = ObjectIdentifier::createClassifiedIdentifierForParticle(sParticle);
+ m_xTableShape = ShapeFactory::createTable(m_xTarget, sCID);
+
+ // calculate the table size
+ auto rDelta = rEnd - rStart;
+ sal_Int32 nTableSize = basegfx::fround(rDelta.getX());
+ m_xTableShape->setSize({ nTableSize, 0 });
+
+ try
+ {
+ m_xTableShape->getPropertyValue(u"Model"_ustr) >>= m_xTable;
+ }
+ catch (const uno::Exception&)
+ {
+ return;
+ }
+
+ if (!m_xTable.is())
+ return;
+
+ uno::Reference<util::XBroadcaster> xBroadcaster(m_xTable, uno::UNO_QUERY);
+
+ if (!xBroadcaster.is())
+ return;
+
+ xBroadcaster->lockBroadcasts();
+
+ auto* pTableObject = static_cast<sdr::table::SdrTableObj*>(m_xTableShape->GetSdrObject());
+
+ // get the data table properties from the model
+ bool bHBorder = false;
+ bool bVBorder = false;
+ bool bOutline = false;
+ bool bKeys = false;
+
+ std::vector<ViewLegendSymbol> aSymbols;
+
+ m_xDataTableModel->getPropertyValue(u"HBorder"_ustr) >>= bHBorder;
+ m_xDataTableModel->getPropertyValue(u"VBorder"_ustr) >>= bVBorder;
+ m_xDataTableModel->getPropertyValue(u"Outline"_ustr) >>= bOutline;
+ m_xDataTableModel->getPropertyValue(u"Keys"_ustr) >>= bKeys;
+
+ // set the data table row and column size
+ sal_Int32 nColumnCount = m_aXValues.size();
+ uno::Reference<table::XTableColumns> xTableColumns = m_xTable->getColumns();
+ xTableColumns->insertByIndex(0, nColumnCount);
+
+ sal_Int32 nRowCount = m_aDataSeriesNames.size();
+ uno::Reference<table::XTableRows> xTableRows = m_xTable->getRows();
+ xTableRows->insertByIndex(0, nRowCount);
+
+ sal_Int32 nColumnWidth = 0.0;
+
+ // If we don't align, we have to calculate the column width ourselves,
+ // otherwise the column width is taken from the x-axis width
+ if (m_bAlignAxisValuesWithColumns)
+ nColumnWidth = nAxisStepWidth;
+ else
+ nColumnWidth = double(nTableSize) / nColumnCount;
+
+ // Setup empty top-left cell
+ {
+ uno::Reference<table::XCell> xCell = m_xTable->getCellByPosition(0, 0);
+ uno::Reference<beans::XPropertySet> xPropertySet(xCell, uno::UNO_QUERY);
+ if (xPropertySet.is())
+ {
+ setTopCell(xPropertySet);
+ }
+ }
+
+ sal_Int32 nColumn;
+ sal_Int32 nRow;
+
+ // COLUMN HEADER
+
+ nColumn = 1;
+ for (auto const& rString : m_aXValues)
+ {
+ uno::Reference<table::XCell> xCell = m_xTable->getCellByPosition(nColumn, 0);
+ uno::Reference<beans::XPropertySet> xPropertySet(xCell, uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCellTextRange(xCell, uno::UNO_QUERY);
+ if (xCellTextRange.is())
+ {
+ auto xText = xCellTextRange->getText();
+ xText->insertString(xText->getStart(), rString, false);
+ auto xTextPropertySet = getFirstParagraphProperties(xText);
+ if (xTextPropertySet)
+ {
+ bool bLeft = (bOutline && nColumn == 1)
+ || (bVBorder && nColumn > 1 && nColumn < nColumnCount);
+ bool bRight = (bOutline && nColumn == nColumnCount)
+ || (bVBorder && nColumn > 1 && nColumn < nColumnCount);
+ setCellCharAndParagraphProperties(xTextPropertySet);
+ setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline);
+ }
+ }
+ nColumn++;
+ }
+
+ // ROW HEADER
+ // Prepare keys (symbols)
+ sal_Int32 nMaxSymbolWidth = 0;
+ constexpr const sal_Int32 constSymbolMargin = 100; // 1mm
+ if (bKeys)
+ {
+ float fFontHeight = 0.0;
+ m_xDataTableModel->getPropertyValue(u"CharHeight"_ustr) >>= fFontHeight;
+ fFontHeight = o3tl::convert(fFontHeight, o3tl::Length::pt, o3tl::Length::mm100);
+
+ sal_Int32 nSymbolHeight = sal_Int32(fFontHeight * 0.6);
+ sal_Int32 nSymbolWidth = nSymbolHeight;
+
+ for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList)
+ {
+ if (pSeriesPlotter)
+ {
+ awt::Size aCurrentRatio = pSeriesPlotter->getPreferredLegendKeyAspectRatio();
+ sal_Int32 nCurrentWidth = aCurrentRatio.Width;
+ if (aCurrentRatio.Height > 0)
+ nCurrentWidth = nSymbolHeight * aCurrentRatio.Width / aCurrentRatio.Height;
+ nSymbolWidth = std::max(nSymbolWidth, nCurrentWidth);
+ }
+ }
+ nMaxSymbolWidth = nSymbolWidth;
+
+ for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList)
+ {
+ if (pSeriesPlotter)
+ {
+ awt::Size aSize(nSymbolWidth, nSymbolHeight);
+ std::vector<ViewLegendSymbol> aNewEntries
+ = pSeriesPlotter->createSymbols(aSize, m_xTarget, m_xComponentContext);
+
+ for (auto const& rSymbol : aNewEntries)
+ aSymbols.push_back(rSymbol);
+ }
+ }
+ }
+
+ nRow = 1;
+ for (auto const& rSeriesName : m_aDataSeriesNames)
+ {
+ uno::Reference<table::XCell> xCell = m_xTable->getCellByPosition(0, nRow);
+ uno::Reference<beans::XPropertySet> xCellPropertySet(xCell, uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCellTextRange(xCell, uno::UNO_QUERY);
+ if (xCellTextRange.is())
+ {
+ bool bTop = (bOutline && nRow == 1) || (bHBorder && nRow > 1 && nRow < nRowCount);
+ bool bBottom
+ = (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount);
+
+ auto xText = xCellTextRange->getText();
+ xText->insertString(xText->getStart(), rSeriesName, false);
+ auto xTextPropertySet = getFirstParagraphProperties(xText);
+ if (xTextPropertySet)
+ {
+ setCellCharAndParagraphProperties(xTextPropertySet);
+ setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom);
+
+ xCellPropertySet->setPropertyValue(u"ParaAdjust"_ustr,
+ uno::Any(style::ParagraphAdjust_LEFT));
+ if (bKeys)
+ {
+ xCellPropertySet->setPropertyValue(
+ u"ParaLeftMargin"_ustr,
+ uno::Any(nMaxSymbolWidth + sal_Int32(2 * constSymbolMargin)));
+ }
+ }
+ }
+ nRow++;
+ }
+
+ // TABLE
+ nRow = 1;
+ const sal_Int32 nTableModelRowCount = m_xTable->getRowCount();
+ const sal_Int32 nTableModelColCount = m_xTable->getColumnCount();
+ // tdf#153182 the broken bounds are most likely because we don't know if the
+ // data-table has header rows and columns. Most likely it does not.
+ bool bBrokenBounds = false;
+ for (auto const& rSeries : m_pDataSeriesValues)
+ {
+ nColumn = 1;
+ for (auto const& rValue : rSeries)
+ {
+ if (nRow >= nTableModelRowCount || nColumn >= nTableModelColCount)
+ {
+ bBrokenBounds = true;
+ SAL_WARN("chart2", "exceeding bounds of table model?");
+ break;
+ }
+ uno::Reference<table::XCell> xCell = m_xTable->getCellByPosition(nColumn, nRow);
+ uno::Reference<beans::XPropertySet> xCellPropertySet(xCell, uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCellTextRange(xCell, uno::UNO_QUERY);
+ if (xCellTextRange.is())
+ {
+ auto xText = xCellTextRange->getText();
+ xText->insertString(xText->getStart(), rValue, false);
+ auto xTextPropertySet = getFirstParagraphProperties(xText);
+ if (xTextPropertySet.is())
+ {
+ bool bLeft = false;
+ bool bTop = false;
+ bool bRight = false;
+ bool bBottom = false;
+
+ if (nColumn > 1 && bVBorder)
+ bLeft = true;
+
+ if (nRow > 1 && bHBorder)
+ bTop = true;
+
+ if (nRow == nRowCount && bOutline)
+ bBottom = true;
+
+ if (nColumn == nColumnCount && bOutline)
+ bRight = true;
+
+ setCellCharAndParagraphProperties(xTextPropertySet);
+ setCellProperties(xCellPropertySet, bLeft, bTop, bRight, bBottom);
+ }
+ }
+ nColumn++;
+ }
+ if (bBrokenBounds)
+ break;
+ nRow++;
+ }
+
+ // force recalculation of column widths in the table shape
+ xBroadcaster->unlockBroadcasts();
+ pTableObject->DistributeColumns(0, nColumnCount, true, true);
+
+ xBroadcaster->lockBroadcasts();
+
+ // reposition the data table
+ changePosition(basegfx::fround(rStart.getX()), basegfx::fround(rStart.getY()));
+
+ sal_Int32 nTableX = m_xTableShape->getPosition().X;
+ sal_Int32 nTableY = m_xTableShape->getPosition().Y;
+
+ uno::Reference<beans::XPropertySet> xPropertySet(xTableColumns->getByIndex(0), uno::UNO_QUERY);
+
+ for (sal_Int32 i = 1; i < xTableColumns->getCount(); ++i)
+ {
+ xPropertySet.set(xTableColumns->getByIndex(i), uno::UNO_QUERY);
+ xPropertySet->setPropertyValue(u"Width"_ustr, uno::Any(nColumnWidth));
+ }
+
+ // force recalculation of row heights in the table shape
+ xBroadcaster->unlockBroadcasts();
+ pTableObject->DistributeRows(0, nRowCount, true, true);
+
+ if (bKeys)
+ {
+ sal_Int32 nTotalHeight = 0;
+ for (sal_Int32 i = 0; i < xTableRows->getCount(); i++)
+ {
+ sal_Int32 nSymbolIndex = i - 1;
+ if (nSymbolIndex < sal_Int32(aSymbols.size()))
+ {
+ xPropertySet.set(xTableRows->getByIndex(i), uno::UNO_QUERY);
+ sal_Int32 nHeight = 0;
+ xPropertySet->getPropertyValue(u"Height"_ustr) >>= nHeight;
+ if (i > 0)
+ {
+ auto& rSymbol = aSymbols[nSymbolIndex].xSymbol;
+ sal_Int32 nSymbolHeight = rSymbol->getSize().Height;
+ sal_Int32 nSymbolY
+ = basegfx::fround(double(nHeight) / 2.0 - double(nSymbolHeight) / 2.0);
+ rSymbol->setPosition(
+ { nTableX + constSymbolMargin, nTableY + nTotalHeight + nSymbolY });
+ }
+ nTotalHeight += nHeight;
+ }
+ }
+ }
+}
+
+void DataTableView::changePosition(sal_Int32 x, sal_Int32 y)
+{
+ if (!m_xTable.is())
+ return;
+
+ uno::Reference<table::XTableColumns> xTableColumns = m_xTable->getColumns();
+ uno::Reference<beans::XPropertySet> xPropertySet(xTableColumns->getByIndex(0), uno::UNO_QUERY);
+
+ sal_Int32 nWidth = 0;
+ xPropertySet->getPropertyValue(u"Width"_ustr) >>= nWidth;
+
+ m_xTarget->setPosition({ x - nWidth, y });
+}
+
+void DataTableView::initializeShapes(const rtl::Reference<SvxShapeGroupAnyD>& xTarget)
+{
+ m_xTarget = xTarget;
+}
+
+void DataTableView::initializeValues(
+ std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList)
+{
+ for (auto& rSeriesPlotter : rSeriesPlotterList)
+ {
+ m_pSeriesPlotterList.push_back(rSeriesPlotter.get());
+
+ for (auto const& rCategory :
+ rSeriesPlotter->getExplicitCategoriesProvider()->getSimpleCategories())
+ {
+ m_aXValues.push_back(rCategory);
+ }
+
+ for (auto const& rString : rSeriesPlotter->getAllSeriesNames())
+ {
+ m_aDataSeriesNames.push_back(rString);
+ }
+
+ for (VDataSeries* pSeries : rSeriesPlotter->getAllSeries())
+ {
+ auto& rValues = m_pDataSeriesValues.emplace_back();
+ for (int i = 0; i < pSeries->getTotalPointCount(); i++)
+ {
+ double nValue = pSeries->getYValue(i);
+ rValues.push_back(rSeriesPlotter->getLabelTextForValue(*pSeries, i, nValue, false));
+ }
+ }
+ }
+}
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index ff2171f596a1..8c418ec2374d 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -25,6 +25,7 @@
#include <svl/itempool.hxx>
#include <svx/objfac3d.hxx>
#include <svx/svdpage.hxx>
+#include <svx/svx3ditems.hxx>
#include <svx/xtable.hxx>
#include <svx/svdoutl.hxx>
#include <editeng/unolingu.hxx>
@@ -43,13 +44,19 @@ namespace chart
{
DrawModelWrapper::DrawModelWrapper()
-: SdrModel(&ChartItemPool::GetGlobalChartItemPool())
+: SdrModel()
{
- SetVOCInvalidationIsReliable(true);
- SetScaleUnit(MapUnit::Map100thMM);
- SetScaleFraction(Fraction(1, 1));
+ m_xChartItemPool = ChartItemPool::CreateChartItemPool();
+
SetDefaultFontHeight(423); // 12pt
+ SfxItemPool* pMasterPool = &GetItemPool();
+ pMasterPool->SetDefaultMetric(MapUnit::Map100thMM);
+ pMasterPool->SetUserDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, true) );
+ pMasterPool->SetUserDefaultItem(makeSvx3DPercentDiagonalItem (5));
+
+ // append chart pool to end of pool chain
+ pMasterPool->GetLastPoolInChain()->SetSecondaryPool(m_xChartItemPool.get());
SetTextDefaults();
//this factory needs to be created before first use of 3D scenes once upon an office runtime
@@ -93,19 +100,36 @@ DrawModelWrapper::DrawModelWrapper()
DrawModelWrapper::~DrawModelWrapper()
{
+ // normally call from ~SdrModel, but do it here explicitly before we clear m_xChartItemPool
+ implDtorClearModel();
+
+ //remove m_pChartItemPool from pool chain
+ if (m_xChartItemPool)
+ {
+ SfxItemPool* pPool = &GetItemPool();
+ for (;;)
+ {
+ SfxItemPool* pSecondary = pPool->GetSecondaryPool();
+ if(pSecondary == m_xChartItemPool.get())
+ {
+ pPool->SetSecondaryPool (nullptr);
+ break;
+ }
+ pPool = pSecondary;
+ }
+ m_xChartItemPool.clear();
+ }
m_pRefDevice.disposeAndClear();
}
-uno::Reference< uno::XInterface > DrawModelWrapper::createUnoModel()
+uno::Reference< frame::XModel > DrawModelWrapper::createUnoModel()
{
- uno::Reference< lang::XComponent > xComponent = new SvxUnoDrawingModel( this ); //tell Andreas Schluens if SvxUnoDrawingModel is not needed anymore -> remove export from svx to avoid link problems in writer
- return uno::Reference< uno::XInterface >::query( xComponent );
+ return new SvxUnoDrawingModel( this ); //tell Andreas Schluens if SvxUnoDrawingModel is not needed anymore -> remove export from svx to avoid link problems in writer
}
-uno::Reference< frame::XModel > DrawModelWrapper::getUnoModel()
+const uno::Reference< frame::XModel > & DrawModelWrapper::getUnoModel()
{
- uno::Reference< uno::XInterface > xI = SdrModel::getUnoModel();
- return uno::Reference<frame::XModel>::query( xI );
+ return SdrModel::getUnoModel();
}
SdrModel& DrawModelWrapper::getSdrModel()
@@ -268,17 +292,13 @@ SdrObject* DrawModelWrapper::getNamedSdrObject( const OUString& rObjectCID, SdrO
{
if(!pSearchList || rObjectCID.isEmpty())
return nullptr;
- const size_t nCount = pSearchList->GetObjCount();
- for( size_t nN=0; nN<nCount; ++nN )
+ for (const rtl::Reference<SdrObject>& pObj : *pSearchList)
{
- SdrObject* pObj = pSearchList->GetObj(nN);
- if(!pObj)
- continue;
if( ObjectIdentifier::areIdenticalObjects( rObjectCID, pObj->GetName() ) )
- return pObj;
- pObj = DrawModelWrapper::getNamedSdrObject( rObjectCID, pObj->GetSubList() );
- if(pObj)
- return pObj;
+ return pObj.get();
+ SdrObject* pNamedObj = DrawModelWrapper::getNamedSdrObject( rObjectCID, pObj->GetSubList() );
+ if(pNamedObj)
+ return pNamedObj;
}
return nullptr;
}
diff --git a/chart2/source/view/main/LabelPositionHelper.cxx b/chart2/source/view/main/LabelPositionHelper.cxx
index ec169ce4f4cc..4b3079ce7225 100644
--- a/chart2/source/view/main/LabelPositionHelper.cxx
+++ b/chart2/source/view/main/LabelPositionHelper.cxx
@@ -24,20 +24,19 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
#include <cmath>
+#include <utility>
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
LabelPositionHelper::LabelPositionHelper(
sal_Int32 nDimensionCount
- , const rtl::Reference<SvxShapeGroupAnyD>& xLogicTarget)
+ , rtl::Reference<SvxShapeGroupAnyD> xLogicTarget)
: m_nDimensionCount(nDimensionCount)
- , m_xLogicTarget(xLogicTarget)
+ , m_xLogicTarget(std::move(xLogicTarget))
{
}
@@ -53,28 +52,28 @@ awt::Point LabelPositionHelper::transformSceneToScreenPosition( const drawing::P
void LabelPositionHelper::changeTextAdjustment( tAnySequence& rPropValues, const tNameSequence& rPropNames, LabelAlignment eAlignment)
{
- //HorizontalAdjustment
+ uno::Any* pHorizontalAdjustAny
+ = PropertyMapper::getValuePointer(rPropValues, rPropNames, u"TextHorizontalAdjust");
+ if (pHorizontalAdjustAny)
{
drawing::TextHorizontalAdjust eHorizontalAdjust = drawing::TextHorizontalAdjust_CENTER;
if( eAlignment==LABEL_ALIGN_RIGHT || eAlignment==LABEL_ALIGN_RIGHT_TOP || eAlignment==LABEL_ALIGN_RIGHT_BOTTOM )
eHorizontalAdjust = drawing::TextHorizontalAdjust_LEFT;
else if( eAlignment==LABEL_ALIGN_LEFT || eAlignment==LABEL_ALIGN_LEFT_TOP || eAlignment==LABEL_ALIGN_LEFT_BOTTOM )
eHorizontalAdjust = drawing::TextHorizontalAdjust_RIGHT;
- uno::Any* pHorizontalAdjustAny = PropertyMapper::getValuePointer(rPropValues,rPropNames,u"TextHorizontalAdjust");
- if(pHorizontalAdjustAny)
- *pHorizontalAdjustAny <<= eHorizontalAdjust;
+ *pHorizontalAdjustAny <<= eHorizontalAdjust;
}
- //VerticalAdjustment
+ uno::Any* pVerticalAdjustAny
+ = PropertyMapper::getValuePointer(rPropValues, rPropNames, u"TextVerticalAdjust");
+ if (pVerticalAdjustAny)
{
drawing::TextVerticalAdjust eVerticalAdjust = drawing::TextVerticalAdjust_CENTER;
if( eAlignment==LABEL_ALIGN_TOP || eAlignment==LABEL_ALIGN_RIGHT_TOP || eAlignment==LABEL_ALIGN_LEFT_TOP )
eVerticalAdjust = drawing::TextVerticalAdjust_BOTTOM;
else if( eAlignment==LABEL_ALIGN_BOTTOM || eAlignment==LABEL_ALIGN_RIGHT_BOTTOM || eAlignment==LABEL_ALIGN_LEFT_BOTTOM )
eVerticalAdjust = drawing::TextVerticalAdjust_TOP;
- uno::Any* pVerticalAdjustAny = PropertyMapper::getValuePointer(rPropValues,rPropNames,u"TextVerticalAdjust");
- if(pVerticalAdjustAny)
- *pVerticalAdjustAny <<= eVerticalAdjust;
+ *pVerticalAdjustAny <<= eVerticalAdjust;
}
}
@@ -98,7 +97,7 @@ void LabelPositionHelper::doDynamicFontResize( tAnySequence& rPropValues
{
//handle dynamic font resize:
awt::Size aOldReferenceSize;
- if( xAxisModelProps->getPropertyValue( "ReferencePageSize") >>= aOldReferenceSize )
+ if( xAxisModelProps->getPropertyValue( u"ReferencePageSize"_ustr) >>= aOldReferenceSize )
{
uno::Any* pAOldAndNewFontHeightAny = PropertyMapper::getValuePointer( rPropValues, rPropNames, u"CharHeight" );
lcl_doDynamicFontResize( pAOldAndNewFontHeightAny, aOldReferenceSize, rNewReferenceSize );
diff --git a/chart2/source/view/main/PlotterBase.cxx b/chart2/source/view/main/PlotterBase.cxx
index a706f1600fc6..d09bba64aeef 100644
--- a/chart2/source/view/main/PlotterBase.cxx
+++ b/chart2/source/view/main/PlotterBase.cxx
@@ -25,7 +25,6 @@
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
PlotterBase::PlotterBase( sal_Int32 nDimensionCount )
: m_nDimension(nDimensionCount)
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index d4ed69579826..0f8c223537b2 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -28,7 +28,6 @@
#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
#include <rtl/math.hxx>
@@ -419,11 +418,7 @@ double PolarPlottingPositionHelper::getWidthAngleDegree( double& fStartLogicValu
{
const ExplicitScaleData& rAngleScale = m_bSwapXAndY ? m_aScales[1] : m_aScales[0];
if( rAngleScale.Orientation != AxisOrientation_MATHEMATICAL )
- {
- double fHelp = fEndLogicValueOnAngleAxis;
- fEndLogicValueOnAngleAxis = fStartLogicValueOnAngleAxis;
- fStartLogicValueOnAngleAxis = fHelp;
- }
+ std::swap( fStartLogicValueOnAngleAxis, fEndLogicValueOnAngleAxis );
double fStartAngleDegree = transformToAngleDegree( fStartLogicValueOnAngleAxis );
double fEndAngleDegree = transformToAngleDegree( fEndLogicValueOnAngleAxis );
@@ -627,8 +622,10 @@ drawing::Position3D PolarPlottingPositionHelper::transformScaledLogicToScene( do
double fLogicValueOnRadiusAxis = m_bSwapXAndY ? fX : fY;
return transformAngleRadiusToScene( fLogicValueOnAngleAxis, fLogicValueOnRadiusAxis, fZ, false );
}
-drawing::Position3D PolarPlottingPositionHelper::transformUnitCircleToScene( double fUnitAngleDegree, double fUnitRadius
- , double fLogicZ ) const
+drawing::Position3D PolarPlottingPositionHelper::transformUnitCircleToScene(
+ double fUnitAngleDegree, double fUnitRadius,
+ double fLogicZ ,
+ const ::basegfx::B3DVector& aOffset) const
{
double fAnglePi = basegfx::deg2rad(fUnitAngleDegree);
@@ -638,6 +635,7 @@ drawing::Position3D PolarPlottingPositionHelper::transformUnitCircleToScene( dou
//!! applying matrix to vector does ignore translation, so it is important to use a B3DPoint here instead of B3DVector
::basegfx::B3DPoint aPoint(fX,fY,fZ);
+ aPoint += aOffset;
::basegfx::B3DPoint aRet = m_aUnitCartesianToScene * aPoint;
return B3DPointToPosition3D(aRet);
}
diff --git a/chart2/source/view/main/PolarLabelPositionHelper.cxx b/chart2/source/view/main/PolarLabelPositionHelper.cxx
index d5c819954a91..5662f8639f08 100644
--- a/chart2/source/view/main/PolarLabelPositionHelper.cxx
+++ b/chart2/source/view/main/PolarLabelPositionHelper.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <BaseGFXHelper.hxx>
#include <PolarLabelPositionHelper.hxx>
#include <PlottingPositionHelper.hxx>
#include <basegfx/vector/b2dvector.hxx>
@@ -27,7 +28,6 @@
namespace chart
{
using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
PolarLabelPositionHelper::PolarLabelPositionHelper(
PolarPlottingPositionHelper* pPosHelper
@@ -63,7 +63,8 @@ awt::Point PolarLabelPositionHelper::getLabelScreenPositionAndAlignmentForUnitCi
, double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree
, double fUnitCircleInnerRadius, double fUnitCircleOuterRadius
, double fLogicZ
- , sal_Int32 nScreenValueOffsetInRadiusDirection ) const
+ , sal_Int32 nScreenValueOffsetInRadiusDirection
+ , const ::basegfx::B3DVector& aOffset) const
{
bool bCenter = (nLabelPlacement != css::chart::DataLabelPlacement::OUTSIDE)
&& (nLabelPlacement != css::chart::DataLabelPlacement::INSIDE);
@@ -76,7 +77,8 @@ awt::Point PolarLabelPositionHelper::getLabelScreenPositionAndAlignmentForUnitCi
fRadius = fUnitCircleInnerRadius + (fUnitCircleOuterRadius-fUnitCircleInnerRadius)/2.0 ;
awt::Point aRet( transformSceneToScreenPosition(
- m_pPosHelper->transformUnitCircleToScene( fAngleDegree, fRadius, fLogicZ+0.5 ) ) );
+ m_pPosHelper->transformUnitCircleToScene( fAngleDegree, fRadius,
+ fLogicZ+0.5, aOffset ) ) );
if(m_nDimensionCount==3 && nLabelPlacement == css::chart::DataLabelPlacement::OUTSIDE)
{
@@ -84,10 +86,11 @@ awt::Point PolarLabelPositionHelper::getLabelScreenPositionAndAlignmentForUnitCi
//take the farthest point to put the label to
awt::Point aP0( transformSceneToScreenPosition(
- m_pPosHelper->transformUnitCircleToScene( 0, 0, fLogicZ ) ) );
+ m_pPosHelper->transformUnitCircleToScene( 0, 0, fLogicZ, aOffset ) ) );
awt::Point aP1(aRet);
awt::Point aP2( transformSceneToScreenPosition(
- m_pPosHelper->transformUnitCircleToScene( fAngleDegree, fRadius, fLogicZ-0.5 ) ) );
+ m_pPosHelper->transformUnitCircleToScene( fAngleDegree, fRadius,
+ fLogicZ-0.5, aOffset ) ) );
::basegfx::B2DVector aV0( aP0.X, aP0.Y );
::basegfx::B2DVector aV1( aP1.X, aP1.Y );
@@ -143,7 +146,8 @@ awt::Point PolarLabelPositionHelper::getLabelScreenPositionAndAlignmentForUnitCi
if( nScreenValueOffsetInRadiusDirection != 0)
{
awt::Point aOrigin( transformSceneToScreenPosition(
- m_pPosHelper->transformUnitCircleToScene( 0.0, 0.0, fLogicZ+0.5 ) ) );
+ m_pPosHelper->transformUnitCircleToScene( 0.0, 0.0, fLogicZ+0.5,
+ aOffset ) ) );
basegfx::B2IVector aDirection( aRet.X- aOrigin.X, aRet.Y- aOrigin.Y );
aDirection.setLength(nScreenValueOffsetInRadiusDirection);
aRet.X += aDirection.getX();
diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx
index d7c1dd8f1c99..e042144747ba 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -22,33 +22,12 @@
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/drawing/BitmapMode.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
-#include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/drawing/RectanglePoint.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <svx/unoshape.hxx>
-#include <svx/svdopath.hxx>
-#include <svx/xfillit0.hxx>
-#include <svx/xflbckit.hxx>
-#include <svx/xflbmpit.hxx>
-#include <svx/xflbmsli.hxx>
-#include <svx/xflbmsxy.hxx>
-#include <svx/xflbmtit.hxx>
-#include <svx/xflboxy.hxx>
-#include <svx/xflbstit.hxx>
-#include <svx/xflbtoxy.hxx>
-#include <svx/xflclit.hxx>
-#include <svx/xfltrit.hxx>
-#include <svx/xlineit0.hxx>
-#include <svx/xlncapit.hxx>
-#include <svx/xlnclit.hxx>
-#include <svx/xlntrit.hxx>
-#include <svx/xlnwtit.hxx>
namespace chart
{
@@ -80,7 +59,7 @@ void PropertyMapper::setMappedProperties(
{
//do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer)
pNames[nN] = rTarget;
- pValues[nN] = aAny;
+ pValues[nN] = std::move(aAny);
++nN;
}
}
@@ -134,13 +113,13 @@ void PropertyMapper::setMappedProperties(
{
//do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer)
pNames[nN] = rTarget;
- pValues[nN] = aAny;
+ pValues[nN] = std::move(aAny);
++nN;
}
}
catch( const uno::Exception& )
{
- TOOLS_WARN_EXCEPTION("chart2", "" );
+ TOOLS_WARN_EXCEPTION("chart2", "exception mapping property from " << rSource << " to " << rTarget);
}
}
if (nN == 0)
@@ -279,7 +258,7 @@ uno::Any* PropertyMapper::getValuePointerForLimitedSpace( tAnySequence& rPropVal
, bool bLimitedHeight)
{
return PropertyMapper::getValuePointer( rPropValues, rPropNames
- , bLimitedHeight ? OUString("TextMaximumFrameHeight") : OUString("TextMaximumFrameWidth") );
+ , bLimitedHeight ? u"TextMaximumFrameHeight"_ustr : u"TextMaximumFrameWidth"_ustr );
}
const tPropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties()
@@ -289,7 +268,8 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties
{"CharColor", "CharColor"},
{"CharContoured", "CharContoured"},
{"CharEmphasis", "CharEmphasis"},//the service style::CharacterProperties describes a property called 'CharEmphasize' which is nowhere implemented
-
+ {"CharEscapement", "CharEscapement"},
+ {"CharEscapementHeight", "CharEscapementHeight"},
{"CharFontFamily", "CharFontFamily"},
{"CharFontFamilyAsian", "CharFontFamilyAsian"},
{"CharFontFamilyComplex", "CharFontFamilyComplex"},
@@ -496,110 +476,6 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesPropert
return s_aShapePropertyMapForFilledSeriesProperties;
}
-void PropertyMapper::setPropertyNameMapForFilledSeriesProperties(SdrPathObj* pShape
- , const uno::Reference< beans::XPropertySet >& xSource
- , std::optional<sal_Int32> xFillColor)
-{
- //shape property -- chart model object property
- static tPropertyNameMap s_aShapePropertyMapForFilledSeriesProperties{
- {"FillBackground", "FillBackground"},
- {"FillBitmapName", "FillBitmapName"},
- {"FillColor", "Color"},
- {"FillGradientName", "GradientName"},
- {"FillGradientStepCount", "GradientStepCount"},
- {"FillHatchName", "HatchName"},
- {"FillStyle", "FillStyle"},
- {"FillTransparence", "Transparency"},
- {"FillTransparenceGradientName", "TransparencyGradientName"},
- //bitmap properties
- {"FillBitmapMode", "FillBitmapMode"},
- {"FillBitmapSizeX", "FillBitmapSizeX"},
- {"FillBitmapSizeY", "FillBitmapSizeY"},
- {"FillBitmapLogicalSize", "FillBitmapLogicalSize"},
- {"FillBitmapOffsetX", "FillBitmapOffsetX"},
- {"FillBitmapOffsetY", "FillBitmapOffsetY"},
- {"FillBitmapRectanglePoint", "FillBitmapRectanglePoint"},
- {"FillBitmapPositionOffsetX", "FillBitmapPositionOffsetX"},
- {"FillBitmapPositionOffsetY", "FillBitmapPositionOffsetY"},
- //line properties
- {"LineColor", "BorderColor"},
- {"LineDashName", "BorderDashName"},
- {"LineStyle", "BorderStyle"},
- {"LineTransparence", "BorderTransparency"},
- {"LineWidth", "BorderWidth"},
- {"LineCap", "LineCap"}};
- std::optional<SfxItemSet> xOptionSet;
- for (auto const& elem : s_aShapePropertyMapForFilledSeriesProperties)
- {
- const OUString & rSource = elem.second;
- try
- {
- uno::Any aAny( xSource->getPropertyValue(rSource) );
- //do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer)
- if( !aAny.hasValue() )
- continue;
- if (!xOptionSet)
- xOptionSet.emplace(pShape->GetObjectItemPool());
- if (rSource == "FillBackground")
- xOptionSet->Put(XFillBackgroundItem(aAny.get<bool>()));
- else if (rSource == "Color")
- xOptionSet->Put(XFillColorItem(OUString(), Color(ColorTransparency, aAny.get<sal_Int32>())));
- else if (rSource == "FillStyle")
- xOptionSet->Put(XFillStyleItem(aAny.get<css::drawing::FillStyle>()));
- else if (rSource == "Transparency")
- xOptionSet->Put(XFillTransparenceItem(aAny.get<sal_uInt16>()));
- else if (rSource == "FillBitmapMode")
- {
- drawing::BitmapMode aMode;
- aAny >>= aMode;
- xOptionSet->Put( XFillBmpTileItem( aMode == drawing::BitmapMode_REPEAT ) );
- xOptionSet->Put( XFillBmpStretchItem( aMode == drawing::BitmapMode_STRETCH ) );
- }
- else if (rSource == "FillBitmapSizeX")
- xOptionSet->Put(XFillBmpSizeXItem(aAny.get<sal_Int32>()));
- else if (rSource == "FillBitmapSizeY")
- xOptionSet->Put(XFillBmpSizeYItem(aAny.get<sal_Int32>()));
- else if (rSource == "FillBitmapLogicalSize")
- xOptionSet->Put(XFillBmpSizeLogItem(aAny.get<bool>()));
- else if (rSource == "FillBitmapPositionOffsetX")
- xOptionSet->Put(XFillBmpPosOffsetXItem(aAny.get<sal_Int32>()));
- else if (rSource == "FillBitmapPositionOffsetY")
- xOptionSet->Put(XFillBmpPosOffsetYItem(aAny.get<sal_Int32>()));
- else if (rSource == "FillBitmapRectanglePoint")
- xOptionSet->Put(XFillBmpPosItem(static_cast<RectPoint>(aAny.get<css::drawing::RectanglePoint>())));
- else if (rSource == "FillBitmapOffsetX")
- xOptionSet->Put(XFillBmpTileOffsetXItem(aAny.get<sal_Int32>()));
- else if (rSource == "FillBitmapOffsetY")
- xOptionSet->Put(XFillBmpTileOffsetYItem(aAny.get<sal_Int32>()));
- else if (rSource == "BorderColor")
- xOptionSet->Put(XLineColorItem(OUString(), Color(ColorTransparency, aAny.get<sal_Int32>())));
- else if (rSource == "BorderStyle")
- xOptionSet->Put(XLineStyleItem(aAny.get<css::drawing::LineStyle>()));
- else if (rSource == "BorderTransparency")
- xOptionSet->Put(XLineTransparenceItem(aAny.get<sal_uInt16>()));
- else if (rSource == "BorderWidth")
- xOptionSet->Put(XLineWidthItem(aAny.get<sal_Int32>()));
- else if (rSource == "LineCap")
- xOptionSet->Put(XLineCapItem(aAny.get<css::drawing::LineCap>()));
- else
- SAL_WARN("chart2", "forgot this one " << rSource);
- }
- catch( const uno::Exception& )
- {
- TOOLS_WARN_EXCEPTION("chart2", "" );
- }
- }
- if (xFillColor)
- {
- if (!xOptionSet)
- xOptionSet.emplace(pShape->GetObjectItemPool());
- xOptionSet->Put(XFillColorItem(OUString(), Color(ColorTransparency, *xFillColor)));
- }
- if (xOptionSet)
- pShape->GetProperties().SetObjectItemSet(*xOptionSet);
-
-}
-
void PropertyMapper::setMultiProperties(
const tNameSequence& rNames
, const tAnySequence& rValues
@@ -676,7 +552,7 @@ void PropertyMapper::getPreparedTextShapePropertyLists(
// use a line-joint showing the border of thick lines like two rectangles
// filled in between.
- aValueMap["LineJoint"] <<= drawing::LineJoint_ROUND;
+ aValueMap[u"LineJoint"_ustr] <<= drawing::LineJoint_ROUND;
PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
}
diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx
new file mode 100644
index 000000000000..01a577139da5
--- /dev/null
+++ b/chart2/source/view/main/SeriesPlotterContainer.cxx
@@ -0,0 +1,776 @@
+/* -*- 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 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 .
+ */
+
+#include <sal/config.h>
+
+#include <cstddef>
+
+#include "SeriesPlotterContainer.hxx"
+
+#include <ChartView.hxx>
+#include <Diagram.hxx>
+#include <ChartType.hxx>
+#include <DataSeries.hxx>
+#include <ChartModel.hxx>
+#include <ChartTypeHelper.hxx>
+#include <ObjectIdentifier.hxx>
+#include <DiagramHelper.hxx>
+#include <Axis.hxx>
+#include <AxisIndexDefines.hxx>
+#include <ConfigColorScheme.hxx>
+#include <ChartColorScheme.hxx>
+#include <DataSeriesHelper.hxx>
+#include <ExplicitCategoriesProvider.hxx>
+#include <unonames.hxx>
+
+#include <com/sun/star/chart/ChartAxisPosition.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+
+#include <comphelper/classids.hxx>
+#include <servicenames_charttypes.hxx>
+#include <comphelper/diagnose_ex.hxx>
+
+namespace chart
+{
+using namespace ::css;
+using namespace ::css::chart2;
+
+using ::css::uno::Reference;
+using ::css::uno::Sequence;
+using ::css::uno::Any;
+
+SeriesPlotterContainer::SeriesPlotterContainer(
+ std::vector<std::unique_ptr<VCoordinateSystem>>& rVCooSysList)
+ : m_rVCooSysList(rVCooSysList)
+ , m_nMaxAxisIndex(0)
+ , m_bChartTypeUsesShiftedCategoryPositionPerDefault(false)
+ , m_nDefaultDateNumberFormat(0)
+{
+}
+
+SeriesPlotterContainer::~SeriesPlotterContainer()
+{
+ // - remove plotter from coordinatesystems
+ for (auto& nC : m_rVCooSysList)
+ nC->clearMinimumAndMaximumSupplierList();
+}
+
+std::vector<LegendEntryProvider*> SeriesPlotterContainer::getLegendEntryProviderList()
+{
+ std::vector<LegendEntryProvider*> aRet(m_aSeriesPlotterList.size());
+ sal_Int32 nN = 0;
+ for (const std::unique_ptr<VSeriesPlotter>& aPlotter : m_aSeriesPlotterList)
+ aRet[nN++] = aPlotter.get();
+ return aRet;
+}
+
+VCoordinateSystem* SeriesPlotterContainer::findInCooSysList(
+ const std::vector<std::unique_ptr<VCoordinateSystem>>& rVCooSysList,
+ const rtl::Reference<BaseCoordinateSystem>& xCooSys)
+{
+ for (auto& pVCooSys : rVCooSysList)
+ {
+ if (pVCooSys->getModel() == xCooSys)
+ return pVCooSys.get();
+ }
+ return nullptr;
+}
+
+VCoordinateSystem* SeriesPlotterContainer::getCooSysForPlotter(
+ const std::vector<std::unique_ptr<VCoordinateSystem>>& rVCooSysList,
+ MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier)
+{
+ if (!pMinimumAndMaximumSupplier)
+ return nullptr;
+ for (auto& pVCooSys : rVCooSysList)
+ {
+ if (pVCooSys->hasMinimumAndMaximumSupplier(pMinimumAndMaximumSupplier))
+ return pVCooSys.get();
+ }
+ return nullptr;
+}
+
+VCoordinateSystem* SeriesPlotterContainer::addCooSysToList(
+ std::vector<std::unique_ptr<VCoordinateSystem>>& rVCooSysList,
+ const rtl::Reference<BaseCoordinateSystem>& xCooSys, ChartModel& rChartModel)
+{
+ VCoordinateSystem* pExistingVCooSys
+ = SeriesPlotterContainer::findInCooSysList(rVCooSysList, xCooSys);
+ if (pExistingVCooSys)
+ return pExistingVCooSys;
+
+ std::unique_ptr<VCoordinateSystem> pVCooSys
+ = VCoordinateSystem::createCoordinateSystem(xCooSys);
+ if (!pVCooSys)
+ return nullptr;
+
+ OUString aCooSysParticle(
+ ObjectIdentifier::createParticleForCoordinateSystem(xCooSys, &rChartModel));
+ pVCooSys->setParticle(aCooSysParticle);
+
+ rVCooSysList.push_back(std::move(pVCooSys));
+ return rVCooSysList.back().get();
+}
+
+void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChartModel)
+{
+ rtl::Reference<Diagram> xDiagram = rChartModel.getFirstChartDiagram();
+ if (!xDiagram.is())
+ return;
+
+ uno::Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(&rChartModel);
+ if (rChartModel.hasInternalDataProvider() && xDiagram->isSupportingDateAxis())
+ m_nDefaultDateNumberFormat = DiagramHelper::getDateNumberFormat(xNumberFormatsSupplier);
+
+ sal_Int32 nDimensionCount = xDiagram->getDimension();
+ if (!nDimensionCount)
+ {
+ //@todo handle mixed dimension
+ nDimensionCount = 2;
+ }
+
+ bool bSortByXValues = false;
+ bool bConnectBars = false;
+ bool bGroupBarsPerAxis = true;
+ bool bIncludeHiddenCells = true;
+ bool bSecondaryYaxisVisible = true;
+ sal_Int32 nStartingAngle = 90;
+ sal_Int32 n3DRelativeHeight = 100;
+ PieChartSubType ePieChartSubType = PieChartSubType_NONE;
+ double nSplitPos = 2;
+ try
+ {
+ xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= bSortByXValues;
+ xDiagram->getPropertyValue(u"ConnectBars"_ustr) >>= bConnectBars;
+ xDiagram->getPropertyValue(u"GroupBarsPerAxis"_ustr) >>= bGroupBarsPerAxis;
+ xDiagram->getPropertyValue(u"IncludeHiddenCells"_ustr) >>= bIncludeHiddenCells;
+ xDiagram->getPropertyValue(u"StartingAngle"_ustr) >>= nStartingAngle;
+
+ if (nDimensionCount == 3)
+ {
+ xDiagram->getPropertyValue(u"3DRelativeHeight"_ustr) >>= n3DRelativeHeight;
+ }
+ xDiagram->getPropertyValue(u"SubPieType"_ustr) >>= ePieChartSubType;
+
+ xDiagram->getPropertyValue(u"SplitPos"_ustr) >>= nSplitPos;
+ }
+ catch (const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ if (xDiagram->getDataTable().is())
+ m_bTableShiftPosition = true;
+
+ //prepare for autoscaling and shape creation
+ // - create plotter for charttypes (for each first scale group at each plotter, as they are independent)
+ // - add series to plotter (thus each charttype can provide minimum and maximum values for autoscaling)
+ // - add plotter to coordinate systems
+
+ //iterate through all coordinate systems
+ uno::Reference<XColorScheme> xColorScheme;
+ if (!rChartModel.usesColorPalette())
+ xColorScheme = xDiagram->getDefaultColorScheme();
+ else
+ xColorScheme = new ChartColorScheme(*rChartModel.getCurrentColorPalette());
+ auto aCooSysList = xDiagram->getBaseCoordinateSystems();
+ sal_Int32 nGlobalSeriesIndex = 0; //for automatic symbols
+ for (std::size_t nCS = 0; nCS < aCooSysList.size(); ++nCS)
+ {
+ const rtl::Reference<BaseCoordinateSystem>& xCooSys(aCooSysList[nCS]);
+ VCoordinateSystem* pVCooSys
+ = SeriesPlotterContainer::addCooSysToList(m_rVCooSysList, xCooSys, rChartModel);
+ // Let's check whether the secondary Y axis is visible
+ try
+ {
+ if (xCooSys->getMaximumAxisIndexByDimension(1) > 0)
+ {
+ rtl::Reference<Axis> xAxisProp = xCooSys->getAxisByDimension2(1, 1);
+ xAxisProp->getPropertyValue(u"Show"_ustr) >>= bSecondaryYaxisVisible;
+ }
+ }
+ catch (const lang::IndexOutOfBoundsException&)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "");
+ }
+ //iterate through all chart types in the current coordinate system
+ std::vector<rtl::Reference<ChartType>> aChartTypeList(xCooSys->getChartTypes2());
+ for (std::size_t nT = 0; nT < aChartTypeList.size(); ++nT)
+ {
+ const rtl::Reference<ChartType>& xChartType(aChartTypeList[nT]);
+ if (nDimensionCount == 3
+ && xChartType->getChartType().equalsIgnoreAsciiCase(
+ CHART2_SERVICE_NAME_CHARTTYPE_PIE))
+ {
+ try
+ {
+ sal_Int32 n3DRelativeHeightOldValue(100);
+ uno::Any aAny = xChartType->getFastPropertyValue(
+ PROP_PIECHARTTYPE_3DRELATIVEHEIGHT); // "3DRelativeHeight"
+ aAny >>= n3DRelativeHeightOldValue;
+ if (n3DRelativeHeightOldValue != n3DRelativeHeight)
+ xChartType->setFastPropertyValue(
+ PROP_PIECHARTTYPE_3DRELATIVEHEIGHT, // "3DRelativeHeight"
+ uno::Any(n3DRelativeHeight));
+ }
+ catch (const uno::Exception&)
+ {
+ }
+ }
+
+ if (ePieChartSubType != PieChartSubType_NONE)
+ {
+ xChartType->setFastPropertyValue(PROP_PIECHARTTYPE_SUBTYPE,
+ uno::Any(ePieChartSubType));
+ // Reset the diagram-level property so it's not persistent.
+ xDiagram->setPropertyValue(u"SubPieType"_ustr, uno::Any(PieChartSubType_NONE));
+
+ xChartType->setFastPropertyValue(PROP_PIECHARTTYPE_SPLIT_POS, uno::Any(nSplitPos));
+ //xDiagram->setPropertyValue(u"SplitPos"_ustr, uno::Any(nSplitPos));
+ }
+
+ if (nT == 0)
+ m_bChartTypeUsesShiftedCategoryPositionPerDefault
+ = ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault(xChartType);
+
+ bool bExcludingPositioning
+ = xDiagram->getDiagramPositioningMode() == DiagramPositioningMode::Excluding;
+ VSeriesPlotter* pPlotter = VSeriesPlotter::createSeriesPlotter(
+ xChartType, nDimensionCount, bExcludingPositioning);
+ if (!pPlotter)
+ continue;
+
+ m_aSeriesPlotterList.push_back(std::unique_ptr<VSeriesPlotter>(pPlotter));
+ pPlotter->setNumberFormatsSupplier(xNumberFormatsSupplier);
+ pPlotter->setColorScheme(xColorScheme);
+ if (pVCooSys)
+ pPlotter->setExplicitCategoriesProvider(
+ &xCooSys->getExplicitCategoriesProvider(rChartModel));
+ sal_Int32 nMissingValueTreatment
+ = xDiagram->getCorrectedMissingValueTreatment(xChartType);
+
+ if (pVCooSys)
+ pVCooSys->addMinimumAndMaximumSupplier(pPlotter);
+
+ sal_Int32 zSlot = -1;
+ sal_Int32 xSlot = -1;
+ sal_Int32 ySlot = -1;
+ const std::vector<rtl::Reference<DataSeries>>& aSeriesList
+ = xChartType->getDataSeries2();
+ for (std::size_t nS = 0; nS < aSeriesList.size(); ++nS)
+ {
+ rtl::Reference<DataSeries> const& xDataSeries = aSeriesList[nS];
+ if (!bIncludeHiddenCells && !xDataSeries->hasUnhiddenData())
+ continue;
+
+ std::unique_ptr<VDataSeries> pSeries(new VDataSeries(xDataSeries));
+
+ pSeries->setGlobalSeriesIndex(nGlobalSeriesIndex);
+ nGlobalSeriesIndex++;
+
+ if (bSortByXValues)
+ pSeries->doSortByXValues();
+
+ pSeries->setConnectBars(bConnectBars);
+ pSeries->setGroupBarsPerAxis(bGroupBarsPerAxis);
+ pSeries->setStartingAngle(nStartingAngle);
+
+ pSeries->setMissingValueTreatment(nMissingValueTreatment);
+
+ OUString aSeriesParticle(ObjectIdentifier::createParticleForSeries(0, nCS, nT, nS));
+ pSeries->setParticle(aSeriesParticle);
+
+ OUString aRole(ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection(
+ xChartType));
+ pSeries->setRoleOfSequenceForDataLabelNumberFormatDetection(aRole);
+
+ //ignore secondary axis for charttypes that do not support them
+ if (pSeries->getAttachedAxisIndex() != MAIN_AXIS_INDEX
+ && (!(xChartType.is() ? xChartType->isSupportingSecondaryAxis(nDimensionCount)
+ : true)
+ || !bSecondaryYaxisVisible))
+ {
+ pSeries->setAttachedAxisIndex(MAIN_AXIS_INDEX);
+ }
+
+ StackingDirection eDirection = pSeries->getStackingDirection();
+ switch (eDirection)
+ {
+ case StackingDirection_NO_STACKING:
+ xSlot++;
+ ySlot = -1;
+ if (zSlot < 0)
+ zSlot = 0;
+ break;
+ case StackingDirection_Y_STACKING:
+ ySlot++;
+ if (xSlot < 0)
+ xSlot = 0;
+ if (zSlot < 0)
+ zSlot = 0;
+ break;
+ case StackingDirection_Z_STACKING:
+ zSlot++;
+ xSlot = -1;
+ ySlot = -1;
+ break;
+ default:
+ // UNO enums have one additional auto-generated case
+ break;
+ }
+ pPlotter->addSeries(std::move(pSeries), zSlot, xSlot, ySlot);
+ }
+ }
+ }
+
+ auto order
+ = [](const std::unique_ptr<VSeriesPlotter>& a, const std::unique_ptr<VSeriesPlotter>& b) {
+ return a->getRenderOrder() < b->getRenderOrder();
+ };
+
+ std::stable_sort(m_aSeriesPlotterList.begin(), m_aSeriesPlotterList.end(), order);
+
+ //transport seriesnames to the coordinatesystems if needed
+ if (m_aSeriesPlotterList.empty())
+ return;
+
+ uno::Sequence<OUString> aSeriesNames;
+ bool bSeriesNamesInitialized = false;
+ for (auto& pVCooSys : m_rVCooSysList)
+ {
+ if (pVCooSys->needSeriesNamesForAxis())
+ {
+ if (!bSeriesNamesInitialized)
+ {
+ aSeriesNames = m_aSeriesPlotterList[0]->getSeriesNames();
+ bSeriesNamesInitialized = true;
+ }
+ pVCooSys->setSeriesNamesForAxis(aSeriesNames);
+ }
+ }
+}
+
+bool SeriesPlotterContainer::isCategoryPositionShifted(const chart2::ScaleData& rSourceScale,
+ bool bHasComplexCategories)
+{
+ if (rSourceScale.AxisType == AxisType::CATEGORY)
+ return bHasComplexCategories || rSourceScale.ShiftedCategoryPosition
+ || m_bTableShiftPosition || m_bChartTypeUsesShiftedCategoryPositionPerDefault;
+
+ if (rSourceScale.AxisType == AxisType::DATE)
+ return rSourceScale.ShiftedCategoryPosition;
+
+ return rSourceScale.AxisType == AxisType::SERIES;
+}
+
+void SeriesPlotterContainer::initAxisUsageList(const Date& rNullDate, ChartModel& rChartModel)
+{
+ m_aAxisUsageList.clear();
+
+ // Loop through coordinate systems in the diagram (though for now
+ // there should only be one coordinate system per diagram).
+ for (auto& pVCooSys : m_rVCooSysList)
+ {
+ rtl::Reference<BaseCoordinateSystem> xCooSys = pVCooSys->getModel();
+ sal_Int32 nDimCount = xCooSys->getDimension();
+ auto xChartType = AxisHelper::getChartTypeByIndex(xCooSys, 0);
+ bool bComplexCategoryAllowed
+ = xChartType.is() ? xChartType->isSupportingComplexCategory() : true;
+
+ for (sal_Int32 nDimIndex = 0; nDimIndex < nDimCount; ++nDimIndex)
+ {
+ bool bDateAxisAllowed
+ = xChartType.is() ? xChartType->isSupportingDateAxis(nDimIndex) : true;
+
+ // Each dimension may have primary and secondary axes.
+ const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimIndex);
+ for (sal_Int32 nAxisIndex = 0; nAxisIndex <= nMaxAxisIndex; ++nAxisIndex)
+ {
+ rtl::Reference<Axis> xAxis = xCooSys->getAxisByDimension2(nDimIndex, nAxisIndex);
+
+ if (!xAxis.is())
+ continue;
+
+ if (m_aAxisUsageList.find(xAxis) == m_aAxisUsageList.end())
+ {
+ // Create axis usage object for this axis.
+
+ chart2::ScaleData aSourceScale = xAxis->getScaleData();
+ ExplicitCategoriesProvider& rCatProvider
+ = xCooSys->getExplicitCategoriesProvider(rChartModel);
+ if (nDimIndex == 0)
+ AxisHelper::checkDateAxis(aSourceScale, &rCatProvider, bDateAxisAllowed);
+
+ bool bHasComplexCat
+ = rCatProvider.hasComplexCategories() && bComplexCategoryAllowed;
+ aSourceScale.ShiftedCategoryPosition
+ = isCategoryPositionShifted(aSourceScale, bHasComplexCat);
+
+ m_aAxisUsageList[xAxis].aAutoScaling = ScaleAutomatism(aSourceScale, rNullDate);
+ }
+
+ AxisUsage& rAxisUsage = m_aAxisUsageList[xAxis];
+ rAxisUsage.addCoordinateSystem(pVCooSys.get(), nDimIndex, nAxisIndex);
+ }
+ }
+ }
+
+ // Determine the highest axis index of all dimensions.
+ m_nMaxAxisIndex = 0;
+ for (const auto& pVCooSys : m_rVCooSysList)
+ {
+ rtl::Reference<BaseCoordinateSystem> xCooSys = pVCooSys->getModel();
+ sal_Int32 nDimCount = xCooSys->getDimension();
+
+ for (sal_Int32 nDimIndex = 0; nDimIndex < nDimCount; ++nDimIndex)
+ {
+ for (auto& axisUsage : m_aAxisUsageList)
+ {
+ sal_Int32 nLocalMax = axisUsage.second.getMaxAxisIndexForDimension(nDimIndex);
+ if (m_nMaxAxisIndex < nLocalMax)
+ m_nMaxAxisIndex = nLocalMax;
+ }
+ }
+ }
+}
+
+void SeriesPlotterContainer::setScalesFromCooSysToPlotter()
+{
+ //set scales to plotter to enable them to provide the preferred scene AspectRatio
+ for (const std::unique_ptr<VSeriesPlotter>& aPlotter : m_aSeriesPlotterList)
+ {
+ VSeriesPlotter* pSeriesPlotter = aPlotter.get();
+ VCoordinateSystem* pVCooSys
+ = SeriesPlotterContainer::getCooSysForPlotter(m_rVCooSysList, pSeriesPlotter);
+ if (pVCooSys)
+ {
+ pSeriesPlotter->setScales(pVCooSys->getExplicitScales(0, 0),
+ pVCooSys->getPropertySwapXAndYAxis());
+ sal_Int32 nMaxAxisIndex = pVCooSys->getMaximumAxisIndexByDimension(
+ 1); //only additional value axis are relevant for series plotter
+ for (sal_Int32 nI = 1; nI <= nMaxAxisIndex; nI++)
+ pSeriesPlotter->addSecondaryValueScale(pVCooSys->getExplicitScale(1, nI), nI);
+ }
+ }
+}
+
+void SeriesPlotterContainer::setNumberFormatsFromAxes()
+{
+ //set numberformats to plotter to enable them to display the data labels in the numberformat of the axis
+ for (const std::unique_ptr<VSeriesPlotter>& aPlotter : m_aSeriesPlotterList)
+ {
+ VSeriesPlotter* pSeriesPlotter = aPlotter.get();
+ VCoordinateSystem* pVCooSys
+ = SeriesPlotterContainer::getCooSysForPlotter(m_rVCooSysList, pSeriesPlotter);
+ if (pVCooSys)
+ {
+ AxesNumberFormats aAxesNumberFormats;
+ const rtl::Reference<BaseCoordinateSystem>& xCooSys = pVCooSys->getModel();
+ sal_Int32 nDimensionCount = xCooSys->getDimension();
+ for (sal_Int32 nDimensionIndex = 0; nDimensionIndex < nDimensionCount;
+ ++nDimensionIndex)
+ {
+ const sal_Int32 nMaximumAxisIndex
+ = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
+ for (sal_Int32 nAxisIndex = 0; nAxisIndex <= nMaximumAxisIndex; ++nAxisIndex)
+ {
+ try
+ {
+ rtl::Reference<Axis> xAxisProp
+ = xCooSys->getAxisByDimension2(nDimensionIndex, nAxisIndex);
+ if (xAxisProp.is())
+ {
+ sal_Int32 nNumberFormatKey(0);
+ if (xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT)
+ >>= nNumberFormatKey)
+ {
+ aAxesNumberFormats.setFormat(nNumberFormatKey, nDimensionIndex,
+ nAxisIndex);
+ }
+ else if (nDimensionIndex == 0)
+ {
+ //provide a default date format for date axis with own data
+ aAxesNumberFormats.setFormat(m_nDefaultDateNumberFormat,
+ nDimensionIndex, nAxisIndex);
+ }
+ }
+ }
+ catch (const lang::IndexOutOfBoundsException&)
+ {
+ TOOLS_WARN_EXCEPTION("chart2", "");
+ }
+ }
+ }
+ }
+ }
+}
+
+void SeriesPlotterContainer::updateScalesAndIncrementsOnAxes()
+{
+ for (auto& nC : m_rVCooSysList)
+ nC->updateScalesAndIncrementsOnAxes();
+}
+
+void SeriesPlotterContainer::doAutoScaling(ChartModel& rChartModel)
+{
+ if (m_aSeriesPlotterList.empty() || m_aAxisUsageList.empty())
+ // We need these two containers populated to do auto-scaling. Bail out.
+ return;
+
+ //iterate over the main scales first than secondary axis
+ for (sal_Int32 nAxisIndex = 0; nAxisIndex <= m_nMaxAxisIndex; ++nAxisIndex)
+ {
+ // - first do autoscale for all x and z scales (because they are treated independent)
+ for (auto & [ rAxis, rAxisUsage ] : m_aAxisUsageList)
+ {
+ (void)rAxis;
+ rAxisUsage.prepareAutomaticAxisScaling(rAxisUsage.aAutoScaling, 0, nAxisIndex);
+ rAxisUsage.prepareAutomaticAxisScaling(rAxisUsage.aAutoScaling, 2, nAxisIndex);
+
+ ExplicitScaleData aExplicitScale;
+ ExplicitIncrementData aExplicitIncrement;
+ rAxisUsage.aAutoScaling.calculateExplicitScaleAndIncrement(aExplicitScale,
+ aExplicitIncrement);
+
+ rAxisUsage.setExplicitScaleAndIncrement(0, nAxisIndex, aExplicitScale,
+ aExplicitIncrement);
+ rAxisUsage.setExplicitScaleAndIncrement(2, nAxisIndex, aExplicitScale,
+ aExplicitIncrement);
+ }
+
+ // - second do autoscale for the dependent y scales (the coordinate systems are prepared with x and z scales already )
+ for (auto & [ rAxis, rAxisUsage ] : m_aAxisUsageList)
+ {
+ (void)rAxis;
+ rAxisUsage.prepareAutomaticAxisScaling(rAxisUsage.aAutoScaling, 1, nAxisIndex);
+
+ ExplicitScaleData aExplicitScale;
+ ExplicitIncrementData aExplicitIncrement;
+ rAxisUsage.aAutoScaling.calculateExplicitScaleAndIncrement(aExplicitScale,
+ aExplicitIncrement);
+
+ rAxisUsage.setExplicitScaleAndIncrement(0, nAxisIndex, aExplicitScale,
+ aExplicitIncrement);
+ rAxisUsage.setExplicitScaleAndIncrement(1, nAxisIndex, aExplicitScale,
+ aExplicitIncrement);
+ rAxisUsage.setExplicitScaleAndIncrement(2, nAxisIndex, aExplicitScale,
+ aExplicitIncrement);
+ }
+ }
+ AdaptScaleOfYAxisWithoutAttachedSeries(rChartModel);
+}
+
+void SeriesPlotterContainer::AdaptScaleOfYAxisWithoutAttachedSeries(ChartModel& rModel)
+{
+ //issue #i80518#
+ for (sal_Int32 nAxisIndex = 0; nAxisIndex <= m_nMaxAxisIndex; nAxisIndex++)
+ {
+ for (auto & [ rAxis, rAxisUsage ] : m_aAxisUsageList)
+ {
+ (void)rAxis;
+ std::vector<VCoordinateSystem*> aVCooSysList_Y
+ = rAxisUsage.getCoordinateSystems(1, nAxisIndex);
+ if (aVCooSysList_Y.empty())
+ continue;
+
+ rtl::Reference<Diagram> xDiagram(rModel.getFirstChartDiagram());
+ if (!xDiagram.is())
+ continue;
+
+ bool bSeriesAttachedToThisAxis = false;
+ sal_Int32 nAttachedAxisIndex = -1;
+ {
+ std::vector<rtl::Reference<DataSeries>> aSeriesVector = xDiagram->getDataSeries();
+ for (auto const& series : aSeriesVector)
+ {
+ sal_Int32 nCurrentIndex = series->getAttachedAxisIndex();
+ if (nAxisIndex == nCurrentIndex)
+ {
+ bSeriesAttachedToThisAxis = true;
+ break;
+ }
+ else if (nAttachedAxisIndex < 0 || nAttachedAxisIndex > nCurrentIndex)
+ nAttachedAxisIndex = nCurrentIndex;
+ }
+ }
+
+ if (bSeriesAttachedToThisAxis || nAttachedAxisIndex < 0)
+ continue;
+
+ for (VCoordinateSystem* nC : aVCooSysList_Y)
+ {
+ nC->prepareAutomaticAxisScaling(rAxisUsage.aAutoScaling, 1, nAttachedAxisIndex);
+
+ ExplicitScaleData aExplicitScaleSource
+ = nC->getExplicitScale(1, nAttachedAxisIndex);
+ ExplicitIncrementData aExplicitIncrementSource
+ = nC->getExplicitIncrement(1, nAttachedAxisIndex);
+
+ ExplicitScaleData aExplicitScaleDest = nC->getExplicitScale(1, nAxisIndex);
+ ExplicitIncrementData aExplicitIncrementDest
+ = nC->getExplicitIncrement(1, nAxisIndex);
+
+ aExplicitScaleDest.Orientation = aExplicitScaleSource.Orientation;
+ aExplicitScaleDest.Scaling = aExplicitScaleSource.Scaling;
+ aExplicitScaleDest.AxisType = aExplicitScaleSource.AxisType;
+
+ aExplicitIncrementDest.BaseValue = aExplicitIncrementSource.BaseValue;
+
+ ScaleData aScale(rAxisUsage.aAutoScaling.getScale());
+ if (!aScale.Minimum.hasValue())
+ {
+ bool bNewMinOK = true;
+ double fMax = 0.0;
+ if (aScale.Maximum >>= fMax)
+ bNewMinOK = (aExplicitScaleSource.Minimum <= fMax);
+ if (bNewMinOK)
+ aExplicitScaleDest.Minimum = aExplicitScaleSource.Minimum;
+ }
+ else
+ aExplicitIncrementDest.BaseValue = aExplicitScaleDest.Minimum;
+
+ if (!aScale.Maximum.hasValue())
+ {
+ bool bNewMaxOK = true;
+ double fMin = 0.0;
+ if (aScale.Minimum >>= fMin)
+ bNewMaxOK = (fMin <= aExplicitScaleSource.Maximum);
+ if (bNewMaxOK)
+ aExplicitScaleDest.Maximum = aExplicitScaleSource.Maximum;
+ }
+ if (!aScale.Origin.hasValue())
+ aExplicitScaleDest.Origin = aExplicitScaleSource.Origin;
+
+ if (!aScale.IncrementData.Distance.hasValue())
+ aExplicitIncrementDest.Distance = aExplicitIncrementSource.Distance;
+
+ bool bAutoMinorInterval = true;
+ if (aScale.IncrementData.SubIncrements.hasElements())
+ bAutoMinorInterval
+ = !(aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue());
+ if (bAutoMinorInterval)
+ {
+ if (!aExplicitIncrementDest.SubIncrements.empty()
+ && !aExplicitIncrementSource.SubIncrements.empty())
+ aExplicitIncrementDest.SubIncrements[0].IntervalCount
+ = aExplicitIncrementSource.SubIncrements[0].IntervalCount;
+ }
+
+ nC->setExplicitScaleAndIncrement(1, nAxisIndex, aExplicitScaleDest,
+ aExplicitIncrementDest);
+ }
+ }
+ }
+
+ if (!AxisHelper::isAxisPositioningEnabled())
+ return;
+
+ //correct origin for y main axis (the origin is where the other main axis crosses)
+ sal_Int32 nAxisIndex = 0;
+ sal_Int32 nDimensionIndex = 1;
+ for (auto & [ rAxis, rAxisUsage ] : m_aAxisUsageList)
+ {
+ (void)rAxis;
+ std::vector<VCoordinateSystem*> aVCooSysList
+ = rAxisUsage.getCoordinateSystems(nDimensionIndex, nAxisIndex);
+ size_t nC;
+ for (nC = 0; nC < aVCooSysList.size(); nC++)
+ {
+ ExplicitScaleData aExplicitScale(
+ aVCooSysList[nC]->getExplicitScale(nDimensionIndex, nAxisIndex));
+ ExplicitIncrementData aExplicitIncrement(
+ aVCooSysList[nC]->getExplicitIncrement(nDimensionIndex, nAxisIndex));
+
+ rtl::Reference<BaseCoordinateSystem> xCooSys(aVCooSysList[nC]->getModel());
+ rtl::Reference<Axis> xAxis = xCooSys->getAxisByDimension2(nDimensionIndex, nAxisIndex);
+ rtl::Reference<Axis> xCrossingMainAxis
+ = AxisHelper::getCrossingMainAxis(xAxis, xCooSys);
+
+ if (xCrossingMainAxis.is())
+ {
+ css::chart::ChartAxisPosition eCrossingMainAxisPos(
+ css::chart::ChartAxisPosition_ZERO);
+ xCrossingMainAxis->getPropertyValue(u"CrossoverPosition"_ustr)
+ >>= eCrossingMainAxisPos;
+ if (eCrossingMainAxisPos == css::chart::ChartAxisPosition_VALUE)
+ {
+ double fValue = 0.0;
+ xCrossingMainAxis->getPropertyValue(u"CrossoverValue"_ustr) >>= fValue;
+ aExplicitScale.Origin = fValue;
+ }
+ else if (eCrossingMainAxisPos == css::chart::ChartAxisPosition_ZERO)
+ aExplicitScale.Origin = 0.0;
+ else if (eCrossingMainAxisPos == css::chart::ChartAxisPosition_START)
+ aExplicitScale.Origin = aExplicitScale.Minimum;
+ else if (eCrossingMainAxisPos == css::chart::ChartAxisPosition_END)
+ aExplicitScale.Origin = aExplicitScale.Maximum;
+ }
+
+ aVCooSysList[nC]->setExplicitScaleAndIncrement(nDimensionIndex, nAxisIndex,
+ aExplicitScale, aExplicitIncrement);
+ }
+ }
+}
+
+drawing::Direction3D SeriesPlotterContainer::getPreferredAspectRatio()
+{
+ drawing::Direction3D aPreferredAspectRatio(1.0, 1.0, 1.0);
+
+ //get a list of all preferred aspect ratios and combine them
+ //first with special demands wins (less or equal zero <-> arbitrary)
+ double fx, fy, fz;
+ fx = fy = fz = -1.0;
+ for (const std::unique_ptr<VSeriesPlotter>& aPlotter : m_aSeriesPlotterList)
+ {
+ drawing::Direction3D aSingleRatio(aPlotter->getPreferredDiagramAspectRatio());
+ if (fx < 0 && aSingleRatio.DirectionX > 0)
+ fx = aSingleRatio.DirectionX;
+
+ if (fy < 0 && aSingleRatio.DirectionY > 0)
+ {
+ if (fx > 0 && aSingleRatio.DirectionX > 0)
+ fy = fx * aSingleRatio.DirectionY / aSingleRatio.DirectionX;
+ else if (fz > 0 && aSingleRatio.DirectionZ > 0)
+ fy = fz * aSingleRatio.DirectionY / aSingleRatio.DirectionZ;
+ else
+ fy = aSingleRatio.DirectionY;
+ }
+
+ if (fz < 0 && aSingleRatio.DirectionZ > 0)
+ {
+ if (fx > 0 && aSingleRatio.DirectionX > 0)
+ fz = fx * aSingleRatio.DirectionZ / aSingleRatio.DirectionX;
+ else if (fy > 0 && aSingleRatio.DirectionY > 0)
+ fz = fy * aSingleRatio.DirectionZ / aSingleRatio.DirectionY;
+ else
+ fz = aSingleRatio.DirectionZ;
+ }
+
+ if (fx > 0 && fy > 0 && fz > 0)
+ break;
+ }
+ aPreferredAspectRatio = drawing::Direction3D(fx, fy, fz);
+ return aPreferredAspectRatio;
+}
+
+} //end chart2 namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/SeriesPlotterContainer.hxx b/chart2/source/view/main/SeriesPlotterContainer.hxx
new file mode 100644
index 000000000000..485d4210d646
--- /dev/null
+++ b/chart2/source/view/main/SeriesPlotterContainer.hxx
@@ -0,0 +1,160 @@
+/* -*- 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 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 .
+ */
+
+#include <config_feature_desktop.h>
+#include <VSeriesPlotter.hxx>
+#include <BaseCoordinateSystem.hxx>
+#include "AxisUsage.hxx"
+
+namespace chart
+{
+/** This class is a container of `SeriesPlotter` objects (such as `PieChart`
+ * instances). It is used for initializing coordinate systems, axes and scales
+ * of all series plotters which belongs to the container.
+ */
+class SeriesPlotterContainer
+{
+public:
+ explicit SeriesPlotterContainer(std::vector<std::unique_ptr<VCoordinateSystem>>& rVCooSysList);
+ ~SeriesPlotterContainer();
+
+ /** It is used to set coordinate systems (`m_rVCooSysList`), this method
+ * is invoked by `ChartView::createShapes2D` before of
+ * `ChartView::impl_createDiagramAndContent`.
+ * Coordinate systems are retrieved through the `XCoordinateSystemContainer`
+ * interface implemented by a diagram object which is provided by the
+ * `ChartModel` object passed to the method (`rChartModel.getFirstDiagram()`).
+ *
+ * It is used for creating series plotters and appending them
+ * to `m_aSeriesPlotterList`. The created series plotters are initialized
+ * through data (number formats supplier, color scheme, data series),
+ * extracted from the chart model or the diagram objects. An exception is
+ * the explicit category provider that is retrieved through the
+ * `VCoordinateSystem` object used by the series plotter.
+ *
+ * It sets the minimum-maximum supplier for a coordinate system:
+ * this supplier is the series plotter itself which utilizes the given
+ * coordinate system. In fact `VSeriesPlotter` has `MinimumMaximumSupplier`
+ * as one of its base classes.
+ * Hence, for instance, a `PieChart`, which is a series plotter, is
+ * a `MinimumMaximumSupplier`, too.
+ */
+ void initializeCooSysAndSeriesPlotter(ChartModel& rModel);
+
+ /** This method is invoked by `ChartView::impl_createDiagramAndContent`.
+ * It iterates on every axis of every coordinate systems, and if the axis
+ * is not yet present in `m_aAxisUsageList` it creates a new `AxisUsage`
+ * object and initialize its `aAutoScaling` member to the `ScaleData`
+ * object of the current axis.
+ */
+ void initAxisUsageList(const Date& rNullDate, ChartModel& rChartModel);
+
+ /**
+ * Perform automatic axis scaling and determine the amount and spacing of
+ * increments. It assumes that the caller has determined the size of the
+ * largest axis label text object prior to calling this method.
+ *
+ * The new axis scaling data will be stored in the VCoordinateSystem
+ * objects. The label alignment direction for each axis will also get
+ * determined during this process, and stored in VAxis.
+ *
+ * This method is invoked by `ChartView::impl_createDiagramAndContent`
+ * soon after `initAxisUsageList`.
+ * It initializes explicit scale and increment objects for all coordinate
+ * systems in `m_rVCooSysList`.
+ * This action is achieved by iterating on the `m_aAxisUsageList` container,
+ * and performing 3 steps:
+ * 1- call `VCoordinateSystem::prepareAutomaticAxisScaling` for setting
+ * scaling parameters of the `aAutoScaling` member (a `ScaleAutomatism`
+ * object) for the current `AxisUsage` instance
+ * (see `VCoordinateSystem::prepareAutomaticAxisScaling`);
+ * 2- calculate the explicit scale and increment objects
+ * (see ScaleAutomatism::calculateExplicitScaleAndIncrement);
+ * 3- set the explicit scale and increment objects for each coordinate
+ * system.
+ */
+ void doAutoScaling(ChartModel& rModel);
+
+ /**
+ * After auto-scaling is performed, call this method to set the explicit
+ * scaling and increment data to all relevant VAxis objects.
+ */
+ void updateScalesAndIncrementsOnAxes();
+
+ /**
+ * After auto-scaling is performed, call this method to set the explicit
+ * scaling data to all the plotters.
+ */
+ void setScalesFromCooSysToPlotter();
+
+ void setNumberFormatsFromAxes();
+ css::drawing::Direction3D getPreferredAspectRatio();
+
+ std::vector<std::unique_ptr<VSeriesPlotter>>& getSeriesPlotterList()
+ {
+ return m_aSeriesPlotterList;
+ }
+ std::vector<std::unique_ptr<VCoordinateSystem>>& getCooSysList() { return m_rVCooSysList; }
+ std::vector<LegendEntryProvider*> getLegendEntryProviderList();
+
+ void AdaptScaleOfYAxisWithoutAttachedSeries(ChartModel& rModel);
+
+ bool isCategoryPositionShifted(const css::chart2::ScaleData& rSourceScale,
+ bool bHasComplexCategories);
+
+ static VCoordinateSystem*
+ getCooSysForPlotter(const std::vector<std::unique_ptr<VCoordinateSystem>>& rVCooSysList,
+ MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier);
+ static VCoordinateSystem*
+ addCooSysToList(std::vector<std::unique_ptr<VCoordinateSystem>>& rVCooSysList,
+ const rtl::Reference<BaseCoordinateSystem>& xCooSys, ChartModel& rChartModel);
+ static VCoordinateSystem*
+ findInCooSysList(const std::vector<std::unique_ptr<VCoordinateSystem>>& rVCooSysList,
+ const rtl::Reference<BaseCoordinateSystem>& xCooSys);
+
+private:
+ /** A vector of series plotters.
+ */
+ std::vector<std::unique_ptr<VSeriesPlotter>> m_aSeriesPlotterList;
+
+ /** A vector of coordinate systems.
+ */
+ std::vector<std::unique_ptr<VCoordinateSystem>>& m_rVCooSysList;
+
+ /** A map whose key is a `XAxis` interface and the related value is
+ * an object of `AxisUsage` type.
+ */
+ std::map<rtl::Reference<Axis>, AxisUsage> m_aAxisUsageList;
+
+ /**
+ * Max axis index of all dimensions. Currently this can be either 0 or 1
+ * since we only support primary and secondary axes per dimension. The
+ * value of 0 means all dimensions have only primary axis, while 1 means
+ * at least one dimension has a secondary axis.
+ */
+ sal_Int32 m_nMaxAxisIndex;
+
+ bool m_bChartTypeUsesShiftedCategoryPositionPerDefault;
+ bool m_bTableShiftPosition = false;
+ sal_Int32 m_nDefaultDateNumberFormat;
+};
+
+} //end chart2 namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index c44988d58774..c788a85c6edd 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -41,7 +41,6 @@
#include <com/sun/star/drawing/XShapes2.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Any.hxx>
@@ -53,12 +52,15 @@
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdopath.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/helpers.hxx>
#include <tools/UnitConversion.hxx>
#include <sal/log.hxx>
#include <algorithm>
+#include <cmath>
+#include <cstddef>
+#include <numbers>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -85,7 +87,7 @@ css::drawing::PolyPolygonShape3D toPolyPolygonShape3D(const std::vector<std::vec
aUnoPoly.SequenceX.realloc(rPoints.size());
aUnoPoly.SequenceY.realloc(rPoints.size());
aUnoPoly.SequenceZ.realloc(rPoints.size());
- for (sal_Int32 nPolygonIndex=0; nPolygonIndex<static_cast<sal_Int32>(rPoints.size()); ++nPolygonIndex)
+ for (std::size_t nPolygonIndex=0; nPolygonIndex<rPoints.size(); ++nPolygonIndex)
{
drawing::DoubleSequence* pOuterSequenceX = &aUnoPoly.SequenceX.getArray()[nPolygonIndex];
drawing::DoubleSequence* pOuterSequenceY = &aUnoPoly.SequenceY.getArray()[nPolygonIndex];
@@ -96,7 +98,7 @@ css::drawing::PolyPolygonShape3D toPolyPolygonShape3D(const std::vector<std::vec
double* pInnerSequenceX = pOuterSequenceX->getArray();
double* pInnerSequenceY = pOuterSequenceY->getArray();
double* pInnerSequenceZ = pOuterSequenceZ->getArray();
- for (sal_Int32 nPointIndex=0; nPointIndex<static_cast<sal_Int32>(rPoints[nPolygonIndex].size()); ++nPointIndex)
+ for (std::size_t nPointIndex=0; nPointIndex<rPoints[nPolygonIndex].size(); ++nPointIndex)
{
auto& rPos = rPoints[nPolygonIndex][nPointIndex];
pInnerSequenceX[nPointIndex] = rPos.PositionX;
@@ -120,10 +122,10 @@ rtl::Reference<SvxShapeGroupAnyD> ShapeFactory::getOrCreateChartRootShape(
// shape is identified by having the name com.sun.star.chart2.shapes.
rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, nullptr);
xShapeGroup->setShapeKind(SdrObjKind::Group);
- uno::Reference<drawing::XShape> xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), uno::UNO_QUERY);
- xDrawPage->addBottom(xShape);
+ // cast to resolve ambiguity in converting to XShape
+ xDrawPage->addBottom(static_cast<SvxShape*>(xShapeGroup.get()));
- setShapeName(xShapeGroup, "com.sun.star.chart2.shapes");
+ setShapeName(xShapeGroup, u"com.sun.star.chart2.shapes"_ustr);
xShapeGroup->setSize(awt::Size(0,0));
return xShapeGroup;
@@ -401,7 +403,7 @@ rtl::Reference<Svx3DExtrudeObject>
if( xSourceProp.is() )
{
drawing::LineStyle aLineStyle;
- xSourceProp->getPropertyValue( "BorderStyle" ) >>= aLineStyle;
+ xSourceProp->getPropertyValue( u"BorderStyle"_ustr ) >>= aLineStyle;
if( aLineStyle == drawing::LineStyle_SOLID )
bRounded = false;
}
@@ -430,7 +432,7 @@ rtl::Reference<Svx3DExtrudeObject>
//create shape
rtl::Reference<Svx3DExtrudeObject> xShape = new Svx3DExtrudeObject(nullptr);
xShape->setShapeKind(SdrObjKind::E3D_Extrusion);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
//set properties
try
@@ -665,7 +667,7 @@ rtl::Reference<Svx3DLatheObject>
//create shape
rtl::Reference<Svx3DLatheObject> xShape = new Svx3DLatheObject(nullptr);
xShape->setShapeKind(SdrObjKind::E3D_Lathe);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
double fWidth = rSize.DirectionX/2.0; //The depth will be corrected within Matrix
double fRadius = fWidth; //!!!!!!!! problem in drawing layer: rotation object calculates wrong needed size -> wrong camera (it's a problem with bounding boxes)
@@ -895,7 +897,13 @@ rtl::Reference<SvxShapePolyPolygon>
//create shape
rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr);
xShape->setShapeKind(SdrObjKind::PathFill); // aka ClosedBezierShape
- xTarget->add(xShape); //need to add the shape before setting of properties
+ xTarget->addShape(*xShape); //need to add the shape before setting of properties
+
+ if (std::isnan(fUnitCircleWidthAngleDegree))
+ {
+ SAL_WARN("chart2", "fUnitCircleWidthAngleDegree isNaN");
+ return xShape;
+ }
//set properties
try
@@ -911,7 +919,7 @@ rtl::Reference<SvxShapePolyPolygon>
basegfx::deg2rad(fUnitCircleWidthAngleDegree),
aTransformationFromUnitCircle, fAngleSubdivisionRadian);
- xShape->SvxShape::setPropertyValue( "PolyPolygonBezier", uno::Any( aCoords ) );
+ xShape->SvxShape::setPropertyValue( u"PolyPolygonBezier"_ustr, uno::Any( aCoords ) );
}
catch( const uno::Exception& )
{
@@ -942,7 +950,7 @@ rtl::Reference<Svx3DExtrudeObject>
//create shape
rtl::Reference<Svx3DExtrudeObject> xShape = new Svx3DExtrudeObject(nullptr);
xShape->setShapeKind(SdrObjKind::E3D_Extrusion);
- xTarget->add(xShape); //need to add the shape before setting of properties
+ xTarget->addShape(*xShape); //need to add the shape before setting of properties
//set properties
try
@@ -1012,7 +1020,7 @@ rtl::Reference<Svx3DPolygonObject>
//create shape
rtl::Reference<Svx3DPolygonObject> xShape = new Svx3DPolygonObject(nullptr);
xShape->setShapeKind(SdrObjKind::E3D_Polygon);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
//set properties
try
@@ -1066,7 +1074,7 @@ rtl::Reference<Svx3DExtrudeObject>
//create shape
rtl::Reference<Svx3DExtrudeObject> xShape = new Svx3DExtrudeObject(nullptr);
xShape->setShapeKind(SdrObjKind::E3D_Extrusion);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
css::drawing::PolyPolygonShape3D aUnoPolyPolygon = toPolyPolygonShape3D(rPolyPolygon);
@@ -1091,7 +1099,7 @@ rtl::Reference<Svx3DExtrudeObject>
//so we need to translate the object via transformation matrix
//Matrix for position
- if (!rPolyPolygon.empty() && !rPolyPolygon[0].empty())
+ if (!rPolyPolygon[0].empty())
{
basegfx::B3DHomMatrix aM;
aM.translate(0, 0, rPolyPolygon[0][0].PositionZ);
@@ -1107,21 +1115,16 @@ rtl::Reference<Svx3DExtrudeObject>
return xShape;
}
-SdrPathObj*
+rtl::Reference<SvxShapePolyPolygon>
ShapeFactory::createArea2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget
- , const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon
- , bool bSetZOrderToZero )
+ , const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon )
{
if( !xTarget.is() )
return nullptr;
//create shape
- SdrPathObj* pPath = new SdrPathObj(xTarget->GetSdrObject()->getSdrModelFromSdrObject(), SdrObjKind::Polygon);
- if (bSetZOrderToZero)
- // insert at ZOrder 0, an area should always be behind other shapes
- xTarget->GetSdrObject()->GetSubList()->InsertObject(pPath, 0);
- else
- xTarget->GetSdrObject()->GetSubList()->InsertObject(pPath);
+ rtl::Reference<SdrPathObj> pPath = new SdrPathObj(xTarget->GetSdrObject()->getSdrModelFromSdrObject(), SdrObjKind::Polygon);
+ xTarget->GetSdrObject()->GetSubList()->InsertObject(pPath.get());
//set properties
try
@@ -1136,10 +1139,10 @@ SdrPathObj*
{
TOOLS_WARN_EXCEPTION("chart2", "" );
}
- return pPath;
+ return static_cast<SvxShapePolyPolygon*>(pPath->getUnoShape().get());
}
-static drawing::PolyPolygonShape3D createPolyPolygon_Symbol( const drawing::Position3D& rPos
+static drawing::PointSequenceSequence createPolyPolygon_Symbol( const drawing::Position3D& rPos
, const drawing::Direction3D& rSize
, sal_Int32 nStandardSymbol )
{
@@ -1168,8 +1171,6 @@ static drawing::PolyPolygonShape3D createPolyPolygon_Symbol( const drawing::Posi
nPointCount = 5;
break;
case Symbol_X:
- nPointCount = 13;
- break;
case Symbol_Plus:
nPointCount = 13;
break;
@@ -1186,314 +1187,230 @@ static drawing::PolyPolygonShape3D createPolyPolygon_Symbol( const drawing::Posi
break;
}
- drawing::PolyPolygonShape3D aPP;
+ drawing::PointSequenceSequence aPP;
- aPP.SequenceX.realloc(1);
- aPP.SequenceY.realloc(1);
- aPP.SequenceZ.realloc(1);
+ aPP.realloc(1);
- drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray();
- drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray();
- drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray();
+ uno::Sequence<awt::Point>* pOuterSequence = aPP.getArray();
- pOuterSequenceX->realloc(nPointCount);
- pOuterSequenceY->realloc(nPointCount);
- pOuterSequenceZ->realloc(nPointCount);
+ pOuterSequence->realloc(nPointCount);
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
-
- for(sal_Int32 nN = nPointCount; nN--;)
- *pInnerSequenceZ++ = 0.0;
+ awt::Point* pInnerSequence = pOuterSequence->getArray();
+ auto toPoint = [](double x, double y) -> awt::Point
+ {
+ return { static_cast<sal_Int32>(x), static_cast<sal_Int32>(y) };
+ };
switch(eSymbolType)
{
case Symbol_Square:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
break;
}
case Symbol_UpArrow:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fHeightH );
break;
}
case Symbol_DownArrow:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
break;
}
case Symbol_RightArrow:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
break;
}
case Symbol_LeftArrow:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY );
break;
}
case Symbol_Bowtie:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
break;
}
case Symbol_Sandglass:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fHeightH );
break;
}
case Symbol_Diamond:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY );
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY );
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY );
break;
}
case Symbol_HorizontalBar:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-0.2*fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-0.2*fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+0.2*fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+0.2*fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-0.2*fHeightH );
break;
}
case Symbol_VerticalBar:
{
- *pInnerSequenceX++ = fX-0.2*fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-0.2*fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX+0.2*fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+0.2*fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX+0.2*fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+0.2*fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX-0.2*fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-0.2*fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX-0.2*fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-0.2*fWidthH, fY-fHeightH );
break;
}
case Symbol_Circle:
{
- double fOmega = 1.5707963267948966192 / (nQuarterCount + 1.0);
+ double fOmega = M_PI_2 / (nQuarterCount + 1.0);
// one point in the middle of each edge to get full size bounding rectangle
- *pInnerSequenceX++ = fX + fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX + fWidthH, fY );
// 0 to PI/2
for (sal_Int32 i = 1; i <= nQuarterCount; ++i)
{
- *pInnerSequenceX++ = fX + fWidthH * cos( i * fOmega );
- *pInnerSequenceY++ = fY - fHeightH * sin( i * fOmega );
+ *pInnerSequence++ = toPoint( fX + fWidthH * cos( i * fOmega ), fY - fHeightH * sin( i * fOmega ) );
}
// PI/2 to PI
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY - fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY - fHeightH );
for (sal_Int32 i = 1; i <= nQuarterCount; ++i)
{
- *pInnerSequenceX++ = fX - fWidthH * sin( i * fOmega);
- *pInnerSequenceY++ = fY - fHeightH * cos( i * fOmega);
+ *pInnerSequence++ = toPoint( fX - fWidthH * sin( i * fOmega), fY - fHeightH * cos( i * fOmega) );
}
// PI to 3/2*PI
- *pInnerSequenceX++ = fX - fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX - fWidthH, fY );
for (sal_Int32 i = 1; i <= nQuarterCount; ++i)
{
- *pInnerSequenceX++ = fX - fWidthH * cos( i * fOmega);
- *pInnerSequenceY++ = fY + fHeightH * sin( i * fOmega);
+ *pInnerSequence++ = toPoint( fX - fWidthH * cos( i * fOmega), fY + fHeightH * sin( i * fOmega) );
}
// 3/2*PI to 2*PI
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY + fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY + fHeightH );
for (sal_Int32 i = 1; i <= nQuarterCount; ++i)
{
- *pInnerSequenceX++ = fX + fWidthH * sin(i * fOmega);
- *pInnerSequenceY++ = fY + fHeightH * cos(i * fOmega);
+ *pInnerSequence++ = toPoint( fX + fWidthH * sin(i * fOmega), fY + fHeightH * cos(i * fOmega) );
}
// close polygon
- *pInnerSequenceX++ = fX + fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX + fWidthH, fY );
break;
}
case Symbol_Star:
{
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY-fHeightH );
- *pInnerSequenceX++ = fX+0.2*fWidthH;
- *pInnerSequenceY++ = fY-0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX+0.2*fWidthH, fY-0.2*fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY );
- *pInnerSequenceX++ = fX+0.2*fWidthH;
- *pInnerSequenceY++ = fY+0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX+0.2*fWidthH, fY+0.2*fHeightH );
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY+fHeightH );
- *pInnerSequenceX++ = fX-0.2*fWidthH;
- *pInnerSequenceY++ = fY+0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX-0.2*fWidthH, fY+0.2*fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY );
- *pInnerSequenceX++ = fX-0.2*fWidthH;
- *pInnerSequenceY++ = fY-0.2*fHeightH;
+ *pInnerSequence++ = toPoint( fX-0.2*fWidthH, fY-0.2*fHeightH );
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX, fY-fHeightH );
break;
}
case Symbol_X:
{
const double fScaleX = fWidthH / 128.0;
const double fScaleY = fHeightH / 128.0;
- const double fSmall = sqrt(200.0);
- const double fLarge = 128.0 - fSmall;
+ constexpr double fSmall = std::numbers::sqrt2 * 10;
+ constexpr double fLarge = 128.0 - fSmall;
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY - fScaleY * fSmall;
+ *pInnerSequence++ = toPoint( fX, fY - fScaleY * fSmall );
- *pInnerSequenceX++ = fX - fScaleX * fLarge;
- *pInnerSequenceY++ = fY - fHeightH;
+ *pInnerSequence++ = toPoint( fX - fScaleX * fLarge, fY - fHeightH );
- *pInnerSequenceX++ = fX - fWidthH;
- *pInnerSequenceY++ = fY - fScaleY * fLarge;
+ *pInnerSequence++ = toPoint( fX - fWidthH, fY - fScaleY * fLarge );
- *pInnerSequenceX++ = fX - fScaleX * fSmall;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX - fScaleX * fSmall, fY );
- *pInnerSequenceX++ = fX - fWidthH;
- *pInnerSequenceY++ = fY + fScaleY * fLarge;
+ *pInnerSequence++ = toPoint( fX - fWidthH, fY + fScaleY * fLarge );
- *pInnerSequenceX++ = fX - fScaleX * fLarge;
- *pInnerSequenceY++ = fY + fHeightH;
+ *pInnerSequence++ = toPoint( fX - fScaleX * fLarge, fY + fHeightH );
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY + fScaleY * fSmall;
+ *pInnerSequence++ = toPoint( fX, fY + fScaleY * fSmall );
- *pInnerSequenceX++ = fX + fScaleX * fLarge;
- *pInnerSequenceY++ = fY + fHeightH;
+ *pInnerSequence++ = toPoint( fX + fScaleX * fLarge, fY + fHeightH );
- *pInnerSequenceX++ = fX + fWidthH;
- *pInnerSequenceY++ = fY + fScaleY * fLarge;
+ *pInnerSequence++ = toPoint( fX + fWidthH, fY + fScaleY * fLarge );
- *pInnerSequenceX++ = fX + fScaleX * fSmall;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX + fScaleX * fSmall, fY );
- *pInnerSequenceX++ = fX + fWidthH;
- *pInnerSequenceY++ = fY - fScaleY * fLarge;
+ *pInnerSequence++ = toPoint( fX + fWidthH, fY - fScaleY * fLarge );
- *pInnerSequenceX++ = fX + fScaleX * fLarge;
- *pInnerSequenceY++ = fY - fHeightH;
+ *pInnerSequence++ = toPoint( fX + fScaleX * fLarge, fY - fHeightH );
- *pInnerSequenceX++ = fX;
- *pInnerSequenceY++ = fY - fScaleY * fSmall;
+ *pInnerSequence++ = toPoint( fX, fY - fScaleY * fSmall );
break;
}
@@ -1501,138 +1418,101 @@ static drawing::PolyPolygonShape3D createPolyPolygon_Symbol( const drawing::Posi
{
const double fScaleX = fWidthH / 128.0;
const double fScaleY = fHeightH / 128.0;
- const double fHalf = 10.0; //half line width on 256 size square
+ constexpr double fHalf = 10.0; //half line width on 256 size square
const double fdX = fScaleX * fHalf;
const double fdY = fScaleY * fHalf;
- *pInnerSequenceX++ = fX-fdX;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fdX, fY-fHeightH );
- *pInnerSequenceX++ = fX-fdX;
- *pInnerSequenceY++ = fY-fdY;
+ *pInnerSequence++ = toPoint( fX-fdX, fY-fdY );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fdY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fdY );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fdY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fdY );
- *pInnerSequenceX++ = fX-fdX;
- *pInnerSequenceY++ = fY+fdY;
+ *pInnerSequence++ = toPoint( fX-fdX, fY+fdY );
- *pInnerSequenceX++ = fX-fdX;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fdX, fY+fHeightH );
- *pInnerSequenceX++ = fX+fdX;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+fdX, fY+fHeightH );
- *pInnerSequenceX++ = fX+fdX;
- *pInnerSequenceY++ = fY+fdY;
+ *pInnerSequence++ = toPoint( fX+fdX, fY+fdY );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+fdY;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+fdY );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-fdY;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-fdY );
- *pInnerSequenceX++ = fX+fdX;
- *pInnerSequenceY++ = fY-fdY;
+ *pInnerSequence++ = toPoint( fX+fdX, fY-fdY );
- *pInnerSequenceX++ = fX+fdY;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+fdY, fY-fHeightH );
- *pInnerSequenceX++ = fX-fdX;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fdX, fY-fHeightH );
break;
}
case Symbol_Asterisk:
{
- const double fHalf = 10.0; // half line width on 256 size square
- const double fTwoY = fHalf * sqrt(3.0);
- const double fFourY = (128.0 - 2.0 * fHalf ) / sqrt(3.0);
- const double fThreeX = 128.0 - fHalf;
- const double fThreeY = fHalf * sqrt(3.0) + fFourY;
- const double fFiveX = 2.0 * fHalf;
+ constexpr double fHalf = 10.0; // half line width on 256 size square
+ constexpr double fTwoY = fHalf * std::numbers::sqrt3;
+ constexpr double fFourY = (128.0 - 2.0 * fHalf ) * std::numbers::inv_sqrt3;
+ constexpr double fThreeX = 128.0 - fHalf;
+ constexpr double fThreeY = fHalf * std::numbers::sqrt3 + fFourY;
+ constexpr double fFiveX = 2.0 * fHalf;
const double fScaleX = fWidthH / 128.0;
const double fScaleY = fHeightH / 128.0;
//1
- *pInnerSequenceX++ = fX-fScaleX * fHalf;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fScaleX * fHalf, fY-fHeightH );
//2
- *pInnerSequenceX++ = fX-fScaleX * fHalf;
- *pInnerSequenceY++ = fY-fScaleY * fTwoY;
+ *pInnerSequence++ = toPoint( fX-fScaleX * fHalf, fY-fScaleY * fTwoY );
//3
- *pInnerSequenceX++ = fX-fScaleX * fThreeX;
- *pInnerSequenceY++ = fY-fScaleY * fThreeY;
+ *pInnerSequence++ = toPoint( fX-fScaleX * fThreeX, fY-fScaleY * fThreeY );
//4
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fScaleY * fFourY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fScaleY * fFourY );
//5
- *pInnerSequenceX++ = fX-fScaleX * fFiveX;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX-fScaleX * fFiveX, fY );
//6 as 4
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fScaleY * fFourY;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fScaleY * fFourY );
//7 as 3
- *pInnerSequenceX++ = fX-fScaleX * fThreeX;
- *pInnerSequenceY++ = fY+fScaleY * fThreeY;
+ *pInnerSequence++ = toPoint( fX-fScaleX * fThreeX, fY+fScaleY * fThreeY );
//8 as 2
- *pInnerSequenceX++ = fX-fScaleX * fHalf;
- *pInnerSequenceY++ = fY+fScaleY * fTwoY;
+ *pInnerSequence++ = toPoint( fX-fScaleX * fHalf, fY+fScaleY * fTwoY );
//9 as 1
- *pInnerSequenceX++ = fX-fScaleX * fHalf;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fScaleX * fHalf, fY+fHeightH );
//10 as 1
- *pInnerSequenceX++ = fX+fScaleX * fHalf;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+fScaleX * fHalf, fY+fHeightH );
//11 as 2
- *pInnerSequenceX++ = fX+fScaleX * fHalf;
- *pInnerSequenceY++ = fY+fScaleY * fTwoY;
+ *pInnerSequence++ = toPoint( fX+fScaleX * fHalf, fY+fScaleY * fTwoY );
//12 as 3
- *pInnerSequenceX++ = fX+fScaleX * fThreeX;
- *pInnerSequenceY++ = fY+fScaleY * fThreeY;
+ *pInnerSequence++ = toPoint( fX+fScaleX * fThreeX, fY+fScaleY * fThreeY );
//13 as 4
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+fScaleY * fFourY;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+fScaleY * fFourY );
//14 as 5
- *pInnerSequenceX++ = fX+fScaleX * fFiveX;
- *pInnerSequenceY++ = fY;
+ *pInnerSequence++ = toPoint( fX+fScaleX * fFiveX, fY );
//15 as 4
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-fScaleY * fFourY;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-fScaleY * fFourY );
//16 as 3
- *pInnerSequenceX++ = fX+fScaleX * fThreeX;
- *pInnerSequenceY++ = fY-fScaleY * fThreeY;
+ *pInnerSequence++ = toPoint( fX+fScaleX * fThreeX, fY-fScaleY * fThreeY );
//17 as 2
- *pInnerSequenceX++ = fX+fScaleX * fHalf;
- *pInnerSequenceY++ = fY-fScaleY * fTwoY;
+ *pInnerSequence++ = toPoint( fX+fScaleX * fHalf, fY-fScaleY * fTwoY );
// 18 as 1
- *pInnerSequenceX++ = fX+fScaleX * fHalf;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+fScaleX * fHalf, fY-fHeightH );
// 19 = 1, closing
- *pInnerSequenceX++ = fX-fScaleX * fHalf;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fScaleX * fHalf, fY-fHeightH );
break;
}
default: //case Symbol_Square:
{
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY+fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY+fHeightH );
- *pInnerSequenceX++ = fX+fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX+fWidthH, fY-fHeightH );
- *pInnerSequenceX++ = fX-fWidthH;
- *pInnerSequenceY++ = fY-fHeightH;
+ *pInnerSequence++ = toPoint( fX-fWidthH, fY-fHeightH );
break;
}
}
@@ -1655,13 +1535,13 @@ rtl::Reference<SvxShapePolyPolygon>
//create shape
rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr);
xShape->setShapeKind(SdrObjKind::Polygon);
- xTarget->add(uno::Reference<drawing::XShape>(xShape));
+ xTarget->addShape(*xShape);
//set properties
try
{
- drawing::PointSequenceSequence aPoints( PolyToPointSequence(
- createPolyPolygon_Symbol( rPosition, rSize, nStandardSymbol ) ));
+ drawing::PointSequenceSequence aPoints =
+ createPolyPolygon_Symbol( rPosition, rSize, nStandardSymbol );
//Polygon
xShape->SvxShape::setPropertyValue( UNO_NAME_POLYPOLYGON
@@ -1698,7 +1578,7 @@ rtl::Reference<SvxGraphicObject>
//create shape
rtl::Reference<SvxGraphicObject> xShape = new SvxGraphicObject(nullptr);
xShape->setShapeKind(SdrObjKind::Graphic);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
try
{
@@ -1716,7 +1596,7 @@ rtl::Reference<SvxGraphicObject>
}
try
{
- xShape->SvxShape::setPropertyValue( "Graphic", uno::Any( xGraphic ));
+ xShape->SvxShape::setPropertyValue( u"Graphic"_ustr, uno::Any( xGraphic ));
}
catch( const uno::Exception& )
{
@@ -1736,8 +1616,8 @@ rtl::Reference< SvxShapeGroup >
//create and add to target
rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, nullptr);
xShapeGroup->setShapeKind(SdrObjKind::Group);
- uno::Reference< drawing::XShape > xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), uno::UNO_QUERY_THROW);
- xTarget->add(xShape);
+ // cast to resolve ambiguity in converting to XShape
+ xTarget->addShape(*xShapeGroup);
//set name
if(!aName.isEmpty())
@@ -1768,8 +1648,8 @@ rtl::Reference< SvxShapeGroup >
//create and add to target
rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, nullptr);
xShapeGroup->setShapeKind(SdrObjKind::Group);
- uno::Reference< drawing::XShape > xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), uno::UNO_QUERY_THROW);
- xTarget->add(xShape);
+ // cast to resolve ambiguity in converting to XShape
+ xTarget->add(static_cast<SvxShape*>(xShapeGroup.get()));
//set name
if(!aName.isEmpty())
@@ -1800,7 +1680,7 @@ rtl::Reference<Svx3DSceneObject>
//create shape
rtl::Reference<Svx3DSceneObject> xShape = new Svx3DSceneObject(nullptr, nullptr);
xShape->setShapeKind(SdrObjKind::E3D_Scene);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
//it is necessary to set the transform matrix to initialize the scene properly
//otherwise all objects which are placed into this Group will not be visible
@@ -1842,7 +1722,7 @@ rtl::Reference<SvxShapeCircle>
//create shape
rtl::Reference<SvxShapeCircle> xShape = new SvxShapeCircle(nullptr);
xShape->setShapeKind(SdrObjKind::CircleOrEllipse);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
try
{
@@ -1877,7 +1757,7 @@ rtl::Reference<SvxShapeCircle>
{
rtl::Reference<SvxShapeCircle> xShape = new SvxShapeCircle(nullptr);
xShape->setShapeKind(SdrObjKind::CircleOrEllipse);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
xShape->setSize( rSize );
xShape->setPosition( rPosition );
@@ -1898,7 +1778,7 @@ rtl::Reference<Svx3DPolygonObject>
//create shape
rtl::Reference<Svx3DPolygonObject> xShape = new Svx3DPolygonObject(nullptr);
xShape->setShapeKind(SdrObjKind::E3D_Polygon);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
css::drawing::PolyPolygonShape3D aUnoPoly = toPolyPolygonShape3D(rPoints);
@@ -1969,7 +1849,7 @@ rtl::Reference<SvxShapePolyPolygon>
//create shape
rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr);
xShape->setShapeKind(SdrObjKind::PolyLine);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
//set properties
try
@@ -2002,7 +1882,7 @@ rtl::Reference<SvxShapePolyPolygon>
//LineDashName
if(pLineProperties->DashName.hasValue())
- xShape->SvxShape::setPropertyValue( "LineDashName"
+ xShape->SvxShape::setPropertyValue( u"LineDashName"_ustr
, pLineProperties->DashName );
//LineCap
@@ -2032,7 +1912,7 @@ rtl::Reference<SvxShapePolyPolygon>
//create shape
rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr);
xShape->setShapeKind(SdrObjKind::PolyLine);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
drawing::PointSequenceSequence aAnyPoints = PolyToPointSequence(rPoints);
@@ -2067,7 +1947,7 @@ rtl::Reference<SvxShapePolyPolygon>
//LineDashName
if(pLineProperties->DashName.hasValue())
- xShape->SvxShape::setPropertyValue( "LineDashName"
+ xShape->SvxShape::setPropertyValue( u"LineDashName"_ustr
, pLineProperties->DashName );
//LineCap
@@ -2090,7 +1970,7 @@ rtl::Reference<SvxShapePolyPolygon>
//create shape
rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr);
xShape->setShapeKind(SdrObjKind::Line);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
xShape->setSize( rSize );
xShape->setPosition( rPosition );
@@ -2108,7 +1988,7 @@ rtl::Reference<SvxShapeRect> ShapeFactory::createInvisibleRectangle(
rtl::Reference<SvxShapeRect> xShape = new SvxShapeRect(nullptr);
xShape->setShapeKind(SdrObjKind::Rectangle);
- xTarget->add( xShape );
+ xTarget->addShape( *xShape );
ShapeFactory::makeShapeInvisible( xShape );
xShape->setSize( rSize );
return xShape;
@@ -2133,11 +2013,12 @@ rtl::Reference<SvxShapeRect> ShapeFactory::createRectangle(
if (ePos == StackPosition::Bottom)
{
uno::Reference<drawing::XShapes2> xTarget2(static_cast<cppu::OWeakObject*>(xTarget.get()), uno::UNO_QUERY);
+ assert(xTarget2);
if (xTarget2.is())
xTarget2->addBottom(xShape);
}
else
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
xShape->setPosition( rPosition );
xShape->setSize( rSize );
@@ -2152,7 +2033,7 @@ rtl::Reference<SvxShapeRect>
{
rtl::Reference<SvxShapeRect> xShape = new SvxShapeRect(nullptr);
xShape->setShapeKind(SdrObjKind::Rectangle);
- xTarget->add( xShape );
+ xTarget->addShape( *xShape );
return xShape;
}
@@ -2173,7 +2054,7 @@ rtl::Reference<SvxShapeText>
//create shape and add to page
rtl::Reference<SvxShapeText> xShape = new SvxShapeText(nullptr);
xShape->setShapeKind(SdrObjKind::Text);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
//set text
xShape->setString( rText );
@@ -2186,7 +2067,7 @@ rtl::Reference<SvxShapeText>
try
{
if (rATransformation.hasValue())
- xShape->SvxShape::setPropertyValue( "Transformation", rATransformation );
+ xShape->SvxShape::setPropertyValue( u"Transformation"_ustr, rATransformation );
else
SAL_INFO("chart2", "No rATransformation value is given to ShapeFactory::createText()");
@@ -2200,7 +2081,7 @@ rtl::Reference<SvxShapeText>
rtl::Reference<SvxShapeText>
ShapeFactory::createText( const rtl::Reference<SvxShapeGroupAnyD>& xTarget
- , uno::Sequence< uno::Reference< chart2::XFormattedString > >& xFormattedString
+ , const uno::Sequence< uno::Reference< chart2::XFormattedString > >& xFormattedString
, const tNameSequence& rPropNames
, const tAnySequence& rPropValues
, const uno::Any& rATransformation )
@@ -2228,7 +2109,7 @@ rtl::Reference<SvxShapeText>
//create shape and add to page
rtl::Reference<SvxShapeText> xShape = new SvxShapeText(nullptr);
xShape->setShapeKind(SdrObjKind::Text);
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
//set paragraph properties
bNotEmpty = false;
@@ -2273,7 +2154,7 @@ rtl::Reference<SvxShapeText>
//the matrix needs to be set at the end behind autogrow and such position influencing properties
try
{
- xShape->SvxShape::setPropertyValue( "Transformation", rATransformation );
+ xShape->SvxShape::setPropertyValue( u"Transformation"_ustr, rATransformation );
}
catch( const uno::Exception& )
{
@@ -2297,11 +2178,12 @@ rtl::Reference<SvxShapeText>
xShape->setShapeKind(SdrObjKind::Text);
try
{
- xTarget->add(xShape);
+ xTarget->addShape(*xShape);
//set text and text properties
uno::Reference< text::XTextCursor > xTextCursor( xShape->createTextCursor() );
- if( !xTextCursor.is() )
+ uno::Reference< text::XTextCursor > xSelectionCursor( xShape->createTextCursor() );
+ if( !xTextCursor.is() || !xSelectionCursor.is() )
return xShape;
tPropertyNameValueMap aValueMap;
@@ -2316,15 +2198,15 @@ rtl::Reference<SvxShapeText>
//fill some more shape properties into the ValueMap
{
- aValueMap.insert( { "TextHorizontalAdjust", uno::Any(drawing::TextHorizontalAdjust_CENTER) } ); // drawing::TextHorizontalAdjust
- aValueMap.insert( { "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) } ); //drawing::TextVerticalAdjust
- aValueMap.insert( { "TextAutoGrowHeight", uno::Any(true) } ); // sal_Bool
- aValueMap.insert( { "TextAutoGrowWidth", uno::Any(true) } ); // sal_Bool
- aValueMap.insert( { "TextMaximumFrameWidth", uno::Any(nTextMaxWidth) } ); // sal_Int32
+ aValueMap.insert( { u"TextHorizontalAdjust"_ustr, uno::Any(drawing::TextHorizontalAdjust_CENTER) } ); // drawing::TextHorizontalAdjust
+ aValueMap.insert( { u"TextVerticalAdjust"_ustr, uno::Any(drawing::TextVerticalAdjust_CENTER) } ); //drawing::TextVerticalAdjust
+ aValueMap.insert( { u"TextAutoGrowHeight"_ustr, uno::Any(true) } ); // sal_Bool
+ aValueMap.insert( { u"TextAutoGrowWidth"_ustr, uno::Any(true) } ); // sal_Bool
+ aValueMap.insert( { u"TextMaximumFrameWidth"_ustr, uno::Any(nTextMaxWidth) } ); // sal_Int32
//set name/classified ObjectID (CID)
if( !aName.isEmpty() )
- aValueMap.emplace( "Name", uno::Any( aName ) ); //CID OUString
+ aValueMap.emplace( u"Name"_ustr, uno::Any( aName ) ); //CID OUString
}
//set global title properties
@@ -2338,7 +2220,7 @@ rtl::Reference<SvxShapeText>
bool bStackCharacters(false);
try
{
- xTextProperties->getPropertyValue( "StackCharacters" ) >>= bStackCharacters;
+ xTextProperties->getPropertyValue( u"StackCharacters"_ustr ) >>= bStackCharacters;
}
catch( const uno::Exception& )
{
@@ -2350,22 +2232,36 @@ rtl::Reference<SvxShapeText>
//if the characters should be stacked we use only the first character properties for code simplicity
if( xFormattedString.hasElements() )
{
- OUString aLabel;
- for( const auto & i : std::as_const(xFormattedString) )
- aLabel += i->getString();
- aLabel = ShapeFactory::getStackedString( aLabel, bStackCharacters );
-
- xTextCursor->gotoEnd(false);
- xShape->insertString( xTextCursor, aLabel, false );
- xTextCursor->gotoEnd(true);
- uno::Reference< beans::XPropertySet > xSourceProps( xFormattedString[0], uno::UNO_QUERY );
-
- PropertyMapper::setMappedProperties( *xShape, xSourceProps
- , PropertyMapper::getPropertyNameMapForCharacterProperties() );
+ size_t nLBreaks = xFormattedString.size() - 1;
+ uno::Reference< beans::XPropertySet > xSelectionProp(xSelectionCursor, uno::UNO_QUERY);
+ for (const uno::Reference<chart2::XFormattedString>& rxFS : xFormattedString)
+ {
+ if (!rxFS->getString().isEmpty())
+ {
+ xTextCursor->gotoEnd(false);
+ xSelectionCursor->gotoEnd(false);
+ OUString aLabel = ShapeFactory::getStackedString(rxFS->getString(), bStackCharacters);
+ if (nLBreaks-- > 0)
+ aLabel += OUStringChar('\r');
+ xShape->insertString(xTextCursor, aLabel, false);
+ xSelectionCursor->gotoEnd(true); // select current paragraph
+ uno::Reference< beans::XPropertySet > xSourceProps(rxFS, uno::UNO_QUERY);
+ if (xFormattedString.size() > 1 && xSelectionProp.is())
+ {
+ PropertyMapper::setMappedProperties(xSelectionProp, xSourceProps,
+ PropertyMapper::getPropertyNameMapForTextShapeProperties());
+ }
+ else
+ {
+ PropertyMapper::setMappedProperties(*xShape, xSourceProps,
+ PropertyMapper::getPropertyNameMapForTextShapeProperties());
+ }
+ }
+ }
// adapt font size according to page size
awt::Size aOldRefSize;
- if( xTextProperties->getPropertyValue( "ReferencePageSize") >>= aOldRefSize )
+ if( xTextProperties->getPropertyValue( u"ReferencePageSize"_ustr) >>= aOldRefSize )
{
RelativeSizeHelper::adaptFontSizes( *xShape, aOldRefSize, rSize );
}
@@ -2373,23 +2269,34 @@ rtl::Reference<SvxShapeText>
}
else
{
- for( const uno::Reference< chart2::XFormattedString >& rxFS : std::as_const(xFormattedString) )
+ uno::Reference< beans::XPropertySet > xSelectionProp(xSelectionCursor, uno::UNO_QUERY);
+ for (const uno::Reference<chart2::XFormattedString>& rxFS : xFormattedString)
{
- xTextCursor->gotoEnd(false);
- xShape->insertString( xTextCursor, rxFS->getString(), false );
- xTextCursor->gotoEnd(true);
+ if (!rxFS->getString().isEmpty())
+ {
+ xTextCursor->gotoEnd(false);
+ xSelectionCursor->gotoEnd(false);
+ xShape->insertString(xTextCursor, rxFS->getString(), false);
+ xSelectionCursor->gotoEnd(true); // select current paragraph
+ uno::Reference< beans::XPropertySet > xSourceProps(rxFS, uno::UNO_QUERY);
+ if (xFormattedString.size() > 1 && xSelectionProp.is())
+ {
+ PropertyMapper::setMappedProperties(xSelectionProp, xSourceProps,
+ PropertyMapper::getPropertyNameMapForTextShapeProperties());
+ }
+ else
+ {
+ PropertyMapper::setMappedProperties(*xShape, xSourceProps,
+ PropertyMapper::getPropertyNameMapForTextShapeProperties());
+ }
+ }
}
- awt::Size aOldRefSize;
- bool bHasRefPageSize =
- ( xTextProperties->getPropertyValue( "ReferencePageSize") >>= aOldRefSize );
if( xFormattedString.hasElements() )
{
- uno::Reference< beans::XPropertySet > xSourceProps( xFormattedString[0], uno::UNO_QUERY );
- PropertyMapper::setMappedProperties( *xShape, xSourceProps, PropertyMapper::getPropertyNameMapForCharacterProperties() );
-
// adapt font size according to page size
- if( bHasRefPageSize )
+ awt::Size aOldRefSize;
+ if( xTextProperties->getPropertyValue(u"ReferencePageSize"_ustr) >>= aOldRefSize )
{
RelativeSizeHelper::adaptFontSizes( *xShape, aOldRefSize, rSize );
}
@@ -2398,15 +2305,15 @@ rtl::Reference<SvxShapeText>
// #i109336# Improve auto positioning in chart
float fFontHeight = 0.0;
- if ( xShape->SvxShape::getPropertyValue( "CharHeight" ) >>= fFontHeight )
+ if ( xShape->SvxShape::getPropertyValue( u"CharHeight"_ustr ) >>= fFontHeight )
{
fFontHeight = convertPointToMm100(fFontHeight);
sal_Int32 nXDistance = static_cast< sal_Int32 >( ::rtl::math::round( fFontHeight * 0.18f ) );
sal_Int32 nYDistance = static_cast< sal_Int32 >( ::rtl::math::round( fFontHeight * 0.30f ) );
- xShape->SvxShape::setPropertyValue( "TextLeftDistance", uno::Any( nXDistance ) );
- xShape->SvxShape::setPropertyValue( "TextRightDistance", uno::Any( nXDistance ) );
- xShape->SvxShape::setPropertyValue( "TextUpperDistance", uno::Any( nYDistance ) );
- xShape->SvxShape::setPropertyValue( "TextLowerDistance", uno::Any( nYDistance ) );
+ xShape->SvxShape::setPropertyValue( u"TextLeftDistance"_ustr, uno::Any( nXDistance ) );
+ xShape->SvxShape::setPropertyValue( u"TextRightDistance"_ustr, uno::Any( nXDistance ) );
+ xShape->SvxShape::setPropertyValue( u"TextUpperDistance"_ustr, uno::Any( nYDistance ) );
+ xShape->SvxShape::setPropertyValue( u"TextLowerDistance"_ustr, uno::Any( nYDistance ) );
}
sal_Int32 nXPos = rPos.X;
sal_Int32 nYPos = rPos.Y;
@@ -2416,9 +2323,9 @@ rtl::Reference<SvxShapeText>
::basegfx::B2DHomMatrix aM;
aM.rotate( -basegfx::deg2rad(nRotation) );//#i78696#->#i80521#
aM.translate( nXPos, nYPos );
- xShape->SvxShape::setPropertyValue( "Transformation", uno::Any( B2DHomMatrixToHomogenMatrix3(aM) ) );
+ xShape->SvxShape::setPropertyValue( u"Transformation"_ustr, uno::Any( B2DHomMatrixToHomogenMatrix3(aM) ) );
- xShape->SvxShape::setPropertyValue( "ParaAdjust", uno::Any( style::ParagraphAdjust_CENTER ) );
+ xShape->SvxShape::setPropertyValue( u"ParaAdjust"_ustr, uno::Any( style::ParagraphAdjust_CENTER ) );
}
catch( const uno::Exception& )
{
@@ -2431,14 +2338,13 @@ rtl::Reference<SvxShapeGroupAnyD> ShapeFactory::getChartRootShape(
const rtl::Reference<SvxDrawPage>& xDrawPage )
{
rtl::Reference<SvxShapeGroupAnyD> xRet;
- const uno::Reference< drawing::XShapes > xShapes = xDrawPage;
- if( xShapes.is() )
+ if( xDrawPage.is() )
{
- sal_Int32 nCount = xShapes->getCount();
+ sal_Int32 nCount = xDrawPage->getCount();
uno::Reference< drawing::XShape > xShape;
for( sal_Int32 nN = nCount; nN--; )
{
- if( xShapes->getByIndex( nN ) >>= xShape )
+ if( xDrawPage->getByIndex( nN ) >>= xShape )
{
if( ShapeFactory::getShapeName( xShape ) == "com.sun.star.chart2.shapes" )
{
@@ -2456,8 +2362,8 @@ void ShapeFactory::makeShapeInvisible( const rtl::Reference< SvxShape >& xShape
{
try
{
- xShape->setPropertyValue( "LineStyle", uno::Any( drawing::LineStyle_NONE ));
- xShape->setPropertyValue( "FillStyle", uno::Any( drawing::FillStyle_NONE ));
+ xShape->setPropertyValue( u"LineStyle"_ustr, uno::Any( drawing::LineStyle_NONE ));
+ xShape->setPropertyValue( u"FillStyle"_ustr, uno::Any( drawing::FillStyle_NONE ));
}
catch( const uno::Exception& )
{
@@ -2467,14 +2373,6 @@ void ShapeFactory::makeShapeInvisible( const rtl::Reference< SvxShape >& xShape
// set a name/CID at a shape (is used for selection handling)
-void ShapeFactory::setShapeName( SdrPathObj* pShape
- , const OUString& rName )
-{
- if(!pShape)
- return;
- pShape->SetName(rName);
-}
-
void ShapeFactory::setShapeName( const rtl::Reference< SvxShape >& xShape
, const OUString& rName )
{
@@ -2552,7 +2450,7 @@ bool ShapeFactory::hasPolygonAnyLines( const std::vector<std::vector<css::drawin
return false;
}
-bool ShapeFactory::isPolygonEmptyOrSinglePoint( drawing::PolyPolygonShape3D& rPoly)
+bool ShapeFactory::isPolygonEmptyOrSinglePoint( const drawing::PolyPolygonShape3D& rPoly)
{
// true, if empty polypolygon or one polygon with one point
return !rPoly.SequenceX.hasElements() ||
@@ -2666,6 +2564,21 @@ void ShapeFactory::removeSubShapes( const rtl::Reference<SvxShapeGroupAnyD>& xSh
}
}
+rtl::Reference<SvxTableShape>
+ShapeFactory::createTable(rtl::Reference<SvxShapeGroupAnyD> const& xTarget, OUString const& rName)
+{
+ if (!xTarget.is())
+ return nullptr;
+
+ //create table shape
+ rtl::Reference<SvxTableShape> xShape = new SvxTableShape(nullptr);
+ xShape->setShapeKind(SdrObjKind::Table);
+ xTarget->addShape(*xShape);
+ if (!rName.isEmpty())
+ setShapeName(xShape, rName);
+ return xShape;
+}
+
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/VButton.cxx b/chart2/source/view/main/VButton.cxx
index dc8e22c4961d..cfa689f7ceab 100644
--- a/chart2/source/view/main/VButton.cxx
+++ b/chart2/source/view/main/VButton.cxx
@@ -15,7 +15,6 @@
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <CommonConverters.hxx>
#include <editeng/unoprnms.hxx>
@@ -70,11 +69,11 @@ rtl::Reference<SvxShapePolyPolygon> VButton::createTriangle(awt::Size aSize)
pInnerSequenceY[2] = 0.0;
pInnerSequenceZ[2] = 0.0;
- xShape->SvxShape::setPropertyValue("Name", uno::makeAny(m_sCID));
+ xShape->SvxShape::setPropertyValue(u"Name"_ustr, uno::Any(m_sCID));
xShape->SvxShape::setPropertyValue(UNO_NAME_POLYPOLYGON,
uno::Any(PolyToPointSequence(aPolyPolygon)));
- xShape->SvxShape::setPropertyValue("LineStyle", uno::makeAny(drawing::LineStyle_NONE));
- xShape->SvxShape::setPropertyValue("FillColor", uno::makeAny(m_nArrowColor));
+ xShape->SvxShape::setPropertyValue(u"LineStyle"_ustr, uno::Any(drawing::LineStyle_NONE));
+ xShape->SvxShape::setPropertyValue(u"FillColor"_ustr, uno::Any(m_nArrowColor));
return xShape;
}
@@ -93,20 +92,20 @@ void VButton::createShapes(const uno::Reference<beans::XPropertySet>& xTextProp)
rtl::Reference<SvxShapeGroupAnyD> xContainer = m_xShape;
tPropertyNameValueMap aTextValueMap;
- aTextValueMap["CharHeight"] <<= 10.0f;
- aTextValueMap["CharHeightAsian"] <<= 10.0f;
- aTextValueMap["CharHeightComplex"] <<= 10.0f;
- aTextValueMap["FillColor"] <<= m_nBGColor;
- aTextValueMap["FillStyle"] <<= drawing::FillStyle_SOLID;
- aTextValueMap["LineColor"] <<= sal_Int32(0xcccccc);
- aTextValueMap["LineStyle"] <<= drawing::LineStyle_SOLID;
- aTextValueMap["ParaAdjust"] <<= style::ParagraphAdjust_CENTER;
- aTextValueMap["TextHorizontalAdjust"] <<= drawing::TextHorizontalAdjust_LEFT;
- aTextValueMap["TextVerticalAdjust"] <<= drawing::TextVerticalAdjust_CENTER;
- aTextValueMap["ParaLeftMargin"] <<= sal_Int32(100);
- aTextValueMap["ParaRightMargin"] <<= sal_Int32(600);
-
- aTextValueMap["Name"] <<= m_sCID; //CID OUString
+ aTextValueMap[u"CharHeight"_ustr] <<= 10.0f;
+ aTextValueMap[u"CharHeightAsian"_ustr] <<= 10.0f;
+ aTextValueMap[u"CharHeightComplex"_ustr] <<= 10.0f;
+ aTextValueMap[u"FillColor"_ustr] <<= m_nBGColor;
+ aTextValueMap[u"FillStyle"_ustr] <<= drawing::FillStyle_SOLID;
+ aTextValueMap[u"LineColor"_ustr] <<= sal_Int32(0xcccccc);
+ aTextValueMap[u"LineStyle"_ustr] <<= drawing::LineStyle_SOLID;
+ aTextValueMap[u"ParaAdjust"_ustr] <<= style::ParagraphAdjust_CENTER;
+ aTextValueMap[u"TextHorizontalAdjust"_ustr] <<= drawing::TextHorizontalAdjust_LEFT;
+ aTextValueMap[u"TextVerticalAdjust"_ustr] <<= drawing::TextVerticalAdjust_CENTER;
+ aTextValueMap[u"ParaLeftMargin"_ustr] <<= sal_Int32(100);
+ aTextValueMap[u"ParaRightMargin"_ustr] <<= sal_Int32(600);
+
+ aTextValueMap[u"Name"_ustr] <<= m_sCID; //CID OUString
PropertyMapper::getMultiPropertyListsFromValueMap(aPropNames, aPropValues, aTextValueMap);
diff --git a/chart2/source/view/main/VButton.hxx b/chart2/source/view/main/VButton.hxx
index 87017f36901a..f63851dd6443 100644
--- a/chart2/source/view/main/VButton.hxx
+++ b/chart2/source/view/main/VButton.hxx
@@ -17,9 +17,6 @@
#include <svx/unoshape.hxx>
namespace com::sun::star::beans { class XPropertySet; }
-namespace com::sun::star::drawing { class XShape; }
-namespace com::sun::star::drawing { class XShapes; }
-namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace chart
{
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index a650adcef066..ebf2141d8bb9 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -20,53 +20,58 @@
#include <limits>
#include <memory>
#include <VDataSeries.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
#include <ObjectIdentifier.hxx>
#include <CommonConverters.hxx>
#include <LabelPositionHelper.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
+#include <RegressionCurveCalculator.hxx>
#include <RegressionCurveHelper.hxx>
#include <unonames.hxx>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
-#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/XRegressionCurveCalculator.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
+#include <o3tl/compare.hxx>
#include <osl/diagnose.h>
#include <tools/color.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/chart2/data/XDataSource.hpp>
namespace chart {
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
+using namespace ::chart::DataSeriesProperties;
void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
{
- Model = xModel;
- Doubles = DataSequenceToDoubleSequence( xModel );
+ m_xModel = xModel;
+ m_aValues = DataSequenceToDoubleSequence( xModel );
}
bool VDataSequence::is() const
{
- return Model.is();
+ return m_xModel.is();
}
void VDataSequence::clear()
{
- Model = nullptr;
- Doubles.realloc(0);
+ m_xModel = nullptr;
+ m_aValues.realloc(0);
}
double VDataSequence::getValue( sal_Int32 index ) const
{
- if( 0<=index && index<Doubles.getLength() )
- return Doubles[index];
+ if( 0<=index && index<m_aValues.getLength() )
+ return m_aValues[index];
return std::numeric_limits<double>::quiet_NaN();
}
@@ -75,10 +80,9 @@ sal_Int32 VDataSequence::detectNumberFormatKey( sal_Int32 index ) const
sal_Int32 nNumberFormatKey = -1;
// -1 is allowed and means a key for the whole sequence
- if( -1<=index && index<Doubles.getLength() &&
- Model.is())
+ if( -1<=index && index<m_aValues.getLength() && m_xModel.is())
{
- nNumberFormatKey = Model->getNumberFormatKeyByIndex( index );
+ nNumberFormatKey = m_xModel->getNumberFormatKeyByIndex( index );
}
return nNumberFormatKey;
@@ -86,7 +90,7 @@ sal_Int32 VDataSequence::detectNumberFormatKey( sal_Int32 index ) const
sal_Int32 VDataSequence::getLength() const
{
- return Doubles.getLength();
+ return m_aValues.getLength();
}
namespace
@@ -98,7 +102,7 @@ struct lcl_LessXOfPoint
{
if( !first.empty() && !second.empty() )
{
- return first[0]<second[0];
+ return o3tl::strong_order(first[0], second[0]) < 0;
}
return false;
}
@@ -107,10 +111,10 @@ struct lcl_LessXOfPoint
void lcl_clearIfNoValuesButTextIsContained( VDataSequence& rData, const uno::Reference<data::XDataSequence>& xDataSequence )
{
//#i71686#, #i101968#, #i102428#
- sal_Int32 nCount = rData.Doubles.getLength();
+ sal_Int32 nCount = rData.m_aValues.getLength();
for( sal_Int32 i = 0; i < nCount; ++i )
{
- if( !std::isnan( rData.Doubles[i] ) )
+ if( !std::isnan( rData.m_aValues[i] ) )
return;
}
//no double value is contained
@@ -137,7 +141,7 @@ void lcl_maybeReplaceNanWithZero( double& rfValue, sal_Int32 nMissingValueTreatm
}
-VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
+VDataSeries::VDataSeries( const rtl::Reference< DataSeries >& xDataSeries )
: m_nPolygonIndex(0)
, m_fLogicMinX(0.0)
, m_fLogicMaxX(0.0)
@@ -159,24 +163,20 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
, mpOldSeries(nullptr)
, mnPercent(0.0)
{
- m_xDataSeriesProps.set(m_xDataSeries, css::uno::UNO_QUERY);
- uno::Reference<data::XDataSource> xDataSource( xDataSeries, uno::UNO_QUERY );
+ m_xDataSeriesProps = m_xDataSeries;
- uno::Sequence< uno::Reference<
- chart2::data::XLabeledDataSequence > > aDataSequences =
- xDataSource->getDataSequences();
+ const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > & aDataSequences =
+ m_xDataSeries->getDataSequences2();
- for(sal_Int32 nN = aDataSequences.getLength();nN--;)
+ for(sal_Int32 nN = aDataSequences.size();nN--;)
{
- if(!aDataSequences[nN].is())
- continue;
uno::Reference<data::XDataSequence> xDataSequence( aDataSequences[nN]->getValues());
uno::Reference<beans::XPropertySet> xProp(xDataSequence, uno::UNO_QUERY );
if( xProp.is())
{
try
{
- uno::Any aARole = xProp->getPropertyValue("Role");
+ uno::Any aARole = xProp->getPropertyValue(u"Role"_ustr);
OUString aRole;
aARole >>= aRole;
@@ -226,18 +226,17 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
m_nPointCount = m_aValues_Y_Last.getLength();
}
- uno::Reference<beans::XPropertySet> xProp(xDataSeries, uno::UNO_QUERY );
- if( !xProp.is())
+ if( !xDataSeries.is())
return;
try
{
- //get AttributedDataPoints
- xProp->getPropertyValue("AttributedDataPoints") >>= m_aAttributedDataPointIndexList;
+ // "AttributedDataPoints"
+ xDataSeries->getFastPropertyValue(PROP_DATASERIES_ATTRIBUTED_DATA_POINTS) >>= m_aAttributedDataPointIndexList;
- xProp->getPropertyValue("StackingDirection") >>= m_eStackingDirection;
+ xDataSeries->getFastPropertyValue(PROP_DATASERIES_STACKING_DIRECTION) >>= m_eStackingDirection; // "StackingDirection"
- xProp->getPropertyValue("AttachedAxisIndex") >>= m_nAxisIndex;
+ xDataSeries->getFastPropertyValue(PROP_DATASERIES_ATTACHED_AXIS_INDEX) >>= m_nAxisIndex; // "AttachedAxisIndex"
if(m_nAxisIndex<0)
m_nAxisIndex=0;
}
@@ -253,7 +252,7 @@ VDataSeries::~VDataSeries()
void VDataSeries::doSortByXValues()
{
- if( !(m_aValues_X.is() && m_aValues_X.Doubles.hasElements()) )
+ if( !(m_aValues_X.is() && m_aValues_X.m_aValues.hasElements()) )
return;
//prepare a vector for sorting
@@ -262,9 +261,9 @@ void VDataSeries::doSortByXValues()
for( nPointIndex=0; nPointIndex < m_nPointCount; nPointIndex++ )
{
aTmp.push_back(
- { ((nPointIndex < m_aValues_X.Doubles.getLength()) ? m_aValues_X.Doubles[nPointIndex]
+ { ((nPointIndex < m_aValues_X.m_aValues.getLength()) ? m_aValues_X.m_aValues[nPointIndex]
: std::numeric_limits<double>::quiet_NaN()),
- ((nPointIndex < m_aValues_Y.Doubles.getLength()) ? m_aValues_Y.Doubles[nPointIndex]
+ ((nPointIndex < m_aValues_Y.m_aValues.getLength()) ? m_aValues_Y.m_aValues[nPointIndex]
: std::numeric_limits<double>::quiet_NaN())
}
);
@@ -274,10 +273,10 @@ void VDataSeries::doSortByXValues()
std::stable_sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() );
//fill the sorted points back to the members
- m_aValues_X.Doubles.realloc( m_nPointCount );
- auto pDoublesX = m_aValues_X.Doubles.getArray();
- m_aValues_Y.Doubles.realloc( m_nPointCount );
- auto pDoublesY = m_aValues_Y.Doubles.getArray();
+ m_aValues_X.m_aValues.realloc( m_nPointCount );
+ auto pDoublesX = m_aValues_X.m_aValues.getArray();
+ m_aValues_Y.m_aValues.realloc( m_nPointCount );
+ auto pDoublesY = m_aValues_Y.m_aValues.getArray();
for( nPointIndex=0; nPointIndex < m_nPointCount; nPointIndex++ )
{
@@ -288,18 +287,18 @@ void VDataSeries::doSortByXValues()
void VDataSeries::releaseShapes()
{
- m_xGroupShape.set(nullptr);
- m_xLabelsGroupShape.set(nullptr);
- m_xErrorXBarsGroupShape.set(nullptr);
- m_xErrorYBarsGroupShape.set(nullptr);
- m_xFrontSubGroupShape.set(nullptr);
- m_xBackSubGroupShape.set(nullptr);
+ m_xGroupShape.clear();
+ m_xLabelsGroupShape.clear();
+ m_xErrorXBarsGroupShape.clear();
+ m_xErrorYBarsGroupShape.clear();
+ m_xFrontSubGroupShape.clear();
+ m_xBackSubGroupShape.clear();
m_aPolyPolygonShape3D.clear();
m_nPolygonIndex = 0;
}
-const uno::Reference<css::chart2::XDataSeries>& VDataSeries::getModel() const
+const rtl::Reference<::chart::DataSeries>& VDataSeries::getModel() const
{
return m_xDataSeries;
}
@@ -426,10 +425,10 @@ double VDataSeries::getXValue( sal_Int32 index ) const
{
if( 0<=index && index<m_aValues_X.getLength() )
{
- fRet = m_aValues_X.Doubles[index];
+ fRet = m_aValues_X.m_aValues[index];
if(mpOldSeries && index < mpOldSeries->m_aValues_X.getLength())
{
- double nOldVal = mpOldSeries->m_aValues_X.Doubles[index];
+ double nOldVal = mpOldSeries->m_aValues_X.m_aValues[index];
fRet = nOldVal + (fRet - nOldVal) * mnPercent;
}
}
@@ -451,10 +450,10 @@ double VDataSeries::getYValue( sal_Int32 index ) const
{
if( 0<=index && index<m_aValues_Y.getLength() )
{
- fRet = m_aValues_Y.Doubles[index];
+ fRet = m_aValues_Y.m_aValues[index];
if(mpOldSeries && index < mpOldSeries->m_aValues_Y.getLength())
{
- double nOldVal = mpOldSeries->m_aValues_Y.Doubles[index];
+ double nOldVal = mpOldSeries->m_aValues_Y.m_aValues[index];
fRet = nOldVal + (fRet - nOldVal) * mnPercent;
}
}
@@ -528,7 +527,7 @@ double VDataSeries::getBubble_Size( sal_Int32 index ) const
bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
{
- OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString(CHART_UNONAME_NUMFMT);
+ OUString aPropName = bForPercentage ? u"PercentageNumberFormat"_ustr : CHART_UNONAME_NUMFMT;
bool bHasNumberFormat = false;
bool bLinkToSource = true;
uno::Reference< beans::XPropertySet > xPointProp( getPropertiesOfPoint( nPointIndex ));
@@ -542,7 +541,7 @@ bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPerce
}
sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
{
- OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString(CHART_UNONAME_NUMFMT);
+ OUString aPropName = bForPercentage ? u"PercentageNumberFormat"_ustr : CHART_UNONAME_NUMFMT;
sal_Int32 nNumberFormat = -1;
uno::Reference< beans::XPropertySet > xPointProp( getPropertiesOfPoint( nPointIndex ));
if( xPointProp.is() )
@@ -574,14 +573,14 @@ sal_Int32 VDataSeries::detectNumberFormatKey( sal_Int32 index ) const
return nRet;
}
-sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Reference< chart2::XChartType >& xChartType, bool bSwapXAndY ) const
+sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const rtl::Reference< ChartType >& xChartType, bool bSwapXAndY ) const
{
sal_Int32 nLabelPlacement=0;
try
{
uno::Reference< beans::XPropertySet > xPointProps( getPropertiesOfPoint( nPointIndex ) );
if( xPointProps.is() )
- xPointProps->getPropertyValue("LabelPlacement") >>= nLabelPlacement;
+ xPointProps->getPropertyValue(u"LabelPlacement"_ustr) >>= nLabelPlacement;
const uno::Sequence < sal_Int32 > aAvailablePlacements( ChartTypeHelper::getSupportedLabelPlacements(
xChartType, bSwapXAndY, m_xDataSeries ) );
@@ -595,7 +594,7 @@ sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Refe
{
nLabelPlacement = aAvailablePlacements[0];
if( xPointProps.is() )
- xPointProps->setPropertyValue("LabelPlacement", uno::Any(nLabelPlacement));
+ xPointProps->setPropertyValue(u"LabelPlacement"_ustr, uno::Any(nLabelPlacement));
return nLabelPlacement;
}
@@ -615,7 +614,7 @@ awt::Point VDataSeries::getLabelPosition( awt::Point aTextShapePos, sal_Int32 nP
{
RelativePosition aCustomLabelPosition;
uno::Reference< beans::XPropertySet > xPointProps(getPropertiesOfPoint(nPointIndex));
- if( xPointProps.is() && (xPointProps->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition))
+ if( xPointProps.is() && (xPointProps->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition))
{
aPos.X = static_cast<sal_Int32>(aCustomLabelPosition.Primary * m_aReferenceSize.Width) + aTextShapePos.X;
aPos.Y = static_cast<sal_Int32>(aCustomLabelPosition.Secondary * m_aReferenceSize.Height) + aTextShapePos.Y;
@@ -637,7 +636,7 @@ bool VDataSeries::isLabelCustomPos(sal_Int32 nPointIndex) const
{
uno::Reference< beans::XPropertySet > xPointProps(m_xDataSeries->getDataPointByIndex(nPointIndex));
RelativePosition aCustomLabelPosition;
- if( xPointProps.is() && (xPointProps->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition) )
+ if( xPointProps.is() && (xPointProps->getPropertyValue(u"CustomLabelPosition"_ustr) >>= aCustomLabelPosition) )
bCustom = true;
}
}
@@ -648,6 +647,26 @@ bool VDataSeries::isLabelCustomPos(sal_Int32 nPointIndex) const
return bCustom;
}
+awt::Size VDataSeries::getLabelCustomSize(sal_Int32 nPointIndex) const
+{
+ awt::Size aSize(-1, -1);
+ try
+ {
+ RelativeSize aCustomLabelSize;
+ const uno::Reference<beans::XPropertySet> xPointProps(getPropertiesOfPoint(nPointIndex));
+ if (xPointProps.is() && (xPointProps->getPropertyValue(u"CustomLabelSize"_ustr) >>= aCustomLabelSize))
+ {
+ aSize.Width = static_cast<sal_Int32>(aCustomLabelSize.Primary * m_aReferenceSize.Width);
+ aSize.Height = static_cast<sal_Int32>(aCustomLabelSize.Secondary * m_aReferenceSize.Height);
+ }
+ }
+ catch (const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+ return aSize;
+}
+
double VDataSeries::getMinimumofAllDifferentYValues( sal_Int32 index ) const
{
double fMin = std::numeric_limits<double>::infinity();
@@ -724,12 +743,12 @@ uno::Sequence< double > const & VDataSeries::getAllX() const
{
//init x values from category indexes
//first category (index 0) matches with real number 1.0
- m_aValues_X.Doubles.realloc( m_nPointCount );
- auto pDoubles = m_aValues_X.Doubles.getArray();
+ m_aValues_X.m_aValues.realloc( m_nPointCount );
+ auto pDoubles = m_aValues_X.m_aValues.getArray();
for(sal_Int32 nN=m_aValues_X.getLength();nN--;)
pDoubles[nN] = nN+1;
}
- return m_aValues_X.Doubles;
+ return m_aValues_X.m_aValues;
}
uno::Sequence< double > const & VDataSeries::getAllY() const
@@ -738,19 +757,19 @@ uno::Sequence< double > const & VDataSeries::getAllY() const
{
//init y values from indexes
//first y-value (index 0) matches with real number 1.0
- m_aValues_Y.Doubles.realloc( m_nPointCount );
- auto pDoubles = m_aValues_Y.Doubles.getArray();
+ m_aValues_Y.m_aValues.realloc( m_nPointCount );
+ auto pDoubles = m_aValues_Y.m_aValues.getArray();
for(sal_Int32 nN=m_aValues_Y.getLength();nN--;)
pDoubles[nN] = nN+1;
}
- return m_aValues_Y.Doubles;
+ return m_aValues_Y.m_aValues;
}
double VDataSeries::getXMeanValue() const
{
if( std::isnan( m_fXMeanValue ) )
{
- uno::Reference< XRegressionCurveCalculator > xCalculator( RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( u"com.sun.star.chart2.MeanValueRegressionCurve" ) );
+ rtl::Reference< RegressionCurveCalculator > xCalculator( RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( u"com.sun.star.chart2.MeanValueRegressionCurve" ) );
uno::Sequence< double > aXValuesDummy;
xCalculator->recalculateRegression( aXValuesDummy, getAllX() );
m_fXMeanValue = xCalculator->getCurveValue( 1.0 );
@@ -762,7 +781,7 @@ double VDataSeries::getYMeanValue() const
{
if( std::isnan( m_fYMeanValue ) )
{
- uno::Reference< XRegressionCurveCalculator > xCalculator(
+ rtl::Reference< RegressionCurveCalculator > xCalculator(
RegressionCurveHelper::createRegressionCurveCalculatorByServiceName(u"com.sun.star.chart2.MeanValueRegressionCurve"));
uno::Sequence< double > aXValuesDummy;
xCalculator->recalculateRegression( aXValuesDummy, getAllY() );
@@ -771,26 +790,26 @@ double VDataSeries::getYMeanValue() const
return m_fYMeanValue;
}
-static std::unique_ptr<Symbol> getSymbolPropertiesFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp )
+static std::optional<Symbol> getSymbolPropertiesFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp )
{
- std::unique_ptr< Symbol > apSymbolProps( new Symbol() );
+ Symbol aSymbolProps;
try
{
- if( xProp->getPropertyValue("Symbol") >>= *apSymbolProps )
+ if( xProp->getPropertyValue(u"Symbol"_ustr) >>= aSymbolProps )
{
//use main color to fill symbols
- xProp->getPropertyValue("Color") >>= apSymbolProps->FillColor;
+ xProp->getPropertyValue(u"Color"_ustr) >>= aSymbolProps.FillColor;
// border of symbols always same as fill color
- apSymbolProps->BorderColor = apSymbolProps->FillColor;
+ aSymbolProps.BorderColor = aSymbolProps.FillColor;
}
else
- apSymbolProps.reset();
+ return std::nullopt;
}
catch(const uno::Exception &)
{
TOOLS_WARN_EXCEPTION("chart2", "" );
}
- return apSymbolProps;
+ return aSymbolProps;
}
Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) const
@@ -799,38 +818,38 @@ Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) const
if( isAttributedDataPoint( index ) )
{
adaptPointCache( index );
- if (!m_apSymbolProperties_AttributedPoint)
- m_apSymbolProperties_AttributedPoint
+ if (!m_oSymbolProperties_AttributedPoint)
+ m_oSymbolProperties_AttributedPoint
= getSymbolPropertiesFromPropertySet(getPropertiesOfPoint(index));
- pRet = m_apSymbolProperties_AttributedPoint.get();
+ pRet = &*m_oSymbolProperties_AttributedPoint;
//if a single data point does not have symbols but the dataseries itself has symbols
//we create an invisible symbol shape to enable selection of that point
if( !pRet || pRet->Style == SymbolStyle_NONE )
{
- if (!m_apSymbolProperties_Series)
- m_apSymbolProperties_Series
+ if (!m_oSymbolProperties_Series)
+ m_oSymbolProperties_Series
= getSymbolPropertiesFromPropertySet(getPropertiesOfSeries());
- if( m_apSymbolProperties_Series && m_apSymbolProperties_Series->Style != SymbolStyle_NONE )
+ if( m_oSymbolProperties_Series && m_oSymbolProperties_Series->Style != SymbolStyle_NONE )
{
- if (!m_apSymbolProperties_InvisibleSymbolForSelection)
+ if (!m_oSymbolProperties_InvisibleSymbolForSelection)
{
- m_apSymbolProperties_InvisibleSymbolForSelection.reset(new Symbol);
- m_apSymbolProperties_InvisibleSymbolForSelection->Style = SymbolStyle_STANDARD;
- m_apSymbolProperties_InvisibleSymbolForSelection->StandardSymbol = 0;//square
- m_apSymbolProperties_InvisibleSymbolForSelection->Size = com::sun::star::awt::Size(0, 0);//tdf#126033
- m_apSymbolProperties_InvisibleSymbolForSelection->BorderColor = 0xff000000;//invisible
- m_apSymbolProperties_InvisibleSymbolForSelection->FillColor = 0xff000000;//invisible
+ m_oSymbolProperties_InvisibleSymbolForSelection.emplace();
+ m_oSymbolProperties_InvisibleSymbolForSelection->Style = SymbolStyle_STANDARD;
+ m_oSymbolProperties_InvisibleSymbolForSelection->StandardSymbol = 0;//square
+ m_oSymbolProperties_InvisibleSymbolForSelection->Size = css::awt::Size(0, 0);//tdf#126033
+ m_oSymbolProperties_InvisibleSymbolForSelection->BorderColor = 0xff000000;//invisible
+ m_oSymbolProperties_InvisibleSymbolForSelection->FillColor = 0xff000000;//invisible
}
- pRet = m_apSymbolProperties_InvisibleSymbolForSelection.get();
+ pRet = &*m_oSymbolProperties_InvisibleSymbolForSelection;
}
}
}
else
{
- if (!m_apSymbolProperties_Series)
- m_apSymbolProperties_Series
+ if (!m_oSymbolProperties_Series)
+ m_oSymbolProperties_Series
= getSymbolPropertiesFromPropertySet(getPropertiesOfSeries());
- pRet = m_apSymbolProperties_Series.get();
+ pRet = &*m_oSymbolProperties_Series;
}
if( pRet && pRet->Style == SymbolStyle_AUTO )
@@ -874,7 +893,7 @@ bool VDataSeries::hasPointOwnColor( sal_Int32 index ) const
try
{
uno::Reference< beans::XPropertyState > xPointState( getPropertiesOfPoint(index), uno::UNO_QUERY_THROW );
- return (xPointState->getPropertyState("Color") != beans::PropertyState_DEFAULT_VALUE );
+ return (xPointState->getPropertyState(u"Color"_ustr) != beans::PropertyState_DEFAULT_VALUE );
}
catch(const uno::Exception&)
{
@@ -899,9 +918,8 @@ bool VDataSeries::isAttributedDataPoint( sal_Int32 index ) const
bool VDataSeries::isVaryColorsByPoint() const
{
bool bVaryColorsByPoint = false;
- Reference< beans::XPropertySet > xSeriesProp( getPropertiesOfSeries() );
- if( xSeriesProp.is() )
- xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint;
+ if( m_xDataSeries )
+ m_xDataSeries->getFastPropertyValue(PROP_DATASERIES_VARY_COLORS_BY_POINT) >>= bVaryColorsByPoint; // "VaryColorsByPoint"
return bVaryColorsByPoint;
}
@@ -912,14 +930,14 @@ uno::Reference< beans::XPropertySet > VDataSeries::getPropertiesOfPoint( sal_Int
return getPropertiesOfSeries();
}
-uno::Reference<beans::XPropertySet> VDataSeries::getPropertiesOfSeries() const
+const uno::Reference<beans::XPropertySet> & VDataSeries::getPropertiesOfSeries() const
{
return m_xDataSeriesProps;
}
-static std::unique_ptr<DataPointLabel> getDataPointLabelFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp )
+static std::optional<DataPointLabel> getDataPointLabelFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp )
{
- std::unique_ptr< DataPointLabel > apLabel( new DataPointLabel() );
+ std::optional< DataPointLabel > apLabel( std::in_place );
try
{
if( !(xProp->getPropertyValue(CHART_UNONAME_LABEL) >>= *apLabel) )
@@ -936,10 +954,10 @@ void VDataSeries::adaptPointCache( sal_Int32 nNewPointIndex ) const
{
if( m_nCurrentAttributedPoint != nNewPointIndex )
{
- m_apLabel_AttributedPoint.reset();
- m_apLabelPropNames_AttributedPoint.reset();
- m_apLabelPropValues_AttributedPoint.reset();
- m_apSymbolProperties_AttributedPoint.reset();
+ m_oLabel_AttributedPoint.reset();
+ m_oLabelPropNames_AttributedPoint.reset();
+ m_oLabelPropValues_AttributedPoint.reset();
+ m_oSymbolProperties_AttributedPoint.reset();
m_nCurrentAttributedPoint = nNewPointIndex;
}
}
@@ -950,17 +968,19 @@ DataPointLabel* VDataSeries::getDataPointLabel( sal_Int32 index ) const
if( isAttributedDataPoint( index ) )
{
adaptPointCache( index );
- if (!m_apLabel_AttributedPoint)
- m_apLabel_AttributedPoint
+ if (!m_oLabel_AttributedPoint)
+ m_oLabel_AttributedPoint
= getDataPointLabelFromPropertySet(getPropertiesOfPoint(index));
- pRet = m_apLabel_AttributedPoint.get();
+ if (m_oLabel_AttributedPoint)
+ pRet = &*m_oLabel_AttributedPoint;
}
else
{
- if (!m_apLabel_Series)
- m_apLabel_Series
+ if (!m_oLabel_Series)
+ m_oLabel_Series
= getDataPointLabelFromPropertySet(getPropertiesOfPoint(index));
- pRet = m_apLabel_Series.get();
+ if (m_oLabel_Series)
+ pRet = &*m_oLabel_Series;
}
if( !m_bAllowPercentValueInDataLabel )
{
@@ -989,33 +1009,33 @@ bool VDataSeries::getTextLabelMultiPropertyLists( sal_Int32 index
if( isAttributedDataPoint( index ) )
{
adaptPointCache( index );
- if (!m_apLabelPropValues_AttributedPoint)
+ if (!m_oLabelPropValues_AttributedPoint)
{
// Cache these properties for this point.
- m_apLabelPropNames_AttributedPoint.reset(new tNameSequence);
- m_apLabelPropValues_AttributedPoint.reset(new tAnySequence);
+ m_oLabelPropNames_AttributedPoint.emplace();
+ m_oLabelPropValues_AttributedPoint.emplace();
xTextProp.set( getPropertiesOfPoint( index ));
PropertyMapper::getTextLabelMultiPropertyLists(
- xTextProp, *m_apLabelPropNames_AttributedPoint, *m_apLabelPropValues_AttributedPoint);
+ xTextProp, *m_oLabelPropNames_AttributedPoint, *m_oLabelPropValues_AttributedPoint);
bDoDynamicFontResize = true;
}
- pPropNames = m_apLabelPropNames_AttributedPoint.get();
- pPropValues = m_apLabelPropValues_AttributedPoint.get();
+ pPropNames = &*m_oLabelPropNames_AttributedPoint;
+ pPropValues = &*m_oLabelPropValues_AttributedPoint;
}
else
{
- if (!m_apLabelPropValues_Series)
+ if (!m_oLabelPropValues_Series)
{
// Cache these properties for the whole series.
- m_apLabelPropNames_Series.reset(new tNameSequence);
- m_apLabelPropValues_Series.reset(new tAnySequence);
+ m_oLabelPropNames_Series.emplace();
+ m_oLabelPropValues_Series.emplace();
xTextProp.set( getPropertiesOfPoint( index ));
PropertyMapper::getTextLabelMultiPropertyLists(
- xTextProp, *m_apLabelPropNames_Series, *m_apLabelPropValues_Series);
+ xTextProp, *m_oLabelPropNames_Series, *m_oLabelPropValues_Series);
bDoDynamicFontResize = true;
}
- pPropNames = m_apLabelPropNames_Series.get();
- pPropValues = m_apLabelPropValues_Series.get();
+ pPropNames = &*m_oLabelPropNames_Series;
+ pPropValues = &*m_oLabelPropValues_Series;
}
if( bDoDynamicFontResize &&
@@ -1116,7 +1136,7 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN
bool VDataSeries::hasPropertyMapping(const OUString& rPropName ) const
{
- return m_PropertyMap.find(rPropName) != m_PropertyMap.end();
+ return m_PropertyMap.contains(rPropName);
}
} //namespace chart
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index 1dfe3653e4d1..d98910468dec 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -19,9 +19,11 @@
#include "VLegend.hxx"
#include "VButton.hxx"
+#include <Legend.hxx>
#include <PropertyMapper.hxx>
#include <ChartModel.hxx>
#include <ObjectIdentifier.hxx>
+#include <FormattedString.hxx>
#include <RelativePositionHelper.hxx>
#include <ShapeFactory.hxx>
#include <RelativeSizeHelper.hxx>
@@ -40,9 +42,10 @@
#include <com/sun/star/chart2/data/PivotTableFieldEntry.hpp>
#include <rtl/math.hxx>
#include <svl/ctloptions.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/UnitConversion.hxx>
+#include <utility>
#include <vector>
#include <algorithm>
@@ -67,13 +70,13 @@ double lcl_CalcViewFontSize(
double fResult = 10.0;
float fFontHeight( 0.0 );
- if( xProp.is() && ( xProp->getPropertyValue( "CharHeight") >>= fFontHeight ))
+ if( xProp.is() && ( xProp->getPropertyValue( u"CharHeight"_ustr) >>= fFontHeight ))
{
fResult = fFontHeight;
try
{
awt::Size aPropRefSize;
- if( (xProp->getPropertyValue( "ReferencePageSize") >>= aPropRefSize) &&
+ if( (xProp->getPropertyValue( u"ReferencePageSize"_ustr) >>= aPropRefSize) &&
(aPropRefSize.Height > 0))
{
fResult = ::chart::RelativeSizeHelper::calculate( fFontHeight, aPropRefSize, rReferenceSize );
@@ -102,7 +105,7 @@ void lcl_getProperties(
::chart::tPropertyNameValueMap aLineFillValueMap;
::chart::PropertyMapper::getValueMap( aLineFillValueMap, ::chart::PropertyMapper::getPropertyNameMapForFillAndLineProperties(), xLegendProp );
- aLineFillValueMap[ "LineJoint" ] <<= drawing::LineJoint_ROUND;
+ aLineFillValueMap[ u"LineJoint"_ustr ] <<= drawing::LineJoint_ROUND;
::chart::PropertyMapper::getMultiPropertyListsFromValueMap(
rOutLineFillProperties.first, rOutLineFillProperties.second, aLineFillValueMap );
@@ -111,31 +114,31 @@ void lcl_getProperties(
::chart::tPropertyNameValueMap aTextValueMap;
::chart::PropertyMapper::getValueMap( aTextValueMap, ::chart::PropertyMapper::getPropertyNameMapForCharacterProperties(), xLegendProp );
- aTextValueMap[ "TextAutoGrowHeight" ] <<= true;
- aTextValueMap[ "TextAutoGrowWidth" ] <<= true;
- aTextValueMap[ "TextHorizontalAdjust" ] <<= drawing::TextHorizontalAdjust_LEFT;
- aTextValueMap[ "TextMaximumFrameWidth" ] <<= rReferenceSize.Width; //needs to be overwritten by actual available space in the legend
+ aTextValueMap[ u"TextAutoGrowHeight"_ustr ] <<= true;
+ aTextValueMap[ u"TextAutoGrowWidth"_ustr ] <<= true;
+ aTextValueMap[ u"TextHorizontalAdjust"_ustr ] <<= drawing::TextHorizontalAdjust_LEFT;
+ aTextValueMap[ u"TextMaximumFrameWidth"_ustr ] <<= rReferenceSize.Width; //needs to be overwritten by actual available space in the legend
// recalculate font size
awt::Size aPropRefSize;
float fFontHeight( 0.0 );
- if( (xLegendProp->getPropertyValue( "ReferencePageSize") >>= aPropRefSize) &&
+ if( (xLegendProp->getPropertyValue( u"ReferencePageSize"_ustr) >>= aPropRefSize) &&
(aPropRefSize.Height > 0) &&
- (aTextValueMap[ "CharHeight" ] >>= fFontHeight) )
+ (aTextValueMap[ u"CharHeight"_ustr ] >>= fFontHeight) )
{
- aTextValueMap[ "CharHeight" ] <<=
+ aTextValueMap[ u"CharHeight"_ustr ] <<=
static_cast< float >(
::chart::RelativeSizeHelper::calculate( fFontHeight, aPropRefSize, rReferenceSize ));
- if( aTextValueMap[ "CharHeightAsian" ] >>= fFontHeight )
+ if( aTextValueMap[ u"CharHeightAsian"_ustr ] >>= fFontHeight )
{
- aTextValueMap[ "CharHeightAsian" ] <<=
+ aTextValueMap[ u"CharHeightAsian"_ustr ] <<=
static_cast< float >(
::chart::RelativeSizeHelper::calculate( fFontHeight, aPropRefSize, rReferenceSize ));
}
- if( aTextValueMap[ "CharHeightComplex" ] >>= fFontHeight )
+ if( aTextValueMap[ u"CharHeightComplex"_ustr ] >>= fFontHeight )
{
- aTextValueMap[ "CharHeightComplex" ] <<=
+ aTextValueMap[ u"CharHeightComplex"_ustr ] <<=
static_cast< float >(
::chart::RelativeSizeHelper::calculate( fFontHeight, aPropRefSize, rReferenceSize ));
}
@@ -158,14 +161,17 @@ awt::Size lcl_createTextShapes(
try
{
OUString aLabelString;
- Sequence< Reference< XFormattedString2 > > aLabelSeq = rEntry.aLabel;
- for( sal_Int32 i = 0; i < aLabelSeq.getLength(); ++i )
+ if (rEntry.xLabel)
{
- // todo: support more than one text range
- if( i == 1 )
- break;
+ // tdf#150034 limit legend label text
+ if (rEntry.xLabel->getString().getLength() > 520)
+ {
+ sal_Int32 nIndex = rEntry.xLabel->getString().indexOf(' ', 500);
+ rEntry.xLabel->setString(
+ rEntry.xLabel->getString().copy(0, nIndex > 500 ? nIndex : 500));
+ }
- aLabelString += aLabelSeq[i]->getString();
+ aLabelString += rEntry.xLabel->getString();
// workaround for Issue #i67540#
if( aLabelString.isEmpty())
aLabelString = " ";
@@ -324,7 +330,7 @@ awt::Size lcl_placeLegendEntries(
sal_Int32 nMaxColumnCount=-1;
for( sal_Int32 nN=0; nN<static_cast<sal_Int32>(aTextShapes.size()); nN++ )
{
- rtl::Reference<SvxShapeText> xShape( aTextShapes[nN] );
+ const rtl::Reference<SvxShapeText>& xShape( aTextShapes[nN] );
if( !xShape.is() )
continue;
awt::Size aSize( xShape->getSize() );
@@ -414,9 +420,9 @@ awt::Size lcl_placeLegendEntries(
{
try
{
- OUString aLabelString = rEntries[0].aLabel[0]->getString();
- static const OUStringLiteral sDots = u"...";
- for (sal_Int32 nNewLen = aLabelString.getLength() - sDots.getLength(); nNewLen > 0; nNewLen--)
+ OUString aLabelString = rEntries[0].xLabel->getString();
+ static constexpr OUString sDots = u"..."_ustr;
+ for (sal_Int32 nNewLen = aLabelString.getLength() - sDots.getLength(); nNewLen > 0; )
{
OUString aNewLabel = aLabelString.subView(0, nNewLen) + sDots;
rtl::Reference<SvxShapeText> xEntry = ShapeFactory::createText(
@@ -429,15 +435,21 @@ awt::Size lcl_placeLegendEntries(
if (rRemainingSpace.Width - nWidth >= 0)
{
aTextShapes.push_back(xEntry);
- rEntries[0].aLabel[0]->setString(aNewLabel);
+ rEntries[0].xLabel->setString(aNewLabel);
aRowHeights[0] = nSumHeight;
aColumnWidths[0] = nWidth;
break;
}
}
DrawModelWrapper::removeShape(xEntry);
+ // The intention here is to make pathological cases with extremely large labels
+ // converge a little faster
+ if (nNewLen > 10 && std::abs(nRemainingSpace) > nSumHeight / 10)
+ nNewLen -= nNewLen / 10;
+ else
+ --nNewLen;
}
- if (aTextShapes.size() == 0)
+ if (aTextShapes.empty())
{
DrawModelWrapper::removeShape(rEntries[0].xSymbol);
rEntries.pop_back();
@@ -574,7 +586,7 @@ awt::Size lcl_placeLegendEntries(
break;
// text shape
- rtl::Reference<SvxShapeText> xTextShape( aTextShapes[nEntry] );
+ const rtl::Reference<SvxShapeText>& xTextShape( aTextShapes[nEntry] );
if( xTextShape.is() )
{
awt::Size aTextSize( xTextShape->getSize() );
@@ -795,12 +807,12 @@ bool lcl_shouldSymbolsBePlacedOnTheLeftSide( const Reference< beans::XPropertySe
bool bSymbolsLeftSide = true;
try
{
- if( SvtCTLOptions().IsCTLFontEnabled() )
+ if( SvtCTLOptions::IsCTLFontEnabled() )
{
if(xLegendProp.is())
{
sal_Int16 nWritingMode=-1;
- if( xLegendProp->getPropertyValue( "WritingMode" ) >>= nWritingMode )
+ if( xLegendProp->getPropertyValue( u"WritingMode"_ustr ) >>= nWritingMode )
{
if( nWritingMode == text::WritingMode2::PAGE )
nWritingMode = nDefaultWritingMode;
@@ -869,13 +881,13 @@ std::vector<std::shared_ptr<VButton>> lcl_createButtons(
} // anonymous namespace
VLegend::VLegend(
- const Reference< XLegend > & xLegend,
+ rtl::Reference< Legend > xLegend,
const Reference< uno::XComponentContext > & xContext,
std::vector< LegendEntryProvider* >&& rLegendEntryProviderList,
- const rtl::Reference<SvxShapeGroupAnyD>& xTargetPage,
+ rtl::Reference<SvxShapeGroupAnyD> xTargetPage,
ChartModel& rModel )
- : m_xTarget(xTargetPage)
- , m_xLegend(xLegend)
+ : m_xTarget(std::move(xTargetPage))
+ , m_xLegend(std::move(xLegend))
, mrModel(rModel)
, m_xContext(xContext)
, m_aLegendEntryProviderList(std::move(rLegendEntryProviderList))
@@ -888,7 +900,7 @@ void VLegend::setDefaultWritingMode( sal_Int16 nDefaultWritingMode )
m_nDefaultWritingMode = nDefaultWritingMode;
}
-bool VLegend::isVisible( const Reference< XLegend > & xLegend )
+bool VLegend::isVisible( const rtl::Reference< Legend > & xLegend )
{
if( ! xLegend.is())
return false;
@@ -896,8 +908,7 @@ bool VLegend::isVisible( const Reference< XLegend > & xLegend )
bool bShow = false;
try
{
- Reference< beans::XPropertySet > xLegendProp( xLegend, uno::UNO_QUERY_THROW );
- xLegendProp->getPropertyValue( "Show") >>= bShow;
+ xLegend->getPropertyValue( u"Show"_ustr) >>= bShow;
}
catch( const uno::Exception & )
{
@@ -918,7 +929,7 @@ void VLegend::createShapes(
try
{
//create shape and add to page
- OUString aLegendParticle( ObjectIdentifier::createParticleForLegend( mrModel ) );
+ OUString aLegendParticle( ObjectIdentifier::createParticleForLegend( &mrModel ) );
m_xShape = ShapeFactory::createGroup2D( m_xTarget,
ObjectIdentifier::createClassifiedIdentifierForParticle( aLegendParticle ) );
@@ -930,36 +941,32 @@ void VLegend::createShapes(
tPropertyValues aLineFillProperties;
tPropertyValues aTextProperties;
- Reference< beans::XPropertySet > xLegendProp( m_xLegend, uno::UNO_QUERY );
css::chart::ChartLegendExpansion eExpansion = css::chart::ChartLegendExpansion_HIGH;
awt::Size aLegendSize( rAvailableSpace );
bool bCustom = false;
LegendPosition eLegendPosition = LegendPosition_LINE_END;
- if (xLegendProp.is())
+ // get Expansion property
+ m_xLegend->getPropertyValue(u"Expansion"_ustr) >>= eExpansion;
+ if( eExpansion == css::chart::ChartLegendExpansion_CUSTOM )
{
- // get Expansion property
- xLegendProp->getPropertyValue("Expansion") >>= eExpansion;
- if( eExpansion == css::chart::ChartLegendExpansion_CUSTOM )
+ RelativeSize aRelativeSize;
+ if (m_xLegend->getPropertyValue(u"RelativeSize"_ustr) >>= aRelativeSize)
{
- RelativeSize aRelativeSize;
- if (xLegendProp->getPropertyValue("RelativeSize") >>= aRelativeSize)
- {
- aLegendSize.Width = static_cast<sal_Int32>(::rtl::math::approxCeil( aRelativeSize.Primary * rPageSize.Width ));
- aLegendSize.Height = static_cast<sal_Int32>(::rtl::math::approxCeil( aRelativeSize.Secondary * rPageSize.Height ));
- bCustom = true;
- }
- else
- {
- eExpansion = css::chart::ChartLegendExpansion_HIGH;
- }
+ aLegendSize.Width = static_cast<sal_Int32>(::rtl::math::approxCeil( aRelativeSize.Primary * rPageSize.Width ));
+ aLegendSize.Height = static_cast<sal_Int32>(::rtl::math::approxCeil( aRelativeSize.Secondary * rPageSize.Height ));
+ bCustom = true;
+ }
+ else
+ {
+ eExpansion = css::chart::ChartLegendExpansion_HIGH;
}
- xLegendProp->getPropertyValue("AnchorPosition") >>= eLegendPosition;
- lcl_getProperties( xLegendProp, aLineFillProperties, aTextProperties, rPageSize );
}
+ m_xLegend->getPropertyValue(u"AnchorPosition"_ustr) >>= eLegendPosition;
+ lcl_getProperties( m_xLegend, aLineFillProperties, aTextProperties, rPageSize );
// create entries
- double fViewFontSize = lcl_CalcViewFontSize( xLegendProp, rPageSize );//todo
+ double fViewFontSize = lcl_CalcViewFontSize( m_xLegend, rPageSize );//todo
// #i109336# Improve auto positioning in chart
sal_Int32 nSymbolHeight = static_cast< sal_Int32 >( fViewFontSize * 0.6 );
sal_Int32 nSymbolWidth = nSymbolHeight;
@@ -985,13 +992,13 @@ void VLegend::createShapes(
if (pLegendEntryProvider)
{
std::vector<ViewLegendEntry> aNewEntries = pLegendEntryProvider->createLegendEntries(
- aMaxSymbolExtent, eLegendPosition, xLegendProp,
+ aMaxSymbolExtent, eLegendPosition, m_xLegend,
xLegendContainer, m_xContext, mrModel);
aViewEntries.insert( aViewEntries.end(), aNewEntries.begin(), aNewEntries.end() );
}
}
- bool bSymbolsLeftSide = lcl_shouldSymbolsBePlacedOnTheLeftSide( xLegendProp, m_nDefaultWritingMode );
+ bool bSymbolsLeftSide = lcl_shouldSymbolsBePlacedOnTheLeftSide( m_xLegend, m_nDefaultWritingMode );
uno::Reference<chart2::data::XPivotTableDataProvider> xPivotTableDataProvider( mrModel.getDataProvider(), uno::UNO_QUERY );
bool bIsPivotChart = xPivotTableDataProvider.is();
@@ -1033,7 +1040,7 @@ void VLegend::createShapes(
aLineFillProperties.second, ShapeFactory::StackPosition::Bottom);
//because of this name this border will be used for marking the legend
- ShapeFactory::setShapeName(xBorder, "MarkHandles");
+ ShapeFactory::setShapeName(xBorder, u"MarkHandles"_ustr);
}
}
}
@@ -1055,18 +1062,17 @@ void VLegend::changePosition(
{
// determine position and alignment depending on default position
awt::Size aLegendSize = m_xShape->getSize();
- Reference< beans::XPropertySet > xLegendProp( m_xLegend, uno::UNO_QUERY_THROW );
chart2::RelativePosition aRelativePosition;
bool bDefaultLegendSize = rDefaultLegendSize.Width != 0 || rDefaultLegendSize.Height != 0;
bool bAutoPosition =
- ! (xLegendProp->getPropertyValue( "RelativePosition") >>= aRelativePosition);
+ ! (m_xLegend->getPropertyValue( u"RelativePosition"_ustr) >>= aRelativePosition);
LegendPosition ePos = LegendPosition_LINE_END;
- xLegendProp->getPropertyValue( "AnchorPosition") >>= ePos;
+ m_xLegend->getPropertyValue( u"AnchorPosition"_ustr) >>= ePos;
bool bOverlay = false;
- xLegendProp->getPropertyValue("Overlay") >>= bOverlay;
+ m_xLegend->getPropertyValue(u"Overlay"_ustr) >>= bOverlay;
//calculate position
if( bAutoPosition )
{
diff --git a/chart2/source/view/main/VLegend.hxx b/chart2/source/view/main/VLegend.hxx
index c8931ce9f931..23eea74f5711 100644
--- a/chart2/source/view/main/VLegend.hxx
+++ b/chart2/source/view/main/VLegend.hxx
@@ -18,6 +18,8 @@
*/
#pragma once
+#include <Legend.hxx>
+
#include <com/sun/star/uno/Reference.hxx>
#include <rtl/ref.hxx>
#include <svx/unoshape.hxx>
@@ -26,10 +28,6 @@
namespace chart { class ChartModel; }
namespace com::sun::star::awt { struct Rectangle; }
namespace com::sun::star::awt { struct Size; }
-namespace com::sun::star::chart2 { class XLegend; }
-namespace com::sun::star::drawing { class XShape; }
-namespace com::sun::star::drawing { class XShapes; }
-namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace com::sun::star::uno { class XComponentContext; }
namespace chart
@@ -40,10 +38,10 @@ class LegendEntryProvider;
class VLegend
{
public:
- VLegend( const css::uno::Reference< css::chart2::XLegend > & xLegend,
+ VLegend( rtl::Reference< ::chart::Legend > xLegend,
const css::uno::Reference< css::uno::XComponentContext > & xContext,
std::vector< LegendEntryProvider* >&& rLegendEntryProviderList,
- const rtl::Reference<SvxShapeGroupAnyD>& xTargetPage,
+ rtl::Reference<SvxShapeGroupAnyD> xTargetPage,
ChartModel& rModel );
void setDefaultWritingMode( sal_Int16 nDefaultWritingMode );
@@ -67,11 +65,11 @@ public:
const css::awt::Size & rDefaultLegendSize );
static bool isVisible(
- const css::uno::Reference< css::chart2::XLegend > & xLegend );
+ const rtl::Reference< ::chart::Legend > & xLegend );
private:
rtl::Reference<SvxShapeGroupAnyD> m_xTarget;
- css::uno::Reference< css::chart2::XLegend > m_xLegend;
+ rtl::Reference<::chart::Legend> m_xLegend;
rtl::Reference< SvxShapeGroup > m_xShape;
ChartModel& mrModel;
diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index 451e32e45409..2fd20bef89c8 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -23,7 +23,7 @@
#include <com/sun/star/drawing/Position3D.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/drawing/Direction3D.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <sal/log.hxx>
using namespace ::com::sun::star;
@@ -128,7 +128,7 @@ rtl::Reference< SvxShapeGroup > VLegendSymbolFactory::createSymbol(
if( aSymbol.Style == chart2::SymbolStyle_STANDARD )
{
// take series color as fill color
- xLegendEntryProperties->getPropertyValue( "Color") >>= aSymbol.FillColor;
+ xLegendEntryProperties->getPropertyValue( u"Color"_ustr) >>= aSymbol.FillColor;
// border of symbols always same as fill color
aSymbol.BorderColor = aSymbol.FillColor;
diff --git a/chart2/source/view/main/VLineProperties.cxx b/chart2/source/view/main/VLineProperties.cxx
index 49a3b4e77642..53ff85d109e6 100644
--- a/chart2/source/view/main/VLineProperties.cxx
+++ b/chart2/source/view/main/VLineProperties.cxx
@@ -21,7 +21,7 @@
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/LineCap.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
@@ -45,12 +45,12 @@ void VLineProperties::initFromPropertySet(const uno::Reference<beans::XPropertyS
{
try
{
- Color = xProp->getPropertyValue("LineColor");
- LineStyle = xProp->getPropertyValue("LineStyle");
- Transparence = xProp->getPropertyValue("LineTransparence");
- Width = xProp->getPropertyValue("LineWidth");
- DashName = xProp->getPropertyValue("LineDashName");
- LineCap = xProp->getPropertyValue("LineCap");
+ Color = xProp->getPropertyValue(u"LineColor"_ustr);
+ LineStyle = xProp->getPropertyValue(u"LineStyle"_ustr);
+ Transparence = xProp->getPropertyValue(u"LineTransparence"_ustr);
+ Width = xProp->getPropertyValue(u"LineWidth"_ustr);
+ DashName = xProp->getPropertyValue(u"LineDashName"_ustr);
+ LineCap = xProp->getPropertyValue(u"LineCap"_ustr);
}
catch (const uno::Exception&)
{
diff --git a/chart2/source/view/main/VPolarTransformation.cxx b/chart2/source/view/main/VPolarTransformation.cxx
index 9d747d66c956..9ec2eea3fc58 100644
--- a/chart2/source/view/main/VPolarTransformation.cxx
+++ b/chart2/source/view/main/VPolarTransformation.cxx
@@ -18,7 +18,6 @@
*/
#include <VPolarTransformation.hxx>
-#include <CommonConverters.hxx>
using namespace ::com::sun::star;
diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx
index 4d90a2fb7503..83979fef3a78 100644
--- a/chart2/source/view/main/VTitle.cxx
+++ b/chart2/source/view/main/VTitle.cxx
@@ -20,18 +20,19 @@
#include "VTitle.hxx"
#include <CommonConverters.hxx>
#include <ShapeFactory.hxx>
+#include <Title.hxx>
#include <com/sun/star/chart2/XTitle.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
namespace chart
{
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-VTitle::VTitle( const uno::Reference< XTitle > & xTitle )
- : m_xTitle(xTitle)
+VTitle::VTitle( uno::Reference< XTitle > xTitle )
+ : m_xTitle(std::move(xTitle))
, m_fRotationAngleDegree(0.0)
, m_nXPos(0)
, m_nYPos(0)
@@ -83,7 +84,7 @@ void VTitle::changePosition( const awt::Point& rPos )
::basegfx::B2DHomMatrix aM;
aM.rotate( basegfx::deg2rad(-m_fRotationAngleDegree) );//#i78696#->#i80521#
aM.translate( m_nXPos, m_nYPos);
- m_xShape->SvxShape::setPropertyValue( "Transformation", uno::Any( B2DHomMatrixToHomogenMatrix3(aM) ) );
+ m_xShape->SvxShape::setPropertyValue( u"Transformation"_ustr, uno::Any( B2DHomMatrixToHomogenMatrix3(aM) ) );
}
catch( const uno::Exception& )
{
@@ -91,14 +92,13 @@ void VTitle::changePosition( const awt::Point& rPos )
}
}
-bool VTitle::isVisible(const uno::Reference< XTitle >& xTitle) {
+bool VTitle::isVisible(const rtl::Reference< Title >& xTitle) {
if (!xTitle.is()) {
return false;
}
bool bShow = true;
try {
- uno::Reference< beans::XPropertySet > xTitleProps(xTitle, uno::UNO_QUERY_THROW);
- xTitleProps->getPropertyValue("Visible") >>= bShow;
+ xTitle->getPropertyValue(u"Visible"_ustr) >>= bShow;
} catch (const uno::Exception &) {
DBG_UNHANDLED_EXCEPTION("chart2");
}
@@ -127,7 +127,7 @@ void VTitle::createShapes(
try
{
double fAngleDegree = 0;
- xTitleProperties->getPropertyValue( "TextRotation" ) >>= fAngleDegree;
+ xTitleProperties->getPropertyValue( u"TextRotation"_ustr ) >>= fAngleDegree;
m_fRotationAngleDegree += fAngleDegree;
}
catch( const uno::Exception& )
diff --git a/chart2/source/view/main/VTitle.hxx b/chart2/source/view/main/VTitle.hxx
index 566128b95a3b..957d322d2be6 100644
--- a/chart2/source/view/main/VTitle.hxx
+++ b/chart2/source/view/main/VTitle.hxx
@@ -27,18 +27,16 @@
namespace com::sun::star::awt { struct Point; }
namespace com::sun::star::chart2 { class XTitle; }
-namespace com::sun::star::drawing { class XShape; }
-namespace com::sun::star::drawing { class XShapes; }
-namespace com::sun::star::lang { class XMultiServiceFactory; }
class SvxShapeText;
namespace chart
{
+class Title;
class VTitle final
{
public:
- explicit VTitle( const css::uno::Reference< css::chart2::XTitle > & xTitle );
+ explicit VTitle( css::uno::Reference< css::chart2::XTitle > xTitle );
~VTitle();
void init( const rtl::Reference<SvxShapeGroupAnyD>& xTargetPage
@@ -54,7 +52,7 @@ public:
css::awt::Size getFinalSize() const;
void changePosition( const css::awt::Point& rPos );
static bool isVisible(
- const css::uno::Reference< css::chart2::XTitle > & xTitle);
+ const rtl::Reference< ::chart::Title > & xTitle);
private:
rtl::Reference<SvxShapeGroupAnyD> m_xTarget;
diff --git a/chart2/uiconfig/menubar/menubar.xml b/chart2/uiconfig/menubar/menubar.xml
index 354ebbc1903a..74d431e33e83 100644
--- a/chart2/uiconfig/menubar/menubar.xml
+++ b/chart2/uiconfig/menubar/menubar.xml
@@ -44,7 +44,6 @@
<menu:menu menu:id=".uno:ViewMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:AvailableToolbars"/>
- <menu:menuitem menu:id=".uno:StatusBarVisible"/>
<menu:menuitem menu:id=".uno:Sidebar" menu:style="text"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:DiagramData"/>
@@ -56,6 +55,7 @@
<menu:menuitem menu:id=".uno:InsertMenuLegend"/>
<menu:menuitem menu:id=".uno:InsertMenuAxes"/>
<menu:menuitem menu:id=".uno:InsertMenuGrids"/>
+ <menu:menuitem menu:id=".uno:InsertMenuDataTable"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:InsertMenuDataLabels"/>
<menu:menuitem menu:id=".uno:InsertMenuTrendlines"/>
@@ -119,6 +119,7 @@
<menu:menuitem menu:id=".uno:View3D"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:FormatSelection" menu:style="text"/>
+ <menu:menuitem menu:id=".uno:FontDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:TransformDialog" menu:style="text"/>
<menu:menu menu:id=".uno:ArrangeRow">
<menu:menupopup>
@@ -132,6 +133,8 @@
<menu:menupopup>
<menu:menu menu:id=".uno:MacrosMenu">
<menu:menupopup>
+ <menu:menuitem menu:id=".uno:MacroManager"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:MacroRecorder"/>
<menu:menuitem menu:id=".uno:RunMacro"/>
<menu:menuitem menu:id=".uno:BasicIDEAppear"/>
@@ -139,10 +142,9 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:MacroSignature"/>
<menu:menuitem menu:id=".uno:MacroOrganizer?TabId:short=1"/>
- <menu:menuseparator/>
- <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/>
<menu:menuitem menu:id="service:com.sun.star.deployment.ui.PackageManagerDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:ConfigureDialog" menu:style="text"/>
<menu:menuitem menu:id=".uno:OptionsTreeDialog"/>
diff --git a/chart2/uiconfig/toolbar/basicshapes.xml b/chart2/uiconfig/toolbar/basicshapes.xml
index 148245f66672..a0debaab8fd5 100644
--- a/chart2/uiconfig/toolbar/basicshapes.xml
+++ b/chart2/uiconfig/toolbar/basicshapes.xml
@@ -45,4 +45,6 @@
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.cross"/>
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.frame"/>
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.ring"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.sinusoid"/>
</toolbar:toolbar>
diff --git a/chart2/uiconfig/toolbar/toolbar.xml b/chart2/uiconfig/toolbar/toolbar.xml
index 809174ba206d..21105871c095 100644
--- a/chart2/uiconfig/toolbar/toolbar.xml
+++ b/chart2/uiconfig/toolbar/toolbar.xml
@@ -20,6 +20,7 @@
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
<toolbar:toolbaritem xlink:href=".uno:ChartElementSelector"/>
<toolbar:toolbaritem xlink:href=".uno:FormatSelection"/>
+ <toolbar:toolbaritem xlink:href=".uno:FontDialog"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:DiagramType"/>
<toolbar:toolbaritem xlink:href=".uno:DiagramArea"/>
diff --git a/chart2/uiconfig/ui/3dviewdialog.ui b/chart2/uiconfig/ui/3dviewdialog.ui
index 7225cf95950e..4f414bb7f996 100644
--- a/chart2/uiconfig/ui/3dviewdialog.ui
+++ b/chart2/uiconfig/ui/3dviewdialog.ui
@@ -1,35 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="3DViewDialog">
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
+ <property name="can-focus">False</property>
+ <property name="border-width">6</property>
<property name="title" translatable="yes" context="3dviewdialog|3DViewDialog">3D View</property>
<property name="modal">True</property>
- <property name="default_width">0</property>
- <property name="default_height">0</property>
- <property name="type_hint">dialog</property>
- <child>
- <placeholder/>
- </child>
+ <property name="default-width">0</property>
+ <property name="default-height">0</property>
+ <property name="type-hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
+ <property name="can-focus">False</property>
+ <property name="layout-style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label" translatable="yes" context="stock">_OK</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="has-default">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -42,8 +39,8 @@
<object class="GtkButton" id="cancel">
<property name="label" translatable="yes" context="stock">_Cancel</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -56,8 +53,8 @@
<object class="GtkButton" id="help">
<property name="label" translatable="yes" context="stock">_Help</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -71,18 +68,18 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
+ <property name="pack-type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="tabcontrol">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="scrollable">True</property>
- <property name="enable_popup">True</property>
+ <property name="enable-popup">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/chart2/uiconfig/ui/chardialog.ui b/chart2/uiconfig/ui/chardialog.ui
index ff84e760a430..171c171e2dc3 100644
--- a/chart2/uiconfig/ui/chardialog.ui
+++ b/chart2/uiconfig/ui/chardialog.ui
@@ -1,30 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="CharDialog">
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
+ <property name="can-focus">False</property>
+ <property name="border-width">6</property>
<property name="title" translatable="yes" context="chardialog|CharDialog">Character</property>
- <property name="type_hint">dialog</property>
- <child>
- <placeholder/>
- </child>
+ <property name="type-hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
+ <property name="can-focus">False</property>
+ <property name="layout-style">end</property>
<child>
<object class="GtkButton" id="reset">
<property name="label" translatable="yes" context="stock">_Reset</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -37,10 +34,10 @@
<object class="GtkButton" id="ok">
<property name="label" translatable="yes" context="stock">_OK</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="has-default">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -53,8 +50,8 @@
<object class="GtkButton" id="cancel">
<property name="label" translatable="yes" context="stock">_Cancel</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -67,8 +64,8 @@
<object class="GtkButton" id="help">
<property name="label" translatable="yes" context="stock">_Help</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -82,47 +79,23 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
+ <property name="pack-type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="tabcontrol">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="scrollable">True</property>
- <property name="enable_popup">True</property>
+ <property name="enable-popup">True</property>
<child>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
+ <property name="can-focus">False</property>
<child>
<placeholder/>
</child>
@@ -131,42 +104,18 @@
<child type="tab">
<object class="GtkLabel" id="font">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="chardialog|font">Font</property>
</object>
<packing>
- <property name="tab_fill">False</property>
+ <property name="tab-fill">False</property>
</packing>
</child>
<child>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
+ <property name="can-focus">False</property>
<child>
<placeholder/>
</child>
@@ -178,43 +127,19 @@
<child type="tab">
<object class="GtkLabel" id="fonteffects">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="chardialog|fonteffects">Font Effects</property>
</object>
<packing>
<property name="position">1</property>
- <property name="tab_fill">False</property>
+ <property name="tab-fill">False</property>
</packing>
</child>
<child>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
+ <property name="can-focus">False</property>
<child>
<placeholder/>
</child>
@@ -226,12 +151,12 @@
<child type="tab">
<object class="GtkLabel" id="position">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="chardialog|position">Position</property>
</object>
<packing>
<property name="position">2</property>
- <property name="tab_fill">False</property>
+ <property name="tab-fill">False</property>
</packing>
</child>
</object>
diff --git a/chart2/uiconfig/ui/chartcolorpalettepopup.ui b/chart2/uiconfig/ui/chartcolorpalettepopup.ui
new file mode 100644
index 000000000000..0bb803ae9a5b
--- /dev/null
+++ b/chart2/uiconfig/ui/chartcolorpalettepopup.ui
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.40.0 -->
+<interface domain="chart">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkPopover" id="ColorPaletteWindow">
+ <property name="can-focus">False</property>
+ <child>
+ <object class="GtkBox" id="container">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <!-- n-columns=1 n-rows=4 -->
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="border-width">6</property>
+ <property name="row-spacing">3</property>
+ <property name="column-spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-bottom">1</property>
+ <property name="label" translatable="yes" context="chartcolorpalettepopup|colorfulwin">Colorful</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ <accessibility>
+ <relation type="label-for" target="colorful_palettes"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="colorfulwin">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="colorful_palettes">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <accessibility>
+ <relation type="labelled-by" target="label1"/>
+ </accessibility>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">1</property>
+ <property name="label" translatable="yes" context="chartcolorpalettepopup|monochromaticwin">Monochromatic</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ <accessibility>
+ <relation type="label-for" target="monochromatic_palettes"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="monochromaticwin">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="monochromatic_palettes">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <accessibility>
+ <relation type="labelled-by" target="label2"/>
+ </accessibility>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/chart2/uiconfig/ui/charttypedialog.ui b/chart2/uiconfig/ui/charttypedialog.ui
index 5f7c1cb13f71..627a619d0b57 100644
--- a/chart2/uiconfig/ui/charttypedialog.ui
+++ b/chart2/uiconfig/ui/charttypedialog.ui
@@ -76,7 +76,19 @@
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkBox" id="content">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
</child>
diff --git a/chart2/uiconfig/ui/dlg_InsertDataTable.ui b/chart2/uiconfig/ui/dlg_InsertDataTable.ui
new file mode 100644
index 000000000000..446f7a414e24
--- /dev/null
+++ b/chart2/uiconfig/ui/dlg_InsertDataTable.ui
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.2 -->
+<interface domain="chart">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkDialog" id="InsertDataTableDialog">
+ <property name="can-focus">False</property>
+ <property name="border-width">6</property>
+ <property name="title" translatable="yes" context="dlg_InsertDataTable|dlg_InsertDataTable">Data Table</property>
+ <property name="modal">True</property>
+ <property name="default-width">0</property>
+ <property name="default-height">0</property>
+ <property name="type-hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can-focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can-focus">False</property>
+ <property name="layout-style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes" context="stock">_OK</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="has-default">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label" translatable="yes" context="stock">_Cancel</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label" translatable="yes" context="stock">_Help</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="margin-end">6</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack-type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="dlg_LegendPosition">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="border-width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkCheckButton" id="showDataTable">
+ <property name="label" translatable="yes" context="dlg_InsertDataTable|horizontalBorderCB">Show data table</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
+ <child>
+ <object class="GtkBox" id="box4">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="horizontalBorderCB">
+ <property name="label" translatable="yes" context="dlg_InsertDataTable|horizontalBorderCB">Show horizontal border</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="verticalBorderCB">
+ <property name="label" translatable="yes" context="dlg_InsertDataTable|verticalBorderCB">Show vertical border</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="outlineCB">
+ <property name="label" translatable="yes" context="dlg_InsertDataTable|outlineCB">Show outline</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="keysCB">
+ <property name="label" translatable="yes" context="dlg_InsertDataTable|keysCB">Show keys</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="dataTablePropertiesLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="dlg_InsertDataTable|dataTablePropertiesLabel">Data Table Properties</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-5">ok</action-widget>
+ <action-widget response="-6">cancel</action-widget>
+ <action-widget response="-11">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/chart2/uiconfig/ui/insertaxisdlg.ui b/chart2/uiconfig/ui/insertaxisdlg.ui
index 2853bc594ed4..5c714e56efd7 100644
--- a/chart2/uiconfig/ui/insertaxisdlg.ui
+++ b/chart2/uiconfig/ui/insertaxisdlg.ui
@@ -1,32 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="InsertAxisDialog">
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
+ <property name="can-focus">False</property>
+ <property name="border-width">6</property>
<property name="title" translatable="yes" context="insertaxisdlg|InsertAxisDialog">Axes</property>
<property name="modal">True</property>
- <property name="default_width">0</property>
- <property name="default_height">0</property>
- <property name="type_hint">dialog</property>
+ <property name="default-width">0</property>
+ <property name="default-height">0</property>
+ <property name="type-hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox3">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area3">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
+ <property name="can-focus">False</property>
+ <property name="layout-style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label" translatable="yes" context="stock">_OK</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="has-default">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -39,8 +39,8 @@
<object class="GtkButton" id="cancel">
<property name="label" translatable="yes" context="stock">_Cancel</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -53,8 +53,8 @@
<object class="GtkButton" id="help">
<property name="label" translatable="yes" context="stock">_Help</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="margin-end">6</property>
<property name="use-underline">True</property>
</object>
@@ -69,14 +69,14 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
+ <property name="pack-type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="spacing">12</property>
@@ -84,27 +84,27 @@
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
<child>
<object class="GtkCheckButton" id="primaryX">
<property name="label" translatable="yes" context="insertaxisdlg|primaryX">_X axis</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="primaryX-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="insertaxisdlg|extended_tip|primaryX">Displays the X axis as a line with subdivisions.</property>
@@ -121,10 +121,10 @@
<object class="GtkCheckButton" id="primaryY">
<property name="label" translatable="yes" context="insertaxisdlg|primaryY">_Y axis</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="primaryY-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="insertaxisdlg|extended_tip|primaryY">Displays the Y axis as a line with subdivisions.</property>
@@ -141,10 +141,10 @@
<object class="GtkCheckButton" id="primaryZ">
<property name="label" translatable="yes" context="insertaxisdlg|primaryZ">_Z axis</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="primaryZ-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="insertaxisdlg|extended_tip|primaryZ">Displays the Z axis as a line with subdivisions.</property>
@@ -162,7 +162,7 @@
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes" context="insertaxisdlg|label1">Axes</property>
<attributes>
@@ -180,27 +180,27 @@
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
<child>
<object class="GtkCheckButton" id="secondaryX">
<property name="label" translatable="yes" context="insertaxisdlg|secondaryX">X _axis</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="secondaryX-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="insertaxisdlg|extended_tip|secondaryX">Displays a secondary X axis in the chart.</property>
@@ -217,10 +217,10 @@
<object class="GtkCheckButton" id="secondaryY">
<property name="label" translatable="yes" context="insertaxisdlg|secondaryY">Y ax_is</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="secondaryY-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="insertaxisdlg|extended_tip|secondaryY">The major axis and the secondary axis can have different scaling. For example, you can scale one axis to 2 in. and the other to 1.5 in. </property>
@@ -237,10 +237,10 @@
<object class="GtkCheckButton" id="secondaryZ">
<property name="label" translatable="yes" context="insertaxisdlg|secondaryZ">Z axi_s</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -253,7 +253,7 @@
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes" context="insertaxisdlg|label2">Secondary Axes</property>
<attributes>
@@ -282,9 +282,6 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
- <child type="titlebar">
- <placeholder/>
- </child>
<child internal-child="accessible">
<object class="AtkObject" id="InsertAxisDialog-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="insertaxisdlg|extended_tip|InsertAxisDialog">Specifies the axes to be displayed in the chart.</property>
diff --git a/chart2/uiconfig/ui/sidebaraxis.ui b/chart2/uiconfig/ui/sidebaraxis.ui
index db8ad151329b..873d6565ce1e 100644
--- a/chart2/uiconfig/ui/sidebaraxis.ui
+++ b/chart2/uiconfig/ui/sidebaraxis.ui
@@ -1,130 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustmentSpinDegrees">
<property name="upper">359</property>
- <property name="step_increment">5</property>
+ <property name="step-increment">5</property>
</object>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid" id="ChartAxisPanel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
+ <property name="can-focus">False</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=4 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="border-width">6</property>
+ <property name="row-spacing">3</property>
+ <property name="column-spacing">6</property>
<child>
<object class="GtkCheckButton" id="checkbutton_show_label">
<property name="label" translatable="yes" context="sidebaraxis|checkbutton_show_label">Show labels</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ <property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_reverse">
<property name="label" translatable="yes" context="sidebaraxis|checkbutton_reverse">Reverse direction</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="label_props">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin-start">12</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">5</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">end</property>
- <property name="label" translatable="yes" context="sidebaraxis|label1">_Label position:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboboxtext_label_position</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboboxtext_label_position">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <items>
- <item translatable="yes" context="sidebaraxis|comboboxtext_label_position">Near Axis</item>
- <item translatable="yes" context="sidebaraxis|comboboxtext_label_position">Near Axis (other side)</item>
- <item translatable="yes" context="sidebaraxis|comboboxtext_label_position">Outside start</item>
- <item translatable="yes" context="sidebaraxis|comboboxtext_label_position">Outside end</item>
- </items>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">end</property>
- <property name="valign">center</property>
- <property name="label" translatable="yes" context="sidebaraxis|label2">_Text orientation:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinbutton1</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spinbutton1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
- <property name="adjustment">adjustmentSpinDegrees</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="sidebaraxis|label1">_Label position:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">comboboxtext_label_position</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext_label_position">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <items>
+ <item translatable="yes" context="sidebaraxis|comboboxtext_label_position">Near Axis</item>
+ <item translatable="yes" context="sidebaraxis|comboboxtext_label_position">Near Axis (other side)</item>
+ <item translatable="yes" context="sidebaraxis|comboboxtext_label_position">Outside start</item>
+ <item translatable="yes" context="sidebaraxis|comboboxtext_label_position">Outside end</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
+ <property name="label" translatable="yes" context="sidebaraxis|label2">_Text orientation:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">spinbutton1</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton1">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustmentSpinDegrees</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkBox" id="label_props">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
+ </packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
diff --git a/chart2/uiconfig/ui/sidebarcolors.ui b/chart2/uiconfig/ui/sidebarcolors.ui
new file mode 100644
index 000000000000..ad602a172c90
--- /dev/null
+++ b/chart2/uiconfig/ui/sidebarcolors.ui
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.40.0 -->
+<interface domain="chart">
+ <requires lib="gtk+" version="3.20"/>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid" id="ChartColorsPanel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="border-width">6</property>
+ <property name="row-spacing">3</property>
+ <property name="column-spacing">6</property>
+ <child>
+ <object class="GtkToolbar" id="colorpalettetype">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="valign">start</property>
+ <property name="toolbar-style">icons</property>
+ <property name="show-arrow">False</property>
+ <property name="icon_size">2</property>
+ <child>
+ <object class="GtkMenuToolButton" id=".uno:ChartColorPalette">
+ <property name="visible">True</property>
+ <property name="tooltip-text" translatable="yes" context="sidebarcellappearance|bordertype|tooltip_text">Allow to select a color palette to apply to current chart data series.</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="colorpalettetype-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes" context="sidebarcellappearance|cellbordertype-atkobject">Border Style</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/chart2/uiconfig/ui/sidebarelements.ui b/chart2/uiconfig/ui/sidebarelements.ui
index c16216bf6dae..f67c3b39903b 100644
--- a/chart2/uiconfig/ui/sidebarelements.ui
+++ b/chart2/uiconfig/ui/sidebarelements.ui
@@ -1,549 +1,469 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.2 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid" id="ChartElementsPanel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<child>
- <object class="GtkBox" id="container">
+ <!-- n-columns=2 n-rows=16 -->
+ <object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="border-width">6</property>
+ <property name="row-spacing">3</property>
+ <property name="column-spacing">6</property>
<child>
- <object class="GtkFrame" id="frame1">
+ <object class="GtkLabel" id="l">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">3</property>
+ <property name="label" translatable="yes" context="sidebarelements|l">Titles</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_title">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_title">Title</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <accessibility>
+ <relation type="label-for" target="edit_title"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="edit_title">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
- <child>
- <object class="GtkCheckButton" id="checkbutton_title">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_title">Title</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <accessibility>
- <relation type="label-for" target="edit_title"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_subtitle">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_subtitle">Subtitle</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <accessibility>
- <relation type="label-for" target="edit_subtitle"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="edit_title">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="truncate-multiline">True</property>
- <accessibility>
- <relation type="labelled-by" target="checkbutton_title"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="edit_subtitle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="truncate-multiline">True</property>
- <accessibility>
- <relation type="labelled-by" target="checkbutton_subtitle"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="l">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebarelements|l">Titles</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
+ <property name="truncate-multiline">True</property>
+ <accessibility>
+ <relation type="labelled-by" target="checkbutton_title"/>
+ </accessibility>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <object class="GtkFrame" id="frame3">
+ <object class="GtkCheckButton" id="checkbutton_subtitle">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_subtitle">Subtitle</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkBox" id="box_legend2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
- <child>
- <object class="GtkCheckButton" id="checkbutton_legend">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_legend">Show legend</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes" context="sidebarelements|checkbutton_legend|tooltip_text">Show Legend</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box_legend">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="placement_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">end</property>
- <property name="margin-start">4</property>
- <property name="label" translatable="yes" context="sidebarelements|placement_label">_Placement:</property>
- <property name="use_underline">True</property>
- <property name="ellipsize">end</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboboxtext_legend">
- <property name="width_request">100</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <items>
- <item translatable="yes" context="sidebarelements|comboboxtext_legend">Right</item>
- <item translatable="yes" context="sidebarelements|comboboxtext_legend">Top</item>
- <item translatable="yes" context="sidebarelements|comboboxtext_legend">Bottom</item>
- <item translatable="yes" context="sidebarelements|comboboxtext_legend">Left</item>
- </items>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_no_overlay">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_no_overlay">Show the legend without overlapping the chart</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label_legen">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebarelements|label_legen">Legend</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <accessibility>
+ <relation type="label-for" target="edit_subtitle"/>
+ </accessibility>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <object class="GtkFrame" id="frame2">
+ <object class="GtkEntry" id="edit_subtitle">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
- <child>
- <object class="GtkCheckButton" id="checkbutton_x_axis">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_x_axis">X axis</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_x_axis_title">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_x_axis_title">X axis title</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_y_axis">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_y_axis">Y axis</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_y_axis_title">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_y_axis_title">Y axis title</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_z_axis">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_z_axis">Z axis</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_z_axis_title">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_z_axis_title">Z axis title</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_2nd_x_axis">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_2nd_x_axis">2nd X axis</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_2nd_x_axis_title">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_2nd_x_axis_title">2nd X axis title</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_2nd_y_axis">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_2nd_y_axis">2nd Y axis</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_2nd_y_axis_title">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_2nd_y_axis_title">2nd Y axis title</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label_axes">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebarelements|label_axes">Axes</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
+ <property name="can-focus">True</property>
+ <property name="truncate-multiline">True</property>
+ <accessibility>
+ <relation type="labelled-by" target="checkbutton_subtitle"/>
+ </accessibility>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <object class="GtkFrame" id="frame4">
+ <object class="GtkLabel" id="label_legen">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
- <child>
- <object class="GtkCheckButton" id="checkbutton_gridline_horizontal_major">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_gridline_horizontal_major">Horizontal major</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_gridline_vertical_major">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_gridline_vertical_major">Vertical major</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_gridline_horizontal_minor">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_gridline_horizontal_minor">Horizontal minor</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_gridline_vertical_minor">
- <property name="label" translatable="yes" context="sidebarelements|checkbutton_gridline_vertical_minor">Vertical minor</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label_gri">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebarelements|label_gri">Gridlines</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">3</property>
+ <property name="label" translatable="yes" context="sidebarelements|label_legen">Legend</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_legend">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_legend">Show legend</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes" context="sidebarelements|checkbutton_legend|tooltip_text">Show Legend</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid4">
- <property name="can_focus">False</property>
+ <object class="GtkComboBoxText" id="comboboxtext_legend">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <items>
+ <item translatable="yes" context="sidebarelements|comboboxtext_legend">Right</item>
+ <item translatable="yes" context="sidebarelements|comboboxtext_legend">Top</item>
+ <item translatable="yes" context="sidebarelements|comboboxtext_legend">Bottom</item>
+ <item translatable="yes" context="sidebarelements|comboboxtext_legend">Left</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_no_overlay">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_no_overlay">Show the legend without overlapping the chart</property>
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">5</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_axes">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">3</property>
+ <property name="label" translatable="yes" context="sidebarelements|label_axes">Axes</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">6</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_x_axis">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_x_axis">X axis</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_y_axis">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_y_axis">Y axis</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_z_axis">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_z_axis">Z axis</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">9</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_2nd_x_axis">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_2nd_x_axis">2nd X axis</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_2nd_y_axis">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_2nd_y_axis">2nd Y axis</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_x_axis_title">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_x_axis_title">X axis title</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_y_axis_title">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_y_axis_title">Y axis title</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_z_axis_title">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_z_axis_title">Z axis title</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">9</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_2nd_x_axis_title">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_2nd_x_axis_title">2nd X axis title</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_2nd_y_axis_title">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_2nd_y_axis_title">2nd Y axis title</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_gri">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">3</property>
+ <property name="label" translatable="yes" context="sidebarelements|label_gri">Gridlines</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">12</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_gridline_horizontal_major">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_gridline_horizontal_major">Horizontal major</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">13</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_gridline_vertical_major">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_gridline_vertical_major">Vertical major</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">14</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_gridline_horizontal_minor">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_gridline_horizontal_minor">Horizontal minor</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">13</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_gridline_vertical_minor">
+ <property name="label" translatable="yes" context="sidebarelements|checkbutton_gridline_vertical_minor">Vertical minor</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">14</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box_legend">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="text_title">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">start</property>
<property name="label" translatable="yes" context="sidebarelements|text_title">Title</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="text_subtitle">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">start</property>
<property name="label" translatable="yes" context="sidebarelements|text_subtitle">Subtitle</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="placement_label">
+ <property name="can-focus">False</property>
+ <property name="halign">end</property>
+ <property name="margin-start">4</property>
+ <property name="label" translatable="yes" context="sidebarelements|placement_label">_Placement:</property>
+ <property name="use-underline">True</property>
+ <property name="ellipsize">end</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">15</property>
+ <property name="width">2</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
- <object class="GtkSizeGroup" id="sizegroup1">
- <widgets>
- <widget name="checkbutton_title"/>
- <widget name="checkbutton_x_axis"/>
- <widget name="checkbutton_y_axis"/>
- <widget name="checkbutton_z_axis"/>
- <widget name="checkbutton_2nd_x_axis"/>
- <widget name="checkbutton_2nd_y_axis"/>
- <widget name="checkbutton_gridline_vertical_major"/>
- <widget name="checkbutton_gridline_horizontal_major"/>
- </widgets>
- </object>
- <object class="GtkSizeGroup" id="sizegroup2">
- <widgets>
- <widget name="checkbutton_subtitle"/>
- <widget name="checkbutton_x_axis_title"/>
- <widget name="checkbutton_y_axis_title"/>
- <widget name="checkbutton_z_axis_title"/>
- <widget name="checkbutton_2nd_x_axis_title"/>
- <widget name="checkbutton_2nd_y_axis_title"/>
- <widget name="checkbutton_gridline_vertical_minor"/>
- <widget name="checkbutton_gridline_horizontal_minor"/>
- </widgets>
- </object>
</interface>
diff --git a/chart2/uiconfig/ui/sidebarerrorbar.ui b/chart2/uiconfig/ui/sidebarerrorbar.ui
index 7ffdc3a68192..32c3ef130ad0 100644
--- a/chart2/uiconfig/ui/sidebarerrorbar.ui
+++ b/chart2/uiconfig/ui/sidebarerrorbar.ui
@@ -1,218 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustmentNEG">
<property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustmentPOS">
<property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">chart2/res/errorup_30.png</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">chart2/res/errorup_30.png</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">chart2/res/errorbothverti_30.png</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">chart2/res/errorbothverti_30.png</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">chart2/res/errordown_30.png</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">chart2/res/errordown_30.png</property>
</object>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid" id="ChartErrorBarPanel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<child>
- <object class="GtkBox" id="box1">
+ <!-- n-columns=2 n-rows=4 -->
+ <object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <property name="baseline_position">top</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="border-width">6</property>
+ <property name="row-spacing">3</property>
+ <property name="column-spacing">6</property>
<child>
- <object class="GtkBox" id="box3">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="sidebarerrorbar|label2">Category:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">comboboxtext_type</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext_type">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <items>
+ <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Constant</item>
+ <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Percentage</item>
+ <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Cell Range or Data Table</item>
+ <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Standard deviation</item>
+ <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Standard error</item>
+ <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Variance</item>
+ <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Error margin</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="sidebarerrorbar|label3">Positive (+):</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="sidebarerrorbar|label4">Negative (-):</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton_pos">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="text" translatable="yes" context="sidebarerrorbar|spinbutton_pos">0.00</property>
+ <property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustmentPOS</property>
+ <property name="digits">2</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton_neg">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="text" translatable="yes" context="sidebarerrorbar|spinbutton_neg">0.00</property>
+ <property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustmentNEG</property>
+ <property name="digits">2</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
<property name="spacing">6</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid1">
+ <object class="GtkRadioButton" id="radiobutton_positive_negative">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="sidebarerrorbar|label2">Category:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboboxtext_type</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboboxtext_type">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <items>
- <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Constant</item>
- <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Percentage</item>
- <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Cell Range or Data Table</item>
- <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Standard deviation</item>
- <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Standard error</item>
- <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Variance</item>
- <item translatable="yes" context="sidebarerrorbar|comboboxtext_type">Error margin</item>
- </items>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="sidebarerrorbar|label3">Positive (+):</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="sidebarerrorbar|label4">Negative (-):</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spinbutton_pos">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">start</property>
- <property name="text" translatable="yes" context="sidebarerrorbar|spinbutton_pos">0.00</property>
- <property name="adjustment">adjustmentPOS</property>
- <property name="truncate-multiline">True</property>
- <property name="digits">2</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spinbutton_neg">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">start</property>
- <property name="text" translatable="yes" context="sidebarerrorbar|spinbutton_neg">0.00</property>
- <property name="adjustment">adjustmentNEG</property>
- <property name="truncate-multiline">True</property>
- <property name="digits">2</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkRadioButton" id="radiobutton_positive_negative">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes" context="sidebarerrorbar|radiobutton_positive_negative|tooltip_text">Positive and Negative</property>
- <property name="image">image2</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radiobutton_positive">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes" context="sidebarerrorbar|radiobutton_positive|tooltip_text">Positive</property>
- <property name="image">image1</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton_positive_negative</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radiobutton_negative">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes" context="sidebarerrorbar|radiobutton_negative|tooltip_text">Negative</property>
- <property name="image">image3</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton_positive_negative</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="sidebarerrorbar|label5">Indicator</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes" context="sidebarerrorbar|radiobutton_positive_negative|tooltip_text">Positive and Negative</property>
+ <property name="image">image2</property>
+ <property name="use-underline">True</property>
+ <property name="active">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -220,17 +148,62 @@
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkRadioButton" id="radiobutton_positive">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes" context="sidebarerrorbar|radiobutton_positive|tooltip_text">Positive</property>
+ <property name="image">image1</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">radiobutton_positive_negative</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="radiobutton_negative">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes" context="sidebarerrorbar|radiobutton_negative|tooltip_text">Negative</property>
+ <property name="image">image3</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">radiobutton_positive_negative</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="sidebarerrorbar|label5">Indicator</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
diff --git a/chart2/uiconfig/ui/sidebarseries.ui b/chart2/uiconfig/ui/sidebarseries.ui
index e7ec66f134e5..7996f5c2e3a7 100644
--- a/chart2/uiconfig/ui/sidebarseries.ui
+++ b/chart2/uiconfig/ui/sidebarseries.ui
@@ -1,288 +1,241 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid" id="ChartSeriesPanel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<child>
- <object class="GtkBox" id="box1">
+ <!-- n-columns=2 n-rows=10 -->
+ <object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="border-width">5</property>
+ <property name="row-spacing">3</property>
+ <property name="column-spacing">6</property>
<child>
- <placeholder/>
+ <object class="GtkLabel" id="label_series_name">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">3</property>
+ <property name="label" translatable="no">Label</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_label">
+ <property name="label" translatable="yes" context="sidebarseries|checkbutton_label">Show data labels</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext_label">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <items>
+ <item translatable="yes" context="sidebarseries|comboboxtext_label">Above</item>
+ <item translatable="yes" context="sidebarseries|comboboxtext_label">Below</item>
+ <item translatable="yes" context="sidebarseries|comboboxtext_label">Center</item>
+ <item translatable="yes" context="sidebarseries|comboboxtext_label">Outside</item>
+ <item translatable="yes" context="sidebarseries|comboboxtext_label">Inside</item>
+ <item translatable="yes" context="sidebarseries|comboboxtext_label">Near origin</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
+ </packing>
</child>
<child>
- <object class="GtkFrame" id="frame1">
+ <object class="GtkCheckButton" id="checkbutton_trendline">
+ <property name="label" translatable="yes" context="sidebarseries|checkbutton_trendline">Show trendline</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">3</property>
+ <property name="label" translatable="yes" context="sidebarseries|label1">Error Bars</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_y_error">
+ <property name="label" translatable="yes" context="sidebarseries|checkbutton_y_error">Y error bars</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_x_error">
+ <property name="label" translatable="yes" context="sidebarseries|checkbutton_x_error">X error bars</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">5</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="axis_label">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">3</property>
+ <property name="label" translatable="yes" context="sidebarseries|axis_label">Align Series to Axis</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">6</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_series_tmpl">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="sidebarseries|label_series_tmpl">Data series '%1'</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">8</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box5">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkBox" id="box2">
+ <object class="GtkRadioButton" id="radiobutton_primary_axis">
+ <property name="label" translatable="yes" context="sidebarseries|radiobutton_primary_axis">Primary Y axis</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
- <child>
- <object class="GtkBox" id="box3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkCheckButton" id="checkbutton_label">
- <property name="label" translatable="yes" context="sidebarseries|checkbutton_label">Show data labels</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="datalabel_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin-start">12</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebarseries|label_box">P_lacement:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">comboboxtext_label</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="comboboxtext_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <items>
- <item translatable="yes" context="sidebarseries|comboboxtext_label">Above</item>
- <item translatable="yes" context="sidebarseries|comboboxtext_label">Below</item>
- <item translatable="yes" context="sidebarseries|comboboxtext_label">Center</item>
- <item translatable="yes" context="sidebarseries|comboboxtext_label">Outside</item>
- <item translatable="yes" context="sidebarseries|comboboxtext_label">Inside</item>
- <item translatable="yes" context="sidebarseries|comboboxtext_label">Near origin</item>
- </items>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_trendline">
- <property name="label" translatable="yes" context="sidebarseries|checkbutton_trendline">Show trendline</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkFrame" id="frame3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkBox" id="box6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
- <child>
- <object class="GtkCheckButton" id="checkbutton_y_error">
- <property name="label" translatable="yes" context="sidebarseries|checkbutton_y_error">Y error bars</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton_x_error">
- <property name="label" translatable="yes" context="sidebarseries|checkbutton_x_error">X error bars</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebarseries|label1">Error Bars</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkBox" id="box5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <property name="margin-start">12</property>
- <property name="margin-top">6</property>
- <child>
- <object class="GtkRadioButton" id="radiobutton_primary_axis">
- <property name="label" translatable="yes" context="sidebarseries|radiobutton_primary_axis">Primary Y axis</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radiobutton_secondary_axis">
- <property name="label" translatable="yes" context="sidebarseries|radiobutton_secondary_axis">Secondary Y axis</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton_primary_axis</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="axis_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebarseries|axis_label">Align Series to Axis</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_series_tmpl">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebarseries|label_series_tmpl">Data series '%1'</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
- </packing>
- </child>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="active">True</property>
+ <property name="draw-indicator">True</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
- <child type="label">
- <object class="GtkLabel" id="label_series_name">
+ <child>
+ <object class="GtkRadioButton" id="radiobutton_secondary_axis">
+ <property name="label" translatable="yes" context="sidebarseries|radiobutton_secondary_axis">Secondary Y axis</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="no">Label</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">radiobutton_primary_axis</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">7</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="datalabel_box">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <child>
+ <object class="GtkLabel" id="label_box">
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="sidebarseries|label_box">P_lacement:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic_widget">comboboxtext_label</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">9</property>
+ <property name="width">2</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
diff --git a/chart2/uiconfig/ui/sidebartype.ui b/chart2/uiconfig/ui/sidebartype.ui
index ae410375d1c0..1d3cb2d1af05 100644
--- a/chart2/uiconfig/ui/sidebartype.ui
+++ b/chart2/uiconfig/ui/sidebartype.ui
@@ -1,12 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">1</property>
<property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment2">
+ <property name="lower">1</property>
+ <property name="upper">100</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
</object>
<object class="GtkTreeStore" id="liststore1">
<columns>
@@ -29,32 +35,33 @@
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid" id="ChartTypePanel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=9 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
- <property name="border_width">6</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">6</property>
+ <property name="border-width">6</property>
+ <property name="row-spacing">3</property>
+ <property name="column-spacing">6</property>
<child>
<object class="GtkScrolledWindow" id="subtypewin">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
+ <property name="margin-bottom">6</property>
<property name="hexpand">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">never</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<child>
<object class="GtkDrawingArea" id="subtype">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
<property name="hexpand">True</property>
</object>
@@ -63,353 +70,311 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="3dlook">
+ <property name="label" translatable="yes" context="sidebartype|3dlook">_3D Look</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="3dblock">
+ <object class="GtkComboBoxText" id="3dscheme">
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <items>
+ <item translatable="yes" context="sidebartype|3dscheme">Simple</item>
+ <item translatable="yes" context="sidebartype|3dscheme">Realistic</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="shapeft">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">3</property>
- <child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkCheckButton" id="3dlook">
- <property name="label" translatable="yes" context="sidebartype|3dlook">_3D Look</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <accessibility>
- <relation type="label-for" target="3dscheme"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="3dscheme">
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <items>
- <item translatable="yes" context="sidebartype|3dscheme">Simple</item>
- <item translatable="yes" context="sidebartype|3dscheme">Realistic</item>
- </items>
- <accessibility>
- <relation type="labelled-by" target="3dlook"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="shapeft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebartype|shapeft">Sh_ape</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">shape</property>
- <property name="angle">0.02</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
+ <property name="can-focus">False</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="label" translatable="yes" context="sidebartype|shapeft">Sh_ape</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">shape</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="shadow-type">in</property>
<child>
- <object class="GtkScrolledWindow">
+ <object class="GtkTreeView" id="shape">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="vexpand">True</property>
- <property name="shadow_type">in</property>
+ <property name="model">liststore1</property>
+ <property name="headers-visible">False</property>
+ <property name="headers-clickable">False</property>
+ <property name="search-column">0</property>
+ <property name="show-expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
<child>
- <object class="GtkTreeView" id="shape">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="vexpand">True</property>
- <property name="model">liststore1</property>
- <property name="headers_visible">False</property>
- <property name="headers_clickable">False</property>
- <property name="search_column">0</property>
- <property name="show_expanders">False</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection"/>
- </child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn1">
<child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn1">
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext1"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
+ <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
</child>
</object>
</child>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="stack">
+ <property name="label" translatable="yes" context="sidebartype|stack">_Stack series</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="valign">start</property>
+ <property name="vexpand">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="linetypeft">
+ <property name="can-focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes" context="sidebartype|linetypeft">_Line type</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">linetype</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="linetype">
+ <property name="can-focus">False</property>
+ <items>
+ <item translatable="yes" context="sidebartype|linetype">Straight</item>
+ <item translatable="yes" context="sidebartype|linetype">Smooth</item>
+ <item translatable="yes" context="sidebartype|linetype">Stepped</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="properties">
+ <property name="label" translatable="yes" context="sidebartype|properties">Properties...</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="sort">
+ <property name="label" translatable="yes" context="sidebartype|sort">_Sort by X values</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="nolinesft">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="sidebartype|nolinesft">_Number of lines</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">nolines</property>
+ <property name="ellipsize">end</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="nolines">
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">8</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="stackblock">
+ <object class="GtkLabel" id="compositesizeft">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="sidebartype|compositesizeft">_Number of lines</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">compositesize</property>
+ <property name="ellipsize">end</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="compositesize">
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustment2</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="cmb_chartType">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">3</property>
+ <property name="can-focus">False</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <property name="model">liststore2</property>
+ <property name="entry-text-column">0</property>
+ <property name="id-column">1</property>
<child>
- <object class="GtkCheckButton" id="stack">
- <property name="label" translatable="yes" context="sidebartype|stack">_Stack series</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
+ <object class="GtkCellRendererText" id="cellrenderertext9"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">3</property>
- <property name="margin-start">12</property>
- <child>
- <object class="GtkRadioButton" id="ontop">
- <property name="label" translatable="yes" context="sidebartype|ontop">On top</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="percent">
- <property name="label" translatable="yes" context="sidebartype|percent">Percent</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">ontop</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="deep">
- <property name="label" translatable="yes" context="sidebartype|deep">Deep</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">ontop</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
+ <object class="GtkCellRendererPixbuf" id="cellrenderertext6"/>
+ <attributes>
+ <attribute name="pixbuf">2</attribute>
+ </attributes>
</child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="grid6">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid7">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkLabel" id="linetypeft">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="sidebartype|linetypeft">_Line type</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">linetype</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="linetype">
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <items>
- <item translatable="yes" context="sidebartype|linetype">Straight</item>
- <item translatable="yes" context="sidebartype|linetype">Smooth</item>
- <item translatable="yes" context="sidebartype|linetype">Stepped</item>
- </items>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="properties">
- <property name="label" translatable="yes" context="sidebartype|properties">Properties...</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
+ <object class="GtkRadioButton" id="ontop">
+ <property name="label" translatable="yes" context="sidebartype|ontop">On top</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="active">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="sort">
- <property name="label" translatable="yes" context="sidebartype|sort">_Sort by X values</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <object class="GtkRadioButton" id="percent">
+ <property name="label" translatable="yes" context="sidebartype|percent">Percent</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">ontop</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="grid8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkLabel" id="nolinesft">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes" context="sidebartype|nolinesft">_Number of lines</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">nolines</property>
- <property name="ellipsize">end</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="nolines">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
- <property name="hexpand">True</property>
- <property name="activates_default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="adjustment">adjustment1</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
+ <object class="GtkRadioButton" id="deep">
+ <property name="label" translatable="yes" context="sidebartype|deep">Deep</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">ontop</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
- <object class="GtkGrid" id="charttypeblock">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkComboBox" id="cmb_chartType">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">center</property>
- <property name="hexpand">True</property>
- <property name="model">liststore2</property>
- <property name="entry_text_column">0</property>
- <property name="id_column">1</property>
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext9"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- <child>
- <object class="GtkCellRendererPixbuf" id="cellrenderertext6"/>
- <attributes>
- <attribute name="pixbuf">2</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
diff --git a/chart2/uiconfig/ui/steppedlinesdlg.ui b/chart2/uiconfig/ui/steppedlinesdlg.ui
index f54f3c51cfaa..903ecf9d7603 100644
--- a/chart2/uiconfig/ui/steppedlinesdlg.ui
+++ b/chart2/uiconfig/ui/steppedlinesdlg.ui
@@ -154,7 +154,7 @@
<property name="group">step_start_rb</property>
<child internal-child="accessible">
<object class="AtkObject" id="step_center_x_rb-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="steppedlinesdlg|extended_tip|step_center_x_rb">Start to step up vertically and end with horizontal line.</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="steppedlinesdlg|extended_tip|step_center_x_rb">Start with horizontal line, step up vertically in the middle of the X values and end with horizontal line.</property>
</object>
</child>
</object>
@@ -174,7 +174,7 @@
<property name="group">step_start_rb</property>
<child internal-child="accessible">
<object class="AtkObject" id="step_end_rb-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="steppedlinesdlg|extended_tip|step_end_rb">Start with horizontal line, step up vertically in the middle of the X values and end with horizontal line.</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="steppedlinesdlg|extended_tip|step_end_rb">Start to step up vertically and end with horizontal line.</property>
</object>
</child>
</object>
diff --git a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
index 2187db5ab092..f67f287f68fc 100644
--- a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
+++ b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
@@ -276,11 +276,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHTSOURCE_COLOR|tooltip_text">Select a color using the color dialog</property>
+ <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_LIGHTSOURCE_COLOR|tooltip_text">Select a color using the Pick a Color dialog</property>
<property name="image">IMG_LIGHTSOURCE_COLOR</property>
<child internal-child="accessible">
<object class="AtkObject" id="BTN_LIGHTSOURCE_COLOR-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="tp_3D_SceneIllumination|extended_tip|BTN_LIGHTSOURCE_COLOR">Select a color using the color dialog.</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="tp_3D_SceneIllumination|extended_tip|BTN_LIGHTSOURCE_COLOR">Select a color using the Pick a Color dialog.</property>
</object>
</child>
</object>
@@ -360,11 +360,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_AMBIENT_COLOR|tooltip_text">Select a color using the color dialog</property>
+ <property name="tooltip_text" translatable="yes" context="tp_3D_SceneIllumination|BTN_AMBIENT_COLOR|tooltip_text">Select a color using the Pick a Color dialog</property>
<property name="image">IMG_AMBIENT_COLOR</property>
<child internal-child="accessible">
<object class="AtkObject" id="BTN_AMBIENT_COLOR-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="tp_3D_SceneIllumination|extended_tip|BTN_AMBIENT_COLOR">Select a color using the color dialog.</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="tp_3D_SceneIllumination|extended_tip|BTN_AMBIENT_COLOR">Select a color using the Pick a color dialog.</property>
</object>
</child>
</object>
diff --git a/chart2/uiconfig/ui/tp_AxisPositions.ui b/chart2/uiconfig/ui/tp_AxisPositions.ui
index 5308a2bc911f..7cff4022b6ac 100644
--- a/chart2/uiconfig/ui/tp_AxisPositions.ui
+++ b/chart2/uiconfig/ui/tp_AxisPositions.ui
@@ -632,7 +632,6 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
- <property name="xalign">0.5</property>
</object>
<packing>
<property name="left_attach">1</property>
diff --git a/chart2/uiconfig/ui/tp_ChartColorPalette.ui b/chart2/uiconfig/ui/tp_ChartColorPalette.ui
new file mode 100644
index 000000000000..3fb233011922
--- /dev/null
+++ b/chart2/uiconfig/ui/tp_ChartColorPalette.ui
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.40.0 -->
+<interface domain="chart">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkBox" id="tp_ChartColorPalette">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-top">4</property>
+ <property name="margin-bottom">4</property>
+ <property name="spacing">16</property>
+ <child>
+ <object class="GtkFrame" id="FL_COLORFUL">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">4</property>
+ <property name="margin-end">4</property>
+ <property name="margin-top">3</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
+ <child>
+ <object class="GtkScrolledWindow" id="colorfulwin">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="valign">start</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="valign">start</property>
+ <child>
+ <object class="GtkDrawingArea" id="colorful_palettes">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="valign">start</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="LBL_COLORFUL">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-bottom">2</property>
+ <property name="label" translatable="yes" context="tp_ChartColorPalette|colorfulwin">Colorful</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">8</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="FL_MONOCHROMATIC">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">4</property>
+ <property name="margin-end">4</property>
+ <property name="margin-top">3</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
+ <child>
+ <object class="GtkScrolledWindow" id="monochromaticwin">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="valign">start</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="valign">start</property>
+ <child>
+ <object class="GtkDrawingArea" id="monochromatic_palettes">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="valign">start</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="LBL_MONOCHROMATIC">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-bottom">2</property>
+ <property name="label" translatable="yes" context="tp_ChartColorPalette|monochromaticwin">Monochromatic</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">8</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/chart2/uiconfig/ui/tp_ChartType.ui b/chart2/uiconfig/ui/tp_ChartType.ui
index 600bf3a4af68..631ce5f98360 100644
--- a/chart2/uiconfig/ui/tp_ChartType.ui
+++ b/chart2/uiconfig/ui/tp_ChartType.ui
@@ -1,13 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">1</property>
<property name="upper">100</property>
<property name="value">1</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment2">
+ <property name="lower">1</property>
+ <property name="upper">100</property>
+ <property name="value">1</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
</object>
<object class="GtkTreeStore" id="liststore1">
<columns>
@@ -29,22 +36,22 @@
</object>
<object class="GtkBox" id="tp_ChartType">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">6</property>
+ <property name="border-width">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="FT_CAPTION_FOR_WIZARD">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_ChartType|FT_CAPTION_FOR_WIZARD">Choose a Chart Type</property>
<property name="xalign">0</property>
<attributes>
@@ -58,37 +65,35 @@
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="column_spacing">12</property>
+ <property name="column-spacing">12</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=1 n-rows=3 -->
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="row_spacing">6</property>
+ <property name="row-spacing">6</property>
<child>
<object class="GtkScrolledWindow" id="subtypewin">
- <property name="visible">False</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">never</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<child>
<object class="GtkDrawingArea" id="subtype">
- <property name="visible">False</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
<property name="hexpand">True</property>
<child internal-child="accessible">
@@ -102,31 +107,31 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=1 n-rows=3 -->
<object class="GtkGrid" id="3dblock">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="row_spacing">3</property>
+ <property name="row-spacing">3</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid" id="grid9">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="column_spacing">6</property>
+ <property name="can-focus">False</property>
+ <property name="column-spacing">6</property>
<child>
<object class="GtkCheckButton" id="3dlook">
<property name="label" translatable="yes" context="tp_ChartType|3dlook">_3D Look</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<accessibility>
<relation type="label-for" target="3dscheme"/>
</accessibility>
@@ -137,13 +142,13 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="3dscheme">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<items>
<item translatable="yes" context="tp_ChartType|3dscheme">Simple</item>
@@ -159,48 +164,47 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="shapeft">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_ChartType|shapeft">Sh_ape</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">shape</property>
- <property name="angle">0.02</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">shape</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="shadow_type">in</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="shape">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="model">liststore1</property>
- <property name="headers_visible">False</property>
- <property name="headers_clickable">False</property>
- <property name="search_column">0</property>
- <property name="show_expanders">False</property>
+ <property name="headers-visible">False</property>
+ <property name="headers-clickable">False</property>
+ <property name="search-column">0</property>
+ <property name="show-expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
@@ -223,29 +227,29 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=1 n-rows=5 -->
<object class="GtkGrid" id="stackblock">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">3</property>
+ <property name="can-focus">False</property>
+ <property name="row-spacing">3</property>
<child>
<object class="GtkCheckButton" id="stack">
<property name="label" translatable="yes" context="tp_ChartType|stack">_Stack series</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="stack-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_ChartType|extended_tip|stack">Displays stacked series for Line charts.</property>
@@ -253,25 +257,25 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=1 n-rows=3 -->
<object class="GtkGrid" id="grid6">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">3</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
+ <property name="row-spacing">3</property>
<child>
<object class="GtkRadioButton" id="ontop">
<property name="label" translatable="yes" context="tp_ChartType|ontop">On top</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
<property name="active">True</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="ontop-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_ChartType|extended_tip|ontop">Stack series display values on top of each other.</property>
@@ -279,17 +283,17 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="percent">
<property name="label" translatable="yes" context="tp_ChartType|percent">Percent</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<property name="group">ontop</property>
<child internal-child="accessible">
<object class="AtkObject" id="percent-atkobject">
@@ -298,52 +302,52 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="deep">
<property name="label" translatable="yes" context="tp_ChartType|deep">Deep</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<property name="group">ontop</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=3 n-rows=1 -->
<object class="GtkGrid" id="grid7">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="column_spacing">6</property>
+ <property name="can-focus">False</property>
+ <property name="column-spacing">6</property>
<child>
<object class="GtkLabel" id="linetypeft">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_ChartType|linetypeft">_Line type</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">linetype</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">linetype</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="linetype">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<items>
<item translatable="yes" context="tp_ChartType|linetype">Straight</item>
<item translatable="yes" context="tp_ChartType|linetype">Smooth</item>
@@ -356,16 +360,16 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="properties">
<property name="label" translatable="yes" context="tp_ChartType|properties">Properties...</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="properties-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_ChartType|extended_tip|properties">Opens a dialog to set the line or curve properties.</property>
@@ -373,23 +377,23 @@
</child>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="sort">
<property name="label" translatable="yes" context="tp_ChartType|sort">_Sort by X values</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="sort-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_ChartType|extended_tip|sort">Connects points by ascending X values, even if the order of values is different, in an XY scatter diagram.</property>
@@ -397,38 +401,38 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=1 -->
<object class="GtkGrid" id="grid8">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="column_spacing">6</property>
+ <property name="can-focus">False</property>
+ <property name="column-spacing">6</property>
<child>
<object class="GtkLabel" id="nolinesft">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
<property name="label" translatable="yes" context="tp_ChartType|nolinesft">_Number of lines</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">nolines</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">nolines</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="nolines">
- <property name="can_focus">True</property>
- <property name="no_show_all">True</property>
- <property name="activates_default">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustment1</property>
<child internal-child="accessible">
<object class="AtkObject" id="nolines-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_ChartType|extended_tip|nolines">Set the number of lines for the Column and Line chart type.</property>
@@ -436,45 +440,89 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=2 n-rows=1 -->
+ <object class="GtkGrid" id="grid10">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="column-spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="compositesizeft">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="label" translatable="yes" context="tp_ChartType|compositesizeft">_Size of composite wedge</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">compositesize</property>
+ <property name="ellipsize">end</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="compositesize">
+ <property name="can-focus">True</property>
+ <property name="no-show-all">True</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustment2</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="compositesize-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="tp_ChartType|extended_tip|compositesize">Set the number of entries in an of-pie chart composite wedge.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
- <property name="visible">False</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="vexpand">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="charttype">
- <property name="visible">False</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
+ <property name="has-focus">True</property>
<property name="vexpand">True</property>
<property name="model">liststore2</property>
- <property name="headers_visible">False</property>
- <property name="headers_clickable">False</property>
- <property name="search_column">0</property>
- <property name="show_expanders">False</property>
+ <property name="headers-visible">False</property>
+ <property name="headers-clickable">False</property>
+ <property name="search-column">0</property>
+ <property name="show-expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2"/>
</child>
@@ -507,8 +555,8 @@
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
</object>
diff --git a/chart2/uiconfig/ui/tp_DataTable.ui b/chart2/uiconfig/ui/tp_DataTable.ui
new file mode 100644
index 000000000000..ad8bc0fcffc7
--- /dev/null
+++ b/chart2/uiconfig/ui/tp_DataTable.ui
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.2 -->
+<interface domain="chart">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkBox" id="DataTableTabPage">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border-width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
+ <child>
+ <object class="GtkBox" id="box4">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="horizontalBorderCB">
+ <property name="label" translatable="yes" context="tp_DataTable|horizontalBorderCB">Show horizontal border</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="verticalBorderCB">
+ <property name="label" translatable="yes" context="tp_DataTable|verticalBorderCB">Show vertical border</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="outlineCB">
+ <property name="label" translatable="yes" context="tp_DataTable|outlineCB">Show outline</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="keysCB">
+ <property name="label" translatable="yes" context="tp_DataTable|keysCB">Show keys</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="halign">start</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="dataTablePropertiesLabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="tp_axisLabel|textflowL">Data Table Properties</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/chart2/uiconfig/ui/tp_SeriesToAxis.ui b/chart2/uiconfig/ui/tp_SeriesToAxis.ui
index dd25988f0ea8..d48dd418467a 100644
--- a/chart2/uiconfig/ui/tp_SeriesToAxis.ui
+++ b/chart2/uiconfig/ui/tp_SeriesToAxis.ui
@@ -1,47 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="chart">
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustmentGAP">
<property name="upper">600</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustmentOVERLAP">
<property name="lower">-100</property>
<property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
+ <property name="step-increment">1</property>
+ <property name="page-increment">10</property>
</object>
<object class="GtkBox" id="TP_OPTIONS">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
+ <property name="can-focus">False</property>
+ <property name="border-width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkFrame" id="frameGrpAxis">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
<object class="GtkRadioButton" id="RBT_OPT_AXIS_1">
<property name="label" translatable="yes" context="tp_SeriesToAxis|RBT_OPT_AXIS_1">Primary Y axis</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
<property name="active">True</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="RBT_OPT_AXIS_1-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_SeriesToAxis|extended_tip|RBT_OPT_AXIS_1">This option is active as default. All data series are aligned to the primary Y axis.</property>
@@ -58,10 +58,10 @@
<object class="GtkRadioButton" id="RBT_OPT_AXIS_2">
<property name="label" translatable="yes" context="tp_SeriesToAxis|RBT_OPT_AXIS_2">Secondary Y axis</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<property name="group">RBT_OPT_AXIS_1</property>
<child internal-child="accessible">
<object class="AtkObject" id="RBT_OPT_AXIS_2-atkobject">
@@ -80,7 +80,7 @@
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_SeriesToAxis|label1">Align Data Series to</property>
<property name="xalign">0</property>
<attributes>
@@ -98,56 +98,56 @@
<child>
<object class="GtkFrame" id="frameSettings">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=2 -->
<object class="GtkGrid" id="gridSettings">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="can-focus">False</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="FT_GAP">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_SeriesToAxis|FT_GAP">_Spacing</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">MT_GAP</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">MT_GAP</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="FT_OVERLAP">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_SeriesToAxis|FT_OVERLAP">_Overlap</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">MT_OVERLAP</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">MT_OVERLAP</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="MT_GAP">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="adjustment">adjustmentGAP</property>
+ <property name="can-focus">True</property>
<property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustmentGAP</property>
<child internal-child="accessible">
<object class="AtkObject" id="MT_GAP-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_SeriesToAxis|extended_tip|MT_GAP">Defines the spacing between the columns in percent.</property>
@@ -155,16 +155,16 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="MT_OVERLAP">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="adjustment">adjustmentOVERLAP</property>
+ <property name="can-focus">True</property>
<property name="truncate-multiline">True</property>
+ <property name="adjustment">adjustmentOVERLAP</property>
<child internal-child="accessible">
<object class="AtkObject" id="MT_OVERLAP-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_SeriesToAxis|extended_tip|MT_OVERLAP">Defines the necessary settings for overlapping data series.</property>
@@ -172,8 +172,8 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
</object>
@@ -187,11 +187,11 @@
<object class="GtkCheckButton" id="CB_BARS_SIDE_BY_SIDE">
<property name="label" translatable="yes" context="tp_SeriesToAxis|CB_BARS_SIDE_BY_SIDE">Show _bars side by side</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
<property name="halign">start</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="CB_BARS_SIDE_BY_SIDE-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_SeriesToAxis|extended_tip|CB_BARS_SIDE_BY_SIDE">The bars from different data series are shown as if they were attached only to one axis.</property>
@@ -208,11 +208,11 @@
<object class="GtkCheckButton" id="CB_CONNECTOR">
<property name="label" translatable="yes" context="tp_SeriesToAxis|CB_CONNECTOR">Connection lines</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
<property name="halign">start</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="CB_CONNECTOR-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_SeriesToAxis|extended_tip|CB_CONNECTOR">For "stacked" and "percent" column (vertical bar) charts, mark this check box to connect the column layers that belong together with lines.</property>
@@ -230,7 +230,7 @@
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_SeriesToAxis|label2">Settings</property>
<attributes>
<attribute name="weight" value="bold"/>
@@ -247,45 +247,45 @@
<child>
<object class="GtkFrame" id="frameFL_PLOT_OPTIONS">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=2 n-rows=3 -->
<object class="GtkGrid" id="gridPLOT_OPTIONS">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="can-focus">False</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="FT_MISSING_VALUES">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_SeriesToAxis|FT_MISSING_VALUES">Plot missing values</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="RB_DONT_PAINT">
<property name="label" translatable="yes" context="tp_SeriesToAxis|RB_DONT_PAINT">_Leave gap</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
<property name="active">True</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="RB_DONT_PAINT-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_SeriesToAxis|extended_tip|RB_DONT_PAINT">For a missing value, no data will be shown. This is the default for chart types Column, Bar, Line, Net.</property>
@@ -293,18 +293,18 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="RB_ASSUME_ZERO">
<property name="label" translatable="yes" context="tp_SeriesToAxis|RB_ASSUME_ZERO">_Assume zero</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<property name="group">RB_DONT_PAINT</property>
<child internal-child="accessible">
<object class="AtkObject" id="RB_ASSUME_ZERO-atkobject">
@@ -313,18 +313,18 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="RB_CONTINUE_LINE">
<property name="label" translatable="yes" context="tp_SeriesToAxis|RB_CONTINUE_LINE">_Continue line</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<property name="group">RB_DONT_PAINT</property>
<child internal-child="accessible">
<object class="AtkObject" id="RB_CONTINUE_LINE-atkobject">
@@ -333,8 +333,8 @@
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
@@ -354,11 +354,11 @@
<object class="GtkCheckButton" id="CB_INCLUDE_HIDDEN_CELLS">
<property name="label" translatable="yes" context="tp_SeriesToAxis|CB_INCLUDE_HIDDEN_CELLS">Include _values from hidden cells</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
<property name="halign">start</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="CB_INCLUDE_HIDDEN_CELLS-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_SeriesToAxis|extended_tip|CB_INCLUDE_HIDDEN_CELLS">Check to also show values of currently hidden cells within the source cell range.</property>
@@ -376,7 +376,7 @@
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_SeriesToAxis|label3">Plot Options</property>
<property name="xalign">0</property>
<attributes>
@@ -394,24 +394,24 @@
<child>
<object class="GtkFrame" id="frameLegend">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
+ <property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-top">6</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="CB_LEGEND_ENTRY_HIDDEN">
<property name="label" translatable="yes" context="tp_SeriesToAxis|CB_LEGEND_ENTRY_HIDDEN">Hide legend entry</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
<property name="halign">start</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="CB_LEGEND_ENTRY_HIDDEN-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="tp_SeriesToAxis|extended_tip|CB_LEGEND_ENTRY_HIDDEN">Do not show legend entry for the selected data series or data point.</property>
@@ -429,7 +429,7 @@
<child type="label">
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="tp_SeriesToAxis|label4">Legend Entry</property>
<attributes>
<attribute name="weight" value="bold"/>
diff --git a/chart2/uiconfig/ui/tp_Trendline.ui b/chart2/uiconfig/ui/tp_Trendline.ui
index 5698ed56ae83..9a385c7b925b 100644
--- a/chart2/uiconfig/ui/tp_Trendline.ui
+++ b/chart2/uiconfig/ui/tp_Trendline.ui
@@ -449,7 +449,6 @@
<property name="can-focus">True</property>
<property name="activates-default">True</property>
<property name="truncate-multiline">True</property>
- <property name="caps-lock-warning">False</property>
<property name="adjustment">adjustmentForwardBackward</property>
<property name="digits">2</property>
</object>
@@ -577,7 +576,6 @@
<property name="activates-default">True</property>
<property name="text">0</property>
<property name="truncate-multiline">True</property>
- <property name="caps-lock-warning">False</property>
<property name="adjustment">adjustmentForwardBackward2</property>
<property name="digits">2</property>
<accessibility>
diff --git a/chart2/uiconfig/ui/tp_axisLabel.ui b/chart2/uiconfig/ui/tp_axisLabel.ui
index 15dc755d9e6f..93578ff9b4c6 100644
--- a/chart2/uiconfig/ui/tp_axisLabel.ui
+++ b/chart2/uiconfig/ui/tp_axisLabel.ui
@@ -110,7 +110,7 @@
<property name="group">tile</property>
<child internal-child="accessible">
<object class="AtkObject" id="even-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="tp_axisLabel|extended_tip|even">Stagger numbers on the axes, odd numbers lower than even numbers.</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="tp_axisLabel|extended_tip|even">Stagger numbers on the axis, odd numbers lower than even numbers.</property>
</object>
</child>
</object>